@pjmendonca/devflow 1.9.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 (124) hide show
  1. package/CHANGELOG.md +526 -0
  2. package/LICENSE +21 -0
  3. package/README.md +620 -0
  4. package/bin/devflow-checkpoint.js +10 -0
  5. package/bin/devflow-collab.js +10 -0
  6. package/bin/devflow-cost.js +10 -0
  7. package/bin/devflow-create-persona.js +10 -0
  8. package/bin/devflow-init.js +10 -0
  9. package/bin/devflow-memory.js +10 -0
  10. package/bin/devflow-new-doc.js +10 -0
  11. package/bin/devflow-personalize.js +10 -0
  12. package/bin/devflow-setup-checkpoint.js +10 -0
  13. package/bin/devflow-story.js +10 -0
  14. package/bin/devflow-tech-debt.js +10 -0
  15. package/bin/devflow-validate-overrides.js +10 -0
  16. package/bin/devflow-validate.js +10 -0
  17. package/bin/devflow-version.js +10 -0
  18. package/lib/constants.js +30 -0
  19. package/lib/exec-python.js +78 -0
  20. package/lib/python-check.js +178 -0
  21. package/package.json +64 -0
  22. package/tooling/.automation/agents/architect.md +135 -0
  23. package/tooling/.automation/agents/ba.md +70 -0
  24. package/tooling/.automation/agents/dev.md +79 -0
  25. package/tooling/.automation/agents/maintainer.md +97 -0
  26. package/tooling/.automation/agents/pm.md +116 -0
  27. package/tooling/.automation/agents/reviewer.md +141 -0
  28. package/tooling/.automation/agents/sm.md +61 -0
  29. package/tooling/.automation/agents/writer.md +193 -0
  30. package/tooling/.automation/config.ps1.template +61 -0
  31. package/tooling/.automation/config.sh.template +48 -0
  32. package/tooling/.automation/memory/.gitkeep +6 -0
  33. package/tooling/.automation/memory/knowledge/kg_integration-test.json +94 -0
  34. package/tooling/.automation/memory/knowledge/kg_test-story.json +300 -0
  35. package/tooling/.automation/memory/shared/shared_integration-test.json +30 -0
  36. package/tooling/.automation/memory/shared/shared_test-story.json +78 -0
  37. package/tooling/.automation/overrides/templates/README.md +113 -0
  38. package/tooling/.automation/overrides/templates/architect/README.md +27 -0
  39. package/tooling/.automation/overrides/templates/architect/cloud-native.yaml +92 -0
  40. package/tooling/.automation/overrides/templates/architect/enterprise-architect.yaml +85 -0
  41. package/tooling/.automation/overrides/templates/architect/pragmatic-minimalist.yaml +88 -0
  42. package/tooling/.automation/overrides/templates/ba/README.md +27 -0
  43. package/tooling/.automation/overrides/templates/ba/agile-storyteller.yaml +86 -0
  44. package/tooling/.automation/overrides/templates/ba/domain-expert.yaml +91 -0
  45. package/tooling/.automation/overrides/templates/ba/requirements-engineer.yaml +89 -0
  46. package/tooling/.automation/overrides/templates/dev/README.md +32 -0
  47. package/tooling/.automation/overrides/templates/dev/junior-mentored.yaml +39 -0
  48. package/tooling/.automation/overrides/templates/dev/performance-engineer.yaml +43 -0
  49. package/tooling/.automation/overrides/templates/dev/rapid-prototyper.yaml +52 -0
  50. package/tooling/.automation/overrides/templates/dev/security-focused.yaml +43 -0
  51. package/tooling/.automation/overrides/templates/dev/senior-fullstack.yaml +39 -0
  52. package/tooling/.automation/overrides/templates/maintainer/README.md +27 -0
  53. package/tooling/.automation/overrides/templates/maintainer/devops-maintainer.yaml +113 -0
  54. package/tooling/.automation/overrides/templates/maintainer/legacy-steward.yaml +94 -0
  55. package/tooling/.automation/overrides/templates/maintainer/oss-maintainer.yaml +94 -0
  56. package/tooling/.automation/overrides/templates/pm/README.md +27 -0
  57. package/tooling/.automation/overrides/templates/pm/agile-pm.yaml +91 -0
  58. package/tooling/.automation/overrides/templates/pm/hybrid-delivery.yaml +87 -0
  59. package/tooling/.automation/overrides/templates/pm/traditional-pm.yaml +91 -0
  60. package/tooling/.automation/overrides/templates/reviewer/README.md +11 -0
  61. package/tooling/.automation/overrides/templates/reviewer/mentoring-reviewer.yaml +45 -0
  62. package/tooling/.automation/overrides/templates/reviewer/quick-sanity.yaml +50 -0
  63. package/tooling/.automation/overrides/templates/reviewer/thorough-critic.yaml +48 -0
  64. package/tooling/.automation/overrides/templates/sm/README.md +11 -0
  65. package/tooling/.automation/overrides/templates/sm/agile-coach.yaml +52 -0
  66. package/tooling/.automation/overrides/templates/sm/startup-pm.yaml +50 -0
  67. package/tooling/.automation/overrides/templates/sm/technical-lead.yaml +47 -0
  68. package/tooling/.automation/overrides/templates/user-profile.template.yaml +62 -0
  69. package/tooling/.automation/overrides/templates/writer/README.md +27 -0
  70. package/tooling/.automation/overrides/templates/writer/api-documentarian.yaml +99 -0
  71. package/tooling/.automation/overrides/templates/writer/docs-as-code.yaml +108 -0
  72. package/tooling/.automation/overrides/templates/writer/user-guide-author.yaml +100 -0
  73. package/tooling/completions/DevflowCompletion.ps1 +213 -0
  74. package/tooling/completions/_run-story +116 -0
  75. package/tooling/completions/run-story-completion.bash +136 -0
  76. package/tooling/docs/DOC-STANDARD.md +717 -0
  77. package/tooling/docs/sprint-status.yaml.template +24 -0
  78. package/tooling/docs/templates/bug-report.md +234 -0
  79. package/tooling/docs/templates/migration-spec.md +274 -0
  80. package/tooling/docs/templates/refactor-spec.md +86 -0
  81. package/tooling/docs/templates/tech-debt.md +86 -0
  82. package/tooling/scripts/context_checkpoint.py +556 -0
  83. package/tooling/scripts/cost_dashboard.py +617 -0
  84. package/tooling/scripts/create-persona.py +690 -0
  85. package/tooling/scripts/create-persona.sh +435 -0
  86. package/tooling/scripts/init-project-workflow.ps1 +651 -0
  87. package/tooling/scripts/init-project-workflow.py +70 -0
  88. package/tooling/scripts/init-project-workflow.sh +746 -0
  89. package/tooling/scripts/lib/__init__.py +35 -0
  90. package/tooling/scripts/lib/agent_handoff.py +526 -0
  91. package/tooling/scripts/lib/agent_router.py +698 -0
  92. package/tooling/scripts/lib/checkpoint-integration.ps1 +245 -0
  93. package/tooling/scripts/lib/checkpoint-integration.sh +191 -0
  94. package/tooling/scripts/lib/claude-cli.ps1 +952 -0
  95. package/tooling/scripts/lib/claude-cli.sh +1293 -0
  96. package/tooling/scripts/lib/cost_config.py +222 -0
  97. package/tooling/scripts/lib/cost_display.py +443 -0
  98. package/tooling/scripts/lib/cost_tracker.py +710 -0
  99. package/tooling/scripts/lib/currency_converter.py +328 -0
  100. package/tooling/scripts/lib/errors.py +438 -0
  101. package/tooling/scripts/lib/override-loader.sh +286 -0
  102. package/tooling/scripts/lib/pair_programming.py +589 -0
  103. package/tooling/scripts/lib/shared_memory.py +637 -0
  104. package/tooling/scripts/lib/swarm_orchestrator.py +689 -0
  105. package/tooling/scripts/memory_summarize.py +324 -0
  106. package/tooling/scripts/new-doc.ps1 +405 -0
  107. package/tooling/scripts/new-doc.py +93 -0
  108. package/tooling/scripts/new-doc.sh +534 -0
  109. package/tooling/scripts/personalize_agent.py +385 -0
  110. package/tooling/scripts/rollback-migration.sh +540 -0
  111. package/tooling/scripts/run-collab.ps1 +251 -0
  112. package/tooling/scripts/run-collab.py +605 -0
  113. package/tooling/scripts/run-collab.sh +110 -0
  114. package/tooling/scripts/run-story.ps1 +490 -0
  115. package/tooling/scripts/run-story.py +387 -0
  116. package/tooling/scripts/run-story.sh +467 -0
  117. package/tooling/scripts/setup-checkpoint-service.ps1 +219 -0
  118. package/tooling/scripts/setup-checkpoint-service.py +87 -0
  119. package/tooling/scripts/setup-checkpoint-service.sh +236 -0
  120. package/tooling/scripts/tech-debt-tracker.py +608 -0
  121. package/tooling/scripts/update_version.py +244 -0
  122. package/tooling/scripts/validate-overrides.py +511 -0
  123. package/tooling/scripts/validate-overrides.sh +432 -0
  124. package/tooling/scripts/validate_setup.py +539 -0
@@ -0,0 +1,251 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Collaborative Story Runner for Windows - Multi-Agent Collaboration CLI
4
+
5
+ .DESCRIPTION
6
+ Integrates all collaboration features:
7
+ - Agent routing (auto-select best agents)
8
+ - Swarm mode (multi-agent debate)
9
+ - Pair programming (DEV + REVIEWER interleaved)
10
+ - Shared memory and knowledge graph
11
+
12
+ .PARAMETER StoryKey
13
+ Story key or task description (required)
14
+
15
+ .PARAMETER Swarm
16
+ Enable swarm mode (multi-agent debate/consensus)
17
+
18
+ .PARAMETER Pair
19
+ Enable pair programming mode (DEV + REVIEWER interleaved)
20
+
21
+ .PARAMETER Auto
22
+ Enable auto-route mode (intelligent agent selection)
23
+
24
+ .PARAMETER Sequential
25
+ Enable sequential mode (traditional pipeline)
26
+
27
+ .PARAMETER Agents
28
+ Comma-separated list of agents for swarm mode
29
+
30
+ .PARAMETER MaxIterations
31
+ Maximum iterations for swarm/pair modes (default: 3)
32
+
33
+ .PARAMETER Model
34
+ Claude model to use (opus, sonnet, haiku)
35
+
36
+ .PARAMETER Budget
37
+ Budget limit in USD (default: 20.0)
38
+
39
+ .PARAMETER Memory
40
+ Show shared memory and knowledge graph
41
+
42
+ .PARAMETER Query
43
+ Query the knowledge graph
44
+
45
+ .PARAMETER RouteOnly
46
+ Only show routing decision, don't execute
47
+
48
+ .PARAMETER Quiet
49
+ Reduce output verbosity
50
+
51
+ .EXAMPLE
52
+ .\run-collab.ps1 -StoryKey "3-5" -Swarm
53
+ Run swarm mode with default agents
54
+
55
+ .EXAMPLE
56
+ .\run-collab.ps1 -StoryKey "3-5" -Pair
57
+ Run pair programming mode
58
+
59
+ .EXAMPLE
60
+ .\run-collab.ps1 -StoryKey "fix auth bug" -Auto
61
+ Auto-route to best agents
62
+
63
+ .EXAMPLE
64
+ .\run-collab.ps1 -StoryKey "3-5" -Memory
65
+ Show shared memory for story
66
+ #>
67
+
68
+ param(
69
+ [Parameter(Position=0)]
70
+ [string]$StoryKey,
71
+
72
+ [switch]$Swarm,
73
+ [switch]$Pair,
74
+ [switch]$Auto,
75
+ [switch]$Sequential,
76
+
77
+ [string]$Agents,
78
+ [int]$MaxIterations = 3,
79
+
80
+ [ValidateSet("opus", "sonnet", "haiku")]
81
+ [string]$Model = "opus",
82
+
83
+ [double]$Budget = 20.0,
84
+
85
+ [switch]$Memory,
86
+ [string]$Query,
87
+ [switch]$RouteOnly,
88
+ [switch]$Quiet
89
+ )
90
+
91
+ # Script directory
92
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
93
+
94
+ # Colors
95
+ function Write-ColorOutput {
96
+ param(
97
+ [string]$Message,
98
+ [string]$Color = "White"
99
+ )
100
+ Write-Host $Message -ForegroundColor $Color
101
+ }
102
+
103
+ function Write-Banner {
104
+ Write-ColorOutput @"
105
+
106
+ ╔═══════════════════════════════════════════════════════════════╗
107
+ ║ DEVFLOW COLLABORATIVE STORY RUNNER ║
108
+ ╠═══════════════════════════════════════════════════════════════╣
109
+ ║ Multi-agent collaboration with swarm, pair, and auto-routing ║
110
+ ╚═══════════════════════════════════════════════════════════════╝
111
+
112
+ "@ -Color Cyan
113
+ }
114
+
115
+ function Show-Usage {
116
+ Write-ColorOutput "Usage: .\run-collab.ps1 -StoryKey <key> [options]" -Color Yellow
117
+ Write-Host ""
118
+ Write-Host "Modes:"
119
+ Write-Host " -Auto Auto-route to best agents (default)"
120
+ Write-Host " -Swarm Multi-agent debate/consensus"
121
+ Write-Host " -Pair DEV + REVIEWER pair programming"
122
+ Write-Host " -Sequential Traditional sequential pipeline"
123
+ Write-Host ""
124
+ Write-Host "Options:"
125
+ Write-Host " -Agents <list> Comma-separated agent list (for swarm)"
126
+ Write-Host " -MaxIterations <n> Max iterations (default: 3)"
127
+ Write-Host " -Model <name> Claude model (opus, sonnet, haiku)"
128
+ Write-Host " -Budget <amount> Budget limit in USD (default: 20.0)"
129
+ Write-Host " -Memory Show shared memory"
130
+ Write-Host " -Query <question> Query knowledge graph"
131
+ Write-Host " -RouteOnly Just show routing, don't execute"
132
+ Write-Host " -Quiet Reduce verbosity"
133
+ Write-Host ""
134
+ Write-Host "Examples:"
135
+ Write-Host " .\run-collab.ps1 -StoryKey '3-5' -Swarm"
136
+ Write-Host " .\run-collab.ps1 -StoryKey '3-5' -Pair"
137
+ Write-Host " .\run-collab.ps1 -StoryKey 'fix auth bug' -Auto"
138
+ }
139
+
140
+ # Build Python command arguments
141
+ function Build-PythonArgs {
142
+ $args = @()
143
+
144
+ if ($StoryKey) {
145
+ $args += $StoryKey
146
+ }
147
+
148
+ if ($Swarm) {
149
+ $args += "--swarm"
150
+ } elseif ($Pair) {
151
+ $args += "--pair"
152
+ } elseif ($Sequential) {
153
+ $args += "--sequential"
154
+ } else {
155
+ $args += "--auto"
156
+ }
157
+
158
+ if ($Agents) {
159
+ $args += "--agents"
160
+ $args += $Agents
161
+ }
162
+
163
+ if ($MaxIterations -ne 3) {
164
+ $args += "--max-iterations"
165
+ $args += $MaxIterations.ToString()
166
+ }
167
+
168
+ if ($Model -ne "opus") {
169
+ $args += "--model"
170
+ $args += $Model
171
+ }
172
+
173
+ if ($Budget -ne 20.0) {
174
+ $args += "--budget"
175
+ $args += $Budget.ToString()
176
+ }
177
+
178
+ if ($Memory) {
179
+ $args += "--memory"
180
+ }
181
+
182
+ if ($Query) {
183
+ $args += "--query"
184
+ $args += $Query
185
+ }
186
+
187
+ if ($RouteOnly) {
188
+ $args += "--route-only"
189
+ }
190
+
191
+ if ($Quiet) {
192
+ $args += "--quiet"
193
+ }
194
+
195
+ return $args
196
+ }
197
+
198
+ # Main execution
199
+ if (-not $StoryKey -and -not $Memory) {
200
+ Show-Usage
201
+ exit 1
202
+ }
203
+
204
+ Write-Banner
205
+
206
+ Write-ColorOutput "Story/Task: $StoryKey" -Color White
207
+ Write-Host ""
208
+
209
+ # Determine mode for display
210
+ $mode = "Auto-Route"
211
+ if ($Swarm) { $mode = "Swarm" }
212
+ elseif ($Pair) { $mode = "Pair Programming" }
213
+ elseif ($Sequential) { $mode = "Sequential" }
214
+
215
+ Write-ColorOutput "Mode: $mode" -Color Blue
216
+
217
+ # Build arguments and run Python script
218
+ $pythonArgs = Build-PythonArgs
219
+ $pythonScript = Join-Path $ScriptDir "run-collab.py"
220
+
221
+ # Check if Python is available
222
+ $pythonCmd = $null
223
+ if (Get-Command python -ErrorAction SilentlyContinue) {
224
+ $pythonCmd = "python"
225
+ } elseif (Get-Command python3 -ErrorAction SilentlyContinue) {
226
+ $pythonCmd = "python3"
227
+ } elseif (Get-Command py -ErrorAction SilentlyContinue) {
228
+ $pythonCmd = "py"
229
+ } else {
230
+ Write-ColorOutput "Error: Python not found. Please install Python 3.9+" -Color Red
231
+ exit 1
232
+ }
233
+
234
+ Write-Host ""
235
+ Write-ColorOutput "Running: $pythonCmd $pythonScript $($pythonArgs -join ' ')" -Color Gray
236
+ Write-Host ""
237
+
238
+ # Execute
239
+ & $pythonCmd $pythonScript @pythonArgs
240
+ $exitCode = $LASTEXITCODE
241
+
242
+ if ($exitCode -eq 0) {
243
+ Write-Host ""
244
+ Write-ColorOutput "════════════════════════════════════════════════════════════" -Color Green
245
+ Write-ColorOutput "✅ Collaboration complete!" -Color Green
246
+ } else {
247
+ Write-Host ""
248
+ Write-ColorOutput "❌ Failed with exit code: $exitCode" -Color Red
249
+ }
250
+
251
+ exit $exitCode