Go, CSS, and JavaScript
/*
MarsDocSync:
docs:
- docs/design-docs/code-documentation-map.md
- docs/design-docs/documentation-sync-architecture.md
- docs/features/F-001-delivery-operating-model.md
*/
No stale documentation
MARS treats documentation as part of the product. Source files
declare which durable docs own their behavior, roles are expected
to read and update those docs, and mars docsync audit
makes missing documentation metadata mechanically visible.
MARS agents can discuss work in chat, but completed work is not true until the owning repo artifact says so. Durable state lives in committed files: goals, active plans, feature contracts, tickets, design docs, validation reports, release notes, scores, and source.
| Artifact | User meaning | When it changes |
|---|---|---|
docs/goals/ | What the system is trying to achieve. | When priority, observations, or supersession changes. |
docs/exec-plans/ | The active delivery strategy and scenario order. | When the plan, assumptions, blockers, or current failing scenario changes. |
docs/features/ | BDD feature contracts and business logic. | Before or alongside implementation of user-visible behavior. |
docs/tickets/ | Work item lifecycle and completion evidence. | As tickets move from backlog to in-progress, review, done, or blocked. |
docs/design-docs/ | Architecture, operating doctrine, and decision rationale. | When a rule, workflow, subsystem, or architectural choice changes. |
docs/QUALITY_SCORE.md | Repo-visible quality and role-health evidence. | After score export, quality review, telemetry triage, or improvement work. |
CHANGELOG.md | Versioned user impact and patch notes. | After each non-release semantic change in MARS and initialized target repos. |
A source file's top-of-file MarsDocSync block lists the
minimum docs a user or agent must inspect when that file changes.
The block is a review contract, not decoration.
/*
MarsDocSync:
docs:
- docs/design-docs/code-documentation-map.md
- docs/design-docs/documentation-sync-architecture.md
- docs/features/F-001-delivery-operating-model.md
*/
<!doctype html>
<!--
MarsDocSync:
docs:
- README.md
- docs/index.html
- docs/product-specs/product-surface.md
-->
Keep <!doctype html> first, then place the metadata comment immediately after it.
# MarsDocSync:
# docs:
# - docs/design-docs/cli-tool-skill-sync.md
# - docs/features/F-004-target-harness-lifecycle.md
Business logic belongs in docs/features/. A feature
contract explains step-by-step product behavior, scenarios, rules,
validations, permissions, routing, scoring, trust behavior, release
classification, and user-visible outcomes.
Write or update the scenario and business rules that define done.
Build the next walking-skeleton slice that makes one real scenario pass.
Check code, docs, tests, and evidence against the exact scenario.
Separate shipped user behavior from enabler work in the changelog.
Documentation sync and context efficiency work together. MARS keeps prompts small by injecting compact route hints and letting roles retrieve deeper docs when they need them.
routes:
- when: role routing, domains, modes, schedules, chains, trigger routing, handoff, feedback, persona manuals, or manifest role behavior
paths: .harness/manifest.yaml, docs/roles/ROLES.md, docs/roles/personas, docs/design-docs/harness-operating-model.md, docs/design-docs/context-glossary.md
- when: implementation, architecture, tests, local commands, CLI commands, command flags, source documentation metadata, no-stale-documentation checks, or CLI tool/skill sync
paths: AGENTS.md, README.md, docs/design-docs/context-glossary.md, docs/design-docs/code-documentation-map.md, docs/design-docs/documentation-sync-architecture.md, docs/design-docs/cli-tool-skill-sync.md, docs/features/README.md
Users should add routes when agents repeatedly miss the same durable context. Prefer pointing at existing docs over copying long instructions into role prompts.
Find the feature contract, design doc, product spec, README, or generated target guidance that explains the behavior you are changing.
rg -n "release notes|model override|ticket delivery" docs README.md AGENTS.md
Open the changed source file's MarsDocSync docs and decide whether each is still accurate after the change.
sed -n '1,40p' internal/models/overrides.go
Change durable docs in the same patch as code or record explicitly why no doc text changed.
edit docs/features/F-003-local-inference-lifecycle.md
edit docs/design-docs/local-inference.md
Use the CLI or mirrored tool before review, release, or successful job disposition.
mars docsync audit --repo .
mars tools run docsync_audit --repo . --args-json '{}'
mars docsync audit is local and deterministic. It walks
audited source roots, parses metadata, checks referenced docs exist,
and applies foundation prefix rules when running inside the MARS
source repo.
| Finding | What it means | User fix |
|---|---|---|
| Missing metadata | An audited source file has no top-of-file MarsDocSync block. | Add metadata that points to the owning docs. |
| Missing docs | A listed path does not exist or is not a durable documentation artifact. | Correct the path or create the owning doc. |
| Missing required docs | A foundation source file omitted baseline docs from the code-documentation map. | Add the required baseline path and read it before completing the change. |
| Parse error | The metadata block shape is invalid for that file type. | Use the documented block comment, HTML comment, or YAML comment format. |
mars docsync audit --repo .
go test ./internal/docsconsistency ./internal/docsync
git diff --check
For docs-only static-site work, this audit plus static link and syntax checks is usually enough. Runtime, generated-target, release, orchestration, inference, scoring, or safety changes need the broader validation gates documented elsewhere.
Target repos inherit the no-stale-documentation model. Generated
harnesses receive AGENTS.md, a context glossary,
feature-contract scaffolding, release docs, ticket lifecycle docs,
a role registry, and knowledge routes. After init, those files
belong to the target repo.
| Surface | Generated purpose | User ownership |
|---|---|---|
AGENTS.md | First-read map and working discipline. | Target-owned after init. |
docs/design-docs/context-glossary.md | Project vocabulary and routing hints. | Target-owned; expand as terminology grows. |
.harness/knowledge/context-glossary.yaml | Compact context routes into durable docs. | Target-owned; tune for project concepts. |
docs/features/README.md | BDD contract rules and feature index. | Target-owned behavior truth. |
docs/roles/ROLES.md | Role inventory matching the manifest. | Target-owned registry; custom roles use Origin: custom. |
docs/design-docs/release-versioning.md | Version, changelog, and release note contract. | Target-owned release doctrine. |
| Symptom | Likely cause | Recovery |
|---|---|---|
| Audit passes but prose is stale | Audit proves metadata shape and paths, not semantic completeness. | Read the listed docs and update the owning behavior description manually. |
| Agent keeps missing project terminology | Context route is absent or too vague. | Add a route in .harness/knowledge/context-glossary.yaml to the right glossary or design doc. |
| Docs changed without code | Pure documentation correction or user-facing site improvement. | Still run link, syntax, and DocSync checks for changed static assets. |
| Code changed without docs | No-stale-docs gap. | Open the file metadata, update listed docs, or record why they remain current. |
| New command documented in one place only | CLI tool/skill sync rule was missed. | Update CLI reference, mirrored mars_cli guidance, generated target docs, and affected skills. |
| Generated target guidance diverges | Foundation doctrine changed without mirroring or source-only classification. | Classify the rule, update generator defaults and tests, or record why it is source-only. |