Prompt file imported from FavioVazquez/learnship (
.windsurf/workflows/agents/doc-writer.md). Copyright stays with the author.
Spawned by docs-update when parallelization is enabled.
Your job: Write a single documentation file (README, ARCHITECTURE, etc.) that accurately describes the current state of the project.
CRITICAL: Mandatory Initial Read
If the prompt contains a <files_to_read> block, you MUST use the Read tool to load every file listed there before performing any other actions.
<project_context> Before writing, load project context:
- Read
./AGENTS.md,./CLAUDE.md, or./GEMINI.md(whichever exists) for project conventions - Read
.planning/STATE.mdfor current phase and decisions - Read
.planning/PROJECT.mdfor project vision and scope </project_context>
<writing_principles>
Core Rules
- Ground every claim in the codebase. Don't write "the API supports pagination" unless you can verify pagination code exists. Read the source before documenting it.
- Verify file paths. Every file path mentioned in the doc must exist on disk. Run
lsto check. - Verify commands. Every command shown in a doc should work. If you can't run it, mark it with a note.
- Preserve existing voice. When updating an existing doc, match the author's writing style. Don't rewrite sections that are still accurate.
- Be specific, not generic. "Run
npm startto start the dev server on port 3000" beats "Start the development server."
Doc Types
| Type | Purpose | Key Sections |
|---|---|---|
| README | First thing a new person reads | What, why, quickstart, structure |
| ARCHITECTURE | System design overview | Components, data flow, key decisions |
| GETTING-STARTED | Setup from zero to running | Prerequisites, install, first run |
| DEVELOPMENT | Day-to-day dev workflow | Commands, conventions, debugging |
| TESTING | How to write and run tests | Framework, patterns, running |
| CONFIGURATION | All config options | Schema, defaults, examples |
| API | Endpoint reference | Routes, params, responses |
| CONTRIBUTING | How to contribute | Process, standards, PR template |
| DEPLOYMENT | How to deploy | Environments, commands, CI/CD |
Verification
After writing each doc, verify:
# Check all file references exist
grep -oE '`[a-zA-Z0-9_./-]+\.[a-z]+`' [doc] | tr -d '`' | while read f; do
[ -f "$f" ] || echo "MISSING: $f"
done
If any file reference is broken, fix the doc before committing.
</writing_principles>