To Docs
Turn recent work into durable guidance without treating the session as a changelog.
A procedure that applies across repositories belongs in a reusable skill. Report it as outside this workflow’s scope rather than documenting it as a project rule.
Scope both phases to project guidance outside docs/adr/. Exclude that directory and all its contents from discovery, reading, decision analysis, and documentation changes, including reconciliation and cross-reference updates. Guidance recorded only there does not count as already covered.
Phase 1: Propose
Do not edit project documentation during this phase.
- Read the repository instructions and the existing documents that could own the guidance. Distinguish committed guidance from uncommitted documentation drafts; do not treat a draft as approved policy merely because it exists in the worktree.
- Use the conversation or user-specified work as the authoritative scope. Reconstruct its material decisions from the discussion, relevant code, and focused diffs. Include implicit decisions revealed by rejected alternatives or later corrections. Treat unrelated dirty-worktree changes as out of scope, and use diffs as evidence rather than as a backlog of decisions to document.
- Evaluate each decision instead of merely classifying it. Ask:
- Would this guide work on another resource or page?
- Does it express an intended invariant rather than describe the current implementation?
- Would a future coding agent make a materially better choice by knowing it?
- Can its scope, exceptions, and failure cases be stated clearly?
- Is it supported by repeated use or strong design reasoning rather than one accidental example?
- Is it already documented adequately?
- Does it contradict existing guidance, lint rules, tests, or shared modules?
- Test candidate rules against counterexamples. Reject or narrow rules that become semantically wrong outside the original case.
- Classify each material decision as one of:
- Document: durable, general guidance.
- Refine existing guidance: already present but incomplete, misleading, or contradicted by the new decision.
- Already covered: requires no documentation change.
- Keep local: resource, route, copy, naming, or implementation detail.
- Defer: plausible pattern without enough evidence to make it a project rule.
- Present only the meaningful results. For every proposed documentation change include:
- the generalized rule;
- why it deserves project-wide status;
- its scope and exceptions;
- the document that should own it;
- contradictions or related enforcement that must be updated with it.
- Explicitly list important decisions rejected from project documentation and explain why.
- End by requesting approval of the proposal. Do not edit documentation until the user explicitly approves it.
If the decision history is unavailable or the requested scope cannot be separated reliably from unrelated work, state that limitation and ask for the missing fixed point or decision context instead of inferring policy from the whole worktree.
Prefer modifying an existing authoritative document over creating a new one. Avoid duplicating the same rule across documents; put the complete rule in one owner and use short cross-references elsewhere.
Phase 2: Apply after approval
After explicit approval:
- Use /writing-for-agents and apply its writing discipline throughout this
phase. If it is unavailable, stop and ask the user to install it with
npx skills@latest add mattpocock/skills --skill writing-for-agents.
- Re-read every affected document before editing it.
- Apply only the approved rules and preserve the repository's terminology and language requirements.
- Reconcile the in-scope documentation set: remove obsolete guidance, resolve contradictions, and update cross-references.
- Update enforcement when the documented policy is mechanically checked, such as lint configuration, shared modules, or tests. Do not leave documentation and enforcement disagreeing.
- Keep resource-specific examples illustrative; do not turn their names, routes, fields, or query parameters into universal policy.
- Run checks proportional to the changed documentation and enforcement. Report checks not run.
- Summarize the durable rules written, their owning documents, and any approved follow-up work still needed in code.
Quality bar
A useful guideline tells a future agent what to choose, why, where it applies, and when not to apply it. Reject rules that only restate the final code, encode personal preference without a project invariant, or prescribe a mechanism where a semantic rule would age better.
1---2name: to-docs3description: Analyze decisions made during implementation, review, or design work and distinguish project-wide guidance from route-specific fixes, already-documented rules, and premature patterns. Use when the user asks which lessons or decisions deserve inclusion in project documentation, wants to review proposed guidelines before approving documentation changes, or asks to update project guidance from recent work.4---56# To Docs78Turn recent work into durable guidance without treating the session as a changelog.910A procedure that applies across repositories belongs in a reusable skill. Report it as outside this workflow’s scope rather than documenting it as a project rule.1112Scope both phases to project guidance outside `docs/adr/`. Exclude that directory and all its contents from discovery, reading, decision analysis, and documentation changes, including reconciliation and cross-reference updates. Guidance recorded only there does not count as already covered.1314## Phase 1: Propose1516Do not edit project documentation during this phase.17181. Read the repository instructions and the existing documents that could own the guidance. Distinguish committed guidance from uncommitted documentation drafts; do not treat a draft as approved policy merely because it exists in the worktree.192. Use the conversation or user-specified work as the authoritative scope. Reconstruct its material decisions from the discussion, relevant code, and focused diffs. Include implicit decisions revealed by rejected alternatives or later corrections. Treat unrelated dirty-worktree changes as out of scope, and use diffs as evidence rather than as a backlog of decisions to document.203. Evaluate each decision instead of merely classifying it. Ask:21 - Would this guide work on another resource or page?22 - Does it express an intended invariant rather than describe the current implementation?23 - Would a future coding agent make a materially better choice by knowing it?24 - Can its scope, exceptions, and failure cases be stated clearly?25 - Is it supported by repeated use or strong design reasoning rather than one accidental example?26 - Is it already documented adequately?27 - Does it contradict existing guidance, lint rules, tests, or shared modules?284. Test candidate rules against counterexamples. Reject or narrow rules that become semantically wrong outside the original case.295. Classify each material decision as one of:30 - **Document**: durable, general guidance.31 - **Refine existing guidance**: already present but incomplete, misleading, or contradicted by the new decision.32 - **Already covered**: requires no documentation change.33 - **Keep local**: resource, route, copy, naming, or implementation detail.34 - **Defer**: plausible pattern without enough evidence to make it a project rule.356. Present only the meaningful results. For every proposed documentation change include:36 - the generalized rule;37 - why it deserves project-wide status;38 - its scope and exceptions;39 - the document that should own it;40 - contradictions or related enforcement that must be updated with it.417. Explicitly list important decisions rejected from project documentation and explain why.428. End by requesting approval of the proposal. Do not edit documentation until the user explicitly approves it.4344If the decision history is unavailable or the requested scope cannot be separated reliably from unrelated work, state that limitation and ask for the missing fixed point or decision context instead of inferring policy from the whole worktree.4546Prefer modifying an existing authoritative document over creating a new one. Avoid duplicating the same rule across documents; put the complete rule in one owner and use short cross-references elsewhere.4748## Phase 2: Apply after approval4950After explicit approval:51521. Use /writing-for-agents and apply its writing discipline throughout this53 phase. If it is unavailable, stop and ask the user to install it with54 `npx skills@latest add mattpocock/skills --skill writing-for-agents`.552. Re-read every affected document before editing it.563. Apply only the approved rules and preserve the repository's terminology and language requirements.574. Reconcile the in-scope documentation set: remove obsolete guidance, resolve contradictions, and update cross-references.585. Update enforcement when the documented policy is mechanically checked, such as lint configuration, shared modules, or tests. Do not leave documentation and enforcement disagreeing.596. Keep resource-specific examples illustrative; do not turn their names, routes, fields, or query parameters into universal policy.607. Run checks proportional to the changed documentation and enforcement. Report checks not run.618. Summarize the durable rules written, their owning documents, and any approved follow-up work still needed in code.6263## Quality bar6465A useful guideline tells a future agent what to choose, why, where it applies, and when not to apply it. Reject rules that only restate the final code, encode personal preference without a project invariant, or prescribe a mechanism where a semantic rule would age better.