oh-my-customcode 0.19.4 → 0.21.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/README.md +5 -5
- package/package.json +1 -1
- package/templates/.claude/hooks/hooks.json +24 -0
- package/templates/.claude/hooks/scripts/model-escalation-advisor.sh +103 -0
- package/templates/.claude/hooks/scripts/stuck-detector.sh +125 -0
- package/templates/.claude/hooks/scripts/task-outcome-recorder.sh +63 -0
- package/templates/.claude/rules/MUST-agent-design.md +14 -0
- package/templates/.claude/skills/dag-orchestration/SKILL.md +198 -0
- package/templates/.claude/skills/model-escalation/SKILL.md +60 -0
- package/templates/.claude/skills/stuck-recovery/SKILL.md +54 -0
- package/templates/.claude/skills/task-decomposition/SKILL.md +181 -0
- package/templates/manifest.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Like oh-my-zsh transformed shell customization, oh-my-customcode makes personali
|
|
|
21
21
|
|
|
22
22
|
| Feature | Description |
|
|
23
23
|
|---------|-------------|
|
|
24
|
-
| **Batteries Included** | 41 agents,
|
|
24
|
+
| **Batteries Included** | 41 agents, 60 skills, 22 guides, 18 rules, 2 hooks, 4 contexts, ontology graph - ready to use out of the box |
|
|
25
25
|
| **Sub-Agent Model** | Supports hierarchical agent orchestration with specialized roles |
|
|
26
26
|
| **Dead Simple Customization** | Create a folder + markdown file = new agent or skill |
|
|
27
27
|
| **Mix and Match** | Use built-in components, create your own, or combine both |
|
|
@@ -124,20 +124,20 @@ Claude Code selects the appropriate model and parallelizes independent tasks (up
|
|
|
124
124
|
| **QA** | 3 | qa-planner, qa-writer, qa-engineer |
|
|
125
125
|
| **Total** | **41** | |
|
|
126
126
|
|
|
127
|
-
### Skills (
|
|
127
|
+
### Skills (60)
|
|
128
128
|
|
|
129
129
|
| Category | Count | Skills |
|
|
130
130
|
|----------|-------|--------|
|
|
131
131
|
| **Routing** | 4 | secretary-routing, dev-lead-routing, de-lead-routing, qa-lead-routing |
|
|
132
132
|
| **Best Practices** | 18 | go-best-practices, python-best-practices, typescript-best-practices, kotlin-best-practices, rust-best-practices, react-best-practices, fastapi-best-practices, springboot-best-practices, go-backend-best-practices, docker-best-practices, aws-best-practices, postgres-best-practices, supabase-postgres-best-practices, redis-best-practices, airflow-best-practices, dbt-best-practices, kafka-best-practices, snowflake-best-practices |
|
|
133
|
-
| **Development** |
|
|
133
|
+
| **Development** | 6 | dev-review, dev-refactor, create-agent, intent-detection, web-design-guidelines, analysis |
|
|
134
134
|
| **Data Engineering** | 2 | spark-best-practices, pipeline-architecture-patterns |
|
|
135
135
|
| **Optimization** | 3 | optimize-analyze, optimize-bundle, optimize-report |
|
|
136
136
|
| **Memory** | 3 | memory-save, memory-recall, memory-management |
|
|
137
137
|
| **Package Management** | 3 | npm-publish, npm-version, npm-audit |
|
|
138
138
|
| **Operations** | 7 | update-docs, update-external, audit-agents, fix-refs, sauron-watch, monitoring-setup, claude-code-bible |
|
|
139
139
|
| **Utilities** | 5 | lists, help, status, result-aggregation, writing-clearly-and-concisely |
|
|
140
|
-
| **Quality & Workflow** |
|
|
140
|
+
| **Quality & Workflow** | 6 | multi-model-verification, structured-dev-cycle, model-escalation, stuck-recovery, dag-orchestration, task-decomposition |
|
|
141
141
|
| **Deploy** | 2 | vercel-deploy, codex-exec |
|
|
142
142
|
| **External** | 1 | skills-sh-search |
|
|
143
143
|
|
|
@@ -225,7 +225,7 @@ your-project/
|
|
|
225
225
|
│ ├── be-fastapi-expert.md
|
|
226
226
|
│ ├── mgr-creator.md
|
|
227
227
|
│ └── ...
|
|
228
|
-
├── skills/ # Skill modules (
|
|
228
|
+
├── skills/ # Skill modules (60 directories, each with SKILL.md)
|
|
229
229
|
│ ├── go-best-practices/
|
|
230
230
|
│ ├── react-best-practices/
|
|
231
231
|
│ ├── secretary-routing/
|
package/package.json
CHANGED
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
{
|
|
77
77
|
"type": "command",
|
|
78
78
|
"command": "bash .claude/hooks/scripts/agent-teams-advisor.sh"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "command",
|
|
82
|
+
"command": "bash .claude/hooks/scripts/model-escalation-advisor.sh"
|
|
79
83
|
}
|
|
80
84
|
],
|
|
81
85
|
"description": "HUD statusline + R010 git delegation guard + R018 Agent Teams advisor on Task spawn"
|
|
@@ -163,6 +167,26 @@
|
|
|
163
167
|
}
|
|
164
168
|
],
|
|
165
169
|
"description": "Type check Python files with ty after edits"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"matcher": "tool == \"Task\"",
|
|
173
|
+
"hooks": [
|
|
174
|
+
{
|
|
175
|
+
"type": "command",
|
|
176
|
+
"command": "bash .claude/hooks/scripts/task-outcome-recorder.sh"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"description": "Record task outcomes (success/failure) for model escalation decisions"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\" || tool == \"Bash\" || tool == \"Task\"",
|
|
183
|
+
"hooks": [
|
|
184
|
+
{
|
|
185
|
+
"type": "command",
|
|
186
|
+
"command": "bash .claude/hooks/scripts/stuck-detector.sh"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"description": "Detect repetitive failure loops and advise recovery strategies"
|
|
166
190
|
}
|
|
167
191
|
],
|
|
168
192
|
"Stop": [
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Model Escalation Advisor Hook
|
|
5
|
+
# Trigger: PreToolUse, tool == "Task"
|
|
6
|
+
# Purpose: Advise model escalation when failure patterns detected
|
|
7
|
+
# Protocol: stdin JSON -> process -> stdout pass-through, exit 0 always
|
|
8
|
+
|
|
9
|
+
input=$(cat)
|
|
10
|
+
|
|
11
|
+
# Extract current task info
|
|
12
|
+
agent_type=$(echo "$input" | jq -r '.tool_input.subagent_type // "unknown"')
|
|
13
|
+
current_model=$(echo "$input" | jq -r '.tool_input.model // "inherit"')
|
|
14
|
+
|
|
15
|
+
# Session-scoped outcome log
|
|
16
|
+
OUTCOME_FILE="/tmp/.claude-task-outcomes-${PPID}"
|
|
17
|
+
|
|
18
|
+
# Skip if no history
|
|
19
|
+
if [ ! -f "$OUTCOME_FILE" ]; then
|
|
20
|
+
echo "$input"
|
|
21
|
+
exit 0
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Thresholds
|
|
25
|
+
FAILURE_THRESHOLD=2
|
|
26
|
+
CONSECUTIVE_THRESHOLD=3
|
|
27
|
+
COOLDOWN=5
|
|
28
|
+
|
|
29
|
+
# Count failures for this agent type
|
|
30
|
+
agent_failures=0
|
|
31
|
+
if [ -n "$agent_type" ] && [ "$agent_type" != "unknown" ]; then
|
|
32
|
+
agent_failures=$(grep -c "\"agent_type\":\"${agent_type}\".*\"outcome\":\"failure\"" "$OUTCOME_FILE" 2>/dev/null || echo "0")
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Count consecutive failures (tail entries)
|
|
36
|
+
consecutive_failures=$(tail -${CONSECUTIVE_THRESHOLD} "$OUTCOME_FILE" 2>/dev/null | grep -c '"outcome":"failure"' 2>/dev/null || echo "0")
|
|
37
|
+
|
|
38
|
+
# Escalation path
|
|
39
|
+
next_model=""
|
|
40
|
+
cost_multiplier=""
|
|
41
|
+
case "$current_model" in
|
|
42
|
+
haiku)
|
|
43
|
+
next_model="sonnet"
|
|
44
|
+
cost_multiplier="~3-5x"
|
|
45
|
+
;;
|
|
46
|
+
sonnet)
|
|
47
|
+
next_model="opus"
|
|
48
|
+
cost_multiplier="~5-10x"
|
|
49
|
+
;;
|
|
50
|
+
*)
|
|
51
|
+
next_model=""
|
|
52
|
+
;;
|
|
53
|
+
esac
|
|
54
|
+
|
|
55
|
+
# Advise escalation
|
|
56
|
+
if [ -n "$next_model" ]; then
|
|
57
|
+
should_advise=false
|
|
58
|
+
reason=""
|
|
59
|
+
|
|
60
|
+
if [ "$agent_failures" -ge "$FAILURE_THRESHOLD" ]; then
|
|
61
|
+
should_advise=true
|
|
62
|
+
reason="${agent_type} failed ${agent_failures}x with ${current_model}"
|
|
63
|
+
elif [ "$consecutive_failures" -ge "$CONSECUTIVE_THRESHOLD" ]; then
|
|
64
|
+
should_advise=true
|
|
65
|
+
reason="${consecutive_failures} consecutive failures"
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
if [ "$should_advise" = true ]; then
|
|
69
|
+
echo "" >&2
|
|
70
|
+
echo "--- [Model Escalation Advisory] ---" >&2
|
|
71
|
+
echo " Agent type: ${agent_type}" >&2
|
|
72
|
+
echo " Current model: ${current_model}" >&2
|
|
73
|
+
echo " ⚡ Recommended: Escalate to ${next_model}" >&2
|
|
74
|
+
echo " Cost impact: ${cost_multiplier} per task" >&2
|
|
75
|
+
echo " Reason: ${reason}" >&2
|
|
76
|
+
echo "------------------------------------" >&2
|
|
77
|
+
fi
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
# De-escalation check
|
|
81
|
+
if [ "$current_model" != "haiku" ] && [ "$current_model" != "inherit" ] && [ "$current_model" != "" ]; then
|
|
82
|
+
recent_successes=$(tail -${COOLDOWN} "$OUTCOME_FILE" 2>/dev/null | grep -c '"outcome":"success"' 2>/dev/null || echo "0")
|
|
83
|
+
|
|
84
|
+
if [ "$recent_successes" -ge "$COOLDOWN" ]; then
|
|
85
|
+
lower_model=""
|
|
86
|
+
case "$current_model" in
|
|
87
|
+
opus) lower_model="sonnet" ;;
|
|
88
|
+
sonnet) lower_model="haiku" ;;
|
|
89
|
+
esac
|
|
90
|
+
|
|
91
|
+
if [ -n "$lower_model" ]; then
|
|
92
|
+
echo "" >&2
|
|
93
|
+
echo "--- [Model De-escalation Advisory] ---" >&2
|
|
94
|
+
echo " ↓ Consider: ${current_model} → ${lower_model}" >&2
|
|
95
|
+
echo " ${recent_successes} consecutive successes" >&2
|
|
96
|
+
echo "--------------------------------------" >&2
|
|
97
|
+
fi
|
|
98
|
+
fi
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Pass through
|
|
102
|
+
echo "$input"
|
|
103
|
+
exit 0
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Stuck Detector Hook
|
|
5
|
+
# Trigger: PostToolUse, tool matches "Edit|Write|Bash|Task"
|
|
6
|
+
# Purpose: Detect repetitive failure loops and advise recovery
|
|
7
|
+
# Protocol: stdin JSON -> process -> stdout pass-through, exit 0 always
|
|
8
|
+
|
|
9
|
+
input=$(cat)
|
|
10
|
+
|
|
11
|
+
# Extract tool info
|
|
12
|
+
tool_name=$(echo "$input" | jq -r '.tool_name // "unknown"')
|
|
13
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // .tool_input.command // ""' | head -c 120)
|
|
14
|
+
is_error=$(echo "$input" | jq -r '.tool_output.is_error // false')
|
|
15
|
+
output_preview=$(echo "$input" | jq -r '.tool_output.output // ""' | head -c 200)
|
|
16
|
+
|
|
17
|
+
# Session-scoped history
|
|
18
|
+
HISTORY_FILE="/tmp/.claude-tool-history-${PPID}"
|
|
19
|
+
|
|
20
|
+
# Create entry
|
|
21
|
+
timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
22
|
+
|
|
23
|
+
# Generate error hash for deduplication (first 50 chars of error)
|
|
24
|
+
error_hash=""
|
|
25
|
+
if [ "$is_error" = "true" ]; then
|
|
26
|
+
error_hash=$(echo "$output_preview" | head -c 50 | md5sum 2>/dev/null | cut -d' ' -f1 || echo "unknown")
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
entry=$(jq -n \
|
|
30
|
+
--arg ts "$timestamp" \
|
|
31
|
+
--arg tool "$tool_name" \
|
|
32
|
+
--arg path "$file_path" \
|
|
33
|
+
--arg err "$is_error" \
|
|
34
|
+
--arg hash "$error_hash" \
|
|
35
|
+
--arg preview "$output_preview" \
|
|
36
|
+
'{timestamp: $ts, tool: $tool, path: $path, is_error: $err, error_hash: $hash, preview: $preview}')
|
|
37
|
+
|
|
38
|
+
echo "$entry" >> "$HISTORY_FILE"
|
|
39
|
+
|
|
40
|
+
# Ring buffer: keep last 100 entries
|
|
41
|
+
if [ -f "$HISTORY_FILE" ]; then
|
|
42
|
+
line_count=$(wc -l < "$HISTORY_FILE")
|
|
43
|
+
if [ "$line_count" -gt 100 ]; then
|
|
44
|
+
tail -100 "$HISTORY_FILE" > "${HISTORY_FILE}.tmp"
|
|
45
|
+
mv "${HISTORY_FILE}.tmp" "$HISTORY_FILE"
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# --- Detection Logic ---
|
|
50
|
+
|
|
51
|
+
# Only check for patterns if we have enough history
|
|
52
|
+
if [ ! -f "$HISTORY_FILE" ]; then
|
|
53
|
+
echo "$input"
|
|
54
|
+
exit 0
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
recent_count=$(wc -l < "$HISTORY_FILE")
|
|
58
|
+
if [ "$recent_count" -lt 3 ]; then
|
|
59
|
+
echo "$input"
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
stuck_detected=false
|
|
64
|
+
signal_type=""
|
|
65
|
+
pattern_desc=""
|
|
66
|
+
occurrence_count=0
|
|
67
|
+
threshold=0
|
|
68
|
+
recovery=""
|
|
69
|
+
|
|
70
|
+
# Signal 1: Repeated error (same error_hash 3+ times in last 10 entries)
|
|
71
|
+
if [ "$is_error" = "true" ] && [ -n "$error_hash" ]; then
|
|
72
|
+
error_repeat=$(tail -10 "$HISTORY_FILE" | grep -c "\"error_hash\":\"${error_hash}\"" 2>/dev/null || echo "0")
|
|
73
|
+
if [ "$error_repeat" -ge 3 ]; then
|
|
74
|
+
stuck_detected=true
|
|
75
|
+
signal_type="Repeated error"
|
|
76
|
+
pattern_desc="Same error appeared ${error_repeat} times in last 10 tool calls"
|
|
77
|
+
occurrence_count=$error_repeat
|
|
78
|
+
threshold=3
|
|
79
|
+
recovery="Rephrase the task or try a different approach"
|
|
80
|
+
fi
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
# Signal 2: Edit loop (same file edited 3+ times in last 8 entries)
|
|
84
|
+
if [ "$stuck_detected" = false ] && { [ "$tool_name" = "Edit" ] || [ "$tool_name" = "Write" ]; }; then
|
|
85
|
+
if [ -n "$file_path" ]; then
|
|
86
|
+
escaped_path=$(echo "$file_path" | sed 's/[.[\*^$()+?{|]/\\&/g')
|
|
87
|
+
edit_repeat=$(tail -8 "$HISTORY_FILE" | grep -c "\"path\":\"${escaped_path}\"" 2>/dev/null || echo "0")
|
|
88
|
+
if [ "$edit_repeat" -ge 3 ]; then
|
|
89
|
+
stuck_detected=true
|
|
90
|
+
signal_type="Edit loop"
|
|
91
|
+
pattern_desc="$(basename "$file_path") edited ${edit_repeat} times in last 8 calls"
|
|
92
|
+
occurrence_count=$edit_repeat
|
|
93
|
+
threshold=3
|
|
94
|
+
recovery="Try a different file or approach instead of re-editing"
|
|
95
|
+
fi
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
# Signal 3: Tool spam (same tool 5+ times in last 8 entries)
|
|
100
|
+
if [ "$stuck_detected" = false ]; then
|
|
101
|
+
tool_repeat=$(tail -8 "$HISTORY_FILE" | grep -c "\"tool\":\"${tool_name}\"" 2>/dev/null || echo "0")
|
|
102
|
+
if [ "$tool_repeat" -ge 5 ]; then
|
|
103
|
+
stuck_detected=true
|
|
104
|
+
signal_type="Tool loop"
|
|
105
|
+
pattern_desc="${tool_name} called ${tool_repeat} times in last 8 calls"
|
|
106
|
+
occurrence_count=$tool_repeat
|
|
107
|
+
threshold=5
|
|
108
|
+
recovery="Step back and reconsider the approach"
|
|
109
|
+
fi
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
# Output advisory if stuck detected
|
|
113
|
+
if [ "$stuck_detected" = true ]; then
|
|
114
|
+
echo "" >&2
|
|
115
|
+
echo "--- [Stuck Detection] Loop detected ---" >&2
|
|
116
|
+
echo " Signal: ${signal_type}" >&2
|
|
117
|
+
echo " Pattern: ${pattern_desc}" >&2
|
|
118
|
+
echo " Occurrences: ${occurrence_count}/${threshold}" >&2
|
|
119
|
+
echo " 💡 Recovery: ${recovery}" >&2
|
|
120
|
+
echo "----------------------------------------" >&2
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
# Pass through
|
|
124
|
+
echo "$input"
|
|
125
|
+
exit 0
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Task Outcome Recorder Hook
|
|
5
|
+
# Trigger: PostToolUse, tool == "Task"
|
|
6
|
+
# Purpose: Record task outcomes for model escalation decisions
|
|
7
|
+
# Protocol: stdin JSON -> process -> stdout pass-through, exit 0 always
|
|
8
|
+
|
|
9
|
+
input=$(cat)
|
|
10
|
+
|
|
11
|
+
# Extract task info
|
|
12
|
+
agent_type=$(echo "$input" | jq -r '.tool_input.subagent_type // "unknown"')
|
|
13
|
+
model=$(echo "$input" | jq -r '.tool_input.model // "inherit"')
|
|
14
|
+
description=$(echo "$input" | jq -r '.tool_input.description // ""' | head -c 80)
|
|
15
|
+
|
|
16
|
+
# Determine outcome
|
|
17
|
+
is_error=$(echo "$input" | jq -r '.tool_output.is_error // false')
|
|
18
|
+
|
|
19
|
+
if [ "$is_error" = "true" ]; then
|
|
20
|
+
outcome="failure"
|
|
21
|
+
error_summary=$(echo "$input" | jq -r '.tool_output.output // ""' | head -c 200)
|
|
22
|
+
else
|
|
23
|
+
outcome="success"
|
|
24
|
+
error_summary=""
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Session-scoped outcome log
|
|
28
|
+
OUTCOME_FILE="/tmp/.claude-task-outcomes-${PPID}"
|
|
29
|
+
|
|
30
|
+
# Append JSON line entry
|
|
31
|
+
timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
32
|
+
entry=$(jq -n \
|
|
33
|
+
--arg ts "$timestamp" \
|
|
34
|
+
--arg agent "$agent_type" \
|
|
35
|
+
--arg model "$model" \
|
|
36
|
+
--arg outcome "$outcome" \
|
|
37
|
+
--arg desc "$description" \
|
|
38
|
+
--arg err "$error_summary" \
|
|
39
|
+
'{timestamp: $ts, agent_type: $agent, model: $model, outcome: $outcome, description: $desc, error_summary: $err}')
|
|
40
|
+
|
|
41
|
+
echo "$entry" >> "$OUTCOME_FILE"
|
|
42
|
+
|
|
43
|
+
# Ring buffer: keep last 50 entries
|
|
44
|
+
if [ -f "$OUTCOME_FILE" ]; then
|
|
45
|
+
line_count=$(wc -l < "$OUTCOME_FILE")
|
|
46
|
+
if [ "$line_count" -gt 50 ]; then
|
|
47
|
+
tail -50 "$OUTCOME_FILE" > "${OUTCOME_FILE}.tmp"
|
|
48
|
+
mv "${OUTCOME_FILE}.tmp" "$OUTCOME_FILE"
|
|
49
|
+
fi
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Report failures to stderr
|
|
53
|
+
if [ "$outcome" = "failure" ]; then
|
|
54
|
+
echo "" >&2
|
|
55
|
+
echo "--- [Task Outcome] FAILURE: ${agent_type}:${model} ---" >&2
|
|
56
|
+
echo " ${description}" >&2
|
|
57
|
+
echo " Error: $(echo "$error_summary" | head -c 100)" >&2
|
|
58
|
+
echo "-----------------------------------------------" >&2
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# Pass through
|
|
62
|
+
echo "$input"
|
|
63
|
+
exit 0
|
|
@@ -26,8 +26,22 @@ source: # For external agents
|
|
|
26
26
|
origin: github | npm
|
|
27
27
|
url: https://...
|
|
28
28
|
version: 1.0.0
|
|
29
|
+
escalation: # Model escalation policy (optional)
|
|
30
|
+
enabled: true # Enable auto-escalation advisory
|
|
31
|
+
path: haiku → sonnet → opus # Escalation sequence
|
|
32
|
+
threshold: 2 # Failures before advisory
|
|
29
33
|
```
|
|
30
34
|
|
|
35
|
+
### Escalation Policy
|
|
36
|
+
|
|
37
|
+
When `escalation.enabled: true`, the model-escalation hooks will track outcomes for this agent type and advise escalation when failures exceed the threshold. This is advisory-only — the orchestrator decides whether to accept the recommendation.
|
|
38
|
+
|
|
39
|
+
| Field | Default | Description |
|
|
40
|
+
|-------|---------|-------------|
|
|
41
|
+
| `enabled` | false | Enable escalation tracking for this agent |
|
|
42
|
+
| `path` | haiku → sonnet → opus | Model upgrade sequence |
|
|
43
|
+
| `threshold` | 2 | Failure count before escalation advisory |
|
|
44
|
+
|
|
31
45
|
## Memory Scopes
|
|
32
46
|
|
|
33
47
|
| Scope | Location | Git Tracked |
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dag-orchestration
|
|
3
|
+
description: YAML-based DAG workflow engine with topological execution and failure strategies
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DAG Orchestration Skill
|
|
7
|
+
|
|
8
|
+
Defines and executes directed acyclic graph (DAG) workflows. The orchestrator uses this skill to plan multi-step tasks with dependencies, execute them in topologically-sorted order, and handle failures.
|
|
9
|
+
|
|
10
|
+
**Orchestrator-only** — only the main conversation uses this skill (R010). Subagents execute individual nodes.
|
|
11
|
+
|
|
12
|
+
## Workflow Spec Format
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
# .claude/workflows/<name>.yaml or inline in conversation
|
|
16
|
+
workflow:
|
|
17
|
+
name: feature-implementation
|
|
18
|
+
description: Implement a new feature with tests and docs
|
|
19
|
+
|
|
20
|
+
nodes:
|
|
21
|
+
- id: analyze
|
|
22
|
+
agent: Explore
|
|
23
|
+
model: haiku
|
|
24
|
+
prompt: "Analyze codebase for integration points"
|
|
25
|
+
|
|
26
|
+
- id: implement
|
|
27
|
+
agent: lang-typescript-expert
|
|
28
|
+
model: sonnet
|
|
29
|
+
prompt: "Implement the feature"
|
|
30
|
+
depends_on: [analyze]
|
|
31
|
+
|
|
32
|
+
- id: test
|
|
33
|
+
agent: qa-engineer
|
|
34
|
+
model: sonnet
|
|
35
|
+
prompt: "Write and run tests"
|
|
36
|
+
depends_on: [implement]
|
|
37
|
+
|
|
38
|
+
- id: review
|
|
39
|
+
agent: lang-typescript-expert
|
|
40
|
+
model: opus
|
|
41
|
+
prompt: "Code review"
|
|
42
|
+
depends_on: [implement]
|
|
43
|
+
|
|
44
|
+
- id: docs
|
|
45
|
+
agent: arch-documenter
|
|
46
|
+
model: sonnet
|
|
47
|
+
prompt: "Update documentation"
|
|
48
|
+
depends_on: [implement]
|
|
49
|
+
|
|
50
|
+
- id: commit
|
|
51
|
+
agent: mgr-gitnerd
|
|
52
|
+
model: sonnet
|
|
53
|
+
prompt: "Commit changes"
|
|
54
|
+
depends_on: [test, review, docs]
|
|
55
|
+
|
|
56
|
+
config:
|
|
57
|
+
max_parallel: 4 # R009 limit
|
|
58
|
+
failure_strategy: stop # stop | skip | retry
|
|
59
|
+
retry_count: 2 # Max retries per node (if strategy=retry)
|
|
60
|
+
timeout_per_node: 300 # Seconds per node (0 = no limit)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Execution Algorithm — Kahn's Topological Sort
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
1. Parse workflow YAML
|
|
67
|
+
2. Build adjacency list and in-degree map
|
|
68
|
+
3. Validate: detect cycles (error if found)
|
|
69
|
+
4. Initialize queue with nodes where in-degree = 0
|
|
70
|
+
5. While queue is not empty:
|
|
71
|
+
a. Dequeue up to max_parallel nodes
|
|
72
|
+
b. Execute nodes in parallel via Task tool (R009)
|
|
73
|
+
c. On completion:
|
|
74
|
+
- Success → decrement in-degree of dependents
|
|
75
|
+
- Failure → apply failure_strategy
|
|
76
|
+
d. Enqueue newly-ready nodes (in-degree = 0)
|
|
77
|
+
6. Verify all nodes executed (detect unreachable nodes)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Execution Rules
|
|
81
|
+
|
|
82
|
+
| Rule | Detail |
|
|
83
|
+
|------|--------|
|
|
84
|
+
| Max parallel | 4 concurrent nodes (R009) |
|
|
85
|
+
| Agent Teams gate | 3+ parallel nodes → check R018 eligibility |
|
|
86
|
+
| Orchestrator only | DAG scheduling runs in main conversation (R010) |
|
|
87
|
+
| Node execution | Each node = one Task tool call to specified agent |
|
|
88
|
+
| State tracking | `/tmp/.claude-dag-$PPID.json` |
|
|
89
|
+
|
|
90
|
+
## Failure Strategies
|
|
91
|
+
|
|
92
|
+
| Strategy | Behavior |
|
|
93
|
+
|----------|----------|
|
|
94
|
+
| `stop` | Halt entire DAG on first failure (default) |
|
|
95
|
+
| `skip` | Mark failed node as skipped, continue dependents with warning |
|
|
96
|
+
| `retry` | Retry failed node up to `retry_count` times, then stop |
|
|
97
|
+
|
|
98
|
+
## State File Format
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"workflow": "feature-implementation",
|
|
103
|
+
"started_at": "2026-03-07T10:00:00Z",
|
|
104
|
+
"status": "running",
|
|
105
|
+
"nodes": {
|
|
106
|
+
"analyze": {"status": "completed", "started": "...", "completed": "..."},
|
|
107
|
+
"implement": {"status": "running", "started": "..."},
|
|
108
|
+
"test": {"status": "pending"},
|
|
109
|
+
"review": {"status": "pending"},
|
|
110
|
+
"docs": {"status": "pending"},
|
|
111
|
+
"commit": {"status": "blocked", "blocked_by": ["test", "review", "docs"]}
|
|
112
|
+
},
|
|
113
|
+
"execution_order": [["analyze"], ["implement"], ["test", "review", "docs"], ["commit"]]
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Display Format
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
[DAG] feature-implementation — 6 nodes
|
|
121
|
+
[Layer 0] analyze ← running
|
|
122
|
+
[Layer 1] implement ← pending (depends: analyze)
|
|
123
|
+
[Layer 2] test, review, docs ← pending (parallel, depends: implement)
|
|
124
|
+
[Layer 3] commit ← blocked (depends: test, review, docs)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Progress:
|
|
128
|
+
```
|
|
129
|
+
[DAG Progress] 3/6 nodes completed
|
|
130
|
+
✓ analyze (12s)
|
|
131
|
+
✓ implement (45s)
|
|
132
|
+
→ test (running)
|
|
133
|
+
→ review (running)
|
|
134
|
+
→ docs (running)
|
|
135
|
+
○ commit (blocked)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Common Workflow Templates
|
|
139
|
+
|
|
140
|
+
### Feature Implementation
|
|
141
|
+
```yaml
|
|
142
|
+
nodes: [analyze → implement → [test, review, docs] → commit]
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Code Review + Fix
|
|
146
|
+
```yaml
|
|
147
|
+
nodes: [review → fix → re-review → commit]
|
|
148
|
+
failure_strategy: retry
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Multi-Language Project
|
|
152
|
+
```yaml
|
|
153
|
+
nodes: [
|
|
154
|
+
analyze → [impl-frontend, impl-backend, impl-db] → integration-test → commit
|
|
155
|
+
]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Refactoring
|
|
159
|
+
```yaml
|
|
160
|
+
nodes: [
|
|
161
|
+
analyze → plan → [refactor-1, refactor-2, refactor-3] → test → review → commit
|
|
162
|
+
]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Integration
|
|
166
|
+
|
|
167
|
+
| Rule | Integration |
|
|
168
|
+
|------|-------------|
|
|
169
|
+
| R009 | Max 4 parallel nodes; independent nodes MUST parallelize |
|
|
170
|
+
| R010 | DAG scheduler runs only in orchestrator |
|
|
171
|
+
| R015 | Display DAG plan before execution |
|
|
172
|
+
| R018 | 3+ parallel nodes → check Agent Teams eligibility |
|
|
173
|
+
| model-escalation | Node failures feed into task-outcome-recorder |
|
|
174
|
+
| stuck-recovery | Repeated node failures trigger stuck detection |
|
|
175
|
+
|
|
176
|
+
## Inline DAG
|
|
177
|
+
|
|
178
|
+
For ad-hoc workflows without a YAML file:
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
[DAG Plan]
|
|
182
|
+
1. analyze (Explore:haiku)
|
|
183
|
+
2. implement (lang-typescript-expert:sonnet) ← depends: 1
|
|
184
|
+
3. test (qa-engineer:sonnet) ← depends: 2
|
|
185
|
+
4. review (lang-typescript-expert:opus) ← depends: 2
|
|
186
|
+
5. commit (mgr-gitnerd:sonnet) ← depends: 3, 4
|
|
187
|
+
|
|
188
|
+
Execute? [Y/n]
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The orchestrator builds the DAG from this inline format and executes using the same algorithm.
|
|
192
|
+
|
|
193
|
+
## Limitations
|
|
194
|
+
|
|
195
|
+
- No cycles allowed (DAG = acyclic)
|
|
196
|
+
- Max 20 nodes per workflow (complexity guard)
|
|
197
|
+
- Nested DAGs not supported (flatten instead)
|
|
198
|
+
- Cross-workflow dependencies not supported
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: model-escalation
|
|
3
|
+
description: Advisory model escalation based on task outcome tracking
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Model Escalation Skill
|
|
7
|
+
|
|
8
|
+
Tracks task outcomes and advises model upgrades when failures are detected. **Advisory-only** — the orchestrator makes the final decision (R010).
|
|
9
|
+
|
|
10
|
+
## Escalation Path
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
haiku → sonnet → opus
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Trigger Conditions
|
|
17
|
+
|
|
18
|
+
| Condition | Action |
|
|
19
|
+
|-----------|--------|
|
|
20
|
+
| 2+ failures with same model for same agent type | Advise escalation |
|
|
21
|
+
| 3+ consecutive failures across any agent type | Advise global escalation |
|
|
22
|
+
| Sustained success after escalation | Advise de-escalation |
|
|
23
|
+
|
|
24
|
+
## Thresholds
|
|
25
|
+
|
|
26
|
+
| Parameter | Default | Description |
|
|
27
|
+
|-----------|---------|-------------|
|
|
28
|
+
| `failure_threshold` | 2 | Failures before escalation advisory |
|
|
29
|
+
| `consecutive_threshold` | 3 | Consecutive failures for global advisory |
|
|
30
|
+
| `cooldown_tasks` | 5 | Successes before de-escalation advisory |
|
|
31
|
+
|
|
32
|
+
## Cost Guard
|
|
33
|
+
|
|
34
|
+
- Advisory includes estimated cost multiplier
|
|
35
|
+
- De-escalation suggested after sustained success at higher tier
|
|
36
|
+
- Cost tracked per session via PPID-scoped temp file
|
|
37
|
+
|
|
38
|
+
## Architecture
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
PostToolUse (Task) → task-outcome-recorder.sh
|
|
42
|
+
Records: agent_type, model, success/failure, error_summary
|
|
43
|
+
Storage: /tmp/.claude-task-outcomes-$PPID (JSON lines, max 50)
|
|
44
|
+
|
|
45
|
+
PreToolUse (Task) → model-escalation-advisor.sh
|
|
46
|
+
Reads outcomes → counts failures → advises escalation via stderr
|
|
47
|
+
Advisory only — never blocks, never modifies tool input
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Advisory Format
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
--- [Model Escalation Advisory] ---
|
|
54
|
+
Agent type: {agent_type}
|
|
55
|
+
Current model: {current_model}
|
|
56
|
+
Recent failures: {count}/{threshold}
|
|
57
|
+
⚡ Recommended: Escalate to {next_model}
|
|
58
|
+
Cost impact: {multiplier} per task
|
|
59
|
+
---
|
|
60
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stuck-recovery
|
|
3
|
+
description: Detect stuck loops and advise recovery strategies
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Stuck Recovery Skill
|
|
7
|
+
|
|
8
|
+
Detects when tasks are stuck in repetitive failure loops and advises recovery strategies. **Advisory-only** — the orchestrator decides the action (R010).
|
|
9
|
+
|
|
10
|
+
## Detection Signals
|
|
11
|
+
|
|
12
|
+
| Signal | Pattern | Threshold |
|
|
13
|
+
|--------|---------|-----------|
|
|
14
|
+
| Repeated error | Same error message appears 3+ times | 3 occurrences |
|
|
15
|
+
| Edit loop | Same file edited 3+ times in sequence | 3 edits |
|
|
16
|
+
| Agent retry | Same agent_type fails 3+ times consecutively | 3 failures |
|
|
17
|
+
| Tool loop | Same tool called 5+ times with similar input | 5 calls |
|
|
18
|
+
|
|
19
|
+
## Recovery Strategies
|
|
20
|
+
|
|
21
|
+
| Strategy | When | Action |
|
|
22
|
+
|----------|------|--------|
|
|
23
|
+
| Fresh context | Repeated same error | Suggest rephrasing the task |
|
|
24
|
+
| Model escalation | Agent retry loop | Trigger model-escalation advisory |
|
|
25
|
+
| Alternative approach | Edit loop detected | Suggest different file/method |
|
|
26
|
+
| Human intervention | All automated strategies exhausted | Ask user for guidance |
|
|
27
|
+
|
|
28
|
+
## Architecture
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
PostToolUse (Edit, Write, Bash, Task) → stuck-detector.sh
|
|
32
|
+
Tracks: tool_name, file_path, error_hash, agent_type
|
|
33
|
+
Storage: /tmp/.claude-tool-history-$PPID (JSON lines, max 100)
|
|
34
|
+
Detection: sliding window pattern matching
|
|
35
|
+
Output: stderr advisory when loop detected
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Advisory Format
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
--- [Stuck Detection] Loop detected ---
|
|
42
|
+
Signal: {signal_type}
|
|
43
|
+
Pattern: {description}
|
|
44
|
+
Occurrences: {count}/{threshold}
|
|
45
|
+
💡 Recovery: {suggested_strategy}
|
|
46
|
+
---
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Integration
|
|
50
|
+
|
|
51
|
+
- Complements model-escalation skill (escalation is one recovery strategy)
|
|
52
|
+
- Respects R010 (advisory only, orchestrator decides)
|
|
53
|
+
- Uses same PPID-scoped temp file pattern as other hooks
|
|
54
|
+
- Works with task-outcome-recorder.sh data when available
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-decomposition
|
|
3
|
+
description: Auto-decompose large tasks into DAG-compatible parallel subtasks
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task Decomposition Skill
|
|
7
|
+
|
|
8
|
+
Analyzes task complexity and decomposes large tasks into smaller, parallelizable subtasks compatible with the DAG orchestration skill. The orchestrator uses this as a planning frontend before execution.
|
|
9
|
+
|
|
10
|
+
## Trigger Conditions
|
|
11
|
+
|
|
12
|
+
Decomposition is **recommended** when any of these thresholds are met:
|
|
13
|
+
|
|
14
|
+
| Trigger | Threshold | Rationale |
|
|
15
|
+
|---------|-----------|-----------|
|
|
16
|
+
| Estimated duration | > 30 minutes | Too long for single agent |
|
|
17
|
+
| Files affected | > 3 files | Parallelizable across files |
|
|
18
|
+
| Domains involved | > 2 domains | Requires multiple specialists |
|
|
19
|
+
| Agent types needed | > 2 types | Cross-specialty coordination |
|
|
20
|
+
|
|
21
|
+
## Decomposition Process
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
1. Analyze task scope
|
|
25
|
+
├── Estimate duration, file count, domains
|
|
26
|
+
├── Identify required agent types
|
|
27
|
+
└── Check trigger thresholds
|
|
28
|
+
|
|
29
|
+
2. If thresholds met → decompose:
|
|
30
|
+
├── Break into atomic subtasks (single agent, single concern)
|
|
31
|
+
├── Identify dependencies between subtasks
|
|
32
|
+
├── Map subtasks to agents (use routing skills)
|
|
33
|
+
└── Generate DAG workflow spec
|
|
34
|
+
|
|
35
|
+
3. Present plan to user (R015 transparency)
|
|
36
|
+
├── Show decomposed subtasks with agents
|
|
37
|
+
├── Show dependency graph
|
|
38
|
+
├── Show estimated parallel execution time
|
|
39
|
+
└── Request confirmation before execution
|
|
40
|
+
|
|
41
|
+
4. Execute via dag-orchestration skill
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Decomposition Heuristics
|
|
45
|
+
|
|
46
|
+
### By File Independence
|
|
47
|
+
```
|
|
48
|
+
Task: "Update auth module across 5 files"
|
|
49
|
+
├── auth.ts → lang-typescript-expert
|
|
50
|
+
├── middleware.ts → lang-typescript-expert
|
|
51
|
+
├── config.ts → lang-typescript-expert (independent)
|
|
52
|
+
├── auth.test.ts → qa-engineer (depends: auth.ts)
|
|
53
|
+
└── README.md → arch-documenter (depends: all above)
|
|
54
|
+
|
|
55
|
+
DAG: [auth.ts, middleware.ts, config.ts] → auth.test.ts → README.md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### By Domain Separation
|
|
59
|
+
```
|
|
60
|
+
Task: "Add user profile feature with API and UI"
|
|
61
|
+
├── API endpoint → be-express-expert
|
|
62
|
+
├── Database schema → db-postgres-expert
|
|
63
|
+
├── Frontend component → fe-vercel-agent
|
|
64
|
+
└── Integration test → qa-engineer
|
|
65
|
+
|
|
66
|
+
DAG: [API, DB] → Frontend → Integration test
|
|
67
|
+
(API and DB are independent, Frontend needs both)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### By Layer
|
|
71
|
+
```
|
|
72
|
+
Task: "Implement order processing in Spring Boot"
|
|
73
|
+
├── Domain model → lang-kotlin-expert
|
|
74
|
+
├── Repository → be-springboot-expert (depends: domain)
|
|
75
|
+
├── Service → be-springboot-expert (depends: domain, repository)
|
|
76
|
+
├── Controller → be-springboot-expert (depends: service)
|
|
77
|
+
└── Tests → qa-engineer (depends: all)
|
|
78
|
+
|
|
79
|
+
DAG: domain → [repository] → service → controller → tests
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Output Format
|
|
83
|
+
|
|
84
|
+
### Decomposition Plan
|
|
85
|
+
```
|
|
86
|
+
[Task Decomposition]
|
|
87
|
+
├── Original: "Add user authentication with JWT"
|
|
88
|
+
├── Complexity: High (4 files, 3 domains, ~45 min)
|
|
89
|
+
├── Decomposed into 5 subtasks:
|
|
90
|
+
│
|
|
91
|
+
│ [1] analyze (Explore:haiku)
|
|
92
|
+
│ Scan codebase for existing auth patterns
|
|
93
|
+
│
|
|
94
|
+
│ [2] implement-auth (lang-typescript-expert:sonnet)
|
|
95
|
+
│ Implement JWT signing and validation
|
|
96
|
+
│ Depends: [1]
|
|
97
|
+
│
|
|
98
|
+
│ [3] implement-middleware (lang-typescript-expert:sonnet)
|
|
99
|
+
│ Create auth middleware
|
|
100
|
+
│ Depends: [1]
|
|
101
|
+
│
|
|
102
|
+
│ [4] write-tests (qa-engineer:sonnet)
|
|
103
|
+
│ Write auth tests
|
|
104
|
+
│ Depends: [2, 3]
|
|
105
|
+
│
|
|
106
|
+
│ [5] commit (mgr-gitnerd:sonnet)
|
|
107
|
+
│ Commit all changes
|
|
108
|
+
│ Depends: [4]
|
|
109
|
+
│
|
|
110
|
+
├── Parallel layers: 3 (max 2 concurrent in layer 2)
|
|
111
|
+
├── Estimated time: ~20 min (vs ~45 min sequential)
|
|
112
|
+
└── Proceed? [Y/n]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Generated DAG Spec
|
|
116
|
+
```yaml
|
|
117
|
+
workflow:
|
|
118
|
+
name: auto-decomposed-auth
|
|
119
|
+
description: "Auto-decomposed: Add user authentication with JWT"
|
|
120
|
+
|
|
121
|
+
nodes:
|
|
122
|
+
- id: analyze
|
|
123
|
+
agent: Explore
|
|
124
|
+
model: haiku
|
|
125
|
+
prompt: "Scan codebase for existing auth patterns"
|
|
126
|
+
- id: implement-auth
|
|
127
|
+
agent: lang-typescript-expert
|
|
128
|
+
model: sonnet
|
|
129
|
+
prompt: "Implement JWT signing and validation"
|
|
130
|
+
depends_on: [analyze]
|
|
131
|
+
- id: implement-middleware
|
|
132
|
+
agent: lang-typescript-expert
|
|
133
|
+
model: sonnet
|
|
134
|
+
prompt: "Create auth middleware"
|
|
135
|
+
depends_on: [analyze]
|
|
136
|
+
- id: write-tests
|
|
137
|
+
agent: qa-engineer
|
|
138
|
+
model: sonnet
|
|
139
|
+
prompt: "Write auth tests"
|
|
140
|
+
depends_on: [implement-auth, implement-middleware]
|
|
141
|
+
- id: commit
|
|
142
|
+
agent: mgr-gitnerd
|
|
143
|
+
model: sonnet
|
|
144
|
+
prompt: "Commit all changes"
|
|
145
|
+
depends_on: [write-tests]
|
|
146
|
+
|
|
147
|
+
config:
|
|
148
|
+
max_parallel: 4
|
|
149
|
+
failure_strategy: stop
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Atomic Task Criteria
|
|
153
|
+
|
|
154
|
+
A subtask is **atomic** when it meets ALL of:
|
|
155
|
+
- Single agent can handle it
|
|
156
|
+
- Single concern (one logical change)
|
|
157
|
+
- Independently testable outcome
|
|
158
|
+
- < 15 minutes estimated duration
|
|
159
|
+
- < 3 files affected
|
|
160
|
+
|
|
161
|
+
If a subtask is not atomic → decompose further (max 2 levels deep).
|
|
162
|
+
|
|
163
|
+
## Skip Decomposition When
|
|
164
|
+
|
|
165
|
+
| Condition | Reason |
|
|
166
|
+
|-----------|--------|
|
|
167
|
+
| Single file edit | Already atomic |
|
|
168
|
+
| < 10 minutes estimated | Overhead not worth it |
|
|
169
|
+
| User explicitly requests "just do it" | User override |
|
|
170
|
+
| Single domain, single agent | No parallelization benefit |
|
|
171
|
+
|
|
172
|
+
## Integration
|
|
173
|
+
|
|
174
|
+
| Component | Integration |
|
|
175
|
+
|-----------|-------------|
|
|
176
|
+
| dag-orchestration | Generates DAG specs consumed by dag-orchestration |
|
|
177
|
+
| Routing skills | Uses dev-lead/de-lead/qa-lead routing for agent mapping |
|
|
178
|
+
| R009 | Maximizes parallelization within max-4 limit |
|
|
179
|
+
| R010 | Decomposition happens in orchestrator only |
|
|
180
|
+
| R015 | Plan displayed before execution for user approval |
|
|
181
|
+
| R018 | 3+ agents in plan → check Agent Teams eligibility |
|