Documentation Sync
Purpose
Use this skill to keep durable repository knowledge in sync with the current coding session.
The sources of truth are:
- the current conversation
- the current git changes
- the existing
dev-docs/*.md, relevant specs/*.md, and AGENTS.md
This skill is for durable knowledge, not changelog prose.
Repository docs and specs
dev-docs/ contains precise and exhaustive Markdown documentation for each domain or system (top-level *.md files).
docs/ holds the Mintlify product docs site (docs.json, topical folders such as getting-started/ and telemetry/, plus images/, logo/, favicons).
- Each domain doc file should cover how the domain or system is architected, built, designed, and structured.
- Keep domain docs organized by domain/system (for example:
dev-docs/reliability.md, dev-docs/evaluations.md, dev-docs/annotations.md, dev-docs/scores.md, dev-docs/issues.md, dev-docs/simulations.md, dev-docs/organizations.md, dev-docs/projects.md, dev-docs/users.md, dev-docs/settings.md, dev-docs/spans.md).
specs/ is a temporary folder used while a feature or system is under construction.
- Each spec or PRD in
specs/ should have its own Markdown file and usually include a task list to track progress.
- Specs define exactly what, how, and why to build while the feature is under construction, so temporary overlap with docs is acceptable.
- Docs should describe the intended final system after all planned phases are complete, including post-MVP phases, precisely enough to remain authoritative after the corresponding spec is deleted.
- Docs should not be written as a snapshot of the repository's currently implemented state.
- If some part of the final design is still not fully specified, docs may say that the exact detail is still pending precise definition, but they should still be framed around the final intended system.
- When working on a spec, proactively ask clarifying questions and challenge assumptions, gaps, ambiguities, and trade-offs as needed to build the best possible spec.
Spec structure
Use this structure for specs:
# Name
> **Documentation**: `dev-docs/reliability.md`, `dev-docs/evaluations.md`, ...
... (here goes the exact and precise specification and the plan)
## Tasks
> **Status legend**: `[ ] pending`, `[~] in progress`, `[x] complete`
### Phase N - ...
- [ ] **P0-1**: ...
... (here goes more tasks)
**Exit gate**:
- ... (here goes the definition of complete for this phase)
... (here goes more phases)
- Each phase should usually map to its own GitHub PR, and each task inside should be a subtask of that PR.
- When implementation stabilizes, promote durable knowledge from
specs/ into dev-docs/.
- Building the related
dev-docs/ pages for the current spec is recommended.
- Optionally, each phase can be linked to a Linear task if configured by the user.
When to use this skill
Use this skill automatically before finishing a task when the session introduced, removed, or clarified durable knowledge such as:
- product behavior
- domain rules or business logic
- architecture or design changes
- repository structure or ownership changes
- schema, API, storage, query, or lifecycle changes
- explicit conventions, constraints, or prohibitions agreed in the conversation
Use it when the user explicitly asks to:
- update docs
- document the changes
- sync knowledge into
dev-docs/
- update
AGENTS.md
- capture design, architecture, or business logic decisions
If there is no durable knowledge change, do not edit docs just to summarize work. Say that no documentation update is needed.
Workflow
1. Inspect the session first
- Read the current conversation carefully.
- Extract durable decisions, not just code edits.
- Note additions, removals, renames, behavior changes, and explicit rules.
- Use the conversation as the filter for what belongs to the current session.
If the worktree contains unrelated changes, do not document them unless the user asked you to.
2. Inspect the repository evidence
- Review
git status and git diff.
- Read the changed files that carry domain or architectural meaning.
- Compare code changes against the existing docs before editing them.
- If a relevant spec exists, read the sections that define the domain language and future-state behavior.
3. Classify the knowledge
dev-docs/: domain or system knowledge about behavior, architecture, structure, responsibilities, interfaces, lifecycle, and business logic.
AGENTS.md: stable repo-wide rules, conventions, constraints, and prohibitions that future agents should follow across sessions.
specs/: temporary plans. Do not move speculative or incomplete ideas into dev-docs/ unless the implementation or the conversation made them durable truth.
4. Map changes to the correct docs
- Prefer updating existing domain docs first.
- Update every impacted doc, not only the most obvious one.
- Delete or rewrite stale sections when behavior was removed or replaced.
- Create a new doc in
dev-docs/ only when the knowledge is durable and no existing doc is a reasonable home.
5. Write future-state documentation
- Document the repository as it should now be understood after the change.
- Explain the model, responsibilities, invariants, flows, and important constraints.
- Prefer precise durable statements over implementation trivia.
- Organize by domain, not by commit chronology.
- Avoid changelog wording such as "we changed", "in this PR", "recently", or dates.
6. Escalate repo-wide rules into AGENTS.md
Add or update AGENTS.md when the session established a general rule that should guide future agent work across the repository.
Good candidates include:
- architecture boundaries
- naming or file organization conventions
- storage or query constraints
- migration or schema rules
- testing rules
- prohibited patterns
- any cross-cutting repo decision
Example: "Do not add foreign key constraints" belongs in AGENTS.md.
Do not add narrow feature details that belong in a domain doc instead. If it is unclear whether a rule is repo-wide and durable, ask the user before editing AGENTS.md.
7. Verify
- Re-read the edited docs and
AGENTS.md.
- Confirm they match the code and do not contradict existing guidance.
- Make sure removed behavior is no longer documented.
- Tell the user which docs changed and why, or that no documentation updates were needed.
Durable knowledge filter
Persist knowledge only if it is likely to matter after this session:
- accepted behavior and user-facing semantics
- domain concepts and relationships
- important architecture and ownership boundaries
- repository-wide conventions and prohibitions
- data model, storage, and query behavior
- operational constraints that affect future work
Do not persist:
- temporary debugging notes
- one-off commands or local environment accidents
- rejected ideas
- task-by-task changelog summaries
- TODO lists unless the user asked for a spec or plan
Domain mapping hints
Use the closest existing doc when possible:
dev-docs/reliability.md: cross-cutting reliability system design
dev-docs/evaluations.md: evaluation lifecycle and behavior
dev-docs/annotations.md: annotation model and flows
dev-docs/annotation-queues.md: queueing and assignment behavior for annotations
dev-docs/scores.md: scoring logic and score lifecycle
dev-docs/issues.md: issue detection, grouping, and issue workflows
dev-docs/simulations.md: simulation concepts and flows
dev-docs/organizations.md: organization tenancy and membership rules
dev-docs/projects.md: project structure and project-scoped behavior
dev-docs/users.md: user identity and user lifecycle
dev-docs/settings.md: configuration and settings behavior
dev-docs/spans.md: span ingestion, storage, and query semantics
dev-docs/repositories.md: repository port naming, standard verbs, audit of domain ports
dev-docs/command-palette.md: global Cmd+K palette architecture and how to register new pages/actions/searchable entities
dev-docs/showcase.md: the shared read-only Showcase project (/projects/lat-demo) — project-scope/Biome enforcement, security model, blue/green regeneration, and backoffice lifecycle
dev-docs/design-system.md: apps/design-system component reference site (@repo/ui demos, local dev, deployment)
If a change spans multiple domains, update multiple docs.
Writing rules
- Keep docs exhaustive, precise, and future-state.
- Prefer the domain language used by the code and specs.
- Explain responsibilities and invariants, not every function.
- When behavior was removed, delete or rewrite the old documentation.
- When conversation decisions are broader than one domain, update both
dev-docs/ and AGENTS.md if appropriate.
- Keep
AGENTS.md prescriptive and reusable by future coding agents.
Quick checklist
1---2name: docs3description: Review the current conversation context and git changes, then persist durable repository knowledge into `dev-docs/*.md` by domain and into `AGENTS.md` for cross-cutting repo rules. Use after features, fixes, refactors, architecture changes, schema changes, or when the user mentions docs, documentation, design, architecture, business logic, conventions, or `AGENTS.md`.4license: MIT5---67# Documentation Sync89## Purpose1011Use this skill to keep durable repository knowledge in sync with the current coding session.1213The sources of truth are:14151. the current conversation162. the current git changes173. the existing `dev-docs/*.md`, relevant `specs/*.md`, and `AGENTS.md`1819This skill is for durable knowledge, not changelog prose.2021## Repository docs and specs2223- `dev-docs/` contains precise and exhaustive Markdown documentation for each domain or system (top-level `*.md` files).24- `docs/` holds the **Mintlify** product docs site (`docs.json`, topical folders such as `getting-started/` and `telemetry/`, plus `images/`, `logo/`, favicons).25- Each domain doc file should cover how the domain or system is architected, built, designed, and structured.26- Keep domain docs organized by domain/system (for example: `dev-docs/reliability.md`, `dev-docs/evaluations.md`, `dev-docs/annotations.md`, `dev-docs/scores.md`, `dev-docs/issues.md`, `dev-docs/simulations.md`, `dev-docs/organizations.md`, `dev-docs/projects.md`, `dev-docs/users.md`, `dev-docs/settings.md`, `dev-docs/spans.md`).27- `specs/` is a temporary folder used while a feature or system is under construction.28- Each spec or PRD in `specs/` should have its own Markdown file and usually include a task list to track progress.29- Specs define exactly what, how, and why to build while the feature is under construction, so temporary overlap with docs is acceptable.30- Docs should describe the intended final system after all planned phases are complete, including post-MVP phases, precisely enough to remain authoritative after the corresponding spec is deleted.31- Docs should not be written as a snapshot of the repository's currently implemented state.32- If some part of the final design is still not fully specified, docs may say that the exact detail is still pending precise definition, but they should still be framed around the final intended system.33- When working on a spec, proactively ask clarifying questions and challenge assumptions, gaps, ambiguities, and trade-offs as needed to build the best possible spec.3435### Spec structure3637Use this structure for specs:3839```markdown40# Name4142> **Documentation**: `dev-docs/reliability.md`, `dev-docs/evaluations.md`, ...4344... (here goes the exact and precise specification and the plan)4546## Tasks4748> **Status legend**: `[ ] pending`, `[~] in progress`, `[x] complete`4950### Phase N - ...5152- [ ] **P0-1**: ...5354... (here goes more tasks)5556**Exit gate**:5758- ... (here goes the definition of complete for this phase)5960... (here goes more phases)61```6263- Each phase should usually map to its own GitHub PR, and each task inside should be a subtask of that PR.64- When implementation stabilizes, promote durable knowledge from `specs/` into `dev-docs/`.65- Building the related `dev-docs/` pages for the current spec is recommended.66- Optionally, each phase can be linked to a Linear task if configured by the user.6768## When to use this skill6970Use this skill automatically before finishing a task when the session introduced, removed, or clarified durable knowledge such as:7172- product behavior73- domain rules or business logic74- architecture or design changes75- repository structure or ownership changes76- schema, API, storage, query, or lifecycle changes77- explicit conventions, constraints, or prohibitions agreed in the conversation7879Use it when the user explicitly asks to:8081- update docs82- document the changes83- sync knowledge into `dev-docs/`84- update `AGENTS.md`85- capture design, architecture, or business logic decisions8687If there is no durable knowledge change, do not edit docs just to summarize work. Say that no documentation update is needed.8889## Workflow9091### 1. Inspect the session first9293- Read the current conversation carefully.94- Extract durable decisions, not just code edits.95- Note additions, removals, renames, behavior changes, and explicit rules.96- Use the conversation as the filter for what belongs to the current session.9798If the worktree contains unrelated changes, do not document them unless the user asked you to.99100### 2. Inspect the repository evidence101102- Review `git status` and `git diff`.103- Read the changed files that carry domain or architectural meaning.104- Compare code changes against the existing docs before editing them.105- If a relevant spec exists, read the sections that define the domain language and future-state behavior.106107### 3. Classify the knowledge108109- `dev-docs/`: domain or system knowledge about behavior, architecture, structure, responsibilities, interfaces, lifecycle, and business logic.110- `AGENTS.md`: stable repo-wide rules, conventions, constraints, and prohibitions that future agents should follow across sessions.111- `specs/`: temporary plans. Do not move speculative or incomplete ideas into `dev-docs/` unless the implementation or the conversation made them durable truth.112113### 4. Map changes to the correct docs114115- Prefer updating existing domain docs first.116- Update every impacted doc, not only the most obvious one.117- Delete or rewrite stale sections when behavior was removed or replaced.118- Create a new doc in `dev-docs/` only when the knowledge is durable and no existing doc is a reasonable home.119120### 5. Write future-state documentation121122- Document the repository as it should now be understood after the change.123- Explain the model, responsibilities, invariants, flows, and important constraints.124- Prefer precise durable statements over implementation trivia.125- Organize by domain, not by commit chronology.126- Avoid changelog wording such as "we changed", "in this PR", "recently", or dates.127128### 6. Escalate repo-wide rules into `AGENTS.md`129130Add or update `AGENTS.md` when the session established a general rule that should guide future agent work across the repository.131132Good candidates include:133134- architecture boundaries135- naming or file organization conventions136- storage or query constraints137- migration or schema rules138- testing rules139- prohibited patterns140- any cross-cutting repo decision141142Example: "Do not add foreign key constraints" belongs in `AGENTS.md`.143144Do not add narrow feature details that belong in a domain doc instead. If it is unclear whether a rule is repo-wide and durable, ask the user before editing `AGENTS.md`.145146### 7. Verify147148- Re-read the edited docs and `AGENTS.md`.149- Confirm they match the code and do not contradict existing guidance.150- Make sure removed behavior is no longer documented.151- Tell the user which docs changed and why, or that no documentation updates were needed.152153## Durable knowledge filter154155Persist knowledge only if it is likely to matter after this session:156157- accepted behavior and user-facing semantics158- domain concepts and relationships159- important architecture and ownership boundaries160- repository-wide conventions and prohibitions161- data model, storage, and query behavior162- operational constraints that affect future work163164Do not persist:165166- temporary debugging notes167- one-off commands or local environment accidents168- rejected ideas169- task-by-task changelog summaries170- TODO lists unless the user asked for a spec or plan171172## Domain mapping hints173174Use the closest existing doc when possible:175176- `dev-docs/reliability.md`: cross-cutting reliability system design177- `dev-docs/evaluations.md`: evaluation lifecycle and behavior178- `dev-docs/annotations.md`: annotation model and flows179- `dev-docs/annotation-queues.md`: queueing and assignment behavior for annotations180- `dev-docs/scores.md`: scoring logic and score lifecycle181- `dev-docs/issues.md`: issue detection, grouping, and issue workflows182- `dev-docs/simulations.md`: simulation concepts and flows183- `dev-docs/organizations.md`: organization tenancy and membership rules184- `dev-docs/projects.md`: project structure and project-scoped behavior185- `dev-docs/users.md`: user identity and user lifecycle186- `dev-docs/settings.md`: configuration and settings behavior187- `dev-docs/spans.md`: span ingestion, storage, and query semantics188- `dev-docs/repositories.md`: repository port naming, standard verbs, audit of domain ports189- `dev-docs/command-palette.md`: global Cmd+K palette architecture and how to register new pages/actions/searchable entities190- `dev-docs/showcase.md`: the shared read-only Showcase project (`/projects/lat-demo`) — project-scope/Biome enforcement, security model, blue/green regeneration, and backoffice lifecycle191- `dev-docs/design-system.md`: `apps/design-system` component reference site (`@repo/ui` demos, local dev, deployment)192193If a change spans multiple domains, update multiple docs.194195## Writing rules196197- Keep docs exhaustive, precise, and future-state.198- Prefer the domain language used by the code and specs.199- Explain responsibilities and invariants, not every function.200- When behavior was removed, delete or rewrite the old documentation.201- When conversation decisions are broader than one domain, update both `dev-docs/` and `AGENTS.md` if appropriate.202- Keep `AGENTS.md` prescriptive and reusable by future coding agents.203204## Quick checklist205206- [ ] I checked both the conversation and the git changes.207- [ ] I filtered out unrelated worktree changes.208- [ ] I identified durable additions, removals, and rule changes.209- [ ] I updated the right `dev-docs/*.md` files by domain.210- [ ] I removed or rewrote stale documentation.211- [ ] I updated `AGENTS.md` for any new repo-wide durable rule.212- [ ] I avoided changelog-style wording.213- [ ] I told the user what documentation changed, or that none was needed.