claude-mcp-workflow 0.1.7 → 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 +39 -2
- package/build/engine.d.ts +21 -1
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +59 -6
- package/build/engine.js.map +1 -1
- package/build/storage.d.ts +20 -0
- package/build/storage.d.ts.map +1 -1
- package/build/storage.js +41 -0
- package/build/storage.js.map +1 -1
- package/build/types.d.ts +21 -20
- package/build/types.d.ts.map +1 -1
- package/build/types.js +2 -1
- package/build/types.js.map +1 -1
- package/hooks/hooks.json +4 -2
- package/hooks/workflow-cleanup.sh +58 -20
- 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 +38 -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/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
|
package/templates/planning.yaml
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
name: planning
|
|
2
2
|
description: "Planning sub-workflow — explore, design plan, record workflow context"
|
|
3
|
-
initial:
|
|
3
|
+
initial: load_skills
|
|
4
4
|
max_transitions: 30
|
|
5
5
|
|
|
6
6
|
states:
|
|
7
|
+
load_skills:
|
|
8
|
+
skills:
|
|
9
|
+
- coding-skill-selector
|
|
10
|
+
- ?project-skill-selector
|
|
11
|
+
transitions:
|
|
12
|
+
continue: explore_needed
|
|
13
|
+
|
|
7
14
|
explore_needed:
|
|
8
15
|
prompt: |
|
|
9
16
|
Determine if codebase exploration is needed before planning.
|
|
@@ -24,10 +31,15 @@ states:
|
|
|
24
31
|
on_fail: design
|
|
25
32
|
|
|
26
33
|
design:
|
|
34
|
+
# The Resume line in the plan-file template below — `transition("<session_id>", "planned")`
|
|
35
|
+
# — is load-bearing: hooks/workflow-start.sh regex-matches this exact positional
|
|
36
|
+
# form (transition\(\\"[a-f0-9]+\\") to recover the session ID on plan resume.
|
|
37
|
+
# Keep it EXACTLY as is; do not normalize to named arguments.
|
|
27
38
|
prompt: |
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
Design the implementation plan. (Coding skills incl. architecture
|
|
40
|
+
and the project's structural-navigation skill were loaded at the
|
|
41
|
+
`load_skills` gate — follow them; do not default to grep on
|
|
42
|
+
parseable source.)
|
|
31
43
|
|
|
32
44
|
**Plan mode**: if system prompt says "Plan mode is active" — you're already in it,
|
|
33
45
|
do NOT call EnterPlanMode. Otherwise call `EnterPlanMode`.
|
|
@@ -56,8 +68,12 @@ states:
|
|
|
56
68
|
running automatically in its review/testing states. Including them causes
|
|
57
69
|
the agent to run manual builds that conflict with the automated pipeline.
|
|
58
70
|
|
|
71
|
+
**Brevity**: fewer steps. Skip what the user can infer from the task. Don't
|
|
72
|
+
restate the task back at the top of the plan. No filler sections (`Overview`,
|
|
73
|
+
`Background`) unless the task is genuinely novel and context is needed.
|
|
74
|
+
|
|
59
75
|
**Steps in plan mode:**
|
|
60
|
-
1. Explore codebase (
|
|
76
|
+
1. Explore codebase (directly or via Plan/Explore subagents)
|
|
61
77
|
2. Design approach
|
|
62
78
|
3. Write plan to the plan file specified in plan mode system prompt
|
|
63
79
|
4. Plan file MUST end with Workflow section (get session_id via `status`):
|
|
@@ -66,17 +82,21 @@ states:
|
|
|
66
82
|
- **Session**: `<session_id>`
|
|
67
83
|
- **Current state**: `planning @ design`
|
|
68
84
|
- **After approve**: transition `planned` → returns to parent
|
|
69
|
-
- **Execution workflow**: coding /
|
|
85
|
+
- **Execution workflow**: coding / feature / bug_fix / testing / refactoring / <workflow-name>
|
|
70
86
|
- **Resume**: `transition("<session_id>", "planned")`
|
|
71
87
|
```
|
|
72
88
|
5. Call `ExitPlanMode` for user approval
|
|
73
89
|
|
|
74
90
|
**After plan approved → transition `planned`.**
|
|
91
|
+
**If the user rejects the plan** → revise the plan file per their feedback,
|
|
92
|
+
then call `ExitPlanMode` again. Do NOT transition until approved.
|
|
75
93
|
transitions:
|
|
76
94
|
planned: done
|
|
77
95
|
dynamic: create_workflow
|
|
78
96
|
|
|
79
97
|
create_workflow:
|
|
98
|
+
# Resume line in the template below: same load-bearing positional form as in
|
|
99
|
+
# `design` (hook regex) — keep `transition("<session_id>", "planned")` exactly.
|
|
80
100
|
prompt: |
|
|
81
101
|
The task is operational/dynamic — create the execution workflow directly.
|
|
82
102
|
The workflow IS the plan.
|
|
@@ -97,10 +117,21 @@ states:
|
|
|
97
117
|
4. Write plan file with:
|
|
98
118
|
- Brief context of what the workflow does
|
|
99
119
|
- Reference to the created workflow name
|
|
100
|
-
- Workflow section
|
|
120
|
+
- The FULL Workflow section (get session_id via `status`):
|
|
121
|
+
```
|
|
122
|
+
## Workflow
|
|
123
|
+
- **Session**: `<session_id>`
|
|
124
|
+
- **Current state**: `planning @ create_workflow`
|
|
125
|
+
- **After approve**: transition `planned` → returns to parent
|
|
126
|
+
- **Execution workflow**: <workflow-name> (actual name, not "dynamic")
|
|
127
|
+
- **Resume**: `transition("<session_id>", "planned")`
|
|
128
|
+
```
|
|
101
129
|
5. Call `ExitPlanMode` for user approval
|
|
102
130
|
|
|
103
131
|
**After plan approved → transition `planned`.**
|
|
132
|
+
**If the user rejects the plan** → revise the plan file (and the workflow
|
|
133
|
+
definition if needed) per their feedback, then call `ExitPlanMode` again.
|
|
134
|
+
Do NOT transition until approved.
|
|
104
135
|
transitions:
|
|
105
136
|
planned: done
|
|
106
137
|
|
|
@@ -12,6 +12,7 @@ states:
|
|
|
12
12
|
- Any hallucinations (made-up names, paths, APIs)?
|
|
13
13
|
- Unnecessary complexity added?
|
|
14
14
|
- User had to correct you or wait?
|
|
15
|
+
- Workflow/skill friction — wrong routing, missing skills, redundant states?
|
|
15
16
|
|
|
16
17
|
Choose transition:
|
|
17
18
|
- `has_lesson` → found something worth recording
|
|
@@ -43,11 +44,17 @@ states:
|
|
|
43
44
|
- `suggest_improvements` → the lesson itself IS about workflow/skill friction
|
|
44
45
|
(not a side observation — the primary lesson is about process inefficiency)
|
|
45
46
|
transitions:
|
|
46
|
-
enrich_skill:
|
|
47
|
-
create_skill:
|
|
47
|
+
enrich_skill: load_skill_manager
|
|
48
|
+
create_skill: load_skill_manager
|
|
48
49
|
update_memory: action
|
|
49
50
|
suggest_improvements: suggest_improvements
|
|
50
51
|
|
|
52
|
+
load_skill_manager:
|
|
53
|
+
skills:
|
|
54
|
+
- skill-manager
|
|
55
|
+
transitions:
|
|
56
|
+
continue: action
|
|
57
|
+
|
|
51
58
|
action:
|
|
52
59
|
prompt: |
|
|
53
60
|
Execute the classified action:
|
|
@@ -59,7 +66,7 @@ states:
|
|
|
59
66
|
After acting, acknowledge the lesson to the user honestly.
|
|
60
67
|
|
|
61
68
|
Choose transition:
|
|
62
|
-
- `more` →
|
|
69
|
+
- `more` → more lessons to classify, or remaining actions for this lesson
|
|
63
70
|
- `suggest_improvements` → also noticed workflow/skill friction
|
|
64
71
|
- `done` → all lessons handled
|
|
65
72
|
transitions:
|
|
@@ -86,7 +93,7 @@ states:
|
|
|
86
93
|
Only suggest changes you're confident about — no speculative ideas.
|
|
87
94
|
|
|
88
95
|
Choose transition:
|
|
89
|
-
- `more` → still have lessons to classify
|
|
96
|
+
- `more` → still have lessons to classify
|
|
90
97
|
- `done` → finished
|
|
91
98
|
transitions:
|
|
92
99
|
more: classify
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: review-push
|
|
2
|
-
description: "Review uncommitted changes, then commit and push to
|
|
2
|
+
description: "Review uncommitted changes, then build, commit, and push to the remote if clean"
|
|
3
3
|
initial: review
|
|
4
4
|
max_transitions: 60
|
|
5
5
|
|
|
@@ -26,11 +26,17 @@ states:
|
|
|
26
26
|
|
|
27
27
|
fix_build:
|
|
28
28
|
task: "Fix build errors"
|
|
29
|
+
max_visits: 5
|
|
29
30
|
prompt: |
|
|
30
31
|
Build failed. Fix the errors, then build again.
|
|
32
|
+
|
|
33
|
+
Budget: 5 visits to this state (engine-enforced); when nearly exhausted
|
|
34
|
+
and the build still fails, choose `give_up` instead of retrying.
|
|
35
|
+
|
|
31
36
|
After fixing → `retry`.
|
|
32
37
|
transitions:
|
|
33
38
|
retry: build
|
|
39
|
+
give_up: failed
|
|
34
40
|
|
|
35
41
|
commit:
|
|
36
42
|
task: "Commit changes"
|
|
@@ -40,9 +46,14 @@ states:
|
|
|
40
46
|
1. `git status` to see what's being committed
|
|
41
47
|
2. `git diff --stat` for a summary
|
|
42
48
|
3. `git log --oneline -5` to match commit message style
|
|
43
|
-
4.
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
4. Confirm you are on the intended branch (`git branch --show-current`) —
|
|
50
|
+
if not, stop and sort the branch out first
|
|
51
|
+
5. Stage relevant files (prefer specific files over `git add -A`)
|
|
52
|
+
6. Scan the staged diff for secrets (`git diff --cached` — API keys,
|
|
53
|
+
tokens, passwords, credentials, .env contents). Found any → unstage
|
|
54
|
+
the file, add it to .gitignore, and report it
|
|
55
|
+
7. Write a clear commit message following the repo's convention
|
|
56
|
+
8. Commit
|
|
46
57
|
|
|
47
58
|
Then → `push`.
|
|
48
59
|
transitions:
|
|
@@ -52,12 +63,20 @@ states:
|
|
|
52
63
|
task: "Push to remote"
|
|
53
64
|
prompt: |
|
|
54
65
|
Push the commit to the remote repository.
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
|
|
67
|
+
1. Run `git push`
|
|
68
|
+
2. Verify it succeeded — push output shows the ref update and
|
|
69
|
+
`git status` reports the branch is up to date with the remote
|
|
70
|
+
3. Report the commit hash and remote URL
|
|
71
|
+
|
|
72
|
+
Then → transition `done`.
|
|
73
|
+
transitions:
|
|
74
|
+
done: finish
|
|
75
|
+
|
|
76
|
+
finish:
|
|
57
77
|
terminal: true
|
|
58
78
|
outcome: complete
|
|
59
79
|
|
|
60
80
|
failed:
|
|
61
|
-
prompt: "Review or build failed."
|
|
62
81
|
terminal: true
|
|
63
82
|
outcome: fail
|