workbook-statelisted
Install: claude install-skill un-seen/hedwigai-skills
# Keep state in a workbook
A hedwigai workbook is one document: tabs of markdown, or an Excel or Word file. It is the place to keep state that has to survive this session or be read by someone else, because:
- **Every write is a new version.** The one before is kept, and `write_workbook` with `restore_version` brings it back.
- **A stale write is refused.** `write_workbook` takes the `base_version` you read. If someone (a person in Excel, another agent, a run) wrote since, your write is refused rather than merged over theirs: read again and redo the change.
- **A schema guards the tables.** A workbook can carry a schema (`read_workbook` with `schema: true`): each table's columns, types, required cells, keys and references. An edit that breaks it is refused with a `SchemaError` per cell, so a tracker cannot drift into a shape the next reader does not expect.
- **The file can stay where the user keeps it.** `link_workbook` makes a file in Google Drive or Dropbox the record: work starts from the file as it stands, and each new version is written back to the same file, its sharing and history kept.
Edit a workbook the way you edit code: its tabs are markdown and its schema is text, every write is compiled against the schema, and a `SchemaError` names each cell that broke it, the way a compiler names a line. Fix those cells and write again; `read_workbook` returns the compiled current version. For a spreadsheet or Word file, `checkout_workbook` puts it in the `bash` shell to ed