@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.
- package/CHANGELOG.md +526 -0
- package/LICENSE +21 -0
- package/README.md +620 -0
- package/bin/devflow-checkpoint.js +10 -0
- package/bin/devflow-collab.js +10 -0
- package/bin/devflow-cost.js +10 -0
- package/bin/devflow-create-persona.js +10 -0
- package/bin/devflow-init.js +10 -0
- package/bin/devflow-memory.js +10 -0
- package/bin/devflow-new-doc.js +10 -0
- package/bin/devflow-personalize.js +10 -0
- package/bin/devflow-setup-checkpoint.js +10 -0
- package/bin/devflow-story.js +10 -0
- package/bin/devflow-tech-debt.js +10 -0
- package/bin/devflow-validate-overrides.js +10 -0
- package/bin/devflow-validate.js +10 -0
- package/bin/devflow-version.js +10 -0
- package/lib/constants.js +30 -0
- package/lib/exec-python.js +78 -0
- package/lib/python-check.js +178 -0
- package/package.json +64 -0
- package/tooling/.automation/agents/architect.md +135 -0
- package/tooling/.automation/agents/ba.md +70 -0
- package/tooling/.automation/agents/dev.md +79 -0
- package/tooling/.automation/agents/maintainer.md +97 -0
- package/tooling/.automation/agents/pm.md +116 -0
- package/tooling/.automation/agents/reviewer.md +141 -0
- package/tooling/.automation/agents/sm.md +61 -0
- package/tooling/.automation/agents/writer.md +193 -0
- package/tooling/.automation/config.ps1.template +61 -0
- package/tooling/.automation/config.sh.template +48 -0
- package/tooling/.automation/memory/.gitkeep +6 -0
- package/tooling/.automation/memory/knowledge/kg_integration-test.json +94 -0
- package/tooling/.automation/memory/knowledge/kg_test-story.json +300 -0
- package/tooling/.automation/memory/shared/shared_integration-test.json +30 -0
- package/tooling/.automation/memory/shared/shared_test-story.json +78 -0
- package/tooling/.automation/overrides/templates/README.md +113 -0
- package/tooling/.automation/overrides/templates/architect/README.md +27 -0
- package/tooling/.automation/overrides/templates/architect/cloud-native.yaml +92 -0
- package/tooling/.automation/overrides/templates/architect/enterprise-architect.yaml +85 -0
- package/tooling/.automation/overrides/templates/architect/pragmatic-minimalist.yaml +88 -0
- package/tooling/.automation/overrides/templates/ba/README.md +27 -0
- package/tooling/.automation/overrides/templates/ba/agile-storyteller.yaml +86 -0
- package/tooling/.automation/overrides/templates/ba/domain-expert.yaml +91 -0
- package/tooling/.automation/overrides/templates/ba/requirements-engineer.yaml +89 -0
- package/tooling/.automation/overrides/templates/dev/README.md +32 -0
- package/tooling/.automation/overrides/templates/dev/junior-mentored.yaml +39 -0
- package/tooling/.automation/overrides/templates/dev/performance-engineer.yaml +43 -0
- package/tooling/.automation/overrides/templates/dev/rapid-prototyper.yaml +52 -0
- package/tooling/.automation/overrides/templates/dev/security-focused.yaml +43 -0
- package/tooling/.automation/overrides/templates/dev/senior-fullstack.yaml +39 -0
- package/tooling/.automation/overrides/templates/maintainer/README.md +27 -0
- package/tooling/.automation/overrides/templates/maintainer/devops-maintainer.yaml +113 -0
- package/tooling/.automation/overrides/templates/maintainer/legacy-steward.yaml +94 -0
- package/tooling/.automation/overrides/templates/maintainer/oss-maintainer.yaml +94 -0
- package/tooling/.automation/overrides/templates/pm/README.md +27 -0
- package/tooling/.automation/overrides/templates/pm/agile-pm.yaml +91 -0
- package/tooling/.automation/overrides/templates/pm/hybrid-delivery.yaml +87 -0
- package/tooling/.automation/overrides/templates/pm/traditional-pm.yaml +91 -0
- package/tooling/.automation/overrides/templates/reviewer/README.md +11 -0
- package/tooling/.automation/overrides/templates/reviewer/mentoring-reviewer.yaml +45 -0
- package/tooling/.automation/overrides/templates/reviewer/quick-sanity.yaml +50 -0
- package/tooling/.automation/overrides/templates/reviewer/thorough-critic.yaml +48 -0
- package/tooling/.automation/overrides/templates/sm/README.md +11 -0
- package/tooling/.automation/overrides/templates/sm/agile-coach.yaml +52 -0
- package/tooling/.automation/overrides/templates/sm/startup-pm.yaml +50 -0
- package/tooling/.automation/overrides/templates/sm/technical-lead.yaml +47 -0
- package/tooling/.automation/overrides/templates/user-profile.template.yaml +62 -0
- package/tooling/.automation/overrides/templates/writer/README.md +27 -0
- package/tooling/.automation/overrides/templates/writer/api-documentarian.yaml +99 -0
- package/tooling/.automation/overrides/templates/writer/docs-as-code.yaml +108 -0
- package/tooling/.automation/overrides/templates/writer/user-guide-author.yaml +100 -0
- package/tooling/completions/DevflowCompletion.ps1 +213 -0
- package/tooling/completions/_run-story +116 -0
- package/tooling/completions/run-story-completion.bash +136 -0
- package/tooling/docs/DOC-STANDARD.md +717 -0
- package/tooling/docs/sprint-status.yaml.template +24 -0
- package/tooling/docs/templates/bug-report.md +234 -0
- package/tooling/docs/templates/migration-spec.md +274 -0
- package/tooling/docs/templates/refactor-spec.md +86 -0
- package/tooling/docs/templates/tech-debt.md +86 -0
- package/tooling/scripts/context_checkpoint.py +556 -0
- package/tooling/scripts/cost_dashboard.py +617 -0
- package/tooling/scripts/create-persona.py +690 -0
- package/tooling/scripts/create-persona.sh +435 -0
- package/tooling/scripts/init-project-workflow.ps1 +651 -0
- package/tooling/scripts/init-project-workflow.py +70 -0
- package/tooling/scripts/init-project-workflow.sh +746 -0
- package/tooling/scripts/lib/__init__.py +35 -0
- package/tooling/scripts/lib/agent_handoff.py +526 -0
- package/tooling/scripts/lib/agent_router.py +698 -0
- package/tooling/scripts/lib/checkpoint-integration.ps1 +245 -0
- package/tooling/scripts/lib/checkpoint-integration.sh +191 -0
- package/tooling/scripts/lib/claude-cli.ps1 +952 -0
- package/tooling/scripts/lib/claude-cli.sh +1293 -0
- package/tooling/scripts/lib/cost_config.py +222 -0
- package/tooling/scripts/lib/cost_display.py +443 -0
- package/tooling/scripts/lib/cost_tracker.py +710 -0
- package/tooling/scripts/lib/currency_converter.py +328 -0
- package/tooling/scripts/lib/errors.py +438 -0
- package/tooling/scripts/lib/override-loader.sh +286 -0
- package/tooling/scripts/lib/pair_programming.py +589 -0
- package/tooling/scripts/lib/shared_memory.py +637 -0
- package/tooling/scripts/lib/swarm_orchestrator.py +689 -0
- package/tooling/scripts/memory_summarize.py +324 -0
- package/tooling/scripts/new-doc.ps1 +405 -0
- package/tooling/scripts/new-doc.py +93 -0
- package/tooling/scripts/new-doc.sh +534 -0
- package/tooling/scripts/personalize_agent.py +385 -0
- package/tooling/scripts/rollback-migration.sh +540 -0
- package/tooling/scripts/run-collab.ps1 +251 -0
- package/tooling/scripts/run-collab.py +605 -0
- package/tooling/scripts/run-collab.sh +110 -0
- package/tooling/scripts/run-story.ps1 +490 -0
- package/tooling/scripts/run-story.py +387 -0
- package/tooling/scripts/run-story.sh +467 -0
- package/tooling/scripts/setup-checkpoint-service.ps1 +219 -0
- package/tooling/scripts/setup-checkpoint-service.py +87 -0
- package/tooling/scripts/setup-checkpoint-service.sh +236 -0
- package/tooling/scripts/tech-debt-tracker.py +608 -0
- package/tooling/scripts/update_version.py +244 -0
- package/tooling/scripts/validate-overrides.py +511 -0
- package/tooling/scripts/validate-overrides.sh +432 -0
- package/tooling/scripts/validate_setup.py +539 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
INIT-PROJECT-WORKFLOW - Claude Code Workflow Initialization for Windows
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
Sets up automated development workflow for any project using Claude Code CLI.
|
|
7
|
+
Interactive wizard guides through installation.
|
|
8
|
+
|
|
9
|
+
.EXAMPLE
|
|
10
|
+
.\init-project-workflow.ps1
|
|
11
|
+
|
|
12
|
+
.NOTES
|
|
13
|
+
Version: 1.0.0
|
|
14
|
+
Requires: PowerShell 5.1+, Claude Code CLI
|
|
15
|
+
#>
|
|
16
|
+
|
|
17
|
+
#Requires -Version 5.1
|
|
18
|
+
|
|
19
|
+
$script:ScriptDir = $PSScriptRoot
|
|
20
|
+
|
|
21
|
+
#region Helper Functions
|
|
22
|
+
|
|
23
|
+
function Write-Banner {
|
|
24
|
+
Write-Host ""
|
|
25
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Cyan
|
|
26
|
+
Write-Host " CLAUDE CODE WORKFLOW INITIALIZATION" -ForegroundColor Cyan
|
|
27
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Cyan
|
|
28
|
+
Write-Host " Automated Development Workflow Setup" -ForegroundColor Cyan
|
|
29
|
+
Write-Host " Version 1.0 (Windows)" -ForegroundColor Cyan
|
|
30
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Cyan
|
|
31
|
+
Write-Host ""
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function Write-Step {
|
|
35
|
+
param(
|
|
36
|
+
[int]$StepNum,
|
|
37
|
+
[string]$StepTitle
|
|
38
|
+
)
|
|
39
|
+
Write-Host ""
|
|
40
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Magenta
|
|
41
|
+
Write-Host " STEP $StepNum: $StepTitle" -ForegroundColor Magenta
|
|
42
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Magenta
|
|
43
|
+
Write-Host ""
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function Read-PromptInput {
|
|
47
|
+
param(
|
|
48
|
+
[string]$Prompt,
|
|
49
|
+
[string]$Default = ""
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
if ($Default) {
|
|
53
|
+
Write-Host "$Prompt " -NoNewline -ForegroundColor Yellow
|
|
54
|
+
Write-Host "(default: $Default)" -ForegroundColor Blue
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
Write-Host "$Prompt" -ForegroundColor Yellow
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
$result = Read-Host
|
|
61
|
+
if ([string]::IsNullOrWhiteSpace($result)) {
|
|
62
|
+
return $Default
|
|
63
|
+
}
|
|
64
|
+
return $result
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function Read-YesNo {
|
|
68
|
+
param(
|
|
69
|
+
[string]$Prompt,
|
|
70
|
+
[string]$Default = "y"
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
Write-Host "$Prompt (y/n) " -NoNewline -ForegroundColor Yellow
|
|
74
|
+
Write-Host "[default: $Default]" -ForegroundColor Blue
|
|
75
|
+
$response = Read-Host
|
|
76
|
+
|
|
77
|
+
if ([string]::IsNullOrWhiteSpace($response)) {
|
|
78
|
+
$response = $Default
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return $response -match '^[Yy]'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
#endregion
|
|
85
|
+
|
|
86
|
+
#region Setup Functions
|
|
87
|
+
|
|
88
|
+
function Get-ProjectType {
|
|
89
|
+
Write-Host ">> Detecting project type..." -ForegroundColor Blue
|
|
90
|
+
|
|
91
|
+
$projectType = "generic"
|
|
92
|
+
|
|
93
|
+
if (Test-Path "package.json") { $projectType = "node" }
|
|
94
|
+
elseif (Test-Path "pubspec.yaml") { $projectType = "flutter" }
|
|
95
|
+
elseif (Test-Path "Cargo.toml") { $projectType = "rust" }
|
|
96
|
+
elseif (Test-Path "go.mod") { $projectType = "go" }
|
|
97
|
+
elseif (Test-Path "requirements.txt") { $projectType = "python" }
|
|
98
|
+
elseif (Test-Path "pyproject.toml") { $projectType = "python" }
|
|
99
|
+
elseif (Test-Path "Gemfile") { $projectType = "ruby" }
|
|
100
|
+
elseif ((Test-Path "pom.xml") -or (Test-Path "build.gradle") -or (Test-Path "build.gradle.kts")) {
|
|
101
|
+
# Check if it's Android or pure Java/Kotlin
|
|
102
|
+
if ((Test-Path "app\src\main\java") -or (Test-Path "app\src\main\kotlin")) {
|
|
103
|
+
$projectType = "android"
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
$projectType = "java"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
elseif ((Test-Path "Package.swift") -or (Get-ChildItem -Filter "*.xcodeproj" -ErrorAction SilentlyContinue) -or (Get-ChildItem -Filter "*.xcworkspace" -ErrorAction SilentlyContinue)) {
|
|
110
|
+
$projectType = "swift"
|
|
111
|
+
}
|
|
112
|
+
elseif ((Test-Path "settings.gradle.kts") -and (Test-Path "build.gradle.kts")) {
|
|
113
|
+
$projectType = "kotlin"
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Write-Host " Detected: $projectType" -ForegroundColor Green
|
|
117
|
+
return $projectType
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function New-DirectoryStructure {
|
|
121
|
+
param([string]$ProjectRoot)
|
|
122
|
+
|
|
123
|
+
Write-Host ">> Creating directory structure..." -ForegroundColor Blue
|
|
124
|
+
|
|
125
|
+
$dirs = @(
|
|
126
|
+
"tooling\.automation\agents"
|
|
127
|
+
"tooling\.automation\checkpoints"
|
|
128
|
+
"tooling\.automation\logs"
|
|
129
|
+
"tooling\scripts\lib"
|
|
130
|
+
"tooling\docs"
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
foreach ($dir in $dirs) {
|
|
134
|
+
$path = Join-Path $ProjectRoot $dir
|
|
135
|
+
if (-not (Test-Path $path)) {
|
|
136
|
+
New-Item -ItemType Directory -Path $path -Force | Out-Null
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
Write-Host " [OK] Directories created" -ForegroundColor Green
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function Copy-CoreScripts {
|
|
144
|
+
param(
|
|
145
|
+
[string]$ProjectRoot,
|
|
146
|
+
[string]$SourceDir
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
Write-Host ">> Copying core automation scripts..." -ForegroundColor Blue
|
|
150
|
+
|
|
151
|
+
# Copy library scripts
|
|
152
|
+
$libSource = Join-Path $SourceDir "lib"
|
|
153
|
+
$libDest = Join-Path $ProjectRoot "tooling\scripts\lib"
|
|
154
|
+
|
|
155
|
+
$libFiles = @("claude-cli.ps1", "checkpoint-integration.ps1")
|
|
156
|
+
foreach ($file in $libFiles) {
|
|
157
|
+
$src = Join-Path $libSource $file
|
|
158
|
+
if (Test-Path $src) {
|
|
159
|
+
Copy-Item $src -Destination $libDest -Force
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
# Copy main scripts
|
|
164
|
+
$mainFiles = @("run-story.ps1", "context_checkpoint.py", "setup-checkpoint-service.ps1", "new-doc.ps1")
|
|
165
|
+
$scriptDest = Join-Path $ProjectRoot "tooling\scripts"
|
|
166
|
+
|
|
167
|
+
foreach ($file in $mainFiles) {
|
|
168
|
+
$src = Join-Path $SourceDir $file
|
|
169
|
+
if (Test-Path $src) {
|
|
170
|
+
Copy-Item $src -Destination $scriptDest -Force
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
Write-Host " [OK] Scripts copied" -ForegroundColor Green
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function New-ConfigFile {
|
|
178
|
+
param(
|
|
179
|
+
[string]$ProjectRoot,
|
|
180
|
+
[string]$ProjectName,
|
|
181
|
+
[string]$ProjectType,
|
|
182
|
+
[string]$ModelDev,
|
|
183
|
+
[string]$ModelPlanning,
|
|
184
|
+
[string]$DisplayCurrency = "USD"
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
Write-Host ">> Creating configuration file..." -ForegroundColor Blue
|
|
188
|
+
|
|
189
|
+
$configPath = Join-Path $ProjectRoot "tooling\.automation\config.ps1"
|
|
190
|
+
$today = (Get-Date).ToString("yyyy-MM-dd")
|
|
191
|
+
|
|
192
|
+
$configContent = @"
|
|
193
|
+
<#
|
|
194
|
+
.SYNOPSIS
|
|
195
|
+
Automation Configuration for $ProjectName
|
|
196
|
+
|
|
197
|
+
.NOTES
|
|
198
|
+
Generated: $today
|
|
199
|
+
#>
|
|
200
|
+
|
|
201
|
+
# Project settings
|
|
202
|
+
`$env:PROJECT_NAME = "$ProjectName"
|
|
203
|
+
`$env:PROJECT_TYPE = "$ProjectType"
|
|
204
|
+
|
|
205
|
+
# Claude Code CLI settings
|
|
206
|
+
`$env:CLAUDE_CLI = if (`$env:CLAUDE_CLI) { `$env:CLAUDE_CLI } else { "claude" }
|
|
207
|
+
`$env:CLAUDE_MODEL_DEV = "$ModelDev"
|
|
208
|
+
`$env:CLAUDE_MODEL_PLANNING = "$ModelPlanning"
|
|
209
|
+
|
|
210
|
+
# Default model
|
|
211
|
+
`$env:CLAUDE_MODEL = if (`$env:CLAUDE_MODEL) { `$env:CLAUDE_MODEL } else { "$ModelPlanning" }
|
|
212
|
+
|
|
213
|
+
# Permission mode for automation
|
|
214
|
+
`$env:PERMISSION_MODE = if (`$env:PERMISSION_MODE) { `$env:PERMISSION_MODE } else { "dangerouslySkipPermissions" }
|
|
215
|
+
|
|
216
|
+
# Auto-commit settings
|
|
217
|
+
`$env:AUTO_COMMIT = if (`$env:AUTO_COMMIT) { `$env:AUTO_COMMIT } else { "true" }
|
|
218
|
+
`$env:AUTO_PR = if (`$env:AUTO_PR) { `$env:AUTO_PR } else { "false" }
|
|
219
|
+
|
|
220
|
+
# Budget limits (USD)
|
|
221
|
+
`$env:MAX_BUDGET_CONTEXT = "3.00"
|
|
222
|
+
`$env:MAX_BUDGET_DEV = "15.00"
|
|
223
|
+
`$env:MAX_BUDGET_REVIEW = "5.00"
|
|
224
|
+
|
|
225
|
+
# Cost display settings
|
|
226
|
+
`$env:COST_DISPLAY_CURRENCY = "$DisplayCurrency"
|
|
227
|
+
`$env:COST_WARNING_PERCENT = "75"
|
|
228
|
+
`$env:COST_CRITICAL_PERCENT = "90"
|
|
229
|
+
`$env:COST_AUTO_STOP = "true"
|
|
230
|
+
|
|
231
|
+
# Paths
|
|
232
|
+
`$script:AutomationDir = `$PSScriptRoot
|
|
233
|
+
`$script:ProjectRoot = (Get-Item "`$script:AutomationDir\..\..").FullName
|
|
234
|
+
`$script:ScriptsDir = Join-Path `$script:ProjectRoot "tooling\scripts"
|
|
235
|
+
`$script:DocsDir = Join-Path `$script:ProjectRoot "tooling\docs"
|
|
236
|
+
|
|
237
|
+
# Tool configurations
|
|
238
|
+
`$env:CHECKPOINT_THRESHOLDS = "75,85,95" # Warning, Critical, Emergency
|
|
239
|
+
"@
|
|
240
|
+
|
|
241
|
+
Set-Content -Path $configPath -Value $configContent
|
|
242
|
+
Write-Host " [OK] Configuration created" -ForegroundColor Green
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function New-AgentPersonas {
|
|
246
|
+
param([string]$ProjectRoot)
|
|
247
|
+
|
|
248
|
+
Write-Host ">> Creating agent persona definitions..." -ForegroundColor Blue
|
|
249
|
+
|
|
250
|
+
$agentsDir = Join-Path $ProjectRoot "tooling\.automation\agents"
|
|
251
|
+
|
|
252
|
+
# SM Agent
|
|
253
|
+
$smContent = @"
|
|
254
|
+
# Scrum Master Agent
|
|
255
|
+
|
|
256
|
+
You are an experienced Scrum Master overseeing development workflow.
|
|
257
|
+
|
|
258
|
+
## Responsibilities
|
|
259
|
+
- Story context creation and planning
|
|
260
|
+
- Code review and quality assurance
|
|
261
|
+
- Story drafting and specification
|
|
262
|
+
- Sprint status management
|
|
263
|
+
|
|
264
|
+
## Approach
|
|
265
|
+
- Be thorough but efficient
|
|
266
|
+
- Focus on quality and completeness
|
|
267
|
+
- Follow Agile best practices
|
|
268
|
+
- Ensure acceptance criteria are met
|
|
269
|
+
|
|
270
|
+
## Communication Style
|
|
271
|
+
- Clear and professional
|
|
272
|
+
- Action-oriented
|
|
273
|
+
- Provide constructive feedback
|
|
274
|
+
"@
|
|
275
|
+
Set-Content -Path (Join-Path $agentsDir "sm.md") -Value $smContent
|
|
276
|
+
|
|
277
|
+
# DEV Agent
|
|
278
|
+
$devContent = @"
|
|
279
|
+
# Developer Agent
|
|
280
|
+
|
|
281
|
+
You are a senior software developer implementing features.
|
|
282
|
+
|
|
283
|
+
## Responsibilities
|
|
284
|
+
- Implement stories according to specifications
|
|
285
|
+
- Write clean, maintainable code
|
|
286
|
+
- Create comprehensive tests
|
|
287
|
+
- Follow project patterns and conventions
|
|
288
|
+
|
|
289
|
+
## Approach
|
|
290
|
+
- Code first, explain later
|
|
291
|
+
- Prioritize working solutions
|
|
292
|
+
- Write self-documenting code
|
|
293
|
+
- Ensure tests pass before completion
|
|
294
|
+
|
|
295
|
+
## Communication Style
|
|
296
|
+
- Concise and technical
|
|
297
|
+
- Focus on implementation details
|
|
298
|
+
- Proactive problem-solving
|
|
299
|
+
"@
|
|
300
|
+
Set-Content -Path (Join-Path $agentsDir "dev.md") -Value $devContent
|
|
301
|
+
|
|
302
|
+
# BA Agent
|
|
303
|
+
$baContent = @"
|
|
304
|
+
# Business Analyst Agent
|
|
305
|
+
|
|
306
|
+
You are a Business Analyst specializing in requirements gathering.
|
|
307
|
+
|
|
308
|
+
## Responsibilities
|
|
309
|
+
- Analyze and document requirements
|
|
310
|
+
- Create user stories with INVEST criteria
|
|
311
|
+
- Define acceptance criteria
|
|
312
|
+
- Identify edge cases and business rules
|
|
313
|
+
|
|
314
|
+
## Approach
|
|
315
|
+
- User-centric thinking
|
|
316
|
+
- Detailed documentation
|
|
317
|
+
- Clear acceptance criteria
|
|
318
|
+
- Consider all scenarios
|
|
319
|
+
|
|
320
|
+
## Communication Style
|
|
321
|
+
- Clear and structured
|
|
322
|
+
- Business-focused
|
|
323
|
+
- Comprehensive but concise
|
|
324
|
+
"@
|
|
325
|
+
Set-Content -Path (Join-Path $agentsDir "ba.md") -Value $baContent
|
|
326
|
+
|
|
327
|
+
# Architect Agent
|
|
328
|
+
$architectContent = @"
|
|
329
|
+
# Architect Agent
|
|
330
|
+
|
|
331
|
+
You are a Software Architect designing technical solutions.
|
|
332
|
+
|
|
333
|
+
## Responsibilities
|
|
334
|
+
- Create technical specifications
|
|
335
|
+
- Design system architecture
|
|
336
|
+
- Define data models and APIs
|
|
337
|
+
- Identify technical risks
|
|
338
|
+
|
|
339
|
+
## Approach
|
|
340
|
+
- Think holistically
|
|
341
|
+
- Follow architectural patterns
|
|
342
|
+
- Consider scalability and maintainability
|
|
343
|
+
- Balance pragmatism with quality
|
|
344
|
+
|
|
345
|
+
## Communication Style
|
|
346
|
+
- Technical and precise
|
|
347
|
+
- Diagram-driven when helpful
|
|
348
|
+
- Consider trade-offs
|
|
349
|
+
"@
|
|
350
|
+
Set-Content -Path (Join-Path $agentsDir "architect.md") -Value $architectContent
|
|
351
|
+
|
|
352
|
+
Write-Host " [OK] Agent personas created" -ForegroundColor Green
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function New-SprintStatus {
|
|
356
|
+
param(
|
|
357
|
+
[string]$ProjectRoot,
|
|
358
|
+
[string]$ProjectName
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
Write-Host ">> Creating sprint status tracker..." -ForegroundColor Blue
|
|
362
|
+
|
|
363
|
+
$sprintPath = Join-Path $ProjectRoot "tooling\docs\sprint-status.yaml"
|
|
364
|
+
$today = (Get-Date).ToString("yyyy-MM-dd")
|
|
365
|
+
$endDate = (Get-Date).AddDays(14).ToString("yyyy-MM-dd")
|
|
366
|
+
|
|
367
|
+
$content = @"
|
|
368
|
+
# Sprint Status - $ProjectName
|
|
369
|
+
# Updated: $today
|
|
370
|
+
|
|
371
|
+
sprint:
|
|
372
|
+
number: 1
|
|
373
|
+
start: $today
|
|
374
|
+
end: $endDate
|
|
375
|
+
|
|
376
|
+
# Story Status Values:
|
|
377
|
+
# - backlog: Not yet started
|
|
378
|
+
# - drafted: Story specification created
|
|
379
|
+
# - ready-for-dev: Context created, ready for implementation
|
|
380
|
+
# - in-progress: Currently being worked on
|
|
381
|
+
# - review: Implementation complete, awaiting review
|
|
382
|
+
# - done: Reviewed and approved
|
|
383
|
+
|
|
384
|
+
stories:
|
|
385
|
+
# Add your stories here in format:
|
|
386
|
+
# story-key: status
|
|
387
|
+
# Example:
|
|
388
|
+
# 1-1-setup-project: done
|
|
389
|
+
# 1-2-implement-auth: in-progress
|
|
390
|
+
"@
|
|
391
|
+
|
|
392
|
+
Set-Content -Path $sprintPath -Value $content
|
|
393
|
+
Write-Host " [OK] Sprint status created" -ForegroundColor Green
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function New-WorkflowReadme {
|
|
397
|
+
param(
|
|
398
|
+
[string]$ProjectRoot,
|
|
399
|
+
[string]$ProjectName
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
Write-Host ">> Creating workflow README..." -ForegroundColor Blue
|
|
403
|
+
|
|
404
|
+
$readmePath = Join-Path $ProjectRoot "tooling\README.md"
|
|
405
|
+
|
|
406
|
+
$content = @"
|
|
407
|
+
# $ProjectName - Development Workflow (Windows)
|
|
408
|
+
|
|
409
|
+
Automated development workflow powered by Claude Code CLI.
|
|
410
|
+
|
|
411
|
+
## Quick Start
|
|
412
|
+
|
|
413
|
+
### Run a Story
|
|
414
|
+
|
|
415
|
+
``````powershell
|
|
416
|
+
cd tooling\scripts
|
|
417
|
+
.\run-story.ps1 -StoryKey "1-1"
|
|
418
|
+
``````
|
|
419
|
+
|
|
420
|
+
### Available Commands
|
|
421
|
+
|
|
422
|
+
``````powershell
|
|
423
|
+
# Full pipeline (context + dev + review)
|
|
424
|
+
.\run-story.ps1 -StoryKey "1-1"
|
|
425
|
+
|
|
426
|
+
# Development only
|
|
427
|
+
.\run-story.ps1 -StoryKey "1-1" -Develop
|
|
428
|
+
|
|
429
|
+
# Review only
|
|
430
|
+
.\run-story.ps1 -StoryKey "1-1" -Review
|
|
431
|
+
|
|
432
|
+
# Context creation only
|
|
433
|
+
.\run-story.ps1 -StoryKey "1-1" -Context
|
|
434
|
+
|
|
435
|
+
# Use specific model
|
|
436
|
+
.\run-story.ps1 -StoryKey "1-1" -Model opus
|
|
437
|
+
``````
|
|
438
|
+
|
|
439
|
+
### Checkpoint Management
|
|
440
|
+
|
|
441
|
+
``````powershell
|
|
442
|
+
# List checkpoints
|
|
443
|
+
python tooling\scripts\context_checkpoint.py --list
|
|
444
|
+
|
|
445
|
+
# Create manual checkpoint
|
|
446
|
+
python tooling\scripts\context_checkpoint.py --checkpoint
|
|
447
|
+
|
|
448
|
+
# Resume from checkpoint
|
|
449
|
+
python tooling\scripts\context_checkpoint.py --resume <checkpoint-id>
|
|
450
|
+
``````
|
|
451
|
+
|
|
452
|
+
### Create New Documentation
|
|
453
|
+
|
|
454
|
+
``````powershell
|
|
455
|
+
.\tooling\scripts\new-doc.ps1 -Type guide -Name "my-guide"
|
|
456
|
+
``````
|
|
457
|
+
|
|
458
|
+
## Directory Structure
|
|
459
|
+
|
|
460
|
+
``````
|
|
461
|
+
tooling\
|
|
462
|
+
+-- .automation\
|
|
463
|
+
| +-- agents\ # Agent persona definitions
|
|
464
|
+
| +-- checkpoints\ # Context checkpoints
|
|
465
|
+
| +-- logs\ # Execution logs
|
|
466
|
+
| +-- config.ps1 # Configuration
|
|
467
|
+
+-- scripts\
|
|
468
|
+
| +-- lib\ # Script libraries
|
|
469
|
+
| +-- run-story.ps1 # Main automation runner
|
|
470
|
+
| +-- new-doc.ps1 # Documentation generator
|
|
471
|
+
+-- docs\
|
|
472
|
+
+-- sprint-status.yaml # Sprint tracking
|
|
473
|
+
``````
|
|
474
|
+
|
|
475
|
+
## Configuration
|
|
476
|
+
|
|
477
|
+
Edit ``tooling\.automation\config.ps1`` to customize:
|
|
478
|
+
- Claude Code models (Opus for dev, Sonnet for planning)
|
|
479
|
+
- Budget limits
|
|
480
|
+
- Auto-commit settings
|
|
481
|
+
- Permission modes
|
|
482
|
+
|
|
483
|
+
## Agent Personas
|
|
484
|
+
|
|
485
|
+
The workflow uses multiple agent personas:
|
|
486
|
+
- **SM (Scrum Master)**: Planning, context creation, code review
|
|
487
|
+
- **DEV (Developer)**: Story implementation
|
|
488
|
+
- **BA (Business Analyst)**: Requirements analysis
|
|
489
|
+
- **ARCHITECT**: Technical design
|
|
490
|
+
|
|
491
|
+
## Live Monitoring
|
|
492
|
+
|
|
493
|
+
The run-story.ps1 script provides live monitoring of:
|
|
494
|
+
- Context usage percentage
|
|
495
|
+
- Estimated costs
|
|
496
|
+
- Agent status
|
|
497
|
+
- Elapsed time
|
|
498
|
+
|
|
499
|
+
Press Ctrl+C to stop monitoring (the task continues in background).
|
|
500
|
+
|
|
501
|
+
## Next Steps
|
|
502
|
+
|
|
503
|
+
1. Add your stories to ``tooling\docs\sprint-status.yaml``
|
|
504
|
+
2. Create story specifications in ``tooling\docs\``
|
|
505
|
+
3. Run your first story: ``.\run-story.ps1 -StoryKey "story-key"``
|
|
506
|
+
"@
|
|
507
|
+
|
|
508
|
+
Set-Content -Path $readmePath -Value $content
|
|
509
|
+
Write-Host " [OK] README created" -ForegroundColor Green
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
#endregion
|
|
513
|
+
|
|
514
|
+
#region Main
|
|
515
|
+
|
|
516
|
+
function Main {
|
|
517
|
+
Write-Banner
|
|
518
|
+
|
|
519
|
+
Write-Host "This wizard will set up automated development workflow for your project." -ForegroundColor Blue
|
|
520
|
+
Write-Host "You'll be guided through the configuration process." -ForegroundColor Blue
|
|
521
|
+
Write-Host ""
|
|
522
|
+
|
|
523
|
+
if (-not (Read-YesNo "Continue with setup?")) {
|
|
524
|
+
Write-Host "Setup cancelled." -ForegroundColor Yellow
|
|
525
|
+
return
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
# STEP 1: Project Information
|
|
529
|
+
Write-Step -StepNum 1 -StepTitle "Project Information"
|
|
530
|
+
|
|
531
|
+
$projectRoot = Read-PromptInput -Prompt "Enter project root directory:" -Default (Get-Location).Path
|
|
532
|
+
$projectName = Read-PromptInput -Prompt "Enter project name:" -Default (Split-Path $projectRoot -Leaf)
|
|
533
|
+
|
|
534
|
+
Push-Location $projectRoot
|
|
535
|
+
$projectType = Get-ProjectType
|
|
536
|
+
|
|
537
|
+
if (-not (Read-YesNo "Is this correct? Type: $projectType")) {
|
|
538
|
+
$projectType = Read-PromptInput -Prompt "Enter project type manually:" -Default $projectType
|
|
539
|
+
}
|
|
540
|
+
Pop-Location
|
|
541
|
+
|
|
542
|
+
# STEP 2: Model Configuration
|
|
543
|
+
Write-Step -StepNum 2 -StepTitle "Claude Model Configuration"
|
|
544
|
+
|
|
545
|
+
Write-Host "For optimal cost/quality balance:" -ForegroundColor Blue
|
|
546
|
+
Write-Host " - Use Opus for code development and review (higher quality)" -ForegroundColor Blue
|
|
547
|
+
Write-Host " - Use Sonnet for planning and context creation (cost-effective)" -ForegroundColor Blue
|
|
548
|
+
Write-Host ""
|
|
549
|
+
|
|
550
|
+
$modelDev = Read-PromptInput -Prompt "Model for development/review:" -Default "opus"
|
|
551
|
+
$modelPlanning = Read-PromptInput -Prompt "Model for planning/context:" -Default "sonnet"
|
|
552
|
+
|
|
553
|
+
# Currency Selection
|
|
554
|
+
Write-Host ""
|
|
555
|
+
Write-Host "Select your preferred currency for cost display:" -ForegroundColor Blue
|
|
556
|
+
Write-Host " 1. USD - US Dollar ($)" -ForegroundColor White
|
|
557
|
+
Write-Host " 2. EUR - Euro (€)" -ForegroundColor White
|
|
558
|
+
Write-Host " 3. GBP - British Pound (£)" -ForegroundColor White
|
|
559
|
+
Write-Host " 4. BRL - Brazilian Real (R$)" -ForegroundColor White
|
|
560
|
+
Write-Host " 5. CAD - Canadian Dollar (C$)" -ForegroundColor White
|
|
561
|
+
Write-Host " 6. AUD - Australian Dollar (A$)" -ForegroundColor White
|
|
562
|
+
Write-Host ""
|
|
563
|
+
|
|
564
|
+
$currencyChoice = Read-PromptInput -Prompt "Enter choice (1-6):" -Default "1"
|
|
565
|
+
|
|
566
|
+
$currencyMap = @{
|
|
567
|
+
"1" = "USD"
|
|
568
|
+
"2" = "EUR"
|
|
569
|
+
"3" = "GBP"
|
|
570
|
+
"4" = "BRL"
|
|
571
|
+
"5" = "CAD"
|
|
572
|
+
"6" = "AUD"
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
$displayCurrency = $currencyMap[$currencyChoice]
|
|
576
|
+
if (-not $displayCurrency) { $displayCurrency = "USD" }
|
|
577
|
+
|
|
578
|
+
Write-Host " Selected: $displayCurrency" -ForegroundColor Green
|
|
579
|
+
|
|
580
|
+
# STEP 3: Directory Structure
|
|
581
|
+
Write-Step -StepNum 3 -StepTitle "Directory Structure"
|
|
582
|
+
|
|
583
|
+
New-DirectoryStructure -ProjectRoot $projectRoot
|
|
584
|
+
|
|
585
|
+
# STEP 4: Copy Scripts
|
|
586
|
+
Write-Step -StepNum 4 -StepTitle "Core Scripts"
|
|
587
|
+
|
|
588
|
+
Copy-CoreScripts -ProjectRoot $projectRoot -SourceDir $script:ScriptDir
|
|
589
|
+
|
|
590
|
+
# STEP 5: Configuration
|
|
591
|
+
Write-Step -StepNum 5 -StepTitle "Configuration Files"
|
|
592
|
+
|
|
593
|
+
New-ConfigFile -ProjectRoot $projectRoot -ProjectName $projectName -ProjectType $projectType -ModelDev $modelDev -ModelPlanning $modelPlanning -DisplayCurrency $displayCurrency
|
|
594
|
+
New-AgentPersonas -ProjectRoot $projectRoot
|
|
595
|
+
New-SprintStatus -ProjectRoot $projectRoot -ProjectName $projectName
|
|
596
|
+
|
|
597
|
+
# STEP 6: Checkpoint Service
|
|
598
|
+
Write-Step -StepNum 6 -StepTitle "Checkpoint Service (Optional)"
|
|
599
|
+
|
|
600
|
+
Write-Host "The checkpoint service monitors Claude sessions and auto-saves context." -ForegroundColor Blue
|
|
601
|
+
Write-Host "This prevents losing progress when context windows fill up." -ForegroundColor Blue
|
|
602
|
+
Write-Host ""
|
|
603
|
+
|
|
604
|
+
if (Read-YesNo "Install checkpoint service as Windows Scheduled Task?") {
|
|
605
|
+
$setupScript = Join-Path $projectRoot "tooling\scripts\setup-checkpoint-service.ps1"
|
|
606
|
+
if (Test-Path $setupScript) {
|
|
607
|
+
& $setupScript -Action install
|
|
608
|
+
}
|
|
609
|
+
Write-Host " [OK] Checkpoint service installed" -ForegroundColor Green
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
Write-Host " [i] Skipped checkpoint service installation" -ForegroundColor Yellow
|
|
613
|
+
Write-Host " You can install later with: .\tooling\scripts\setup-checkpoint-service.ps1 -Action install" -ForegroundColor Blue
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
# STEP 7: Documentation
|
|
617
|
+
Write-Step -StepNum 7 -StepTitle "Documentation"
|
|
618
|
+
|
|
619
|
+
New-WorkflowReadme -ProjectRoot $projectRoot -ProjectName $projectName
|
|
620
|
+
|
|
621
|
+
# STEP 8: Finalize
|
|
622
|
+
Write-Step -StepNum 8 -StepTitle "Setup Complete!"
|
|
623
|
+
|
|
624
|
+
Write-Host "[OK] Workflow initialization complete!" -ForegroundColor Green
|
|
625
|
+
Write-Host ""
|
|
626
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Cyan
|
|
627
|
+
Write-Host " NEXT STEPS" -ForegroundColor Cyan
|
|
628
|
+
Write-Host ("{0}" -f ("=" * 65)) -ForegroundColor Cyan
|
|
629
|
+
Write-Host ""
|
|
630
|
+
Write-Host "1. Review configuration:" -ForegroundColor Yellow
|
|
631
|
+
Write-Host " $projectRoot\tooling\.automation\config.ps1" -ForegroundColor Blue
|
|
632
|
+
Write-Host ""
|
|
633
|
+
Write-Host "2. Add your first story:" -ForegroundColor Yellow
|
|
634
|
+
Write-Host " Edit: $projectRoot\tooling\docs\sprint-status.yaml" -ForegroundColor Blue
|
|
635
|
+
Write-Host " Create: $projectRoot\tooling\docs\1-1-your-story.md" -ForegroundColor Blue
|
|
636
|
+
Write-Host ""
|
|
637
|
+
Write-Host "3. Run your first story:" -ForegroundColor Yellow
|
|
638
|
+
Write-Host " cd $projectRoot\tooling\scripts" -ForegroundColor Blue
|
|
639
|
+
Write-Host " .\run-story.ps1 -StoryKey '1-1'" -ForegroundColor Blue
|
|
640
|
+
Write-Host ""
|
|
641
|
+
Write-Host "4. Read the workflow guide:" -ForegroundColor Yellow
|
|
642
|
+
Write-Host " $projectRoot\tooling\README.md" -ForegroundColor Blue
|
|
643
|
+
Write-Host ""
|
|
644
|
+
Write-Host "Happy coding!" -ForegroundColor Green
|
|
645
|
+
Write-Host ""
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
#endregion
|
|
649
|
+
|
|
650
|
+
# Run main
|
|
651
|
+
Main
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Cross-Platform Project Workflow Initialization
|
|
4
|
+
|
|
5
|
+
Automatically detects the operating system and runs the appropriate setup wizard.
|
|
6
|
+
Works on Windows, macOS, and Linux.
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
python init-project-workflow.py
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import subprocess
|
|
14
|
+
import sys
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
SCRIPT_DIR = Path(__file__).parent
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_platform():
|
|
21
|
+
"""Detect the current platform."""
|
|
22
|
+
if sys.platform == "win32":
|
|
23
|
+
return "windows"
|
|
24
|
+
elif sys.platform == "darwin":
|
|
25
|
+
return "macos"
|
|
26
|
+
else:
|
|
27
|
+
return "linux"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def run_windows():
|
|
31
|
+
"""Run PowerShell script on Windows."""
|
|
32
|
+
script = SCRIPT_DIR / "init-project-workflow.ps1"
|
|
33
|
+
|
|
34
|
+
if not script.exists():
|
|
35
|
+
print(f"Error: PowerShell script not found: {script}")
|
|
36
|
+
return 1
|
|
37
|
+
|
|
38
|
+
cmd = ["powershell", "-ExecutionPolicy", "Bypass", "-File", str(script)]
|
|
39
|
+
return subprocess.call(cmd)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def run_unix():
|
|
43
|
+
"""Run shell script on macOS/Linux."""
|
|
44
|
+
script = SCRIPT_DIR / "init-project-workflow.sh"
|
|
45
|
+
|
|
46
|
+
if not script.exists():
|
|
47
|
+
print(f"Error: Shell script not found: {script}")
|
|
48
|
+
return 1
|
|
49
|
+
|
|
50
|
+
# Ensure script is executable
|
|
51
|
+
os.chmod(script, 0o755)
|
|
52
|
+
|
|
53
|
+
cmd = [str(script)]
|
|
54
|
+
return subprocess.call(cmd)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def main():
|
|
58
|
+
platform = get_platform()
|
|
59
|
+
|
|
60
|
+
print(f"Detected platform: {platform}")
|
|
61
|
+
print()
|
|
62
|
+
|
|
63
|
+
if platform == "windows":
|
|
64
|
+
return run_windows()
|
|
65
|
+
else:
|
|
66
|
+
return run_unix()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
if __name__ == "__main__":
|
|
70
|
+
sys.exit(main())
|