@codemcp/workflows 6.20.2 → 6.22.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 (135) hide show
  1. package/package.json +2 -2
  2. package/packages/cli/dist/{chunk-4N42FFJE.js → chunk-QMPDZD7D.js} +117 -2674
  3. package/packages/cli/dist/{cli-MFHC7UWY.js → cli-CY4PLNWR.js} +475 -34
  4. package/packages/cli/dist/{dist-ISN3FRV4.js → dist-6BKGI5U7.js} +91 -8
  5. package/packages/cli/dist/{dist-TDV3DJ2J.js → dist-S4HQ3JQN.js} +3 -1
  6. package/packages/cli/dist/index.js +2 -2
  7. package/packages/cli/package.json +5 -2
  8. package/packages/cli/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  9. package/packages/cli/resources/templates/opencode-agents/research.md.tmpl +13 -0
  10. package/packages/cli/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  11. package/packages/cli/resources/workflows/bugfix.yaml +6 -0
  12. package/packages/cli/resources/workflows/epcc.yaml +3 -0
  13. package/packages/cli/resources/workflows/greenfield.yaml +3 -0
  14. package/packages/cli/resources/workflows/pr-review.yaml +2 -0
  15. package/packages/cli/resources/workflows/qrspi.yaml +5 -0
  16. package/packages/cli/resources/workflows/tdd.yaml +3 -0
  17. package/packages/cli/resources/workflows/waterfall.yaml +3 -0
  18. package/packages/core/dist/capability-hint.d.ts +28 -0
  19. package/packages/core/dist/capability-hint.js +52 -0
  20. package/packages/core/dist/capability-hint.js.map +1 -0
  21. package/packages/core/dist/config-manager.d.ts +19 -0
  22. package/packages/core/dist/config-manager.js +26 -0
  23. package/packages/core/dist/config-manager.js.map +1 -1
  24. package/packages/core/dist/index.d.ts +1 -0
  25. package/packages/core/dist/index.js +1 -0
  26. package/packages/core/dist/index.js.map +1 -1
  27. package/packages/core/dist/instruction-generator.js +7 -1
  28. package/packages/core/dist/instruction-generator.js.map +1 -1
  29. package/packages/core/dist/interfaces/instruction-generator.interface.d.ts +14 -0
  30. package/packages/core/dist/state-machine-types.d.ts +7 -0
  31. package/packages/core/dist/system-prompt-generator.js +26 -4
  32. package/packages/core/dist/system-prompt-generator.js.map +1 -1
  33. package/packages/core/package.json +1 -1
  34. package/packages/core/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  35. package/packages/core/resources/templates/opencode-agents/research.md.tmpl +13 -0
  36. package/packages/core/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  37. package/packages/core/resources/workflows/bugfix.yaml +6 -0
  38. package/packages/core/resources/workflows/epcc.yaml +3 -0
  39. package/packages/core/resources/workflows/greenfield.yaml +3 -0
  40. package/packages/core/resources/workflows/pr-review.yaml +2 -0
  41. package/packages/core/resources/workflows/qrspi.yaml +5 -0
  42. package/packages/core/resources/workflows/tdd.yaml +3 -0
  43. package/packages/core/resources/workflows/waterfall.yaml +3 -0
  44. package/packages/docs/.vitepress/dist/404.html +1 -1
  45. package/packages/docs/.vitepress/dist/assets/user_capability-routing.md.DbNKvMiS.js +15 -0
  46. package/packages/docs/.vitepress/dist/assets/user_capability-routing.md.DbNKvMiS.lean.js +1 -0
  47. package/packages/docs/.vitepress/dist/dev/ARCHITECTURE.html +2 -2
  48. package/packages/docs/.vitepress/dist/dev/DEVELOPMENT.html +2 -2
  49. package/packages/docs/.vitepress/dist/dev/LOGGING.html +2 -2
  50. package/packages/docs/.vitepress/dist/dev/PUBLISHING.html +2 -2
  51. package/packages/docs/.vitepress/dist/hashmap.json +1 -1
  52. package/packages/docs/.vitepress/dist/index.html +2 -2
  53. package/packages/docs/.vitepress/dist/user/advanced-engineering.html +3 -3
  54. package/packages/docs/.vitepress/dist/user/agent-setup.html +3 -3
  55. package/packages/docs/.vitepress/dist/user/beads-integration.html +2 -2
  56. package/packages/docs/.vitepress/dist/user/capability-routing.html +40 -0
  57. package/packages/docs/.vitepress/dist/user/crowd-mcp-integration.html +2 -2
  58. package/packages/docs/.vitepress/dist/user/custom-workflows.html +2 -2
  59. package/packages/docs/.vitepress/dist/user/git-commit-feature.html +2 -2
  60. package/packages/docs/.vitepress/dist/user/how-it-works.html +2 -2
  61. package/packages/docs/.vitepress/dist/user/long-term-memory.html +2 -2
  62. package/packages/docs/.vitepress/dist/user/packaged-workflows.html +2 -2
  63. package/packages/docs/.vitepress/dist/user/tutorial.html +2 -2
  64. package/packages/docs/.vitepress/dist/user/workflow-selection.html +2 -2
  65. package/packages/docs/.vitepress/dist/workflows/adr.html +1 -1
  66. package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.html +1 -1
  67. package/packages/docs/.vitepress/dist/workflows/boundary-testing.html +1 -1
  68. package/packages/docs/.vitepress/dist/workflows/bugfix.html +1 -1
  69. package/packages/docs/.vitepress/dist/workflows/bugfix.yaml +6 -0
  70. package/packages/docs/.vitepress/dist/workflows/business-analysis.html +1 -1
  71. package/packages/docs/.vitepress/dist/workflows/c4-analysis.html +1 -1
  72. package/packages/docs/.vitepress/dist/workflows/epcc.html +1 -1
  73. package/packages/docs/.vitepress/dist/workflows/epcc.yaml +3 -0
  74. package/packages/docs/.vitepress/dist/workflows/game-beginner.html +1 -1
  75. package/packages/docs/.vitepress/dist/workflows/greenfield.html +1 -1
  76. package/packages/docs/.vitepress/dist/workflows/greenfield.yaml +3 -0
  77. package/packages/docs/.vitepress/dist/workflows/minor.html +1 -1
  78. package/packages/docs/.vitepress/dist/workflows/posts.html +1 -1
  79. package/packages/docs/.vitepress/dist/workflows/pr-review.html +1 -1
  80. package/packages/docs/.vitepress/dist/workflows/pr-review.yaml +2 -0
  81. package/packages/docs/.vitepress/dist/workflows/qrspi.html +1 -1
  82. package/packages/docs/.vitepress/dist/workflows/qrspi.yaml +5 -0
  83. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.html +1 -1
  84. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.html +1 -1
  85. package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.html +1 -1
  86. package/packages/docs/.vitepress/dist/workflows/sdd-feature.html +1 -1
  87. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.html +1 -1
  88. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.html +1 -1
  89. package/packages/docs/.vitepress/dist/workflows/skilled-bugfix.html +1 -1
  90. package/packages/docs/.vitepress/dist/workflows/skilled-epcc.html +1 -1
  91. package/packages/docs/.vitepress/dist/workflows/skilled-greenfield.html +1 -1
  92. package/packages/docs/.vitepress/dist/workflows/slides.html +1 -1
  93. package/packages/docs/.vitepress/dist/workflows/tdd.html +1 -1
  94. package/packages/docs/.vitepress/dist/workflows/tdd.yaml +3 -0
  95. package/packages/docs/.vitepress/dist/workflows/waterfall.html +1 -1
  96. package/packages/docs/.vitepress/dist/workflows/waterfall.yaml +3 -0
  97. package/packages/docs/.vitepress/dist/workflows.html +1 -1
  98. package/packages/docs/package.json +1 -1
  99. package/packages/mcp-server/dist/index.js +93 -8
  100. package/packages/mcp-server/package.json +1 -1
  101. package/packages/mcp-server/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  102. package/packages/mcp-server/resources/templates/opencode-agents/research.md.tmpl +13 -0
  103. package/packages/mcp-server/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  104. package/packages/mcp-server/resources/workflows/bugfix.yaml +6 -0
  105. package/packages/mcp-server/resources/workflows/epcc.yaml +3 -0
  106. package/packages/mcp-server/resources/workflows/greenfield.yaml +3 -0
  107. package/packages/mcp-server/resources/workflows/pr-review.yaml +2 -0
  108. package/packages/mcp-server/resources/workflows/qrspi.yaml +5 -0
  109. package/packages/mcp-server/resources/workflows/tdd.yaml +3 -0
  110. package/packages/mcp-server/resources/workflows/waterfall.yaml +3 -0
  111. package/packages/opencode-plugin/dist/index.js +93 -8
  112. package/packages/opencode-plugin/package.json +1 -1
  113. package/packages/opencode-plugin/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  114. package/packages/opencode-plugin/resources/templates/opencode-agents/research.md.tmpl +13 -0
  115. package/packages/opencode-plugin/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  116. package/packages/opencode-plugin/resources/workflows/bugfix.yaml +6 -0
  117. package/packages/opencode-plugin/resources/workflows/epcc.yaml +3 -0
  118. package/packages/opencode-plugin/resources/workflows/greenfield.yaml +3 -0
  119. package/packages/opencode-plugin/resources/workflows/pr-review.yaml +2 -0
  120. package/packages/opencode-plugin/resources/workflows/qrspi.yaml +5 -0
  121. package/packages/opencode-plugin/resources/workflows/tdd.yaml +3 -0
  122. package/packages/opencode-plugin/resources/workflows/waterfall.yaml +3 -0
  123. package/packages/opencode-tui-plugin/package.json +1 -1
  124. package/packages/visualizer/package.json +1 -1
  125. package/resources/state-machine-schema.json +4 -0
  126. package/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  127. package/resources/templates/opencode-agents/research.md.tmpl +13 -0
  128. package/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  129. package/resources/workflows/bugfix.yaml +6 -0
  130. package/resources/workflows/epcc.yaml +3 -0
  131. package/resources/workflows/greenfield.yaml +3 -0
  132. package/resources/workflows/pr-review.yaml +2 -0
  133. package/resources/workflows/qrspi.yaml +5 -0
  134. package/resources/workflows/tdd.yaml +3 -0
  135. package/resources/workflows/waterfall.yaml +3 -0
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Subagent for deep reasoning, complex planning, and architectural trade-off analysis."
3
+ mode: subagent
4
+ model: ${model}
5
+ ---
6
+
7
+ You are the `${capability}` subagent for the workflows system. Your job is to support the parent agent during phases that demand careful reasoning, planning, and architectural analysis.
8
+
9
+ Approach problems methodically. Read the relevant code, surrounding tests, and any linked design notes before forming an opinion. When a question involves trade-offs, lay out the options with their concrete consequences rather than jumping to a single answer. Distinguish clearly between observed facts, reasonable inferences, and assumptions that still need verification.
10
+
11
+ Prefer structured output: short bullet lists, named options, and explicit recommendation with rationale. Call out open questions, risks, and edge cases the parent agent should not overlook. When a decision depends on values (readability, performance, maintainability, scope) name them rather than hand-waving.
12
+
13
+ Avoid making code changes unless the parent agent explicitly asks you to. Your primary value is sharp thinking, not typing. Do not invent APIs, file paths, or version numbers — when uncertain, say so and point at where to verify.
@@ -26,10 +26,13 @@ metadata:
26
26
  states:
27
27
  reproduce:
28
28
  description: 'Reproduce and understand the bug'
29
+ required_capability: 'research'
29
30
  allowed_file_patterns:
30
31
  - '**/*.md'
31
32
  - '**/*.txt'
32
33
  - '**/*.adoc'
34
+ - '**/*test*'
35
+ - '**/*spec*'
33
36
  default_instructions: |
34
37
  Gather specific information to reliably reproduce the reported bug:
35
38
  - What are the exact OS, browser/runtime versions, and hardware specs?
@@ -46,6 +49,7 @@ states:
46
49
 
47
50
  analyze:
48
51
  description: 'Analyze the bug and identify root cause'
52
+ required_capability: 'thinking'
49
53
  allowed_file_patterns:
50
54
  - '**/*.md'
51
55
  - '**/*.txt'
@@ -74,6 +78,7 @@ states:
74
78
 
75
79
  fix:
76
80
  description: 'Implement the bug fix'
81
+ required_capability: 'coding'
77
82
  allowed_file_patterns:
78
83
  - '**/*'
79
84
  default_instructions: |
@@ -110,6 +115,7 @@ states:
110
115
 
111
116
  verify:
112
117
  description: 'Verify the fix and ensure no regressions'
118
+ required_capability: 'thinking'
113
119
  allowed_file_patterns:
114
120
  - '**/*'
115
121
  default_instructions: Test the fix thoroughly to ensure the original bug is resolved and no new issues were introduced. Run existing tests, create new ones if needed, and verify the solution is robust.
@@ -26,6 +26,7 @@ metadata:
26
26
  states:
27
27
  explore:
28
28
  description: 'Research and exploration phase - understanding the problem space'
29
+ required_capability: 'research'
29
30
  allowed_file_patterns:
30
31
  - '**/*.md'
31
32
  - '**/*.txt'
@@ -48,6 +49,7 @@ states:
48
49
 
49
50
  plan:
50
51
  description: 'Planning phase - creating a detailed implementation strategy'
52
+ required_capability: 'thinking'
51
53
  allowed_file_patterns:
52
54
  - '**/*.md'
53
55
  - '**/*.txt'
@@ -92,6 +94,7 @@ states:
92
94
 
93
95
  code:
94
96
  description: 'Implementation phase - writing and building the solution'
97
+ required_capability: 'coding'
95
98
  allowed_file_patterns:
96
99
  - '**/*'
97
100
  default_instructions: |
@@ -27,6 +27,7 @@ metadata:
27
27
  states:
28
28
  ideation:
29
29
  description: 'Deep requirements discovery and PRD creation phase'
30
+ required_capability: 'thinking'
30
31
  allowed_file_patterns:
31
32
  - '**/*.md'
32
33
  - '**/*.txt'
@@ -51,6 +52,7 @@ states:
51
52
 
52
53
  architecture:
53
54
  description: 'Tech stack selection and architecture design phase'
55
+ required_capability: 'thinking'
54
56
  allowed_file_patterns:
55
57
  - '**/*.md'
56
58
  - '**/*.txt'
@@ -130,6 +132,7 @@ states:
130
132
 
131
133
  code:
132
134
  description: 'Implementation phase following the established plan and architecture'
135
+ required_capability: 'coding'
133
136
  allowed_file_patterns:
134
137
  - '**/*'
135
138
  default_instructions: |
@@ -57,6 +57,7 @@ states:
57
57
 
58
58
  review_architecture:
59
59
  description: 'Review whether the change is in the right place and respects existing structure'
60
+ required_capability: 'thinking'
60
61
  default_instructions: |
61
62
  Evaluate the structural decisions in the change against the confirmed intent:
62
63
 
@@ -93,6 +94,7 @@ states:
93
94
 
94
95
  review_correctness:
95
96
  description: 'Review whether the logic correctly achieves the confirmed intent'
97
+ required_capability: 'thinking'
96
98
  default_instructions: |
97
99
  Evaluate the logic of the change against the confirmed intent:
98
100
 
@@ -54,6 +54,7 @@ states:
54
54
 
55
55
  research:
56
56
  description: 'Gather facts without forming conclusions or proposing solutions'
57
+ required_capability: 'research'
57
58
  allowed_file_patterns:
58
59
  - '**/*.md'
59
60
  - '**/*.txt'
@@ -81,6 +82,7 @@ states:
81
82
 
82
83
  design:
83
84
  description: 'Explore options and reach consensus on WHAT and high-level HOW'
85
+ required_capability: 'thinking'
84
86
  allowed_file_patterns:
85
87
  - '**/*.md'
86
88
  - '**/*.txt'
@@ -114,6 +116,7 @@ states:
114
116
 
115
117
  structure:
116
118
  description: 'Decompose the approved design into end-to-end vertical slices'
119
+ required_capability: 'thinking'
117
120
  allowed_file_patterns:
118
121
  - '**/*.md'
119
122
  - '**/*.txt'
@@ -143,6 +146,7 @@ states:
143
146
 
144
147
  plan:
145
148
  description: 'Create a detailed implementation plan per vertical slice'
149
+ required_capability: 'thinking'
146
150
  allowed_file_patterns:
147
151
  - '**/*.md'
148
152
  - '**/*.txt'
@@ -182,6 +186,7 @@ states:
182
186
 
183
187
  implement:
184
188
  description: 'Build the solution slice by slice'
189
+ required_capability: 'coding'
185
190
  allowed_file_patterns:
186
191
  - '**/*'
187
192
  default_instructions: |
@@ -26,6 +26,7 @@ metadata:
26
26
  states:
27
27
  explore:
28
28
  description: 'Research and exploration phase - understanding the problem space and codebase'
29
+ required_capability: 'research'
29
30
  allowed_file_patterns:
30
31
  - '**/*.md'
31
32
  - '**/*.txt'
@@ -50,6 +51,7 @@ states:
50
51
 
51
52
  red:
52
53
  description: 'RED phase - Write a failing test that defines the expected behavior'
54
+ required_capability: 'thinking'
53
55
  allowed_file_patterns:
54
56
  - '**/*'
55
57
  default_instructions: |
@@ -87,6 +89,7 @@ states:
87
89
 
88
90
  green:
89
91
  description: 'GREEN phase - Write only the necessary code to make the test pass'
92
+ required_capability: 'coding'
90
93
  allowed_file_patterns:
91
94
  - '**/*'
92
95
  default_instructions: |
@@ -27,6 +27,7 @@ metadata:
27
27
  states:
28
28
  requirements:
29
29
  description: 'Gathering and analyzing requirements'
30
+ required_capability: 'research'
30
31
  allowed_file_patterns:
31
32
  - '**/*.md'
32
33
  - '**/*.txt'
@@ -53,6 +54,7 @@ states:
53
54
 
54
55
  design:
55
56
  description: 'Technical design and architecture planning'
57
+ required_capability: 'thinking'
56
58
  allowed_file_patterns:
57
59
  - '**/*.md'
58
60
  - '**/*.txt'
@@ -80,6 +82,7 @@ states:
80
82
 
81
83
  implementation:
82
84
  description: 'Building the solution according to design'
85
+ required_capability: 'coding'
83
86
  allowed_file_patterns:
84
87
  - '**/*'
85
88
  default_instructions: |
@@ -16878,7 +16878,8 @@ var ConfigManager = class {
16878
16878
  this.validateConfig(config, configPath);
16879
16879
  logger3.info("Loaded project configuration", {
16880
16880
  configPath,
16881
- enabledWorkflows: config.enabled_workflows?.length || 0
16881
+ enabledWorkflows: config.enabled_workflows?.length || 0,
16882
+ capabilityModels: config.capability_models ? Object.keys(config.capability_models).length : 0
16882
16883
  });
16883
16884
  return config;
16884
16885
  } catch (error) {
@@ -16908,6 +16909,23 @@ var ConfigManager = class {
16908
16909
  }
16909
16910
  }
16910
16911
  }
16912
+ if (config.capability_models !== void 0) {
16913
+ if (typeof config.capability_models !== "object" || config.capability_models === null || Array.isArray(config.capability_models)) {
16914
+ throw new Error(`Invalid config file ${configPath}: capability_models must be an object`);
16915
+ }
16916
+ for (const [key, entry] of Object.entries(config.capability_models)) {
16917
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
16918
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' must be an object`);
16919
+ }
16920
+ const { model, agent } = entry;
16921
+ if (model !== void 0 && (typeof model !== "string" || model.trim() === "")) {
16922
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' model must be a non-empty string`);
16923
+ }
16924
+ if (agent !== void 0 && (typeof agent !== "string" || agent.trim() === "")) {
16925
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' agent must be a non-empty string`);
16926
+ }
16927
+ }
16928
+ }
16911
16929
  }
16912
16930
  };
16913
16931
 
@@ -19861,6 +19879,31 @@ var BeadsStateManager = class {
19861
19879
  }
19862
19880
  };
19863
19881
 
19882
+ // ../core/dist/capability-hint.js
19883
+ var CAPABILITY_DESCRIPTIONS = {
19884
+ thinking: "deep reasoning, complex planning",
19885
+ research: "fast information gathering and browsing"
19886
+ };
19887
+ function formatCapabilityHint(capability, config) {
19888
+ if (!capability) {
19889
+ return "";
19890
+ }
19891
+ const description = CAPABILITY_DESCRIPTIONS[capability];
19892
+ const label = description ? `Capability hint: This phase requires ${capability} capability (${description}).` : `Capability hint: This phase requires ${capability} capability.`;
19893
+ const model = config?.model;
19894
+ const agent = config?.agent;
19895
+ if (agent && model) {
19896
+ return `${label} When launching subagents, use agent: ${agent} (model: ${model}).`;
19897
+ }
19898
+ if (agent) {
19899
+ return `${label} When launching subagents, use agent: ${agent}.`;
19900
+ }
19901
+ if (model) {
19902
+ return `${label} When launching subagents, prefer model: ${model}.`;
19903
+ }
19904
+ return label;
19905
+ }
19906
+
19864
19907
  // ../core/dist/interaction-logger.js
19865
19908
  var logger12 = createLogger("InteractionLogger");
19866
19909
  var InteractionLogger = class {
@@ -19987,7 +20030,7 @@ var InstructionGenerator = class {
19987
20030
  * Enhance base instructions with context-specific information
19988
20031
  */
19989
20032
  async enhanceInstructions(baseInstructions, context3) {
19990
- const { phase, conversationContext, allowedFilePatterns } = context3;
20033
+ const { phase, conversationContext, allowedFilePatterns, requiredCapability, capabilityConfig } = context3;
19991
20034
  const phaseName = capitalizePhase(phase);
19992
20035
  let workflowSection = `---
19993
20036
  ### YOU MUST FOLLOW THESE INSTRUCTIONS:
@@ -20002,6 +20045,12 @@ var InstructionGenerator = class {
20002
20045
  if (allowedFilePatterns && allowedFilePatterns.length > 0 && !allowedFilePatterns.includes("**/*") && !allowedFilePatterns.includes("*")) {
20003
20046
  workflowSection += `
20004
20047
  - Files allowed: \`${allowedFilePatterns.join("`, `")}\``;
20048
+ }
20049
+ const capabilityHint = formatCapabilityHint(requiredCapability, capabilityConfig);
20050
+ if (capabilityHint) {
20051
+ workflowSection += `
20052
+
20053
+ ${capabilityHint}`;
20005
20054
  }
20006
20055
  workflowSection += "\n\nCall `whats_next()` after user messages.";
20007
20056
  return `## ${phaseName} Phase
@@ -20024,13 +20073,35 @@ function generateSystemPrompt(stateMachine) {
20024
20073
  function generateSimpleSystemPrompt(_stateMachine) {
20025
20074
  logger13.debug("Generating system prompt");
20026
20075
  const systemPrompt = `
20027
- You are an AI assistant that helps users develop software features using the workflows server.
20076
+ You are a structured, workflow-driven agent. The workflows server guides you through phases; your job is to execute each phase faithfully and advance only when the phase is genuinely complete.
20077
+
20078
+ ## Core loop
20079
+
20080
+ After every user message, call \`whats_next()\`. It returns a JSON object with an \`instructions\` field. Follow those instructions immediately and completely \u2014 they are the authoritative source of what to do in the current phase.
20081
+
20082
+ The response also returns a \`plan_file_path\`. That file is your persistent memory for the session. Read it at the start of each phase. Update it as directed by the instructions.
20083
+
20084
+ ## Before acting
20028
20085
 
20029
- IMPORTANT: Call whats_next() after each user message to get phase-specific instructions and maintain the development workflow.
20086
+ If the user's message is ambiguous or could be interpreted in more than one way, ask a clarifying question before calling \`whats_next()\`. State what is unclear and what you need to know. Do not silently pick an interpretation and proceed.
20030
20087
 
20031
- Each tool call returns a JSON response with an "instructions" field. Follow these instructions immediately after you receive them.
20088
+ Once intent is clear, state your assumptions explicitly before starting work. Surface tradeoffs. If a simpler approach exists than what was asked, say so.
20032
20089
 
20033
- Use the development plan which you will retrieve via whats_next() to record important insights and decisions as per the structure of the plan.
20090
+ ## Scope discipline
20091
+
20092
+ Do the minimum the current phase instructions require. Do not do work that belongs to a later phase. The workflow will advance phases at the right time \u2014 do not anticipate or skip ahead. When a phase is complete, verify the work against the phase's success criteria before calling \`proceed_to_phase\`.
20093
+
20094
+ ## Subagent delegation
20095
+
20096
+ ### Capability hints
20097
+ When \`whats_next()\` includes a capability hint in its instructions (e.g. \`Capability hint: This phase requires thinking capability\`):
20098
+ - If your platform supports switching to a specific model or agent, do so as indicated by the hint.
20099
+ - Otherwise, decompose the phase work into independent, atomic, self-contained tasks and delegate each to a subagent of the indicated capability type (research, thinking, or coding). Collect and integrate results before proceeding.
20100
+
20101
+ ### Reviews
20102
+ When \`conduct_review\` is called and returns review perspectives, always delegate the review to a thinking-specialized subagent. Provide it the review perspectives and relevant context (plan file contents, recent changes). Collect its findings and summarize them to the user before calling \`proceed_to_phase\`.
20103
+
20104
+ ## Task management
20034
20105
 
20035
20106
  Do not use your own task management tools.`;
20036
20107
  logger13.info("System prompt generated successfully", {
@@ -26171,6 +26242,11 @@ var WhatsNextHandler = class extends ConversationRequiredToolHandler {
26171
26242
  );
26172
26243
  const phaseState = stateMachine.states[transitionResult.newPhase];
26173
26244
  const allowedFilePatterns = phaseState?.allowed_file_patterns ?? ["**/*"];
26245
+ const requiredCapability = phaseState?.required_capability;
26246
+ const projectConfig = ConfigManager.loadProjectConfig(
26247
+ conversationContext.projectPath
26248
+ );
26249
+ const capabilityConfig = requiredCapability ? projectConfig?.capability_models?.[requiredCapability] : void 0;
26174
26250
  const instructions = await context3.instructionGenerator.generateInstructions(
26175
26251
  transitionResult.instructions,
26176
26252
  {
@@ -26182,7 +26258,9 @@ var WhatsNextHandler = class extends ConversationRequiredToolHandler {
26182
26258
  transitionReason: transitionResult.transitionReason,
26183
26259
  isModeled: transitionResult.isModeled,
26184
26260
  instructionSource: "whats_next",
26185
- allowedFilePatterns
26261
+ allowedFilePatterns,
26262
+ requiredCapability,
26263
+ capabilityConfig
26186
26264
  }
26187
26265
  );
26188
26266
  let finalInstructions = instructions.instructions;
@@ -26343,6 +26421,11 @@ var ProceedToPhaseHandler = class extends ConversationRequiredToolHandler {
26343
26421
  );
26344
26422
  const phaseState = stateMachine.states[transitionResult.newPhase];
26345
26423
  const allowedFilePatterns = phaseState?.allowed_file_patterns ?? ["**/*"];
26424
+ const requiredCapability = phaseState?.required_capability;
26425
+ const projectConfig = ConfigManager.loadProjectConfig(
26426
+ conversationContext.projectPath
26427
+ );
26428
+ const capabilityConfig = requiredCapability ? projectConfig?.capability_models?.[requiredCapability] : void 0;
26346
26429
  const instructions = await context3.instructionGenerator.generateInstructions(
26347
26430
  transitionResult.instructions,
26348
26431
  {
@@ -26354,7 +26437,9 @@ var ProceedToPhaseHandler = class extends ConversationRequiredToolHandler {
26354
26437
  transitionReason: transitionResult.transitionReason,
26355
26438
  isModeled: transitionResult.isModeled,
26356
26439
  instructionSource: "proceed_to_phase",
26357
- allowedFilePatterns
26440
+ allowedFilePatterns,
26441
+ requiredCapability,
26442
+ capabilityConfig
26358
26443
  }
26359
26444
  );
26360
26445
  let finalInstructions = instructions.instructions;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-opencode",
3
- "version": "6.20.2",
3
+ "version": "6.22.0",
4
4
  "description": "OpenCode plugin for structured development workflows",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Subagent for code generation and editing, focused on idiomatic patterns and minimal scope."
3
+ mode: subagent
4
+ model: ${model}
5
+ ---
6
+
7
+ You are the `${capability}` subagent for the workflows system. Your job is to implement focused, high-quality code changes on behalf of the parent agent.
8
+
9
+ Read the file you are about to edit before changing it. Match the surrounding style: indentation, naming, import order, error-handling conventions, and test patterns. Prefer small, surgical edits over large rewrites — change as little as possible to satisfy the requirement, and leave unrelated code untouched.
10
+
11
+ Write idiomatic code for the language and framework in use. Avoid clever one-liners, speculative abstractions, or new dependencies unless they are clearly justified. When a fix could be done two ways, pick the simpler one and note the trade-off in a short comment if it matters.
12
+
13
+ Run the relevant tests and linters when you can. If a build or test fails, do not declare success — diagnose and fix the root cause rather than papering over it. Never commit, push, or modify git state unless the parent agent explicitly instructs you to.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Subagent for fast information gathering and codebase exploration."
3
+ mode: subagent
4
+ model: ${model}
5
+ ---
6
+
7
+ You are the `${capability}` subagent for the workflows system. Your job is to gather information quickly and report back concisely to the parent agent.
8
+
9
+ Search the codebase, documentation, and any provided context before answering. Use the most targeted query you can — exact symbol names, file paths, or distinctive error messages — before falling back to broader patterns. When a question can be answered by reading one or two files, just read them instead of guessing.
10
+
11
+ Report findings as a tight, structured summary: the direct answer first, then supporting evidence with file paths and line numbers. Quote only the snippets that matter. Do not paraphrase code when the original is clearer.
12
+
13
+ Avoid making changes. Do not implement, refactor, or "fix while you're there" — your job is to inform the parent's decision, not to make it. If a question cannot be answered from the available context, say so plainly and suggest the next investigation step.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Subagent for deep reasoning, complex planning, and architectural trade-off analysis."
3
+ mode: subagent
4
+ model: ${model}
5
+ ---
6
+
7
+ You are the `${capability}` subagent for the workflows system. Your job is to support the parent agent during phases that demand careful reasoning, planning, and architectural analysis.
8
+
9
+ Approach problems methodically. Read the relevant code, surrounding tests, and any linked design notes before forming an opinion. When a question involves trade-offs, lay out the options with their concrete consequences rather than jumping to a single answer. Distinguish clearly between observed facts, reasonable inferences, and assumptions that still need verification.
10
+
11
+ Prefer structured output: short bullet lists, named options, and explicit recommendation with rationale. Call out open questions, risks, and edge cases the parent agent should not overlook. When a decision depends on values (readability, performance, maintainability, scope) name them rather than hand-waving.
12
+
13
+ Avoid making code changes unless the parent agent explicitly asks you to. Your primary value is sharp thinking, not typing. Do not invent APIs, file paths, or version numbers — when uncertain, say so and point at where to verify.
@@ -26,10 +26,13 @@ metadata:
26
26
  states:
27
27
  reproduce:
28
28
  description: 'Reproduce and understand the bug'
29
+ required_capability: 'research'
29
30
  allowed_file_patterns:
30
31
  - '**/*.md'
31
32
  - '**/*.txt'
32
33
  - '**/*.adoc'
34
+ - '**/*test*'
35
+ - '**/*spec*'
33
36
  default_instructions: |
34
37
  Gather specific information to reliably reproduce the reported bug:
35
38
  - What are the exact OS, browser/runtime versions, and hardware specs?
@@ -46,6 +49,7 @@ states:
46
49
 
47
50
  analyze:
48
51
  description: 'Analyze the bug and identify root cause'
52
+ required_capability: 'thinking'
49
53
  allowed_file_patterns:
50
54
  - '**/*.md'
51
55
  - '**/*.txt'
@@ -74,6 +78,7 @@ states:
74
78
 
75
79
  fix:
76
80
  description: 'Implement the bug fix'
81
+ required_capability: 'coding'
77
82
  allowed_file_patterns:
78
83
  - '**/*'
79
84
  default_instructions: |
@@ -110,6 +115,7 @@ states:
110
115
 
111
116
  verify:
112
117
  description: 'Verify the fix and ensure no regressions'
118
+ required_capability: 'thinking'
113
119
  allowed_file_patterns:
114
120
  - '**/*'
115
121
  default_instructions: Test the fix thoroughly to ensure the original bug is resolved and no new issues were introduced. Run existing tests, create new ones if needed, and verify the solution is robust.
@@ -26,6 +26,7 @@ metadata:
26
26
  states:
27
27
  explore:
28
28
  description: 'Research and exploration phase - understanding the problem space'
29
+ required_capability: 'research'
29
30
  allowed_file_patterns:
30
31
  - '**/*.md'
31
32
  - '**/*.txt'
@@ -48,6 +49,7 @@ states:
48
49
 
49
50
  plan:
50
51
  description: 'Planning phase - creating a detailed implementation strategy'
52
+ required_capability: 'thinking'
51
53
  allowed_file_patterns:
52
54
  - '**/*.md'
53
55
  - '**/*.txt'
@@ -92,6 +94,7 @@ states:
92
94
 
93
95
  code:
94
96
  description: 'Implementation phase - writing and building the solution'
97
+ required_capability: 'coding'
95
98
  allowed_file_patterns:
96
99
  - '**/*'
97
100
  default_instructions: |
@@ -27,6 +27,7 @@ metadata:
27
27
  states:
28
28
  ideation:
29
29
  description: 'Deep requirements discovery and PRD creation phase'
30
+ required_capability: 'thinking'
30
31
  allowed_file_patterns:
31
32
  - '**/*.md'
32
33
  - '**/*.txt'
@@ -51,6 +52,7 @@ states:
51
52
 
52
53
  architecture:
53
54
  description: 'Tech stack selection and architecture design phase'
55
+ required_capability: 'thinking'
54
56
  allowed_file_patterns:
55
57
  - '**/*.md'
56
58
  - '**/*.txt'
@@ -130,6 +132,7 @@ states:
130
132
 
131
133
  code:
132
134
  description: 'Implementation phase following the established plan and architecture'
135
+ required_capability: 'coding'
133
136
  allowed_file_patterns:
134
137
  - '**/*'
135
138
  default_instructions: |
@@ -57,6 +57,7 @@ states:
57
57
 
58
58
  review_architecture:
59
59
  description: 'Review whether the change is in the right place and respects existing structure'
60
+ required_capability: 'thinking'
60
61
  default_instructions: |
61
62
  Evaluate the structural decisions in the change against the confirmed intent:
62
63
 
@@ -93,6 +94,7 @@ states:
93
94
 
94
95
  review_correctness:
95
96
  description: 'Review whether the logic correctly achieves the confirmed intent'
97
+ required_capability: 'thinking'
96
98
  default_instructions: |
97
99
  Evaluate the logic of the change against the confirmed intent:
98
100
 
@@ -54,6 +54,7 @@ states:
54
54
 
55
55
  research:
56
56
  description: 'Gather facts without forming conclusions or proposing solutions'
57
+ required_capability: 'research'
57
58
  allowed_file_patterns:
58
59
  - '**/*.md'
59
60
  - '**/*.txt'
@@ -81,6 +82,7 @@ states:
81
82
 
82
83
  design:
83
84
  description: 'Explore options and reach consensus on WHAT and high-level HOW'
85
+ required_capability: 'thinking'
84
86
  allowed_file_patterns:
85
87
  - '**/*.md'
86
88
  - '**/*.txt'
@@ -114,6 +116,7 @@ states:
114
116
 
115
117
  structure:
116
118
  description: 'Decompose the approved design into end-to-end vertical slices'
119
+ required_capability: 'thinking'
117
120
  allowed_file_patterns:
118
121
  - '**/*.md'
119
122
  - '**/*.txt'
@@ -143,6 +146,7 @@ states:
143
146
 
144
147
  plan:
145
148
  description: 'Create a detailed implementation plan per vertical slice'
149
+ required_capability: 'thinking'
146
150
  allowed_file_patterns:
147
151
  - '**/*.md'
148
152
  - '**/*.txt'
@@ -182,6 +186,7 @@ states:
182
186
 
183
187
  implement:
184
188
  description: 'Build the solution slice by slice'
189
+ required_capability: 'coding'
185
190
  allowed_file_patterns:
186
191
  - '**/*'
187
192
  default_instructions: |
@@ -26,6 +26,7 @@ metadata:
26
26
  states:
27
27
  explore:
28
28
  description: 'Research and exploration phase - understanding the problem space and codebase'
29
+ required_capability: 'research'
29
30
  allowed_file_patterns:
30
31
  - '**/*.md'
31
32
  - '**/*.txt'
@@ -50,6 +51,7 @@ states:
50
51
 
51
52
  red:
52
53
  description: 'RED phase - Write a failing test that defines the expected behavior'
54
+ required_capability: 'thinking'
53
55
  allowed_file_patterns:
54
56
  - '**/*'
55
57
  default_instructions: |
@@ -87,6 +89,7 @@ states:
87
89
 
88
90
  green:
89
91
  description: 'GREEN phase - Write only the necessary code to make the test pass'
92
+ required_capability: 'coding'
90
93
  allowed_file_patterns:
91
94
  - '**/*'
92
95
  default_instructions: |
@@ -27,6 +27,7 @@ metadata:
27
27
  states:
28
28
  requirements:
29
29
  description: 'Gathering and analyzing requirements'
30
+ required_capability: 'research'
30
31
  allowed_file_patterns:
31
32
  - '**/*.md'
32
33
  - '**/*.txt'
@@ -53,6 +54,7 @@ states:
53
54
 
54
55
  design:
55
56
  description: 'Technical design and architecture planning'
57
+ required_capability: 'thinking'
56
58
  allowed_file_patterns:
57
59
  - '**/*.md'
58
60
  - '**/*.txt'
@@ -80,6 +82,7 @@ states:
80
82
 
81
83
  implementation:
82
84
  description: 'Building the solution according to design'
85
+ required_capability: 'coding'
83
86
  allowed_file_patterns:
84
87
  - '**/*'
85
88
  default_instructions: |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-opencode-tui",
3
- "version": "6.20.2",
3
+ "version": "6.22.0",
4
4
  "description": "OpenCode TUI sidebar plugin that displays the current responsible-vibe workflow phase and name",
5
5
  "main": "workflows-phase.tsx",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-visualizer",
3
- "version": "6.20.2",
3
+ "version": "6.22.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.ts",
6
6
  "module": "dist/index.ts",
@@ -82,6 +82,10 @@
82
82
  },
83
83
  "description": "Glob patterns for files that can be edited in this state. Use '**/*' to allow all files."
84
84
  },
85
+ "required_capability": {
86
+ "type": "string",
87
+ "description": "Optional capability hint for this phase. If absent, no capability routing is applied. Free-form string; conventional values are `thinking`, `research`, `coding`. See `.vibe/config.yaml` `capability_models` for optional model/agent mapping."
88
+ },
85
89
  "default_instructions": {
86
90
  "type": "string",
87
91
  "description": "Default instructions when entering this state"