claude-mcp-workflow 0.1.8 → 0.1.9
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/.claude-plugin/plugin.json +4 -2
- package/README.md +37 -0
- package/build/engine.d.ts +13 -1
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +41 -2
- package/build/engine.js.map +1 -1
- package/build/types.d.ts +20 -20
- package/build/types.js +1 -1
- package/build/types.js.map +1 -1
- package/hooks/hooks.json +4 -2
- package/hooks/workflow-cleanup.sh +8 -4
- package/hooks/workflow-start.sh +60 -32
- package/package.json +1 -1
- package/templates/bug-fix.yaml +98 -16
- package/templates/code-review.yaml +30 -12
- package/templates/coding.yaml +49 -4
- package/templates/debugging.yaml +39 -14
- package/templates/explore.yaml +48 -14
- package/templates/file-code.yaml +13 -4
- package/templates/file-review.yaml +25 -6
- package/templates/github-init.yaml +24 -8
- package/templates/investigate.yaml +13 -4
- package/templates/master.yaml +16 -13
- package/templates/new-feature.yaml +24 -26
- package/templates/planning.yaml +34 -7
- package/templates/reflection.yaml +11 -4
- package/templates/review-push.yaml +26 -7
- package/templates/skills/architecture/SKILL.md +131 -1
- package/templates/skills/aws-lambda/SKILL.md +9 -9
- package/templates/skills/browser-verify/SKILL.md +58 -0
- package/templates/skills/build-cmake/SKILL.md +24 -8
- package/templates/skills/ci-github-actions/SKILL.md +34 -18
- package/templates/skills/claude-code-config/SKILL.md +41 -19
- package/templates/skills/cleanup/SKILL.md +57 -0
- package/templates/skills/coding-skill-selector/SKILL.md +2 -1
- package/templates/skills/debug-bridge-scaffold/SKILL.md +98 -0
- package/templates/skills/domain-gamedev/SKILL.md +56 -6
- package/templates/skills/domain-pixi/SKILL.md +256 -7
- package/templates/skills/domain-reid/SKILL.md +39 -5
- package/templates/skills/domain-yolo/SKILL.md +18 -7
- package/templates/skills/ide-zed/SKILL.md +23 -0
- package/templates/skills/lang-as3/SKILL.md +7 -5
- package/templates/skills/lang-haxe/SKILL.md +538 -19
- package/templates/skills/lang-python/SKILL.md +6 -2
- package/templates/skills/math/SKILL.md +64 -2
- package/templates/skills/mcp-setup/SKILL.md +14 -2
- package/templates/skills/preferences/SKILL.md +10 -10
- package/templates/skills/skill-manager/SKILL.md +264 -0
- package/templates/skills/target-openfl-native/SKILL.md +52 -17
- package/templates/skills/target-openfl-native/references/build-and-versions.md +7 -4
- package/templates/skills/task-delegation/SKILL.md +76 -4
- package/templates/skills/web-reading/SKILL.md +33 -25
- package/templates/skills/workflow-authoring/SKILL.md +47 -12
- package/templates/subagent.yaml +29 -8
- package/templates/testing.yaml +64 -10
- package/templates/web-research.yaml +23 -13
package/templates/debugging.yaml
CHANGED
|
@@ -37,10 +37,14 @@ states:
|
|
|
37
37
|
- When it started happening
|
|
38
38
|
- Any recent changes
|
|
39
39
|
|
|
40
|
+
If there is no interactive user (you are running as a subagent), do NOT ask — state your assumptions and continue, or take the failure path.
|
|
41
|
+
|
|
40
42
|
Choose transition:
|
|
41
43
|
- `got_info` → have enough info to try reproducing again
|
|
44
|
+
- `escalate` → no way to get more information; give up
|
|
42
45
|
transitions:
|
|
43
46
|
got_info: reproduce
|
|
47
|
+
escalate: escalated
|
|
44
48
|
|
|
45
49
|
hypothesize:
|
|
46
50
|
prompt: |
|
|
@@ -51,21 +55,35 @@ states:
|
|
|
51
55
|
|
|
52
56
|
Choose transition:
|
|
53
57
|
- `trace` → ready to add targeted traces to test hypotheses
|
|
58
|
+
- `escalate` → out of hypotheses (or trace budget exhausted); report findings
|
|
54
59
|
transitions:
|
|
55
60
|
trace: trace
|
|
61
|
+
escalate: escalated
|
|
56
62
|
|
|
57
63
|
trace:
|
|
58
64
|
max_visits: 5
|
|
59
65
|
prompt: |
|
|
60
66
|
Add 3-5 targeted traces with unique prefixes (`[DBG1]`, `[DBG2]`).
|
|
61
67
|
|
|
62
|
-
Delegate to `general-purpose` subagent
|
|
63
|
-
|
|
68
|
+
Delegate the build+run to a flat `general-purpose` subagent
|
|
69
|
+
(build/run/report — no workflow, no skills) to keep build output
|
|
70
|
+
out of main context: give it the build command, run command, what
|
|
71
|
+
to look for, and a timeout.
|
|
72
|
+
A flat subagent inherits none of this project's skills or env
|
|
73
|
+
rules — it only knows what YOU put in its spawn prompt. So include
|
|
74
|
+
VERBATIM in that prompt: (a) any tooling/hook constraints that
|
|
75
|
+
apply in this project (required CLIs, blocked commands), and
|
|
76
|
+
(b) "Strip noise, but quote every error, failing assertion, and
|
|
77
|
+
number VERBATIM — don't paraphrase the signal or replace it with
|
|
78
|
+
a verdict; the parent judges."
|
|
79
|
+
Spawn with `run_in_background: false` — you need the result before transitioning.
|
|
64
80
|
|
|
65
81
|
**Anti-patterns:**
|
|
66
82
|
- Running builds in main context (100KB+ noise)
|
|
67
83
|
- Adding Mutex/volatile "just in case" — masks real problem
|
|
68
84
|
|
|
85
|
+
Budget: 5 visits to this state (engine-enforced); when nearly exhausted, choose `escalate` instead of retrying.
|
|
86
|
+
|
|
69
87
|
Choose transition:
|
|
70
88
|
- `found` → root cause identified
|
|
71
89
|
- `more_traces` → need more data
|
|
@@ -74,29 +92,35 @@ states:
|
|
|
74
92
|
transitions:
|
|
75
93
|
found: diagnosed
|
|
76
94
|
more_traces: trace
|
|
77
|
-
bridge:
|
|
95
|
+
bridge: load_skills_bridge
|
|
78
96
|
escalate: escalated
|
|
79
97
|
|
|
98
|
+
load_skills_bridge:
|
|
99
|
+
skills:
|
|
100
|
+
- ?debug-bridge
|
|
101
|
+
transitions:
|
|
102
|
+
continue: bridge_debug
|
|
103
|
+
|
|
80
104
|
bridge_debug:
|
|
81
105
|
prompt: |
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Use debug bridge for interactive state inspection.
|
|
86
|
-
Launch `general-purpose` subagent. Inspect state, take screenshots, simulate events.
|
|
106
|
+
Use the debug bridge for interactive state inspection.
|
|
107
|
+
Launch a `general-purpose` subagent to build and launch the app.
|
|
108
|
+
Inspect state, take screenshots, simulate events.
|
|
87
109
|
|
|
88
110
|
Choose transition:
|
|
89
111
|
- `found` → root cause identified via bridge
|
|
90
112
|
- `back_to_trace` → need more code-level tracing
|
|
113
|
+
- `escalate` → bridge inspection exhausted (or trace budget spent); report findings
|
|
91
114
|
transitions:
|
|
92
115
|
found: diagnosed
|
|
93
116
|
back_to_trace: trace
|
|
117
|
+
escalate: escalated
|
|
94
118
|
|
|
95
119
|
diagnosed:
|
|
96
120
|
prompt: |
|
|
97
121
|
Root cause identified. Present diagnosis to the user, then decide:
|
|
98
122
|
- Trivial fix (1-2 lines, obvious, no risk) → `fix`
|
|
99
|
-
- Significant changes needed → `done` (exit to
|
|
123
|
+
- Significant changes needed → `done` (exit to parent workflow; user decides next)
|
|
100
124
|
- Unclear scope or trade-offs → `ask_user`
|
|
101
125
|
transitions:
|
|
102
126
|
fix: fix
|
|
@@ -106,9 +130,11 @@ states:
|
|
|
106
130
|
ask_user:
|
|
107
131
|
prompt: |
|
|
108
132
|
Present findings and trade-offs. Ask user how to proceed:
|
|
109
|
-
- Quick fix here?
|
|
110
|
-
- Plan a bigger change?
|
|
111
|
-
- More investigation needed?
|
|
133
|
+
- Quick fix here? → `fix`
|
|
134
|
+
- Plan a bigger change? → `done` (exit to parent workflow)
|
|
135
|
+
- More investigation needed? → `investigate`
|
|
136
|
+
|
|
137
|
+
If there is no interactive user (you are running as a subagent), do NOT ask — state your assumptions and continue, or take the failure path.
|
|
112
138
|
transitions:
|
|
113
139
|
fix: fix
|
|
114
140
|
done: done
|
|
@@ -159,8 +185,7 @@ states:
|
|
|
159
185
|
|
|
160
186
|
escalated:
|
|
161
187
|
prompt: |
|
|
162
|
-
Could not diagnose the root cause
|
|
163
|
-
Report findings to the user:
|
|
188
|
+
Could not diagnose the root cause. Report findings to the user:
|
|
164
189
|
- What was tried
|
|
165
190
|
- What was ruled out
|
|
166
191
|
- Remaining hypotheses
|
package/templates/explore.yaml
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
name: explore
|
|
2
2
|
description: "Codebase exploration workflow — understand structure, trace code, find patterns"
|
|
3
|
-
initial:
|
|
3
|
+
initial: load_skills
|
|
4
4
|
max_transitions: 20
|
|
5
5
|
|
|
6
6
|
states:
|
|
7
|
+
load_skills:
|
|
8
|
+
skills:
|
|
9
|
+
- coding-skill-selector
|
|
10
|
+
- ?project-skill-selector
|
|
11
|
+
transitions:
|
|
12
|
+
continue: scope
|
|
13
|
+
|
|
7
14
|
scope:
|
|
8
15
|
prompt: |
|
|
9
16
|
Determine what we're looking for and where.
|
|
@@ -26,16 +33,45 @@ states:
|
|
|
26
33
|
Explore the codebase using available tools.
|
|
27
34
|
|
|
28
35
|
**Preferred approach:**
|
|
29
|
-
- Launch parallel
|
|
36
|
+
- Launch parallel subagents for independent questions. Location-only
|
|
37
|
+
fan-out (find files/symbols, paste back what's there, zero judgement)
|
|
38
|
+
may use flat `Explore`-type agents; any agent that returns judgement,
|
|
39
|
+
analysis, or a recommendation is ANALYTICAL — never spawn it flat,
|
|
40
|
+
use the VERBATIM preamble below.
|
|
30
41
|
- Use Glob to find files by pattern
|
|
31
|
-
-
|
|
32
|
-
|
|
42
|
+
- For "where is X / what is X's shape / which decls carry Y" use the
|
|
43
|
+
STRUCTURAL navigation tool your loaded skills prescribe for the
|
|
44
|
+
language (a parser-aware query CLI, LSP, etc.) — NOT grep — when
|
|
45
|
+
one exists. Grep/Read only for non-parsing files or prose inside
|
|
46
|
+
comments/strings. The loaded coding skills are authoritative here;
|
|
47
|
+
follow the tool-usage gate defined by the loaded skills, do not
|
|
48
|
+
default to grep.
|
|
49
|
+
- Use Read to examine specific files — targeted (offset/limit on the
|
|
50
|
+
located window), never a blind whole-file dump as a grep substitute
|
|
33
51
|
|
|
34
52
|
**Rules:**
|
|
35
|
-
-
|
|
53
|
+
- Locate with the structural tool first, then narrow with Read
|
|
36
54
|
- Follow imports and call chains to understand flow
|
|
37
55
|
- Note key files, patterns, and architectural decisions
|
|
38
56
|
|
|
57
|
+
For an ANALYTICAL subagent, include in its prompt VERBATIM:
|
|
58
|
+
---
|
|
59
|
+
IMPORTANT: Override the default CLAUDE.md rule about start().
|
|
60
|
+
Do NOT call start() without arguments.
|
|
61
|
+
Instead, your FIRST action must be:
|
|
62
|
+
mcp__plugin_workflow_wf__start({ workflow: "subagent", parent_session_id: "<SESSION_ID>" })
|
|
63
|
+
where <SESSION_ID> is the current session ID (substitute it before sending).
|
|
64
|
+
Then follow the subagent workflow until completion — its `route` state
|
|
65
|
+
self-classifies (analytical → skill-loaded sub-workflow; trivial → execute).
|
|
66
|
+
start() returns `SESSION: <id>` — pass that session_id explicitly in every
|
|
67
|
+
subsequent workflow tool call; parallel siblings share the same ppid.
|
|
68
|
+
---
|
|
69
|
+
After collecting reports: `sessions` → `abort` orphaned child `subagent`
|
|
70
|
+
sessions.
|
|
71
|
+
|
|
72
|
+
Budget: 4 visits to this state (engine-enforced); when nearly exhausted,
|
|
73
|
+
choose `not_found` instead of retrying.
|
|
74
|
+
|
|
39
75
|
Choose transition:
|
|
40
76
|
- `found` → gathered enough information to answer
|
|
41
77
|
- `deeper` → need to explore further (follow a lead, check another area)
|
|
@@ -55,6 +91,9 @@ states:
|
|
|
55
91
|
Present what you've found so far concisely, then ask your question(s).
|
|
56
92
|
Use AskUserQuestion for critical decisions that affect the direction of exploration.
|
|
57
93
|
|
|
94
|
+
If there is no interactive user (you are running as a subagent), do NOT
|
|
95
|
+
ask — state your assumptions and continue, or take the failure path.
|
|
96
|
+
|
|
58
97
|
After getting user's answer → transition `continue` to resume investigation
|
|
59
98
|
with the new context, or `enough` if the answer completes the picture.
|
|
60
99
|
transitions:
|
|
@@ -73,18 +112,13 @@ states:
|
|
|
73
112
|
|
|
74
113
|
If this reveals a recurring knowledge gap → note it for reflection.
|
|
75
114
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
115
|
+
When the synthesis is presented → transition `done`. If the findings
|
|
116
|
+
indicate code changes, say so in the synthesis — the parent workflow
|
|
117
|
+
decides what happens next.
|
|
79
118
|
transitions:
|
|
80
119
|
done: done
|
|
81
|
-
needs_action: needs_action
|
|
82
|
-
|
|
83
|
-
needs_action:
|
|
84
|
-
prompt: "Exploration complete. Findings indicate action is needed."
|
|
85
|
-
terminal: true
|
|
86
|
-
outcome: needs_action
|
|
87
120
|
|
|
88
121
|
done:
|
|
89
122
|
prompt: "Codebase exploration complete."
|
|
90
123
|
terminal: true
|
|
124
|
+
outcome: complete
|
package/templates/file-code.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: file-code
|
|
2
|
-
description: "Per-file coding — spawned by coding/bug-fix for each file
|
|
2
|
+
description: "Per-file coding — spawned as an agent by coding/bug-fix for each file, or run inline as a sub-workflow for a single file"
|
|
3
3
|
initial: load_skills
|
|
4
4
|
max_transitions: 25
|
|
5
5
|
|
|
@@ -15,7 +15,8 @@ states:
|
|
|
15
15
|
task: "Understand file context"
|
|
16
16
|
prompt: |
|
|
17
17
|
You are implementing changes in a single file as part of a larger task.
|
|
18
|
-
The file path, plan, and interface contracts
|
|
18
|
+
The file path, plan, and interface contracts come from your task prompt
|
|
19
|
+
(spawned agent) or from the conversation so far (inline sub-workflow).
|
|
19
20
|
|
|
20
21
|
1. Read the existing file (if it exists) to understand current structure.
|
|
21
22
|
2. Read related files: imports, callers, siblings in the same module.
|
|
@@ -35,7 +36,8 @@ states:
|
|
|
35
36
|
- Loaded preference/style skills
|
|
36
37
|
- Existing patterns in the file and its neighbors
|
|
37
38
|
|
|
38
|
-
Check original before changing: `git
|
|
39
|
+
Check the original before changing: `git show HEAD:<file>` shows the
|
|
40
|
+
pre-change content (original values, structure).
|
|
39
41
|
|
|
40
42
|
Write the code, then → transition `done`.
|
|
41
43
|
transitions:
|
|
@@ -71,5 +73,12 @@ states:
|
|
|
71
73
|
**Interface notes**: <how this file connects to others — exports, imports, contracts satisfied>
|
|
72
74
|
**Concerns**: <anything the parent agent should verify — edge cases, assumptions, integration risks>
|
|
73
75
|
|
|
74
|
-
Output this report as your final response
|
|
76
|
+
Output this report — as your final response (spawned agent) or into the
|
|
77
|
+
conversation for the parent workflow (inline sub-workflow).
|
|
78
|
+
Then → transition `done`.
|
|
79
|
+
transitions:
|
|
80
|
+
done: finish
|
|
81
|
+
|
|
82
|
+
finish:
|
|
75
83
|
terminal: true
|
|
84
|
+
outcome: complete
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: file-review
|
|
2
|
-
description: "Per-file deep review — spawned
|
|
2
|
+
description: "Per-file deep review — spawned as an agent for each changed file, or run inline as a sub-workflow for a single file"
|
|
3
3
|
initial: load_skills
|
|
4
4
|
max_transitions: 25
|
|
5
5
|
|
|
@@ -15,7 +15,8 @@ states:
|
|
|
15
15
|
task: "Read file and context"
|
|
16
16
|
prompt: |
|
|
17
17
|
You are reviewing a single file as part of a code review.
|
|
18
|
-
The file path and diff info
|
|
18
|
+
The file path and diff info come from your task prompt (spawned agent)
|
|
19
|
+
or from the conversation so far (inline sub-workflow).
|
|
19
20
|
|
|
20
21
|
1. Read the diff for this file to understand what changed.
|
|
21
22
|
2. Check the review scope from your task prompt:
|
|
@@ -66,7 +67,8 @@ states:
|
|
|
66
67
|
|
|
67
68
|
Otherwise (user-authored), build a concrete style checklist from loaded skills:
|
|
68
69
|
|
|
69
|
-
Process
|
|
70
|
+
Process the bare `preferences` skill plus each loaded `lang-*` and
|
|
71
|
+
`preferences-*` skill ONE AT A TIME.
|
|
70
72
|
For each skill:
|
|
71
73
|
1. Re-read the FULL skill text
|
|
72
74
|
2. Extract EVERY rule — each `// WRONG` example, explicit rule, or convention
|
|
@@ -76,6 +78,10 @@ states:
|
|
|
76
78
|
Do NOT summarize, group, or prioritize — every rule matters equally.
|
|
77
79
|
If your total is under 25 rules across all skills, you missed some — re-read.
|
|
78
80
|
|
|
81
|
+
Escape hatch: if NO lang/preferences skills apply to this file type
|
|
82
|
+
(e.g. config, YAML, docs), state so explicitly and continue — the
|
|
83
|
+
language-agnostic checks in the following states still run.
|
|
84
|
+
|
|
79
85
|
Output the full checklist, then → transition `done`.
|
|
80
86
|
transitions:
|
|
81
87
|
done: check_correctness
|
|
@@ -110,7 +116,11 @@ states:
|
|
|
110
116
|
|
|
111
117
|
Line <N>: `<the loop header>` — iterates <what> to access <what> → verdict: ok / issue
|
|
112
118
|
|
|
113
|
-
Check each loop against these anti-patterns
|
|
119
|
+
Check each loop against these anti-patterns. The examples are
|
|
120
|
+
Haxe-flavored — translate each pattern to the file's language.
|
|
121
|
+
Rules 5-6 are personal style preferences — apply them ONLY when
|
|
122
|
+
`{{context.is_user_authored}}` is not "false" (treat empty as "true");
|
|
123
|
+
for external/forked/vendored code check rules 1-4 only.
|
|
114
124
|
|
|
115
125
|
1. **Range-over-sparse-container**: the loop iterates an index range (`0...n`,
|
|
116
126
|
`i++`) but uses the index to look up a Map/Dict/HashMap, with a null check
|
|
@@ -251,12 +261,21 @@ states:
|
|
|
251
261
|
**What changed**: <one-paragraph summary of the changes>
|
|
252
262
|
**Issues found**:
|
|
253
263
|
For each issue:
|
|
254
|
-
- Severity: bug / risk / style / nit
|
|
264
|
+
- Severity: bug / risk / style / nit / pre-existing
|
|
265
|
+
(`pre-existing` = issue outside the changed lines, found during
|
|
266
|
+
a diff-scope review — report separately, do NOT mix with diff issues)
|
|
255
267
|
- Line: <line number>
|
|
256
268
|
- Description: <what's wrong>
|
|
257
269
|
- Suggestion: <how to fix>
|
|
258
270
|
|
|
259
271
|
If no issues found, say so explicitly.
|
|
260
272
|
|
|
261
|
-
Output this report as your final response
|
|
273
|
+
Output this report — as your final response (spawned agent) or into the
|
|
274
|
+
conversation for the parent workflow (inline sub-workflow).
|
|
275
|
+
Then → transition `done`.
|
|
276
|
+
transitions:
|
|
277
|
+
done: finish
|
|
278
|
+
|
|
279
|
+
finish:
|
|
262
280
|
terminal: true
|
|
281
|
+
outcome: complete
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: github-init
|
|
2
|
-
description: "Initialize git repo and create private GitHub repository"
|
|
2
|
+
description: "Initialize git repo and create a private GitHub repository for a project not yet on GitHub"
|
|
3
3
|
initial: check_state
|
|
4
4
|
max_transitions: 20
|
|
5
5
|
|
|
@@ -9,17 +9,20 @@ states:
|
|
|
9
9
|
Check the current state of the project:
|
|
10
10
|
1. `git status` — is it already a git repo?
|
|
11
11
|
2. `gh auth status` — is GitHub CLI authenticated?
|
|
12
|
-
3.
|
|
12
|
+
3. `git remote -v` — is a GitHub remote already configured?
|
|
13
|
+
4. Check if `.gitignore` exists
|
|
13
14
|
|
|
14
15
|
Choose transition:
|
|
15
16
|
- `needs_gitignore` → not a git repo, no .gitignore
|
|
16
17
|
- `needs_init` → .gitignore exists but not a git repo
|
|
17
18
|
- `needs_repo` → already a git repo, just needs GitHub remote
|
|
19
|
+
- `already_done` → git repo with GitHub remote already set — just verify
|
|
18
20
|
- `fail` → gh CLI not authenticated or other blocker
|
|
19
21
|
transitions:
|
|
20
22
|
needs_gitignore: create_gitignore
|
|
21
23
|
needs_init: git_init
|
|
22
24
|
needs_repo: create_repo
|
|
25
|
+
already_done: verify
|
|
23
26
|
fail: failed
|
|
24
27
|
|
|
25
28
|
create_gitignore:
|
|
@@ -27,7 +30,8 @@ states:
|
|
|
27
30
|
Create `.gitignore` appropriate for the project.
|
|
28
31
|
|
|
29
32
|
Detect the project type (look at package.json, Cargo.toml, *.csproj, etc.)
|
|
30
|
-
and generate a suitable .gitignore. Always include OS artifacts (.DS_Store)
|
|
33
|
+
and generate a suitable .gitignore. Always include OS artifacts (.DS_Store)
|
|
34
|
+
and secrets: `.env*`, key files, credentials.
|
|
31
35
|
|
|
32
36
|
Ask the user if unsure what to exclude.
|
|
33
37
|
|
|
@@ -42,7 +46,10 @@ states:
|
|
|
42
46
|
2. Check for files excluded by global gitignore that should be tracked
|
|
43
47
|
(e.g. CLAUDE.md if it's part of the project). Force-add them if needed.
|
|
44
48
|
3. `git add -A`
|
|
45
|
-
4. `git
|
|
49
|
+
4. Review the staged file list (`git status`) before committing — no
|
|
50
|
+
secrets (.env files, keys, credentials) may be staged. If found,
|
|
51
|
+
unstage them and add to .gitignore.
|
|
52
|
+
5. `git commit -m "Initial commit"`
|
|
46
53
|
|
|
47
54
|
Transition `next`.
|
|
48
55
|
transitions:
|
|
@@ -52,11 +59,14 @@ states:
|
|
|
52
59
|
prompt: |
|
|
53
60
|
Create a private GitHub repo and push:
|
|
54
61
|
1. Determine repo name from the current directory name
|
|
55
|
-
2.
|
|
56
|
-
|
|
62
|
+
2. Run: `gh repo create <repo> --private --source=. --push`
|
|
63
|
+
(a bare name creates the repo under the authenticated account —
|
|
64
|
+
no username parsing needed)
|
|
57
65
|
|
|
58
66
|
If it succeeds → transition `next`.
|
|
59
|
-
If
|
|
67
|
+
If the name is already taken → retry once with a more specific name,
|
|
68
|
+
then transition `next` on success.
|
|
69
|
+
If it fails otherwise → transition `fail`.
|
|
60
70
|
transitions:
|
|
61
71
|
next: verify
|
|
62
72
|
fail: failed
|
|
@@ -66,9 +76,15 @@ states:
|
|
|
66
76
|
Verify the repo was created:
|
|
67
77
|
- `gh repo view --json isPrivate,url`
|
|
68
78
|
- `git remote -v`
|
|
69
|
-
Confirm it's private and remote is set.
|
|
79
|
+
Confirm it's private and the remote is set.
|
|
80
|
+
|
|
81
|
+
Choose transition:
|
|
82
|
+
- `next` → confirmed
|
|
83
|
+
- `fail` → verification failed (repo missing, wrong visibility, or no
|
|
84
|
+
remote) — report what exactly failed
|
|
70
85
|
transitions:
|
|
71
86
|
next: done
|
|
87
|
+
fail: failed
|
|
72
88
|
|
|
73
89
|
done:
|
|
74
90
|
prompt: "GitHub repo created and code pushed successfully."
|
|
@@ -11,8 +11,8 @@ states:
|
|
|
11
11
|
1. Extract from the user's message:
|
|
12
12
|
- **Goal**: what the user ultimately wants changed
|
|
13
13
|
- **Unknowns**: questions, uncertainties, assumptions to verify
|
|
14
|
-
(markers: "seems like", "I think", "if that's the case", "not sure",
|
|
15
|
-
"
|
|
14
|
+
(markers: "seems like", "I think", "if that's the case", "not sure",
|
|
15
|
+
"should", "?", conditional language, hedging)
|
|
16
16
|
- **Knowns**: concrete facts or behaviors stated as certain
|
|
17
17
|
|
|
18
18
|
2. Formulate 1-3 specific investigation questions to resolve the unknowns
|
|
@@ -28,7 +28,9 @@ states:
|
|
|
28
28
|
|
|
29
29
|
assess:
|
|
30
30
|
prompt: |
|
|
31
|
-
Investigation
|
|
31
|
+
Investigation finished — successfully or not (a failed exploration also
|
|
32
|
+
lands here; treat missing findings as unresolved unknowns).
|
|
33
|
+
Review findings against the original unknowns.
|
|
32
34
|
|
|
33
35
|
Present to the user:
|
|
34
36
|
1. For each unknown — what did investigation reveal?
|
|
@@ -36,17 +38,21 @@ states:
|
|
|
36
38
|
3. Recommended action and scope
|
|
37
39
|
|
|
38
40
|
Choose transition:
|
|
39
|
-
- `trivial` → fix is obvious and small (1-3 lines)
|
|
41
|
+
- `trivial` → fix is obvious and small (1-3 lines); it will be applied in
|
|
42
|
+
the quick_fix state after the skill gate — do NOT apply it here
|
|
40
43
|
**Before choosing trivial, verify ALL:**
|
|
41
44
|
☐ Only 1 file changed
|
|
42
45
|
☐ No UI positioning/layout/scaling involved (needs visual verification)
|
|
43
46
|
☐ No unknowns about API behavior in the fix path
|
|
44
47
|
If any check fails → `needs_plan`
|
|
48
|
+
- `investigate_more` → findings raised new specific questions that need
|
|
49
|
+
another exploration round
|
|
45
50
|
- `needs_plan` → changes needed but require planning (multi-file, risk, unclear scope)
|
|
46
51
|
- `no_action` → investigation showed the change is unnecessary or already works correctly
|
|
47
52
|
- `unclear` → still unclear after investigation, need user input
|
|
48
53
|
transitions:
|
|
49
54
|
trivial: load_skills
|
|
55
|
+
investigate_more: run_explore
|
|
50
56
|
needs_plan: needs_plan
|
|
51
57
|
no_action: done
|
|
52
58
|
unclear: clarify
|
|
@@ -56,6 +62,9 @@ states:
|
|
|
56
62
|
Present findings and remaining questions to the user.
|
|
57
63
|
Use AskUserQuestion for critical decisions.
|
|
58
64
|
|
|
65
|
+
If there is no interactive user (you are running as a subagent), do NOT
|
|
66
|
+
ask — state your assumptions and continue, or take the failure path.
|
|
67
|
+
|
|
59
68
|
After getting user's answer → transition based on clarity:
|
|
60
69
|
- `reassess` → re-evaluate with new info
|
|
61
70
|
- `done` → user says no action needed
|
package/templates/master.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: master
|
|
2
|
-
description: "Master workflow — single entry point
|
|
2
|
+
description: "Master workflow — single entry point. Analyzes task, loads knowledge skills, routes to process sub-workflows."
|
|
3
3
|
initial: route
|
|
4
4
|
max_transitions: 100
|
|
5
5
|
|
|
@@ -12,8 +12,8 @@ states:
|
|
|
12
12
|
|
|
13
13
|
**Step 1 — Check for project workflows.**
|
|
14
14
|
If project workflows are listed below this prompt, check if any match the
|
|
15
|
-
user's task. If a match →
|
|
16
|
-
|
|
15
|
+
user's task. If a match → set context key `project_workflow` to that
|
|
16
|
+
workflow's name, THEN transition `project`.
|
|
17
17
|
|
|
18
18
|
**Step 2 — Standard routing (only if no project workflow matched).**
|
|
19
19
|
|
|
@@ -23,7 +23,8 @@ states:
|
|
|
23
23
|
- 5+ files touched, mixed actions, cascade risk, user asks to plan
|
|
24
24
|
|
|
25
25
|
Route the user's message:
|
|
26
|
-
- understand
|
|
26
|
+
- understand how code works → explore; diagnose why behavior occurs →
|
|
27
|
+
debugging (NEVER coding for either)
|
|
27
28
|
- questions about code behavior ("will X break?", "how does Y work?",
|
|
28
29
|
"what happens when Z?") → explore (requires reading code before answering)
|
|
29
30
|
- broken behavior / suspected bug → bug_fix (EVEN with hedging language).
|
|
@@ -41,7 +42,8 @@ states:
|
|
|
41
42
|
- new feature e2e → feature
|
|
42
43
|
- restructure code, refactoring, fix formatting, cleanup, lint across files/directories → code_review
|
|
43
44
|
- review PR/code → code_review
|
|
44
|
-
- test / verify / check on device
|
|
45
|
+
- test / verify / check runtime behavior (locally, on a device, in a
|
|
46
|
+
simulator, against a running service) → testing
|
|
45
47
|
- review changes + commit + push ("review and push",
|
|
46
48
|
"check and push", "push to github") → review_push
|
|
47
49
|
- /init or "generate CLAUDE.md" or "create CLAUDE.md" → init
|
|
@@ -113,24 +115,26 @@ states:
|
|
|
113
115
|
The dynamic workflow was already created during planning.
|
|
114
116
|
|
|
115
117
|
1. Read context key `dynamic_workflow` to get the workflow name
|
|
116
|
-
2. Call `modify` to add execution state:
|
|
118
|
+
2. Call `modify` to add the execution state and its edge:
|
|
117
119
|
- add_state: {name: "run_dynamic", sub_workflow: "<workflow name>", on_complete: "doc_sync", on_fail: "doc_sync"}
|
|
118
120
|
- add_transition: {from: "create_dynamic", name: "execute", to: "run_dynamic"}
|
|
119
121
|
3. Transition `execute`
|
|
120
|
-
|
|
121
|
-
execute
|
|
122
|
+
|
|
123
|
+
The `execute` transition does not exist until the `modify` call adds it —
|
|
124
|
+
skipping step 2 makes the transition fail loudly.
|
|
122
125
|
|
|
123
126
|
run_project:
|
|
124
127
|
prompt: |
|
|
125
128
|
A project-specific workflow was selected. Wire it up dynamically:
|
|
126
129
|
|
|
127
130
|
1. Read context key `project_workflow` to get the workflow name
|
|
128
|
-
2. Call `modify` to
|
|
131
|
+
2. Call `modify` to add a new state and its edge:
|
|
129
132
|
- add_state: {name: "run_project_sub", sub_workflow: "<workflow name>", on_complete: "doc_sync", on_fail: "doc_sync"}
|
|
130
133
|
- add_transition: {from: "run_project", name: "execute", to: "run_project_sub"}
|
|
131
134
|
3. Transition `execute`
|
|
132
|
-
|
|
133
|
-
execute
|
|
135
|
+
|
|
136
|
+
The `execute` transition does not exist until the `modify` call adds it —
|
|
137
|
+
skipping step 2 makes the transition fail loudly.
|
|
134
138
|
|
|
135
139
|
run_investigate:
|
|
136
140
|
sub_workflow: investigate
|
|
@@ -183,10 +187,9 @@ states:
|
|
|
183
187
|
|
|
184
188
|
run_review_push:
|
|
185
189
|
sub_workflow: review-push
|
|
186
|
-
on_complete:
|
|
190
|
+
on_complete: doc_sync
|
|
187
191
|
on_fail: done
|
|
188
192
|
|
|
189
|
-
|
|
190
193
|
run_research:
|
|
191
194
|
sub_workflow: web-research
|
|
192
195
|
on_complete: done
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
name: new-feature
|
|
2
2
|
description: "New feature implementation workflow"
|
|
3
|
-
initial:
|
|
3
|
+
initial: check_plan
|
|
4
4
|
max_transitions: 80
|
|
5
5
|
|
|
6
6
|
states:
|
|
7
|
+
check_plan:
|
|
8
|
+
prompt: |
|
|
9
|
+
ROUTING STATE — decide where to start based on plan status.
|
|
10
|
+
|
|
11
|
+
- A plan for this feature was already approved in this conversation
|
|
12
|
+
→ transition `have_plan` (skip straight to implementation).
|
|
13
|
+
- No approved plan yet → transition `no_plan` (clarify requirements,
|
|
14
|
+
then plan).
|
|
15
|
+
transitions:
|
|
16
|
+
have_plan: implement
|
|
17
|
+
no_plan: requirements
|
|
18
|
+
|
|
7
19
|
requirements:
|
|
8
20
|
task: "Clarify requirements"
|
|
9
21
|
prompt: |
|
|
10
22
|
Clarify requirements with the user. What exactly should this feature do?
|
|
11
23
|
|
|
24
|
+
If the request is unambiguous → transition `clear` without asking anything.
|
|
25
|
+
|
|
12
26
|
**Do NOT explore the codebase here** — no Read, Grep, Glob, or Explore agents.
|
|
13
27
|
Only ask the user questions. Codebase exploration happens in the planning phase.
|
|
14
28
|
transitions:
|
|
@@ -16,35 +30,19 @@ states:
|
|
|
16
30
|
|
|
17
31
|
plan:
|
|
18
32
|
sub_workflow: planning
|
|
19
|
-
on_complete:
|
|
33
|
+
on_complete: implement
|
|
20
34
|
on_fail: requirements
|
|
21
35
|
|
|
22
|
-
load_skills:
|
|
23
|
-
skills:
|
|
24
|
-
- coding-skill-selector
|
|
25
|
-
- ?project-skill-selector
|
|
26
|
-
transitions:
|
|
27
|
-
continue: implement
|
|
28
|
-
|
|
29
36
|
implement:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
transitions:
|
|
34
|
-
done: test
|
|
35
|
-
|
|
36
|
-
test:
|
|
37
|
-
sub_workflow: testing
|
|
38
|
-
on_complete: review
|
|
39
|
-
on_fail: load_skills
|
|
40
|
-
|
|
41
|
-
review:
|
|
42
|
-
task: "Review implementation"
|
|
43
|
-
prompt: "Review the implementation. Check for edge cases, code quality, and adherence to project conventions."
|
|
44
|
-
transitions:
|
|
45
|
-
approved: done
|
|
46
|
-
changes_needed: load_skills
|
|
37
|
+
sub_workflow: coding
|
|
38
|
+
on_complete: done
|
|
39
|
+
on_fail: failed
|
|
47
40
|
|
|
48
41
|
done:
|
|
49
42
|
prompt: "Feature implemented, tested, and reviewed."
|
|
50
43
|
terminal: true
|
|
44
|
+
outcome: complete
|
|
45
|
+
|
|
46
|
+
failed:
|
|
47
|
+
terminal: true
|
|
48
|
+
outcome: fail
|