Context
- Current directory: !
pwd
- Project CLAUDE.md: !
head -80 CLAUDE.md 2>/dev/null || echo "no CLAUDE.md"
- Package.json: !
cat package.json 2>/dev/null | head -40 || echo "no package.json"
- Existing README: !
head -20 README.md 2>/dev/null || echo "no README.md"
- Project structure: !
find . -maxdepth 3 -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.astro" -o -name "*.vue" -o -name "*.py" \) 2>/dev/null | grep -v node_modules | grep -v .git | grep -v dist | sort | head -40
Mode detection
$ARGUMENTS is a file path → FILE MODE: document that specific file.
$ARGUMENTS is "readme" → README MODE: generate or update README.md.
$ARGUMENTS is "api" → API MODE: document all API endpoints.
$ARGUMENTS is "components" → COMPONENTS MODE: document all UI components.
$ARGUMENTS is empty → AUTO MODE: detect gaps and suggest what to document.
FILE MODE
Document a specific file with inline documentation.
Flow
- Read the target file and all its imports (1 level deep).
- Analyze: exports, functions, types, classes, side effects.
- Add documentation:
- TypeScript/JavaScript: JSDoc/TSDoc comments for exports
- Python: docstrings (Google style)
- Astro/Vue: component description comment at top
- Don't document obvious code. Focus on:
- Why, not what
- Non-obvious parameters and return values
- Edge cases and gotchas
- Usage examples for public APIs
README MODE
Generate or update README.md for the project.
Flow
- Analyze the project: package.json, CLAUDE.md, directory structure, framework, features.
- Generate sections:
# [Project Name]
[One-line description]
## Features
- [Auto-detected from code and package.json]
## Quick Start
[Install + run commands from package.json scripts]
## Project Structure
[Key directories and their purpose]
## Tech Stack
[Framework, UI, backend, auth — auto-detected]
## Environment Variables
[From .env.example or CLAUDE.md]
## Scripts
[All package.json scripts with descriptions]
## Contributing
[Standard section]
- If README.md exists, use AskUserQuestion:
- Question: "README.md already exists. How should I update it?"
- Options:
- Merge — "Add missing sections, keep existing content" (Recommended)
- Replace — "Overwrite with fresh generation"
- Skip — "Don't modify README.md"
API MODE
Document all API routes/endpoints.
Flow
- Find all API route files:
- Next.js:
app/api/**/route.ts, pages/api/**/*.ts
- Astro:
src/pages/api/**/*.ts
- Convex:
convex/*.ts (queries, mutations, actions)
- Python: FastAPI routes, Flask routes
- For each endpoint, document:
- Method: GET, POST, PUT, DELETE
- Path: full URL path
- Auth: required? what type?
- Request body: schema/type
- Response: schema/type + status codes
- Example: curl or fetch example
- Output to
docs/API.md or inline in the route files (ask user preference).
COMPONENTS MODE
Document all UI components.
Flow
- Find all component files in the project.
- For each component, document:
- Name: component name
- Description: what it does (from code analysis)
- Props/Slots: all accepted props with types and defaults
- Usage example: how to use the component
- Dependencies: what it imports/requires
- Output to
docs/COMPONENTS.md or as a component index.
AUTO MODE
Detect documentation gaps and suggest what to document.
Flow
- Check for:
- Missing README.md
- Undocumented exports (no JSDoc/docstring)
- API routes without documentation
- Components without prop documentation
- Missing .env.example
- Missing CHANGELOG.md
- Use AskUserQuestion:
- Question: "I found these documentation gaps. What should I document?"
multiSelect: true
- Options based on detected gaps
Important
- Read actual code — never invent functionality that doesn't exist.
- Match existing doc style — if the project uses a specific documentation format, follow it.
- French for French projects — GoCharbon, claiire, plaisirsurprise (FR content).
- Every code example must be syntactically correct and runnable.
- Don't over-document. Simple, self-explanatory code doesn't need comments.
- For component docs, include the actual prop types from the source code.
- Keep README concise — link to detailed docs instead of putting everything in one file.
- Accents français obligatoires. Lors de toute création ou modification de contenu en français, vérifier systématiquement que TOUS les accents sont présents et corrects (é, è, ê, à, â, ù, û, ô, î, ï, ç, œ, æ). Les accents manquants sont une faute d'orthographe. Relire chaque texte produit pour s'assurer qu'aucun accent n'a été oublié — c'est une erreur très fréquente à corriger impérativement.
1---2name: shipflow-docs3description: Generate or update documentation from code — README, API docs, component docs, or single file documentation4---5
6## Context
7
8- Current directory: !`pwd`
9- Project CLAUDE.md: !`head -80 CLAUDE.md 2>/dev/null || echo "no CLAUDE.md"`
10- Package.json: !`cat package.json 2>/dev/null | head -40 || echo "no package.json"`
11- Existing README: !`head -20 README.md 2>/dev/null || echo "no README.md"`
12- Project structure: !`find . -maxdepth 3 -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.astro" -o -name "*.vue" -o -name "*.py" \) 2>/dev/null | grep -v node_modules | grep -v .git | grep -v dist | sort | head -40`
13
14## Mode detection
15
16- **`$ARGUMENTS` is a file path** → FILE MODE: document that specific file.
17- **`$ARGUMENTS` is "readme"** → README MODE: generate or update README.md.
18- **`$ARGUMENTS` is "api"** → API MODE: document all API endpoints.
19- **`$ARGUMENTS` is "components"** → COMPONENTS MODE: document all UI components.
20- **`$ARGUMENTS` is empty** → AUTO MODE: detect gaps and suggest what to document.
21
22---
23
24## FILE MODE
25
26Document a specific file with inline documentation.
27
28### Flow
29
301. Read the target file and all its imports (1 level deep).
312. Analyze: exports, functions, types, classes, side effects.
323. Add documentation:
33 - **TypeScript/JavaScript**: JSDoc/TSDoc comments for exports
34 - **Python**: docstrings (Google style)
35 - **Astro/Vue**: component description comment at top
364. Don't document obvious code. Focus on:
37 - Why, not what
38 - Non-obvious parameters and return values
39 - Edge cases and gotchas
40 - Usage examples for public APIs
41
42---
43
44## README MODE
45
46Generate or update `README.md` for the project.
47
48### Flow
49
501. Analyze the project: package.json, CLAUDE.md, directory structure, framework, features.
512. Generate sections:
52
53```markdown
54# [Project Name]
55
56[One-line description]
57
58## Features
59- [Auto-detected from code and package.json]
60
61## Quick Start
62[Install + run commands from package.json scripts]
63
64## Project Structure
65[Key directories and their purpose]
66
67## Tech Stack
68[Framework, UI, backend, auth — auto-detected]
69
70## Environment Variables
71[From .env.example or CLAUDE.md]
72
73## Scripts
74[All package.json scripts with descriptions]
75
76## Contributing
77[Standard section]
78```
79
803. If README.md exists, use **AskUserQuestion**:
81 - Question: "README.md already exists. How should I update it?"
82 - Options:
83 - **Merge** — "Add missing sections, keep existing content" (Recommended)
84 - **Replace** — "Overwrite with fresh generation"
85 - **Skip** — "Don't modify README.md"
86
87---
88
89## API MODE
90
91Document all API routes/endpoints.
92
93### Flow
94
951. Find all API route files:
96 - Next.js: `app/api/**/route.ts`, `pages/api/**/*.ts`
97 - Astro: `src/pages/api/**/*.ts`
98 - Convex: `convex/*.ts` (queries, mutations, actions)
99 - Python: FastAPI routes, Flask routes
1002. For each endpoint, document:
101 - **Method**: GET, POST, PUT, DELETE
102 - **Path**: full URL path
103 - **Auth**: required? what type?
104 - **Request body**: schema/type
105 - **Response**: schema/type + status codes
106 - **Example**: curl or fetch example
1073. Output to `docs/API.md` or inline in the route files (ask user preference).
108
109---
110
111## COMPONENTS MODE
112
113Document all UI components.
114
115### Flow
116
1171. Find all component files in the project.
1182. For each component, document:
119 - **Name**: component name
120 - **Description**: what it does (from code analysis)
121 - **Props/Slots**: all accepted props with types and defaults
122 - **Usage example**: how to use the component
123 - **Dependencies**: what it imports/requires
1243. Output to `docs/COMPONENTS.md` or as a component index.
125
126---
127
128## AUTO MODE
129
130Detect documentation gaps and suggest what to document.
131
132### Flow
133
1341. Check for:
135 - Missing README.md
136 - Undocumented exports (no JSDoc/docstring)
137 - API routes without documentation
138 - Components without prop documentation
139 - Missing .env.example
140 - Missing CHANGELOG.md
1412. Use **AskUserQuestion**:
142 - Question: "I found these documentation gaps. What should I document?"
143 - `multiSelect: true`
144 - Options based on detected gaps
145
146---
147
148## Important
149
150- **Read actual code** — never invent functionality that doesn't exist.
151- **Match existing doc style** — if the project uses a specific documentation format, follow it.
152- **French for French projects** — GoCharbon, claiire, plaisirsurprise (FR content).
153- Every code example must be **syntactically correct** and **runnable**.
154- Don't over-document. Simple, self-explanatory code doesn't need comments.
155- For component docs, include the actual prop types from the source code.
156- Keep README concise — link to detailed docs instead of putting everything in one file.
157- **Accents français obligatoires.** Lors de toute création ou modification de contenu en français, vérifier systématiquement que TOUS les accents sont présents et corrects (é, è, ê, à, â, ù, û, ô, î, ï, ç, œ, æ). Les accents manquants sont une faute d'orthographe. Relire chaque texte produit pour s'assurer qu'aucun accent n'a été oublié — c'est une erreur très fréquente à corriger impérativement.