@cubis/foundry 0.3.69 → 0.3.71

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 (180) hide show
  1. package/dist/cli/core.js +95 -2
  2. package/dist/cli/core.js.map +1 -1
  3. package/dist/cli/init/execute.js +6 -4
  4. package/dist/cli/init/execute.js.map +1 -1
  5. package/dist/cli/init/prompts.js +5 -0
  6. package/dist/cli/init/prompts.js.map +1 -1
  7. package/mcp/src/cbxConfig/index.ts +6 -1
  8. package/mcp/src/cbxConfig/serviceConfig.ts +38 -3
  9. package/mcp/src/cbxConfig/types.ts +6 -0
  10. package/mcp/src/gateway/config.ts +69 -8
  11. package/mcp/src/gateway/manager.ts +17 -6
  12. package/mcp/src/gateway/types.ts +1 -1
  13. package/mcp/src/server.ts +7 -3
  14. package/mcp/src/tools/playwrightGetStatus.ts +60 -0
  15. package/mcp/src/tools/registry.test.ts +26 -8
  16. package/mcp/src/tools/registry.ts +27 -1
  17. package/mcp/src/upstream/passthrough.ts +29 -5
  18. package/package.json +1 -1
  19. package/src/cli/core.ts +100 -5
  20. package/src/cli/init/execute.ts +14 -5
  21. package/src/cli/init/prompts.ts +5 -0
  22. package/src/cli/init/types.ts +1 -1
  23. package/workflows/powers/ask-questions-if-underspecified/SKILL.md +51 -3
  24. package/workflows/powers/behavioral-modes/SKILL.md +100 -9
  25. package/workflows/skills/agent-design/SKILL.md +198 -0
  26. package/workflows/skills/agent-design/references/clarification-patterns.md +153 -0
  27. package/workflows/skills/agent-design/references/skill-testing.md +164 -0
  28. package/workflows/skills/agent-design/references/workflow-patterns.md +226 -0
  29. package/workflows/skills/deep-research/SKILL.md +25 -20
  30. package/workflows/skills/deep-research/references/multi-round-research-loop.md +73 -8
  31. package/workflows/skills/frontend-design/SKILL.md +37 -32
  32. package/workflows/skills/frontend-design/commands/brand.md +167 -0
  33. package/workflows/skills/frontend-design/references/brand-presets.md +228 -0
  34. package/workflows/skills/generated/skill-audit.json +11 -2
  35. package/workflows/skills/generated/skill-catalog.json +842 -107
  36. package/workflows/skills/playwright-e2e/SKILL.md +21 -5
  37. package/workflows/skills/playwright-e2e/references/locator-trace-flake-checklist.md +28 -0
  38. package/workflows/skills/skills_index.json +803 -100
  39. package/workflows/workflows/agent-environment-setup/manifest.json +65 -9
  40. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/backend-specialist.md +6 -0
  41. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/code-archaeologist.md +7 -0
  42. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/database-architect.md +6 -0
  43. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/debugger.md +7 -0
  44. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/devops-engineer.md +6 -0
  45. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/documentation-writer.md +4 -0
  46. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/frontend-specialist.md +6 -0
  47. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/game-developer.md +1 -0
  48. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/mobile-developer.md +6 -0
  49. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/orchestrator.md +8 -0
  50. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/penetration-tester.md +4 -0
  51. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/performance-optimizer.md +4 -0
  52. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/product-manager.md +1 -0
  53. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/project-planner.md +8 -0
  54. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/qa-automation-engineer.md +1 -0
  55. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/researcher.md +5 -0
  56. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/security-auditor.md +6 -0
  57. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/seo-specialist.md +1 -0
  58. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/sre-engineer.md +6 -0
  59. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/test-engineer.md +5 -0
  60. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/validator.md +1 -0
  61. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/vercel-expert.md +1 -0
  62. package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +1 -1
  63. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/backend-specialist.md +6 -0
  64. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/code-archaeologist.md +7 -0
  65. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/database-architect.md +6 -0
  66. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/debugger.md +7 -0
  67. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/devops-engineer.md +6 -0
  68. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/documentation-writer.md +4 -0
  69. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/frontend-specialist.md +6 -0
  70. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/game-developer.md +1 -0
  71. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/mobile-developer.md +6 -0
  72. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/orchestrator.md +8 -0
  73. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/penetration-tester.md +4 -0
  74. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/performance-optimizer.md +4 -0
  75. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/product-manager.md +1 -0
  76. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/project-planner.md +8 -0
  77. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/qa-automation-engineer.md +1 -0
  78. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/researcher.md +5 -0
  79. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/security-auditor.md +6 -0
  80. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/seo-specialist.md +1 -0
  81. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/sre-engineer.md +6 -0
  82. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/test-engineer.md +5 -0
  83. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/validator.md +1 -0
  84. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/vercel-expert.md +1 -0
  85. package/workflows/workflows/agent-environment-setup/platforms/claude/rules/CLAUDE.md +77 -63
  86. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/agent-design/SKILL.md +198 -0
  87. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/agent-design/references/clarification-patterns.md +153 -0
  88. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/agent-design/references/skill-testing.md +164 -0
  89. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/agent-design/references/workflow-patterns.md +226 -0
  90. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/SKILL.md +25 -20
  91. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/references/multi-round-research-loop.md +73 -8
  92. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/frontend-design/SKILL.md +37 -32
  93. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/frontend-design/commands/brand.md +167 -0
  94. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/frontend-design/references/brand-presets.md +228 -0
  95. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/playwright-e2e/SKILL.md +21 -5
  96. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/playwright-e2e/references/locator-trace-flake-checklist.md +28 -0
  97. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/skills_index.json +803 -100
  98. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/backend-specialist.md +6 -0
  99. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/code-archaeologist.md +7 -0
  100. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/database-architect.md +6 -0
  101. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/debugger.md +7 -0
  102. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/devops-engineer.md +6 -0
  103. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/documentation-writer.md +4 -0
  104. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/frontend-specialist.md +6 -0
  105. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/game-developer.md +1 -0
  106. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/mobile-developer.md +6 -0
  107. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/orchestrator.md +8 -0
  108. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/penetration-tester.md +4 -0
  109. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/performance-optimizer.md +4 -0
  110. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/product-manager.md +1 -0
  111. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/project-planner.md +8 -0
  112. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/qa-automation-engineer.md +1 -0
  113. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/researcher.md +5 -0
  114. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/security-auditor.md +6 -0
  115. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/seo-specialist.md +1 -0
  116. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/sre-engineer.md +6 -0
  117. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/test-engineer.md +5 -0
  118. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/validator.md +1 -0
  119. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/vercel-expert.md +1 -0
  120. package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +1 -1
  121. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/backend-specialist.md +5 -0
  122. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/code-archaeologist.md +5 -0
  123. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/database-architect.md +5 -0
  124. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/debugger.md +5 -0
  125. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/devops-engineer.md +5 -0
  126. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/documentation-writer.md +3 -0
  127. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/frontend-specialist.md +5 -0
  128. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/mobile-developer.md +5 -0
  129. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/orchestrator.md +6 -0
  130. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/penetration-tester.md +3 -0
  131. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/performance-optimizer.md +3 -0
  132. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/project-planner.md +6 -0
  133. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/researcher.md +3 -0
  134. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/security-auditor.md +5 -0
  135. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/sre-engineer.md +5 -0
  136. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/test-engineer.md +3 -0
  137. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +87 -82
  138. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/agent-design/SKILL.md +197 -0
  139. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/agent-design/references/clarification-patterns.md +153 -0
  140. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/agent-design/references/skill-testing.md +164 -0
  141. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/agent-design/references/workflow-patterns.md +226 -0
  142. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/SKILL.md +25 -20
  143. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/references/multi-round-research-loop.md +73 -8
  144. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/frontend-design/SKILL.md +37 -32
  145. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/frontend-design/commands/brand.md +167 -0
  146. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/frontend-design/references/brand-presets.md +228 -0
  147. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/playwright-e2e/SKILL.md +21 -5
  148. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/playwright-e2e/references/locator-trace-flake-checklist.md +28 -0
  149. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/skills_index.json +803 -100
  150. package/workflows/workflows/agent-environment-setup/shared/agents/backend-specialist.md +6 -0
  151. package/workflows/workflows/agent-environment-setup/shared/agents/code-archaeologist.md +7 -0
  152. package/workflows/workflows/agent-environment-setup/shared/agents/database-architect.md +6 -0
  153. package/workflows/workflows/agent-environment-setup/shared/agents/debugger.md +7 -0
  154. package/workflows/workflows/agent-environment-setup/shared/agents/devops-engineer.md +6 -0
  155. package/workflows/workflows/agent-environment-setup/shared/agents/documentation-writer.md +4 -0
  156. package/workflows/workflows/agent-environment-setup/shared/agents/frontend-specialist.md +6 -0
  157. package/workflows/workflows/agent-environment-setup/shared/agents/game-developer.md +1 -0
  158. package/workflows/workflows/agent-environment-setup/shared/agents/mobile-developer.md +6 -0
  159. package/workflows/workflows/agent-environment-setup/shared/agents/orchestrator.md +8 -0
  160. package/workflows/workflows/agent-environment-setup/shared/agents/penetration-tester.md +4 -0
  161. package/workflows/workflows/agent-environment-setup/shared/agents/performance-optimizer.md +4 -0
  162. package/workflows/workflows/agent-environment-setup/shared/agents/product-manager.md +1 -0
  163. package/workflows/workflows/agent-environment-setup/shared/agents/project-planner.md +8 -0
  164. package/workflows/workflows/agent-environment-setup/shared/agents/qa-automation-engineer.md +1 -0
  165. package/workflows/workflows/agent-environment-setup/shared/agents/researcher.md +5 -0
  166. package/workflows/workflows/agent-environment-setup/shared/agents/security-auditor.md +6 -0
  167. package/workflows/workflows/agent-environment-setup/shared/agents/seo-specialist.md +1 -0
  168. package/workflows/workflows/agent-environment-setup/shared/agents/sre-engineer.md +6 -0
  169. package/workflows/workflows/agent-environment-setup/shared/agents/test-engineer.md +5 -0
  170. package/workflows/workflows/agent-environment-setup/shared/agents/validator.md +1 -0
  171. package/workflows/workflows/agent-environment-setup/shared/agents/vercel-expert.md +1 -0
  172. package/workflows/workflows/agent-environment-setup/shared/rules/STEERING.md +27 -4
  173. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/antigravity.md +18 -3
  174. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/claude.md +12 -4
  175. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/codex.md +12 -2
  176. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/copilot.md +13 -3
  177. package/workflows/skills/react-best-practices/docs/AGENTS.md +0 -2934
  178. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/react-best-practices/docs/AGENTS.md +0 -2934
  179. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/AGENTS.md +0 -25
  180. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/react-best-practices/docs/AGENTS.md +0 -2934
@@ -10,11 +10,12 @@ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
10
10
  import {
11
11
  parsePostmanState,
12
12
  parseStitchState,
13
+ parsePlaywrightState,
13
14
  readEffectiveConfig,
14
15
  } from "../cbxConfig/index.js";
15
16
  import type { CbxConfig, ConfigScope } from "../cbxConfig/types.js";
16
17
 
17
- type ServiceId = "postman" | "stitch";
18
+ type ServiceId = "postman" | "stitch" | "playwright";
18
19
 
19
20
  export interface UpstreamToolInfo {
20
21
  name: string;
@@ -126,7 +127,10 @@ async function loadCachedCatalogTools({
126
127
  }
127
128
  }
128
129
 
129
- function getServiceAuth(config: CbxConfig, service: ServiceId): {
130
+ function getServiceAuth(
131
+ config: CbxConfig,
132
+ service: ServiceId,
133
+ ): {
130
134
  mcpUrl: string | null;
131
135
  activeProfileName: string | null;
132
136
  envVar: string | null;
@@ -134,6 +138,17 @@ function getServiceAuth(config: CbxConfig, service: ServiceId): {
134
138
  configured: boolean;
135
139
  error?: string;
136
140
  } {
141
+ if (service === "playwright") {
142
+ const state = parsePlaywrightState(config);
143
+ return {
144
+ mcpUrl: state.mcpUrl,
145
+ activeProfileName: null,
146
+ envVar: null,
147
+ headers: {},
148
+ configured: Boolean(state.mcpUrl),
149
+ };
150
+ }
151
+
137
152
  if (service === "postman") {
138
153
  const state = parsePostmanState(config);
139
154
  const activeProfile = state.activeProfile;
@@ -214,9 +229,11 @@ function isCallToolResult(
214
229
  result: Awaited<ReturnType<Client["callTool"]>>,
215
230
  ): result is CallToolResult {
216
231
  return Array.isArray(
217
- (result as {
218
- content?: unknown;
219
- }).content,
232
+ (
233
+ result as {
234
+ content?: unknown;
235
+ }
236
+ ).content,
220
237
  );
221
238
  }
222
239
 
@@ -275,6 +292,7 @@ export async function discoverUpstreamCatalogs(
275
292
  ): Promise<{
276
293
  postman: UpstreamCatalog;
277
294
  stitch: UpstreamCatalog;
295
+ playwright: UpstreamCatalog;
278
296
  }> {
279
297
  const effective = readEffectiveConfig(scope);
280
298
  if (!effective) {
@@ -291,9 +309,14 @@ export async function discoverUpstreamCatalogs(
291
309
  discoveryError: "cbx_config.json not found",
292
310
  };
293
311
  const missingStitch: UpstreamCatalog = { ...missing, service: "stitch" };
312
+ const missingPlaywright: UpstreamCatalog = {
313
+ ...missing,
314
+ service: "playwright",
315
+ };
294
316
  return {
295
317
  postman: missing,
296
318
  stitch: missingStitch,
319
+ playwright: missingPlaywright,
297
320
  };
298
321
  }
299
322
 
@@ -366,6 +389,7 @@ export async function discoverUpstreamCatalogs(
366
389
  return {
367
390
  postman: await discoverOne("postman"),
368
391
  stitch: await discoverOne("stitch"),
392
+ playwright: await discoverOne("playwright"),
369
393
  };
370
394
  }
371
395
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubis/foundry",
3
- "version": "0.3.69",
3
+ "version": "0.3.71",
4
4
  "description": "Cubis Foundry CLI for workflow-first AI agent environments",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/core.ts CHANGED
@@ -217,6 +217,10 @@ const STITCH_SKILL_ID = "stitch";
217
217
  const STITCH_MCP_SERVER_ID = "StitchMCP";
218
218
  const STITCH_API_KEY_ENV_VAR = "STITCH_API_KEY_DEFAULT";
219
219
  const STITCH_MCP_URL = "https://stitch.googleapis.com/mcp";
220
+ const PLAYWRIGHT_SKILL_ID = "playwright";
221
+ const PLAYWRIGHT_MCP_SERVER_ID = "PlaywrightMCP";
222
+ const PLAYWRIGHT_DEFAULT_PORT = 8931;
223
+ const PLAYWRIGHT_MCP_URL = `http://localhost:${PLAYWRIGHT_DEFAULT_PORT}/mcp`;
220
224
  const POSTMAN_WORKSPACE_MANUAL_CHOICE = "__postman_workspace_manual__";
221
225
  const CBX_CONFIG_FILENAME = "cbx_config.json";
222
226
  const CBX_CREDENTIALS_ENV_FILENAME = "credentials.env";
@@ -4719,6 +4723,30 @@ function buildGeminiStitchServer({
4719
4723
  };
4720
4724
  }
4721
4725
 
4726
+ function buildVsCodePlaywrightServer({ mcpUrl = PLAYWRIGHT_MCP_URL } = {}) {
4727
+ return {
4728
+ type: "http",
4729
+ url: mcpUrl,
4730
+ headers: {},
4731
+ };
4732
+ }
4733
+
4734
+ function buildCopilotCliPlaywrightServer({ mcpUrl = PLAYWRIGHT_MCP_URL } = {}) {
4735
+ return {
4736
+ type: "http",
4737
+ url: mcpUrl,
4738
+ headers: {},
4739
+ tools: ["*"],
4740
+ };
4741
+ }
4742
+
4743
+ function buildGeminiPlaywrightServer({ mcpUrl = PLAYWRIGHT_MCP_URL } = {}) {
4744
+ return {
4745
+ httpUrl: mcpUrl,
4746
+ headers: {},
4747
+ };
4748
+ }
4749
+
4722
4750
  function getPostmanApiKeySource({ apiKey, envApiKey }) {
4723
4751
  if (apiKey) return "inline";
4724
4752
  if (envApiKey) return "env";
@@ -5210,6 +5238,7 @@ async function applyPostmanMcpForPlatform({
5210
5238
  stitchMcpUrl,
5211
5239
  includeStitchMcp = false,
5212
5240
  includeFoundryMcp = true,
5241
+ includePlaywrightMcp = false,
5213
5242
  foundryRuntime = "local",
5214
5243
  dryRun = false,
5215
5244
  cwd = process.cwd(),
@@ -5278,6 +5307,9 @@ async function applyPostmanMcpForPlatform({
5278
5307
  mcpUrl: stitchMcpUrl,
5279
5308
  });
5280
5309
  }
5310
+ if (includePlaywrightMcp) {
5311
+ mcpServers[PLAYWRIGHT_MCP_SERVER_ID] = buildGeminiPlaywrightServer();
5312
+ }
5281
5313
  next.mcpServers = mcpServers;
5282
5314
  return next;
5283
5315
  },
@@ -5324,6 +5356,10 @@ async function applyPostmanMcpForPlatform({
5324
5356
  } else {
5325
5357
  delete mcpServers[FOUNDRY_MCP_SERVER_ID];
5326
5358
  }
5359
+ if (includePlaywrightMcp) {
5360
+ mcpServers[PLAYWRIGHT_MCP_SERVER_ID] =
5361
+ buildCopilotCliPlaywrightServer();
5362
+ }
5327
5363
  next.mcpServers = mcpServers;
5328
5364
  return next;
5329
5365
  }
@@ -5350,6 +5386,9 @@ async function applyPostmanMcpForPlatform({
5350
5386
  } else {
5351
5387
  delete servers[FOUNDRY_MCP_SERVER_ID];
5352
5388
  }
5389
+ if (includePlaywrightMcp) {
5390
+ servers[PLAYWRIGHT_MCP_SERVER_ID] = buildVsCodePlaywrightServer();
5391
+ }
5353
5392
  next.servers = servers;
5354
5393
  return next;
5355
5394
  },
@@ -5401,6 +5440,9 @@ async function applyPostmanMcpForPlatform({
5401
5440
  } else {
5402
5441
  delete servers[FOUNDRY_MCP_SERVER_ID];
5403
5442
  }
5443
+ if (includePlaywrightMcp) {
5444
+ servers[PLAYWRIGHT_MCP_SERVER_ID] = buildVsCodePlaywrightServer();
5445
+ }
5404
5446
  next.servers = servers;
5405
5447
  return next;
5406
5448
  },
@@ -5529,6 +5571,57 @@ async function applyPostmanMcpForPlatform({
5529
5571
  };
5530
5572
  }
5531
5573
 
5574
+ if (platform === "claude") {
5575
+ const claudeConfigPath =
5576
+ mcpScope === "global"
5577
+ ? path.join(os.homedir(), ".claude", "mcp.json")
5578
+ : path.join(workspaceRoot, ".mcp.json");
5579
+ const result = await upsertJsonObjectFile({
5580
+ targetPath: claudeConfigPath,
5581
+ updater: (existing) => {
5582
+ const next = { ...existing };
5583
+ const mcpServers =
5584
+ next.mcpServers &&
5585
+ typeof next.mcpServers === "object" &&
5586
+ !Array.isArray(next.mcpServers)
5587
+ ? { ...next.mcpServers }
5588
+ : {};
5589
+ if (includeFoundryMcp) {
5590
+ if (normalizedFoundryRuntime === "docker") {
5591
+ mcpServers[FOUNDRY_MCP_SERVER_ID] = {
5592
+ type: "url",
5593
+ url: buildFoundryDockerUrl({ port: foundryDockerPort }),
5594
+ };
5595
+ } else {
5596
+ mcpServers[FOUNDRY_MCP_SERVER_ID] = {
5597
+ type: "stdio",
5598
+ command: FOUNDRY_MCP_COMMAND,
5599
+ args: buildFoundryServeArgs({ scope: foundryScope }),
5600
+ };
5601
+ }
5602
+ } else {
5603
+ delete mcpServers[FOUNDRY_MCP_SERVER_ID];
5604
+ }
5605
+ if (includePlaywrightMcp) {
5606
+ mcpServers[PLAYWRIGHT_MCP_SERVER_ID] = {
5607
+ type: "url",
5608
+ url: PLAYWRIGHT_MCP_URL,
5609
+ };
5610
+ }
5611
+ next.mcpServers = mcpServers;
5612
+ return next;
5613
+ },
5614
+ dryRun,
5615
+ });
5616
+ return {
5617
+ kind: "claude-mcp",
5618
+ scope: mcpScope,
5619
+ path: claudeConfigPath,
5620
+ action: result.action,
5621
+ warnings: [...warnings, ...result.warnings],
5622
+ };
5623
+ }
5624
+
5532
5625
  return {
5533
5626
  kind: "unknown",
5534
5627
  scope: mcpScope,
@@ -5606,10 +5699,7 @@ async function resolvePostmanInstallSelection({
5606
5699
  : null;
5607
5700
  let workspaceSelectionSource = hasWorkspaceOption ? "option" : "none";
5608
5701
  const requestedMcpScope = options.mcpScope
5609
- ? coerceWorkspaceOnlyMcpScope(
5610
- options.mcpScope,
5611
- "--mcp-scope",
5612
- )
5702
+ ? coerceWorkspaceOnlyMcpScope(options.mcpScope, "--mcp-scope")
5613
5703
  : null;
5614
5704
  let mcpScope = requestedMcpScope?.scope || "project";
5615
5705
  const warnings = [];
@@ -6057,6 +6147,7 @@ async function configurePostmanInstallArtifacts({
6057
6147
  stitchMcpUrl: effectiveStitchMcpUrl,
6058
6148
  includeStitchMcp: shouldInstallStitch,
6059
6149
  includeFoundryMcp: postmanSelection.foundryMcpEnabled,
6150
+ includePlaywrightMcp: postmanSelection.playwrightEnabled ?? false,
6060
6151
  foundryRuntime: postmanSelection.effectiveMcpRuntime || "local",
6061
6152
  dryRun,
6062
6153
  cwd,
@@ -6167,6 +6258,7 @@ async function applyPostmanConfigArtifacts({
6167
6258
  POSTMAN_API_KEY_ENV_VAR;
6168
6259
  const postmanMcpUrl = postmanState.mcpUrl || POSTMAN_MCP_URL;
6169
6260
  const stitchEnabled = Boolean(stitchState);
6261
+ const playwrightEnabled = Boolean(configValue?.playwright);
6170
6262
  const stitchApiKeyEnvVar =
6171
6263
  normalizePostmanApiKey(stitchState?.apiKeyEnvVar) || STITCH_API_KEY_ENV_VAR;
6172
6264
  const stitchMcpUrl = stitchState?.mcpUrl || STITCH_MCP_URL;
@@ -6239,6 +6331,7 @@ async function applyPostmanConfigArtifacts({
6239
6331
  stitchMcpUrl,
6240
6332
  includeStitchMcp: stitchEnabled,
6241
6333
  includeFoundryMcp: true,
6334
+ includePlaywrightMcp: playwrightEnabled ?? false,
6242
6335
  foundryRuntime,
6243
6336
  dryRun,
6244
6337
  cwd,
@@ -8239,7 +8332,9 @@ async function performWorkflowInstall(
8239
8332
  cancelled: false,
8240
8333
  cwd,
8241
8334
  scope,
8242
- warnings: requestedInstallScope.warning ? [requestedInstallScope.warning] : [],
8335
+ warnings: requestedInstallScope.warning
8336
+ ? [requestedInstallScope.warning]
8337
+ : [],
8243
8338
  ruleScope,
8244
8339
  dryRun,
8245
8340
  platform,
@@ -23,12 +23,20 @@ export function buildInitExecutionPlan({
23
23
  const planItems: InitExecutionPlanItem[] = [];
24
24
  const wantsPostman = hasMcpSelection(selections.selectedMcps, "postman");
25
25
  const wantsStitch = hasMcpSelection(selections.selectedMcps, "stitch");
26
- const wantsFoundry = hasMcpSelection(selections.selectedMcps, "cubis-foundry");
26
+ const wantsFoundry = hasMcpSelection(
27
+ selections.selectedMcps,
28
+ "cubis-foundry",
29
+ );
30
+ const wantsPlaywright = hasMcpSelection(
31
+ selections.selectedMcps,
32
+ "playwright",
33
+ );
27
34
 
28
35
  for (const platform of selections.platforms) {
29
36
  const stitchSupported = platform === "antigravity";
30
37
  const stitchEnabled = wantsStitch && stitchSupported;
31
- const hasAnyMcp = wantsPostman || stitchEnabled || wantsFoundry;
38
+ const hasAnyMcp =
39
+ wantsPostman || stitchEnabled || wantsFoundry || wantsPlaywright;
32
40
  const warnings: string[] = [];
33
41
  if (wantsStitch && !stitchSupported) {
34
42
  warnings.push(
@@ -48,10 +56,11 @@ export function buildInitExecutionPlan({
48
56
  target,
49
57
  postman: wantsPostman,
50
58
  stitch: stitchEnabled,
59
+ playwright: wantsPlaywright,
51
60
  stitchDefaultForAntigravity: false,
52
61
  mcpScope: selections.mcpScope,
53
62
  foundryMcp: wantsFoundry,
54
- mcpToolSync: wantsPostman || stitchEnabled,
63
+ mcpToolSync: wantsPostman || stitchEnabled || wantsPlaywright,
55
64
  mcpRuntime: hasAnyMcp ? selections.mcpRuntime : "local",
56
65
  mcpFallback: "local",
57
66
  mcpBuildLocal: hasAnyMcp ? selections.mcpBuildLocal : false,
@@ -83,9 +92,9 @@ export function formatInitSummary(selections: InitWizardSelections) {
83
92
  `- Skill profile: ${selections.skillProfile}`,
84
93
  `- Skills scope: ${selections.skillsScope}`,
85
94
  `- MCP scope: ${selections.mcpScope}`,
86
- `- MCP runtime: ${selections.mcpRuntime}${selections.mcpRuntime === "docker" ? selections.mcpBuildLocal ? " (build local image)" : " (pull image)" : ""}`,
95
+ `- MCP runtime: ${selections.mcpRuntime}${selections.mcpRuntime === "docker" ? (selections.mcpBuildLocal ? " (build local image)" : " (pull image)") : ""}`,
87
96
  `- MCP selections: ${selections.selectedMcps.length > 0 ? selections.selectedMcps.join(", ") : "(none)"}`,
88
97
  `- Postman mode: ${postmanSelected ? selections.postmanMode : "(not selected)"}`,
89
- `- Postman workspace: ${postmanSelected ? selections.postmanWorkspaceId === null ? "null" : selections.postmanWorkspaceId : "(not selected)"}`,
98
+ `- Postman workspace: ${postmanSelected ? (selections.postmanWorkspaceId === null ? "null" : selections.postmanWorkspaceId) : "(not selected)"}`,
90
99
  ].join("\n");
91
100
  }
@@ -90,6 +90,11 @@ export async function promptInitMcpSelection(defaultMcps: InitMcpId[]) {
90
90
  value: "stitch",
91
91
  checked: defaultMcps.includes("stitch"),
92
92
  },
93
+ {
94
+ name: "Playwright",
95
+ value: "playwright",
96
+ checked: defaultMcps.includes("playwright"),
97
+ },
93
98
  ],
94
99
  });
95
100
  }
@@ -1,6 +1,6 @@
1
1
  export type InitScope = "project" | "global";
2
2
  export type InitSkillProfile = "core" | "web-backend" | "full";
3
- export type InitMcpId = "cubis-foundry" | "postman" | "stitch";
3
+ export type InitMcpId = "cubis-foundry" | "postman" | "stitch" | "playwright";
4
4
  export type InitPostmanMode = "full" | "minimal";
5
5
  export type InitPlatformId = "codex" | "antigravity" | "copilot" | "claude";
6
6
  export type InitMcpRuntime = "local" | "docker";
@@ -1,17 +1,27 @@
1
1
  ---
2
2
  name: ask-questions-if-underspecified
3
- description: Clarify requirements before implementing. Use when serious doubts arise.
3
+ description: Clarify requirements before implementing. Use when serious doubts arise about objective, scope, constraints, environment, or safety — or when the task is substantial enough that being wrong wastes significant effort.
4
4
  ---
5
5
 
6
6
  # Ask Questions If Underspecified
7
7
 
8
8
  ## When to Use
9
9
 
10
- Use this skill when a request has multiple plausible interpretations or key details (objective, scope, constraints, environment, or safety) are unclear.
10
+ Use this skill when a request has multiple plausible interpretations or key details (objective, scope, constraints, environment, or safety) are unclear — **and** when the cost of implementing the wrong interpretation is significant.
11
+
12
+ Three situations require clarification:
13
+
14
+ 1. **High branching** — Multiple plausible interpretations produce significantly different implementations
15
+ 2. **Substantial deliverable** — The task is large enough that wrong assumptions waste real time
16
+ 3. **Safety-critical** — The action is hard to reverse (data migrations, deployments, file deletions)
11
17
 
12
18
  ## When NOT to Use
13
19
 
14
- Do not use this skill when the request is already clear, or when a quick, low-risk discovery read can answer the missing details.
20
+ Do not use this skill when:
21
+
22
+ - The request is already clear and one interpretation is obviously correct
23
+ - A quick discovery read (config files, existing patterns, repo structure) can answer the missing details faster than asking
24
+ - The task is small enough that being slightly wrong is cheap and correctable
15
25
 
16
26
  ## Goal
17
27
 
@@ -22,6 +32,7 @@ Ask the minimum set of clarifying questions needed to avoid wrong work; do not s
22
32
  ### 1) Decide whether the request is underspecified
23
33
 
24
34
  Treat a request as underspecified if after exploring how to perform the work, some or all of the following are not clear:
35
+
25
36
  - Define the objective (what should change vs stay the same)
26
37
  - Define "done" (acceptance criteria, examples, edge cases)
27
38
  - Define scope (which files/components/users are in/out)
@@ -36,6 +47,7 @@ If multiple plausible interpretations exist, assume it is underspecified.
36
47
  Ask 1-5 questions in the first pass. Prefer questions that eliminate whole branches of work.
37
48
 
38
49
  Make questions easy to answer:
50
+
39
51
  - Optimize for scannability (short, numbered questions; avoid paragraphs)
40
52
  - Offer multiple-choice options when possible
41
53
  - Suggest reasonable defaults when appropriate (mark them clearly as the default/recommended choice; bold the recommended choice in the list, or if you present options in a code block, put a bold "Recommended" line immediately above the block and also tag defaults inside the block)
@@ -47,10 +59,12 @@ Make questions easy to answer:
47
59
  ### 3) Pause before acting
48
60
 
49
61
  Until must-have answers arrive:
62
+
50
63
  - Do not run commands, edit files, or produce a detailed plan that depends on unknowns
51
64
  - Do perform a clearly labeled, low-risk discovery step only if it does not commit you to a direction (e.g., inspect repo structure, read relevant config files)
52
65
 
53
66
  If the user explicitly asks you to proceed without answers:
67
+
54
68
  - State your assumptions as a short numbered list
55
69
  - Ask for confirmation; proceed only after they confirm or correct them
56
70
 
@@ -83,3 +97,37 @@ Reply with: defaults (or 1a 2a)
83
97
 
84
98
  - Don't ask questions you can answer with a quick, low-risk discovery read (e.g., configs, existing patterns, docs).
85
99
  - Don't ask open-ended questions if a tight multiple-choice or yes/no would eliminate ambiguity faster.
100
+ - Don't ask more than 5 questions at once — rank by impact and ask the top ones.
101
+ - Don't skip the fast-path — every clarification block needs `defaults` shortcut.
102
+ - Don't forget to restate interpretation before proceeding — confirms you heard correctly.
103
+ - Don't ask about reversible decisions — pick one, proceed, let them correct if wrong.
104
+
105
+ ## Three-Stage Pattern (for complex or substantial tasks)
106
+
107
+ For tasks where wrong assumptions would waste significant effort — documents, architecture decisions, multi-file features — use a three-stage approach:
108
+
109
+ ### Stage 1: Meta-context questions (3-5 questions)
110
+
111
+ Ask about the big picture before touching content:
112
+
113
+ - What _type_ of deliverable is this? (spec, code, doc, design, plan)
114
+ - Who's the audience/consumer?
115
+ - What does "done" look like?
116
+ - Existing template, format, or precedent to follow?
117
+ - Hard constraints (framework, performance, compatibility)?
118
+
119
+ ### Stage 2: Info dump + targeted follow-up
120
+
121
+ After Stage 1 answers: invite the user to brain-dump everything relevant.
122
+
123
+ > "Dump everything you know — background, prior decisions, constraints, opinions, blockers. Don't organize it. Just get it all out."
124
+
125
+ Then ask 5-10 targeted follow-up questions based on gaps. Users can answer in shorthand (`1: yes, 2: see above, 3: no`).
126
+
127
+ **Exit Stage 2 when:** You understand objective, constraints, and at least one clear definition of success.
128
+
129
+ ### Stage 3: Confirm interpretation, then proceed
130
+
131
+ Restate in 1-3 sentences before starting:
132
+
133
+ > "Here's what I understand: [objective]. [Key constraint]. [What done looks like]. Starting now — correct me if anything's off."
@@ -7,6 +7,7 @@ allowed-tools: Read, Glob, Grep
7
7
  # Behavioral Modes - Adaptive AI Operating Modes
8
8
 
9
9
  ## Purpose
10
+
10
11
  This skill defines distinct behavioral modes that optimize AI performance for specific tasks. Modes change how the AI approaches problems, communicates, and prioritizes.
11
12
 
12
13
  ---
@@ -18,6 +19,7 @@ This skill defines distinct behavioral modes that optimize AI performance for sp
18
19
  **When to use:** Early project planning, feature ideation, architecture decisions
19
20
 
20
21
  **Behavior:**
22
+
21
23
  - Ask clarifying questions before assumptions
22
24
  - Offer multiple alternatives (at least 3)
23
25
  - Think divergently - explore unconventional solutions
@@ -25,6 +27,7 @@ This skill defines distinct behavioral modes that optimize AI performance for sp
25
27
  - Use visual diagrams (mermaid) to explain concepts
26
28
 
27
29
  **Output style:**
30
+
28
31
  ```
29
32
  "Let's explore this together. Here are some approaches:
30
33
 
@@ -46,6 +49,7 @@ What resonates with you? Or should we explore a different direction?"
46
49
  **When to use:** Writing code, building features, executing plans
47
50
 
48
51
  **Behavior:**
52
+
49
53
  - **CRITICAL: Use `clean-code` skill standards** - concise, direct, no verbose explanations
50
54
  - Fast execution - minimize questions
51
55
  - Use established patterns and best practices
@@ -57,6 +61,7 @@ What resonates with you? Or should we explore a different direction?"
57
61
  - **NO RUSHING** - Quality > Speed. Read ALL references before coding.
58
62
 
59
63
  **Output style:**
64
+
60
65
  ```
61
66
  [Code block]
62
67
 
@@ -64,6 +69,7 @@ What resonates with you? Or should we explore a different direction?"
64
69
  ```
65
70
 
66
71
  **NOT:**
72
+
67
73
  ```
68
74
  "Building [feature]...
69
75
 
@@ -83,6 +89,7 @@ Run `npm run dev` to test."
83
89
  **When to use:** Fixing bugs, troubleshooting errors, investigating issues
84
90
 
85
91
  **Behavior:**
92
+
86
93
  - Ask for error messages and reproduction steps
87
94
  - Think systematically - check logs, trace data flow
88
95
  - Form hypothesis → test → verify
@@ -90,6 +97,7 @@ Run `npm run dev` to test."
90
97
  - Prevent future occurrences
91
98
 
92
99
  **Output style:**
100
+
93
101
  ```
94
102
  "Investigating...
95
103
 
@@ -106,6 +114,7 @@ Run `npm run dev` to test."
106
114
  **When to use:** Code review, architecture review, security audit
107
115
 
108
116
  **Behavior:**
117
+
109
118
  - Be thorough but constructive
110
119
  - Categorize by severity (Critical/High/Medium/Low)
111
120
  - Explain the "why" behind suggestions
@@ -113,6 +122,7 @@ Run `npm run dev` to test."
113
122
  - Acknowledge what's done well
114
123
 
115
124
  **Output style:**
125
+
116
126
  ```
117
127
  ## Code Review: [file/feature]
118
128
 
@@ -133,6 +143,7 @@ Run `npm run dev` to test."
133
143
  **When to use:** Explaining concepts, documentation, onboarding
134
144
 
135
145
  **Behavior:**
146
+
136
147
  - Explain from fundamentals
137
148
  - Use analogies and examples
138
149
  - Progress from simple to complex
@@ -140,6 +151,7 @@ Run `npm run dev` to test."
140
151
  - Check understanding
141
152
 
142
153
  **Output style:**
154
+
143
155
  ```
144
156
  ## Understanding [Concept]
145
157
 
@@ -163,6 +175,7 @@ Run `npm run dev` to test."
163
175
  **When to use:** Production deployment, final polish, release preparation
164
176
 
165
177
  **Behavior:**
178
+
166
179
  - Focus on stability over features
167
180
  - Check for missing error handling
168
181
  - Verify environment configs
@@ -170,6 +183,7 @@ Run `npm run dev` to test."
170
183
  - Create deployment checklist
171
184
 
172
185
  **Output style:**
186
+
173
187
  ```
174
188
  ## Pre-Ship Checklist
175
189
 
@@ -195,35 +209,111 @@ Run `npm run dev` to test."
195
209
 
196
210
  The AI should automatically detect the appropriate mode based on:
197
211
 
198
- | Trigger | Mode |
199
- |---------|------|
200
- | "what if", "ideas", "options" | BRAINSTORM |
201
- | "build", "create", "add" | IMPLEMENT |
202
- | "not working", "error", "bug" | DEBUG |
203
- | "review", "check", "audit" | REVIEW |
204
- | "explain", "how does", "learn" | TEACH |
205
- | "deploy", "release", "production" | SHIP |
212
+ | Trigger | Mode |
213
+ | ---------------------------------------------- | ------------------- |
214
+ | "what if", "ideas", "options" | BRAINSTORM |
215
+ | "build", "create", "add" | IMPLEMENT |
216
+ | "not working", "error", "bug" | DEBUG |
217
+ | "review", "check", "audit" | REVIEW |
218
+ | "explain", "how does", "learn" | TEACH |
219
+ | "deploy", "release", "production" | SHIP |
220
+ | "iterate", "refine quality", "not good enough" | EVALUATOR-OPTIMIZER |
221
+
222
+ ---
223
+
224
+ ## Workflow Patterns
225
+
226
+ Three patterns govern how modes combine across multiple agents or steps. Use the simplest pattern that solves the problem — add complexity only when it measurably improves results.
227
+
228
+ ### 1. Sequential (default)
229
+
230
+ Use when tasks have dependencies — each step needs the previous step's output.
231
+
232
+ ```
233
+ [BRAINSTORM] → [IMPLEMENT] → [REVIEW] → [SHIP]
234
+ ```
235
+
236
+ Best for: multi-stage features, draft-review-polish cycles, data pipelines.
237
+
238
+ ### 2. Parallel
239
+
240
+ Use when tasks are independent and doing them one at a time is too slow.
241
+
242
+ ```
243
+ [security REVIEW + performance REVIEW + quality REVIEW] → synthesize
244
+ ```
245
+
246
+ Best for: code review across multiple dimensions, parallel analysis. Requires a clear aggregation strategy before starting.
247
+
248
+ ### 3. Evaluator-Optimizer (new)
249
+
250
+ Use when first-draft quality consistently falls short and quality is measurable.
251
+
252
+ ```
253
+ [IMPLEMENT] → [REVIEW with criteria] → pass? → done
254
+ ↓ fail
255
+ feedback → [IMPLEMENT again]
256
+ ```
257
+
258
+ **When to use:**
259
+
260
+ - Technical docs, customer communications, SQL queries against specific standards
261
+ - Any output where the gap between first attempt and required quality is significant
262
+ - When you have clear, checkable criteria (not just "make it better")
263
+
264
+ **When NOT to use:**
265
+
266
+ - First-attempt quality is already acceptable
267
+ - Criteria are too subjective for consistent AI evaluation
268
+ - Real-time use cases needing immediate responses
269
+ - Deterministic validators exist (linters, schema validators) — use those instead
270
+
271
+ **Implementation:**
272
+
273
+ ```
274
+ ## Generator
275
+ Task: [what to create]
276
+ Constraints: [specific, measurable requirements — these become eval criteria]
277
+
278
+ ## Evaluator
279
+ Criteria:
280
+ 1. [Criterion A] — Pass/Fail + specific failure note
281
+ 2. [Criterion B] — Pass/Fail + specific failure note
282
+
283
+ Output JSON: { "pass": bool, "failures": ["..."], "revision_note": "..." }
284
+
285
+ Max iterations: 3 ← always set a ceiling
286
+ Stop when: all criteria pass OR max iterations reached
287
+ ```
206
288
 
207
289
  ---
208
290
 
209
- ## Multi-Agent Collaboration Patterns (2025)
291
+ ## Multi-Agent Collaboration Patterns
210
292
 
211
293
  Modern architectures optimized for agent-to-agent collaboration:
212
294
 
213
295
  ### 1. 🔭 EXPLORE Mode
296
+
214
297
  **Role:** Discovery and Analysis (Explorer Agent)
215
298
  **Behavior:** Socratic questioning, deep-dive code reading, dependency mapping.
216
299
  **Output:** `discovery-report.json`, architectural visualization.
217
300
 
218
301
  ### 2. 🗺️ PLAN-EXECUTE-CRITIC (PEC)
302
+
219
303
  Cyclic mode transitions for high-complexity tasks:
304
+
220
305
  1. **Planner:** Decomposes the task into atomic steps (`task.md`).
221
306
  2. **Executor:** Performs the actual coding (`IMPLEMENT`).
222
307
  3. **Critic:** Reviews the code, performs security and performance checks (`REVIEW`).
223
308
 
224
309
  ### 3. 🧠 MENTAL MODEL SYNC
310
+
225
311
  Behavior for creating and loading "Mental Model" summaries to preserve context between sessions.
226
312
 
313
+ ### 4. 🔄 EVALUATOR-OPTIMIZER
314
+
315
+ Paired agents in an iterative quality loop: Generator produces, Evaluator scores against criteria, Generator refines. Set max iteration ceiling before starting.
316
+
227
317
  ---
228
318
 
229
319
  ## Combining Modes
@@ -239,4 +329,5 @@ Users can explicitly request a mode:
239
329
  /implement the user profile page
240
330
  /debug why login fails
241
331
  /review this pull request
332
+ /iterate [target quality bar] ← triggers evaluator-optimizer
242
333
  ```