A document has a specific reader
Documentation turns verified information from code, configuration, tests, logs, and runs into a description that a specific person can understand. Claude Code helps create the structure and draft, but it does not replace verification by a developer.
It is better to have several short documents with clear purposes than one universal README that mixes onboarding, API details, troubleshooting, and architecture.
| Artifact | Purpose |
|---|---|
README.md | Basic purpose and startup |
docs/onboarding.md | First steps for a new team member |
docs/refund-flow.md | Description of a specific functional flow |
CODEBASE_INVENTORY.md | Map of the repository structure |
API_MAP.md | Routes, handlers, and integrations |
| Troubleshooting note | Diagnosis of a specific problem |
Prepare sources before writing
- Identify the specific controllers, services, clients, and tests.
- Add manifests, configurations, and
.env.examplewhen relevant. - Run a separate read-only investigation when needed.
- Write a constrained prompt and prohibit inventing entities.
- Obtain a draft of the sections, explanations, and constraints.
- Check every non-trivial claim before publication.
A documentation request
Based on the listed files, prepare a draft document.
Do not invent classes, commands, or integrations.
Cite a source for important claims.
Mark unconfirmed information, constraints,
and questions that require verification separately.Check execution commands
- the command name must match the scripts in the relevant manifest;
- the wrapper file must exist in the repository;
- ports, the database, and environment variables must be specified for the required environment;
- a local run should be confirmed in practice, not merely read in the README;
- external webhooks or integrations may not be reproducible locally.
Update documentation with the code
After changes to services, routes, or configuration, check the related documents again. State the boundaries of your knowledge explicitly: it is better to say “the fact was not found” or “an external webhook is required” than to present a guess as an implemented feature.
Canonical lesson source · JavaRush
Open JavaRush material