@pjmendonca/devflow 1.13.2 → 1.19.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 (236) hide show
  1. package/.claude/commands/agent.md +1 -1
  2. package/.claude/commands/brainstorm.md +28 -0
  3. package/.claude/commands/bugfix.md +21 -0
  4. package/.claude/commands/checkpoint.md +0 -1
  5. package/.claude/commands/collab.md +0 -1
  6. package/.claude/commands/costs.md +88 -18
  7. package/.claude/commands/devflow.md +26 -0
  8. package/.claude/commands/handoff.md +0 -1
  9. package/.claude/commands/init.md +383 -0
  10. package/.claude/commands/memory.md +0 -1
  11. package/.claude/commands/pair.md +0 -1
  12. package/.claude/commands/review.md +27 -0
  13. package/.claude/commands/route.md +0 -1
  14. package/.claude/commands/swarm.md +0 -1
  15. package/.claude/commands/validate.md +55 -0
  16. package/.claude/hooks/session-notification.sh +44 -0
  17. package/.claude/hooks/session-startup.sh +427 -0
  18. package/.claude/hooks/session-stop.sh +38 -0
  19. package/.claude/hooks/session_tracker.py +272 -0
  20. package/.claude/settings.json +38 -0
  21. package/.claude/skills/brainstorm/SKILL.md +531 -0
  22. package/.claude/skills/costs/SKILL.md +156 -0
  23. package/.claude/skills/validate/SKILL.md +101 -0
  24. package/CHANGELOG.md +284 -0
  25. package/README.md +207 -10
  26. package/bin/devflow-install.js +2 -1
  27. package/bin/devflow.js +4 -0
  28. package/lib/constants.js +0 -1
  29. package/lib/exec-python.js +1 -1
  30. package/package.json +1 -1
  31. package/tooling/.automation/.checkpoint_lock +1 -0
  32. package/tooling/.automation/agents/architect.md +19 -0
  33. package/tooling/.automation/agents/ba.md +19 -0
  34. package/tooling/.automation/agents/maintainer.md +19 -0
  35. package/tooling/.automation/agents/pm.md +19 -0
  36. package/tooling/.automation/agents/reviewer.md +1 -1
  37. package/tooling/.automation/agents/writer.md +19 -0
  38. package/tooling/.automation/benchmarks/benchmark_20251230_100119.json +314 -0
  39. package/tooling/.automation/benchmarks/benchmark_20251230_100216.json +314 -0
  40. package/tooling/.automation/costs/config.json +31 -0
  41. package/tooling/.automation/costs/sessions/2025-12-29_20251229_164128.json +22 -0
  42. package/tooling/.automation/memory/knowledge/kg_integration-test.json +738 -1
  43. package/tooling/.automation/memory/knowledge/kg_test-story.json +3381 -2
  44. package/tooling/.automation/memory/shared/shared_integration-test.json +193 -1
  45. package/tooling/.automation/memory/shared/shared_test-story.json +757 -1
  46. package/tooling/.automation/memory/shared/shared_test.json +1332 -0
  47. package/tooling/.automation/memory/shared/shared_validation-check.json +240 -0
  48. package/tooling/.automation/overrides/templates/architect/cloud-native.yaml +5 -5
  49. package/tooling/.automation/overrides/templates/architect/enterprise-architect.yaml +23 -5
  50. package/tooling/.automation/overrides/templates/architect/pragmatic-minimalist.yaml +24 -6
  51. package/tooling/.automation/overrides/templates/ba/agile-storyteller.yaml +4 -4
  52. package/tooling/.automation/overrides/templates/ba/domain-expert.yaml +4 -4
  53. package/tooling/.automation/overrides/templates/ba/requirements-engineer.yaml +4 -4
  54. package/tooling/.automation/overrides/templates/dev/performance-engineer.yaml +18 -0
  55. package/tooling/.automation/overrides/templates/dev/rapid-prototyper.yaml +19 -1
  56. package/tooling/.automation/overrides/templates/dev/security-focused.yaml +18 -0
  57. package/tooling/.automation/overrides/templates/dev/user-advocate.yaml +54 -0
  58. package/tooling/.automation/overrides/templates/maintainer/devops-maintainer.yaml +4 -4
  59. package/tooling/.automation/overrides/templates/maintainer/legacy-steward.yaml +4 -4
  60. package/tooling/.automation/overrides/templates/maintainer/oss-maintainer.yaml +4 -4
  61. package/tooling/.automation/overrides/templates/maintainer/reliability-engineer.yaml +55 -0
  62. package/tooling/.automation/overrides/templates/pm/agile-pm.yaml +4 -4
  63. package/tooling/.automation/overrides/templates/pm/hybrid-delivery.yaml +3 -3
  64. package/tooling/.automation/overrides/templates/pm/traditional-pm.yaml +4 -4
  65. package/tooling/.automation/overrides/templates/reviewer/quick-sanity.yaml +18 -0
  66. package/tooling/.automation/overrides/templates/reviewer/thorough-critic.yaml +18 -0
  67. package/tooling/.automation/overrides/templates/sm/agile-coach.yaml +2 -2
  68. package/tooling/.automation/overrides/templates/sm/startup-pm.yaml +3 -3
  69. package/tooling/.automation/overrides/templates/writer/api-documentarian.yaml +5 -5
  70. package/tooling/.automation/overrides/templates/writer/docs-as-code.yaml +4 -4
  71. package/tooling/.automation/overrides/templates/writer/user-guide-author.yaml +5 -5
  72. package/tooling/.automation/validation/history/2025-12-29_val_002a28c1.json +32 -0
  73. package/tooling/.automation/validation/history/2025-12-29_val_01273bb1.json +32 -0
  74. package/tooling/.automation/validation/history/2025-12-29_val_03369914.json +41 -0
  75. package/tooling/.automation/validation/history/2025-12-29_val_07a449ba.json +32 -0
  76. package/tooling/.automation/validation/history/2025-12-29_val_0df1f0a2.json +41 -0
  77. package/tooling/.automation/validation/history/2025-12-29_val_10ff3d34.json +41 -0
  78. package/tooling/.automation/validation/history/2025-12-29_val_110771d7.json +32 -0
  79. package/tooling/.automation/validation/history/2025-12-29_val_13f3a7f9.json +32 -0
  80. package/tooling/.automation/validation/history/2025-12-29_val_17ba9d21.json +41 -0
  81. package/tooling/.automation/validation/history/2025-12-29_val_22247089.json +32 -0
  82. package/tooling/.automation/validation/history/2025-12-29_val_227ea6a4.json +32 -0
  83. package/tooling/.automation/validation/history/2025-12-29_val_2335d5ae.json +32 -0
  84. package/tooling/.automation/validation/history/2025-12-29_val_246824bb.json +41 -0
  85. package/tooling/.automation/validation/history/2025-12-29_val_28b4b9cd.json +32 -0
  86. package/tooling/.automation/validation/history/2025-12-29_val_2abd12cc.json +32 -0
  87. package/tooling/.automation/validation/history/2025-12-29_val_2c801b2f.json +59 -0
  88. package/tooling/.automation/validation/history/2025-12-29_val_2c8cfa8e.json +32 -0
  89. package/tooling/.automation/validation/history/2025-12-29_val_2ce76eb0.json +32 -0
  90. package/tooling/.automation/validation/history/2025-12-29_val_30351948.json +41 -0
  91. package/tooling/.automation/validation/history/2025-12-29_val_30eb7229.json +41 -0
  92. package/tooling/.automation/validation/history/2025-12-29_val_34df0e77.json +41 -0
  93. package/tooling/.automation/validation/history/2025-12-29_val_376e4d6a.json +32 -0
  94. package/tooling/.automation/validation/history/2025-12-29_val_3a4e8a1a.json +59 -0
  95. package/tooling/.automation/validation/history/2025-12-29_val_3b77a628.json +32 -0
  96. package/tooling/.automation/validation/history/2025-12-29_val_3ea4e1cf.json +59 -0
  97. package/tooling/.automation/validation/history/2025-12-29_val_44aacdb4.json +59 -0
  98. package/tooling/.automation/validation/history/2025-12-29_val_457ddfa8.json +32 -0
  99. package/tooling/.automation/validation/history/2025-12-29_val_45af6238.json +41 -0
  100. package/tooling/.automation/validation/history/2025-12-29_val_4735dba1.json +41 -0
  101. package/tooling/.automation/validation/history/2025-12-29_val_486b203c.json +41 -0
  102. package/tooling/.automation/validation/history/2025-12-29_val_49dc56cd.json +59 -0
  103. package/tooling/.automation/validation/history/2025-12-29_val_4d863d6d.json +32 -0
  104. package/tooling/.automation/validation/history/2025-12-29_val_5149a808.json +59 -0
  105. package/tooling/.automation/validation/history/2025-12-29_val_52e0bb43.json +32 -0
  106. package/tooling/.automation/validation/history/2025-12-29_val_585d6319.json +59 -0
  107. package/tooling/.automation/validation/history/2025-12-29_val_5b2d859a.json +32 -0
  108. package/tooling/.automation/validation/history/2025-12-29_val_635a7081.json +41 -0
  109. package/tooling/.automation/validation/history/2025-12-29_val_64df4905.json +32 -0
  110. package/tooling/.automation/validation/history/2025-12-29_val_70634cee.json +41 -0
  111. package/tooling/.automation/validation/history/2025-12-29_val_714553f9.json +32 -0
  112. package/tooling/.automation/validation/history/2025-12-29_val_7f7bfdbf.json +41 -0
  113. package/tooling/.automation/validation/history/2025-12-29_val_7faad91d.json +32 -0
  114. package/tooling/.automation/validation/history/2025-12-29_val_81821f8f.json +41 -0
  115. package/tooling/.automation/validation/history/2025-12-29_val_8249f3c9.json +32 -0
  116. package/tooling/.automation/validation/history/2025-12-29_val_8422b50f.json +41 -0
  117. package/tooling/.automation/validation/history/2025-12-29_val_8446c134.json +32 -0
  118. package/tooling/.automation/validation/history/2025-12-29_val_879f4e26.json +59 -0
  119. package/tooling/.automation/validation/history/2025-12-29_val_8b6d5bd7.json +32 -0
  120. package/tooling/.automation/validation/history/2025-12-29_val_8c5cd787.json +32 -0
  121. package/tooling/.automation/validation/history/2025-12-29_val_91d20bc7.json +32 -0
  122. package/tooling/.automation/validation/history/2025-12-29_val_958a12b7.json +41 -0
  123. package/tooling/.automation/validation/history/2025-12-29_val_95d91108.json +41 -0
  124. package/tooling/.automation/validation/history/2025-12-29_val_980dbb74.json +32 -0
  125. package/tooling/.automation/validation/history/2025-12-29_val_9e40c79b.json +32 -0
  126. package/tooling/.automation/validation/history/2025-12-29_val_9f499b7c.json +32 -0
  127. package/tooling/.automation/validation/history/2025-12-29_val_9f7c3b57.json +32 -0
  128. package/tooling/.automation/validation/history/2025-12-29_val_a30d5bd4.json +32 -0
  129. package/tooling/.automation/validation/history/2025-12-29_val_a6eb09c7.json +32 -0
  130. package/tooling/.automation/validation/history/2025-12-29_val_a86f7b83.json +41 -0
  131. package/tooling/.automation/validation/history/2025-12-29_val_ad5347e1.json +41 -0
  132. package/tooling/.automation/validation/history/2025-12-29_val_b0a5a993.json +32 -0
  133. package/tooling/.automation/validation/history/2025-12-29_val_bcb0192e.json +32 -0
  134. package/tooling/.automation/validation/history/2025-12-29_val_bf3c9aaa.json +32 -0
  135. package/tooling/.automation/validation/history/2025-12-29_val_c461ff88.json +32 -0
  136. package/tooling/.automation/validation/history/2025-12-29_val_c4f4e258.json +41 -0
  137. package/tooling/.automation/validation/history/2025-12-29_val_c7f0fa6d.json +41 -0
  138. package/tooling/.automation/validation/history/2025-12-29_val_c911b0e6.json +32 -0
  139. package/tooling/.automation/validation/history/2025-12-29_val_cc581964.json +32 -0
  140. package/tooling/.automation/validation/history/2025-12-29_val_cdd5a33b.json +32 -0
  141. package/tooling/.automation/validation/history/2025-12-29_val_cfd42495.json +32 -0
  142. package/tooling/.automation/validation/history/2025-12-29_val_d1c7a4ee.json +41 -0
  143. package/tooling/.automation/validation/history/2025-12-29_val_d2280d0e.json +32 -0
  144. package/tooling/.automation/validation/history/2025-12-29_val_d2a6ff69.json +32 -0
  145. package/tooling/.automation/validation/history/2025-12-29_val_d8c53ab2.json +59 -0
  146. package/tooling/.automation/validation/history/2025-12-29_val_d9c1247a.json +41 -0
  147. package/tooling/.automation/validation/history/2025-12-29_val_d9d58569.json +32 -0
  148. package/tooling/.automation/validation/history/2025-12-29_val_dabb4fd9.json +32 -0
  149. package/tooling/.automation/validation/history/2025-12-29_val_dd8fe359.json +32 -0
  150. package/tooling/.automation/validation/history/2025-12-29_val_decdffc9.json +32 -0
  151. package/tooling/.automation/validation/history/2025-12-29_val_e3a95476.json +59 -0
  152. package/tooling/.automation/validation/history/2025-12-29_val_e776dfca.json +32 -0
  153. package/tooling/.automation/validation/history/2025-12-29_val_ea70969f.json +59 -0
  154. package/tooling/.automation/validation/history/2025-12-29_val_ef41ea95.json +32 -0
  155. package/tooling/.automation/validation/history/2025-12-29_val_f384f9b1.json +32 -0
  156. package/tooling/.automation/validation/history/2025-12-29_val_f8adc38c.json +41 -0
  157. package/tooling/.automation/validation/history/2025-12-29_val_fa40b69e.json +32 -0
  158. package/tooling/.automation/validation/history/2025-12-29_val_fc538d54.json +41 -0
  159. package/tooling/.automation/validation/history/2025-12-29_val_fe814665.json +32 -0
  160. package/tooling/.automation/validation/history/2025-12-29_val_ffea4b12.json +32 -0
  161. package/tooling/.automation/validation/history/2025-12-30_val_02d001e5.json +59 -0
  162. package/tooling/.automation/validation/history/2025-12-30_val_0b8966dc.json +32 -0
  163. package/tooling/.automation/validation/history/2025-12-30_val_15455fbf.json +59 -0
  164. package/tooling/.automation/validation/history/2025-12-30_val_157e34b9.json +32 -0
  165. package/tooling/.automation/validation/history/2025-12-30_val_28d1d933.json +32 -0
  166. package/tooling/.automation/validation/history/2025-12-30_val_3442a52c.json +32 -0
  167. package/tooling/.automation/validation/history/2025-12-30_val_37f1ce1e.json +32 -0
  168. package/tooling/.automation/validation/history/2025-12-30_val_4f1d8a93.json +32 -0
  169. package/tooling/.automation/validation/history/2025-12-30_val_56ff1de3.json +32 -0
  170. package/tooling/.automation/validation/history/2025-12-30_val_664fd4e2.json +41 -0
  171. package/tooling/.automation/validation/history/2025-12-30_val_66afb0a7.json +32 -0
  172. package/tooling/.automation/validation/history/2025-12-30_val_7634663c.json +41 -0
  173. package/tooling/.automation/validation/history/2025-12-30_val_8ea830c3.json +41 -0
  174. package/tooling/.automation/validation/history/2025-12-30_val_998957c2.json +32 -0
  175. package/tooling/.automation/validation/history/2025-12-30_val_a52177db.json +32 -0
  176. package/tooling/.automation/validation/history/2025-12-30_val_a5b65a63.json +32 -0
  177. package/tooling/.automation/validation/history/2025-12-30_val_ae391d0e.json +32 -0
  178. package/tooling/.automation/validation/history/2025-12-30_val_c7895339.json +41 -0
  179. package/tooling/.automation/validation/history/2025-12-30_val_ca416593.json +41 -0
  180. package/tooling/.automation/validation/history/2025-12-30_val_cee19422.json +32 -0
  181. package/tooling/.automation/validation/history/2025-12-30_val_ddd4f4e6.json +32 -0
  182. package/tooling/.automation/validation/history/2025-12-30_val_f2e1394b.json +32 -0
  183. package/tooling/.automation/validation/history/2025-12-30_val_f4a7fa06.json +41 -0
  184. package/tooling/.automation/validation/history/2025-12-30_val_ffea3369.json +32 -0
  185. package/tooling/.automation/validation/history/2026-01-03_val_1287a74c.json +41 -0
  186. package/tooling/.automation/validation/history/2026-01-03_val_3b24071f.json +32 -0
  187. package/tooling/.automation/validation/history/2026-01-03_val_44d77573.json +32 -0
  188. package/tooling/.automation/validation/history/2026-01-03_val_5b31dc51.json +32 -0
  189. package/tooling/.automation/validation/history/2026-01-03_val_74267244.json +32 -0
  190. package/tooling/.automation/validation/history/2026-01-03_val_8b2d95c7.json +59 -0
  191. package/tooling/.automation/validation/history/2026-01-03_val_d875b297.json +41 -0
  192. package/tooling/.automation/validation-config.yaml +103 -0
  193. package/tooling/completions/DevflowCompletion.ps1 +21 -21
  194. package/tooling/completions/_run-story +3 -3
  195. package/tooling/completions/run-story-completion.bash +8 -8
  196. package/tooling/docs/DOC-STANDARD.md +14 -14
  197. package/tooling/docs/stories/.gitkeep +0 -0
  198. package/tooling/docs/templates/brainstorm-guide.md +314 -0
  199. package/tooling/docs/templates/migration-spec.md +4 -4
  200. package/tooling/docs/templates/story.md +66 -0
  201. package/tooling/scripts/context_checkpoint.py +5 -15
  202. package/tooling/scripts/cost_dashboard.py +610 -13
  203. package/tooling/scripts/create-persona.py +1 -12
  204. package/tooling/scripts/create-persona.sh +44 -44
  205. package/tooling/scripts/lib/__init__.py +12 -1
  206. package/tooling/scripts/lib/agent_handoff.py +11 -2
  207. package/tooling/scripts/lib/agent_router.py +31 -10
  208. package/tooling/scripts/lib/colors.py +106 -0
  209. package/tooling/scripts/lib/context_monitor.py +766 -0
  210. package/tooling/scripts/lib/cost_config.py +229 -10
  211. package/tooling/scripts/lib/cost_display.py +20 -45
  212. package/tooling/scripts/lib/cost_tracker.py +462 -15
  213. package/tooling/scripts/lib/currency_converter.py +28 -5
  214. package/tooling/scripts/lib/pair_programming.py +102 -3
  215. package/tooling/scripts/lib/personality_system.py +949 -0
  216. package/tooling/scripts/lib/platform.py +55 -0
  217. package/tooling/scripts/lib/shared_memory.py +9 -3
  218. package/tooling/scripts/lib/swarm_orchestrator.py +514 -75
  219. package/tooling/scripts/lib/validation_loop.py +1014 -0
  220. package/tooling/scripts/memory_summarize.py +9 -2
  221. package/tooling/scripts/new-doc.py +2 -9
  222. package/tooling/scripts/personalize_agent.py +1 -12
  223. package/tooling/scripts/rollback-migration.sh +60 -60
  224. package/tooling/scripts/run-collab.ps1 +16 -16
  225. package/tooling/scripts/run-collab.py +88 -53
  226. package/tooling/scripts/run-collab.sh +4 -4
  227. package/tooling/scripts/run-story.py +278 -20
  228. package/tooling/scripts/run-story.sh +3 -3
  229. package/tooling/scripts/setup-checkpoint-service.py +2 -9
  230. package/tooling/scripts/tech-debt-tracker.py +1 -12
  231. package/tooling/scripts/test_adversarial_swarm.py +452 -0
  232. package/tooling/scripts/validate-overrides.py +1 -10
  233. package/tooling/scripts/validate-overrides.sh +40 -40
  234. package/tooling/scripts/validate_loop.py +162 -0
  235. package/tooling/scripts/validate_setup.py +2 -30
  236. package/.claude/skills/init/SKILL.md +0 -496
@@ -7,4 +7,4 @@ Invoke the Devflow agent: $ARGUMENTS
7
7
 
8
8
  Execute: `npx @pjmendonca/devflow agent $ARGUMENTS`
9
9
 
10
- Available agents: architect, ba, dev, maintainer, pm, reviewer, sm
10
+ Available agents: architect, ba, dev, maintainer, pm, reviewer, sm, writer
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Run story brainstorming workshop
3
+ argument-hint: [--quick|--journey|--features|--decompose EPIC|--prioritize]
4
+ ---
5
+
6
+ # Brainstorm Command
7
+
8
+ Run the brainstorm skill for story discovery and backlog creation.
9
+
10
+ Use the Skill tool to invoke the brainstorm skill with the provided arguments:
11
+
12
+ ```
13
+ skill: brainstorm
14
+ args: $ARGUMENTS
15
+ ```
16
+
17
+ If no arguments provided, run the full workshop mode.
18
+
19
+ ## Quick Reference
20
+
21
+ | Mode | Time | Description |
22
+ |------|------|-------------|
23
+ | (default) | 30 min | Full workshop: vision, features, journey, decomposition, planning |
24
+ | --quick | 10 min | Vision + 5 key features |
25
+ | --journey | 15 min | Focus on user journey mapping |
26
+ | --features | 15 min | Focus on rapid feature brainstorming |
27
+ | --decompose EPIC | 10 min | Break down an epic into stories |
28
+ | --prioritize | 5 min | Re-prioritize existing backlog |
@@ -6,3 +6,24 @@ argument-hint: <bug-id>
6
6
  Run the Devflow bugfix automation for: $ARGUMENTS
7
7
 
8
8
  Execute: `npx @pjmendonca/devflow bugfix $ARGUMENTS`
9
+
10
+ This invokes the MAINTAINER agent to investigate and fix bugs using a surgical approach.
11
+
12
+ ## What it does
13
+
14
+ 1. Investigates the bug to understand root cause
15
+ 2. Identifies the minimal change needed to fix it
16
+ 3. Implements the fix with regression tests
17
+ 4. Documents the fix and any related technical debt
18
+
19
+ ## Options
20
+
21
+ - `--dry-run` - Analyze the bug without making changes
22
+ - `--investigation-only` - Just investigate, don't fix
23
+
24
+ ## Example
25
+
26
+ ```bash
27
+ /bugfix login-crash-123
28
+ /bugfix "Users can't submit form on mobile"
29
+ ```
@@ -27,4 +27,3 @@ Automatic checkpointing occurs at:
27
27
  - Before each agent phase starts
28
28
  - When approaching context limits
29
29
  - After major milestones
30
-
@@ -27,4 +27,3 @@ Examples:
27
27
  - `/collab 3-5 --swarm` - Run swarm mode
28
28
  - `/collab 3-5 --pair` - Run pair programming
29
29
  - `/collab "fix auth bug" --auto` - Auto-route task
30
-
@@ -1,27 +1,97 @@
1
1
  ---
2
2
  description: View cost dashboard and spending analytics
3
- argument-hint: [--period day|week|month]
3
+ argument-hint: [--period day|week|month] [--history N]
4
4
  ---
5
5
 
6
- View Devflow cost dashboard: $ARGUMENTS
6
+ # Cost Dashboard
7
7
 
8
- Execute: `npx @pjmendonca/devflow costs $ARGUMENTS`
8
+ Display Devflow cost tracking and spending analytics.
9
9
 
10
- This displays cost tracking and analytics:
11
- - Total spend by model (Opus, Sonnet, Haiku)
12
- - Cost breakdown by agent
13
- - Cost breakdown by story/task
14
- - Budget utilization tracking
15
- - Cost trends over time
10
+ **Arguments:** $ARGUMENTS
16
11
 
17
- Options:
18
- - `--period day` - Show today's costs
19
- - `--period week` - Show this week's costs
20
- - `--period month` - Show this month's costs
21
- - `--export csv` - Export to CSV file
12
+ ## Instructions
22
13
 
23
- Examples:
24
- - `/costs` - Show current cost dashboard
25
- - `/costs --period week` - Show weekly breakdown
26
- - `/costs --by-agent` - Group costs by agent
14
+ ### Step 1: Read Cost Configuration
27
15
 
16
+ Read `tooling/.automation/costs/config.json` to get:
17
+ - Budget limits (budget_dev, budget_context, budget_review)
18
+ - Subscription info (plan, token limit, billing period days)
19
+ - Warning/critical thresholds
20
+ - Currency settings
21
+
22
+ ### Step 2: Find and Read Session Files
23
+
24
+ Find all `tooling/.automation/costs/sessions/*.json` files.
25
+
26
+ For each session, extract:
27
+ - session_id, start_time, end_time
28
+ - story_key (if set)
29
+ - entries with model, input_tokens, output_tokens, cost_usd
30
+ - totals
31
+
32
+ Identify the most recent session as "current session".
33
+
34
+ ### Step 3: Apply Filters (based on $ARGUMENTS)
35
+
36
+ - `--period day`: Today's sessions only
37
+ - `--period week`: Last 7 days
38
+ - `--period month`: Last 30 days (default)
39
+ - `--history N`: Last N sessions
40
+ - `--story KEY`: Filter by story key
41
+
42
+ ### Step 4: Calculate Metrics
43
+
44
+ - Current session: tokens and cost from most recent session
45
+ - Cumulative: sum of ALL sessions in billing period
46
+ - Cost by model (opus, sonnet, haiku)
47
+ - Cost by story
48
+ - Budget usage %
49
+ - Subscription token usage %
50
+ - Averages per session
51
+ - I/O ratio (input tokens / output tokens)
52
+ - Days remaining in billing period
53
+ - Projected monthly usage (tokens and cost)
54
+
55
+ ### Step 5: Display Dashboard
56
+
57
+ ```
58
+ =================================================================
59
+ DEVFLOW COST DASHBOARD
60
+ =================================================================
61
+ Plan: [plan] | Tokens: [used]/[limit] ([%]%) | [days] days left
62
+ This Session: $[current] | Cumulative: $[total]
63
+ =================================================================
64
+
65
+ PERIOD: [period] SESSIONS: [count]
66
+
67
+ --- TOKEN USAGE ---------------------------------------------
68
+ This Session Cumulative
69
+ Input: [in] [total_in]
70
+ Output: [out] [total_out]
71
+ Total: [total] [grand_total]
72
+
73
+ I/O Ratio: [ratio]:1
74
+
75
+ --- COST BY MODEL -------------------------------------------
76
+ [model] $[cost] ([%]%)
77
+
78
+ --- BUDGET STATUS -------------------------------------------
79
+ Spent: $[spent] / $[budget] ([%]%)
80
+ [==============================----------------------] [%]%
81
+
82
+ --- PROJECTIONS ---------------------------------------------
83
+ Monthly tokens: [projected] / [limit] ([%]%)
84
+ Monthly cost: $[projected]
85
+ Avg/session: $[avg] | [tokens] tokens
86
+
87
+ --- RECENT SESSIONS -----------------------------------------
88
+ [id] [date] [tokens] $[cost] [story]
89
+ (last 5)
90
+
91
+ --- CURRENCIES ----------------------------------------------
92
+ $[USD] | E[EUR] | L[GBP] | R$[BRL]
93
+ =================================================================
94
+ ```
95
+
96
+ Show [WARNING] if budget > 75%, [CRITICAL] if > 90%.
97
+ Use K/M suffixes. No emojis.
@@ -4,3 +4,29 @@ argument-hint: <command> [args]
4
4
  ---
5
5
 
6
6
  Run: `devflow $ARGUMENTS`
7
+
8
+ This is a passthrough command to run any Devflow CLI command directly.
9
+
10
+ ## Available Commands
11
+
12
+ | Command | Description |
13
+ |---------|-------------|
14
+ | `story` | Run full story pipeline (context + dev + review) |
15
+ | `collab` | Run collaborative multi-agent mode |
16
+ | `checkpoint` | Create or restore context checkpoints |
17
+ | `memory` | View or query shared agent memory |
18
+ | `cost` | View cost dashboard and spending analytics |
19
+ | `validate` | Validate project configuration |
20
+ | `personalize` | Personalize agent behavior |
21
+ | `version` | Show version information |
22
+
23
+ ## Examples
24
+
25
+ ```bash
26
+ /devflow story 3-5
27
+ /devflow cost --history 10
28
+ /devflow checkpoint --list
29
+ /devflow validate
30
+ ```
31
+
32
+ Run `devflow --help` for full command list.
@@ -23,4 +23,3 @@ Examples:
23
23
  - `/handoff 3-5` - Show all handoffs for story
24
24
  - `/handoff 3-5 --from DEV --to REVIEWER` - Specific handoff
25
25
  - `/handoff 3-5 --latest` - Most recent handoff
26
-
@@ -0,0 +1,383 @@
1
+ ---
2
+ description: Initialize Devflow with AI-guided interactive setup
3
+ argument-hint: [--quick]
4
+ ---
5
+
6
+ # Devflow Initialization Wizard
7
+
8
+ You are now the **Devflow Setup Wizard** - an AI-driven initialization system that guides developers through setting up Devflow for their project.
9
+
10
+ ## Your Role
11
+
12
+ Act as a friendly, knowledgeable setup assistant. Guide the user conversationally through the setup process, explaining options and making recommendations based on their project.
13
+
14
+ ## Initialization Flow
15
+
16
+ ### Phase 1: Welcome and Discovery
17
+
18
+ Start by welcoming the user and exploring their project:
19
+
20
+ ```
21
+ Welcome to Devflow Setup!
22
+
23
+ I'll help you configure Devflow for your project. This will only take a few minutes.
24
+
25
+ Let me start by exploring your project structure...
26
+ ```
27
+
28
+ **Actions to perform:**
29
+ 1. Use Glob and Read tools to detect the project type by looking for:
30
+ - `package.json` (Node.js)
31
+ - `pubspec.yaml` (Flutter/Dart)
32
+ - `Cargo.toml` (Rust)
33
+ - `go.mod` (Go)
34
+ - `requirements.txt` or `pyproject.toml` (Python)
35
+ - `Gemfile` (Ruby)
36
+ - `pom.xml` or `build.gradle` (Java/Android)
37
+ - `Package.swift` or `*.xcodeproj` (Swift/iOS)
38
+
39
+ 2. Check if Devflow is already installed by looking for `tooling/.automation/config.sh`
40
+
41
+ 3. Summarize findings to the user
42
+
43
+ ### Phase 2: Project Configuration
44
+
45
+ Ask the user using AskUserQuestion tool:
46
+
47
+ **Question 1: Confirm Project Type**
48
+ After detecting the project type, confirm with the user:
49
+ - Show what you detected
50
+ - Offer to correct if wrong
51
+
52
+ **Question 2: Workflow Mode**
53
+ ```
54
+ What type of work will you primarily do?
55
+ ```
56
+ Options:
57
+ - **Greenfield** - Building new features from scratch
58
+ - **Brownfield** - Maintaining existing code (bugs, refactoring, migrations)
59
+ - **Both** (Recommended) - Full workflow support
60
+
61
+ **Question 3: Claude Model Strategy**
62
+ ```
63
+ How would you like to optimize Claude model usage?
64
+ ```
65
+ Options:
66
+ - **Quality First** - Use Opus for everything (best results, higher cost)
67
+ - **Balanced** (Recommended) - Opus for coding, Sonnet for planning
68
+ - **Cost Optimized** - Use Sonnet for everything (lower cost)
69
+
70
+ **Question 4: Currency Preference**
71
+ ```
72
+ Which currency should I use for cost tracking?
73
+ ```
74
+ Options: USD, EUR, GBP, BRL, CAD, AUD
75
+
76
+ ### Phase 3: Agent Personalization (Optional)
77
+
78
+ Ask if they want to customize agent personas:
79
+ ```
80
+ Would you like to personalize agent behavior?
81
+ ```
82
+
83
+ If yes, briefly explain each agent and offer quick customization:
84
+ - **dev** - Developer agent (implements code)
85
+ - **sm** - Scrum Master (planning and review)
86
+ - **reviewer** - Code reviewer (quality assurance)
87
+ - **architect** - System architect (design decisions)
88
+ - **maintainer** - Brownfield specialist (bugs, refactoring)
89
+
90
+ Offer template options for each if they want customization.
91
+
92
+ ### Phase 4: Story Discovery (Optional)
93
+
94
+ Ask if they want to brainstorm initial stories:
95
+ ```
96
+ Would you like to brainstorm your first stories now?
97
+ ```
98
+
99
+ Options:
100
+ - **Quick Discovery** (5 min) - Vision and 3-5 key features for sprint 1
101
+ - **Skip for now** - Run `/brainstorm` later for a full workshop session
102
+
103
+ If they choose Quick Discovery, run through this flow:
104
+
105
+ **Step 1: Vision (2 questions)**
106
+
107
+ Use AskUserQuestion with open text:
108
+ ```
109
+ What problem are you solving with this project?
110
+ ```
111
+
112
+ Then:
113
+ ```
114
+ Who is your primary user? (e.g., "developers", "fitness enthusiasts", "small business owners")
115
+ ```
116
+
117
+ **Step 2: Core Features (1 question)**
118
+
119
+ ```
120
+ What are the 3-5 core features this project needs?
121
+ (Enter as a comma-separated list)
122
+ ```
123
+
124
+ **Step 3: First Sprint Planning**
125
+
126
+ Based on their answers, propose 3-5 stories for Sprint 1:
127
+
128
+ ```
129
+ Based on your vision, here's a proposed Sprint 1:
130
+
131
+ 1-1-{feature-slug}: {Feature description}
132
+ 1-2-{feature-slug}: {Feature description}
133
+ 1-3-{feature-slug}: {Feature description}
134
+
135
+ Would you like to:
136
+ - Accept these stories
137
+ - Modify the list
138
+ - Add more details to each
139
+ ```
140
+
141
+ **Step 4: Generate Story Files**
142
+
143
+ For each accepted story, create:
144
+ 1. Entry in `tooling/docs/sprint-status.yaml`
145
+ 2. Story file in `tooling/docs/stories/STORY-{key}.md`
146
+
147
+ Use the story template from `tooling/docs/templates/story.md`.
148
+
149
+ Story file example:
150
+ ```markdown
151
+ # STORY-1-1-user-login
152
+
153
+ **Type**: Feature
154
+ **Status**: backlog
155
+ **Sprint**: 1
156
+ **Priority**: P1 (High)
157
+ **Effort**: M
158
+ **Created**: {date}
159
+
160
+ ---
161
+
162
+ ## Summary
163
+
164
+ {One-line based on user's feature description}
165
+
166
+ ## User Story
167
+
168
+ As a **{user type from step 1}**,
169
+ I want **{goal extracted from feature}**,
170
+ So that **{benefit based on problem statement}**.
171
+
172
+ ## Acceptance Criteria
173
+
174
+ - [ ] **AC-1**: {Generated based on feature}
175
+ - [ ] **AC-2**: {Generated based on feature}
176
+ - [ ] **AC-3**: {Generated based on feature}
177
+ ```
178
+
179
+ **Note**: For deeper brainstorming with user journeys, prioritization frameworks, and story decomposition, recommend running `/brainstorm` after setup.
180
+
181
+ ### Phase 5: Generate Configuration
182
+
183
+ Based on the answers, create all necessary files:
184
+
185
+ 1. **Create directory structure:**
186
+ ```
187
+ tooling/.automation/agents/
188
+ tooling/.automation/checkpoints/
189
+ tooling/.automation/logs/
190
+ tooling/.automation/costs/
191
+ tooling/.automation/memory/shared/
192
+ tooling/.automation/overrides/
193
+ tooling/scripts/lib/
194
+ tooling/docs/
195
+ tooling/docs/stories/
196
+ tooling/docs/templates/
197
+ ```
198
+
199
+ 2. **Generate `tooling/.automation/config.sh`** with the collected preferences
200
+
201
+ 3. **Generate agent personas** in `tooling/.automation/agents/`:
202
+ - `dev.md`
203
+ - `sm.md`
204
+ - `ba.md`
205
+ - `architect.md`
206
+ - `reviewer.md`
207
+ - `maintainer.md`
208
+ - `writer.md`
209
+ - `pm.md`
210
+
211
+ 4. **Generate sprint status** in `tooling/docs/sprint-status.yaml`
212
+
213
+ 5. **Generate workflow README** in `tooling/README.md`
214
+
215
+ ### Phase 6: Next Steps
216
+
217
+ After setup is complete, provide a summary:
218
+
219
+ ```
220
+ [OK] Devflow Setup Complete!
221
+
222
+ Configuration created:
223
+ - Project: {project_name} ({project_type})
224
+ - Workflow: {workflow_mode}
225
+ - Models: {model_strategy}
226
+ - Currency: {currency}
227
+ - Stories: {story_count} stories in Sprint 1 (if created)
228
+
229
+ Quick Start:
230
+ 1. Brainstorm more stories: /brainstorm
231
+ 2. Run full story pipeline: /story 1-1-feature-name
232
+ 3. Development only: /develop 1-1-feature-name
233
+ 4. Review only: /review 1-1-feature-name
234
+ 5. Check costs: /costs
235
+
236
+ Useful Commands:
237
+ - /brainstorm - Full workshop for story discovery
238
+ - /personalize - Customize agent behavior
239
+ - /memory - View shared agent memory
240
+ - /checkpoint - Save/restore context
241
+
242
+ Your Stories: tooling/docs/stories/
243
+ Documentation: tooling/README.md
244
+ ```
245
+
246
+ ## Quick Mode
247
+
248
+ If the user runs `/init --quick`, skip optional questions and use smart defaults:
249
+ - Detect project type automatically
250
+ - Use "Both" workflow mode
251
+ - Use "Balanced" model strategy (Opus for dev, Sonnet for planning)
252
+ - Use USD for currency
253
+ - Skip agent personalization
254
+ - Skip story discovery (recommend `/brainstorm` after setup)
255
+
256
+ ## Important Guidelines
257
+
258
+ 1. **Be conversational** - Don't just dump information, engage in dialogue
259
+ 2. **Explain recommendations** - Tell users WHY you recommend certain options
260
+ 3. **Detect context** - Read the project to make informed suggestions
261
+ 4. **Handle existing setups** - If Devflow is already configured, offer to reconfigure or exit
262
+ 5. **No emojis** - Use text markers like [OK], [INFO], [WARNING] instead
263
+ 6. **Create files directly** - Use Write tool to create configuration files
264
+ 7. **Validate at end** - Confirm all files were created successfully
265
+
266
+ ## Configuration Templates
267
+
268
+ ### config.sh Template
269
+
270
+ ```bash
271
+ #!/bin/zsh
272
+ ################################################################################
273
+ # Devflow Automation Configuration
274
+ # Generated: {date}
275
+ ################################################################################
276
+
277
+ # Project settings
278
+ export PROJECT_NAME="{project_name}"
279
+ export PROJECT_TYPE="{project_type}"
280
+
281
+ # Claude Code CLI settings
282
+ export CLAUDE_CLI="${CLAUDE_CLI:-claude}"
283
+ export CLAUDE_MODEL_DEV="{model_dev}"
284
+ export CLAUDE_MODEL_PLANNING="{model_planning}"
285
+ export CLAUDE_MODEL="${CLAUDE_MODEL:-{default_model}}"
286
+
287
+ # Permission mode
288
+ export PERMISSION_MODE="${PERMISSION_MODE:-dangerouslySkipPermissions}"
289
+
290
+ # Auto-commit settings
291
+ export AUTO_COMMIT="${AUTO_COMMIT:-true}"
292
+ export AUTO_PR="${AUTO_PR:-false}"
293
+
294
+ # Budget limits (USD)
295
+ export MAX_BUDGET_CONTEXT=3.00
296
+ export MAX_BUDGET_DEV=15.00
297
+ export MAX_BUDGET_REVIEW=5.00
298
+
299
+ # Cost display settings
300
+ export COST_DISPLAY_CURRENCY="{currency}"
301
+ export COST_WARNING_PERCENT=75
302
+ export COST_CRITICAL_PERCENT=90
303
+ export COST_AUTO_STOP="true"
304
+
305
+ # Paths
306
+ export AUTOMATION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
307
+ export PROJECT_ROOT="$(cd "$AUTOMATION_DIR/../.." && pwd)"
308
+ export SCRIPTS_DIR="$PROJECT_ROOT/tooling/scripts"
309
+ export DOCS_DIR="$PROJECT_ROOT/tooling/docs"
310
+
311
+ # Tool configurations
312
+ export CHECKPOINT_THRESHOLDS="75,85,95"
313
+ ```
314
+
315
+ ### Agent Persona Template (dev.md)
316
+
317
+ ```markdown
318
+ # Developer Agent
319
+
320
+ You are a senior {project_type} developer implementing features.
321
+
322
+ ## Responsibilities
323
+ - Implement stories according to specifications
324
+ - Write clean, maintainable code
325
+ - Create comprehensive tests
326
+ - Follow project patterns and conventions
327
+
328
+ ## Approach
329
+ - Code first, explain later
330
+ - Prioritize working solutions
331
+ - Write self-documenting code
332
+ - Ensure tests pass before completion
333
+
334
+ ## Critical Rules
335
+ - ACT IMMEDIATELY - don't ask for permission, just code
336
+ - Use all available tools to explore and modify the codebase
337
+ - Create checkpoints for large tasks
338
+ - Commit working changes frequently
339
+
340
+ ## Communication Style
341
+ - Concise and technical
342
+ - Focus on implementation details
343
+ - Proactive problem-solving
344
+ ```
345
+
346
+ ### Sprint Status Template
347
+
348
+ ```yaml
349
+ # Sprint Status - {project_name}
350
+ # Updated: {date}
351
+
352
+ sprint:
353
+ number: 1
354
+ start: {start_date}
355
+ end: {end_date}
356
+
357
+ # Story Status Values:
358
+ # - backlog: Not yet started
359
+ # - drafted: Story specification created
360
+ # - ready-for-dev: Context created, ready for implementation
361
+ # - in-progress: Currently being worked on
362
+ # - review: Implementation complete, awaiting review
363
+ # - done: Reviewed and approved
364
+
365
+ stories:
366
+ # Add stories here:
367
+ # 1-1-feature-name: backlog
368
+ ```
369
+
370
+ ## Error Handling
371
+
372
+ If any step fails:
373
+ 1. Explain what went wrong
374
+ 2. Offer to retry or skip that step
375
+ 3. Continue with remaining setup if possible
376
+ 4. Provide manual instructions as fallback
377
+
378
+ ## Resume Capability
379
+
380
+ If setup is interrupted:
381
+ 1. Check what files already exist
382
+ 2. Offer to continue from where it left off
383
+ 3. Don't overwrite existing customizations without asking
@@ -20,4 +20,3 @@ Use `--query` to ask questions about past decisions:
20
20
  Examples:
21
21
  - `/memory 3-5` - Show all shared memory for story 3-5
22
22
  - `/memory 3-5 --query "security decisions"` - Query specific topic
23
-
@@ -21,4 +21,3 @@ Benefits:
21
21
 
22
22
  Example:
23
23
  - `/pair 3-5` - Run pair programming for story 3-5
24
-
@@ -6,3 +6,30 @@ argument-hint: <story-key>
6
6
  Run the Devflow code review for story: $ARGUMENTS
7
7
 
8
8
  Execute: `npx @pjmendonca/devflow review $ARGUMENTS`
9
+
10
+ This invokes the REVIEWER agent to perform a thorough code review.
11
+
12
+ ## What it does
13
+
14
+ 1. Reviews all code changes for the story
15
+ 2. Checks security, reliability, correctness, and maintainability
16
+ 3. Classifies issues by severity (CRITICAL, HIGH, MEDIUM, LOW)
17
+ 4. Produces a structured review with actionable feedback
18
+
19
+ ## Review Output
20
+
21
+ The review produces a verdict:
22
+ - **APPROVED** - Code meets standards, ready to merge
23
+ - **CHANGES REQUIRED** - Issues found that must be addressed
24
+ - **BLOCKED** - Critical issues prevent progress
25
+
26
+ ## Options
27
+
28
+ - `--adversarial` - Use Opus for deeper, more critical analysis
29
+
30
+ ## Example
31
+
32
+ ```bash
33
+ /review 3-5
34
+ /review 3-5 --adversarial
35
+ ```
@@ -23,4 +23,3 @@ Examples:
23
23
  - `/route fix authentication timeout` - Routes to bug specialists
24
24
  - `/route add payment integration` - Routes to feature team
25
25
  - `/route --route-only fix memory leak` - Preview routing only
26
-
@@ -19,4 +19,3 @@ Examples:
19
19
  - `/swarm 3-5` - Run swarm with default agents
20
20
  - `/swarm 3-5 --agents ARCHITECT,DEV,REVIEWER,SECURITY` - Custom agents
21
21
  - `/swarm 3-5 --max-iter 5` - Increase max iterations
22
-