Problem
Refresh generates user-facing docs (docs/api.md, docs/stack.md, docs/diagrams.md, docs/flows.md, docs/version-audit.md, docs/audit.md) but the generated README never links them. The readme task prompt has no documentation-index section — only a conditional "Architecture: link to docs/diagrams.md". Result: a fresh refresh leaves every generated doc orphaned and effectively invisible to readers.
Observed in practice: a full /forerunner-refresh run generated 5 docs in a target repo and the README linked none of them.
Design (grilled, decisions final)
Term: Docs Index (added to CONTEXT.md) — the ## Documentation README section listing every user-facing doc in docs/ with a one-line description. The readme task is its sole writer.
1. readme task — new conditional section
src/codeforerunner/prompts/tasks/readme.md:
- Add conditional section Documentation: present iff any top-level
docs/*.md exists.
- Bullet list, one entry per doc:
- [Title](docs/file.md) — one-line description.
- Covers all top-level
docs/*.md present on disk — generated and hand-written alike.
- Respect scan excludes (e.g.
docs/legacy/** from forerunner.config.yaml).
- Never link
.forerunner/* (internal artifacts: scan, check-report, arch-review, review-summary).
- Replaces the existing conditional "Architecture: link to docs/diagrams.md if it exists" — subsumed by the index.
Example shape:
## Documentation
- [Getting started](docs/getting-started.md) — install and first run
- [Architecture diagrams](docs/diagrams.md) — system and data-flow diagrams
- [Stack guide](docs/stack.md) — env setup, modules, env vars
- [Version audit](docs/version-audit.md) — dependency EOL status
2. check task — new staleness rule
src/codeforerunner/prompts/tasks/check.md, add to "What to Check":
- Docs Index accuracy: does README link every top-level
docs/*.md (excluding scan-excluded paths)? Unlinked doc → README STALE. README links a doc file that no longer exists → README STALE.
3. refresh task — readme runs last
src/codeforerunner/prompts/tasks/refresh.md: change generation order from
readme → api-docs → stack-docs → diagrams → flows → version-audit → audit
to
api-docs → stack-docs → diagrams → flows → version-audit → audit → readme
Rationale: docs generated in the same pass must exist on disk before the readme task builds the Docs Index; otherwise the index misses them and the README is stale the moment it is written. README links only files that actually exist — never "planned" docs from the check report.
Acceptance criteria
Out of scope
- Recursive indexing of
docs/ subdirectories (e.g. per-file docs/adr/ entries).
- Surgical README patching outside the readme task — check decides, readme writes, no second README write path.
- Changes to this repo's own README (it already has a
## Docs section; it will pick the new shape up on the next self-refresh).
Problem
Refresh generates user-facing docs (
docs/api.md,docs/stack.md,docs/diagrams.md,docs/flows.md,docs/version-audit.md,docs/audit.md) but the generated README never links them. The readme task prompt has no documentation-index section — only a conditional "Architecture: link to docs/diagrams.md". Result: a fresh refresh leaves every generated doc orphaned and effectively invisible to readers.Observed in practice: a full
/forerunner-refreshrun generated 5 docs in a target repo and the README linked none of them.Design (grilled, decisions final)
Term: Docs Index (added to CONTEXT.md) — the
## DocumentationREADME section listing every user-facing doc indocs/with a one-line description. The readme task is its sole writer.1. readme task — new conditional section
src/codeforerunner/prompts/tasks/readme.md:docs/*.mdexists.- [Title](docs/file.md) — one-line description.docs/*.mdpresent on disk — generated and hand-written alike.docs/legacy/**fromforerunner.config.yaml)..forerunner/*(internal artifacts: scan, check-report, arch-review, review-summary).Example shape:
2. check task — new staleness rule
src/codeforerunner/prompts/tasks/check.md, add to "What to Check":docs/*.md(excluding scan-excluded paths)? Unlinked doc → README STALE. README links a doc file that no longer exists → README STALE.3. refresh task — readme runs last
src/codeforerunner/prompts/tasks/refresh.md: change generation order fromreadme → api-docs → stack-docs → diagrams → flows → version-audit → auditto
api-docs → stack-docs → diagrams → flows → version-audit → audit → readmeRationale: docs generated in the same pass must exist on disk before the readme task builds the Docs Index; otherwise the index misses them and the README is stale the moment it is written. README links only files that actually exist — never "planned" docs from the check report.
Acceptance criteria
## Documentationwhendocs/*.mdexists; omits it whendocs/is absent or empty.docs/*.md, each with a one-line description; no.forerunner/*entries; scan excludes respected.docs/*.mdexists, and when an index link points at a missing file.Out of scope
docs/subdirectories (e.g. per-filedocs/adr/entries).## Docssection; it will pick the new shape up on the next self-refresh).