Goal
- Analyze the Python file
<FILE>passed by the user, and generate or update
<FILE>.README.md with bullet-point documentation of its architecture, code
organization, idioms, and so on
Workflow
Read File
- Read
<FILE>to understand its structure: - Parse all function and class definitions
- Identify the public API (exported functions, classes, constants)
- Trace which functions call which
- Identify external dependencies (imports from other modules, libraries)
- Note the module's purpose and role in the broader system
Check the Existing Readme
- If
<FILE>.README.mdexists, read it and plan what to update. Otherwise, plan
the content from scratch
- Make sure the docstring of the corresponding file points to
<FILE>.README.md,
e.g.,
```text
For a description of the architecture of this file, see the file
<FILE>.README.md
```
Generate Document
- Follow the template
.claude/templates/architecture_doc.template.md - Generate the sections in markdown with bullet points, following:
.claude/skills/markdown.rules.mdfor markdown formatting.claude/skills/text.rules.mdfor text formatting
Update Document
- Write the results to
<FILE>.README.mdin the same dir as<FILE> - Wrap the text at 85 columns
Conventions
- Use conventions summarized in
docs/documentation_meta/all.architecture_diagrams.explanation.md
- Use PlantUML diagrams (
`plantuml) for all architecture diagrams, never
Mermaid, following .claude/skills/C4.rules.md
- Use the standard C4 layout in PlantUML:
Personfor external usersSystemfor external systemsContainerfor application containers/processesComponentfor internal componentsRelfor relationships between elements- Label diagrams with what they show
- Reference real code artifacts (function names, class names, file paths) when
available
- Distinguish facts from assumptions:
- For facts (code-derived):
- E.g., "The function
process_data()callsvalidate_input()before
computing results"
- For assumptions:
- E.g., "This likely handles error cases based on the try-except blocks
present"
- Focus on:
- Maintainability: How easy is it to modify and extend this code?
- Extensibility: How well does the design accommodate new features?
- Operational understanding: What must someone know to work with this code?
- Say how the doc was generated, with this line right after the title:
```markdown
- Generated by
.claude/skills/readme_file.write_architecture/SKILL.md
```
Constraints
- Do not modify
<FILE>. Only create or update<FILE>.README.md - Do not over-document: skip what the code makes obvious
- Keep diagrams focused: one clear diagram beats three cluttered ones
- Do not invent architecture that is not in the code
- When unsure of the intent, mark the observation as an assumption
- Do not use emojis or decorative formatting
Verification
- [ ]
<FILE>.README.mdexists and documents the architecture of<FILE> - [ ] The docstring in
<FILE>references<FILE>.README.md - [ ] Diagrams use PlantUML syntax with the C4 element types
- [ ] No architecture is invented that is not in the code
- [ ] The architecture doc says it was generated by
.claude/skills/readme_file.write_architecture/SKILL.md