@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,286 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
################################################################################
|
|
3
|
+
# Override Loader Library
|
|
4
|
+
#
|
|
5
|
+
# Loads user profile and agent overrides to personalize agent behavior.
|
|
6
|
+
# Overrides are stored in tooling/.automation/overrides/ and survive updates.
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# source lib/override-loader.sh
|
|
10
|
+
# load_agent_with_overrides "dev" # Returns combined agent prompt
|
|
11
|
+
################################################################################
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
14
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
15
|
+
OVERRIDES_DIR="$PROJECT_ROOT/.automation/overrides"
|
|
16
|
+
AGENTS_DIR="$PROJECT_ROOT/.automation/agents"
|
|
17
|
+
MEMORY_DIR="$PROJECT_ROOT/.automation/memory"
|
|
18
|
+
|
|
19
|
+
################################################################################
|
|
20
|
+
# YAML Parsing Helpers (basic, for simple YAML structures)
|
|
21
|
+
################################################################################
|
|
22
|
+
|
|
23
|
+
# Extract a simple value from YAML (key: value)
|
|
24
|
+
yaml_get_value() {
|
|
25
|
+
local file="$1"
|
|
26
|
+
local key="$2"
|
|
27
|
+
grep -E "^${key}:" "$file" 2>/dev/null | sed "s/^${key}:[[:space:]]*//" | sed 's/^["'"'"']//' | sed 's/["'"'"']$//'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Extract a nested value (parent.child: value)
|
|
31
|
+
yaml_get_nested() {
|
|
32
|
+
local file="$1"
|
|
33
|
+
local parent="$2"
|
|
34
|
+
local child="$3"
|
|
35
|
+
awk "/^${parent}:/{found=1} found && /^ ${child}:/{print; exit}" "$file" 2>/dev/null | sed "s/^[[:space:]]*${child}:[[:space:]]*//" | sed 's/^["'"'"']//' | sed 's/["'"'"']$//'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# Extract a list from YAML (returns newline-separated items)
|
|
39
|
+
yaml_get_list() {
|
|
40
|
+
local file="$1"
|
|
41
|
+
local key="$2"
|
|
42
|
+
awk "/^${key}:/{found=1; next} found && /^[[:space:]]*-/{print} found && /^[a-zA-Z]/{exit}" "$file" 2>/dev/null | sed 's/^[[:space:]]*-[[:space:]]*//' | sed 's/^["'"'"']//' | sed 's/["'"'"']$//'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
################################################################################
|
|
46
|
+
# User Profile Loading
|
|
47
|
+
################################################################################
|
|
48
|
+
|
|
49
|
+
# Load user profile and return formatted context
|
|
50
|
+
load_user_profile() {
|
|
51
|
+
local profile_file="$OVERRIDES_DIR/user-profile.yaml"
|
|
52
|
+
|
|
53
|
+
if [[ ! -f "$profile_file" ]]; then
|
|
54
|
+
return 0
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
local user_name=$(yaml_get_nested "$profile_file" "user" "name")
|
|
58
|
+
local tech_level=$(yaml_get_nested "$profile_file" "user" "technical_level")
|
|
59
|
+
local comm_style=$(yaml_get_nested "$profile_file" "user" "communication_style")
|
|
60
|
+
|
|
61
|
+
local output=""
|
|
62
|
+
|
|
63
|
+
if [[ -n "$user_name" && "$user_name" != "User" ]]; then
|
|
64
|
+
output+="
|
|
65
|
+
## User Context
|
|
66
|
+
- User name: $user_name"
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if [[ -n "$tech_level" ]]; then
|
|
70
|
+
output+="
|
|
71
|
+
- Technical level: $tech_level"
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
if [[ -n "$comm_style" ]]; then
|
|
75
|
+
output+="
|
|
76
|
+
- Preferred communication: $comm_style"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# Load code style preferences
|
|
80
|
+
local code_style=$(yaml_get_list "$profile_file" " code_style")
|
|
81
|
+
if [[ -n "$code_style" ]]; then
|
|
82
|
+
output+="
|
|
83
|
+
|
|
84
|
+
## Code Style Preferences"
|
|
85
|
+
while IFS= read -r style; do
|
|
86
|
+
[[ -n "$style" ]] && output+="
|
|
87
|
+
- $style"
|
|
88
|
+
done <<< "$code_style"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# Load memories
|
|
92
|
+
local memories=$(yaml_get_list "$profile_file" "memories")
|
|
93
|
+
if [[ -n "$memories" ]]; then
|
|
94
|
+
output+="
|
|
95
|
+
|
|
96
|
+
## Project Memories (Always Remember)"
|
|
97
|
+
while IFS= read -r memory; do
|
|
98
|
+
[[ -n "$memory" ]] && output+="
|
|
99
|
+
- $memory"
|
|
100
|
+
done <<< "$memories"
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
echo "$output"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
################################################################################
|
|
107
|
+
# Agent Override Loading
|
|
108
|
+
################################################################################
|
|
109
|
+
|
|
110
|
+
# Load agent-specific overrides
|
|
111
|
+
load_agent_override() {
|
|
112
|
+
local agent_name="$1"
|
|
113
|
+
local override_file="$OVERRIDES_DIR/${agent_name}.override.yaml"
|
|
114
|
+
|
|
115
|
+
if [[ ! -f "$override_file" ]]; then
|
|
116
|
+
return 0
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
local output=""
|
|
120
|
+
|
|
121
|
+
# Load additional rules
|
|
122
|
+
local rules=$(yaml_get_list "$override_file" "additional_rules")
|
|
123
|
+
if [[ -n "$rules" ]]; then
|
|
124
|
+
output+="
|
|
125
|
+
|
|
126
|
+
## Additional Rules"
|
|
127
|
+
while IFS= read -r rule; do
|
|
128
|
+
[[ -n "$rule" ]] && output+="
|
|
129
|
+
- $rule"
|
|
130
|
+
done <<< "$rules"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Load memories
|
|
134
|
+
local memories=$(yaml_get_list "$override_file" "memories")
|
|
135
|
+
if [[ -n "$memories" ]]; then
|
|
136
|
+
output+="
|
|
137
|
+
|
|
138
|
+
## Agent Memories"
|
|
139
|
+
while IFS= read -r memory; do
|
|
140
|
+
[[ -n "$memory" ]] && output+="
|
|
141
|
+
- $memory"
|
|
142
|
+
done <<< "$memories"
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
# Load critical actions
|
|
146
|
+
local actions=$(yaml_get_list "$override_file" "critical_actions")
|
|
147
|
+
if [[ -n "$actions" ]]; then
|
|
148
|
+
output+="
|
|
149
|
+
|
|
150
|
+
## Critical Actions (Must Do)"
|
|
151
|
+
while IFS= read -r action; do
|
|
152
|
+
[[ -n "$action" ]] && output+="
|
|
153
|
+
- $action"
|
|
154
|
+
done <<< "$actions"
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
echo "$output"
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
# Get model override for an agent
|
|
161
|
+
get_agent_model_override() {
|
|
162
|
+
local agent_name="$1"
|
|
163
|
+
local override_file="$OVERRIDES_DIR/${agent_name}.override.yaml"
|
|
164
|
+
|
|
165
|
+
if [[ -f "$override_file" ]]; then
|
|
166
|
+
yaml_get_value "$override_file" "model"
|
|
167
|
+
fi
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
# Get budget override for an agent
|
|
171
|
+
get_agent_budget_override() {
|
|
172
|
+
local agent_name="$1"
|
|
173
|
+
local override_file="$OVERRIDES_DIR/${agent_name}.override.yaml"
|
|
174
|
+
|
|
175
|
+
if [[ -f "$override_file" ]]; then
|
|
176
|
+
yaml_get_value "$override_file" "max_budget_usd"
|
|
177
|
+
fi
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
################################################################################
|
|
181
|
+
# Agent Memory Loading
|
|
182
|
+
################################################################################
|
|
183
|
+
|
|
184
|
+
# Load persistent memory for an agent
|
|
185
|
+
load_agent_memory() {
|
|
186
|
+
local agent_name="$1"
|
|
187
|
+
local memory_file="$MEMORY_DIR/${agent_name}.memory.md"
|
|
188
|
+
|
|
189
|
+
if [[ -f "$memory_file" ]]; then
|
|
190
|
+
echo "
|
|
191
|
+
|
|
192
|
+
## Persistent Memory
|
|
193
|
+
|
|
194
|
+
$(cat "$memory_file")"
|
|
195
|
+
fi
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
# Append to agent memory
|
|
199
|
+
append_agent_memory() {
|
|
200
|
+
local agent_name="$1"
|
|
201
|
+
local memory_entry="$2"
|
|
202
|
+
local memory_file="$MEMORY_DIR/${agent_name}.memory.md"
|
|
203
|
+
|
|
204
|
+
mkdir -p "$MEMORY_DIR"
|
|
205
|
+
|
|
206
|
+
# Add timestamp and entry
|
|
207
|
+
echo "- $(date '+%Y-%m-%d %H:%M'): $memory_entry" >> "$memory_file"
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
################################################################################
|
|
211
|
+
# Main Loading Function
|
|
212
|
+
################################################################################
|
|
213
|
+
|
|
214
|
+
# Load agent with all overrides applied
|
|
215
|
+
# Returns the complete agent prompt with user profile, overrides, and memory
|
|
216
|
+
load_agent_with_overrides() {
|
|
217
|
+
local agent_name="$1"
|
|
218
|
+
local agent_file="$AGENTS_DIR/${agent_name}.md"
|
|
219
|
+
|
|
220
|
+
# Start with base agent
|
|
221
|
+
local output=""
|
|
222
|
+
if [[ -f "$agent_file" ]]; then
|
|
223
|
+
output=$(cat "$agent_file")
|
|
224
|
+
else
|
|
225
|
+
echo "Warning: Agent file not found: $agent_file" >&2
|
|
226
|
+
return 1
|
|
227
|
+
fi
|
|
228
|
+
|
|
229
|
+
# Add user profile
|
|
230
|
+
local profile=$(load_user_profile)
|
|
231
|
+
if [[ -n "$profile" ]]; then
|
|
232
|
+
output+="
|
|
233
|
+
$profile"
|
|
234
|
+
fi
|
|
235
|
+
|
|
236
|
+
# Add agent-specific overrides
|
|
237
|
+
local override=$(load_agent_override "$agent_name")
|
|
238
|
+
if [[ -n "$override" ]]; then
|
|
239
|
+
output+="
|
|
240
|
+
$override"
|
|
241
|
+
fi
|
|
242
|
+
|
|
243
|
+
# Add persistent memory
|
|
244
|
+
local memory=$(load_agent_memory "$agent_name")
|
|
245
|
+
if [[ -n "$memory" ]]; then
|
|
246
|
+
output+="
|
|
247
|
+
$memory"
|
|
248
|
+
fi
|
|
249
|
+
|
|
250
|
+
echo "$output"
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
# Check if overrides exist for an agent
|
|
254
|
+
has_overrides() {
|
|
255
|
+
local agent_name="$1"
|
|
256
|
+
[[ -f "$OVERRIDES_DIR/${agent_name}.override.yaml" ]]
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
# List all available overrides
|
|
260
|
+
list_overrides() {
|
|
261
|
+
echo "Available overrides:"
|
|
262
|
+
for file in "$OVERRIDES_DIR"/*.override.yaml; do
|
|
263
|
+
if [[ -f "$file" ]]; then
|
|
264
|
+
local name=$(basename "$file" .override.yaml)
|
|
265
|
+
echo " - $name"
|
|
266
|
+
fi
|
|
267
|
+
done
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
################################################################################
|
|
271
|
+
# Initialization
|
|
272
|
+
################################################################################
|
|
273
|
+
|
|
274
|
+
# Create overrides directory if it doesn't exist
|
|
275
|
+
init_overrides() {
|
|
276
|
+
mkdir -p "$OVERRIDES_DIR" "$MEMORY_DIR"
|
|
277
|
+
|
|
278
|
+
# Create user profile if it doesn't exist
|
|
279
|
+
if [[ ! -f "$OVERRIDES_DIR/user-profile.yaml" ]]; then
|
|
280
|
+
echo "# User profile not found. Creating default..." >&2
|
|
281
|
+
# Default will be created by the main setup
|
|
282
|
+
fi
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
# Auto-initialize when sourced
|
|
286
|
+
init_overrides 2>/dev/null || true
|