guild-agents 0.3.1 → 1.0.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.
Files changed (38) hide show
  1. package/README.md +5 -1
  2. package/bin/guild.js +74 -1
  3. package/package.json +12 -5
  4. package/src/commands/doctor.js +70 -1
  5. package/src/commands/logs.js +63 -0
  6. package/src/commands/reset-learnings.js +44 -0
  7. package/src/commands/run.js +62 -0
  8. package/src/templates/agents/advisor.md +1 -0
  9. package/src/templates/agents/bugfix.md +1 -0
  10. package/src/templates/agents/code-reviewer.md +1 -0
  11. package/src/templates/agents/db-migration.md +1 -0
  12. package/src/templates/agents/developer.md +1 -0
  13. package/src/templates/agents/learnings-extractor.md +49 -0
  14. package/src/templates/agents/platform-expert.md +1 -0
  15. package/src/templates/agents/product-owner.md +1 -0
  16. package/src/templates/agents/qa.md +1 -0
  17. package/src/templates/agents/tech-lead.md +1 -0
  18. package/src/templates/skills/build-feature/SKILL.md +130 -26
  19. package/src/templates/skills/council/SKILL.md +51 -4
  20. package/src/templates/skills/create-pr/SKILL.md +32 -0
  21. package/src/templates/skills/dev-flow/SKILL.md +14 -0
  22. package/src/templates/skills/guild-specialize/SKILL.md +45 -3
  23. package/src/templates/skills/new-feature/SKILL.md +33 -0
  24. package/src/templates/skills/qa-cycle/SKILL.md +48 -5
  25. package/src/templates/skills/review/SKILL.md +22 -1
  26. package/src/templates/skills/session-end/SKILL.md +27 -0
  27. package/src/templates/skills/session-start/SKILL.md +32 -0
  28. package/src/templates/skills/status/SKILL.md +19 -0
  29. package/src/utils/dispatch-protocol.js +74 -0
  30. package/src/utils/dispatch.js +172 -0
  31. package/src/utils/learnings-io.js +76 -0
  32. package/src/utils/learnings.js +204 -0
  33. package/src/utils/orchestrator-io.js +356 -0
  34. package/src/utils/orchestrator.js +590 -0
  35. package/src/utils/skill-loader.js +83 -0
  36. package/src/utils/trace.js +400 -0
  37. package/src/utils/version.js +90 -0
  38. package/src/utils/workflow-parser.js +225 -0
@@ -2,6 +2,104 @@
2
2
  name: build-feature
3
3
  description: "Full pipeline: evaluation -> spec -> implementation -> review -> QA"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: evaluate
9
+ role: advisor
10
+ intent: "Evaluate the feature against the project vision. Identify risks, dependencies, and conflicts. Issue verdict: Approved / Rejected / Requires adjustments."
11
+ requires: [feature-description]
12
+ produces: [evaluation-report, verdict]
13
+ model-tier: reasoning
14
+ on-failure: abort
15
+ - id: specify
16
+ role: product-owner
17
+ intent: "Break the feature into concrete tasks with verifiable acceptance criteria. Estimate effort and suggest implementation order."
18
+ requires: [feature-description, evaluation-report]
19
+ produces: [task-list, acceptance-criteria]
20
+ model-tier: reasoning
21
+ condition: step.evaluate.verdict != rejected
22
+ - id: design
23
+ role: tech-lead
24
+ intent: "Define implementation approach: files to modify, patterns to follow, interfaces, and technical risks."
25
+ requires: [task-list, acceptance-criteria]
26
+ produces: [technical-plan]
27
+ model-tier: reasoning
28
+ - id: implement
29
+ role: developer
30
+ intent: "Implement the feature following the technical plan. Write unit tests. Make atomic commits."
31
+ requires: [technical-plan, acceptance-criteria]
32
+ produces: [implementation, test-results]
33
+ model-tier: execution
34
+ - id: gate-pre-review
35
+ role: system
36
+ intent: "Run project tests and lint. Both must pass before review."
37
+ commands: [npm test, npm run lint]
38
+ gate: true
39
+ produces: [gate-pre-review-result]
40
+ on-failure: goto:implement
41
+ - id: checkpoint-phase4
42
+ role: system
43
+ intent: "Create checkpoint commit and write partial pipeline trace (phases 1-4) to spec file."
44
+ requires: [implementation, gate-pre-review-result]
45
+ produces: [checkpoint-commit]
46
+ gate: true
47
+ - id: review
48
+ role: code-reviewer
49
+ intent: "Review code quality, patterns, security, and test coverage. Classify findings as Blocker, Warning, or Suggestion."
50
+ requires: [implementation, gate-pre-review-result]
51
+ produces: [review-report]
52
+ model-tier: reasoning
53
+ retry:
54
+ max: 2
55
+ on: has-blockers
56
+ - id: fix-review-blockers
57
+ role: developer
58
+ intent: "Fix blocker findings from code review. Run tests after fixing."
59
+ requires: [review-report]
60
+ produces: [implementation]
61
+ model-tier: execution
62
+ condition: step.review.has-blockers
63
+ on-failure: goto:review
64
+ - id: qa-phase
65
+ role: system
66
+ intent: "Run QA validation with bugfix cycles."
67
+ delegates-to: qa-cycle
68
+ requires: [acceptance-criteria, implementation]
69
+ produces: [qa-report]
70
+ retry:
71
+ max: 2
72
+ on: has-bugs
73
+ - id: post-qa-review
74
+ role: code-reviewer
75
+ intent: "Review changes introduced during QA bugfix cycles."
76
+ requires: [qa-report, implementation]
77
+ produces: [post-qa-review-report]
78
+ model-tier: reasoning
79
+ condition: step.qa-phase.had-significant-changes
80
+ retry:
81
+ max: 2
82
+ on: has-blockers
83
+ - id: gate-final
84
+ role: system
85
+ intent: "Run project tests and lint as final verification. Both must pass."
86
+ commands: [npm test, npm run lint]
87
+ gate: true
88
+ produces: [final-gate-result]
89
+ on-failure: goto:qa-phase
90
+ - id: completion
91
+ role: system
92
+ intent: "Write complete pipeline trace to spec file. Update SESSION.md. Present summary to user."
93
+ requires: [final-gate-result, review-report, qa-report]
94
+ produces: [pipeline-trace, session-update]
95
+ gate: true
96
+ - id: extract-learnings
97
+ role: learnings-extractor
98
+ intent: "Extract compound learnings from this pipeline execution."
99
+ requires: [pipeline-trace]
100
+ produces: [updated-learnings]
101
+ model-tier: routine
102
+ blocking: false
5
103
  ---
6
104
 
7
105
  # Build Feature
@@ -40,27 +138,29 @@ When running a single build-feature, a simple `git checkout -b` is sufficient.
40
138
  At the start of each phase, display a progress indicator to the user before any agent output:
41
139
 
42
140
  ```text
43
- [1/6] Advisor — Evaluating feature...
44
- [2/6] Product Owner — Defining spec...
45
- [3/6] Tech Lead — Defining technical approach...
46
- [4/6] Developer — Implementing...
47
- [5/6] Code Reviewer — Reviewing changes...
48
- [6/6] QA — Validating acceptance criteria...
141
+ [1/6] Advisor (opus) — Evaluating feature...
142
+ [2/6] Product Owner (opus) — Defining spec...
143
+ [3/6] Tech Lead (opus) — Defining technical approach...
144
+ [4/6] Developer (sonnet) — Implementing...
145
+ [5/6] Code Reviewer (opus) — Reviewing changes...
146
+ [6/6] QA (sonnet) — Validating acceptance criteria...
49
147
  ```
50
148
 
149
+ Model names are resolved from the step's `model-tier` using the `max` profile: reasoning=opus, execution=sonnet, routine=haiku. System/gate steps do not show a model name.
150
+
51
151
  When a phase loops (review-fix or QA-review cycles), show the iteration:
52
152
 
53
153
  ```text
54
- [5/6 · round 2] Code Reviewer — Re-reviewing after fixes...
55
- [4/6 · round 2] Developer — Fixing review blockers...
154
+ [5/6 · round 2] Code Reviewer (opus) — Re-reviewing after fixes...
155
+ [4/6 · round 2] Developer (sonnet) — Fixing review blockers...
56
156
  ```
57
157
 
58
158
  This indicator MUST be displayed before spawning the agent for that phase.
59
159
 
60
160
  ### Phase 1 — Evaluation (Advisor)
61
161
 
62
- **Progress:** `[1/6] Advisor — Evaluating feature...`
63
- **Agent:** Reads `.claude/agents/advisor.md` via Task tool
162
+ **Progress:** `[1/6] Advisor (opus) — Evaluating feature...`
163
+ **Agent:** Reads `.claude/agents/advisor.md` via Task tool with `model: "opus"`
64
164
  **Input:** The feature description provided by the user
65
165
  **Process:**
66
166
 
@@ -74,8 +174,8 @@ This indicator MUST be displayed before spawning the agent for that phase.
74
174
 
75
175
  ### Phase 2 — Specification (Product Owner)
76
176
 
77
- **Progress:** `[2/6] Product Owner — Defining spec...`
78
- **Agent:** Reads `.claude/agents/product-owner.md` via Task tool
177
+ **Progress:** `[2/6] Product Owner (opus) — Defining spec...`
178
+ **Agent:** Reads `.claude/agents/product-owner.md` via Task tool with `model: "opus"`
79
179
  **Input:** The feature approved by the Advisor + their observations
80
180
  **Process:**
81
181
 
@@ -88,8 +188,8 @@ This indicator MUST be displayed before spawning the agent for that phase.
88
188
 
89
189
  ### Phase 3 — Technical Approach (Tech Lead)
90
190
 
91
- **Progress:** `[3/6] Tech Lead — Defining technical approach...`
92
- **Agent:** Reads `.claude/agents/tech-lead.md` via Task tool
191
+ **Progress:** `[3/6] Tech Lead (opus) — Defining technical approach...`
192
+ **Agent:** Reads `.claude/agents/tech-lead.md` via Task tool with `model: "opus"`
93
193
  **Input:** Product Owner tasks + acceptance criteria
94
194
  **Process:**
95
195
 
@@ -102,8 +202,8 @@ This indicator MUST be displayed before spawning the agent for that phase.
102
202
 
103
203
  ### Phase 4 — Implementation (Developer)
104
204
 
105
- **Progress:** `[4/6] Developer — Implementing...`
106
- **Agent:** Reads `.claude/agents/developer.md` via Task tool
205
+ **Progress:** `[4/6] Developer (sonnet) — Implementing...`
206
+ **Agent:** Reads `.claude/agents/developer.md` via Task tool with `model: "sonnet"`
107
207
  **Input:** Tech Lead technical plan + PO acceptance criteria
108
208
  **Process:**
109
209
 
@@ -129,8 +229,8 @@ This gate CANNOT be skipped, even if the user requested phase skipping. The spec
129
229
 
130
230
  ### Phase 5 — Review (Code Reviewer)
131
231
 
132
- **Progress:** `[5/6] Code Reviewer — Reviewing changes...`
133
- **Agent:** Reads `.claude/agents/code-reviewer.md` via Task tool
232
+ **Progress:** `[5/6] Code Reviewer (opus) — Reviewing changes...`
233
+ **Agent:** Reads `.claude/agents/code-reviewer.md` via Task tool with `model: "opus"`
134
234
  **Input:** The implemented changes (git diff)
135
235
  **Process:**
136
236
 
@@ -143,7 +243,7 @@ This gate CANNOT be skipped, even if the user requested phase skipping. The spec
143
243
 
144
244
  ### Phase 6 — QA (delegates to /qa-cycle)
145
245
 
146
- **Progress:** `[6/6] QA — Validating acceptance criteria...`
246
+ **Progress:** `[6/6] QA (sonnet) — Validating acceptance criteria...`
147
247
 
148
248
  Runs the `/qa-cycle` skill passing the PO acceptance criteria as context. The qa-cycle handles:
149
249
 
@@ -334,30 +434,33 @@ Example Task invocation:
334
434
  ```text
335
435
  Task tool with:
336
436
  subagent_type: "general-purpose"
337
- prompt: "Read .claude/agents/developer.md and assume that role. Then: [task description]"
437
+ model: "opus"
438
+ prompt: "Read .claude/agents/advisor.md and assume that role. Then: [task description]"
338
439
  ```
339
440
 
441
+ The `model` parameter is resolved from the step's `model-tier`: reasoning→`"opus"`, execution→`"sonnet"`, routine→`"haiku"`. System/gate steps run inline (no Task tool).
442
+
340
443
  ## Example Session
341
444
 
342
445
  ```text
343
446
  User: /build-feature add dark mode toggle to settings page
344
447
 
345
- [1/6] Advisor — Evaluating feature...
448
+ [1/6] Advisor (opus) — Evaluating feature...
346
449
  Approved. Low risk, aligns with UX roadmap.
347
450
 
348
- [2/6] Product Owner — Defining spec...
451
+ [2/6] Product Owner (opus) — Defining spec...
349
452
  3 tasks defined with acceptance criteria.
350
453
 
351
- [3/6] Tech Lead — Defining technical approach...
454
+ [3/6] Tech Lead (opus) — Defining technical approach...
352
455
  Use CSS variables + context provider pattern.
353
456
 
354
- [4/6] Developer — Implementing...
457
+ [4/6] Developer (sonnet) — Implementing...
355
458
  Implemented ThemeContext, toggle component, CSS vars.
356
459
 
357
- [5/6] Code Reviewer — Reviewing changes...
460
+ [5/6] Code Reviewer (opus) — Reviewing changes...
358
461
  Passed. 1 suggestion (memoize context value).
359
462
 
360
- [6/6] QA — Validating acceptance criteria...
463
+ [6/6] QA (sonnet) — Validating acceptance criteria...
361
464
  All 3 acceptance criteria verified. 0 bugs.
362
465
 
363
466
  Feature complete. PR ready for merge.
@@ -368,3 +471,4 @@ Feature complete. PR ready for merge.
368
471
  - If the user wants to skip phases (e.g., "already evaluated, implement directly"), allow skipping to Phase 4 but warn that validation is lost. Verification gates (pre-Review and final) are NEVER skipped
369
472
  - The pipeline is sequential: each phase depends on the output of the previous one
370
473
  - Review/QA loops have limits to prevent infinite cycles
474
+ - In v1.x, parallel pipeline execution (multiple build-features via worktrees) is best-effort and depends on the host environment supporting concurrent agents
@@ -2,6 +2,49 @@
2
2
  name: council
3
3
  description: "Convenes multiple agents to debate an important decision"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: identify-type
9
+ role: system
10
+ intent: "Analyze the question and determine council type: architecture, feature-scope, or tech-debt."
11
+ requires: [user-question]
12
+ produces: [council-type, participant-roles]
13
+ gate: true
14
+ - id: agent-1
15
+ role: dynamic
16
+ intent: "Analyze the question from specialized perspective. State position with concrete arguments."
17
+ requires: [user-question, council-type]
18
+ produces: [perspective-1]
19
+ model-tier: reasoning
20
+ parallel: [agent-2, agent-3]
21
+ - id: agent-2
22
+ role: dynamic
23
+ intent: "Analyze the question from specialized perspective. State position with concrete arguments."
24
+ requires: [user-question, council-type]
25
+ produces: [perspective-2]
26
+ model-tier: reasoning
27
+ parallel: [agent-1, agent-3]
28
+ - id: agent-3
29
+ role: dynamic
30
+ intent: "Analyze the question from specialized perspective. State position with concrete arguments."
31
+ requires: [user-question, council-type]
32
+ produces: [perspective-3]
33
+ model-tier: reasoning
34
+ parallel: [agent-1, agent-2]
35
+ - id: synthesize
36
+ role: system
37
+ intent: "Synthesize debate: points of agreement, disagreement, risks. Present options to user."
38
+ requires: [perspective-1, perspective-2, perspective-3]
39
+ produces: [synthesis, options]
40
+ gate: true
41
+ - id: write-spec
42
+ role: system
43
+ intent: "After user decides, write spec document to docs/specs/."
44
+ requires: [synthesis, user-decision]
45
+ produces: [spec-document]
46
+ condition: user-wants-spec
47
+ gate: true
5
48
  ---
6
49
 
7
50
  # Council
@@ -71,7 +114,7 @@ Analyze the user's question and determine which council type applies:
71
114
 
72
115
  ### Step 2 — Convene agents
73
116
 
74
- Invoke the 3 corresponding agents IN PARALLEL using Task tool. Each agent:
117
+ Invoke the 3 corresponding agents IN PARALLEL using Task tool with `model: "opus"` (all council agents use reasoning tier). Each agent:
75
118
 
76
119
  1. Reads their `.claude/agents/[name].md` file to assume their role
77
120
  2. Reads `CLAUDE.md` and `SESSION.md` for project context
@@ -147,9 +190,12 @@ Example:
147
190
  ```text
148
191
  Task tool with:
149
192
  subagent_type: "general-purpose"
193
+ model: "opus"
150
194
  prompt: "Read .claude/agents/tech-lead.md and assume that role. Then: [debate question]"
151
195
  ```
152
196
 
197
+ The `model` parameter is resolved from the step's `model-tier`: all council agents use reasoning→`"opus"`.
198
+
153
199
  ## Example Session
154
200
 
155
201
  ```text
@@ -157,9 +203,9 @@ User: /council Should we migrate from REST to GraphQL?
157
203
 
158
204
  Council: Architecture
159
205
 
160
- Tech Lead — Recommends GraphQL for complex queries, keep REST for simple CRUD.
161
- Advisor — Risk is high mid-project. Suggests incremental adoption.
162
- Developer — Prefers REST simplicity. GraphQL adds tooling overhead.
206
+ Tech Lead (opus) — Recommends GraphQL for complex queries, keep REST for simple CRUD.
207
+ Advisor (opus) — Risk is high mid-project. Suggests incremental adoption.
208
+ Developer (opus) — Prefers REST simplicity. GraphQL adds tooling overhead.
163
209
 
164
210
  Consensus: Incremental adoption. New endpoints in GraphQL, existing stay REST.
165
211
  ```
@@ -173,3 +219,4 @@ Consensus: Incremental adoption. New endpoints in GraphQL, existing stay REST.
173
219
  - After the user decides, always offer to write the spec to `docs/specs/`
174
220
  - The spec document is the primary output of `/council` — it captures the debate, decision, and rationale
175
221
  - If the user declines the spec, log the decision to SESSION.md as before
222
+ - In v1.x, `parallel` execution is best-effort — the orchestrator may run parallel steps sequentially if concurrent agent execution is unavailable
@@ -2,6 +2,38 @@
2
2
  name: create-pr
3
3
  description: "Create a pull request from the current branch with structured summary"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: verify-branch
9
+ role: system
10
+ intent: "Verify not on main/develop, check for uncommitted changes, get commits ahead of main."
11
+ commands: [git branch --show-current, git status, git log main..HEAD --oneline]
12
+ produces: [branch-name, branch-state, commit-list]
13
+ - id: gather-context
14
+ role: system
15
+ intent: "Collect diff stats, run tests and lint for PR description context."
16
+ commands: [git diff main..HEAD --stat, npm test, npm run lint]
17
+ requires: [branch-state]
18
+ produces: [diff-summary, test-result, lint-result]
19
+ - id: generate-description
20
+ role: system
21
+ intent: "Build structured PR description from commits, diff stats, and test results."
22
+ requires: [commit-list, diff-summary, test-result, lint-result]
23
+ produces: [pr-description, pr-title]
24
+ gate: true
25
+ - id: create-pr
26
+ role: system
27
+ intent: "Push branch to origin and create PR via gh CLI."
28
+ commands: [git push -u origin, gh pr create]
29
+ requires: [pr-description, pr-title, branch-name]
30
+ produces: [pr-url]
31
+ - id: post-creation
32
+ role: system
33
+ intent: "Display PR URL and suggest next steps."
34
+ requires: [pr-url]
35
+ produces: [summary]
36
+ gate: true
5
37
  ---
6
38
 
7
39
  # Create PR
@@ -2,6 +2,20 @@
2
2
  name: dev-flow
3
3
  description: "Shows current pipeline phase and what comes next"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: read-state
9
+ role: system
10
+ intent: "Read SESSION.md to determine current feature and pipeline phase."
11
+ commands: [cat SESSION.md]
12
+ produces: [session-state, feature-name, current-phase]
13
+ - id: present-flow
14
+ role: system
15
+ intent: "Display pipeline progress with phase checklist and suggest next step."
16
+ requires: [session-state, feature-name, current-phase]
17
+ produces: [flow-display]
18
+ gate: true
5
19
  ---
6
20
 
7
21
  # Dev Flow
@@ -2,6 +2,44 @@
2
2
  name: guild-specialize
3
3
  description: "Enriches CLAUDE.md by exploring the project and specializes agents to the real stack"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: read-base
9
+ role: system
10
+ intent: "Read CLAUDE.md, PROJECT.md, and SESSION.md for current Guild configuration."
11
+ commands: [cat CLAUDE.md, cat PROJECT.md, cat SESSION.md]
12
+ produces: [claude-md, project-md, session-md]
13
+ - id: explore-project
14
+ role: system
15
+ intent: "Scan project structure, dependency files, configs, CI, and documentation to detect stack and architecture."
16
+ commands: [ls -R src/, cat package.json]
17
+ produces: [detected-stack, detected-architecture, detected-conventions]
18
+ gate: true
19
+ - id: enrich-claude-md
20
+ role: tech-lead
21
+ intent: "Replace [PENDING: guild-specialize] placeholders in CLAUDE.md with detected project information."
22
+ requires: [claude-md, detected-stack, detected-architecture, detected-conventions]
23
+ produces: [enriched-claude-md]
24
+ model-tier: reasoning
25
+ - id: specialize-agents
26
+ role: tech-lead
27
+ intent: "Add project-specific context to each agent definition in .claude/agents/."
28
+ requires: [detected-stack, detected-architecture, detected-conventions]
29
+ produces: [specialized-agents]
30
+ model-tier: execution
31
+ - id: confirm
32
+ role: system
33
+ intent: "Present summary of detected stack, architecture, and updated agents."
34
+ requires: [enriched-claude-md, specialized-agents]
35
+ produces: [specialization-summary]
36
+ gate: true
37
+ - id: commit-enrichment
38
+ role: system
39
+ intent: "Commit enriched CLAUDE.md and agent files as an atomic commit."
40
+ commands: [git add CLAUDE.md .claude/agents/*.md, git commit]
41
+ requires: [enriched-claude-md, specialized-agents]
42
+ produces: [enrichment-commit]
5
43
  ---
6
44
 
7
45
  # Guild Specialize
@@ -65,7 +103,7 @@ Investigate the real project structure looking for:
65
103
 
66
104
  ### Step 3 — Enrich CLAUDE.md
67
105
 
68
- Replace all `[PENDING: guild-specialize]` placeholders in CLAUDE.md with real information:
106
+ Invoke the Tech Lead agent using Task tool with `model: "opus"` (reasoning tier) to replace all `[PENDING: guild-specialize]` placeholders in CLAUDE.md with real information:
69
107
 
70
108
  - **Stack with exact versions**: extracted from dependency files
71
109
  - **Folder structure explained**: what each main folder does
@@ -77,7 +115,7 @@ Replace all `[PENDING: guild-specialize]` placeholders in CLAUDE.md with real in
77
115
 
78
116
  ### Step 4 — Specialize agents
79
117
 
80
- For each agent in `.claude/agents/*.md`, add project-specific context:
118
+ Invoke the Tech Lead agent using Task tool with `model: "sonnet"` (execution tier) to add project-specific context for each agent in `.claude/agents/*.md`:
81
119
 
82
120
  - **advisor.md**: real project domain, target users
83
121
  - **tech-lead.md**: specific stack, detected patterns, architecture decisions
@@ -89,7 +127,9 @@ For each agent in `.claude/agents/*.md`, add project-specific context:
89
127
  - **db-migration.md**: ORM, migration tool, current schema (if applicable)
90
128
  - **platform-expert.md**: Claude Code version, known permission bugs, hook configuration
91
129
 
92
- Use the `Task` tool to invoke each agent by reading their `.claude/agents/[name].md` if you need a specialized perspective to enrich their configuration.
130
+ Use the `Task` tool with `model: "sonnet"` to invoke each agent by reading their `.claude/agents/[name].md` if you need a specialized perspective to enrich their configuration.
131
+
132
+ The `model` parameter is resolved from the step's `model-tier`: reasoning→`"opus"`, execution→`"sonnet"`. System/gate steps run inline (no Task tool).
93
133
 
94
134
  ### Step 5 — Confirm
95
135
 
@@ -129,6 +169,7 @@ User: /guild-specialize
129
169
 
130
170
  Guild Specialize analyzing project...
131
171
 
172
+ Tech Lead (opus) — Enriching CLAUDE.md...
132
173
  Stack detected:
133
174
  - Node.js 20.11.0, TypeScript 5.3.3
134
175
  - React 18.2.0, Next.js 14.1.0
@@ -139,6 +180,7 @@ Architecture:
139
180
  - API routes in src/app/api/
140
181
  - Shared components in src/components/
141
182
 
183
+ Tech Lead (sonnet) — Specializing agents...
142
184
  Agents updated:
143
185
  - developer.md: Specialized for Next.js + TypeScript
144
186
  - qa.md: Configured for Vitest + Playwright
@@ -2,6 +2,39 @@
2
2
  name: new-feature
3
3
  description: "Creates branch and scaffold for a new feature"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: get-name
9
+ role: system
10
+ intent: "Obtain feature name from user input or prompt for it."
11
+ produces: [feature-name, feature-description]
12
+ gate: true
13
+ - id: create-branch
14
+ role: system
15
+ intent: "Create feature branch (simple checkout or worktree for parallel execution)."
16
+ commands: [git checkout -b]
17
+ requires: [feature-name]
18
+ produces: [branch-name]
19
+ - id: update-session
20
+ role: system
21
+ intent: "Update SESSION.md with new feature context, date, and state."
22
+ requires: [feature-name, feature-description, branch-name]
23
+ produces: [session-update]
24
+ gate: true
25
+ - id: create-issue
26
+ role: system
27
+ intent: "Optionally create GitHub Issue for the feature via gh CLI."
28
+ commands: [gh issue create]
29
+ requires: [feature-name, feature-description]
30
+ produces: [issue-url]
31
+ condition: user-wants-issue
32
+ - id: confirm
33
+ role: system
34
+ intent: "Confirm branch created, SESSION.md updated, issue created. Suggest /build-feature."
35
+ requires: [branch-name, session-update]
36
+ produces: [confirmation]
37
+ gate: true
5
38
  ---
6
39
 
7
40
  # New Feature
@@ -2,6 +2,38 @@
2
2
  name: qa-cycle
3
3
  description: "QA + bugfix cycle until it passes"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: gate-pre-qa
9
+ role: system
10
+ intent: "Run project tests and lint before QA validation."
11
+ commands: [npm test, npm run lint]
12
+ gate: true
13
+ produces: [test-result, lint-result]
14
+ - id: qa-validate
15
+ role: qa
16
+ intent: "Validate the implementation against acceptance criteria. Test edge cases and error scenarios. Report bugs found."
17
+ requires: [acceptance-criteria, test-result, lint-result]
18
+ produces: [qa-report]
19
+ model-tier: execution
20
+ retry:
21
+ max: 3
22
+ on: has-bugs
23
+ - id: bugfix
24
+ role: bugfix
25
+ intent: "Diagnose and fix bugs reported by QA. Run tests after fixing."
26
+ requires: [qa-report]
27
+ produces: [bugfix-result]
28
+ model-tier: execution
29
+ condition: step.qa-validate.has-bugs
30
+ on-failure: goto:qa-validate
31
+ - id: gate-post-qa
32
+ role: system
33
+ intent: "Run project tests and lint after QA cycle completes."
34
+ commands: [npm test, npm run lint]
35
+ gate: true
36
+ produces: [final-test-result, final-lint-result]
5
37
  ---
6
38
 
7
39
  # QA Cycle
@@ -30,7 +62,7 @@ Before invoking the QA agent, run the project verification commands. The specifi
30
62
 
31
63
  ### Step 2 — QA Validation
32
64
 
33
- Invoke the QA agent using Task tool:
65
+ Invoke the QA agent using Task tool with `model: "sonnet"` (execution tier):
34
66
 
35
67
  1. Read `.claude/agents/qa.md` to assume the QA role
36
68
  2. Read CLAUDE.md and SESSION.md for context
@@ -42,7 +74,7 @@ Invoke the QA agent using Task tool:
42
74
 
43
75
  ### Step 3 — Bugfix (if there are bugs)
44
76
 
45
- If QA reports bugs (including test/lint failures), invoke the Bugfix agent using Task tool:
77
+ If QA reports bugs (including test/lint failures), invoke the Bugfix agent using Task tool with `model: "sonnet"` (execution tier):
46
78
 
47
79
  1. Read `.claude/agents/bugfix.md` to assume the Bugfix role
48
80
  2. Receive the QA bug report as input
@@ -71,9 +103,9 @@ Update SESSION.md with the QA cycle result.
71
103
  ```text
72
104
  User: /qa-cycle
73
105
 
74
- QA Cycle 1: 2 of 5 criteria pass. Bug: form validation missing on email field.
75
- Bugfix: Added email regex validation to UserForm component.
76
- QA Cycle 2: 5 of 5 criteria pass. 0 bugs.
106
+ QA (sonnet) — Cycle 1: 2 of 5 criteria pass. Bug: form validation missing on email field.
107
+ Bugfix (sonnet) — Added email regex validation to UserForm component.
108
+ QA (sonnet) — Cycle 2: 5 of 5 criteria pass. 0 bugs.
77
109
 
78
110
  Result: Approved.
79
111
  ```
@@ -81,3 +113,14 @@ Result: Approved.
81
113
  ## Subagent Configuration
82
114
 
83
115
  When spawning QA or Bugfix agents via the Task tool, always use `subagent_type: "general-purpose"`. Guild agent role names are NOT valid Claude Code subagent_types.
116
+
117
+ Example:
118
+
119
+ ```text
120
+ Task tool with:
121
+ subagent_type: "general-purpose"
122
+ model: "sonnet"
123
+ prompt: "Read .claude/agents/qa.md and assume that role. Then: [task description]"
124
+ ```
125
+
126
+ The `model` parameter is resolved from the step's `model-tier`: qa-validate and bugfix use execution→`"sonnet"`.
@@ -2,6 +2,26 @@
2
2
  name: review
3
3
  description: "Standalone code review on the current diff"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: gather-diff
9
+ role: system
10
+ intent: "Get current git diff (staged or unstaged) and run tests + lint for context."
11
+ commands: [git diff --staged, git diff, npm test, npm run lint]
12
+ produces: [diff-content, test-result, lint-result]
13
+ - id: review
14
+ role: code-reviewer
15
+ intent: "Review code quality, patterns, security, and tests. Classify findings by severity."
16
+ requires: [diff-content, test-result, lint-result]
17
+ produces: [review-report]
18
+ model-tier: reasoning
19
+ - id: present
20
+ role: system
21
+ intent: "Present findings organized by severity with final verdict."
22
+ requires: [review-report]
23
+ produces: [formatted-report]
24
+ gate: true
5
25
  ---
6
26
 
7
27
  # Review
@@ -38,7 +58,7 @@ Note: The Code Reviewer does not have access to Bash (only Read, Glob, Grep), so
38
58
 
39
59
  ### Step 2 — Invoke Code Reviewer
40
60
 
41
- Invoke the Code Reviewer agent using Task tool:
61
+ Invoke the Code Reviewer agent using Task tool with `model: "opus"` (reasoning tier):
42
62
 
43
63
  1. Read `.claude/agents/code-reviewer.md` to assume the role
44
64
  2. Read CLAUDE.md to understand the project conventions
@@ -66,6 +86,7 @@ If there are blockers, suggest fixing them and running `/review` again.
66
86
  User: /review
67
87
 
68
88
  Reviewing diff: 4 files changed, +127 -34
89
+ Code Reviewer (opus) — Reviewing changes...
69
90
 
70
91
  Findings:
71
92
  - [Warning] src/api/users.js:45 — No input validation on email parameter
@@ -2,6 +2,33 @@
2
2
  name: session-end
3
3
  description: "Saves current state to SESSION.md"
4
4
  user-invocable: true
5
+ workflow:
6
+ version: 1
7
+ steps:
8
+ - id: gather-state
9
+ role: system
10
+ intent: "Analyze current work state: task in progress, pipeline phase, modified files, session commits."
11
+ commands: [git status, git log --oneline -10]
12
+ produces: [work-state, modified-files, session-commits]
13
+ - id: update-session
14
+ role: system
15
+ intent: "Write current state, decisions, and next steps to SESSION.md."
16
+ requires: [work-state, modified-files, session-commits]
17
+ produces: [session-update]
18
+ gate: true
19
+ - id: commit-wip
20
+ role: system
21
+ intent: "Create WIP checkpoint commit if uncommitted changes exist."
22
+ commands: [git add -A, git commit -m "wip: session paused"]
23
+ requires: [modified-files]
24
+ produces: [wip-commit]
25
+ condition: has-uncommitted-changes
26
+ - id: confirm
27
+ role: system
28
+ intent: "Confirm SESSION.md updated, WIP committed, safe to close."
29
+ requires: [session-update]
30
+ produces: [confirmation]
31
+ gate: true
5
32
  ---
6
33
 
7
34
  # Session End