@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
@@ -0,0 +1,101 @@
1
+ # Validate Skill
2
+
3
+ Run automated validation checks with feedback loops.
4
+
5
+ ## Description
6
+
7
+ The validate skill runs a three-tier validation system:
8
+
9
+ 1. **Pre-flight** (Tier 1): Checks before execution
10
+ - Story file exists
11
+ - Budget is available
12
+ - Dependencies are valid
13
+
14
+ 2. **Inter-phase** (Tier 2): Checks between agents
15
+ - Code compiles/parses
16
+ - Linting passes
17
+ - Phase transitions are valid
18
+
19
+ 3. **Post-completion** (Tier 3): Checks after pipeline
20
+ - Tests pass
21
+ - Types are valid
22
+ - Version is synced
23
+ - Changelog is updated
24
+
25
+ ## Usage
26
+
27
+ ```
28
+ /validate [story-key] [--tier 1|2|3|all] [--auto-fix] [--json]
29
+ ```
30
+
31
+ ## Arguments
32
+
33
+ | Argument | Description | Default |
34
+ |----------|-------------|---------|
35
+ | story-key | Story identifier to validate | Current branch |
36
+ | --tier | Validation tier (1, 2, 3, or all) | all |
37
+ | --auto-fix | Attempt automatic fixes | false |
38
+ | --json | Output as JSON | false |
39
+ | --quiet | Minimal output | false |
40
+
41
+ ## Examples
42
+
43
+ ### Run all validations
44
+ ```
45
+ /validate 3-5 --tier all
46
+ ```
47
+
48
+ ### Run post-completion checks with auto-fix
49
+ ```
50
+ /validate --tier 3 --auto-fix
51
+ ```
52
+
53
+ ### Get JSON output for CI
54
+ ```
55
+ /validate 3-5 --json
56
+ ```
57
+
58
+ ## Prompt
59
+
60
+ You are running validation checks for the Devflow project.
61
+
62
+ $ARGUMENTS
63
+
64
+ Execute the validation loop:
65
+
66
+ ```python
67
+ import sys
68
+ sys.path.insert(0, "tooling/scripts/lib")
69
+
70
+ from validation_loop import (
71
+ create_validation_loop,
72
+ run_preflight_validation,
73
+ run_post_completion_validation,
74
+ ALL_GATES,
75
+ LoopContext,
76
+ )
77
+
78
+ # Parse arguments
79
+ story_key = "$ARGUMENTS".split()[0] if "$ARGUMENTS" else "validation-check"
80
+ tier = "all" # Default to all tiers
81
+
82
+ # Create context
83
+ context = LoopContext(story_key=story_key)
84
+
85
+ # Run appropriate validation
86
+ if tier == "1" or tier == "all":
87
+ print("[VALIDATION] Running pre-flight checks...")
88
+ report = run_preflight_validation(story_key)
89
+ print(report.to_summary())
90
+
91
+ if tier == "3" or tier == "all":
92
+ print("[VALIDATION] Running post-completion checks...")
93
+ report = run_post_completion_validation(story_key)
94
+ print(report.to_summary())
95
+ ```
96
+
97
+ Report results clearly with:
98
+ - [PASS] for passed gates
99
+ - [WARN] for warnings
100
+ - [FAIL] for failures
101
+ - Suggested fixes when available
package/CHANGELOG.md CHANGED
@@ -5,6 +5,290 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.19.0] - 2026-01-03
9
+
10
+ ### Added
11
+ - **Story Discovery Phase in Init Wizard** - Optional Phase 4 for quick story brainstorming
12
+ - Vision discovery with problem, users, success metrics, and competitive advantage
13
+ - Core feature identification with comma-separated input
14
+ - First sprint planning with story proposals
15
+ - Automatic story file generation in `tooling/docs/stories/`
16
+ - Integration with sprint-status.yaml for backlog tracking
17
+
18
+ - **Brainstorm Skill** - Full workshop for product discovery and story creation
19
+ - `/brainstorm` command for 30-minute comprehensive workshops
20
+ - `--quick` mode for 10-minute vision + features session
21
+ - `--journey` mode for focused user journey mapping
22
+ - `--features` mode for rapid feature brainstorming
23
+ - `--decompose EPIC` to break epics into stories
24
+ - `--prioritize` to re-prioritize existing backlog
25
+
26
+ - **Brainstorming Techniques Guide** - Reference documentation for discovery methods
27
+ - Guided Discovery (Socratic method) with vision and feature questions
28
+ - User Journey Mapping with 5-stage framework (Trigger, Entry, Core, Success, Retention)
29
+ - Rapid Feature List with MoSCoW prioritization
30
+ - Story Decomposition with INVEST criteria
31
+ - RICE scoring and Impact/Effort matrix for prioritization
32
+
33
+ - **Story Template** - New `tooling/docs/templates/story.md` for feature stories
34
+ - User story format with acceptance criteria
35
+ - Priority and effort sizing (XS/S/M/L/XL)
36
+ - Technical notes, business rules, and dependencies
37
+ - Testing strategy and definition of done
38
+
39
+ - **Stories Directory** - `tooling/docs/stories/` for story file storage
40
+ - Stories use format: `STORY-{sprint}-{number}-{slug}.md`
41
+ - Integrated with sprint-status.yaml tracking
42
+
43
+ ### Changed
44
+ - **Init Wizard** - Now 6 phases (added Story Discovery as Phase 4)
45
+ - Quick Mode skips story discovery, recommends `/brainstorm` after setup
46
+ - Phase 6 summary includes story count and brainstorm command reference
47
+ - Directory structure now includes `tooling/docs/stories/` and `tooling/docs/templates/`
48
+
49
+ ## [1.18.0] - 2025-12-30
50
+
51
+ ### Added
52
+ - **Adversarial Swarm Mode** - Multi-agent debates with opposing personas for robust designs
53
+ - `personality_system.py` - Dynamic persona selection and adversarial stance management
54
+ - `PersonalitySelector` - Analyzes tasks and selects opposing personas automatically
55
+ - `ConvergenceDetector` - Hybrid convergence detection (position stability + token budget)
56
+ - `PersonalityHandoff` - Structured handoff with debate summary for implementing agent
57
+ - Agents assigned adversarial stances that naturally oppose each other
58
+ - Cross-challenge prompts force agents to defend positions and find edge cases
59
+ - Automatic consensus/convergence detection ends debates efficiently
60
+
61
+ - **Adversarial Stance Templates** - Added `adversarial_stance` to persona templates
62
+ - `primary_concern` - Agent's core focus (security, velocity, simplicity, etc.)
63
+ - `opposes` - Stances this persona naturally challenges
64
+ - `challenge_triggers` - Phrases that trigger pushback
65
+ - `debate_style` - How the agent argues (assertive, questioning, evidence-based)
66
+ - Updated templates: thorough-critic, security-focused, rapid-prototyper,
67
+ quick-sanity, enterprise-architect, pragmatic-minimalist, performance-engineer
68
+
69
+ - **New Persona Templates** for better adversarial coverage
70
+ - `dev/user-advocate.yaml` - UX-focused developer who champions end users
71
+ - `maintainer/reliability-engineer.yaml` - Reliability/SRE perspective on failure modes
72
+
73
+ - **Test Harness for Swarm Performance** - Benchmark and analyze debate effectiveness
74
+ - `test_adversarial_swarm.py` - Simulated testing without LLM calls
75
+ - Tracks per-round metrics: new arguments, challenges, concessions, agreement
76
+ - Calculates marginal value per round to identify diminishing returns
77
+ - Generates performance plots (matplotlib) showing trends over rounds
78
+ - Saves benchmark results to `tooling/.automation/benchmarks/`
79
+
80
+ ### Changed
81
+ - **SwarmOrchestrator** - Now adversarial by default
82
+ - Prompts restructured for debate format with cross-challenges
83
+ - Agents receive opponent positions and must respond to challenges
84
+ - Concession tracking for convergence detection
85
+ - PersonalityHandoff generated with consensus points and unresolved tensions
86
+
87
+ ## [1.17.0] - 2025-12-29
88
+
89
+ ### Added
90
+ - **Usage Projection & Forecasting** - Predict when subscription limits will be reached
91
+ - `cost_tracker.py` - `get_usage_projection()` calculates daily averages and forecasts
92
+ - Dashboard shows "At current rate, limit reached in X days" warnings
93
+ - Displays projected end-of-period usage vs limit
94
+ - Color-coded on-track/warning/critical status
95
+ - **Model Efficiency Metrics** - Cost-per-output-token analysis
96
+ - `cost_tracker.py` - `get_model_efficiency()` ranks models by efficiency
97
+ - `cost_dashboard.py` - `--efficiency` / `-E` flag to display metrics
98
+ - Shows: $/1K output tokens, output/input ratio, calls, total cost
99
+ - Highlights most cost-efficient model with [BEST] badge
100
+ - **Subscription Plan Presets** - Easy configuration with common plans
101
+ - `cost_config.py` - `SUBSCRIPTION_PLANS` with free/developer/pro/scale/enterprise
102
+ - `--set-plan` CLI flag to configure and persist plan
103
+ - Environment variable: `SUBSCRIPTION_PLAN=pro`
104
+ - Auto-saves to config.json for persistence
105
+ - **Analytics Export System** - Comprehensive reports with trends and rankings
106
+ - `--schedule-export` flag generates full analytics report
107
+ - Daily usage trends (last 14 days with tokens, cost, sessions)
108
+ - Per-story cost rankings (top 10 by token consumption)
109
+ - Period comparison (current vs previous period with deltas)
110
+ - API rate statistics (calls/day, calls/hour, peak times)
111
+ - Export formats: JSON (full data), Markdown (formatted report)
112
+ - **API Rate Tracking** - Monitor API call patterns
113
+ - `cost_tracker.py` - `get_api_rate_stats()` for call frequency analysis
114
+ - Tracks: total calls, calls per day/hour, peak hour, peak day
115
+ - Hourly and daily distribution data for pattern analysis
116
+
117
+ ## [1.16.0] - 2025-12-29
118
+
119
+ ### Added
120
+ - **Subscription Usage Tracking** - Track token usage against API subscription limits
121
+ - `cost_config.py` - New `subscription_token_limit` and `subscription_billing_period_days` settings
122
+ - `cost_tracker.py` - `get_subscription_usage()` and `get_subscription_percentage()` methods
123
+ - `cost_dashboard.py` - `--subscription` / `-S` flag to display subscription usage
124
+ - Environment variable support: `SUBSCRIPTION_TOKEN_LIMIT`, `SUBSCRIPTION_BILLING_PERIOD_DAYS`
125
+ - Progress bar visualization with color-coded status (ok/warning/critical/exceeded)
126
+ - Subscription summary included in `--summary` view when configured
127
+ - Tracks: used tokens, remaining tokens, percentage, billing period, total cost
128
+
129
+ ## [1.15.0] - 2025-12-29
130
+
131
+ ### Added
132
+ - **Context Monitor** - Real-time context window tracking and compaction awareness
133
+ - `lib/context_monitor.py` - Core context monitoring with threshold detection
134
+ - Tracks token usage and estimates context window consumption
135
+ - Five-level threshold system: SAFE, CAUTION, WARNING, CRITICAL, EMERGENCY
136
+ - Automatic checkpoint triggers at critical thresholds
137
+ - Activity tracking (current agent, phase, task) for status display
138
+ - **Persistent Status Line** - Always-visible CLI status during operations
139
+ - Shows: Agent, Phase, Context%, Cost, Time in compact format
140
+ - Color-coded context indicators based on usage level
141
+ - Phase progress display (e.g., "[2/3] DEV Development (0:45)")
142
+ - Proactive warnings before compaction thresholds
143
+ - **Status Line Integration** - Added to story runner
144
+ - `run-story.py` - Integrated context monitor with cost tracking
145
+ - Real-time status updates during phase execution
146
+ - Auto-checkpoint at critical/emergency context levels
147
+ - **Unit Tests** - Comprehensive test coverage
148
+ - `tests/test_context_monitor.py` - 38 tests for context monitoring
149
+
150
+ ### Changed
151
+ - **NativeRunner** - Now includes context monitoring alongside cost tracking
152
+ - **.gitignore** - Added context and checkpoint directories for user-specific data
153
+
154
+ ## [1.14.0] - 2025-12-29
155
+
156
+ ### Added
157
+ - **Validation Loop Framework** - Three-tier automated feedback and validation system
158
+ - `lib/validation_loop.py` - Core validation engine with configurable gates
159
+ - Tier 1 (Pre-flight): Story exists, budget available, dependencies valid
160
+ - Tier 2 (Inter-phase): Code compiles, lint passes, phase transitions
161
+ - Tier 3 (Post-completion): Tests pass, types valid, version synced
162
+ - Auto-fix capability for lint and formatting issues
163
+ - Validation history tracking in shared memory/knowledge graph
164
+ - **Validation Integration** - Added to all agent pipelines
165
+ - `run-story.py` - Pre-flight, inter-phase, and post-completion validation
166
+ - `run-collab.py` - Pre-flight and post-completion validation
167
+ - `swarm_orchestrator.py` - Inter-iteration validation
168
+ - `pair_programming.py` - Inter-revision validation
169
+ - **Validation CLI** - New command and skill for running validation
170
+ - `/validate` command in `.claude/commands/validate.md`
171
+ - Validate skill in `.claude/skills/validate/SKILL.md`
172
+ - Standalone script `tooling/scripts/validate_loop.py` for CI/CLI usage
173
+ - **Validation Configuration** - YAML-based configuration
174
+ - `tooling/.automation/validation-config.yaml` - Gate configuration
175
+ - Per-gate overrides for timeouts, commands, and auto-fix
176
+ - **CI Integration** - Validation in CI/CD pipeline
177
+ - New `validation-loop` job in `.github/workflows/ci.yml`
178
+ - Pre-commit hooks for validation in `.pre-commit-config.yaml`
179
+ - **Unit Tests** - Comprehensive test coverage
180
+ - `tests/test_validation_loop.py` - Tests for validation system
181
+
182
+ ### Changed
183
+ - **SwarmConfig** - Added `validation_enabled` flag (default: true)
184
+ - **PairConfig** - Added `validation_enabled` flag (default: true)
185
+
186
+ ## [1.13.6] - 2025-12-29
187
+
188
+ ### Fixed
189
+ - **Logic Bug in Prompt Sanitization** - Fixed always-true condition in `_sanitize_prompt()`
190
+ - `swarm_orchestrator.py` - Condition `(ord(char) >= 32 or ord(char) >= 128)` was always true
191
+ - `pair_programming.py` - Same bug fixed
192
+ - Now correctly filters control characters while preserving printable content
193
+ - **Environment Variable Validation** - Added safe parsing in `cost_config.py`
194
+ - `from_env()` now uses `_safe_float()` and `_safe_int()` helpers
195
+ - Invalid values are logged and defaults are used instead of crashing
196
+ - **Module-level Import** - Moved `import re` to module level in `cost_tracker.py`
197
+ - Was previously inside `parse_token_usage()` function
198
+ - Improves import time consistency
199
+
200
+ ## [1.13.5] - 2025-12-29
201
+
202
+ ### Added
203
+ - **Subprocess Sanitization** - Security hardening for agent invocations
204
+ - `swarm_orchestrator.py` - Added `_sanitize_prompt()` for safe subprocess execution
205
+ - `pair_programming.py` - Same sanitization to prevent injection attacks
206
+ - Removes null bytes, control characters, and enforces length limits
207
+ - **Pricing Cache** - Performance optimization for cost calculations
208
+ - `cost_tracker.py` - Added `_get_pricing()` with model lookup caching
209
+ - Eliminates repeated dictionary iterations for same models
210
+
211
+ ### Fixed
212
+ - **Dead Code** - Removed unused code paths in `run-collab.py`
213
+ - Fixed unused `prompt` variable (was discarded f-string)
214
+ - Now captures and reports `run_sequential_mode()` return value
215
+ - **Input Validation** - Added type validation in `cost_tracker.py`
216
+ - `calculate_cost()` now validates token inputs are numeric
217
+ - Raises `CalculationError` with helpful message for invalid inputs
218
+ - **Negative Padding Crash** - Fixed crash in `cost_display.py`
219
+ - `_content_line()` now truncates content if too long
220
+ - Prevents negative padding that caused display errors
221
+ - **Atomic File Writes** - Prevent config corruption in `currency_converter.py`
222
+ - `save_config()` now writes to temp file first, then atomic rename
223
+ - Cleans up temp file on failure
224
+
225
+ ### Changed
226
+ - **Configurable Constants** - Extracted hardcoded values in `agent_router.py`
227
+ - `CONFIDENCE_BASE`, `CONFIDENCE_PATTERN_WEIGHT`, `CONFIDENCE_FILE_CONTEXT_WEIGHT`
228
+ - `COMPLEXITY_SIMPLE_THRESHOLD`, `COST_OPT_COMPLEXITY_THRESHOLD`, `MAX_ALTERNATIVES`
229
+ - **Pre-compiled Patterns** - Performance optimization in `agent_router.py`
230
+ - `COMPILED_TASK_PATTERNS` - Pre-compiled regex for task type detection
231
+ - Faster pattern matching in `analyze_task()` method
232
+
233
+ ## [1.13.4] - 2025-12-27
234
+
235
+ ### Added
236
+ - **Pre-commit Configuration** - New `.pre-commit-config.yaml` for automated code quality
237
+ - Ruff linting and formatting
238
+ - MyPy type checking
239
+ - Shell script linting with shellcheck
240
+ - General file hygiene (trailing whitespace, YAML/JSON validation)
241
+ - **Agent Router Tests** - Comprehensive test suite for `agent_router.py`
242
+ - Tests for task type detection, complexity estimation, routing logic
243
+ - Tests for workflow selection and alternative agent suggestions
244
+
245
+ ### Fixed
246
+ - **Bare Exception Handling** - Replaced broad `except Exception` with specific types
247
+ - `cost_config.py` - Now catches `json.JSONDecodeError` and `OSError` separately
248
+ - `currency_converter.py` - Now catches `json.JSONDecodeError` and `OSError` separately
249
+ - `agent_handoff.py` - Git operations now catch `subprocess.SubprocessError`
250
+ - **Silent Failures** - Added warning messages to previously silent catch blocks
251
+ - `shared_memory.py` - Now logs warnings for corrupted memory/knowledge graph files
252
+ - `agent_handoff.py` - Now logs warnings when git operations fail
253
+ - **Regex Performance** - Pre-compiled regex patterns in `memory_summarize.py`
254
+
255
+ ### Changed
256
+ - **Environment Variables** - Standardized on `os.getenv()` across all files
257
+ - Updated `colors.py`, `cost_display.py`, `run-collab.py`
258
+ - Consistent pattern for environment variable access
259
+
260
+ ## [1.13.3] - 2025-12-27
261
+
262
+ ### Added
263
+ - **Shared Python Libraries** - New reusable modules in `lib/`
264
+ - `colors.py` - Consolidated ANSI color codes with cross-platform support
265
+ - `platform.py` - Unified platform detection utilities
266
+ - **Agent Improvements** - Enhanced all agent definitions
267
+ - Added "When Complete" sections to ARCHITECT, MAINTAINER, BA, PM, WRITER agents
268
+ - Added "Context Management" sections to all agents missing them
269
+ - **Command Documentation** - Expanded command help files
270
+ - Enhanced `/bugfix` with workflow description and options
271
+ - Enhanced `/devflow` with full command reference table
272
+ - Enhanced `/review` with verdict explanations and options
273
+
274
+ ### Fixed
275
+ - **JavaScript Bug** - Fixed no-op ternary in `lib/exec-python.js:53-55` that did nothing
276
+ - **Stale Reference** - Removed orphaned `devflow-init` from `lib/constants.js`
277
+ - **Error Handling** - Added error handler to `spawn()` in `bin/devflow.js`
278
+ - **Silent Failures** - Added error logging to `bin/devflow-install.js`
279
+ - **Regex Bug** - Fixed `.match()` to `.test()` in `bin/devflow-install.js:30`
280
+ - **Empty List Crash** - Added guard for empty list in `memory_summarize.py:138`
281
+ - **Emoji Policy Violation** - Removed emojis from `CONTRIBUTING.md` table
282
+ - **README Examples** - Updated deprecated `./run-story.sh` to `npx @pjmendonca/devflow story`
283
+ - **SECURITY Agent** - Removed references to non-existent SECURITY agent from README
284
+
285
+ ### Changed
286
+ - **DOC-STANDARD.md** - Renamed from "Stronger Project" to "Devflow"
287
+ - **DOC-STANDARD.md** - Updated callout conventions to use text-based format (no emojis)
288
+ - **REVIEWER Agent** - Fixed contradictory "rubber stamping" rule
289
+ - **Agent Command** - Added missing `writer` to available agents list
290
+ - **.gitignore** - Added `.claude/plans/` exclusion
291
+
8
292
  ## [1.13.2] - 2025-12-27
9
293
 
10
294
  ### Removed
package/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  A production-ready, portable workflow automation system that uses Claude Code CLI to implement user stories with minimal human intervention. Think "CI/CD for development" - but instead of deploying code, it writes code.
11
11
 
12
+ Find us at our [discord](https://discord.gg/mHdyQ7VN8R)
13
+
12
14
  ### Key Features
13
15
 
14
16
  - **Multi-Persona Agent System** - 8 specialized AI agents (SM, DEV, BA, ARCHITECT, PM, WRITER, MAINTAINER, REVIEWER)
@@ -23,6 +25,8 @@ A production-ready, portable workflow automation system that uses Claude Code CL
23
25
  - **Shared Memory** - Cross-agent memory pool for context sharing and learnings
24
26
  - **Agent Handoff System** - Structured context preservation between agent transitions
25
27
  - **Multi-Currency Cost Tracking** - Customizable currency display with budget controls and alerts
28
+ - **Persistent Status Line** - Real-time context and cost percentage display in CLI
29
+ - **Validation Framework** - Three-tier automated validation with auto-fix capability
26
30
  - **Project Agnostic** - Works with Flutter, Node.js, Python, Rust, Go, Ruby, etc.
27
31
  - **Guided Setup** - Interactive wizard guides you through installation
28
32
 
@@ -275,16 +279,16 @@ Multiple agents work together, debating and iterating until consensus:
275
279
 
276
280
  ```bash
277
281
  # Run swarm with default agents (ARCHITECT, DEV, REVIEWER)
278
- ./run-story.sh 3-5 --swarm
282
+ npx @pjmendonca/devflow story 3-5 --swarm
279
283
 
280
284
  # Custom agent selection
281
- ./run-story.sh 3-5 --swarm --agents ARCHITECT,DEV,REVIEWER,SECURITY
285
+ npx @pjmendonca/devflow story 3-5 --swarm --agents ARCHITECT,DEV,REVIEWER
282
286
 
283
287
  # Control iterations
284
- ./run-story.sh 3-5 --swarm --max-iter 5
288
+ npx @pjmendonca/devflow story 3-5 --swarm --max-iter 5
285
289
 
286
290
  # Set budget limits
287
- ./run-story.sh 3-5 --swarm --budget 20.00
291
+ npx @pjmendonca/devflow story 3-5 --swarm --budget 20.00
288
292
  ```
289
293
 
290
294
  **Swarm Configuration Options:**
@@ -313,7 +317,7 @@ Multiple agents work together, debating and iterating until consensus:
313
317
  DEV and REVIEWER work together in real-time:
314
318
 
315
319
  ```bash
316
- ./run-story.sh 3-5 --pair
320
+ npx @pjmendonca/devflow story 3-5 --pair
317
321
  ```
318
322
 
319
323
  **How it works:**
@@ -328,16 +332,16 @@ Let Devflow automatically select the best agents:
328
332
 
329
333
  ```bash
330
334
  # Auto-detect task type and select appropriate agents
331
- ./run-story.sh "fix authentication bug" --auto-route
335
+ npx @pjmendonca/devflow story "fix authentication bug" --auto-route
332
336
 
333
337
  # Works with any task description
334
- ./run-story.sh "add user profile feature" --auto-route
338
+ npx @pjmendonca/devflow story "add user profile feature" --auto-route
335
339
  ```
336
340
 
337
341
  **How it works:**
338
342
  - Analyzes task description for keywords
339
343
  - Considers file types and complexity
340
- - Routes to appropriate specialists (e.g., security -> SECURITY agent)
344
+ - Routes to appropriate specialists (e.g., bugs -> MAINTAINER agent, new features -> DEV agent)
341
345
 
342
346
  ## Cost Tracking & Currency Configuration
343
347
 
@@ -434,6 +438,199 @@ python tooling/scripts/cost_dashboard.py --summary
434
438
  - **Set budget limits** - Prevent runaway costs with phase-specific limits
435
439
  - **Monitor the dashboard** - Track spending patterns across stories
436
440
 
441
+ ### Status Line
442
+
443
+ Devflow provides a persistent status line in Claude Code that shows real-time metrics:
444
+
445
+ ```
446
+ [Devflow] Claude Opus 4.5 | Context: 12.3% | Cost: $0.1234 (8.2%) | +45 -12 lines
447
+ ```
448
+
449
+ **What it shows:**
450
+ - **Model** - Current Claude model in use
451
+ - **Context** - Percentage of context window used (with color coding)
452
+ - **Cost** - Cumulative cost with subscription usage percentage
453
+ - **Lines** - Lines added/removed in the session
454
+
455
+ **Retroactive Cost Tracking:**
456
+
457
+ The cost percentage is calculated retroactively across all sessions in your billing period:
458
+ - Reads all session files from `tooling/.automation/costs/sessions/`
459
+ - Sums tokens used within the billing period (default: 30 days)
460
+ - Shows percentage of your subscription token limit used
461
+ - Updates in real-time as you work
462
+
463
+ **Color coding for cost percentage:**
464
+ - **Green** - Under 75% of subscription limit
465
+ - **Yellow** - 75-89% of subscription limit (warning)
466
+ - **Red** - 90%+ of subscription limit (critical)
467
+
468
+ **Configuration:**
469
+
470
+ The status line reads currency settings from `tooling/.automation/costs/config.json`. To customize:
471
+
472
+ ```bash
473
+ # Set display currency
474
+ export COST_DISPLAY_CURRENCY="EUR"
475
+
476
+ # Or edit config.json:
477
+ {
478
+ "display_currency": "BRL",
479
+ "currency_rates": {
480
+ "USD": 1.0,
481
+ "BRL": 6.10,
482
+ "EUR": 0.92
483
+ }
484
+ }
485
+ ```
486
+
487
+ ### Subscription Usage Tracking
488
+
489
+ Track your usage against API subscription limits:
490
+
491
+ ```bash
492
+ # View subscription usage
493
+ python tooling/scripts/cost_dashboard.py --subscription
494
+
495
+ # Set your plan manually
496
+ python tooling/scripts/cost_dashboard.py --set-plan pro
497
+
498
+ # View usage projection
499
+ python tooling/scripts/cost_dashboard.py --subscription
500
+ ```
501
+
502
+ **Auto-Detection:**
503
+
504
+ Devflow automatically detects your subscription plan based on the model you're using:
505
+ - **Opus** users -> Pro plan (5M tokens/month)
506
+ - **Sonnet** users -> Developer plan (1M tokens/month)
507
+ - **Haiku** users -> Free plan (100K tokens/month)
508
+
509
+ The detected plan is saved to `tooling/.automation/costs/config.json` for future sessions.
510
+
511
+ **Available plans:** free, developer, pro, scale, enterprise
512
+
513
+ **Manual configuration (overrides auto-detection):**
514
+ ```bash
515
+ export SUBSCRIPTION_PLAN="pro" # Use a preset plan
516
+ export SUBSCRIPTION_TOKEN_LIMIT=5000000 # Or set custom limit
517
+ ```
518
+
519
+ ### Model Efficiency Metrics
520
+
521
+ Analyze which models give you the best value:
522
+
523
+ ```bash
524
+ python tooling/scripts/cost_dashboard.py --efficiency
525
+ ```
526
+
527
+ Shows cost-per-output-token for each model, helping optimize model selection.
528
+
529
+ ### Usage Projection & Forecasting
530
+
531
+ Predict when you'll reach your subscription limits:
532
+
533
+ ```bash
534
+ # View usage projection in subscription view
535
+ python tooling/scripts/cost_dashboard.py --subscription
536
+ ```
537
+
538
+ **What it shows:**
539
+ - Daily average token consumption
540
+ - Projected days until limit reached
541
+ - End-of-period usage forecast vs limit
542
+ - Color-coded status: on-track (green), warning (yellow), critical (red)
543
+
544
+ ### Analytics Export System
545
+
546
+ Generate comprehensive analytics reports:
547
+
548
+ ```bash
549
+ # Generate full analytics report (Markdown)
550
+ python tooling/scripts/cost_dashboard.py --schedule-export report.md
551
+
552
+ # Export to JSON format
553
+ python tooling/scripts/cost_dashboard.py --schedule-export report.json
554
+ ```
555
+
556
+ **Report contents:**
557
+ - Daily usage trends (last 14 days with tokens, cost, sessions)
558
+ - Per-story cost rankings (top 10 by token consumption)
559
+ - Period comparison (current vs previous period with deltas)
560
+ - API rate statistics (calls/day, calls/hour, peak times)
561
+
562
+ ### API Rate Tracking
563
+
564
+ Monitor your API call patterns:
565
+
566
+ ```bash
567
+ python tooling/scripts/cost_dashboard.py --summary
568
+ ```
569
+
570
+ **Metrics tracked:**
571
+ - Total API calls in period
572
+ - Average calls per day/hour
573
+ - Peak usage hour and day
574
+ - Hourly and daily distribution data
575
+
576
+ ## Validation Framework
577
+
578
+ Devflow includes a three-tier validation system that ensures code quality throughout the development pipeline.
579
+
580
+ ### Validation Tiers
581
+
582
+ | Tier | Name | When | Validates |
583
+ |------|------|------|-----------|
584
+ | 1 | Pre-flight | Before starting | Story exists, budget available, dependencies |
585
+ | 2 | Inter-phase | Between phases | Code compiles, lint passes, phase transitions |
586
+ | 3 | Post-completion | After finishing | Tests pass, types valid, version synced |
587
+
588
+ ### Running Validation
589
+
590
+ ```bash
591
+ # Validate a story
592
+ /validate 3-5
593
+
594
+ # Run specific tier
595
+ /validate 3-5 --tier pre-flight
596
+
597
+ # Run with auto-fix for lint issues
598
+ /validate 3-5 --auto-fix
599
+ ```
600
+
601
+ ### Validation Gates
602
+
603
+ **Pre-flight (Tier 1):**
604
+ - Story file exists
605
+ - Budget is available
606
+ - Required dependencies installed
607
+
608
+ **Inter-phase (Tier 2):**
609
+ - TypeScript/Python compilation
610
+ - Linting (with auto-fix option)
611
+ - Phase transition rules
612
+
613
+ **Post-completion (Tier 3):**
614
+ - Test suite passes
615
+ - Type checking passes
616
+ - Version sync validated
617
+
618
+ ### Configuration
619
+
620
+ Customize validation in `tooling/.automation/validation-config.yaml`:
621
+
622
+ ```yaml
623
+ gates:
624
+ lint:
625
+ enabled: true
626
+ auto_fix: true
627
+ timeout: 60
628
+ test:
629
+ enabled: true
630
+ command: "npm test"
631
+ timeout: 300
632
+ ```
633
+
437
634
  ## Shell Completion
438
635
 
439
636
  Enable tab-completion for faster command entry.
@@ -550,7 +747,7 @@ Free to use in commercial and personal projects.
550
747
 
551
748
 
552
749
  <!-- VERSION_START - Auto-updated by update_version.py -->
553
- **Version**: 1.13.2
750
+ **Version**: 1.19.0
554
751
  **Status**: Production Ready
555
- **Last Updated**: 2025-12-27
752
+ **Last Updated**: 2026-01-03
556
753
  <!-- VERSION_END -->
@@ -14,6 +14,7 @@ if (fs.existsSync(path.join(targetDir, '.claude', 'commands', 'story.md'))) {
14
14
  try {
15
15
  execSync(`node "${path.join(__dirname, 'devflow-validate.js')}"`, { stdio: 'inherit' });
16
16
  } catch (error) {
17
+ console.error('Validation failed. Please check the errors above.');
17
18
  process.exit(1);
18
19
  }
19
20
  process.exit(0);
@@ -27,7 +28,7 @@ function copyDir(src, dest, exclude = []) {
27
28
  const srcPath = path.join(src, entry.name);
28
29
  const destPath = path.join(dest, entry.name);
29
30
 
30
- if (exclude.some(pattern => entry.name.match(pattern))) continue;
31
+ if (exclude.some(pattern => pattern.test(entry.name))) continue;
31
32
 
32
33
  if (entry.isDirectory()) {
33
34
  copyDir(srcPath, destPath, exclude);
package/bin/devflow.js CHANGED
@@ -46,6 +46,10 @@ const command = args[0];
46
46
  if (commands[command]) {
47
47
  const binPath = require.resolve(`./devflow-${command}.js`);
48
48
  const child = spawn('node', [binPath, ...args.slice(1)], { stdio: 'inherit' });
49
+ child.on('error', (err) => {
50
+ console.error(`Failed to execute command: ${err.message}`);
51
+ process.exit(1);
52
+ });
49
53
  child.on('exit', (code) => process.exit(code || 0));
50
54
  } else {
51
55
  console.error(`Unknown command: ${command}`);