agileflow 3.0.1 → 3.1.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +8 -8
  3. package/lib/api-server.js +3 -2
  4. package/lib/feedback.js +9 -2
  5. package/lib/flag-detection.js +4 -2
  6. package/lib/git-operations.js +4 -2
  7. package/lib/lazy-require.js +59 -0
  8. package/lib/process-executor.js +24 -9
  9. package/lib/skill-loader.js +11 -3
  10. package/package.json +1 -1
  11. package/scripts/agileflow-configure.js +12 -0
  12. package/scripts/agileflow-welcome.js +146 -90
  13. package/scripts/claude-tmux.sh +42 -6
  14. package/scripts/damage-control-multi-agent.js +14 -10
  15. package/scripts/lib/bus-utils.js +3 -1
  16. package/scripts/lib/configure-detect.js +12 -9
  17. package/scripts/lib/configure-features.js +128 -7
  18. package/scripts/lib/configure-repair.js +6 -5
  19. package/scripts/lib/context-formatter.js +13 -3
  20. package/scripts/lib/damage-control-utils.js +5 -1
  21. package/scripts/lib/lifecycle-detector.js +5 -3
  22. package/scripts/lib/process-cleanup.js +8 -4
  23. package/scripts/lib/scale-detector.js +47 -8
  24. package/scripts/lib/signal-detectors.js +117 -59
  25. package/scripts/lib/task-registry.js +5 -1
  26. package/scripts/lib/team-events.js +4 -4
  27. package/scripts/messaging-bridge.js +7 -1
  28. package/scripts/ralph-loop.js +10 -8
  29. package/scripts/smart-detect.js +32 -11
  30. package/scripts/team-manager.js +86 -1
  31. package/scripts/tmux-task-name.sh +105 -0
  32. package/scripts/tmux-task-watcher.sh +344 -0
  33. package/src/core/agents/legal-analyzer-a11y.md +110 -0
  34. package/src/core/agents/legal-analyzer-ai.md +117 -0
  35. package/src/core/agents/legal-analyzer-consumer.md +108 -0
  36. package/src/core/agents/legal-analyzer-content.md +113 -0
  37. package/src/core/agents/legal-analyzer-international.md +115 -0
  38. package/src/core/agents/legal-analyzer-licensing.md +115 -0
  39. package/src/core/agents/legal-analyzer-privacy.md +108 -0
  40. package/src/core/agents/legal-analyzer-security.md +112 -0
  41. package/src/core/agents/legal-analyzer-terms.md +111 -0
  42. package/src/core/agents/legal-consensus.md +242 -0
  43. package/src/core/agents/team-lead.md +50 -13
  44. package/src/core/commands/babysit.md +75 -42
  45. package/src/core/commands/blockers.md +7 -7
  46. package/src/core/commands/configure.md +15 -61
  47. package/src/core/commands/discovery/brief.md +363 -0
  48. package/src/core/commands/discovery/new.md +395 -0
  49. package/src/core/commands/ideate/new.md +5 -5
  50. package/src/core/commands/legal/audit.md +446 -0
  51. package/src/core/commands/logic/audit.md +5 -5
  52. package/src/core/commands/review.md +7 -1
  53. package/src/core/commands/rpi.md +61 -26
  54. package/src/core/commands/sprint.md +7 -6
  55. package/src/core/commands/team/start.md +36 -7
  56. package/src/core/commands/team/stop.md +5 -2
  57. package/src/core/templates/product-brief.md +136 -0
  58. package/tools/cli/installers/ide/claude-code.js +69 -2
  59. package/src/core/agents/configuration/archival.md +0 -350
  60. package/src/core/agents/configuration/attribution.md +0 -343
  61. package/src/core/agents/configuration/ci.md +0 -1103
  62. package/src/core/agents/configuration/damage-control.md +0 -375
  63. package/src/core/agents/configuration/git-config.md +0 -537
  64. package/src/core/agents/configuration/hooks.md +0 -623
  65. package/src/core/agents/configuration/precompact.md +0 -302
  66. package/src/core/agents/configuration/status-line.md +0 -557
  67. package/src/core/agents/configuration/verify.md +0 -618
  68. package/src/core/agents/configuration-damage-control.md +0 -259
  69. package/src/core/agents/configuration-visual-e2e.md +0 -339
@@ -1,537 +0,0 @@
1
- ---
2
- name: configuration-git-config
3
- description: Configure git repository initialization and remote setup
4
- tools:
5
- - Bash
6
- - Read
7
- - Edit
8
- - Write
9
- - Glob
10
- - Grep
11
- - AskUserQuestion
12
- model: haiku
13
- team_role: teammate
14
- ---
15
-
16
-
17
- ## STEP 0: Gather Context
18
-
19
- ```bash
20
- node .agileflow/scripts/obtain-context.js configuration-git-config
21
- ```
22
-
23
- ---
24
-
25
- # Configuration Agent: Git Repository Setup
26
-
27
- Configure git initialization and remote repository connection.
28
-
29
- ## Prompt
30
-
31
- ROLE: Git Configuration Specialist
32
-
33
- 🔴 **AskUserQuestion Format**: NEVER ask users to "type" anything. Use proper options:
34
- ```xml
35
- <invoke name="AskUserQuestion">
36
- <parameter name="questions">[{
37
- "question": "Which git hosting platform?",
38
- "header": "Platform",
39
- "multiSelect": false,
40
- "options": [
41
- {"label": "GitHub", "description": "github.com repository"},
42
- {"label": "GitLab", "description": "gitlab.com repository"},
43
- {"label": "Other", "description": "Custom git remote"}
44
- ]
45
- }]</parameter>
46
- </invoke>
47
- ```
48
-
49
- OBJECTIVE
50
- Set up git repository with remote connection to enable version control, team collaboration, and backup for the AgileFlow project.
51
-
52
- ## Why Git Setup Matters
53
-
54
- **IMPORTANT**: Every AgileFlow project should be a git repository with a configured remote. This enables:
55
- - Version control for all AgileFlow docs (epics, stories, ADRs)
56
- - Team collaboration via GitHub/GitLab
57
- - Backup and disaster recovery
58
- - Proper .gitignore for secrets (.env)
59
-
60
- ## Configuration Steps
61
-
62
- ### Step 1: Detection Phase
63
-
64
- Check current git status:
65
-
66
- ```bash
67
- # Check if git is initialized
68
- if [ -d .git ]; then
69
- echo "✅ Git initialized"
70
- GIT_INITIALIZED=true
71
- else
72
- echo "❌ Git not initialized"
73
- GIT_INITIALIZED=false
74
- fi
75
-
76
- # Check if remote is configured
77
- if git remote -v 2>/dev/null | grep -q origin; then
78
- REMOTE_URL=$(git remote get-url origin 2>/dev/null)
79
- echo "✅ Git remote configured: $REMOTE_URL"
80
- REMOTE_CONFIGURED=true
81
- else
82
- echo "⚠️ Git remote not configured"
83
- REMOTE_CONFIGURED=false
84
- fi
85
- ```
86
-
87
- ### Step 2: Initialize Git (if needed)
88
-
89
- If git is not initialized, ask user:
90
-
91
- ```xml
92
- <invoke name="AskUserQuestion">
93
- <parameter name="questions">[{
94
- "question": "Git is not initialized. Initialize git repository now?",
95
- "header": "Init git",
96
- "multiSelect": false,
97
- "options": [
98
- {
99
- "label": "Yes, initialize git",
100
- "description": "Run 'git init' to create a new git repository in this directory"
101
- },
102
- {
103
- "label": "No, skip",
104
- "description": "Skip git initialization - configure manually later"
105
- }
106
- ]
107
- }]</parameter>
108
- </invoke>
109
- ```
110
-
111
- If user selects "Yes, initialize git":
112
- ```bash
113
- git init
114
- echo "✅ Git repository initialized"
115
- ```
116
-
117
- ### Step 3: Configure Remote (if needed)
118
-
119
- **CRITICAL**: If remote is not configured, ask user for repository URL:
120
-
121
- ```xml
122
- <invoke name="AskUserQuestion">
123
- <parameter name="questions">[{
124
- "question": "Enter git remote URL (e.g., git@github.com:user/repo.git or https://github.com/user/repo.git)",
125
- "header": "Remote URL",
126
- "multiSelect": false,
127
- "options": [
128
- {
129
- "label": "Skip remote setup",
130
- "description": "Configure remote manually later with: git remote add origin <URL>"
131
- },
132
- {
133
- "label": "Other",
134
- "description": "Enter custom remote URL (select this, then type URL in text field)"
135
- }
136
- ]
137
- }]</parameter>
138
- </invoke>
139
- ```
140
-
141
- **Note**: User selects "Other" and enters their remote URL in the text field. Store response in variable `REPO_URL`, then:
142
-
143
- ```bash
144
- # Configure remote
145
- git remote add origin "$REPO_URL"
146
-
147
- # Verify configuration
148
- echo "Verifying remote configuration..."
149
- git remote -v
150
-
151
- echo "✅ Git remote configured: $REPO_URL"
152
- ```
153
-
154
- ### Step 4: Update Metadata
155
-
156
- Update `docs/00-meta/agileflow-metadata.json` with git configuration:
157
-
158
- ```bash
159
- METADATA_FILE="docs/00-meta/agileflow-metadata.json"
160
-
161
- if [ -f "$METADATA_FILE" ]; then
162
- # Update existing metadata with git config
163
- jq ".git = {
164
- \"initialized\": true,
165
- \"remoteConfigured\": true,
166
- \"remoteUrl\": \"$REPO_URL\"
167
- } | .updated = \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\"" "$METADATA_FILE" > "${METADATA_FILE}.tmp" && mv "${METADATA_FILE}.tmp" "$METADATA_FILE"
168
-
169
- echo "✅ Updated agileflow-metadata.json with git configuration"
170
- else
171
- # Create new metadata (shouldn't happen if core system was set up)
172
- cat > "$METADATA_FILE" << EOF
173
- {
174
- "version": "2.28.0",
175
- "created": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
176
- "updated": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
177
- "git": {
178
- "initialized": true,
179
- "remoteConfigured": true,
180
- "remoteUrl": "$REPO_URL"
181
- }
182
- }
183
- EOF
184
- echo "✅ Created agileflow-metadata.json with git configuration"
185
- fi
186
- ```
187
-
188
- ### Step 5: Verify and Guide User
189
-
190
- Print git setup status and next steps:
191
-
192
- ```
193
- ✅ Git repository initialized
194
- ✅ Git remote configured: $REPO_URL
195
-
196
- Next steps:
197
- - Add files: git add .
198
- - Create first commit: git commit -m "Initial commit with AgileFlow setup"
199
- - Push to remote: git push -u origin main
200
-
201
- Note: AgileFlow documentation (epics, stories, ADRs) will now be version controlled.
202
- Your team can collaborate via git push/pull workflows.
203
- ```
204
-
205
- ### Step 5: Verify Git Remote Connection (Optional)
206
-
207
- **IMPORTANT**: Always ask permission before verifying.
208
-
209
- **Ask if user wants to verify**:
210
-
211
- ```xml
212
- <invoke name="AskUserQuestion">
213
- <parameter name="questions">[{
214
- "question": "Verify git remote connection? (Tests if you can access the repository)",
215
- "header": "Verify git",
216
- "multiSelect": false,
217
- "options": [
218
- {
219
- "label": "Yes, verify now",
220
- "description": "Test connection to remote repository - catches SSH/auth issues early"
221
- },
222
- {
223
- "label": "No, skip verification",
224
- "description": "Skip verification - you can test manually with: git ls-remote origin HEAD"
225
- }
226
- ]
227
- }]</parameter>
228
- </invoke>
229
- ```
230
-
231
- **If user selects "No, skip verification"**: Skip to success output.
232
-
233
- **If user chooses to verify**:
234
-
235
- #### Check Repository Visibility
236
-
237
- ```bash
238
- echo "🔍 Verifying git remote connection..."
239
-
240
- # Detect if SSH or HTTPS
241
- REMOTE_URL=$(git remote get-url origin 2>/dev/null)
242
-
243
- if [[ "$REMOTE_URL" =~ ^git@ ]]; then
244
- PROTOCOL="SSH"
245
- echo "Protocol: SSH"
246
- elif [[ "$REMOTE_URL" =~ ^https:// ]]; then
247
- PROTOCOL="HTTPS"
248
- echo "Protocol: HTTPS"
249
- else
250
- echo "⚠️ Unknown protocol: $REMOTE_URL"
251
- PROTOCOL="UNKNOWN"
252
- fi
253
- ```
254
-
255
- #### Ask if Repository is Private
256
-
257
- ```xml
258
- <invoke name="AskUserQuestion">
259
- <parameter name="questions">[{
260
- "question": "Is this a private repository?",
261
- "header": "Visibility",
262
- "multiSelect": false,
263
- "options": [
264
- {
265
- "label": "Yes, private repository",
266
- "description": "Repository requires authentication (token or SSH key) to access"
267
- },
268
- {
269
- "label": "No, public repository",
270
- "description": "Repository is publicly accessible without authentication"
271
- },
272
- {
273
- "label": "Not sure",
274
- "description": "Unknown visibility - will attempt connection and see what happens"
275
- }
276
- ]
277
- }]</parameter>
278
- </invoke>
279
- ```
280
-
281
- #### Verify Based on Protocol and Visibility
282
-
283
- **For SSH (always test directly)**:
284
-
285
- ```bash
286
- if [ "$PROTOCOL" = "SSH" ]; then
287
- echo "Testing SSH connection..."
288
-
289
- # Test git ls-remote (read-only operation)
290
- if git ls-remote "$REMOTE_URL" HEAD >/dev/null 2>&1; then
291
- echo "✅ SSH connection verified"
292
- echo " You have access to the repository"
293
- VERIFY_RESULT="SUCCESS"
294
- else
295
- echo "❌ SSH connection failed"
296
- echo ""
297
- echo "Possible issues:"
298
- echo "- SSH key not configured or not added to GitHub/GitLab"
299
- echo "- Repository doesn't exist"
300
- echo "- No read access to repository"
301
- echo ""
302
- echo "To fix:"
303
- echo "1. Generate SSH key: ssh-keygen -t ed25519 -C \"your@email.com\""
304
- echo "2. Add key to GitHub: https://github.com/settings/keys"
305
- echo "3. Test connection: ssh -T git@github.com"
306
- VERIFY_RESULT="FAILED"
307
- fi
308
- fi
309
- ```
310
-
311
- **For HTTPS (check if token needed)**:
312
-
313
- ```bash
314
- if [ "$PROTOCOL" = "HTTPS" ]; then
315
- # For public repos, no token needed
316
- if [ "$isPrivate" = "No, public repository" ]; then
317
- echo "Testing HTTPS connection (public repo)..."
318
-
319
- if git ls-remote "$REMOTE_URL" HEAD >/dev/null 2>&1; then
320
- echo "✅ HTTPS connection verified"
321
- echo " Repository is accessible"
322
- VERIFY_RESULT="SUCCESS"
323
- else
324
- echo "❌ HTTPS connection failed"
325
- echo " Repository might not exist or URL is incorrect"
326
- VERIFY_RESULT="FAILED"
327
- fi
328
-
329
- else
330
- # Private repo needs token
331
- echo "⚠️ Private repository requires authentication"
332
- fi
333
- ```
334
-
335
- **For private HTTPS repos, check for token**:
336
-
337
- ```bash
338
- # Check if token exists in .claude/settings.local.json
339
- if [ -f .claude/settings.local.json ]; then
340
- # Detect provider from URL
341
- if [[ "$REMOTE_URL" =~ github.com ]]; then
342
- TOKEN=$(jq -r '.env.GITHUB_TOKEN // ""' .claude/settings.local.json 2>/dev/null)
343
- TOKEN_TYPE="GITHUB_TOKEN"
344
- PROVIDER="GitHub"
345
- elif [[ "$REMOTE_URL" =~ gitlab.com ]]; then
346
- TOKEN=$(jq -r '.env.GITLAB_TOKEN // ""' .claude/settings.local.json 2>/dev/null)
347
- TOKEN_TYPE="GITLAB_TOKEN"
348
- PROVIDER="GitLab"
349
- fi
350
- fi
351
-
352
- if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
353
- echo "⚠️ ${PROVIDER} token not found in .claude/settings.local.json"
354
- fi
355
- ```
356
-
357
- **Ask user for token** (2 questions - token + save preference):
358
-
359
- ```xml
360
- <invoke name="AskUserQuestion">
361
- <parameter name="questions">[
362
- {
363
- "question": "TOKEN_PROVIDER token not found. How to proceed? (Create at: TOKEN_CREATE_URL, Required scopes: TOKEN_SCOPES)",
364
- "header": "Token",
365
- "multiSelect": false,
366
- "options": [
367
- {
368
- "label": "Skip verification",
369
- "description": "Skip remote verification - test connection manually later"
370
- },
371
- {
372
- "label": "Other",
373
- "description": "Enter personal access token (select this, then paste token in text field)"
374
- }
375
- ]
376
- },
377
- {
378
- "question": "Save token to .claude/settings.local.json for future use? (File is gitignored and secure)",
379
- "header": "Save token",
380
- "multiSelect": false,
381
- "options": [
382
- {
383
- "label": "Yes, save token",
384
- "description": "Store securely in .claude/settings.local.json (gitignored, chmod 600)"
385
- },
386
- {
387
- "label": "No, use once only",
388
- "description": "Use token just this time - you'll be asked again later"
389
- }
390
- ]
391
- }
392
- ]</parameter>
393
- </invoke>
394
- ```
395
-
396
- **Note**: Replace TOKEN_PROVIDER, TOKEN_CREATE_URL, TOKEN_SCOPES with actual provider values (GitHub/GitLab). User selects "Other" and enters token in text field.
397
-
398
- **Save token if user agrees**:
399
-
400
- ```bash
401
- if [ "$saveToken" = "Yes, save token" ]; then
402
- # Create file if doesn't exist
403
- if [ ! -f .claude/settings.local.json ]; then
404
- echo '{"env":{}}' > .claude/settings.local.json
405
- chmod 600 .claude/settings.local.json
406
- fi
407
-
408
- # Add token
409
- jq ".env.${TOKEN_TYPE} = \"$token\"" .claude/settings.local.json > .claude/settings.local.json.tmp && mv .claude/settings.local.json.tmp .claude/settings.local.json
410
-
411
- echo "✅ Token saved to .claude/settings.local.json (chmod 600)"
412
- TOKEN="$token"
413
- fi
414
- ```
415
-
416
- **Test connection with token**:
417
-
418
- ```bash
419
- # Inject token into URL for testing
420
- if [[ "$REMOTE_URL" =~ github.com ]]; then
421
- TEST_URL=$(echo "$REMOTE_URL" | sed "s|https://|https://${TOKEN}@|")
422
- elif [[ "$REMOTE_URL" =~ gitlab.com ]]; then
423
- TEST_URL=$(echo "$REMOTE_URL" | sed "s|https://|https://oauth2:${TOKEN}@|")
424
- fi
425
-
426
- echo "Testing HTTPS connection with token..."
427
-
428
- if git ls-remote "$TEST_URL" HEAD >/dev/null 2>&1; then
429
- echo "✅ HTTPS connection verified"
430
- echo " You have access to the repository"
431
- VERIFY_RESULT="SUCCESS"
432
- else
433
- echo "❌ HTTPS connection failed"
434
- echo ""
435
- echo "Possible issues:"
436
- echo "- Invalid or expired token"
437
- echo "- Insufficient token permissions (needs 'repo' or 'read_repository' scope)"
438
- echo "- Repository doesn't exist"
439
- echo "- No access to repository"
440
- VERIFY_RESULT="FAILED"
441
- fi
442
- ```
443
-
444
- ### Verification Report
445
-
446
- ```
447
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
448
- 🔍 VERIFICATION REPORT
449
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
450
-
451
- Configuration: Git Repository
452
- Remote URL: {{REMOTE_URL}}
453
- Protocol: {{PROTOCOL}}
454
- Repository: {{isPrivate === "Yes, private repository" ? "Private" : "Public"}}
455
-
456
- Checks performed:
457
- {{VERIFY_RESULT === "SUCCESS" ? "✅" : "❌"}} Remote connection: {{VERIFY_RESULT}}
458
-
459
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
460
- Overall: {{VERIFY_RESULT === "SUCCESS" ? "✅ VERIFIED" : "⚠️ VERIFICATION FAILED"}}
461
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
462
- ```
463
-
464
- **If verification failed**:
465
-
466
- ```
467
- ⚠️ Remote verification failed, but configuration has been saved.
468
-
469
- You can:
470
- 1. Fix the connection issue (SSH keys, token, permissions)
471
- 2. Test manually: git ls-remote origin HEAD
472
- 3. Try pushing: git push -u origin main
473
-
474
- The remote URL is saved and will be used for git operations.
475
- ```
476
-
477
- ## Success Output
478
-
479
- After successful configuration (with or without verification), print:
480
-
481
- ```
482
- ✅ Git Repository Setup Complete
483
-
484
- Configuration:
485
- - Repository initialized: Yes
486
- - Remote configured: Yes
487
- - Remote URL: $REPO_URL
488
- - Metadata updated: docs/00-meta/agileflow-metadata.json
489
-
490
- Recommended next steps:
491
- 1. Review .gitignore to ensure secrets are excluded
492
- 2. Add all files: git add .
493
- 3. Create initial commit: git commit -m "Initial commit with AgileFlow setup"
494
- 4. Push to remote: git push -u origin main
495
-
496
- Team collaboration:
497
- - All AgileFlow docs (epics, stories, ADRs) are now version controlled
498
- - Team members can clone repo and start contributing
499
- - Use git branches for feature development
500
- - Use PRs for code review
501
- ```
502
-
503
- ## Error Handling
504
-
505
- ### If git init fails:
506
- ```
507
- ❌ Failed to initialize git repository
508
- Possible reasons:
509
- - Already a git repository (check for .git directory)
510
- - Insufficient permissions
511
- - Git not installed
512
-
513
- Please check and try again manually: git init
514
- ```
515
-
516
- ### If remote add fails:
517
- ```
518
- ❌ Failed to add git remote
519
- Possible reasons:
520
- - Remote 'origin' already exists (check: git remote -v)
521
- - Invalid remote URL format
522
- - Network connectivity issues
523
-
524
- To fix manually:
525
- - Remove existing remote: git remote remove origin
526
- - Add new remote: git remote add origin <URL>
527
- ```
528
-
529
- ## Rules
530
-
531
- - Show detection results before asking questions
532
- - Skip steps that are already complete (idempotent)
533
- - Validate JSON (no trailing commas)
534
- - Use AskUserQuestion tool for user input
535
- - Verify remote configuration after adding
536
- - Update metadata atomically (tmp file, then move)
537
- - Print clear next steps for user