@codemcp/workflows 6.20.2 → 6.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/package.json +2 -2
  2. package/packages/cli/dist/{chunk-4N42FFJE.js → chunk-KWAFQZUI.js} +91 -2670
  3. package/packages/cli/dist/{cli-MFHC7UWY.js → cli-O52P3RVC.js} +468 -33
  4. package/packages/cli/dist/{dist-ISN3FRV4.js → dist-FIUD5G5U.js} +65 -4
  5. package/packages/cli/dist/{dist-TDV3DJ2J.js → dist-ZTAPC4IK.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/package.json +1 -1
  32. package/packages/core/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  33. package/packages/core/resources/templates/opencode-agents/research.md.tmpl +13 -0
  34. package/packages/core/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  35. package/packages/core/resources/workflows/bugfix.yaml +6 -0
  36. package/packages/core/resources/workflows/epcc.yaml +3 -0
  37. package/packages/core/resources/workflows/greenfield.yaml +3 -0
  38. package/packages/core/resources/workflows/pr-review.yaml +2 -0
  39. package/packages/core/resources/workflows/qrspi.yaml +5 -0
  40. package/packages/core/resources/workflows/tdd.yaml +3 -0
  41. package/packages/core/resources/workflows/waterfall.yaml +3 -0
  42. package/packages/docs/.vitepress/dist/404.html +1 -1
  43. package/packages/docs/.vitepress/dist/assets/user_capability-routing.md.DbNKvMiS.js +15 -0
  44. package/packages/docs/.vitepress/dist/assets/user_capability-routing.md.DbNKvMiS.lean.js +1 -0
  45. package/packages/docs/.vitepress/dist/dev/ARCHITECTURE.html +2 -2
  46. package/packages/docs/.vitepress/dist/dev/DEVELOPMENT.html +2 -2
  47. package/packages/docs/.vitepress/dist/dev/LOGGING.html +2 -2
  48. package/packages/docs/.vitepress/dist/dev/PUBLISHING.html +2 -2
  49. package/packages/docs/.vitepress/dist/hashmap.json +1 -1
  50. package/packages/docs/.vitepress/dist/index.html +2 -2
  51. package/packages/docs/.vitepress/dist/user/advanced-engineering.html +3 -3
  52. package/packages/docs/.vitepress/dist/user/agent-setup.html +3 -3
  53. package/packages/docs/.vitepress/dist/user/beads-integration.html +2 -2
  54. package/packages/docs/.vitepress/dist/user/capability-routing.html +40 -0
  55. package/packages/docs/.vitepress/dist/user/crowd-mcp-integration.html +2 -2
  56. package/packages/docs/.vitepress/dist/user/custom-workflows.html +2 -2
  57. package/packages/docs/.vitepress/dist/user/git-commit-feature.html +2 -2
  58. package/packages/docs/.vitepress/dist/user/how-it-works.html +2 -2
  59. package/packages/docs/.vitepress/dist/user/long-term-memory.html +2 -2
  60. package/packages/docs/.vitepress/dist/user/packaged-workflows.html +2 -2
  61. package/packages/docs/.vitepress/dist/user/tutorial.html +2 -2
  62. package/packages/docs/.vitepress/dist/user/workflow-selection.html +2 -2
  63. package/packages/docs/.vitepress/dist/workflows/adr.html +1 -1
  64. package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.html +1 -1
  65. package/packages/docs/.vitepress/dist/workflows/boundary-testing.html +1 -1
  66. package/packages/docs/.vitepress/dist/workflows/bugfix.html +1 -1
  67. package/packages/docs/.vitepress/dist/workflows/bugfix.yaml +6 -0
  68. package/packages/docs/.vitepress/dist/workflows/business-analysis.html +1 -1
  69. package/packages/docs/.vitepress/dist/workflows/c4-analysis.html +1 -1
  70. package/packages/docs/.vitepress/dist/workflows/epcc.html +1 -1
  71. package/packages/docs/.vitepress/dist/workflows/epcc.yaml +3 -0
  72. package/packages/docs/.vitepress/dist/workflows/game-beginner.html +1 -1
  73. package/packages/docs/.vitepress/dist/workflows/greenfield.html +1 -1
  74. package/packages/docs/.vitepress/dist/workflows/greenfield.yaml +3 -0
  75. package/packages/docs/.vitepress/dist/workflows/minor.html +1 -1
  76. package/packages/docs/.vitepress/dist/workflows/posts.html +1 -1
  77. package/packages/docs/.vitepress/dist/workflows/pr-review.html +1 -1
  78. package/packages/docs/.vitepress/dist/workflows/pr-review.yaml +2 -0
  79. package/packages/docs/.vitepress/dist/workflows/qrspi.html +1 -1
  80. package/packages/docs/.vitepress/dist/workflows/qrspi.yaml +5 -0
  81. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.html +1 -1
  82. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.html +1 -1
  83. package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.html +1 -1
  84. package/packages/docs/.vitepress/dist/workflows/sdd-feature.html +1 -1
  85. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.html +1 -1
  86. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.html +1 -1
  87. package/packages/docs/.vitepress/dist/workflows/skilled-bugfix.html +1 -1
  88. package/packages/docs/.vitepress/dist/workflows/skilled-epcc.html +1 -1
  89. package/packages/docs/.vitepress/dist/workflows/skilled-greenfield.html +1 -1
  90. package/packages/docs/.vitepress/dist/workflows/slides.html +1 -1
  91. package/packages/docs/.vitepress/dist/workflows/tdd.html +1 -1
  92. package/packages/docs/.vitepress/dist/workflows/tdd.yaml +3 -0
  93. package/packages/docs/.vitepress/dist/workflows/waterfall.html +1 -1
  94. package/packages/docs/.vitepress/dist/workflows/waterfall.yaml +3 -0
  95. package/packages/docs/.vitepress/dist/workflows.html +1 -1
  96. package/packages/docs/package.json +1 -1
  97. package/packages/mcp-server/dist/index.js +67 -4
  98. package/packages/mcp-server/package.json +1 -1
  99. package/packages/mcp-server/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  100. package/packages/mcp-server/resources/templates/opencode-agents/research.md.tmpl +13 -0
  101. package/packages/mcp-server/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  102. package/packages/mcp-server/resources/workflows/bugfix.yaml +6 -0
  103. package/packages/mcp-server/resources/workflows/epcc.yaml +3 -0
  104. package/packages/mcp-server/resources/workflows/greenfield.yaml +3 -0
  105. package/packages/mcp-server/resources/workflows/pr-review.yaml +2 -0
  106. package/packages/mcp-server/resources/workflows/qrspi.yaml +5 -0
  107. package/packages/mcp-server/resources/workflows/tdd.yaml +3 -0
  108. package/packages/mcp-server/resources/workflows/waterfall.yaml +3 -0
  109. package/packages/opencode-plugin/dist/index.js +67 -4
  110. package/packages/opencode-plugin/package.json +1 -1
  111. package/packages/opencode-plugin/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  112. package/packages/opencode-plugin/resources/templates/opencode-agents/research.md.tmpl +13 -0
  113. package/packages/opencode-plugin/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  114. package/packages/opencode-plugin/resources/workflows/bugfix.yaml +6 -0
  115. package/packages/opencode-plugin/resources/workflows/epcc.yaml +3 -0
  116. package/packages/opencode-plugin/resources/workflows/greenfield.yaml +3 -0
  117. package/packages/opencode-plugin/resources/workflows/pr-review.yaml +2 -0
  118. package/packages/opencode-plugin/resources/workflows/qrspi.yaml +5 -0
  119. package/packages/opencode-plugin/resources/workflows/tdd.yaml +3 -0
  120. package/packages/opencode-plugin/resources/workflows/waterfall.yaml +3 -0
  121. package/packages/opencode-tui-plugin/package.json +1 -1
  122. package/packages/visualizer/package.json +1 -1
  123. package/resources/state-machine-schema.json +4 -0
  124. package/resources/templates/opencode-agents/coding.md.tmpl +13 -0
  125. package/resources/templates/opencode-agents/research.md.tmpl +13 -0
  126. package/resources/templates/opencode-agents/thinking.md.tmpl +13 -0
  127. package/resources/workflows/bugfix.yaml +6 -0
  128. package/resources/workflows/epcc.yaml +3 -0
  129. package/resources/workflows/greenfield.yaml +3 -0
  130. package/resources/workflows/pr-review.yaml +2 -0
  131. package/resources/workflows/qrspi.yaml +5 -0
  132. package/resources/workflows/tdd.yaml +3 -0
  133. package/resources/workflows/waterfall.yaml +3 -0
@@ -7153,7 +7153,8 @@ var ConfigManager = class {
7153
7153
  this.validateConfig(config, configPath);
7154
7154
  logger3.info("Loaded project configuration", {
7155
7155
  configPath,
7156
- enabledWorkflows: config.enabled_workflows?.length || 0
7156
+ enabledWorkflows: config.enabled_workflows?.length || 0,
7157
+ capabilityModels: config.capability_models ? Object.keys(config.capability_models).length : 0
7157
7158
  });
7158
7159
  return config;
7159
7160
  } catch (error) {
@@ -7183,6 +7184,23 @@ var ConfigManager = class {
7183
7184
  }
7184
7185
  }
7185
7186
  }
7187
+ if (config.capability_models !== void 0) {
7188
+ if (typeof config.capability_models !== "object" || config.capability_models === null || Array.isArray(config.capability_models)) {
7189
+ throw new Error(`Invalid config file ${configPath}: capability_models must be an object`);
7190
+ }
7191
+ for (const [key, entry] of Object.entries(config.capability_models)) {
7192
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
7193
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' must be an object`);
7194
+ }
7195
+ const { model, agent } = entry;
7196
+ if (model !== void 0 && (typeof model !== "string" || model.trim() === "")) {
7197
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' model must be a non-empty string`);
7198
+ }
7199
+ if (agent !== void 0 && (typeof agent !== "string" || agent.trim() === "")) {
7200
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' agent must be a non-empty string`);
7201
+ }
7202
+ }
7203
+ }
7186
7204
  }
7187
7205
  };
7188
7206
  var logger4 = createLogger("WorkflowManager");
@@ -10081,6 +10099,29 @@ var BeadsStateManager = class {
10081
10099
  }
10082
10100
  }
10083
10101
  };
10102
+ var CAPABILITY_DESCRIPTIONS = {
10103
+ thinking: "deep reasoning, complex planning",
10104
+ research: "fast information gathering and browsing"
10105
+ };
10106
+ function formatCapabilityHint(capability, config) {
10107
+ if (!capability) {
10108
+ return "";
10109
+ }
10110
+ const description = CAPABILITY_DESCRIPTIONS[capability];
10111
+ const label = description ? `Capability hint: This phase requires ${capability} capability (${description}).` : `Capability hint: This phase requires ${capability} capability.`;
10112
+ const model = config?.model;
10113
+ const agent = config?.agent;
10114
+ if (agent && model) {
10115
+ return `${label} When launching subagents, use agent: ${agent} (model: ${model}).`;
10116
+ }
10117
+ if (agent) {
10118
+ return `${label} When launching subagents, use agent: ${agent}.`;
10119
+ }
10120
+ if (model) {
10121
+ return `${label} When launching subagents, prefer model: ${model}.`;
10122
+ }
10123
+ return label;
10124
+ }
10084
10125
  var logger12 = createLogger("InteractionLogger");
10085
10126
  var InteractionLogger = class {
10086
10127
  database;
@@ -10204,7 +10245,7 @@ var InstructionGenerator = class {
10204
10245
  * Enhance base instructions with context-specific information
10205
10246
  */
10206
10247
  async enhanceInstructions(baseInstructions, context) {
10207
- const { phase, conversationContext, allowedFilePatterns } = context;
10248
+ const { phase, conversationContext, allowedFilePatterns, requiredCapability, capabilityConfig } = context;
10208
10249
  const phaseName = capitalizePhase(phase);
10209
10250
  let workflowSection = `---
10210
10251
  ### YOU MUST FOLLOW THESE INSTRUCTIONS:
@@ -10219,6 +10260,12 @@ var InstructionGenerator = class {
10219
10260
  if (allowedFilePatterns && allowedFilePatterns.length > 0 && !allowedFilePatterns.includes("**/*") && !allowedFilePatterns.includes("*")) {
10220
10261
  workflowSection += `
10221
10262
  - Files allowed: \`${allowedFilePatterns.join("`, `")}\``;
10263
+ }
10264
+ const capabilityHint = formatCapabilityHint(requiredCapability, capabilityConfig);
10265
+ if (capabilityHint) {
10266
+ workflowSection += `
10267
+
10268
+ ${capabilityHint}`;
10222
10269
  }
10223
10270
  workflowSection += "\n\nCall `whats_next()` after user messages.";
10224
10271
  return `## ${phaseName} Phase
@@ -12254,6 +12301,11 @@ var WhatsNextHandler = class extends ConversationRequiredToolHandler {
12254
12301
  );
12255
12302
  const phaseState = stateMachine.states[transitionResult.newPhase];
12256
12303
  const allowedFilePatterns = phaseState?.allowed_file_patterns ?? ["**/*"];
12304
+ const requiredCapability = phaseState?.required_capability;
12305
+ const projectConfig = ConfigManager.loadProjectConfig(
12306
+ conversationContext.projectPath
12307
+ );
12308
+ const capabilityConfig = requiredCapability ? projectConfig?.capability_models?.[requiredCapability] : void 0;
12257
12309
  const instructions = await context.instructionGenerator.generateInstructions(
12258
12310
  transitionResult.instructions,
12259
12311
  {
@@ -12265,7 +12317,9 @@ var WhatsNextHandler = class extends ConversationRequiredToolHandler {
12265
12317
  transitionReason: transitionResult.transitionReason,
12266
12318
  isModeled: transitionResult.isModeled,
12267
12319
  instructionSource: "whats_next",
12268
- allowedFilePatterns
12320
+ allowedFilePatterns,
12321
+ requiredCapability,
12322
+ capabilityConfig
12269
12323
  }
12270
12324
  );
12271
12325
  let finalInstructions = instructions.instructions;
@@ -12424,6 +12478,11 @@ var ProceedToPhaseHandler = class extends ConversationRequiredToolHandler {
12424
12478
  );
12425
12479
  const phaseState = stateMachine.states[transitionResult.newPhase];
12426
12480
  const allowedFilePatterns = phaseState?.allowed_file_patterns ?? ["**/*"];
12481
+ const requiredCapability = phaseState?.required_capability;
12482
+ const projectConfig = ConfigManager.loadProjectConfig(
12483
+ conversationContext.projectPath
12484
+ );
12485
+ const capabilityConfig = requiredCapability ? projectConfig?.capability_models?.[requiredCapability] : void 0;
12427
12486
  const instructions = await context.instructionGenerator.generateInstructions(
12428
12487
  transitionResult.instructions,
12429
12488
  {
@@ -12435,7 +12494,9 @@ var ProceedToPhaseHandler = class extends ConversationRequiredToolHandler {
12435
12494
  transitionReason: transitionResult.transitionReason,
12436
12495
  isModeled: transitionResult.isModeled,
12437
12496
  instructionSource: "proceed_to_phase",
12438
- allowedFilePatterns
12497
+ allowedFilePatterns,
12498
+ requiredCapability,
12499
+ capabilityConfig
12439
12500
  }
12440
12501
  );
12441
12502
  let finalInstructions = instructions.instructions;
@@ -20,13 +20,14 @@ import {
20
20
  capitalizePhase,
21
21
  clearLogSink,
22
22
  createLogger,
23
+ formatCapabilityHint,
23
24
  generateSystemPrompt,
24
25
  getPathBasename,
25
26
  logger,
26
27
  registerLogSink,
27
28
  setLoggingLevel,
28
29
  setLoggingLevelFromString
29
- } from "./chunk-4N42FFJE.js";
30
+ } from "./chunk-KWAFQZUI.js";
30
31
  import "./chunk-R5U7XKVJ.js";
31
32
  export {
32
33
  BeadsIntegration,
@@ -50,6 +51,7 @@ export {
50
51
  capitalizePhase,
51
52
  clearLogSink,
52
53
  createLogger,
54
+ formatCapabilityHint,
53
55
  generateSystemPrompt,
54
56
  getPathBasename,
55
57
  logger,
@@ -10,7 +10,7 @@ var args = process.argv.slice(2);
10
10
  if (args.length === 0) {
11
11
  const isLocal = existsSync(join(__dirname, "../../mcp-server/dist/index.js"));
12
12
  if (isLocal) {
13
- const { startMcpServer } = await import("./dist-ISN3FRV4.js");
13
+ const { startMcpServer } = await import("./dist-FIUD5G5U.js");
14
14
  await startMcpServer();
15
15
  } else {
16
16
  const mcpServerModule = "@codemcp/workflows-server";
@@ -18,6 +18,6 @@ if (args.length === 0) {
18
18
  await startMcpServer();
19
19
  }
20
20
  } else {
21
- const { runCli } = await import("./cli-MFHC7UWY.js");
21
+ const { runCli } = await import("./cli-O52P3RVC.js");
22
22
  await runCli();
23
23
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-cli",
3
- "version": "6.20.2",
3
+ "version": "6.21.0",
4
4
  "description": "CLI tools for responsible-vibe development workflows",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -14,10 +14,13 @@
14
14
  "format:check": "prettier --check .",
15
15
  "format": "prettier --write ."
16
16
  },
17
- "dependencies": {},
17
+ "dependencies": {
18
+ "js-yaml": "4.1.1"
19
+ },
18
20
  "devDependencies": {
19
21
  "@codemcp/workflows-core": "workspace:*",
20
22
  "@codemcp/workflows-server": "workspace:*",
23
+ "@types/js-yaml": "4.0.9",
21
24
  "@types/node": "^22.0.0",
22
25
  "rimraf": "^5.0.10",
23
26
  "tsup": "^8.0.0",
@@ -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: |
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Capability hint formatter
3
+ *
4
+ * Pure helper that renders an instruction-based "Capability hint" sentence so
5
+ * the LLM picks a good model/agent for subagent work in a given phase. The
6
+ * mechanism is intentionally instruction-based (no API model switching) and
7
+ * fully opt-in: absent a capability, the helper returns an empty string and
8
+ * there is no behavioral change.
9
+ *
10
+ * Built-in human-readable descriptions exist ONLY for `thinking` and
11
+ * `research`. `coding` is deliberately omitted as self-evident, and any
12
+ * unknown/custom term is echoed verbatim without a parenthetical.
13
+ */
14
+ /**
15
+ * Optional model/agent routing configuration consumed by the clause builder.
16
+ */
17
+ export interface CapabilityConfig {
18
+ model?: string;
19
+ agent?: string;
20
+ }
21
+ /**
22
+ * Format a capability hint instruction sentence.
23
+ *
24
+ * @returns The full hint text, or `""` when `capability` is falsy. The hint
25
+ * is one sentence by default; when `config` declares model/agent a second
26
+ * sentence (the subagent clause) is appended.
27
+ */
28
+ export declare function formatCapabilityHint(capability: string | undefined, config?: CapabilityConfig): string;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Capability hint formatter
3
+ *
4
+ * Pure helper that renders an instruction-based "Capability hint" sentence so
5
+ * the LLM picks a good model/agent for subagent work in a given phase. The
6
+ * mechanism is intentionally instruction-based (no API model switching) and
7
+ * fully opt-in: absent a capability, the helper returns an empty string and
8
+ * there is no behavioral change.
9
+ *
10
+ * Built-in human-readable descriptions exist ONLY for `thinking` and
11
+ * `research`. `coding` is deliberately omitted as self-evident, and any
12
+ * unknown/custom term is echoed verbatim without a parenthetical.
13
+ */
14
+ /**
15
+ * Built-in human-readable descriptions for known capabilities. `coding` is
16
+ * INTENTIONALLY ABSENT because it is self-evident.
17
+ */
18
+ const CAPABILITY_DESCRIPTIONS = {
19
+ thinking: 'deep reasoning, complex planning',
20
+ research: 'fast information gathering and browsing',
21
+ };
22
+ /**
23
+ * Format a capability hint instruction sentence.
24
+ *
25
+ * @returns The full hint text, or `""` when `capability` is falsy. The hint
26
+ * is one sentence by default; when `config` declares model/agent a second
27
+ * sentence (the subagent clause) is appended.
28
+ */
29
+ export function formatCapabilityHint(capability, config) {
30
+ if (!capability) {
31
+ return '';
32
+ }
33
+ // Label sentence with optional parenthetical description.
34
+ const description = CAPABILITY_DESCRIPTIONS[capability];
35
+ const label = description
36
+ ? `Capability hint: This phase requires ${capability} capability (${description}).`
37
+ : `Capability hint: This phase requires ${capability} capability.`;
38
+ // Subagent clause (emitted only when model and/or agent is configured).
39
+ const model = config?.model;
40
+ const agent = config?.agent;
41
+ if (agent && model) {
42
+ return `${label} When launching subagents, use agent: ${agent} (model: ${model}).`;
43
+ }
44
+ if (agent) {
45
+ return `${label} When launching subagents, use agent: ${agent}.`;
46
+ }
47
+ if (model) {
48
+ return `${label} When launching subagents, prefer model: ${model}.`;
49
+ }
50
+ return label;
51
+ }
52
+ //# sourceMappingURL=capability-hint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-hint.js","sourceRoot":"","sources":["../src/capability-hint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH;;;GAGG;AACH,MAAM,uBAAuB,GAA2B;IACtD,QAAQ,EAAE,kCAAkC;IAC5C,QAAQ,EAAE,yCAAyC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAA8B,EAC9B,MAAyB;IAEzB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,0DAA0D;IAC1D,MAAM,WAAW,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,WAAW;QACvB,CAAC,CAAC,wCAAwC,UAAU,gBAAgB,WAAW,IAAI;QACnF,CAAC,CAAC,wCAAwC,UAAU,cAAc,CAAC;IAErE,wEAAwE;IACxE,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,CAAC;IAC5B,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,CAAC;IAE5B,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;QACnB,OAAO,GAAG,KAAK,yCAAyC,KAAK,YAAY,KAAK,IAAI,CAAC;IACrF,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,GAAG,KAAK,yCAAyC,KAAK,GAAG,CAAC;IACnE,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,GAAG,KAAK,4CAA4C,KAAK,GAAG,CAAC;IACtE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -5,6 +5,25 @@
5
5
  */
6
6
  export interface ProjectConfig {
7
7
  enabled_workflows?: string[];
8
+ /**
9
+ * Optional capability→model/agent routing map.
10
+ *
11
+ * Keys are capability strings declared on workflow phases via
12
+ * `required_capability` (e.g. `thinking`, `research`, `coding`, or any
13
+ * custom term). Each value is an object with optional `model` and `agent`
14
+ * fields used to enrich the capability hint instruction. Absent ⇒ no
15
+ * model/agent clause (opt-in). An empty entry object `{}` is allowed and
16
+ * is a no-op (no model, no agent).
17
+ * @example
18
+ * capability_models:
19
+ * thinking:
20
+ * model: anthropic/claude-opus-4-7
21
+ * agent: general_thinking
22
+ */
23
+ capability_models?: Record<string, {
24
+ model?: string;
25
+ agent?: string;
26
+ }>;
8
27
  }
9
28
  /**
10
29
  * Manages project configuration loading and validation
@@ -32,6 +32,9 @@ export class ConfigManager {
32
32
  logger.info('Loaded project configuration', {
33
33
  configPath,
34
34
  enabledWorkflows: config.enabled_workflows?.length || 0,
35
+ capabilityModels: config.capability_models
36
+ ? Object.keys(config.capability_models).length
37
+ : 0,
35
38
  });
36
39
  return config;
37
40
  }
@@ -63,6 +66,29 @@ export class ConfigManager {
63
66
  }
64
67
  }
65
68
  }
69
+ if (config.capability_models !== undefined) {
70
+ if (typeof config.capability_models !== 'object' ||
71
+ config.capability_models === null ||
72
+ Array.isArray(config.capability_models)) {
73
+ throw new Error(`Invalid config file ${configPath}: capability_models must be an object`);
74
+ }
75
+ for (const [key, entry] of Object.entries(config.capability_models)) {
76
+ if (entry === null ||
77
+ typeof entry !== 'object' ||
78
+ Array.isArray(entry)) {
79
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' must be an object`);
80
+ }
81
+ const { model, agent } = entry;
82
+ if (model !== undefined &&
83
+ (typeof model !== 'string' || model.trim() === '')) {
84
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' model must be a non-empty string`);
85
+ }
86
+ if (agent !== undefined &&
87
+ (typeof agent !== 'string' || agent.trim() === '')) {
88
+ throw new Error(`Invalid config file ${configPath}: capability_models entry '${key}' agent must be a non-empty string`);
89
+ }
90
+ }
91
+ }
66
92
  }
67
93
  }
68
94
  //# sourceMappingURL=config-manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-manager.js","sourceRoot":"","sources":["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AAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACpE,IACE,KAAK,KAAK,IAAI;oBACd,OAAO,KAAK,KAAK,QAAQ;oBACzB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,CAAC;oBACD,MAAM,IAAI,KAAK,CACb,uBAAuB,UAAU,8BAA8B,GAAG,qBAAqB,CACxF,CAAC;gBACJ,CAAC;gBAED,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;gBAC/B,IACE,KAAK,KAAK,SAAS;oBACnB,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAClD,CAAC;oBACD,MAAM,IAAI,KAAK,CACb,uBAAuB,UAAU,8BAA8B,GAAG,oCAAoC,CACvG,CAAC;gBACJ,CAAC;gBACD,IACE,KAAK,KAAK,SAAS;oBACnB,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAClD,CAAC;oBACD,MAAM,IAAI,KAAK,CACb,uBAAuB,UAAU,8BAA8B,GAAG,oCAAoC,CACvG,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC"}
@@ -16,6 +16,7 @@ export * from './git-manager.js';
16
16
  export * from './task-backend.js';
17
17
  export * from './beads-integration.js';
18
18
  export * from './beads-state-manager.js';
19
+ export * from './capability-hint.js';
19
20
  export * from './string-utils.js';
20
21
  export * from './logger.js';
21
22
  export * from './interaction-logger.js';
@@ -22,6 +22,7 @@ export * from './task-backend.js';
22
22
  export * from './beads-integration.js';
23
23
  export * from './beads-state-manager.js';
24
24
  // Utilities and generators
25
+ export * from './capability-hint.js';
25
26
  export * from './string-utils.js';
26
27
  export * from './logger.js';
27
28
  export * from './interaction-logger.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AAEzC,8BAA8B;AAC9B,cAAc,uBAAuB,CAAC;AAEtC,wCAAwC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AAEvC,kBAAkB;AAClB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAE1C,8BAA8B;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AAEzC,2BAA2B;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AAEzC,8BAA8B;AAC9B,cAAc,uBAAuB,CAAC;AAEtC,wCAAwC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AAEvC,kBAAkB;AAClB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAE1C,8BAA8B;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AAEzC,2BAA2B;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC"}
@@ -9,6 +9,7 @@
9
9
  import { ProjectDocsManager } from './project-docs-manager.js';
10
10
  import { createLogger } from './logger.js';
11
11
  import { capitalizePhase } from './string-utils.js';
12
+ import { formatCapabilityHint } from './capability-hint.js';
12
13
  export class InstructionGenerator {
13
14
  projectDocsManager;
14
15
  constructor(logger = createLogger('InstructionGenerator')) {
@@ -61,7 +62,7 @@ export class InstructionGenerator {
61
62
  * Enhance base instructions with context-specific information
62
63
  */
63
64
  async enhanceInstructions(baseInstructions, context) {
64
- const { phase, conversationContext, allowedFilePatterns } = context;
65
+ const { phase, conversationContext, allowedFilePatterns, requiredCapability, capabilityConfig, } = context;
65
66
  const phaseName = capitalizePhase(phase);
66
67
  // IMPORTANT: Directive markers to make instructions stand out from context
67
68
  let workflowSection = `---
@@ -81,6 +82,11 @@ export class InstructionGenerator {
81
82
  !allowedFilePatterns.includes('*')) {
82
83
  workflowSection += `\n- Files allowed: \`${allowedFilePatterns.join('`, `')}\``;
83
84
  }
85
+ // Append optional capability hint. Opt-in: empty hint ⇒ skip entirely.
86
+ const capabilityHint = formatCapabilityHint(requiredCapability, capabilityConfig);
87
+ if (capabilityHint) {
88
+ workflowSection += `\n\n${capabilityHint}`;
89
+ }
84
90
  workflowSection += '\n\nCall `whats_next()` after user messages.';
85
91
  return `## ${phaseName} Phase\n\n${baseInstructions}\n\n${workflowSection}`;
86
92
  }