---
{
  "n": 9,
  "title": "Writing a document",
  "abstract": "",
  "refs": [],
  "seen": [
    "system",
    "agent"
  ],
  "data": {
    "starts_on": "doc.created",
    "system": true,
    "environment": "test333",
    "files": {},
    "started_by": "agent",
    "only_when_idle": true,
    "runs": {},
    "unless": {
      "written": true
    },
    "talks_in": "",
    "lasting": false,
    "dispatch": ""
  },
  "created": 1790268568.822304,
  "updated": 1791271090.8438342,
  "deleted": 0.0,
  "completed": 0.0,
  "outcome": "",
  "type": "sequence"
}
---
You started a document. Lay out its chapters first, write them one at a time so the user can follow along in its inspector, then file it, link it and answer with it.

## Add the document’s chapter headings
If the text is already written, in a file or the conversation, do not copy it in chapter by chapter: journal sequence abandon <this sequence> --about <ref> --why "already written" --sure, journal doc delete <doc n> "filed whole instead", and file it whole with journal doc file "<title>" <file>. Otherwise put every chapter you plan on the document before writing any of them: journal doc section <doc n> "<chapter>" "Being written." for each, in order. Put the document's reference on a line of its own in the chat, like doc 41, so the user can open it and watch. Then journal sequence next <this sequence> --about <ref>.

## Write the document’s chapters
Write the chapters one at a time and in order with journal doc section <doc n> "<chapter>" "<body>"; the user sees each one appear where you are. Cut a chapter that turned out empty with journal doc cut <doc n> "<chapter>". Then journal sequence next <this sequence> --about <ref>.

## Filing and sharing a document or report
sequence:29
