agileflow 2.77.0 → 2.79.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 +6 -6
- package/package.json +6 -1
- package/scripts/agileflow-configure.js +174 -2
- package/scripts/agileflow-statusline.sh +171 -78
- package/scripts/agileflow-welcome.js +88 -64
- package/scripts/auto-self-improve.js +23 -45
- package/scripts/check-update.js +35 -42
- package/scripts/damage-control/bash-tool-damage-control.js +257 -0
- package/scripts/damage-control/edit-tool-damage-control.js +279 -0
- package/scripts/damage-control/patterns.yaml +227 -0
- package/scripts/damage-control/write-tool-damage-control.js +274 -0
- package/scripts/damage-control-bash.js +232 -0
- package/scripts/damage-control-edit.js +243 -0
- package/scripts/damage-control-write.js +243 -0
- package/scripts/obtain-context.js +22 -3
- package/scripts/ralph-loop.js +191 -63
- package/scripts/screenshot-verifier.js +213 -0
- package/scripts/session-manager.js +12 -33
- package/src/core/agents/accessibility.md +124 -53
- package/src/core/agents/adr-writer.md +192 -52
- package/src/core/agents/analytics.md +139 -60
- package/src/core/agents/api.md +173 -63
- package/src/core/agents/ci.md +139 -57
- package/src/core/agents/compliance.md +159 -68
- package/src/core/agents/configuration/damage-control.md +356 -0
- package/src/core/agents/configuration-damage-control.md +248 -0
- package/src/core/agents/database.md +162 -61
- package/src/core/agents/datamigration.md +179 -66
- package/src/core/agents/design.md +179 -57
- package/src/core/agents/devops.md +160 -3
- package/src/core/agents/documentation.md +204 -60
- package/src/core/agents/epic-planner.md +147 -55
- package/src/core/agents/integrations.md +197 -69
- package/src/core/agents/mentor.md +158 -57
- package/src/core/agents/mobile.md +159 -67
- package/src/core/agents/monitoring.md +154 -65
- package/src/core/agents/multi-expert.md +115 -43
- package/src/core/agents/orchestrator.md +77 -24
- package/src/core/agents/performance.md +130 -75
- package/src/core/agents/product.md +151 -55
- package/src/core/agents/qa.md +162 -74
- package/src/core/agents/readme-updater.md +178 -76
- package/src/core/agents/refactor.md +148 -95
- package/src/core/agents/research.md +143 -72
- package/src/core/agents/security.md +154 -65
- package/src/core/agents/testing.md +176 -97
- package/src/core/agents/ui.md +170 -79
- package/src/core/commands/adr/list.md +171 -0
- package/src/core/commands/adr/update.md +235 -0
- package/src/core/commands/adr/view.md +252 -0
- package/src/core/commands/adr.md +207 -50
- package/src/core/commands/agent.md +16 -0
- package/src/core/commands/assign.md +148 -44
- package/src/core/commands/auto.md +18 -1
- package/src/core/commands/babysit.md +391 -38
- package/src/core/commands/baseline.md +14 -0
- package/src/core/commands/blockers.md +170 -51
- package/src/core/commands/board.md +144 -66
- package/src/core/commands/changelog.md +15 -0
- package/src/core/commands/ci.md +179 -69
- package/src/core/commands/compress.md +18 -0
- package/src/core/commands/configure.md +16 -0
- package/src/core/commands/context/export.md +193 -4
- package/src/core/commands/context/full.md +191 -18
- package/src/core/commands/context/note.md +248 -4
- package/src/core/commands/debt.md +17 -0
- package/src/core/commands/deploy.md +208 -65
- package/src/core/commands/deps.md +15 -0
- package/src/core/commands/diagnose.md +16 -0
- package/src/core/commands/docs.md +196 -64
- package/src/core/commands/epic/list.md +170 -0
- package/src/core/commands/epic/view.md +242 -0
- package/src/core/commands/epic.md +192 -69
- package/src/core/commands/feedback.md +191 -71
- package/src/core/commands/handoff.md +162 -48
- package/src/core/commands/help.md +9 -0
- package/src/core/commands/ideate.md +446 -0
- package/src/core/commands/impact.md +16 -0
- package/src/core/commands/metrics.md +141 -37
- package/src/core/commands/multi-expert.md +77 -0
- package/src/core/commands/packages.md +16 -0
- package/src/core/commands/pr.md +161 -67
- package/src/core/commands/readme-sync.md +16 -0
- package/src/core/commands/research/analyze.md +568 -0
- package/src/core/commands/research/ask.md +345 -20
- package/src/core/commands/research/import.md +562 -19
- package/src/core/commands/research/list.md +173 -5
- package/src/core/commands/research/view.md +181 -8
- package/src/core/commands/retro.md +135 -48
- package/src/core/commands/review.md +219 -47
- package/src/core/commands/session/end.md +209 -0
- package/src/core/commands/session/history.md +210 -0
- package/src/core/commands/session/init.md +116 -0
- package/src/core/commands/session/new.md +296 -0
- package/src/core/commands/session/resume.md +166 -0
- package/src/core/commands/session/status.md +166 -0
- package/src/core/commands/setup/visual-e2e.md +462 -0
- package/src/core/commands/skill/create.md +115 -17
- package/src/core/commands/skill/delete.md +117 -0
- package/src/core/commands/skill/edit.md +104 -0
- package/src/core/commands/skill/list.md +128 -0
- package/src/core/commands/skill/test.md +135 -0
- package/src/core/commands/skill/upgrade.md +542 -0
- package/src/core/commands/sprint.md +17 -1
- package/src/core/commands/status.md +133 -21
- package/src/core/commands/story/list.md +176 -0
- package/src/core/commands/story/view.md +265 -0
- package/src/core/commands/story-validate.md +101 -1
- package/src/core/commands/story.md +204 -51
- package/src/core/commands/template.md +16 -1
- package/src/core/commands/tests.md +226 -64
- package/src/core/commands/update.md +17 -1
- package/src/core/commands/validate-expertise.md +16 -0
- package/src/core/commands/velocity.md +140 -36
- package/src/core/commands/verify.md +14 -0
- package/src/core/commands/whats-new.md +30 -0
- package/src/core/skills/_learnings/README.md +91 -0
- package/src/core/skills/_learnings/_template.yaml +106 -0
- package/src/core/skills/_learnings/code-review.yaml +118 -0
- package/src/core/skills/_learnings/commit.yaml +69 -0
- package/src/core/skills/_learnings/story-writer.yaml +71 -0
- package/src/core/templates/damage-control-patterns.yaml +234 -0
- package/src/core/templates/skill-template.md +53 -11
- package/tools/cli/commands/start.js +180 -0
- package/tools/cli/installers/ide/claude-code.js +127 -0
- package/tools/cli/tui/Dashboard.js +66 -0
- package/tools/cli/tui/StoryList.js +69 -0
- package/tools/cli/tui/index.js +16 -0
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Set up automated deployment pipeline
|
|
3
3
|
argument-hint: (no arguments)
|
|
4
|
+
compact_context:
|
|
5
|
+
priority: high
|
|
6
|
+
preserve_rules:
|
|
7
|
+
- "Auto-detect project type (static, full-stack, mobile, containers, serverless)"
|
|
8
|
+
- "Recommend deployment platform based on project (Vercel for Next.js, Netlify for static, Railway for containers)"
|
|
9
|
+
- "ALWAYS show configuration preview and wait for YES/NO before creating files"
|
|
10
|
+
- "Generate platform-specific config (vercel.json, netlify.toml, Dockerfile, etc.)"
|
|
11
|
+
- "Create .env.example template with all required secrets (never commit actual secrets)"
|
|
12
|
+
- "Create CI/CD workflow (.github/workflows/deploy.yml) with staging+production environments"
|
|
13
|
+
state_fields:
|
|
14
|
+
- project_type
|
|
15
|
+
- detected_platform
|
|
16
|
+
- environments_configured
|
|
17
|
+
- secrets_template_created
|
|
4
18
|
---
|
|
5
19
|
|
|
6
20
|
# setup-deployment
|
|
@@ -15,89 +29,218 @@ If the user confirms they want the full details, continue. Otherwise, stop here.
|
|
|
15
29
|
Automatically set up deployment pipeline for the project.
|
|
16
30
|
|
|
17
31
|
<!-- COMPACT_SUMMARY_START -->
|
|
18
|
-
## Compact Summary
|
|
19
32
|
|
|
20
|
-
|
|
33
|
+
## ⚠️ COMPACT SUMMARY - /agileflow:setup-deployment IS ACTIVE
|
|
34
|
+
|
|
35
|
+
**CRITICAL**: You are configuring deployment pipeline for production. Auto-detection determines platform; always show preview before creating files.
|
|
36
|
+
|
|
37
|
+
**ROLE**: Deployment Configurator - Auto-detect project type, recommend platform, generate configs, create CI/CD workflow
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### 🚨 RULE #1: AUTO-DETECT PROJECT TYPE
|
|
42
|
+
|
|
43
|
+
Always detect first (before prompting for platform):
|
|
44
|
+
- **Static**: package.json + only build script (no server)
|
|
45
|
+
- **Full-stack**: Express/FastAPI/Next.js API routes
|
|
46
|
+
- **Mobile**: expo config or react-native
|
|
47
|
+
- **Containers**: Dockerfile present
|
|
48
|
+
- **Serverless**: Lambda functions or serverless.yml
|
|
49
|
+
|
|
50
|
+
If unclear, ask user: "Is this [static/full-stack/containers]?"
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### 🚨 RULE #2: PLATFORM RECOMMENDATIONS
|
|
55
|
+
|
|
56
|
+
| Project Type | Recommended | Reason |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| Next.js | **Vercel** | Built for Next.js, no config needed |
|
|
59
|
+
| React SPA | **Netlify** | Static + built-in redirects |
|
|
60
|
+
| Node.js server | **Railway** | Cheap, Docker-based, easy |
|
|
61
|
+
| Docker container | **Fly.io** | Native container support |
|
|
62
|
+
| Expo/React Native | **EAS** | Official Expo deployment |
|
|
63
|
+
| AWS preference | **Lambda + API Gateway** | FaaS with full control |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### 🚨 RULE #3: DIFF-FIRST PATTERN
|
|
68
|
+
|
|
69
|
+
ALWAYS preview all generated files before creating:
|
|
21
70
|
|
|
22
|
-
**Quick Usage**:
|
|
23
71
|
```
|
|
24
|
-
|
|
72
|
+
Deployment Setup for: Next.js web app
|
|
73
|
+
Recommended platform: Vercel
|
|
74
|
+
|
|
75
|
+
Will create:
|
|
76
|
+
✓ vercel.json (deployment config)
|
|
77
|
+
✓ .github/workflows/deploy.yml (CI/CD)
|
|
78
|
+
✓ .env.example (secrets template)
|
|
79
|
+
✓ docs/02-practices/deployment.md (guide)
|
|
80
|
+
|
|
81
|
+
Environments:
|
|
82
|
+
• Staging: staging.example.com (branch: staging)
|
|
83
|
+
• Production: example.com (branch: main)
|
|
84
|
+
|
|
85
|
+
Proceed? (YES/NO)
|
|
25
86
|
```
|
|
26
87
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
Then ask: "Create deployment configuration? (YES/NO)"
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### 🚨 RULE #4: ENVIRONMENT CONFIGURATION
|
|
93
|
+
|
|
94
|
+
Always create BOTH environments (unless ENV=production specified):
|
|
95
|
+
|
|
96
|
+
**Staging**:
|
|
97
|
+
- Branch: staging
|
|
98
|
+
- URL: staging.example.com or staging.vercel.app
|
|
99
|
+
- Database: Staging DB
|
|
100
|
+
- Secrets from: STAGING_* variables
|
|
101
|
+
|
|
102
|
+
**Production**:
|
|
103
|
+
- Branch: main
|
|
104
|
+
- URL: example.com
|
|
105
|
+
- Database: Production DB
|
|
106
|
+
- Secrets from: PROD_* variables
|
|
107
|
+
|
|
108
|
+
Both workflows deploy automatically on push.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### 🚨 RULE #5: SECRETS MANAGEMENT
|
|
113
|
+
|
|
114
|
+
**NEVER** commit actual secrets to git:
|
|
115
|
+
1. Create `.env.example` with placeholder values
|
|
116
|
+
2. Create `docs/02-practices/secrets-management.md` with instructions
|
|
117
|
+
3. Show user how to add secrets to platform:
|
|
118
|
+
- Vercel: `vercel env add DATABASE_URL`
|
|
119
|
+
- Heroku: `heroku config:set DATABASE_URL=...`
|
|
120
|
+
- GitHub Actions: Settings → Secrets → Actions
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### 🚨 RULE #6: USE TodoWrite FOR TRACKING
|
|
125
|
+
|
|
126
|
+
Track all 8 steps explicitly:
|
|
64
127
|
```xml
|
|
65
128
|
<invoke name="TodoWrite">
|
|
66
129
|
<parameter name="content">
|
|
67
|
-
1. Detect project type
|
|
68
|
-
2. Recommend platform
|
|
69
|
-
3. Generate
|
|
70
|
-
4. Create CI/CD workflow
|
|
71
|
-
5. Create .env.example
|
|
72
|
-
6.
|
|
73
|
-
7.
|
|
74
|
-
8. Display next steps
|
|
130
|
+
1. Detect project type
|
|
131
|
+
2. Recommend platform
|
|
132
|
+
3. Generate config files
|
|
133
|
+
4. Create CI/CD workflow
|
|
134
|
+
5. Create .env.example
|
|
135
|
+
6. Create deployment docs
|
|
136
|
+
7. Show preview + confirm
|
|
137
|
+
8. Display next steps
|
|
75
138
|
</parameter>
|
|
76
139
|
<parameter name="status">in-progress</parameter>
|
|
77
140
|
</invoke>
|
|
78
141
|
```
|
|
79
142
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### ANTI-PATTERNS (DON'T DO THESE)
|
|
146
|
+
|
|
147
|
+
❌ Skip platform detection, use user's first choice
|
|
148
|
+
❌ Create files without preview
|
|
149
|
+
❌ Hardcode secrets in config files
|
|
150
|
+
❌ Only create production environment
|
|
151
|
+
❌ Forget to create .env.example template
|
|
152
|
+
❌ Create deployment docs without next steps
|
|
153
|
+
|
|
154
|
+
### DO THESE INSTEAD
|
|
155
|
+
|
|
156
|
+
✅ Auto-detect project type first
|
|
157
|
+
✅ Show full preview before creating
|
|
158
|
+
✅ Use .env.example with placeholders
|
|
159
|
+
✅ Create staging + production (unless specified)
|
|
160
|
+
✅ Create .env.example + secrets management guide
|
|
161
|
+
✅ Display clear next steps checklist
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### WORKFLOW PHASES
|
|
166
|
+
|
|
167
|
+
**Phase 1: Detection (Steps 1-2)**
|
|
168
|
+
- Scan for package.json, Dockerfile, etc.
|
|
169
|
+
- Detect project type
|
|
170
|
+
- Recommend platform
|
|
171
|
+
|
|
172
|
+
**Phase 2: Generation (Steps 3-6)**
|
|
173
|
+
- Generate platform-specific config
|
|
174
|
+
- Generate CI/CD workflow with both envs
|
|
175
|
+
- Generate .env.example with all required vars
|
|
176
|
+
- Generate deployment guide
|
|
177
|
+
|
|
178
|
+
**Phase 3: Preview & Confirm (Step 7)**
|
|
179
|
+
- Display all files side-by-side
|
|
180
|
+
- Ask: "Create deployment configuration? (YES/NO)"
|
|
181
|
+
|
|
182
|
+
**Phase 4: Complete (Step 8)**
|
|
183
|
+
- Write all files
|
|
184
|
+
- Display next steps checklist
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
### NEXT STEPS TO DISPLAY
|
|
189
|
+
|
|
91
190
|
```
|
|
92
191
|
✅ Deployment configured for Vercel!
|
|
93
192
|
|
|
94
193
|
Next steps:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
194
|
+
|
|
195
|
+
1. Add secrets to Vercel:
|
|
196
|
+
vercel env add DATABASE_URL production
|
|
197
|
+
vercel env add API_KEY production
|
|
198
|
+
[... more secrets from .env.example]
|
|
199
|
+
|
|
200
|
+
2. Link repository to Vercel:
|
|
201
|
+
vercel link
|
|
202
|
+
|
|
203
|
+
3. Test staging deploy:
|
|
204
|
+
git checkout -b staging
|
|
205
|
+
git push origin staging
|
|
206
|
+
Check: https://staging.vercel.app
|
|
207
|
+
|
|
208
|
+
4. Test production deploy:
|
|
209
|
+
git push origin main
|
|
210
|
+
Check: https://example.com
|
|
211
|
+
|
|
212
|
+
5. Set up custom domain (if needed):
|
|
213
|
+
vercel domains add example.com
|
|
214
|
+
|
|
215
|
+
Documentation: docs/02-practices/deployment.md
|
|
216
|
+
Secrets guide: docs/02-practices/secrets-management.md
|
|
100
217
|
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### KEY FILES TO REMEMBER
|
|
222
|
+
|
|
223
|
+
| File | Purpose |
|
|
224
|
+
|------|---------|
|
|
225
|
+
| `vercel.json` (or platform equivalent) | Deployment configuration |
|
|
226
|
+
| `.github/workflows/deploy.yml` | CI/CD workflow for both environments |
|
|
227
|
+
| `.env.example` | Template for all required secrets |
|
|
228
|
+
| `docs/02-practices/deployment.md` | Team deployment guide |
|
|
229
|
+
| `docs/02-practices/secrets-management.md` | How to add secrets |
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### REMEMBER AFTER COMPACTION
|
|
234
|
+
|
|
235
|
+
- `/agileflow:setup-deployment` IS ACTIVE - configure deployment
|
|
236
|
+
- Always auto-detect project type first
|
|
237
|
+
- Recommend appropriate platform based on type
|
|
238
|
+
- ALWAYS show preview before creating files
|
|
239
|
+
- Create BOTH staging and production (unless specified)
|
|
240
|
+
- Create .env.example template (never commit actual secrets)
|
|
241
|
+
- Use TodoWrite to track 8 steps
|
|
242
|
+
- Display next steps with exact commands
|
|
243
|
+
|
|
101
244
|
<!-- COMPACT_SUMMARY_END -->
|
|
102
245
|
|
|
103
246
|
## Prompt
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
description: Visualize dependency graph with critical path detection
|
|
3
3
|
argument-hint: [SCOPE=story|epic|all] [EPIC=<id>] [STORY=<id>] [FORMAT=ascii|mermaid|graphviz|json] [ANALYSIS=critical-path|circular|blocking|all]
|
|
4
4
|
model: haiku
|
|
5
|
+
compact_context:
|
|
6
|
+
priority: high
|
|
7
|
+
preserve_rules:
|
|
8
|
+
- "Parse dependencies from TWO sources: 1) Story frontmatter (depends_on/blocks fields), 2) Bus log (implicit blocked events)"
|
|
9
|
+
- "Build adjacency list graph and run DFS for critical path analysis"
|
|
10
|
+
- "Detect circular dependencies as ERRORS (cannot complete - flag prominently)"
|
|
11
|
+
- "Calculate blocking impact: stories that block multiple others are bottlenecks"
|
|
12
|
+
- "Generate ASCII tree with legend, critical path highlighted, blocking stories marked"
|
|
13
|
+
- "Support multiple formats: ascii (default), mermaid, graphviz, json"
|
|
14
|
+
- "Provide actionable recommendations: work on blockers first, parallelize independent stories"
|
|
15
|
+
state_fields:
|
|
16
|
+
- scope_analyzed
|
|
17
|
+
- circular_deps_detected
|
|
18
|
+
- critical_path_calculated
|
|
19
|
+
- blocking_stories_identified
|
|
5
20
|
---
|
|
6
21
|
|
|
7
22
|
# dependencies
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: System health diagnostics
|
|
3
|
+
compact_context:
|
|
4
|
+
priority: high
|
|
5
|
+
preserve_rules:
|
|
6
|
+
- "No arguments required - runs full system diagnostics automatically"
|
|
7
|
+
- "Run 4 validation checks: JSON files, auto-archival, hooks system, file sizes"
|
|
8
|
+
- "JSON Validation CRITICAL - validate status.json, metadata, settings with jq empty"
|
|
9
|
+
- "Auto-Archival System - check script executable and hook configuration"
|
|
10
|
+
- "Hooks System - validate .claude/settings.json structure"
|
|
11
|
+
- "File Size Analysis - warn if status.json exceeds 100KB"
|
|
12
|
+
- "Report issues with indicators: ✅ (pass), ❌ (fail), ⚠️ (warn), ℹ️ (info)"
|
|
13
|
+
- "Exit code 0 (healthy) or 1 (issues found)"
|
|
14
|
+
state_fields:
|
|
15
|
+
- total_checks
|
|
16
|
+
- passed_checks
|
|
17
|
+
- warning_count
|
|
18
|
+
- failure_count
|
|
3
19
|
---
|
|
4
20
|
|
|
5
21
|
# diagnose
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Synchronize documentation with code changes
|
|
3
3
|
argument-hint: [BRANCH=<name>] [BASE=<branch>] [AUTO_CREATE=yes|no]
|
|
4
|
+
compact_context:
|
|
5
|
+
priority: high
|
|
6
|
+
preserve_rules:
|
|
7
|
+
- "Compare BRANCH against BASE using git diff"
|
|
8
|
+
- "Categorize changes: API, UI, services, config, database"
|
|
9
|
+
- "Generate gap report: missing, outdated, up-to-date docs"
|
|
10
|
+
- "NEVER delete docs without explicit approval"
|
|
11
|
+
- "ALWAYS use diff-first, YES/NO pattern before writing"
|
|
12
|
+
- "PRESERVE custom content - use managed section markers"
|
|
13
|
+
- "INFER docs from TypeScript types, JSDoc, OpenAPI, tests"
|
|
14
|
+
- "Optional AUTO_CREATE mode auto-generates all missing docs"
|
|
15
|
+
state_fields:
|
|
16
|
+
- branch_name
|
|
17
|
+
- base_branch
|
|
18
|
+
- auto_create_flag
|
|
4
19
|
---
|
|
5
20
|
|
|
6
21
|
# docs-sync
|
|
@@ -18,76 +33,180 @@ node .agileflow/scripts/obtain-context.js docs
|
|
|
18
33
|
---
|
|
19
34
|
|
|
20
35
|
<!-- COMPACT_SUMMARY_START -->
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- Suggest PR checklist item: "- [ ] Documentation updated"
|
|
66
|
-
- Recommend CI integration for automated checks
|
|
67
|
-
|
|
68
|
-
**Gap Report Format**:
|
|
36
|
+
|
|
37
|
+
## ⚠️ COMPACT SUMMARY - /agileflow:docs-sync IS ACTIVE
|
|
38
|
+
|
|
39
|
+
**CRITICAL**: You are detecting code changes and synchronizing documentation. Goal: prevent documentation drift.
|
|
40
|
+
|
|
41
|
+
**ROLE**: Documentation Synchronizer
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### 🚨 RULE #1: COMPARE BRANCHES AND DETECT CHANGES
|
|
46
|
+
|
|
47
|
+
Use git diff to compare BRANCH against BASE:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git diff <BASE>...<BRANCH> --name-status
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Categorize changes:
|
|
54
|
+
- **API endpoints**: src/api/, src/routes/, src/controllers/
|
|
55
|
+
- **UI components**: src/components/, src/pages/
|
|
56
|
+
- **Services**: src/services/, src/utils/
|
|
57
|
+
- **Config**: *.config.js, *.yml, .env.example
|
|
58
|
+
- **Database**: migrations/, schema/
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### 🚨 RULE #2: MAP TO EXPECTED DOCUMENTATION
|
|
63
|
+
|
|
64
|
+
For each changed file, map to expected docs:
|
|
65
|
+
|
|
66
|
+
| Code Change | Expected Doc Location | Gap Status |
|
|
67
|
+
|-------------|----------------------|-----------|
|
|
68
|
+
| New API endpoint | docs/04-architecture/api.md | Check section exists |
|
|
69
|
+
| New UI component | docs/04-architecture/components.md | Check section exists |
|
|
70
|
+
| New service/utility | docs/04-architecture/services.md | Check section exists |
|
|
71
|
+
| Config change | docs/02-practices/configuration.md | Check referenced |
|
|
72
|
+
| Database migration | docs/04-architecture/database.md | Check documented |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### 🚨 RULE #3: GENERATE GAP REPORT
|
|
77
|
+
|
|
78
|
+
Always create gap report showing status for each change:
|
|
79
|
+
|
|
69
80
|
```markdown
|
|
70
81
|
# Documentation Sync Report
|
|
71
|
-
**Branch**:
|
|
82
|
+
**Branch**: feature/auth | **Base**: main | **Generated**: 2025-12-22T10:30Z
|
|
72
83
|
|
|
73
|
-
## Missing Documentation
|
|
74
|
-
|
|
75
|
-
- ❌
|
|
84
|
+
## Missing Documentation (3)
|
|
85
|
+
- ❌ POST /api/auth/login (src/api/auth/login.ts)
|
|
86
|
+
- ❌ LoginForm component (src/components/LoginForm.tsx)
|
|
87
|
+
- ❌ JWT_SECRET env var (.env.example)
|
|
76
88
|
|
|
77
|
-
## Outdated Documentation
|
|
78
|
-
- 📄
|
|
89
|
+
## Outdated Documentation (1)
|
|
90
|
+
- 📄 Mentions /api/v1/login (removed in this branch)
|
|
79
91
|
|
|
80
|
-
## Up-to-Date
|
|
81
|
-
- ✅
|
|
92
|
+
## Up-to-Date (2)
|
|
93
|
+
- ✅ UserAvatar component documented
|
|
94
|
+
- ✅ Database schema up-to-date
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### 🚨 RULE #4: NEVER DELETE WITHOUT APPROVAL
|
|
100
|
+
|
|
101
|
+
**CRITICAL**: When docs are removed or changed:
|
|
102
|
+
1. Show diff to user
|
|
103
|
+
2. Ask explicit approval: "Delete this section? (YES/NO)"
|
|
104
|
+
3. Only delete if user approves
|
|
105
|
+
|
|
106
|
+
❌ WRONG: Remove outdated docs without asking
|
|
107
|
+
✅ RIGHT: Show diff, ask approval, delete only if approved
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### 🚨 RULE #5: DIFF-FIRST, YES/NO PATTERN
|
|
112
|
+
|
|
113
|
+
**ALWAYS follow this pattern:**
|
|
114
|
+
|
|
115
|
+
1. Generate all proposed changes in memory (don't write)
|
|
116
|
+
2. Show diff/preview to user
|
|
117
|
+
3. Ask: "Create missing documentation? (YES/NO)"
|
|
118
|
+
4. Only write files if user says YES
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### 🚨 RULE #6: SMART INFERENCE
|
|
123
|
+
|
|
124
|
+
Infer documentation from code sources:
|
|
125
|
+
|
|
126
|
+
**From TypeScript**:
|
|
127
|
+
```typescript
|
|
128
|
+
// Code:
|
|
129
|
+
export interface User {
|
|
130
|
+
id: string;
|
|
131
|
+
email: string;
|
|
132
|
+
name: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Generated doc:
|
|
136
|
+
## User Interface
|
|
137
|
+
- id (string) - Unique user identifier
|
|
138
|
+
- email (string) - User email address
|
|
139
|
+
- name (string) - User full name
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**From JSDoc**:
|
|
143
|
+
```typescript
|
|
144
|
+
/**
|
|
145
|
+
* Authenticates user with email and password
|
|
146
|
+
* @returns JWT token and user profile
|
|
147
|
+
*/
|
|
148
|
+
export async function login(email: string, password: string)
|
|
149
|
+
|
|
150
|
+
// Generated doc:
|
|
151
|
+
POST /api/auth/login
|
|
152
|
+
Authenticates user with email and password.
|
|
153
|
+
Returns JWT token and user profile.
|
|
82
154
|
```
|
|
83
155
|
|
|
84
|
-
|
|
85
|
-
- Markdown gap report with categorized findings
|
|
86
|
-
- List of recommended actions with previews
|
|
87
|
-
- Optional: Pull request with documentation updates (if approved)
|
|
156
|
+
---
|
|
88
157
|
|
|
89
|
-
|
|
90
|
-
|
|
158
|
+
### ANTI-PATTERNS (DON'T DO THESE)
|
|
159
|
+
|
|
160
|
+
❌ Delete docs without approval
|
|
161
|
+
❌ Skip diff-first pattern
|
|
162
|
+
❌ Overwrite manually written sections
|
|
163
|
+
❌ Create vague doc stubs ("TODO: Add details")
|
|
164
|
+
❌ Ignore outdated documentation
|
|
165
|
+
❌ Skip gap report
|
|
166
|
+
|
|
167
|
+
### DO THESE INSTEAD
|
|
168
|
+
|
|
169
|
+
✅ Always ask before deleting
|
|
170
|
+
✅ Show diffs for user approval
|
|
171
|
+
✅ Preserve custom content
|
|
172
|
+
✅ Generate complete doc stubs from code
|
|
173
|
+
✅ Flag outdated docs clearly
|
|
174
|
+
✅ Create comprehensive gap report
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### WORKFLOW
|
|
179
|
+
|
|
180
|
+
1. **Get Diff**: Compare BRANCH vs BASE with git diff
|
|
181
|
+
2. **Categorize**: Group changes by type (API, UI, services, etc.)
|
|
182
|
+
3. **Map**: For each change, identify expected doc location
|
|
183
|
+
4. **Analyze**: Check if docs exist, are current, or are missing
|
|
184
|
+
5. **Report**: Generate gap report with status indicators
|
|
185
|
+
6. **Preview**: Show all proposed changes to user
|
|
186
|
+
7. **Ask**: "Create missing documentation? (YES/NO)"
|
|
187
|
+
8. **Create**: Only if user approves - generate stubs from code
|
|
188
|
+
9. **Commit**: If AUTO_CREATE=yes, commit with message "docs: sync with codebase changes"
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### TOOL USAGE EXAMPLES
|
|
193
|
+
|
|
194
|
+
**TodoWrite** (to track sync process):
|
|
195
|
+
```xml
|
|
196
|
+
<invoke name="TodoWrite">
|
|
197
|
+
<parameter name="content">1. Get git diff between BASE and BRANCH
|
|
198
|
+
2. Categorize changes (API, UI, services, config, DB)
|
|
199
|
+
3. Map to expected documentation locations
|
|
200
|
+
4. Analyze gaps (missing, outdated, current)
|
|
201
|
+
5. Generate gap report
|
|
202
|
+
6. Preview proposed changes
|
|
203
|
+
7. Get user approval
|
|
204
|
+
8. Create docs if approved</parameter>
|
|
205
|
+
<parameter name="status">in-progress</parameter>
|
|
206
|
+
</invoke>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**AskUserQuestion** (for approval):
|
|
91
210
|
```xml
|
|
92
211
|
<invoke name="AskUserQuestion">
|
|
93
212
|
<parameter name="questions">[{
|
|
@@ -95,14 +214,27 @@ When asking for approval before creating docs:
|
|
|
95
214
|
"header": "Documentation Sync",
|
|
96
215
|
"multiSelect": false,
|
|
97
216
|
"options": [
|
|
98
|
-
{"label": "Create all missing docs", "description": "Auto-generate stubs
|
|
99
|
-
{"label": "Review each one first", "description": "Preview
|
|
217
|
+
{"label": "Create all missing docs", "description": "Auto-generate stubs from code"},
|
|
218
|
+
{"label": "Review each one first", "description": "Preview changes before creating"},
|
|
100
219
|
{"label": "Skip documentation", "description": "Don't create docs now"}
|
|
101
220
|
]
|
|
102
221
|
}]</parameter>
|
|
103
222
|
</invoke>
|
|
104
223
|
```
|
|
105
224
|
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
### REMEMBER AFTER COMPACTION
|
|
228
|
+
|
|
229
|
+
- `/agileflow:docs-sync` IS ACTIVE
|
|
230
|
+
- Compare BRANCH vs BASE with git diff
|
|
231
|
+
- Categorize changes (API, UI, services, etc.)
|
|
232
|
+
- Generate gap report (missing, outdated, current)
|
|
233
|
+
- Never delete docs without approval
|
|
234
|
+
- Use diff-first, YES/NO pattern
|
|
235
|
+
- Infer docs from code (TypeScript, JSDoc, tests)
|
|
236
|
+
- Optional AUTO_CREATE auto-generates all missing docs
|
|
237
|
+
|
|
106
238
|
<!-- COMPACT_SUMMARY_END -->
|
|
107
239
|
|
|
108
240
|
---
|