@haposoft/cafekit 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +866 -0
- package/bin/install.js +773 -0
- package/package.json +40 -0
- package/src/antigravity/GEMINI.md +162 -0
- package/src/antigravity/workflows/code.md +16 -0
- package/src/antigravity/workflows/docs-init.md +432 -0
- package/src/antigravity/workflows/docs-update.md +245 -0
- package/src/antigravity/workflows/review.md +15 -0
- package/src/antigravity/workflows/spec-design.md +220 -0
- package/src/antigravity/workflows/spec-init.md +78 -0
- package/src/antigravity/workflows/spec-requirements.md +122 -0
- package/src/antigravity/workflows/spec-status.md +95 -0
- package/src/antigravity/workflows/spec-tasks.md +156 -0
- package/src/antigravity/workflows/spec-validate.md +106 -0
- package/src/antigravity/workflows/test.md +13 -0
- package/src/claude/ROUTING.md +101 -0
- package/src/claude/agents/code-reviewer.md +131 -0
- package/src/claude/agents/debugger.md +137 -0
- package/src/claude/agents/fullstack-developer.md +95 -0
- package/src/claude/agents/tester.md +105 -0
- package/src/claude/commands/code.md +17 -0
- package/src/claude/commands/docs.md +609 -0
- package/src/claude/commands/review/codebase/parallel.md +122 -0
- package/src/claude/commands/review/codebase.md +49 -0
- package/src/claude/commands/review.md +16 -0
- package/src/claude/commands/spec-design.md +247 -0
- package/src/claude/commands/spec-init.md +118 -0
- package/src/claude/commands/spec-requirements.md +138 -0
- package/src/claude/commands/spec-status.md +98 -0
- package/src/claude/commands/spec-tasks.md +173 -0
- package/src/claude/commands/spec-validate.md +118 -0
- package/src/claude/commands/test.md +8 -0
- package/src/claude/migration-manifest.json +39 -0
- package/src/common/skills/specs/SKILL.md +101 -0
- package/src/common/skills/specs/rules/design-discovery-full.md +93 -0
- package/src/common/skills/specs/rules/design-discovery-light.md +49 -0
- package/src/common/skills/specs/rules/design-principles.md +182 -0
- package/src/common/skills/specs/rules/design-review.md +110 -0
- package/src/common/skills/specs/rules/ears-format.md +49 -0
- package/src/common/skills/specs/rules/gap-analysis.md +144 -0
- package/src/common/skills/specs/rules/steering-principles.md +90 -0
- package/src/common/skills/specs/rules/tasks-generation.md +131 -0
- package/src/common/skills/specs/rules/tasks-parallel-analysis.md +34 -0
- package/src/common/skills/specs/templates/design.md +276 -0
- package/src/common/skills/specs/templates/init.json +41 -0
- package/src/common/skills/specs/templates/requirements-init.md +9 -0
- package/src/common/skills/specs/templates/requirements.md +26 -0
- package/src/common/skills/specs/templates/research.md +61 -0
- package/src/common/skills/specs/templates/tasks.md +21 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs
|
|
3
|
+
description: Documentation management command. Use '/docs init' to create initial docs, '/docs update' to update existing docs.
|
|
4
|
+
allowed-tools: Read, Write, Glob, Grep, Bash
|
|
5
|
+
argument-hint: <init|update> [--focus=dir1,dir2]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /docs - Documentation Management
|
|
9
|
+
|
|
10
|
+
$ARGUMENTS
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
|
|
16
|
+
Unified command for project documentation:
|
|
17
|
+
- `/docs init` - Initialize comprehensive documentation (replaces old /init)
|
|
18
|
+
- `/docs update` - Update docs after code changes
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Parse Arguments
|
|
23
|
+
|
|
24
|
+
**Extract subcommand:**
|
|
25
|
+
- If `$ARGUMENTS` starts with `init` → Run INIT workflow
|
|
26
|
+
- If `$ARGUMENTS` starts with `update` → Run UPDATE workflow
|
|
27
|
+
- Else → Show usage help
|
|
28
|
+
|
|
29
|
+
**Extract flags:**
|
|
30
|
+
- `--focus=dir1,dir2` - Focus on specific directories
|
|
31
|
+
- `--dir=./path` - Target specific directory
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## INIT Workflow (`/docs init`)
|
|
36
|
+
|
|
37
|
+
### Step 1: Check Prerequisites
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Check if docs/ already exists
|
|
41
|
+
ls -la docs/ 2>/dev/null && echo "EXISTS" || echo "NOT_FOUND"
|
|
42
|
+
|
|
43
|
+
# Check repomix
|
|
44
|
+
which repomix || npm list -g repomix 2>/dev/null || echo "REPOMIX_NOT_FOUND"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**If docs/ exists:**
|
|
48
|
+
- Ask: "docs/ already exists. Overwrite / Merge / Skip?"
|
|
49
|
+
|
|
50
|
+
### Step 2: Install Repomix (if needed)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Check if repomix is installed
|
|
54
|
+
which repomix 2>/dev/null || npm list -g repomix 2>/dev/null
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**If repomix not found:**
|
|
58
|
+
- Detect package manager: npm, pnpm, yarn, bun
|
|
59
|
+
- Install repomix globally:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Detect package manager
|
|
63
|
+
test -f pnpm-lock.yaml && PM="pnpm"
|
|
64
|
+
test -f yarn.lock && PM="yarn"
|
|
65
|
+
test -f bun.lockb && PM="bun"
|
|
66
|
+
PM="${PM:-npm}"
|
|
67
|
+
|
|
68
|
+
# Install repomix globally
|
|
69
|
+
$PM install -g repomix
|
|
70
|
+
|
|
71
|
+
# Verify installation
|
|
72
|
+
which repomix
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Report:**
|
|
76
|
+
```
|
|
77
|
+
📦 Installing repomix... ✅ Done
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Step 3: Run Repomix
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Generate codebase compaction
|
|
84
|
+
repomix
|
|
85
|
+
|
|
86
|
+
# Verify output
|
|
87
|
+
ls -la ./repomix-output.xml
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 4: Auto-Detect Project Info
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Package manager & config
|
|
94
|
+
test -f pnpm-lock.yaml && echo "PNPM"
|
|
95
|
+
test -f yarn.lock && echo "YARN"
|
|
96
|
+
test -f package-lock.json && echo "NPM"
|
|
97
|
+
test -f bun.lockb && echo "BUN"
|
|
98
|
+
test -f requirements.txt && echo "PIP"
|
|
99
|
+
test -f poetry.lock && echo "POETRY"
|
|
100
|
+
test -f go.mod && echo "GO"
|
|
101
|
+
test -f Cargo.toml && echo "CARGO"
|
|
102
|
+
|
|
103
|
+
# Read configs
|
|
104
|
+
cat package.json 2>/dev/null
|
|
105
|
+
cat pyproject.toml 2>/dev/null
|
|
106
|
+
cat go.mod 2>/dev/null
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Extract:**
|
|
110
|
+
- Project name, version, description
|
|
111
|
+
- Tech stack with versions
|
|
112
|
+
- Scripts/commands
|
|
113
|
+
- Dependencies
|
|
114
|
+
|
|
115
|
+
### Step 5: Detect Structure & Platform
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Directory structure
|
|
119
|
+
find . -maxdepth 3 -type d ! -path './node_modules/*' ! -path './.git/*' ! -path './.*' 2>/dev/null | sort | head -40
|
|
120
|
+
|
|
121
|
+
# Deployment platform
|
|
122
|
+
test -f vercel.json && echo "Vercel"
|
|
123
|
+
test -f netlify.toml && echo "Netlify"
|
|
124
|
+
test -f Dockerfile && echo "Docker"
|
|
125
|
+
test -f docker-compose.yml && echo "Docker Compose"
|
|
126
|
+
test -f fly.toml && echo "Fly.io"
|
|
127
|
+
test -d .github/workflows && echo "GitHub Actions"
|
|
128
|
+
|
|
129
|
+
# Database
|
|
130
|
+
test -f prisma/schema.prisma && echo "Prisma"
|
|
131
|
+
test -f drizzle.config.ts && echo "Drizzle"
|
|
132
|
+
|
|
133
|
+
# API
|
|
134
|
+
test -d src/app/api && echo "NextJS_API"
|
|
135
|
+
test -d src/routes && echo "Express_Routes"
|
|
136
|
+
|
|
137
|
+
# Testing
|
|
138
|
+
cat package.json | grep -E '"(vitest|jest|playwright|cypress)"' && echo "Testing"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Step 6: Generate 7 Documentation Files
|
|
142
|
+
|
|
143
|
+
Create `docs/` directory and generate:
|
|
144
|
+
|
|
145
|
+
#### 1. codebase-summary.md
|
|
146
|
+
```markdown
|
|
147
|
+
# Codebase Summary
|
|
148
|
+
|
|
149
|
+
> Auto-generated project overview
|
|
150
|
+
|
|
151
|
+
## Project Info
|
|
152
|
+
| Property | Value |
|
|
153
|
+
|----------|-------|
|
|
154
|
+
| **Name** | {detected} |
|
|
155
|
+
| **Version** | {detected} |
|
|
156
|
+
| **Type** | {detected} |
|
|
157
|
+
|
|
158
|
+
## Statistics
|
|
159
|
+
| Metric | Value |
|
|
160
|
+
|--------|-------|
|
|
161
|
+
| Files | {from repomix} |
|
|
162
|
+
| Tokens | {from repomix} |
|
|
163
|
+
| Generated | {timestamp} |
|
|
164
|
+
|
|
165
|
+
## Tech Stack
|
|
166
|
+
| Layer | Technology |
|
|
167
|
+
|-------|------------|
|
|
168
|
+
| {detected} | {with versions} |
|
|
169
|
+
|
|
170
|
+
## Structure
|
|
171
|
+
```
|
|
172
|
+
{directory tree}
|
|
173
|
+
```
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### 2. project-overview-pdr.md
|
|
177
|
+
```markdown
|
|
178
|
+
# Project Overview (PDR)
|
|
179
|
+
|
|
180
|
+
## Identity
|
|
181
|
+
- **Name:** {name}
|
|
182
|
+
- **Type:** {type}
|
|
183
|
+
- **Status:** Active
|
|
184
|
+
|
|
185
|
+
## Description
|
|
186
|
+
{from package.json or README}
|
|
187
|
+
|
|
188
|
+
## Features
|
|
189
|
+
{extracted from codebase}
|
|
190
|
+
|
|
191
|
+
## Roadmap
|
|
192
|
+
- [ ] Current sprint
|
|
193
|
+
- [ ] Next milestones
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### 3. code-standards.md
|
|
197
|
+
```markdown
|
|
198
|
+
# Code Standards
|
|
199
|
+
|
|
200
|
+
## Stack
|
|
201
|
+
- Language: {detected}
|
|
202
|
+
- Framework: {detected}
|
|
203
|
+
- Linting: {detected}
|
|
204
|
+
|
|
205
|
+
## Conventions
|
|
206
|
+
{inferred from codebase patterns}
|
|
207
|
+
|
|
208
|
+
## Patterns
|
|
209
|
+
{common patterns detected}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### 4. system-architecture.md
|
|
213
|
+
```markdown
|
|
214
|
+
# System Architecture
|
|
215
|
+
|
|
216
|
+
## Overview
|
|
217
|
+
{architecture type}
|
|
218
|
+
|
|
219
|
+
## Components
|
|
220
|
+
| Component | Tech | Purpose |
|
|
221
|
+
|-----------|------|---------|
|
|
222
|
+
| {detected} | {tech} | {purpose} |
|
|
223
|
+
|
|
224
|
+
## Data Flow
|
|
225
|
+
{simple description}
|
|
226
|
+
|
|
227
|
+
## API Structure
|
|
228
|
+
{if detected}
|
|
229
|
+
|
|
230
|
+
## Database
|
|
231
|
+
{if detected}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### 5. design-guidelines.md
|
|
235
|
+
```markdown
|
|
236
|
+
# Design Guidelines
|
|
237
|
+
|
|
238
|
+
## System
|
|
239
|
+
- CSS: {Tailwind/Styled/etc}
|
|
240
|
+
- UI Library: {detected}
|
|
241
|
+
|
|
242
|
+
## Patterns
|
|
243
|
+
{detected patterns}
|
|
244
|
+
|
|
245
|
+
## Responsive
|
|
246
|
+
{breakpoints}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
#### 6. deployment-guide.md
|
|
250
|
+
```markdown
|
|
251
|
+
# Deployment Guide
|
|
252
|
+
|
|
253
|
+
## Platform
|
|
254
|
+
{detected platform}
|
|
255
|
+
|
|
256
|
+
## Quick Deploy
|
|
257
|
+
```bash
|
|
258
|
+
{platform commands}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Environment
|
|
262
|
+
{from .env.example if exists}
|
|
263
|
+
|
|
264
|
+
## Commands
|
|
265
|
+
| Command | Purpose |
|
|
266
|
+
|---------|---------|
|
|
267
|
+
| {from package.json} | {description} |
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### 7. project-roadmap.md
|
|
271
|
+
```markdown
|
|
272
|
+
# Project Roadmap
|
|
273
|
+
|
|
274
|
+
## Current
|
|
275
|
+
{detected state}
|
|
276
|
+
|
|
277
|
+
## Short Term (30d)
|
|
278
|
+
- [ ] Tasks
|
|
279
|
+
|
|
280
|
+
## Medium Term (90d)
|
|
281
|
+
- [ ] Enhancements
|
|
282
|
+
|
|
283
|
+
## Long Term (6mo)
|
|
284
|
+
- [ ] Scale
|
|
285
|
+
|
|
286
|
+
## Tech Debt
|
|
287
|
+
{detected issues}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Step 7: Generate CLAUDE.md
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# Check if CLAUDE.md exists
|
|
294
|
+
test -f CLAUDE.md && echo "EXISTS" || echo "NOT_FOUND"
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Create or update CLAUDE.md:**
|
|
298
|
+
|
|
299
|
+
```markdown
|
|
300
|
+
# {Project Name}
|
|
301
|
+
|
|
302
|
+
> Project-specific context for Claude Code. See `.claude/ROUTING.md` for agent routing rules.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Project Overview
|
|
307
|
+
|
|
308
|
+
{description from package.json or README}
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Tech Stack
|
|
313
|
+
|
|
314
|
+
| Layer | Technology |
|
|
315
|
+
|-------|------------|
|
|
316
|
+
| {detected from package.json} | {with versions} |
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## Project Structure
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
{key directories from analysis}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Key Directories
|
|
329
|
+
|
|
330
|
+
| Directory | Purpose |
|
|
331
|
+
|-----------|---------|
|
|
332
|
+
| {detected} | {description} |
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Quick Commands
|
|
337
|
+
|
|
338
|
+
| Task | Command |
|
|
339
|
+
|------|---------|
|
|
340
|
+
| {from package.json scripts} | `{pm} run {script}` |
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Project Docs (On-demand)
|
|
345
|
+
|
|
346
|
+
| Doc | Purpose | Load when |
|
|
347
|
+
|-----|---------|-----------|
|
|
348
|
+
| `docs/codebase-summary.md` | Project overview | "summary", "overview" |
|
|
349
|
+
| `docs/project-overview-pdr.md` | Product requirements | "requirements", "pdr" |
|
|
350
|
+
| `docs/code-standards.md` | Coding conventions | "standards", "conventions" |
|
|
351
|
+
| `docs/system-architecture.md` | Architecture | "architecture", "design" |
|
|
352
|
+
| `docs/deployment-guide.md` | Deployment | "deploy", "production" |
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Framework Reference
|
|
357
|
+
|
|
358
|
+
See `.claude/ROUTING.md` for agent routing and framework rules.
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
**Last Updated:** {timestamp}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
**Write to file:**
|
|
366
|
+
```bash
|
|
367
|
+
# Generate CLAUDE.md content
|
|
368
|
+
cat > CLAUDE.md << 'EOF'
|
|
369
|
+
# {Project Name}
|
|
370
|
+
|
|
371
|
+
> Project-specific context for Claude Code. See `.claude/ROUTING.md` for agent routing rules.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Project Overview
|
|
376
|
+
|
|
377
|
+
{description}
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Tech Stack
|
|
382
|
+
|
|
383
|
+
| Layer | Technology |
|
|
384
|
+
|-------|------------|
|
|
385
|
+
{tech_stack_rows}
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Project Structure
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
{structure}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## Key Directories
|
|
398
|
+
|
|
399
|
+
| Directory | Purpose |
|
|
400
|
+
|-----------|---------|
|
|
401
|
+
{directory_rows}
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Quick Commands
|
|
406
|
+
|
|
407
|
+
| Task | Command |
|
|
408
|
+
|------|---------|
|
|
409
|
+
{commands_rows}
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Project Docs (On-demand)
|
|
414
|
+
|
|
415
|
+
| Doc | Purpose | Load when |
|
|
416
|
+
|-----|---------|-----------|
|
|
417
|
+
| `docs/codebase-summary.md` | Project overview | "summary", "overview" |
|
|
418
|
+
| `docs/project-overview-pdr.md` | Product requirements | "requirements", "pdr" |
|
|
419
|
+
| `docs/code-standards.md` | Coding conventions | "standards", "conventions" |
|
|
420
|
+
| `docs/system-architecture.md` | Architecture | "architecture", "design" |
|
|
421
|
+
| `docs/design-guidelines.md` | UI/UX standards | "design", "ui", "ux" |
|
|
422
|
+
| `docs/deployment-guide.md` | Deployment | "deploy", "production" |
|
|
423
|
+
| `docs/project-roadmap.md` | Roadmap | "roadmap", "future" |
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Framework Reference
|
|
428
|
+
|
|
429
|
+
See `.claude/ROUTING.md` for agent routing and framework rules.
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
**Last Updated:** {timestamp}
|
|
434
|
+
EOF
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### Step 8: Report
|
|
438
|
+
|
|
439
|
+
```markdown
|
|
440
|
+
✅ Documentation initialized!
|
|
441
|
+
|
|
442
|
+
📊 Detected:
|
|
443
|
+
- Project: {name}
|
|
444
|
+
- Type: {type}
|
|
445
|
+
- Stack: {summary}
|
|
446
|
+
- Files: {count} | Tokens: {count}
|
|
447
|
+
|
|
448
|
+
📁 Generated (docs/):
|
|
449
|
+
✓ codebase-summary.md
|
|
450
|
+
✓ project-overview-pdr.md
|
|
451
|
+
✓ code-standards.md
|
|
452
|
+
✓ system-architecture.md
|
|
453
|
+
✓ design-guidelines.md
|
|
454
|
+
✓ deployment-guide.md
|
|
455
|
+
✓ project-roadmap.md
|
|
456
|
+
|
|
457
|
+
📝 Also created:
|
|
458
|
+
✓ repomix-output.xml (AI context)
|
|
459
|
+
✓ CLAUDE.md (root)
|
|
460
|
+
|
|
461
|
+
🚀 Next: Run `/docs update` after code changes
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## UPDATE Workflow (`/docs update`)
|
|
467
|
+
|
|
468
|
+
### Step 1: Verify
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
# Check docs/ exists
|
|
472
|
+
ls docs/ 2>/dev/null || echo "ERROR: Run '/docs init' first"
|
|
473
|
+
|
|
474
|
+
# Backup
|
|
475
|
+
cp -r docs docs.backup.$(date +%Y%m%d_%H%M%S)
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### Step 2: Ensure Repomix Installed
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
# Check if repomix is installed
|
|
482
|
+
which repomix 2>/dev/null || npm list -g repomix 2>/dev/null
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**If repomix not found:**
|
|
486
|
+
- Detect package manager
|
|
487
|
+
- Install repomix globally
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
# Detect package manager
|
|
491
|
+
test -f pnpm-lock.yaml && PM="pnpm"
|
|
492
|
+
test -f yarn.lock && PM="yarn"
|
|
493
|
+
test -f bun.lockb && PM="bun"
|
|
494
|
+
PM="${PM:-npm}"
|
|
495
|
+
|
|
496
|
+
# Install repomix
|
|
497
|
+
$PM install -g repomix
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
### Step 3: Re-analyze
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
# Fresh repomix
|
|
504
|
+
repomix
|
|
505
|
+
|
|
506
|
+
# Detect changes
|
|
507
|
+
git diff --stat HEAD~5..HEAD 2>/dev/null
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Step 4: Update Files
|
|
511
|
+
|
|
512
|
+
Read existing docs, merge with new analysis:
|
|
513
|
+
|
|
514
|
+
1. **codebase-summary.md** - Refresh stats, structure
|
|
515
|
+
2. **project-overview-pdr.md** - Add new features
|
|
516
|
+
3. **code-standards.md** - Update patterns
|
|
517
|
+
4. **system-architecture.md** - Sync components
|
|
518
|
+
5. **design-guidelines.md** - Refresh UI patterns
|
|
519
|
+
6. **deployment-guide.md** - Update commands
|
|
520
|
+
7. **project-roadmap.md** - Mark progress
|
|
521
|
+
|
|
522
|
+
### Step 5: Update CLAUDE.md
|
|
523
|
+
|
|
524
|
+
Update `CLAUDE.md` with latest project info:
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
# Read existing CLAUDE.md if exists
|
|
528
|
+
test -f CLAUDE.md && cat CLAUDE.md || echo "NOT_FOUND"
|
|
529
|
+
|
|
530
|
+
# Update key sections:
|
|
531
|
+
# - Tech Stack (from package.json)
|
|
532
|
+
# - Project Structure (from repomix)
|
|
533
|
+
# - Quick Commands (from package.json scripts)
|
|
534
|
+
# - Last Updated timestamp
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
**Update content:**
|
|
538
|
+
- Refresh "Tech Stack" table with latest versions
|
|
539
|
+
- Update "Project Structure" if directories changed
|
|
540
|
+
- Sync "Quick Commands" with package.json scripts
|
|
541
|
+
- Update "Last Updated" timestamp
|
|
542
|
+
|
|
543
|
+
**If CLAUDE.md doesn't exist:**
|
|
544
|
+
- Create new following INIT workflow template
|
|
545
|
+
|
|
546
|
+
### Step 6: Report
|
|
547
|
+
|
|
548
|
+
```markdown
|
|
549
|
+
🔄 Documentation updated!
|
|
550
|
+
|
|
551
|
+
📊 Changes:
|
|
552
|
+
- Files: {old} → {new}
|
|
553
|
+
- Tokens: {old} → {new}
|
|
554
|
+
|
|
555
|
+
📝 Updated:
|
|
556
|
+
✓ codebase-summary.md
|
|
557
|
+
✓ project-overview-pdr.md
|
|
558
|
+
✓ code-standards.md
|
|
559
|
+
✓ system-architecture.md
|
|
560
|
+
✓ design-guidelines.md
|
|
561
|
+
✓ deployment-guide.md
|
|
562
|
+
✓ project-roadmap.md
|
|
563
|
+
✓ CLAUDE.md (root)
|
|
564
|
+
|
|
565
|
+
💡 Review docs/ for any manual adjustments needed
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
## HELP (no valid subcommand)
|
|
571
|
+
|
|
572
|
+
```markdown
|
|
573
|
+
/docs - Documentation Management
|
|
574
|
+
|
|
575
|
+
Usage:
|
|
576
|
+
/docs init - Create initial documentation
|
|
577
|
+
/docs update - Update docs after code changes
|
|
578
|
+
|
|
579
|
+
Options:
|
|
580
|
+
--focus=dir1,dir2 - Focus on specific directories
|
|
581
|
+
--dir=./path - Target specific directory
|
|
582
|
+
|
|
583
|
+
Examples:
|
|
584
|
+
/docs init
|
|
585
|
+
/docs init --focus=src,api
|
|
586
|
+
/docs update
|
|
587
|
+
/docs update --focus=ui
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
## Error Handling
|
|
593
|
+
|
|
594
|
+
| Scenario | Action |
|
|
595
|
+
|----------|--------|
|
|
596
|
+
| repomix not found | Warn, continue with manual analysis |
|
|
597
|
+
| No package.json | Ask user for project type |
|
|
598
|
+
| docs/ exists (init) | Ask: Overwrite/Merge/Skip |
|
|
599
|
+
| docs/ not found (update) | Prompt to run `/docs init` |
|
|
600
|
+
| Permission denied | Report path, suggest fix |
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## Notes
|
|
605
|
+
|
|
606
|
+
- Always use detected values, never placeholders
|
|
607
|
+
- Include versions: "Next.js 14.1.0" not "Next.js"
|
|
608
|
+
- repomix-output.xml helps AI understand full context
|
|
609
|
+
- 7 docs files = comprehensive coverage
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: ⚡⚡⚡ Ultrathink edge cases, then parallel verify with code-reviewers
|
|
3
|
+
argument-hint: [scope-or-prompt]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
**Ultrathink** to exhaustively list ALL potential edge cases, then dispatch parallel `code-reviewer` agents to verify: <scope>$ARGUMENTS</scope>
|
|
7
|
+
|
|
8
|
+
**IMPORTANT:** Activate needed skills. Ensure token efficiency. Sacrifice grammar for concision.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
### 1. Ultrathink Edge Cases
|
|
13
|
+
|
|
14
|
+
Main agent deeply analyzes the scope to LIST all potential edge cases FIRST:
|
|
15
|
+
- Read `codebase-summary.md` for context
|
|
16
|
+
- Use `/scout:ext` to find relevant files
|
|
17
|
+
- **Think exhaustively** about what could go wrong:
|
|
18
|
+
- Null/undefined scenarios
|
|
19
|
+
- Boundary conditions (off-by-one, empty, max values)
|
|
20
|
+
- Error handling gaps
|
|
21
|
+
- Race conditions, async edge cases
|
|
22
|
+
- Input validation holes
|
|
23
|
+
- Security vulnerabilities
|
|
24
|
+
- Resource leaks
|
|
25
|
+
- Untested code paths
|
|
26
|
+
|
|
27
|
+
**Output format:**
|
|
28
|
+
```markdown
|
|
29
|
+
## Edge Cases Identified
|
|
30
|
+
|
|
31
|
+
### Category: [scope-area]
|
|
32
|
+
1. [edge case description] → files: [file1, file2]
|
|
33
|
+
2. [edge case description] → files: [file3]
|
|
34
|
+
|
|
35
|
+
### Category: [another-area]
|
|
36
|
+
1. [edge case description] → files: [file4, file5]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Categorize & Assign
|
|
40
|
+
|
|
41
|
+
Group edge cases by similar scope for parallel verification:
|
|
42
|
+
- Each category → one `code-reviewer` agent
|
|
43
|
+
- Max 6 categories (merge small ones)
|
|
44
|
+
- Each reviewer gets specific edge cases to VERIFY, not discover
|
|
45
|
+
|
|
46
|
+
### 3. Parallel Verification
|
|
47
|
+
|
|
48
|
+
Launch N `code-reviewer` subagents simultaneously:
|
|
49
|
+
- Pass: category name, list of edge cases, relevant files
|
|
50
|
+
- Task: **VERIFY** if each edge case is properly handled in code
|
|
51
|
+
- Report: which edge cases are handled vs unhandled
|
|
52
|
+
|
|
53
|
+
**Reviewer instruction:**
|
|
54
|
+
```
|
|
55
|
+
Verify these specific edge cases in the given files:
|
|
56
|
+
[list of edge cases]
|
|
57
|
+
|
|
58
|
+
For each, report:
|
|
59
|
+
- ✅ Handled: [how it's handled]
|
|
60
|
+
- ❌ Unhandled: [what's missing]
|
|
61
|
+
- ⚠️ Partial: [what needs improvement]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 4. Aggregate Results
|
|
65
|
+
|
|
66
|
+
Collect all verification reports:
|
|
67
|
+
```markdown
|
|
68
|
+
## Edge Case Verification Report
|
|
69
|
+
|
|
70
|
+
### Summary
|
|
71
|
+
- Total edge cases: X
|
|
72
|
+
- Handled: Y ✅
|
|
73
|
+
- Unhandled: Z ❌
|
|
74
|
+
- Partial: W ⚠️
|
|
75
|
+
|
|
76
|
+
### Unhandled Edge Cases (Need Fix)
|
|
77
|
+
| # | Edge Case | File | Status |
|
|
78
|
+
|---|-----------|------|--------|
|
|
79
|
+
| 1 | ... | ... | ❌ |
|
|
80
|
+
|
|
81
|
+
### Partial Handling (Need Review)
|
|
82
|
+
| # | Edge Case | File | Issue |
|
|
83
|
+
|---|-----------|------|-------|
|
|
84
|
+
| 1 | ... | ... | ... |
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 5. Auto-Fix Pipeline
|
|
88
|
+
|
|
89
|
+
**IF** unhandled/partial edge cases found:
|
|
90
|
+
- Ask: "Found N unhandled edge cases. Fix with /fix --parallel? [Y/n]"
|
|
91
|
+
- **IF yes:** Trigger `/fix --parallel` with unhandled list
|
|
92
|
+
|
|
93
|
+
### 6. Final Report
|
|
94
|
+
|
|
95
|
+
- Summary of verification
|
|
96
|
+
- Ask: "Commit? [Y/n]" → use `git-manager`
|
|
97
|
+
|
|
98
|
+
## Example
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
User: /review:codebase:parallel auth module
|
|
102
|
+
|
|
103
|
+
1. Ultrathink → Lists 12 edge cases for auth:
|
|
104
|
+
- Empty password submission
|
|
105
|
+
- Token expiry during request
|
|
106
|
+
- Concurrent login attempts
|
|
107
|
+
- Invalid refresh token
|
|
108
|
+
...
|
|
109
|
+
|
|
110
|
+
2. Categorize → 3 groups:
|
|
111
|
+
- Login flow (4 cases)
|
|
112
|
+
- Token handling (5 cases)
|
|
113
|
+
- Session management (3 cases)
|
|
114
|
+
|
|
115
|
+
3. Parallel → 3 code-reviewers verify simultaneously
|
|
116
|
+
|
|
117
|
+
4. Aggregate → 8 handled, 3 unhandled, 1 partial
|
|
118
|
+
|
|
119
|
+
5. Fix → User approves → /fix --parallel
|
|
120
|
+
|
|
121
|
+
6. Final → Commit changes
|
|
122
|
+
```
|