@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,108 @@
1
+ # Docs-as-Code Persona
2
+ # Focus: Automated docs, living documentation, CI/CD integration
3
+ # Best for: Engineering teams, open source projects, developer tools
4
+
5
+ persona:
6
+ name: "Docs-as-Code Practitioner"
7
+ description: "Engineer-writer hybrid focused on automated, maintainable documentation"
8
+
9
+ personality:
10
+ traits:
11
+ - automation_first
12
+ - developer_tooling_savvy
13
+ - consistency_obsessed
14
+ - maintainability_focused
15
+ - contribution_friendly
16
+
17
+ communication_style:
18
+ tone: technical_collegial
19
+ detail_level: engineer_appropriate
20
+ audience: developers_contributors
21
+ tooling: markdown_native
22
+ preferred_formats:
23
+ - markdown
24
+ - diagrams_as_code
25
+ - automated_references
26
+
27
+ behavior:
28
+ documentation_approach:
29
+ philosophy: "Docs live with code"
30
+ infrastructure:
31
+ - docs_in_repo
32
+ - ci_cd_publishing
33
+ - automated_testing
34
+ - version_control
35
+
36
+ content_creation:
37
+ automation:
38
+ - api_docs_from_code
39
+ - diagrams_from_definitions
40
+ - changelog_generation
41
+ - link_checking
42
+ standards:
43
+ - linting_rules
44
+ - style_guides
45
+ - templates
46
+
47
+ focus_areas:
48
+ - automation
49
+ - maintainability
50
+ - contribution_ease
51
+ - single_source_of_truth
52
+ - freshness
53
+
54
+ tooling:
55
+ authoring:
56
+ - markdown
57
+ - mdx
58
+ - asciidoc
59
+ static_sites:
60
+ - docusaurus
61
+ - mkdocs
62
+ - hugo
63
+ diagrams:
64
+ - mermaid
65
+ - plantuml
66
+ - d2
67
+ automation:
68
+ - github_actions
69
+ - pre_commit_hooks
70
+ - vale_linting
71
+
72
+ deliverables:
73
+ infrastructure:
74
+ - documentation_site
75
+ - contributing_guide
76
+ - style_guide
77
+ - templates
78
+
79
+ automation:
80
+ - ci_cd_pipeline
81
+ - link_checker
82
+ - freshness_checker
83
+ - api_doc_generator
84
+
85
+ quality_standards:
86
+ automation:
87
+ - all_docs_linted
88
+ - links_validated
89
+ - builds_tested
90
+ - previews_generated
91
+ contribution:
92
+ - clear_guidelines
93
+ - easy_local_setup
94
+ - templates_provided
95
+ - review_process_defined
96
+
97
+ constraints:
98
+ always:
99
+ - automate_what_can_be_automated
100
+ - keep_docs_with_code
101
+ - enable_contributions
102
+ - version_documentation
103
+ - test_documentation
104
+ never:
105
+ - create_documentation_silos
106
+ - skip_automation_opportunities
107
+ - make_contribution_hard
108
+ - let_docs_rot
@@ -0,0 +1,100 @@
1
+ # User Guide Author Persona
2
+ # Focus: End-user documentation, tutorials, help content
3
+ # Best for: Consumer products, SaaS applications, user-facing software
4
+
5
+ persona:
6
+ name: "User Guide Author"
7
+ description: "User-focused writer creating accessible, helpful documentation"
8
+
9
+ personality:
10
+ traits:
11
+ - user_empathetic
12
+ - clarity_focused
13
+ - task_oriented
14
+ - accessibility_conscious
15
+ - patience_embodied
16
+
17
+ communication_style:
18
+ tone: friendly_professional
19
+ detail_level: step_by_step
20
+ audience: end_users
21
+ jargon: minimal_explained
22
+ preferred_formats:
23
+ - task_based_guides
24
+ - tutorials
25
+ - faq
26
+
27
+ behavior:
28
+ documentation_approach:
29
+ philosophy: "Help users succeed"
30
+ structure:
31
+ - getting_started
32
+ - common_tasks
33
+ - feature_guides
34
+ - troubleshooting
35
+ - faq
36
+
37
+ content_creation:
38
+ every_guide:
39
+ - clear_objective
40
+ - prerequisites
41
+ - numbered_steps
42
+ - screenshots
43
+ - expected_outcome
44
+ - troubleshooting_tips
45
+ language:
46
+ - second_person_you
47
+ - active_voice
48
+ - simple_sentences
49
+
50
+ focus_areas:
51
+ - user_success
52
+ - task_completion
53
+ - visual_aids
54
+ - accessibility
55
+ - searchability
56
+
57
+ deliverables:
58
+ onboarding:
59
+ - welcome_guide
60
+ - quick_start
61
+ - first_steps_tutorial
62
+
63
+ reference:
64
+ - feature_documentation
65
+ - settings_reference
66
+ - keyboard_shortcuts
67
+
68
+ support:
69
+ - troubleshooting_guide
70
+ - faq
71
+ - known_issues
72
+ - contact_support
73
+
74
+ quality_standards:
75
+ readability:
76
+ - flesch_kincaid_grade_8
77
+ - short_paragraphs
78
+ - bullet_points
79
+ - clear_headings
80
+ visuals:
81
+ - annotated_screenshots
82
+ - consistent_styling
83
+ - alt_text_included
84
+ accessibility:
85
+ - screen_reader_friendly
86
+ - color_contrast_compliant
87
+ - keyboard_navigable
88
+
89
+ constraints:
90
+ always:
91
+ - write_for_the_user
92
+ - include_visuals
93
+ - test_procedures
94
+ - provide_context
95
+ - anticipate_questions
96
+ never:
97
+ - assume_technical_knowledge
98
+ - use_unexplained_jargon
99
+ - skip_steps
100
+ - forget_accessibility
@@ -0,0 +1,213 @@
1
+ # Devflow PowerShell Tab Completion
2
+ #
3
+ # Installation:
4
+ # 1. Add to your PowerShell profile ($PROFILE):
5
+ # . /path/to/devflow/tooling/completions/DevflowCompletion.ps1
6
+ #
7
+ # 2. Or import as module:
8
+ # Import-Module /path/to/devflow/tooling/completions/DevflowCompletion.ps1
9
+
10
+ # Agent personas
11
+ $script:DevflowAgents = @(
12
+ [PSCustomObject]@{ Name = 'SM'; Description = 'Scrum Master - Sprint coordination' }
13
+ [PSCustomObject]@{ Name = 'DEV'; Description = 'Developer - Code implementation' }
14
+ [PSCustomObject]@{ Name = 'BA'; Description = 'Business Analyst - Requirements' }
15
+ [PSCustomObject]@{ Name = 'ARCHITECT'; Description = 'Architect - System design' }
16
+ [PSCustomObject]@{ Name = 'PM'; Description = 'Product Manager - Roadmap' }
17
+ [PSCustomObject]@{ Name = 'WRITER'; Description = 'Technical Writer - Documentation' }
18
+ [PSCustomObject]@{ Name = 'MAINTAINER'; Description = 'Maintainer - Code quality' }
19
+ [PSCustomObject]@{ Name = 'REVIEWER'; Description = 'Code Reviewer - Quality assurance' }
20
+ )
21
+
22
+ $script:DevflowModels = @('opus', 'sonnet', 'haiku')
23
+ $script:DevflowModes = @('swarm', 'pair', 'auto', 'sequential')
24
+
25
+ # Argument completer for run-story.ps1
26
+ Register-ArgumentCompleter -CommandName 'run-story.ps1', 'run-story' -Native -ScriptBlock {
27
+ param($wordToComplete, $commandAst, $cursorPosition)
28
+
29
+ $params = @(
30
+ @{ Name = '-Swarm'; Tooltip = 'Enable swarm mode (multi-agent debate)' }
31
+ @{ Name = '-Pair'; Tooltip = 'Enable pair programming mode' }
32
+ @{ Name = '-Auto'; Tooltip = 'Enable auto-routing mode' }
33
+ @{ Name = '-Sequential'; Tooltip = 'Enable sequential mode' }
34
+ @{ Name = '-Agents'; Tooltip = 'Comma-separated agent list' }
35
+ @{ Name = '-MaxIterations'; Tooltip = 'Max iterations (default: 3)' }
36
+ @{ Name = '-Model'; Tooltip = 'Claude model (opus, sonnet, haiku)' }
37
+ @{ Name = '-Budget'; Tooltip = 'Budget limit in USD' }
38
+ @{ Name = '-Memory'; Tooltip = 'Show shared memory' }
39
+ @{ Name = '-Query'; Tooltip = 'Query knowledge graph' }
40
+ @{ Name = '-RouteOnly'; Tooltip = 'Only show routing decision' }
41
+ @{ Name = '-Quiet'; Tooltip = 'Reduce output verbosity' }
42
+ @{ Name = '-Help'; Tooltip = 'Show help' }
43
+ )
44
+
45
+ # Get the current word being typed
46
+ $commandElements = $commandAst.CommandElements
47
+ $lastWord = if ($commandElements.Count -gt 1) {
48
+ $commandElements[-1].Extent.Text
49
+ } else { '' }
50
+
51
+ # Check if completing a parameter value
52
+ $previousWord = if ($commandElements.Count -gt 2) {
53
+ $commandElements[-2].Extent.Text
54
+ } else { '' }
55
+
56
+ # Model completion
57
+ if ($previousWord -eq '-Model') {
58
+ $script:DevflowModels | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
59
+ [System.Management.Automation.CompletionResult]::new(
60
+ $_,
61
+ $_,
62
+ 'ParameterValue',
63
+ "Claude model: $_"
64
+ )
65
+ }
66
+ return
67
+ }
68
+
69
+ # Agent completion
70
+ if ($previousWord -eq '-Agents') {
71
+ # Support comma-separated completion
72
+ $existingAgents = if ($wordToComplete -match ',') {
73
+ $wordToComplete -replace ',[^,]*$', ','
74
+ } else { '' }
75
+
76
+ $currentPart = if ($wordToComplete -match ',') {
77
+ ($wordToComplete -split ',')[-1]
78
+ } else { $wordToComplete }
79
+
80
+ $script:DevflowAgents | Where-Object { $_.Name -like "$currentPart*" } | ForEach-Object {
81
+ [System.Management.Automation.CompletionResult]::new(
82
+ "$existingAgents$($_.Name)",
83
+ $_.Name,
84
+ 'ParameterValue',
85
+ $_.Description
86
+ )
87
+ }
88
+ return
89
+ }
90
+
91
+ # Parameter completion
92
+ $params | Where-Object { $_.Name -like "$wordToComplete*" } | ForEach-Object {
93
+ [System.Management.Automation.CompletionResult]::new(
94
+ $_.Name,
95
+ $_.Name,
96
+ 'ParameterName',
97
+ $_.Tooltip
98
+ )
99
+ }
100
+ }
101
+
102
+ # Argument completer for run-collab.ps1
103
+ Register-ArgumentCompleter -CommandName 'run-collab.ps1', 'run-collab' -Native -ScriptBlock {
104
+ param($wordToComplete, $commandAst, $cursorPosition)
105
+
106
+ $params = @(
107
+ @{ Name = '-Swarm'; Tooltip = 'Enable swarm mode' }
108
+ @{ Name = '-Pair'; Tooltip = 'Enable pair programming' }
109
+ @{ Name = '-Auto'; Tooltip = 'Enable auto-routing' }
110
+ @{ Name = '-Sequential'; Tooltip = 'Sequential pipeline' }
111
+ @{ Name = '-Agents'; Tooltip = 'Comma-separated agents' }
112
+ @{ Name = '-MaxIterations'; Tooltip = 'Max iterations' }
113
+ @{ Name = '-Model'; Tooltip = 'Claude model' }
114
+ @{ Name = '-Budget'; Tooltip = 'Budget limit USD' }
115
+ @{ Name = '-Memory'; Tooltip = 'Show shared memory' }
116
+ @{ Name = '-Query'; Tooltip = 'Query knowledge graph' }
117
+ @{ Name = '-RouteOnly'; Tooltip = 'Routing only' }
118
+ @{ Name = '-Quiet'; Tooltip = 'Quiet mode' }
119
+ @{ Name = '-StoryKey'; Tooltip = 'Story key or description' }
120
+ )
121
+
122
+ $commandElements = $commandAst.CommandElements
123
+ $previousWord = if ($commandElements.Count -gt 2) {
124
+ $commandElements[-2].Extent.Text
125
+ } else { '' }
126
+
127
+ # Model completion
128
+ if ($previousWord -eq '-Model') {
129
+ $script:DevflowModels | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
130
+ [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
131
+ }
132
+ return
133
+ }
134
+
135
+ # Agent completion
136
+ if ($previousWord -eq '-Agents') {
137
+ $existingAgents = if ($wordToComplete -match ',') {
138
+ $wordToComplete -replace ',[^,]*$', ','
139
+ } else { '' }
140
+
141
+ $currentPart = if ($wordToComplete -match ',') {
142
+ ($wordToComplete -split ',')[-1]
143
+ } else { $wordToComplete }
144
+
145
+ $script:DevflowAgents | Where-Object { $_.Name -like "$currentPart*" } | ForEach-Object {
146
+ [System.Management.Automation.CompletionResult]::new(
147
+ "$existingAgents$($_.Name)",
148
+ $_.Name,
149
+ 'ParameterValue',
150
+ $_.Description
151
+ )
152
+ }
153
+ return
154
+ }
155
+
156
+ # Parameter completion
157
+ $params | Where-Object { $_.Name -like "$wordToComplete*" } | ForEach-Object {
158
+ [System.Management.Automation.CompletionResult]::new(
159
+ $_.Name,
160
+ $_.Name,
161
+ 'ParameterName',
162
+ $_.Tooltip
163
+ )
164
+ }
165
+ }
166
+
167
+ # Helper function to show available commands
168
+ function Get-DevflowCommands {
169
+ @"
170
+
171
+ Devflow Collaboration Commands
172
+ ==============================
173
+
174
+ run-story.ps1 / run-story.sh
175
+ Main story runner with collaboration modes
176
+
177
+ Modes:
178
+ -Swarm Multi-agent debate/consensus
179
+ -Pair DEV + REVIEWER pair programming
180
+ -Auto Intelligent auto-routing (default)
181
+ -Sequential Traditional sequential pipeline
182
+
183
+ run-collab.ps1 / run-collab.py
184
+ Direct Python collaboration CLI
185
+
186
+ Same modes as run-story with additional:
187
+ -Memory View shared memory
188
+ -Query Query knowledge graph
189
+ -RouteOnly Preview routing without execution
190
+
191
+ Available Agents:
192
+ SM Scrum Master
193
+ DEV Developer
194
+ BA Business Analyst
195
+ ARCHITECT Architect
196
+ PM Product Manager
197
+ WRITER Technical Writer
198
+ MAINTAINER Maintainer
199
+ REVIEWER Code Reviewer
200
+
201
+ Examples:
202
+ run-story.ps1 -StoryKey "PROJ-123" -Swarm
203
+ run-story.ps1 -StoryKey "PROJ-123" -Pair
204
+ run-story.ps1 -StoryKey "PROJ-123" -Agents SM,DEV,ARCHITECT
205
+ run-collab.ps1 -StoryKey "fix auth bug" -Auto -RouteOnly
206
+
207
+ "@
208
+ }
209
+
210
+ # Export alias
211
+ Set-Alias -Name devflow-help -Value Get-DevflowCommands
212
+
213
+ Write-Host "Devflow tab completion loaded. Use 'devflow-help' for command reference." -ForegroundColor Cyan
@@ -0,0 +1,116 @@
1
+ #compdef run-story.sh run-story run-collab.sh run-collab
2
+
3
+ # Devflow Story Runner Zsh Completion
4
+ #
5
+ # Installation:
6
+ # 1. Copy this file to a directory in your $fpath (e.g., ~/.zsh/completions/)
7
+ # 2. Add to ~/.zshrc: fpath=(~/.zsh/completions $fpath)
8
+ # 3. Reload: source ~/.zshrc
9
+ #
10
+ # Or for quick setup, add to ~/.zshrc:
11
+ # source /path/to/devflow/tooling/completions/_run-story
12
+
13
+ # Agent personas
14
+ local -a agents
15
+ agents=(
16
+ 'SM:Scrum Master - Sprint coordination and Agile practices'
17
+ 'DEV:Developer - Code implementation and technical solutions'
18
+ 'BA:Business Analyst - Requirements analysis and stakeholder alignment'
19
+ 'ARCHITECT:Architect - System design and technical decisions'
20
+ 'PM:Product Manager - Roadmap and feature prioritization'
21
+ 'WRITER:Technical Writer - Documentation and user guides'
22
+ 'MAINTAINER:Maintainer - Code quality and long-term health'
23
+ 'REVIEWER:Code Reviewer - Quality assurance and best practices'
24
+ )
25
+
26
+ # Collaboration modes
27
+ local -a modes
28
+ modes=(
29
+ 'swarm:Multi-agent debate with consensus building'
30
+ 'pair:DEV + REVIEWER pair programming'
31
+ 'auto:Intelligent auto-routing to best agents'
32
+ 'sequential:Traditional sequential pipeline'
33
+ )
34
+
35
+ # Model options
36
+ local -a models
37
+ models=(
38
+ 'opus:Claude Opus - Most capable, highest quality'
39
+ 'sonnet:Claude Sonnet - Balanced performance'
40
+ 'haiku:Claude Haiku - Fast and efficient'
41
+ )
42
+
43
+ # Common options
44
+ local -a common_opts
45
+ common_opts=(
46
+ '--help[Show help message]'
47
+ '--quiet[Reduce output verbosity]'
48
+ '--debug[Enable debug mode]'
49
+ '--dry-run[Show what would be done without executing]'
50
+ )
51
+
52
+ # Collaboration options
53
+ local -a collab_opts
54
+ collab_opts=(
55
+ '--swarm[Enable swarm mode - multi-agent debate]'
56
+ '--pair[Enable pair programming mode]'
57
+ '--auto-route[Enable auto-routing mode]'
58
+ '--sequential[Enable sequential mode]'
59
+ '--agents[Comma-separated list of agents]:agent list:_values -s , agents SM DEV BA ARCHITECT PM WRITER MAINTAINER REVIEWER'
60
+ '--max-iterations[Maximum iterations]:iterations:(1 2 3 4 5)'
61
+ '--model[Claude model to use]:model:(opus sonnet haiku)'
62
+ '--budget[Budget limit in USD]:budget:'
63
+ '--memory[Show shared memory and knowledge graph]'
64
+ '--query[Query the knowledge graph]:query:'
65
+ '--route-only[Only show routing decision]'
66
+ )
67
+
68
+ # run-story.sh specific completions
69
+ _run-story() {
70
+ local curcontext="$curcontext" state line
71
+ typeset -A opt_args
72
+
73
+ _arguments -C \
74
+ '1:story key or description:->story' \
75
+ '*::option:->option' \
76
+ $common_opts \
77
+ $collab_opts
78
+
79
+ case $state in
80
+ story)
81
+ # Could provide completions from JIRA/etc if configured
82
+ _message 'story key (e.g., PROJ-123) or task description'
83
+ ;;
84
+ option)
85
+ _arguments $common_opts $collab_opts
86
+ ;;
87
+ esac
88
+ }
89
+
90
+ # run-collab.py specific completions
91
+ _run-collab() {
92
+ _arguments \
93
+ '1:story key or description:' \
94
+ '--swarm[Enable swarm mode]' \
95
+ '--pair[Enable pair programming mode]' \
96
+ '--auto[Enable auto-routing mode]' \
97
+ '--sequential[Enable sequential mode]' \
98
+ '--agents[Agent list]:agents:_values -s , agents SM DEV BA ARCHITECT PM WRITER MAINTAINER REVIEWER' \
99
+ '--max-iterations[Max iterations]:iterations:(1 2 3 4 5 10)' \
100
+ '--model[Claude model]:model:(opus sonnet haiku)' \
101
+ '--budget[Budget limit]:budget:' \
102
+ '--memory[Show shared memory]' \
103
+ '--query[Query knowledge graph]:query:' \
104
+ '--route-only[Only show routing]' \
105
+ '--quiet[Reduce verbosity]' \
106
+ '--help[Show help]'
107
+ }
108
+
109
+ # Alias completions
110
+ compdef _run-story run-story.sh
111
+ compdef _run-story run-story
112
+ compdef _run-collab run-collab.py
113
+ compdef _run-collab run-collab
114
+
115
+ # Export for direct sourcing
116
+ _run-story "$@"
@@ -0,0 +1,136 @@
1
+ #!/bin/bash
2
+ # Devflow Bash Tab Completion
3
+ #
4
+ # Installation:
5
+ # 1. Source in ~/.bashrc:
6
+ # source /path/to/devflow/tooling/completions/run-story-completion.bash
7
+ #
8
+ # 2. Or copy to system completions:
9
+ # cp run-story-completion.bash /etc/bash_completion.d/devflow
10
+
11
+ # Available agents
12
+ _devflow_agents="SM DEV BA ARCHITECT PM WRITER MAINTAINER REVIEWER"
13
+
14
+ # Available models
15
+ _devflow_models="opus sonnet haiku"
16
+
17
+ # Collaboration modes
18
+ _devflow_modes="swarm pair auto-route sequential"
19
+
20
+ # run-story.sh completion
21
+ _run_story_completion() {
22
+ local cur prev opts
23
+ COMPREPLY=()
24
+ cur="${COMP_WORDS[COMP_CWORD]}"
25
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
26
+
27
+ # Main options
28
+ opts="--swarm --pair --auto-route --sequential --agents --max-iterations --model --budget --memory --query --route-only --quiet --debug --dry-run --help"
29
+
30
+ case "${prev}" in
31
+ --agents|-a)
32
+ # Support comma-separated agent completion
33
+ local existing_agents current_part
34
+ if [[ "$cur" == *,* ]]; then
35
+ existing_agents="${cur%,*},"
36
+ current_part="${cur##*,}"
37
+ else
38
+ existing_agents=""
39
+ current_part="$cur"
40
+ fi
41
+
42
+ local suggestions=""
43
+ for agent in $_devflow_agents; do
44
+ if [[ "$agent" == ${current_part}* ]]; then
45
+ suggestions="$suggestions ${existing_agents}${agent}"
46
+ fi
47
+ done
48
+ COMPREPLY=( $(compgen -W "$suggestions" -- "") )
49
+ return 0
50
+ ;;
51
+ --model|-m)
52
+ COMPREPLY=( $(compgen -W "${_devflow_models}" -- "${cur}") )
53
+ return 0
54
+ ;;
55
+ --max-iterations|--max-iter)
56
+ COMPREPLY=( $(compgen -W "1 2 3 4 5 10" -- "${cur}") )
57
+ return 0
58
+ ;;
59
+ --budget)
60
+ COMPREPLY=( $(compgen -W "5.0 10.0 20.0 50.0 100.0" -- "${cur}") )
61
+ return 0
62
+ ;;
63
+ --query)
64
+ # No specific completions for query text
65
+ return 0
66
+ ;;
67
+ *)
68
+ ;;
69
+ esac
70
+
71
+ # Complete options
72
+ if [[ ${cur} == -* ]]; then
73
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
74
+ return 0
75
+ fi
76
+ }
77
+
78
+ # run-collab.py completion
79
+ _run_collab_completion() {
80
+ local cur prev opts
81
+ COMPREPLY=()
82
+ cur="${COMP_WORDS[COMP_CWORD]}"
83
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
84
+
85
+ opts="--swarm --pair --auto --sequential --agents --max-iterations --model --budget --memory --query --route-only --quiet --help"
86
+
87
+ case "${prev}" in
88
+ --agents)
89
+ local existing_agents current_part
90
+ if [[ "$cur" == *,* ]]; then
91
+ existing_agents="${cur%,*},"
92
+ current_part="${cur##*,}"
93
+ else
94
+ existing_agents=""
95
+ current_part="$cur"
96
+ fi
97
+
98
+ local suggestions=""
99
+ for agent in $_devflow_agents; do
100
+ if [[ "$agent" == ${current_part}* ]]; then
101
+ suggestions="$suggestions ${existing_agents}${agent}"
102
+ fi
103
+ done
104
+ COMPREPLY=( $(compgen -W "$suggestions" -- "") )
105
+ return 0
106
+ ;;
107
+ --model)
108
+ COMPREPLY=( $(compgen -W "${_devflow_models}" -- "${cur}") )
109
+ return 0
110
+ ;;
111
+ --max-iterations)
112
+ COMPREPLY=( $(compgen -W "1 2 3 4 5 10" -- "${cur}") )
113
+ return 0
114
+ ;;
115
+ --budget)
116
+ COMPREPLY=( $(compgen -W "5.0 10.0 20.0 50.0 100.0" -- "${cur}") )
117
+ return 0
118
+ ;;
119
+ *)
120
+ ;;
121
+ esac
122
+
123
+ if [[ ${cur} == -* ]]; then
124
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
125
+ return 0
126
+ fi
127
+ }
128
+
129
+ # Register completions
130
+ complete -F _run_story_completion run-story.sh
131
+ complete -F _run_story_completion run-story
132
+ complete -F _run_collab_completion run-collab.py
133
+ complete -F _run_collab_completion run-collab
134
+ complete -F _run_collab_completion python3 run-collab.py
135
+
136
+ echo "Devflow bash completion loaded."