Write manual

From ngophatneknha/ai-engineering-hub · View interactive version

Write manual is an AI agent skill from the GitHub repository ngophatneknha/ai-engineering-hub. Writes a long technical manual that explains one subject at one pinned version, from its purpose to each request and response. Every listing comes from an offline capture, every claim traces to a ranked source, and an audit must report TOTAL 0. Use it for "write a manual", "write a 101 manual for <s

How to use this skill

Skill file

Write a manual

A manual explains one subject, such as a protocol, a file format, or a runtime, at one exact version. A lesson teaches a concept and moves on. A manual stays with one system until the reader can predict what it does in a case the manual never showed.

This skill gives the full method. It covers research, ranked sources, and a register of conflicts between sources. It also covers an offline capture kit, a fixed section shape, prose limits, and an audit that must report TOTAL 0. It works in any repository. Inside the AI Engineering from Scratch repo, the tooling already exists, and manuals/a2a-101/ is the worked example.

When to use

When not to use

Size of a 101 manual

| Item | Target |

|---|---|

| pages | 60 to 100 |

| parts | 6 to 8, plus one reference part |

| sections | about 25 |

| figures | 30 to 40 |

| outcomes in manual.json | at least 3 |

| takeaways per section | exactly 1 block, with at least 2 items |

The worked example has 7 parts, 28 sections, 7 reference sections, and 31 figures.

Method

  1. Pin the subject. Record the version, source URL, commit, release date, and verified date.
  2. Rank the sources. List them in authority order: schema or proto, specification, project docs, reference SDK, capture kit.
  3. Vendor what the license allows. Copy each quotable source unchanged into research/sources/, with its license file beside it.
  4. Write the fact brief. Index every rule you will use by section and line number, in research/. See references/research-and-sources.md.
  5. Open the conflict register. Give each disagreement between two sources an id (D1, D2, ...) as you find it.
  6. Build the capture kit. Drive the subject offline and write deterministic files to capture/out/. See references/capture-kit.md.
  7. Plan the contents from the specification. Name each section after one thing the reader can find in the spec.
  8. Write manual.json. Fill the pin, outcomes, palette, ranked sources, quote sources, capture commands, and parts. See references/manual-json.md.
  9. Write the front matter. Title it "How to read this manual" and follow the order in "Front matter" below.
  10. Write one section at a time. Use the section shape below. Cut every listing from a capture file.
  11. Draw each figure from a capture. Follow the figure must-haves below and the sibling blueprint-figure skill.
  12. Build and audit. Fix every finding until the audit prints TOTAL 0. See references/audit.md.
  13. Size commits by judgment. A section with its figures and the captures it adds is a good unit.

Plan the contents from the specification

Build the table of contents from the names the specification uses, then decide what each part proves.

Each section title names one object, operation, binding, header, error, or extension from the specification. "CancelTask and terminal states" is a good title. "State machines" is not, because no specification defines an object with that name. Put a general idea in the section about the object that has it.

Front matter

front.md covers these topics, in this order:

  1. Who the manual is for, and what they can do after it.
  2. How it was made, with the ranked sources table.
  3. The capture kit.
  4. The conventions: citation forms, listing cuts, and id shortening.
  5. A first run that the reader can do offline.
  6. How the parts are ordered, as an empty parts block.
  7. Colour in figures, as an empty palette block.
  8. Figure 0.1, which teaches the arrow and colour grammar of this manual.

Section shape

Every section file follows this order. Reference sections and the front matter need a thesis and a sources line, but no outcome sentence and no takeaways.

  1. # Title, with the name the specification uses.
  2. > Thesis, directly under the title: one sentence of at most 30 words, the claim the section proves.
  3. An opening paragraph that starts from a concrete situation the reader has been in.
  4. The sentence "When you finish this section, you can ..." inside the first two paragraphs.
  5. The body: ## subsections, definitions that start with **Term:**, figures, listings, rules, and tables.
  6. Exactly one takeaways block, with two or more actions.
  7. A last paragraph that starts with Sources: and names every file the section was written from.

A complete template is in references/section-template.md.

Fenced block kinds

| Fence | Holds | Required keys |

|---|---|---|

| figure | one figure, by id | id, kind, title, claim, caption |

| listing | lines cut from one capture file | title, source, lang, optional note, then --- and the lines |

| rule | one quote, checked word for word | label, source, then --- and the quote |

| takeaways | the actions for the section | two or more - item lines |

| parts, palette, figure-index, contents | generated tables | no body |

Every other fence needs a language tag. A json, jsonl, http, or sse fence must be a listing instead.

Markdown subset

Use only these constructs, so every edition renders the same way:

Raw HTML, horizontal rules, nested lists, #### headings, and other quote blocks fail the build. Section anchors are s- plus the id with dots as hyphens, such as s-1-4 or s-r-2.

Listings

Sources, quotes, and conflicts

Prose limits

| Limit | Value |

|---|---|

| words in a sentence | at most 25 |

| words in a thesis | at most 30, one sentence |

| words in a figure claim | at most 28, one sentence ending with a period |

| words in a takeaway | at most 20, an instruction in imperative mood |

| sentences in a paragraph | at most 6 |

Write in the second person, about the mechanism. Define a term once, use it the same way everywhere, and add it to the glossary. Quotes, code, and citations are exempt from the limits.

Use no semicolons, no contractions, and no em or en dashes. Never write the word may. Use "can", or state the condition. Avoid the banned words in references/prose-rules.md.

Figure must-haves

Use the sibling blueprint-figure skill to draw the figures. Every figure in a manual must also meet these rules:

| Arrow style | Means |

|---|---|

| solid ink | a call or request |

| dashed ink | a reply |

| solid teal | a durable write |

| dashed amber | a state change |

| solid plum | a model call or compute |

| dashed olive | an effect outside the system |

| dotted indigo | a stream or an event |

| dashed rose | a failure |

Build and audit

Inside the AI Engineering from Scratch repo, run these from the repository root:

node --test site/test_manuals.js
node site/build-manuals.js
node manuals/_shared/figkit.js build manuals/<id>
node scripts/audit_manuals.js --manual <id>

Outside the repo, build your own audit from references/audit.md. It lists each check, so you can write it as one script. Fix the text, never the limit. A manual does not merge until the audit prints TOTAL 0.

Commit rules

Check before you finish

Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.