Docs as you go
The user builds by prompting, one idea at a time. They usually know what they
want, both the requirements and the technical approach, and they make decisions
in conversation. This skill makes sure every one of those decisions ends up in
the repo, in a fixed docs structure, in the same step it was made.
Two reasons this matters:
- Conversations get lost. Context runs out, gets summarised or the session
ends. Anything that exists only in the chat is gone. The docs are the memory.
- The next session starts cold. A new session, a different agent or another
developer should be able to continue from the repo alone.
The skill is agent-neutral. It needs only reading and writing files, running the
project's own commands, and git. Nothing here depends on a particular model,
agent, harness or language.
Contents
Starting
Start only when the user asks. Then:
- Look before writing. Read the README, any existing
docs/ and
AGENTS.md, and the build or package files to learn the language and the
commands. Check whether it's a git repo.
- Existing docs win. If the repo already has docs in another shape, say so
and ask whether to adopt this structure or fit into theirs. Never restructure
without a yes.
- Write files in your first reply. Always create
AGENTS.md and
docs/README.md from what the user has said so far, however little that is.
Questions don't come first: write the files, put what you still need to know
in Open threads, and ask at the end of the reply.
- Create only what there's content for. Beyond those two, files appear when
their trigger is hit (see When to write what). An empty
repo with one sentence of intent gets a two-line
AGENTS.md, not ten empty
files. Indexes follow the same rule: a table, row, list entry or link appears
only once the file it points to exists. That includes the links under "What
this is" in AGENTS.md. Never write a placeholder link or a "pending" note.
- Other instruction files point here. If the agent in use reads a
differently named instruction file, make that file refer to
AGENTS.md
instead of copying its content, so there's one set of rules.
- State the working agreement in your first reply, in a few lines, even
when the user asked for something else too: docs are updated every step, work
goes one step at a time, each step stops for review, commits only on request.
Then continue with whatever the user asked for.
Templates for every file are in reference/templates.md.
Resuming
At the start of every new session, and whenever earlier conversation may have
been summarised or lost, before doing anything else:
Read AGENTS.md, then docs/README.md.
Read spec.md and tasks.md for every feature not marked Done.
Read the Open threads in AGENTS.md.
Say back, without being asked, even when some of it doesn't seem to matter
for the next step:
- each Accepted ADR's decision and why, one line each (the language, storage
and so on);
- each entry in "Things that will bite you", by name;
- what's parked;
- the tasks left in any unfinished feature.
Then wait for the go-ahead.
Trust the docs over what you think you remember from the conversation. If they
disagree with what the user is now asking, point out the difference and ask.
The docs
AGENTS.md rules and gotchas for anyone (or any agent) working here
docs/
README.md index: reading order, ADR table, feature table
product.md the problem, who it's for, goals and non-goals
architecture/overview.md the parts and how data moves between them
adr/NNNN-short-title.md one file per significant decision
features/NNN-name/
spec.md what and why: problem, stories, requirements, acceptance
plan.md how: approach, modules or files, order
tasks.md small checkable steps
development.md running, checks, local data, dependencies, workarounds
proposals/ drafts for other projects (feature requests upstream)
Numbers are zero-padded and never reused: ADRs 0001, features 001.
When to write what
| Trigger in the conversation |
Write |
| The user explains what the project is, who it's for or what it won't do |
docs/product.md, and "What this is" in AGENTS.md |
| A choice between real alternatives is made (see below) |
A new ADR, and a row in the docs/README.md table |
| A feature is agreed, before its code |
features/NNN-name/spec.md, plan.md, tasks.md, table row |
| Two or more parts start to talk to each other, or data gets a shape |
docs/architecture/overview.md |
| Commands to run, check, test or build settle |
"Commands" in AGENTS.md; details in docs/development.md |
| A rule is set ("always…", "never…") |
"Rules" in AGENTS.md; an ADR if it needed weighing up |
| Something surprising breaks and gets worked around |
"Things that will bite you" in AGENTS.md |
| The user parks something ("later", "park it", "not now") |
"Open threads" in AGENTS.md, with enough to resume it |
| An idea needs another project to change |
A draft in docs/proposals/; the user posts it |
| A task in a feature is finished and verified |
Tick it in that feature's tasks.md |
| A feature's spec is written |
Its row in the docs/README.md table says In progress |
| A feature's last task is ticked |
Its status in the docs/README.md table becomes Done |
| A bug is fixed |
A test that fails without the fix; a gotcha if it could recur |
| The user reverses an earlier decision |
A superseding ADR, and every doc that mentions the old choice |
Update the index tables in docs/README.md in the same step as the file they
list.
Nothing lives only in the chat
This is the rule the skill exists for.
- Every step ends with a docs pass. Before reporting a step as done, update
every doc the step affected, and check that every link in those docs resolves.
Docs-only steps included. Code and its docs are one change.
- Decisions are written when they're made, not at the end of the feature.
- Before anything long (a big refactor, a long run, a research dive), write
down where things stand: tick tasks, add open questions to
tasks.md or Open
threads.
- When the conversation is getting long, or the agent shows any sign that
earlier context is being summarised, do a docs pass straight away, even
mid-step, and say so.
- The test: if this conversation disappeared right now, could a fresh session
continue from the repo alone, without asking the user to repeat themselves? If
not, something is still only in the chat. Write it down.
Chat-only details that matter and have no home yet (a half-agreed idea, a
question the user hasn't answered) go in Open threads, marked as such.
Noticing decisions
Watch for decisions the user doesn't announce as decisions. Signs:
- They pick one of the options you offered.
- They reject an approach ("no, don't use X", "keep it simple").
- They set a constraint ("no cloud", "exact versions only", "never npm").
- Something was tried and dropped for a reason.
- A library, service, storage or file format is chosen.
- They change their mind about an earlier decision.
Write an ADR when someone could reasonably have chosen differently. Record the
options that were on the table and why the chosen one won, in the user's
reasoning where they gave it. Mention it in the step report ("recorded as ADR
0007"). A small preference that needed no weighing up goes into Rules in
AGENTS.md instead. When unsure whether it's worth an ADR, ask in one line.
Every ADR has a status:
- Proposed: a setup or approach you recommend where the user has to pick
something, such as the test runner. Say so in the step report. A decision the
user hasn't made yet is not an ADR at all: it waits in Open threads until they
choose, so the ADR records their reasons rather than yours.
- Accepted: the user agreed. Most ADRs are written straight as Accepted,
because the decision was made in the conversation.
- Rejected: a Proposed ADR the user turned down. Delete it instead, unless
the reasons are worth remembering.
- Superseded by NNNN: a later ADR replaced it.
Once an ADR is Accepted, never edit its decision. When the user changes their
mind, write a new ADR that supersedes it: its Context names the old ADR and what
changed. In the old ADR, change only the status line. In the docs/README.md
table, add "(superseded by NNNN)" to the old row and add the new one. Fixing a
typo or a broken link is fine; changing what was decided is not.
Then clean up everything else. Search every doc outside docs/adr/ for the old
choice: its name, file names, commands and formats. That includes the spec, plan
and tasks of features finished long ago. Rewrite each mention to describe the new
choice, in the present tense.
How the docs are written
- The templates list every heading; files only hold the ones with content.
Create a doc with just the sections there's something real to say about. When
new content arrives, add its section in the template's order. No "TBD", no
empty headings, no placeholder text.
- Docs read as if written before the build. Present tense, describing what
the project does and why. No "we first tried…", "update:", dated change notes
or "how it went" sections. History lives in git and ADRs. (ADR Context sections
are the exception: they explain the situation at the time.) A spec's Problem
says what's missing, in the present tense ("there's no way to…"), not how the
code used to behave.
- Everything outside the ADRs describes the project as it is now. That
includes finished features' spec, plan and tasks. When something changes, they
change with it.
- Plain words, short sentences. Explain why, not just what. Name files and
commands exactly.
AGENTS.md stays short. It holds rules, commands, a repo map, gotchas and
open threads, and links into docs/ for the long explanations. Its Status line
says what the project is as a whole ("in development", "feature complete, not
released"), never how far the build has got and never a date. Progress lives in
the feature table.
- A new feature's spec, plan and tasks are their own step. When a feature is
agreed, write them from what the user said, then stop for review before writing
any code. Only when the user says to build straight away ("no need to show me
the spec", "just build it") write the docs and the code in one step, still in
that order: spec, plan and tasks first, then the code.
- Tasks are ticked when verified: after an automated check passes, or after a
manual check the user agreed to. Never just because the code is written.
- Keep the user's words for decisions. If they gave a reason, use it.
Working in steps
One step at a time. A step is one request from the user: finish all of
it, then stop. "Carry on" on a feature whose plan is approved means the whole
feature, not just the next task; stop early only for a real question. When a
request is big, say the steps before starting (for a feature, its plan's Order
is that list), and suggest splitting it so each part makes sense as one commit.
Tests. If the project has no automated tests yet, don't pick a setup
silently, and never decide on your own that it doesn't need tests. Write the
setup you recommend (the language's built-in test runner where there is one)
as an ADR marked Proposed, and flag it in that step's report. It becomes
Accepted when the user goes ahead. Every bug fix starts with a test: run it,
see it fail, then fix.
Verify with the project's own checks. Formatting, linting, tests and build,
whatever the project uses. For anything visible, look at it (run it, take a
screenshot if you can). Check that links in changed docs resolve.
Stop and report at the end of each step, in three short parts:
- Changed: code and docs touched.
- Checked: what was verified, and what wasn't and why.
- Next: the next step, and any question for the user.
Then offer a review and a commit, and wait. Don't start the next step until the
user says so. "Carry on", "continue", "next" and "looks good" are a go-ahead
for the next step, never a request to commit.
Offer options with a recommendation when there's a real choice. Don't pick
silently, and don't list options without saying which you'd take.
Ask when something is genuinely unclear rather than guessing.
Spikes before building. When an approach is uncertain, try it in a
throwaway location first. Spike code is never committed; what it showed goes in
the plan or an ADR.
Temporary files go outside the repo or are deleted before the step ends.
Match the surrounding code: its naming, comment density and idioms.
Commits
Only commit when the user explicitly asks for a commit ("commit", "commit it",
"make a commit"). When they do:
- Look at what's changed first. Stage everything except an agent's own
folders (its local settings or skills), which stay out unless the user says
otherwise. If anything else looks like it shouldn't be committed (secrets,
large binaries, data or build output), leave it out and ask. Say in your
report what was left out and why.
- Write a Conventional Commits message. A one-line subject:
type: summary or type(scope): summary, imperative, lowercase start, no
full stop, about 72 characters at most. Types: feat, fix, docs,
refactor, test, chore, build, ci, perf, style.
- Several separate changes get bullets. After a blank line, one short bullet
per change. A single change needs only the subject.
- No attribution. Never end with
Co-authored-by, "Generated with", or any
line crediting an AI, agent or tool, even if the agent in use adds one by
default.
- Docs go in the same commit as the code they describe.
- Never push, amend, rebase or force-push unless the user asks.
fix: keep the filter panel open after saving
feat: add CSV export for reports
- export button on the report screen
- dates and numbers written in the user's locale
- docs: feature 004 spec and plan, ADR 0006 for the CSV library
Stopping
When the user says they're done for now, or the session is ending:
- Do a final docs pass: tasks ticked, feature statuses right, Open threads
current, including anything half-discussed.
- Report what's uncommitted, if anything, and offer a commit.
1---2name: docs-as-you-go3description: Write and maintain a project's docs folder (product, architecture, decision records, feature spec/plan/tasks, development notes) and an AGENTS.md step by step while the project is being built prompt by prompt, so decisions and requirements live in the repo instead of only in the conversation. Also works in small reviewed steps and makes conventional commits on request. Use only when someone explicitly asks for it, e.g. "start docs-as-you-go", "document this as we build", "resume docs-as-you-go"; never start it on your own.4---56# Docs as you go78The user builds by prompting, one idea at a time. They usually know what they9want, both the requirements and the technical approach, and they make decisions10in conversation. This skill makes sure every one of those decisions ends up in11the repo, in a fixed docs structure, **in the same step it was made**.1213Two reasons this matters:1415- **Conversations get lost.** Context runs out, gets summarised or the session16 ends. Anything that exists only in the chat is gone. The docs are the memory.17- **The next session starts cold.** A new session, a different agent or another18 developer should be able to continue from the repo alone.1920The skill is agent-neutral. It needs only reading and writing files, running the21project's own commands, and git. Nothing here depends on a particular model,22agent, harness or language.2324## Contents2526- [Starting](#starting)27- [Resuming](#resuming)28- [The docs](#the-docs)29- [When to write what](#when-to-write-what)30- [Nothing lives only in the chat](#nothing-lives-only-in-the-chat)31- [Noticing decisions](#noticing-decisions)32- [How the docs are written](#how-the-docs-are-written)33- [Working in steps](#working-in-steps)34- [Commits](#commits)35- [Stopping](#stopping)3637## Starting3839Start only when the user asks. Then:40411. **Look before writing.** Read the README, any existing `docs/` and42 `AGENTS.md`, and the build or package files to learn the language and the43 commands. Check whether it's a git repo.442. **Existing docs win.** If the repo already has docs in another shape, say so45 and ask whether to adopt this structure or fit into theirs. Never restructure46 without a yes.473. **Write files in your first reply.** Always create `AGENTS.md` and48 `docs/README.md` from what the user has said so far, however little that is.49 Questions don't come first: write the files, put what you still need to know50 in Open threads, and ask at the end of the reply.514. **Create only what there's content for.** Beyond those two, files appear when52 their trigger is hit (see [When to write what](#when-to-write-what)). An empty53 repo with one sentence of intent gets a two-line `AGENTS.md`, not ten empty54 files. Indexes follow the same rule: a table, row, list entry or link appears55 only once the file it points to exists. That includes the links under "What56 this is" in `AGENTS.md`. Never write a placeholder link or a "pending" note.575. **Other instruction files point here.** If the agent in use reads a58 differently named instruction file, make that file refer to `AGENTS.md`59 instead of copying its content, so there's one set of rules.606. **State the working agreement** in your first reply, in a few lines, even61 when the user asked for something else too: docs are updated every step, work62 goes one step at a time, each step stops for review, commits only on request.63 Then continue with whatever the user asked for.6465Templates for every file are in [reference/templates.md](reference/templates.md).6667## Resuming6869At the start of every new session, and whenever earlier conversation may have70been summarised or lost, before doing anything else:71721. Read `AGENTS.md`, then `docs/README.md`.732. Read `spec.md` and `tasks.md` for every feature not marked Done.743. Read the Open threads in `AGENTS.md`.754. Say back, without being asked, even when some of it doesn't seem to matter76 for the next step:77 - each Accepted ADR's decision and why, one line each (the language, storage78 and so on);79 - each entry in "Things that will bite you", by name;80 - what's parked;81 - the tasks left in any unfinished feature.8283 Then wait for the go-ahead.8485Trust the docs over what you think you remember from the conversation. If they86disagree with what the user is now asking, point out the difference and ask.8788## The docs8990```91AGENTS.md rules and gotchas for anyone (or any agent) working here92docs/93 README.md index: reading order, ADR table, feature table94 product.md the problem, who it's for, goals and non-goals95 architecture/overview.md the parts and how data moves between them96 adr/NNNN-short-title.md one file per significant decision97 features/NNN-name/98 spec.md what and why: problem, stories, requirements, acceptance99 plan.md how: approach, modules or files, order100 tasks.md small checkable steps101 development.md running, checks, local data, dependencies, workarounds102 proposals/ drafts for other projects (feature requests upstream)103```104105Numbers are zero-padded and never reused: ADRs `0001`, features `001`.106107## When to write what108109| Trigger in the conversation | Write |110| ----------------------------------------------------------------------- | ------------------------------------------------------------ |111| The user explains what the project is, who it's for or what it won't do | `docs/product.md`, and "What this is" in `AGENTS.md` |112| A choice between real alternatives is made (see below) | A new ADR, and a row in the `docs/README.md` table |113| A feature is agreed, before its code | `features/NNN-name/spec.md`, `plan.md`, `tasks.md`, table row |114| Two or more parts start to talk to each other, or data gets a shape | `docs/architecture/overview.md` |115| Commands to run, check, test or build settle | "Commands" in `AGENTS.md`; details in `docs/development.md` |116| A rule is set ("always…", "never…") | "Rules" in `AGENTS.md`; an ADR if it needed weighing up |117| Something surprising breaks and gets worked around | "Things that will bite you" in `AGENTS.md` |118| The user parks something ("later", "park it", "not now") | "Open threads" in `AGENTS.md`, with enough to resume it |119| An idea needs another project to change | A draft in `docs/proposals/`; the user posts it |120| A task in a feature is finished and verified | Tick it in that feature's `tasks.md` |121| A feature's spec is written | Its row in the `docs/README.md` table says In progress |122| A feature's last task is ticked | Its status in the `docs/README.md` table becomes Done |123| A bug is fixed | A test that fails without the fix; a gotcha if it could recur |124| The user reverses an earlier decision | A superseding ADR, and every doc that mentions the old choice |125126Update the index tables in `docs/README.md` in the same step as the file they127list.128129## Nothing lives only in the chat130131This is the rule the skill exists for.132133- **Every step ends with a docs pass.** Before reporting a step as done, update134 every doc the step affected, and check that every link in those docs resolves.135 Docs-only steps included. Code and its docs are one change.136- **Decisions are written when they're made,** not at the end of the feature.137- **Before anything long** (a big refactor, a long run, a research dive), write138 down where things stand: tick tasks, add open questions to `tasks.md` or Open139 threads.140- **When the conversation is getting long,** or the agent shows any sign that141 earlier context is being summarised, do a docs pass straight away, even142 mid-step, and say so.143- **The test:** if this conversation disappeared right now, could a fresh session144 continue from the repo alone, without asking the user to repeat themselves? If145 not, something is still only in the chat. Write it down.146147Chat-only details that matter and have no home yet (a half-agreed idea, a148question the user hasn't answered) go in Open threads, marked as such.149150## Noticing decisions151152Watch for decisions the user doesn't announce as decisions. Signs:153154- They pick one of the options you offered.155- They reject an approach ("no, don't use X", "keep it simple").156- They set a constraint ("no cloud", "exact versions only", "never npm").157- Something was tried and dropped for a reason.158- A library, service, storage or file format is chosen.159- They change their mind about an earlier decision.160161Write an ADR when someone could reasonably have chosen differently. Record the162options that were on the table and why the chosen one won, in the user's163reasoning where they gave it. Mention it in the step report ("recorded as ADR1640007"). A small preference that needed no weighing up goes into Rules in165`AGENTS.md` instead. When unsure whether it's worth an ADR, ask in one line.166167Every ADR has a status:168169- **Proposed:** a setup or approach you recommend where the user has to pick170 something, such as the test runner. Say so in the step report. A decision the171 user hasn't made yet is not an ADR at all: it waits in Open threads until they172 choose, so the ADR records their reasons rather than yours.173- **Accepted:** the user agreed. Most ADRs are written straight as Accepted,174 because the decision was made in the conversation.175- **Rejected:** a Proposed ADR the user turned down. Delete it instead, unless176 the reasons are worth remembering.177- **Superseded by NNNN:** a later ADR replaced it.178179Once an ADR is Accepted, never edit its decision. When the user changes their180mind, write a new ADR that supersedes it: its Context names the old ADR and what181changed. In the old ADR, change only the status line. In the `docs/README.md`182table, add "(superseded by NNNN)" to the old row and add the new one. Fixing a183typo or a broken link is fine; changing what was decided is not.184185Then clean up everything else. Search every doc outside `docs/adr/` for the old186choice: its name, file names, commands and formats. That includes the spec, plan187and tasks of features finished long ago. Rewrite each mention to describe the new188choice, in the present tense.189190## How the docs are written191192- **The templates list every heading; files only hold the ones with content.**193 Create a doc with just the sections there's something real to say about. When194 new content arrives, add its section in the template's order. No "TBD", no195 empty headings, no placeholder text.196- **Docs read as if written before the build.** Present tense, describing what197 the project does and why. No "we first tried…", "update:", dated change notes198 or "how it went" sections. History lives in git and ADRs. (ADR Context sections199 are the exception: they explain the situation at the time.) A spec's Problem200 says what's missing, in the present tense ("there's no way to…"), not how the201 code used to behave.202- **Everything outside the ADRs describes the project as it is now.** That203 includes finished features' spec, plan and tasks. When something changes, they204 change with it.205- **Plain words, short sentences.** Explain why, not just what. Name files and206 commands exactly.207- **`AGENTS.md` stays short.** It holds rules, commands, a repo map, gotchas and208 open threads, and links into `docs/` for the long explanations. Its Status line209 says what the project is as a whole ("in development", "feature complete, not210 released"), never how far the build has got and never a date. Progress lives in211 the feature table.212- **A new feature's spec, plan and tasks are their own step.** When a feature is213 agreed, write them from what the user said, then stop for review before writing214 any code. Only when the user says to build straight away ("no need to show me215 the spec", "just build it") write the docs and the code in one step, still in216 that order: spec, plan and tasks first, then the code.217- **Tasks are ticked when verified:** after an automated check passes, or after a218 manual check the user agreed to. Never just because the code is written.219- **Keep the user's words for decisions.** If they gave a reason, use it.220221## Working in steps222223- **One step at a time.** A step is one request from the user: finish all of224 it, then stop. "Carry on" on a feature whose plan is approved means the whole225 feature, not just the next task; stop early only for a real question. When a226 request is big, say the steps before starting (for a feature, its plan's Order227 is that list), and suggest splitting it so each part makes sense as one commit.228- **Tests.** If the project has no automated tests yet, don't pick a setup229 silently, and never decide on your own that it doesn't need tests. Write the230 setup you recommend (the language's built-in test runner where there is one)231 as an ADR marked Proposed, and flag it in that step's report. It becomes232 Accepted when the user goes ahead. Every bug fix starts with a test: run it,233 see it fail, then fix.234- **Verify with the project's own checks.** Formatting, linting, tests and build,235 whatever the project uses. For anything visible, look at it (run it, take a236 screenshot if you can). Check that links in changed docs resolve.237- **Stop and report** at the end of each step, in three short parts:238 - **Changed:** code and docs touched.239 - **Checked:** what was verified, and what wasn't and why.240 - **Next:** the next step, and any question for the user.241242 Then offer a review and a commit, and wait. Don't start the next step until the243 user says so. "Carry on", "continue", "next" and "looks good" are a go-ahead244 for the next step, never a request to commit.245- **Offer options with a recommendation** when there's a real choice. Don't pick246 silently, and don't list options without saying which you'd take.247- **Ask when something is genuinely unclear** rather than guessing.248- **Spikes before building.** When an approach is uncertain, try it in a249 throwaway location first. Spike code is never committed; what it showed goes in250 the plan or an ADR.251- **Temporary files** go outside the repo or are deleted before the step ends.252- **Match the surrounding code:** its naming, comment density and idioms.253254## Commits255256Only commit when the user explicitly asks for a commit ("commit", "commit it",257"make a commit"). When they do:2582591. **Look at what's changed first.** Stage everything except an agent's own260 folders (its local settings or skills), which stay out unless the user says261 otherwise. If anything else looks like it shouldn't be committed (secrets,262 large binaries, data or build output), leave it out and ask. Say in your263 report what was left out and why.2642. **Write a Conventional Commits message.** A one-line subject:265 `type: summary` or `type(scope): summary`, imperative, lowercase start, no266 full stop, about 72 characters at most. Types: `feat`, `fix`, `docs`,267 `refactor`, `test`, `chore`, `build`, `ci`, `perf`, `style`.2683. **Several separate changes get bullets.** After a blank line, one short bullet269 per change. A single change needs only the subject.2704. **No attribution.** Never end with `Co-authored-by`, "Generated with", or any271 line crediting an AI, agent or tool, even if the agent in use adds one by272 default.2735. **Docs go in the same commit** as the code they describe.2746. **Never push, amend, rebase or force-push** unless the user asks.275276```277fix: keep the filter panel open after saving278```279280```281feat: add CSV export for reports282283- export button on the report screen284- dates and numbers written in the user's locale285- docs: feature 004 spec and plan, ADR 0006 for the CSV library286```287288## Stopping289290When the user says they're done for now, or the session is ending:2912921. Do a final docs pass: tasks ticked, feature statuses right, Open threads293 current, including anything half-discussed.2942. Report what's uncommitted, if anything, and offer a commit.