@cubis/foundry 0.3.75 → 0.3.77

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 (263) hide show
  1. package/README.md +98 -76
  2. package/dist/cli/commands/register.js +1 -1
  3. package/dist/cli/commands/register.js.map +1 -1
  4. package/dist/cli/core.js +405 -216
  5. package/dist/cli/core.js.map +1 -1
  6. package/dist/cli/init/execute.js +5 -7
  7. package/dist/cli/init/execute.js.map +1 -1
  8. package/dist/cli/workflows/commands.js +2 -2
  9. package/dist/cli/workflows/commands.js.map +1 -1
  10. package/mcp/src/tools/skillTools.test.ts +34 -1
  11. package/package.json +4 -3
  12. package/src/cli/commands/register.ts +1 -1
  13. package/src/cli/core.ts +495 -267
  14. package/src/cli/init/execute.ts +5 -9
  15. package/src/cli/workflows/commands.ts +2 -2
  16. package/workflows/skills/_schema/skill-platform-attributes.json +14 -0
  17. package/workflows/skills/deep-research/SKILL.md +81 -0
  18. package/workflows/skills/deep-research/evals/assertions.md +17 -0
  19. package/workflows/skills/deep-research/evals/evals.json +56 -0
  20. package/workflows/skills/deep-research/examples/01-latest-docs-check.md +12 -0
  21. package/workflows/skills/deep-research/examples/02-ecosystem-comparison.md +12 -0
  22. package/workflows/skills/deep-research/examples/03-research-to-implementation-handoff.md +12 -0
  23. package/workflows/skills/deep-research/references/comparison-checklist.md +57 -0
  24. package/workflows/skills/deep-research/references/research-output.md +69 -0
  25. package/workflows/skills/deep-research/references/source-ladder.md +81 -0
  26. package/workflows/skills/generated/skill-audit.json +20 -2
  27. package/workflows/skills/generated/skill-catalog.json +62 -4
  28. package/workflows/skills/skills_index.json +58 -0
  29. package/workflows/skills/stitch/SKILL.md +79 -0
  30. package/workflows/skills/stitch/evals/assertions.md +45 -0
  31. package/workflows/skills/stitch/evals/evals.json +68 -0
  32. package/workflows/skills/stitch/examples/01-new-screen.md +13 -0
  33. package/workflows/skills/stitch/examples/02-update-existing-screen.md +13 -0
  34. package/workflows/skills/stitch/examples/03-mobile-handoff.md +13 -0
  35. package/workflows/skills/stitch/examples/04-prompt-enhancement.md +21 -0
  36. package/workflows/skills/stitch/examples/05-design-sync-loop.md +16 -0
  37. package/workflows/skills/stitch/references/implementation-patterns.md +20 -0
  38. package/workflows/skills/stitch/references/platform-setup.md +46 -0
  39. package/workflows/skills/stitch/references/update-diff-workflow.md +23 -0
  40. package/workflows/workflows/agent-environment-setup/generated/route-manifest.json +21 -13
  41. package/workflows/workflows/agent-environment-setup/manifest.json +32 -1
  42. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/frontend-specialist.md +10 -2
  43. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/mobile-developer.md +6 -2
  44. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/orchestrator.md +6 -5
  45. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/project-planner.md +4 -3
  46. package/workflows/workflows/agent-environment-setup/platforms/antigravity/agents/researcher.md +8 -4
  47. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/accessibility.toml +2 -0
  48. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/backend.toml +2 -0
  49. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/create.toml +2 -0
  50. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/database.toml +2 -0
  51. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/debug.toml +2 -0
  52. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/devops.toml +2 -0
  53. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/implement-track.toml +2 -0
  54. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/migrate.toml +2 -0
  55. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/mobile.toml +2 -0
  56. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/onboard.toml +2 -0
  57. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/orchestrate.toml +2 -0
  58. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/plan.toml +2 -0
  59. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/refactor.toml +2 -0
  60. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/release.toml +2 -0
  61. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/review.toml +2 -0
  62. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/security.toml +2 -0
  63. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/test.toml +2 -0
  64. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/vercel.toml +2 -0
  65. package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +14 -8
  66. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/SKILL.md +89 -0
  67. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/evals/assertions.md +17 -0
  68. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/evals/evals.json +56 -0
  69. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/examples/01-latest-docs-check.md +12 -0
  70. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/examples/02-ecosystem-comparison.md +12 -0
  71. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/examples/03-research-to-implementation-handoff.md +12 -0
  72. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/references/comparison-checklist.md +57 -0
  73. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/references/research-output.md +69 -0
  74. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/references/source-ladder.md +81 -0
  75. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/SKILL.md +87 -0
  76. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/evals/assertions.md +45 -0
  77. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/evals/evals.json +68 -0
  78. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/examples/01-new-screen.md +13 -0
  79. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/examples/02-update-existing-screen.md +13 -0
  80. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/examples/03-mobile-handoff.md +13 -0
  81. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/examples/04-prompt-enhancement.md +21 -0
  82. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/examples/05-design-sync-loop.md +16 -0
  83. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/references/implementation-patterns.md +20 -0
  84. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/references/platform-setup.md +46 -0
  85. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/references/update-diff-workflow.md +23 -0
  86. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/create.md +3 -2
  87. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/mobile.md +4 -3
  88. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/onboard.md +3 -3
  89. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/orchestrate.md +2 -2
  90. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/plan.md +4 -4
  91. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/frontend-specialist.md +10 -2
  92. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/mobile-developer.md +6 -2
  93. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/orchestrator.md +6 -5
  94. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/project-planner.md +4 -3
  95. package/workflows/workflows/agent-environment-setup/platforms/claude/agents/researcher.md +8 -4
  96. package/workflows/workflows/agent-environment-setup/platforms/claude/hooks/README.md +15 -0
  97. package/workflows/workflows/agent-environment-setup/platforms/claude/hooks/route-research-guard.mjs +39 -0
  98. package/workflows/workflows/agent-environment-setup/platforms/claude/hooks/settings.snippet.json +15 -0
  99. package/workflows/workflows/agent-environment-setup/platforms/claude/rules/CLAUDE.md +16 -8
  100. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/SKILL.md +95 -0
  101. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/evals/assertions.md +17 -0
  102. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/evals/evals.json +56 -0
  103. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/examples/01-latest-docs-check.md +12 -0
  104. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/examples/02-ecosystem-comparison.md +12 -0
  105. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/examples/03-research-to-implementation-handoff.md +12 -0
  106. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/references/comparison-checklist.md +57 -0
  107. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/references/research-output.md +69 -0
  108. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/references/source-ladder.md +81 -0
  109. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/skills_index.json +58 -0
  110. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/SKILL.md +93 -0
  111. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/evals/assertions.md +45 -0
  112. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/evals/evals.json +68 -0
  113. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/examples/01-new-screen.md +13 -0
  114. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/examples/02-update-existing-screen.md +13 -0
  115. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/examples/03-mobile-handoff.md +13 -0
  116. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/examples/04-prompt-enhancement.md +21 -0
  117. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/examples/05-design-sync-loop.md +16 -0
  118. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/references/implementation-patterns.md +20 -0
  119. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/references/platform-setup.md +46 -0
  120. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/references/update-diff-workflow.md +23 -0
  121. package/workflows/workflows/agent-environment-setup/platforms/claude/workflows/create.md +3 -2
  122. package/workflows/workflows/agent-environment-setup/platforms/claude/workflows/mobile.md +4 -3
  123. package/workflows/workflows/agent-environment-setup/platforms/claude/workflows/onboard.md +3 -3
  124. package/workflows/workflows/agent-environment-setup/platforms/claude/workflows/orchestrate.md +2 -2
  125. package/workflows/workflows/agent-environment-setup/platforms/claude/workflows/plan.md +4 -4
  126. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/frontend-specialist.md +10 -2
  127. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/mobile-developer.md +6 -2
  128. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/orchestrator.md +6 -5
  129. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/project-planner.md +4 -3
  130. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/researcher.md +8 -4
  131. package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +14 -8
  132. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/SKILL.md +89 -0
  133. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/evals/assertions.md +17 -0
  134. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/evals/evals.json +56 -0
  135. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/examples/01-latest-docs-check.md +12 -0
  136. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/examples/02-ecosystem-comparison.md +12 -0
  137. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/examples/03-research-to-implementation-handoff.md +12 -0
  138. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/references/comparison-checklist.md +57 -0
  139. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/references/research-output.md +69 -0
  140. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/references/source-ladder.md +81 -0
  141. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/SKILL.md +87 -0
  142. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/evals/assertions.md +45 -0
  143. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/evals/evals.json +68 -0
  144. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/examples/01-new-screen.md +13 -0
  145. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/examples/02-update-existing-screen.md +13 -0
  146. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/examples/03-mobile-handoff.md +13 -0
  147. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/examples/04-prompt-enhancement.md +21 -0
  148. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/examples/05-design-sync-loop.md +16 -0
  149. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/references/implementation-patterns.md +20 -0
  150. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/references/platform-setup.md +46 -0
  151. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/references/update-diff-workflow.md +23 -0
  152. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/create.md +3 -2
  153. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/mobile.md +4 -3
  154. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/onboard.md +3 -3
  155. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/orchestrate.md +2 -2
  156. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/plan.md +4 -4
  157. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/frontend-specialist.md +6 -2
  158. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/mobile-developer.md +6 -2
  159. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/orchestrator.md +6 -5
  160. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/project-planner.md +4 -3
  161. package/workflows/workflows/agent-environment-setup/platforms/copilot/agents/researcher.md +8 -4
  162. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-accessibility.prompt.md +2 -1
  163. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-backend.prompt.md +2 -1
  164. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-create.prompt.md +2 -1
  165. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-database.prompt.md +2 -1
  166. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-debug.prompt.md +2 -1
  167. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-devops.prompt.md +2 -1
  168. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-implement-track.prompt.md +2 -1
  169. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-migrate.prompt.md +2 -1
  170. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-mobile.prompt.md +2 -1
  171. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-onboard.prompt.md +2 -1
  172. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-orchestrate.prompt.md +2 -1
  173. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-plan.prompt.md +2 -1
  174. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-refactor.prompt.md +2 -1
  175. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-release.prompt.md +2 -1
  176. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-review.prompt.md +2 -1
  177. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-security.prompt.md +2 -1
  178. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-test.prompt.md +2 -1
  179. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-vercel.prompt.md +2 -1
  180. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +14 -8
  181. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/SKILL.md +94 -0
  182. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/evals/assertions.md +17 -0
  183. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/evals/evals.json +56 -0
  184. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/examples/01-latest-docs-check.md +12 -0
  185. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/examples/02-ecosystem-comparison.md +12 -0
  186. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/examples/03-research-to-implementation-handoff.md +12 -0
  187. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/references/comparison-checklist.md +57 -0
  188. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/references/research-output.md +69 -0
  189. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/references/source-ladder.md +81 -0
  190. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/skills_index.json +58 -0
  191. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/SKILL.md +92 -0
  192. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/evals/assertions.md +45 -0
  193. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/evals/evals.json +68 -0
  194. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/examples/01-new-screen.md +13 -0
  195. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/examples/02-update-existing-screen.md +13 -0
  196. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/examples/03-mobile-handoff.md +13 -0
  197. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/examples/04-prompt-enhancement.md +21 -0
  198. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/examples/05-design-sync-loop.md +16 -0
  199. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/references/implementation-patterns.md +20 -0
  200. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/references/platform-setup.md +46 -0
  201. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/references/update-diff-workflow.md +23 -0
  202. package/workflows/workflows/agent-environment-setup/platforms/copilot/workflows/create.md +3 -2
  203. package/workflows/workflows/agent-environment-setup/platforms/copilot/workflows/mobile.md +4 -3
  204. package/workflows/workflows/agent-environment-setup/platforms/copilot/workflows/onboard.md +3 -3
  205. package/workflows/workflows/agent-environment-setup/platforms/copilot/workflows/orchestrate.md +2 -2
  206. package/workflows/workflows/agent-environment-setup/platforms/copilot/workflows/plan.md +4 -4
  207. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/accessibility.toml +2 -0
  208. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/backend.toml +2 -0
  209. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/create.toml +2 -0
  210. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/database.toml +2 -0
  211. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/debug.toml +2 -0
  212. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/devops.toml +2 -0
  213. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/implement-track.toml +2 -0
  214. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/migrate.toml +2 -0
  215. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/mobile.toml +2 -0
  216. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/onboard.toml +2 -0
  217. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/orchestrate.toml +2 -0
  218. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/plan.toml +2 -0
  219. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/refactor.toml +2 -0
  220. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/release.toml +2 -0
  221. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/review.toml +2 -0
  222. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/security.toml +2 -0
  223. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/test.toml +2 -0
  224. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/vercel.toml +2 -0
  225. package/workflows/workflows/agent-environment-setup/platforms/gemini/rules/GEMINI.md +14 -8
  226. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/SKILL.md +89 -0
  227. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/evals/assertions.md +17 -0
  228. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/evals/evals.json +56 -0
  229. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/examples/01-latest-docs-check.md +12 -0
  230. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/examples/02-ecosystem-comparison.md +12 -0
  231. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/examples/03-research-to-implementation-handoff.md +12 -0
  232. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/references/comparison-checklist.md +57 -0
  233. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/references/research-output.md +69 -0
  234. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/references/source-ladder.md +81 -0
  235. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/SKILL.md +87 -0
  236. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/evals/assertions.md +45 -0
  237. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/evals/evals.json +68 -0
  238. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/examples/01-new-screen.md +13 -0
  239. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/examples/02-update-existing-screen.md +13 -0
  240. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/examples/03-mobile-handoff.md +13 -0
  241. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/examples/04-prompt-enhancement.md +21 -0
  242. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/examples/05-design-sync-loop.md +16 -0
  243. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/references/implementation-patterns.md +20 -0
  244. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/references/platform-setup.md +46 -0
  245. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/references/update-diff-workflow.md +23 -0
  246. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/create.md +3 -2
  247. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/mobile.md +4 -3
  248. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/onboard.md +3 -3
  249. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/orchestrate.md +2 -2
  250. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/plan.md +4 -4
  251. package/workflows/workflows/agent-environment-setup/shared/agents/frontend-specialist.md +10 -2
  252. package/workflows/workflows/agent-environment-setup/shared/agents/mobile-developer.md +6 -2
  253. package/workflows/workflows/agent-environment-setup/shared/agents/orchestrator.md +2 -1
  254. package/workflows/workflows/agent-environment-setup/shared/agents/project-planner.md +2 -1
  255. package/workflows/workflows/agent-environment-setup/shared/agents/researcher.md +5 -1
  256. package/workflows/workflows/agent-environment-setup/shared/rules/STEERING.md +44 -13
  257. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/claude.md +2 -0
  258. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/gemini.md +20 -0
  259. package/workflows/workflows/agent-environment-setup/shared/workflows/create.md +3 -2
  260. package/workflows/workflows/agent-environment-setup/shared/workflows/mobile.md +4 -3
  261. package/workflows/workflows/agent-environment-setup/shared/workflows/onboard.md +1 -1
  262. package/workflows/workflows/agent-environment-setup/shared/workflows/orchestrate.md +1 -1
  263. package/workflows/workflows/agent-environment-setup/shared/workflows/plan.md +2 -2
package/src/cli/core.ts CHANGED
@@ -174,17 +174,20 @@ const WORKFLOW_PROFILES = {
174
174
  workflowDirs: [".claude/workflows"],
175
175
  agentDirs: [".claude/agents"],
176
176
  skillDirs: [".claude/skills"],
177
+ hookDirs: [".claude/hooks"],
177
178
  ruleFilesByPriority: ["CLAUDE.md"],
178
179
  },
179
180
  global: {
180
181
  workflowDirs: ["~/.claude/workflows"],
181
182
  agentDirs: ["~/.claude/agents"],
182
183
  skillDirs: ["~/.claude/skills"],
184
+ hookDirs: ["~/.claude/hooks"],
183
185
  ruleFilesByPriority: ["~/.claude/CLAUDE.md"],
184
186
  },
185
187
  detectorPaths: [
186
188
  "CLAUDE.md",
187
189
  ".claude",
190
+ ".claude/hooks",
188
191
  ".claude/rules",
189
192
  ".claude/settings.json",
190
193
  ],
@@ -2783,6 +2786,7 @@ async function recordBundleInstallState({
2783
2786
  skills: artifacts.skills.map(toPosixPath),
2784
2787
  commands: (artifacts.commands || []).map(toPosixPath),
2785
2788
  prompts: (artifacts.prompts || []).map(toPosixPath),
2789
+ hooks: (artifacts.hooks || []).map(toPosixPath),
2786
2790
  };
2787
2791
 
2788
2792
  await writeState(scope, state, cwd);
@@ -2815,6 +2819,7 @@ async function resolveProfilePaths(profileId, scope, cwd = process.cwd()) {
2815
2819
  const skillDirs = Array.isArray(cfg.skillDirs) ? cfg.skillDirs : [];
2816
2820
  const commandDirs = Array.isArray(cfg.commandDirs) ? cfg.commandDirs : [];
2817
2821
  const promptDirs = Array.isArray(cfg.promptDirs) ? cfg.promptDirs : [];
2822
+ const hookDirs = Array.isArray(cfg.hookDirs) ? cfg.hookDirs : [];
2818
2823
 
2819
2824
  const resolvePreferredDir = async (dirs) => {
2820
2825
  if (dirs.length === 0) return null;
@@ -2831,6 +2836,7 @@ async function resolveProfilePaths(profileId, scope, cwd = process.cwd()) {
2831
2836
  skillsDir: await resolvePreferredDir(skillDirs),
2832
2837
  commandsDir: commandDirs[0] ? expandPath(commandDirs[0], cwd) : null,
2833
2838
  promptsDir: promptDirs[0] ? expandPath(promptDirs[0], cwd) : null,
2839
+ hooksDir: hookDirs[0] ? expandPath(hookDirs[0], cwd) : null,
2834
2840
  ruleFilesByPriority: cfg.ruleFilesByPriority.map((filePath) =>
2835
2841
  expandPath(filePath, cwd),
2836
2842
  ),
@@ -2862,6 +2868,7 @@ function resolveProfilePathCandidates(profileId, scope, cwd = process.cwd()) {
2862
2868
  skillsDirs: expandUniquePaths(cfg.skillDirs, cwd),
2863
2869
  commandsDirs: expandUniquePaths(cfg.commandDirs, cwd),
2864
2870
  promptsDirs: expandUniquePaths(cfg.promptDirs, cwd),
2871
+ hooksDirs: expandUniquePaths(cfg.hookDirs, cwd),
2865
2872
  ruleFilesByPriority: expandUniquePaths(cfg.ruleFilesByPriority, cwd),
2866
2873
  };
2867
2874
  }
@@ -2895,6 +2902,7 @@ async function resolveArtifactProfilePaths(
2895
2902
  agentsDir: workspacePaths.agentsDir,
2896
2903
  commandsDir: workspacePaths.commandsDir ?? scopedPaths.commandsDir,
2897
2904
  promptsDir: workspacePaths.promptsDir ?? scopedPaths.promptsDir,
2905
+ hooksDir: scopedPaths.hooksDir,
2898
2906
  };
2899
2907
  }
2900
2908
 
@@ -4561,10 +4569,14 @@ function resolvePostmanMcpDefinitionPath({
4561
4569
  );
4562
4570
  }
4563
4571
 
4564
- function resolveStitchMcpDefinitionPath({ scope, cwd = process.cwd() }) {
4572
+ function resolveStitchMcpDefinitionPath({
4573
+ platform,
4574
+ scope,
4575
+ cwd = process.cwd(),
4576
+ }) {
4565
4577
  return path.join(
4566
4578
  resolveMcpRootPath({ scope, cwd }),
4567
- "antigravity",
4579
+ platform,
4568
4580
  "stitch.json",
4569
4581
  );
4570
4582
  }
@@ -5271,11 +5283,7 @@ async function removeGeneratedArtifactIfExists({ targetPath, dryRun = false }) {
5271
5283
  async function applyPostmanMcpForPlatform({
5272
5284
  platform,
5273
5285
  mcpScope,
5274
- apiKeyEnvVar,
5275
- mcpUrl,
5276
- includePostmanMcp = true,
5277
- stitchApiKeyEnvVar,
5278
- stitchMcpUrl,
5286
+ includePostmanMcp = false,
5279
5287
  includeStitchMcp = false,
5280
5288
  includeFoundryMcp = true,
5281
5289
  includePlaywrightMcp = false,
@@ -5287,12 +5295,11 @@ async function applyPostmanMcpForPlatform({
5287
5295
  const warnings = [];
5288
5296
  const foundryScope = mcpScope === "global" ? "global" : "project";
5289
5297
  const normalizedFoundryRuntime = normalizeMcpRuntime(foundryRuntime, "local");
5290
- const resolvedPostmanApiKey = normalizePostmanApiKey(
5291
- process.env[apiKeyEnvVar || POSTMAN_API_KEY_ENV_VAR],
5292
- );
5293
- const resolvedStitchApiKey = normalizePostmanApiKey(
5294
- process.env[stitchApiKeyEnvVar || STITCH_API_KEY_ENV_VAR],
5295
- );
5298
+ const cleanupLegacyServers = (servers) => {
5299
+ delete servers[POSTMAN_SKILL_ID];
5300
+ delete servers[STITCH_MCP_SERVER_ID];
5301
+ return servers;
5302
+ };
5296
5303
  let foundryDockerPort = DEFAULT_MCP_DOCKER_HOST_PORT;
5297
5304
  if (includeFoundryMcp && normalizedFoundryRuntime === "docker") {
5298
5305
  const runningPort = await resolveDockerContainerHostPort({
@@ -5324,13 +5331,7 @@ async function applyPostmanMcpForPlatform({
5324
5331
  !Array.isArray(next.mcpServers)
5325
5332
  ? { ...next.mcpServers }
5326
5333
  : {};
5327
- if (includePostmanMcp) {
5328
- mcpServers[POSTMAN_SKILL_ID] = buildGeminiPostmanServer({
5329
- apiKeyEnvVar,
5330
- apiKey: resolvedPostmanApiKey,
5331
- mcpUrl,
5332
- });
5333
- }
5334
+ cleanupLegacyServers(mcpServers);
5334
5335
  if (includeFoundryMcp) {
5335
5336
  mcpServers[FOUNDRY_MCP_SERVER_ID] = buildGeminiFoundryServer({
5336
5337
  scope: foundryScope,
@@ -5340,13 +5341,6 @@ async function applyPostmanMcpForPlatform({
5340
5341
  } else {
5341
5342
  delete mcpServers[FOUNDRY_MCP_SERVER_ID];
5342
5343
  }
5343
- if (includeStitchMcp) {
5344
- mcpServers[STITCH_MCP_SERVER_ID] = buildGeminiStitchServer({
5345
- apiKeyEnvVar: stitchApiKeyEnvVar,
5346
- apiKey: resolvedStitchApiKey,
5347
- mcpUrl: stitchMcpUrl,
5348
- });
5349
- }
5350
5344
  if (includePlaywrightMcp) {
5351
5345
  mcpServers[PLAYWRIGHT_MCP_SERVER_ID] = buildGeminiPlaywrightServer();
5352
5346
  }
@@ -5380,13 +5374,7 @@ async function applyPostmanMcpForPlatform({
5380
5374
  !Array.isArray(next.mcpServers)
5381
5375
  ? { ...next.mcpServers }
5382
5376
  : {};
5383
- if (includePostmanMcp) {
5384
- mcpServers[POSTMAN_SKILL_ID] = buildCopilotCliPostmanServer({
5385
- apiKeyEnvVar,
5386
- apiKey: resolvedPostmanApiKey,
5387
- mcpUrl,
5388
- });
5389
- }
5377
+ cleanupLegacyServers(mcpServers);
5390
5378
  if (includeFoundryMcp) {
5391
5379
  mcpServers[FOUNDRY_MCP_SERVER_ID] = buildCopilotCliFoundryServer({
5392
5380
  scope: foundryScope,
@@ -5410,13 +5398,7 @@ async function applyPostmanMcpForPlatform({
5410
5398
  !Array.isArray(next.servers)
5411
5399
  ? { ...next.servers }
5412
5400
  : {};
5413
- if (includePostmanMcp) {
5414
- servers[POSTMAN_SKILL_ID] = buildVsCodePostmanServer({
5415
- apiKeyEnvVar,
5416
- apiKey: resolvedPostmanApiKey,
5417
- mcpUrl,
5418
- });
5419
- }
5401
+ cleanupLegacyServers(servers);
5420
5402
  if (includeFoundryMcp) {
5421
5403
  servers[FOUNDRY_MCP_SERVER_ID] = buildVsCodeFoundryServer({
5422
5404
  scope: foundryScope,
@@ -5464,13 +5446,7 @@ async function applyPostmanMcpForPlatform({
5464
5446
  !Array.isArray(next.servers)
5465
5447
  ? { ...next.servers }
5466
5448
  : {};
5467
- if (includePostmanMcp) {
5468
- servers[POSTMAN_SKILL_ID] = buildVsCodePostmanServer({
5469
- apiKeyEnvVar,
5470
- apiKey: resolvedPostmanApiKey,
5471
- mcpUrl,
5472
- });
5473
- }
5449
+ cleanupLegacyServers(servers);
5474
5450
  if (includeFoundryMcp) {
5475
5451
  servers[FOUNDRY_MCP_SERVER_ID] = buildVsCodeFoundryServer({
5476
5452
  scope: foundryScope,
@@ -5513,6 +5489,11 @@ async function applyPostmanMcpForPlatform({
5513
5489
  } catch {
5514
5490
  // Best effort. Add will still run and becomes source of truth.
5515
5491
  }
5492
+ try {
5493
+ await execFile("codex", ["mcp", "remove", STITCH_MCP_SERVER_ID], { cwd });
5494
+ } catch {
5495
+ // Best effort. Add will still run and becomes source of truth.
5496
+ }
5516
5497
  try {
5517
5498
  await execFile("codex", ["mcp", "remove", FOUNDRY_MCP_SERVER_ID], {
5518
5499
  cwd,
@@ -5520,51 +5501,12 @@ async function applyPostmanMcpForPlatform({
5520
5501
  } catch {
5521
5502
  // Best effort. Add will still run and becomes source of truth.
5522
5503
  }
5523
-
5524
- if (includePostmanMcp) {
5525
- try {
5526
- await execFile(
5527
- "codex",
5528
- [
5529
- "mcp",
5530
- "add",
5531
- POSTMAN_SKILL_ID,
5532
- "--url",
5533
- mcpUrl,
5534
- "--bearer-token-env-var",
5535
- apiKeyEnvVar || POSTMAN_API_KEY_ENV_VAR,
5536
- ],
5537
- { cwd },
5538
- );
5539
- const postmanToken = normalizePostmanApiKey(
5540
- process.env[apiKeyEnvVar || POSTMAN_API_KEY_ENV_VAR],
5541
- );
5542
- const postmanPatch = await patchCodexPostmanHttpHeaders({
5543
- configPath: codexConfigPath,
5544
- mcpUrl,
5545
- bearerToken: postmanToken,
5546
- dryRun: false,
5547
- });
5548
- if (postmanPatch.action === "patched") {
5549
- warnings.push(
5550
- "Codex Postman MCP config patched to static Authorization header for startup reliability.",
5551
- );
5552
- }
5553
- if (postmanPatch.warnings?.length) {
5554
- warnings.push(...postmanPatch.warnings);
5555
- }
5556
- } catch (error) {
5557
- warnings.push(
5558
- `Failed to register Postman MCP via Codex CLI. Ensure 'codex' is installed and rerun. (${error.message})`,
5559
- );
5560
- return {
5561
- kind: "codex-cli",
5562
- scope: mcpScope,
5563
- path: codexConfigPath,
5564
- action: "failed",
5565
- warnings,
5566
- };
5567
- }
5504
+ try {
5505
+ await execFile("codex", ["mcp", "remove", PLAYWRIGHT_MCP_SERVER_ID], {
5506
+ cwd,
5507
+ });
5508
+ } catch {
5509
+ // Best effort. Add will still run and becomes source of truth.
5568
5510
  }
5569
5511
 
5570
5512
  if (includeFoundryMcp) {
@@ -5601,6 +5543,19 @@ async function applyPostmanMcpForPlatform({
5601
5543
  );
5602
5544
  }
5603
5545
  }
5546
+ if (includePlaywrightMcp) {
5547
+ try {
5548
+ await execFile(
5549
+ "codex",
5550
+ ["mcp", "add", PLAYWRIGHT_MCP_SERVER_ID, "--url", PLAYWRIGHT_MCP_URL],
5551
+ { cwd },
5552
+ );
5553
+ } catch (error) {
5554
+ warnings.push(
5555
+ `Failed to register ${PLAYWRIGHT_MCP_SERVER_ID} MCP via Codex CLI. Ensure 'codex' is installed and rerun. (${error.message})`,
5556
+ );
5557
+ }
5558
+ }
5604
5559
 
5605
5560
  return {
5606
5561
  kind: "codex-cli",
@@ -5626,6 +5581,7 @@ async function applyPostmanMcpForPlatform({
5626
5581
  !Array.isArray(next.mcpServers)
5627
5582
  ? { ...next.mcpServers }
5628
5583
  : {};
5584
+ cleanupLegacyServers(mcpServers);
5629
5585
  if (includeFoundryMcp) {
5630
5586
  if (normalizedFoundryRuntime === "docker") {
5631
5587
  mcpServers[FOUNDRY_MCP_SERVER_ID] = {
@@ -5668,7 +5624,7 @@ async function applyPostmanMcpForPlatform({
5668
5624
  path: null,
5669
5625
  action: "skipped",
5670
5626
  warnings: [
5671
- `Unsupported platform '${platform}' for Postman MCP installation.`,
5627
+ `Unsupported platform '${platform}' for Foundry MCP installation.`,
5672
5628
  ],
5673
5629
  };
5674
5630
  }
@@ -5716,13 +5672,28 @@ async function resolvePostmanInstallSelection({
5716
5672
  }
5717
5673
 
5718
5674
  const stitchRequested = Boolean(options.stitch);
5675
+ const playwrightRequested = Boolean(options.playwright);
5719
5676
  const postmanRequested =
5720
5677
  Boolean(options.postman) ||
5721
5678
  hasWorkspaceOption ||
5722
5679
  options.postmanMode !== undefined;
5680
+ const stitchEnabled = stitchRequested;
5681
+ const gatewayRequested = postmanRequested || stitchEnabled;
5682
+ const foundryMcpRequested = options.foundryMcp === true;
5683
+ const foundryMcpEnabled =
5684
+ options.foundryMcp === false && !gatewayRequested
5685
+ ? false
5686
+ : foundryMcpRequested || gatewayRequested;
5723
5687
  const foundryOnlyRequested =
5724
- options.foundryMcp === true && !postmanRequested && !stitchRequested;
5725
- const enabled = postmanRequested || stitchRequested || foundryOnlyRequested;
5688
+ foundryMcpRequested &&
5689
+ !postmanRequested &&
5690
+ !stitchRequested &&
5691
+ !playwrightRequested;
5692
+ const enabled =
5693
+ postmanRequested ||
5694
+ stitchRequested ||
5695
+ playwrightRequested ||
5696
+ foundryOnlyRequested;
5726
5697
  if (!enabled) return { enabled: false };
5727
5698
  const requestedPostmanMode = postmanRequested
5728
5699
  ? normalizePostmanMode(options.postmanMode, DEFAULT_POSTMAN_INSTALL_MODE)
@@ -5743,19 +5714,20 @@ async function resolvePostmanInstallSelection({
5743
5714
  : null;
5744
5715
  let mcpScope = requestedMcpScope?.scope || "project";
5745
5716
  const warnings = [];
5717
+ if (options.foundryMcp === false && gatewayRequested) {
5718
+ warnings.push(
5719
+ "Ignoring --no-foundry-mcp because Postman/Stitch now route through the Cubis Foundry MCP gateway.",
5720
+ );
5721
+ }
5746
5722
  if (requestedMcpScope?.warning) {
5747
5723
  warnings.push(requestedMcpScope.warning);
5748
5724
  }
5749
- const stitchEnabled =
5750
- stitchRequested ||
5751
- (platform === "antigravity" &&
5752
- options.stitchDefaultForAntigravity !== false);
5753
5725
  const envStitchApiKey = normalizePostmanApiKey(
5754
5726
  process.env[STITCH_API_KEY_ENV_VAR],
5755
5727
  );
5756
5728
  const requestedRuntime = normalizeMcpRuntime(
5757
5729
  options.mcpRuntime,
5758
- DEFAULT_MCP_RUNTIME,
5730
+ foundryMcpEnabled ? DEFAULT_MCP_RUNTIME : "local",
5759
5731
  );
5760
5732
  const requestedFallback = normalizeMcpFallback(
5761
5733
  options.mcpFallback,
@@ -5768,8 +5740,8 @@ async function resolvePostmanInstallSelection({
5768
5740
  DEFAULT_MCP_UPDATE_POLICY,
5769
5741
  );
5770
5742
  const mcpBuildLocal = Boolean(options.mcpBuildLocal);
5771
- const mcpToolSync = options.mcpToolSync !== false;
5772
- const foundryMcpEnabled = options.foundryMcp !== false;
5743
+ const mcpToolSync =
5744
+ options.mcpToolSync !== false && (postmanRequested || stitchEnabled);
5773
5745
 
5774
5746
  const canPrompt =
5775
5747
  !options.yes && !options.dryRun && !process.env.CI && process.stdin.isTTY;
@@ -5783,10 +5755,10 @@ async function resolvePostmanInstallSelection({
5783
5755
  workspaceSelectionSource = "interactive";
5784
5756
  }
5785
5757
 
5786
- let effectiveRuntime = requestedRuntime;
5787
- let runtimeSkipped = false;
5788
- let dockerImageAction = "not-requested";
5789
- if (requestedRuntime === "docker") {
5758
+ let effectiveRuntime = foundryMcpEnabled ? requestedRuntime : null;
5759
+ let runtimeSkipped = !foundryMcpEnabled;
5760
+ let dockerImageAction = foundryMcpEnabled ? "not-requested" : "not-needed";
5761
+ if (foundryMcpEnabled && requestedRuntime === "docker") {
5790
5762
  const dockerAvailable = await checkDockerAvailable({ cwd });
5791
5763
  if (!dockerAvailable) {
5792
5764
  if (requestedFallback === "fail") {
@@ -5871,11 +5843,12 @@ async function resolvePostmanInstallSelection({
5871
5843
  generatedAt: new Date().toISOString(),
5872
5844
  mcp: {
5873
5845
  scope: mcpScope,
5874
- server: postmanRequested
5875
- ? POSTMAN_SKILL_ID
5876
- : stitchEnabled
5877
- ? STITCH_MCP_SERVER_ID
5878
- : FOUNDRY_MCP_SERVER_ID,
5846
+ server:
5847
+ foundryMcpEnabled || gatewayRequested
5848
+ ? FOUNDRY_MCP_SERVER_ID
5849
+ : playwrightRequested
5850
+ ? PLAYWRIGHT_MCP_SERVER_ID
5851
+ : FOUNDRY_MCP_SERVER_ID,
5879
5852
  platform,
5880
5853
  runtime: requestedRuntime,
5881
5854
  fallback: requestedFallback,
@@ -5918,12 +5891,20 @@ async function resolvePostmanInstallSelection({
5918
5891
  mcpUrl: STITCH_MCP_URL,
5919
5892
  };
5920
5893
  }
5894
+ if (playwrightRequested) {
5895
+ cbxConfig.playwright = {
5896
+ enabled: true,
5897
+ server: PLAYWRIGHT_MCP_SERVER_ID,
5898
+ mcpUrl: PLAYWRIGHT_MCP_URL,
5899
+ };
5900
+ }
5921
5901
 
5922
5902
  return {
5923
5903
  enabled: true,
5924
5904
  postmanEnabled: postmanRequested,
5925
5905
  apiKeySource,
5926
5906
  stitchEnabled,
5907
+ playwrightEnabled: playwrightRequested,
5927
5908
  stitchApiKeySource,
5928
5909
  mcpRuntime: requestedRuntime,
5929
5910
  effectiveMcpRuntime: runtimeSkipped ? null : effectiveRuntime,
@@ -5951,6 +5932,7 @@ async function configurePostmanInstallArtifacts({
5951
5932
  profilePaths,
5952
5933
  postmanSelection,
5953
5934
  overwrite = false,
5935
+ persistCredentials = true,
5954
5936
  dryRun = false,
5955
5937
  cwd = process.cwd(),
5956
5938
  }) {
@@ -6123,50 +6105,30 @@ async function configurePostmanInstallArtifacts({
6123
6105
  gitIgnoreResults.push(mcpIgnore);
6124
6106
  }
6125
6107
 
6126
- let mcpDefinitionPath = null;
6127
- let mcpDefinitionResult = null;
6108
+ const legacyDefinitionCleanupResults = [];
6128
6109
  if (shouldInstallPostman) {
6129
- mcpDefinitionPath = resolvePostmanMcpDefinitionPath({
6130
- platform,
6131
- scope: postmanSelection.mcpScope,
6132
- cwd,
6133
- });
6134
- const mcpDefinitionContent = `${JSON.stringify(
6135
- buildPostmanMcpDefinition({
6136
- apiKeyEnvVar: effectiveApiKeyEnvVar,
6137
- apiKey: envApiKey,
6138
- mcpUrl: effectiveMcpUrl,
6110
+ legacyDefinitionCleanupResults.push(
6111
+ await removeGeneratedArtifactIfExists({
6112
+ targetPath: resolvePostmanMcpDefinitionPath({
6113
+ platform,
6114
+ scope: postmanSelection.mcpScope,
6115
+ cwd,
6116
+ }),
6117
+ dryRun,
6139
6118
  }),
6140
- null,
6141
- 2,
6142
- )}\n`;
6143
- mcpDefinitionResult = await writeGeneratedArtifact({
6144
- destination: mcpDefinitionPath,
6145
- content: mcpDefinitionContent,
6146
- dryRun,
6147
- });
6119
+ );
6148
6120
  }
6149
- let stitchMcpDefinitionPath = null;
6150
- let stitchMcpDefinitionResult = null;
6151
6121
  if (shouldInstallStitch) {
6152
- stitchMcpDefinitionPath = resolveStitchMcpDefinitionPath({
6153
- scope: postmanSelection.mcpScope,
6154
- cwd,
6155
- });
6156
- const stitchMcpDefinitionContent = `${JSON.stringify(
6157
- buildStitchMcpDefinition({
6158
- apiKeyEnvVar: effectiveStitchApiKeyEnvVar,
6159
- apiKey: envStitchApiKey,
6160
- mcpUrl: effectiveStitchMcpUrl,
6122
+ legacyDefinitionCleanupResults.push(
6123
+ await removeGeneratedArtifactIfExists({
6124
+ targetPath: resolveStitchMcpDefinitionPath({
6125
+ platform,
6126
+ scope: postmanSelection.mcpScope,
6127
+ cwd,
6128
+ }),
6129
+ dryRun,
6161
6130
  }),
6162
- null,
6163
- 2,
6164
- )}\n`;
6165
- stitchMcpDefinitionResult = await writeGeneratedArtifact({
6166
- destination: stitchMcpDefinitionPath,
6167
- content: stitchMcpDefinitionContent,
6168
- dryRun,
6169
- });
6131
+ );
6170
6132
  }
6171
6133
 
6172
6134
  const mcpRuntimeResult = postmanSelection.runtimeSkipped
@@ -6229,6 +6191,28 @@ async function configurePostmanInstallArtifacts({
6229
6191
  dryRun,
6230
6192
  })
6231
6193
  : null;
6194
+ const credentialEnvVarNames = [];
6195
+ if (persistCredentials && shouldInstallPostman && effectiveApiKeySource === "env") {
6196
+ credentialEnvVarNames.push(
6197
+ effectiveApiKeyEnvVar || POSTMAN_API_KEY_ENV_VAR,
6198
+ );
6199
+ }
6200
+ if (
6201
+ persistCredentials &&
6202
+ shouldInstallStitch &&
6203
+ effectiveStitchApiKeySource === "env"
6204
+ ) {
6205
+ credentialEnvVarNames.push(
6206
+ effectiveStitchApiKeyEnvVar || STITCH_API_KEY_ENV_VAR,
6207
+ );
6208
+ }
6209
+ const persistedCredentials =
6210
+ credentialEnvVarNames.length > 0
6211
+ ? await persistManagedCredentialsEnv({
6212
+ envVarNames: [...new Set(credentialEnvVarNames)],
6213
+ dryRun,
6214
+ })
6215
+ : null;
6232
6216
 
6233
6217
  return {
6234
6218
  enabled: true,
@@ -6243,6 +6227,7 @@ async function configurePostmanInstallArtifacts({
6243
6227
  mcpToolSync: postmanSelection.mcpToolSync,
6244
6228
  foundryMcpEnabled: postmanSelection.foundryMcpEnabled,
6245
6229
  postmanEnabled: shouldInstallPostman,
6230
+ playwrightEnabled: Boolean(postmanSelection.playwrightEnabled),
6246
6231
  postmanMode:
6247
6232
  shouldInstallPostman && effectiveMcpUrl
6248
6233
  ? resolvePostmanModeFromUrl(
@@ -6251,6 +6236,9 @@ async function configurePostmanInstallArtifacts({
6251
6236
  )
6252
6237
  : null,
6253
6238
  postmanMcpUrl: shouldInstallPostman ? effectiveMcpUrl : null,
6239
+ playwrightMcpUrl: postmanSelection.playwrightEnabled
6240
+ ? PLAYWRIGHT_MCP_URL
6241
+ : null,
6254
6242
  apiKeySource: effectiveApiKeySource,
6255
6243
  stitchApiKeySource: effectiveStitchApiKeySource,
6256
6244
  defaultWorkspaceId: effectiveDefaultWorkspaceId,
@@ -6258,13 +6246,11 @@ async function configurePostmanInstallArtifacts({
6258
6246
  cbxConfigPath: postmanSelection.cbxConfigPath,
6259
6247
  cbxConfigResult,
6260
6248
  gitIgnoreResults,
6261
- mcpDefinitionPath,
6262
- mcpDefinitionResult,
6263
- stitchMcpDefinitionPath,
6264
- stitchMcpDefinitionResult,
6249
+ legacyDefinitionCleanupResults,
6265
6250
  mcpRuntimeResult,
6266
6251
  mcpCatalogSyncResults,
6267
6252
  legacySkillMcpCleanup,
6253
+ persistedCredentials,
6268
6254
  };
6269
6255
  }
6270
6256
 
@@ -6291,14 +6277,32 @@ async function applyPostmanConfigArtifacts({
6291
6277
  cwd = process.cwd(),
6292
6278
  }) {
6293
6279
  const warnings = [];
6294
- const postmanState = ensureCredentialServiceState(configValue, "postman");
6280
+ const storedPostmanState = parseStoredPostmanConfig(configValue);
6281
+ const postmanEnabled = Boolean(storedPostmanState);
6282
+ const postmanState =
6283
+ storedPostmanState ||
6284
+ parseStoredCredentialServiceConfig({ service: "postman", rawService: {} });
6295
6285
  const stitchState = parseStoredStitchConfig(configValue);
6296
- const postmanApiKeyEnvVar =
6297
- normalizePostmanApiKey(postmanState.apiKeyEnvVar) ||
6298
- POSTMAN_API_KEY_ENV_VAR;
6299
- const postmanMcpUrl = postmanState.mcpUrl || POSTMAN_MCP_URL;
6286
+ const postmanApiKeyEnvVar = postmanEnabled
6287
+ ? normalizePostmanApiKey(postmanState.apiKeyEnvVar) ||
6288
+ POSTMAN_API_KEY_ENV_VAR
6289
+ : POSTMAN_API_KEY_ENV_VAR;
6290
+ const postmanMcpUrl = postmanEnabled
6291
+ ? postmanState.mcpUrl || POSTMAN_MCP_URL
6292
+ : POSTMAN_MCP_URL;
6300
6293
  const stitchEnabled = Boolean(stitchState);
6301
- const playwrightEnabled = Boolean(configValue?.playwright);
6294
+ const playwrightConfig =
6295
+ configValue?.playwright &&
6296
+ typeof configValue.playwright === "object" &&
6297
+ !Array.isArray(configValue.playwright)
6298
+ ? configValue.playwright
6299
+ : null;
6300
+ const playwrightEnabled = Boolean(
6301
+ playwrightConfig?.enabled ?? configValue?.playwright,
6302
+ );
6303
+ const playwrightMcpUrl =
6304
+ String(playwrightConfig?.mcpUrl || PLAYWRIGHT_MCP_URL).trim() ||
6305
+ PLAYWRIGHT_MCP_URL;
6302
6306
  const stitchApiKeyEnvVar =
6303
6307
  normalizePostmanApiKey(stitchState?.apiKeyEnvVar) || STITCH_API_KEY_ENV_VAR;
6304
6308
  const stitchMcpUrl = stitchState?.mcpUrl || STITCH_MCP_URL;
@@ -6306,54 +6310,31 @@ async function applyPostmanConfigArtifacts({
6306
6310
  configValue?.mcp?.effectiveRuntime || configValue?.mcp?.runtime,
6307
6311
  "local",
6308
6312
  );
6309
- const resolvedPostmanApiKey = normalizePostmanApiKey(
6310
- process.env[postmanApiKeyEnvVar],
6311
- );
6312
- const resolvedStitchApiKey = normalizePostmanApiKey(
6313
- process.env[stitchApiKeyEnvVar],
6314
- );
6315
-
6316
- const mcpDefinitionPath = resolvePostmanMcpDefinitionPath({
6317
- platform,
6318
- scope: mcpScope,
6319
- cwd,
6320
- });
6321
- const mcpDefinitionContent = `${JSON.stringify(
6322
- buildPostmanMcpDefinition({
6323
- apiKeyEnvVar: postmanApiKeyEnvVar,
6324
- apiKey: resolvedPostmanApiKey,
6325
- mcpUrl: postmanMcpUrl,
6326
- }),
6327
- null,
6328
- 2,
6329
- )}\n`;
6330
- const mcpDefinitionResult = await writeGeneratedArtifact({
6331
- destination: mcpDefinitionPath,
6332
- content: mcpDefinitionContent,
6333
- dryRun,
6334
- });
6313
+ const legacyDefinitionCleanupResults = [];
6314
+ if (postmanEnabled && platform) {
6315
+ legacyDefinitionCleanupResults.push(
6316
+ await removeGeneratedArtifactIfExists({
6317
+ targetPath: resolvePostmanMcpDefinitionPath({
6318
+ platform,
6319
+ scope: mcpScope,
6320
+ cwd,
6321
+ }),
6322
+ dryRun,
6323
+ }),
6324
+ );
6325
+ }
6335
6326
 
6336
- let stitchMcpDefinitionPath = null;
6337
- let stitchMcpDefinitionResult = null;
6338
6327
  if (stitchEnabled) {
6339
- stitchMcpDefinitionPath = resolveStitchMcpDefinitionPath({
6340
- scope: mcpScope,
6341
- cwd,
6342
- });
6343
- const stitchMcpDefinitionContent = `${JSON.stringify(
6344
- buildStitchMcpDefinition({
6345
- apiKeyEnvVar: stitchApiKeyEnvVar,
6346
- apiKey: resolvedStitchApiKey,
6347
- mcpUrl: stitchMcpUrl,
6328
+ legacyDefinitionCleanupResults.push(
6329
+ await removeGeneratedArtifactIfExists({
6330
+ targetPath: resolveStitchMcpDefinitionPath({
6331
+ platform,
6332
+ scope: mcpScope,
6333
+ cwd,
6334
+ }),
6335
+ dryRun,
6348
6336
  }),
6349
- null,
6350
- 2,
6351
- )}\n`;
6352
- stitchMcpDefinitionResult = await writeGeneratedArtifact({
6353
- destination: stitchMcpDefinitionPath,
6354
- content: stitchMcpDefinitionContent,
6355
- dryRun,
6356
- });
6337
+ );
6357
6338
  }
6358
6339
 
6359
6340
  let mcpRuntimeResult = null;
@@ -6367,6 +6348,7 @@ async function applyPostmanConfigArtifacts({
6367
6348
  mcpScope,
6368
6349
  apiKeyEnvVar: postmanApiKeyEnvVar,
6369
6350
  mcpUrl: postmanMcpUrl,
6351
+ includePostmanMcp: postmanEnabled,
6370
6352
  stitchApiKeyEnvVar,
6371
6353
  stitchMcpUrl,
6372
6354
  includeStitchMcp: stitchEnabled,
@@ -6380,10 +6362,10 @@ async function applyPostmanConfigArtifacts({
6380
6362
  }
6381
6363
 
6382
6364
  return {
6383
- mcpDefinitionPath,
6384
- mcpDefinitionResult,
6385
- stitchMcpDefinitionPath,
6386
- stitchMcpDefinitionResult,
6365
+ postmanEnabled,
6366
+ playwrightEnabled,
6367
+ playwrightMcpUrl: playwrightEnabled ? playwrightMcpUrl : null,
6368
+ legacyDefinitionCleanupResults,
6387
6369
  mcpRuntimeResult,
6388
6370
  warnings,
6389
6371
  };
@@ -6707,6 +6689,13 @@ async function installBundleArtifacts({
6707
6689
  ) {
6708
6690
  await mkdir(profilePaths.promptsDir, { recursive: true });
6709
6691
  }
6692
+ if (
6693
+ profilePaths.hooksDir &&
6694
+ Array.isArray(platformSpec.hooks) &&
6695
+ platformSpec.hooks.some((entry) => typeof entry?.file === "string")
6696
+ ) {
6697
+ await mkdir(profilePaths.hooksDir, { recursive: true });
6698
+ }
6710
6699
  }
6711
6700
 
6712
6701
  const bundleRoot = path.join(agentAssetsRoot(), "workflows", bundleId);
@@ -6720,6 +6709,7 @@ async function installBundleArtifacts({
6720
6709
  skills: [],
6721
6710
  commands: [],
6722
6711
  prompts: [],
6712
+ hooks: [],
6723
6713
  };
6724
6714
 
6725
6715
  // Bind useSymlinks into copyArtifact so every call site inherits it
@@ -6832,6 +6822,40 @@ async function installBundleArtifacts({
6832
6822
  skipped.push(destination);
6833
6823
  else installed.push(destination);
6834
6824
  }
6825
+ const hookFiles = Array.isArray(platformSpec.hooks)
6826
+ ? platformSpec.hooks
6827
+ .map((entry) =>
6828
+ typeof entry === "string"
6829
+ ? entry
6830
+ : typeof entry?.file === "string"
6831
+ ? entry.file
6832
+ : null,
6833
+ )
6834
+ .filter(Boolean)
6835
+ : [];
6836
+ for (const hookFile of hookFiles) {
6837
+ if (!profilePaths.hooksDir) continue;
6838
+ const source = path.join(platformRoot, "hooks", hookFile);
6839
+ const destination = path.join(
6840
+ profilePaths.hooksDir,
6841
+ path.basename(hookFile),
6842
+ );
6843
+
6844
+ if (!(await pathExists(source))) {
6845
+ throw new Error(`Missing hook source file: ${source}`);
6846
+ }
6847
+
6848
+ const result = await copyArt({
6849
+ source,
6850
+ destination,
6851
+ overwrite,
6852
+ dryRun,
6853
+ });
6854
+ artifacts.hooks.push(destination);
6855
+ if (result.action === "skipped" || result.action === "would-skip")
6856
+ skipped.push(destination);
6857
+ else installed.push(destination);
6858
+ }
6835
6859
  if (shouldInstallPlatformSkills) {
6836
6860
  const agentSkillDependencies = await resolvePlatformAgentSkillDependencies({
6837
6861
  platformRoot,
@@ -7129,6 +7153,22 @@ async function removeBundleArtifacts({
7129
7153
  if (await safeRemove(destination, dryRun)) removed.push(destination);
7130
7154
  }
7131
7155
 
7156
+ for (const hookEntry of platformSpec.hooks || []) {
7157
+ if (!profilePaths.hooksDir) continue;
7158
+ const hookFile =
7159
+ typeof hookEntry === "string"
7160
+ ? hookEntry
7161
+ : typeof hookEntry?.file === "string"
7162
+ ? hookEntry.file
7163
+ : null;
7164
+ if (!hookFile) continue;
7165
+ const destination = path.join(
7166
+ profilePaths.hooksDir,
7167
+ path.basename(hookFile),
7168
+ );
7169
+ if (await safeRemove(destination, dryRun)) removed.push(destination);
7170
+ }
7171
+
7132
7172
  const skillIds = await resolveInstallSkillIds({
7133
7173
  platformSpec,
7134
7174
  extraSkillIds: [],
@@ -7361,11 +7401,16 @@ function printPostmanSetupSummary({ postmanSetup }) {
7361
7401
 
7362
7402
  console.log("\nMCP setup:");
7363
7403
  console.log(`- MCP scope: ${postmanSetup.mcpScope}`);
7404
+ if (postmanSetup.playwrightEnabled) {
7405
+ console.log(
7406
+ `- Playwright MCP: enabled (${postmanSetup.playwrightMcpUrl || PLAYWRIGHT_MCP_URL})`,
7407
+ );
7408
+ }
7364
7409
  if (postmanSetup.postmanEnabled && postmanSetup.postmanMode) {
7365
7410
  console.log(`- Postman mode: ${postmanSetup.postmanMode}`);
7366
7411
  }
7367
7412
  if (postmanSetup.postmanEnabled && postmanSetup.postmanMcpUrl) {
7368
- console.log(`- Postman MCP URL: ${postmanSetup.postmanMcpUrl}`);
7413
+ console.log(`- Postman upstream MCP URL: ${postmanSetup.postmanMcpUrl}`);
7369
7414
  }
7370
7415
  console.log(
7371
7416
  `- Config file: ${postmanSetup.cbxConfigResult.action} (${postmanSetup.cbxConfigPath})`,
@@ -7385,7 +7430,7 @@ function printPostmanSetupSummary({ postmanSetup }) {
7385
7430
  `- MCP tool sync: ${postmanSetup.mcpToolSync ? "enabled" : "disabled"}`,
7386
7431
  );
7387
7432
  console.log(
7388
- `- Foundry MCP side-by-side: ${postmanSetup.foundryMcpEnabled ? (postmanSetup.effectiveMcpRuntime === "docker" ? "enabled (docker endpoint)" : "enabled (cbx mcp serve)") : "disabled"}`,
7433
+ `- Foundry MCP gateway: ${postmanSetup.foundryMcpEnabled ? (postmanSetup.effectiveMcpRuntime === "docker" ? "enabled (docker endpoint)" : "enabled (cbx mcp serve)") : "disabled"}`,
7389
7434
  );
7390
7435
  if (postmanSetup.postmanEnabled) {
7391
7436
  console.log(`- Postman API key source: ${postmanSetup.apiKeySource}`);
@@ -7403,17 +7448,9 @@ function printPostmanSetupSummary({ postmanSetup }) {
7403
7448
  `- .gitignore (${ignoreResult.filePath}): ${ignoreResult.action}`,
7404
7449
  );
7405
7450
  }
7406
- if (postmanSetup.mcpDefinitionPath && postmanSetup.mcpDefinitionResult) {
7451
+ for (const cleanupResult of postmanSetup.legacyDefinitionCleanupResults || []) {
7407
7452
  console.log(
7408
- `- Managed MCP definition (${postmanSetup.mcpDefinitionPath}): ${postmanSetup.mcpDefinitionResult.action}`,
7409
- );
7410
- }
7411
- if (
7412
- postmanSetup.stitchMcpDefinitionPath &&
7413
- postmanSetup.stitchMcpDefinitionResult
7414
- ) {
7415
- console.log(
7416
- `- Managed Stitch MCP definition (${postmanSetup.stitchMcpDefinitionPath}): ${postmanSetup.stitchMcpDefinitionResult.action}`,
7453
+ `- Legacy direct MCP cleanup (${cleanupResult.path}): ${cleanupResult.action}`,
7417
7454
  );
7418
7455
  }
7419
7456
  if (postmanSetup.mcpRuntimeResult) {
@@ -7434,6 +7471,19 @@ function printPostmanSetupSummary({ postmanSetup }) {
7434
7471
  }
7435
7472
  }
7436
7473
  }
7474
+ if (postmanSetup.persistedCredentials) {
7475
+ console.log(
7476
+ `- Credential vault (${postmanSetup.persistedCredentials.envPath}): ${postmanSetup.persistedCredentials.action}`,
7477
+ );
7478
+ console.log(
7479
+ `- Credential vars: ${postmanSetup.persistedCredentials.persisted.length > 0 ? postmanSetup.persistedCredentials.persisted.join(", ") : "(none)"}`,
7480
+ );
7481
+ if (postmanSetup.persistedCredentials.missing.length > 0) {
7482
+ console.log(
7483
+ `- Missing credential vars: ${postmanSetup.persistedCredentials.missing.join(", ")}`,
7484
+ );
7485
+ }
7486
+ }
7437
7487
  if (postmanSetup.legacySkillMcpCleanup) {
7438
7488
  console.log(
7439
7489
  `- Legacy skill mcp.json cleanup (${postmanSetup.legacySkillMcpCleanup.path}): ${postmanSetup.legacySkillMcpCleanup.action}`,
@@ -7865,7 +7915,7 @@ function withInstallOptions(command) {
7865
7915
  .option("--overwrite", "overwrite existing files")
7866
7916
  .option(
7867
7917
  "--postman",
7868
- "optional: install Postman skill and generate cbx_config.json",
7918
+ "optional: configure Postman profiles and gateway-backed Foundry MCP wiring",
7869
7919
  )
7870
7920
  .option(
7871
7921
  "--postman-mode <mode>",
@@ -7873,7 +7923,11 @@ function withInstallOptions(command) {
7873
7923
  )
7874
7924
  .option(
7875
7925
  "--stitch",
7876
- "optional: include Stitch MCP profile/config alongside Postman",
7926
+ "optional: configure Stitch profiles and gateway-backed Foundry MCP wiring",
7927
+ )
7928
+ .option(
7929
+ "--playwright",
7930
+ "optional: include Playwright MCP server wiring",
7877
7931
  )
7878
7932
  .option(
7879
7933
  "--postman-api-key <key>",
@@ -7922,7 +7976,7 @@ function withInstallOptions(command) {
7922
7976
  .option("--no-mcp-tool-sync", "disable automatic MCP tool catalog sync")
7923
7977
  .option(
7924
7978
  "--no-foundry-mcp",
7925
- "disable side-by-side cubis-foundry MCP registration during --postman setup",
7979
+ "deprecated: Postman/Stitch always use Cubis Foundry MCP gateway wiring",
7926
7980
  )
7927
7981
  .option(
7928
7982
  "--terminal-integration",
@@ -7934,7 +7988,7 @@ function withInstallOptions(command) {
7934
7988
  )
7935
7989
  .option(
7936
7990
  "--skill-profile <profile>",
7937
- "skill install profile: core|web-backend|full (default: core)",
7991
+ "skill install profile: core|web-backend|full",
7938
7992
  DEFAULT_SKILL_PROFILE,
7939
7993
  )
7940
7994
  .option("--all-skills", "alias for --skill-profile full")
@@ -8343,6 +8397,7 @@ async function performWorkflowInstall(
8343
8397
  profilePaths: installResult.profilePaths,
8344
8398
  postmanSelection,
8345
8399
  overwrite: Boolean(options.overwrite),
8400
+ persistCredentials: !options.initWizardMode,
8346
8401
  dryRun,
8347
8402
  cwd,
8348
8403
  });
@@ -9263,14 +9318,16 @@ async function runWorkflowRemoveAll(options) {
9263
9318
  dryRun,
9264
9319
  records: removedRecords,
9265
9320
  });
9266
- if (platform === "antigravity") {
9267
- await removePathRecord({
9268
- targetPath: resolveStitchMcpDefinitionPath({ scope, cwd }),
9269
- category: `${platform}/${scope}/stitch-mcp-definition`,
9270
- dryRun,
9271
- records: removedRecords,
9272
- });
9273
- }
9321
+ await removePathRecord({
9322
+ targetPath: resolveStitchMcpDefinitionPath({
9323
+ platform,
9324
+ scope,
9325
+ cwd,
9326
+ }),
9327
+ category: `${platform}/${scope}/stitch-mcp-definition`,
9328
+ dryRun,
9329
+ records: removedRecords,
9330
+ });
9274
9331
 
9275
9332
  const runtimeResults = await removePlatformMcpRuntimeTargets({
9276
9333
  platform,
@@ -9592,7 +9649,7 @@ function prepareConfigDocument(existingValue, { scope, generatedBy }) {
9592
9649
  if (!next.mcp || typeof next.mcp !== "object" || Array.isArray(next.mcp))
9593
9650
  next.mcp = {};
9594
9651
  next.mcp.scope = scope;
9595
- if (!next.mcp.server) next.mcp.server = POSTMAN_SKILL_ID;
9652
+ if (!next.mcp.server) next.mcp.server = FOUNDRY_MCP_SERVER_ID;
9596
9653
  return next;
9597
9654
  }
9598
9655
 
@@ -9879,30 +9936,160 @@ function migrateInlineCredentialsInConfig(configValue) {
9879
9936
  };
9880
9937
  }
9881
9938
 
9882
- async function collectInlineHeaderFindings({ scope, cwd = process.cwd() }) {
9883
- const findings = [];
9884
- const stitchDefinitionPath = resolveStitchMcpDefinitionPath({ scope, cwd });
9885
- const geminiSettingsPath =
9939
+ function resolveCredentialLeakScanTargets({ scope, cwd = process.cwd() }) {
9940
+ const workspaceRoot = findWorkspaceRoot(cwd);
9941
+ const targets = new Set([
9942
+ resolveLegacyPostmanConfigPath({ scope, cwd }),
9886
9943
  scope === "global"
9887
9944
  ? path.join(os.homedir(), ".gemini", "settings.json")
9888
- : path.join(findWorkspaceRoot(cwd), ".gemini", "settings.json");
9945
+ : path.join(workspaceRoot, ".gemini", "settings.json"),
9946
+ scope === "global"
9947
+ ? path.join(os.homedir(), ".claude", "mcp.json")
9948
+ : path.join(workspaceRoot, ".mcp.json"),
9949
+ scope === "global"
9950
+ ? path.join(os.homedir(), ".copilot", "mcp-config.json")
9951
+ : path.join(workspaceRoot, ".vscode", "mcp.json"),
9952
+ ]);
9889
9953
 
9890
- const scanFile = async (filePath) => {
9891
- if (!(await pathExists(filePath))) return;
9892
- const raw = await readFile(filePath, "utf8");
9893
- const unsafeStitchHeader =
9894
- /X-Goog-Api-Key:(?!\s*\$\{[A-Za-z_][A-Za-z0-9_]*\})\s*[^"\n]+/i;
9895
- const unsafeBearerHeader = /"Authorization"\s*:\s*"Bearer\s+(?!\$\{)[^"]+/i;
9896
- if (unsafeStitchHeader.test(raw) || unsafeBearerHeader.test(raw)) {
9897
- findings.push(filePath);
9954
+ if (scope === "global") {
9955
+ targets.add(path.join(os.homedir(), ".codex", "config.toml"));
9956
+ }
9957
+
9958
+ for (const platform of Object.keys(WORKFLOW_PROFILES)) {
9959
+ targets.add(resolvePostmanMcpDefinitionPath({ platform, scope, cwd }));
9960
+ targets.add(resolveStitchMcpDefinitionPath({ platform, scope, cwd }));
9961
+ }
9962
+
9963
+ return [...targets];
9964
+ }
9965
+
9966
+ function collectCredentialLeakMatches(raw) {
9967
+ const matches = [];
9968
+ const patterns = [
9969
+ {
9970
+ id: "inline-apiKey-field",
9971
+ pattern: /"apiKey"\s*:\s*"(?!\$\{)[^"]+/i,
9972
+ },
9973
+ {
9974
+ id: "inline-bearer-header-json",
9975
+ pattern: /"Authorization"\s*:\s*"Bearer\s+(?!\$\{)[^"]+/i,
9976
+ },
9977
+ {
9978
+ id: "inline-bearer-header-toml",
9979
+ pattern:
9980
+ /http_headers\s*=\s*\{[^}]*Authorization\s*=\s*"Bearer\s+(?!\$\{)[^"]+/is,
9981
+ },
9982
+ {
9983
+ id: "inline-stitch-header-arg",
9984
+ pattern: /X-Goog-Api-Key:(?!\s*\$\{[A-Za-z_][A-Za-z0-9_]*\})\s*[^"\n]+/i,
9985
+ },
9986
+ {
9987
+ id: "inline-stitch-header-json",
9988
+ pattern: /"X-Goog-Api-Key"\s*:\s*"(?!\$\{)[^"]+/i,
9989
+ },
9990
+ ];
9991
+
9992
+ for (const { id, pattern } of patterns) {
9993
+ if (pattern.test(raw)) {
9994
+ matches.push(id);
9898
9995
  }
9899
- };
9996
+ }
9997
+
9998
+ return matches;
9999
+ }
9900
10000
 
9901
- await scanFile(stitchDefinitionPath);
9902
- await scanFile(geminiSettingsPath);
10001
+ async function collectCredentialLeakFindings({ scope, cwd = process.cwd() }) {
10002
+ const findings = [];
10003
+ for (const filePath of resolveCredentialLeakScanTargets({ scope, cwd })) {
10004
+ if (!(await pathExists(filePath))) continue;
10005
+ const raw = await readFile(filePath, "utf8");
10006
+ const matches = collectCredentialLeakMatches(raw);
10007
+ if (matches.length > 0) {
10008
+ findings.push({ filePath, matches });
10009
+ }
10010
+ }
9903
10011
  return findings;
9904
10012
  }
9905
10013
 
10014
+ async function cleanupLegacyDirectCredentialArtifacts({
10015
+ scope,
10016
+ dryRun = false,
10017
+ cwd = process.cwd(),
10018
+ }) {
10019
+ const workspaceRoot = findWorkspaceRoot(cwd);
10020
+ const cleanupResults = [];
10021
+ const legacyServerIds = [POSTMAN_SKILL_ID, STITCH_MCP_SERVER_ID];
10022
+
10023
+ cleanupResults.push(
10024
+ await removeMcpRuntimeEntriesJson({
10025
+ filePath:
10026
+ scope === "global"
10027
+ ? path.join(os.homedir(), ".gemini", "settings.json")
10028
+ : path.join(workspaceRoot, ".gemini", "settings.json"),
10029
+ keyName: "mcpServers",
10030
+ serverIds: legacyServerIds,
10031
+ dryRun,
10032
+ }),
10033
+ );
10034
+ cleanupResults.push(
10035
+ await removeMcpRuntimeEntriesJson({
10036
+ filePath:
10037
+ scope === "global"
10038
+ ? path.join(os.homedir(), ".claude", "mcp.json")
10039
+ : path.join(workspaceRoot, ".mcp.json"),
10040
+ keyName: "mcpServers",
10041
+ serverIds: legacyServerIds,
10042
+ dryRun,
10043
+ }),
10044
+ );
10045
+ if (scope === "global") {
10046
+ cleanupResults.push(
10047
+ await removeMcpRuntimeEntriesJson({
10048
+ filePath: path.join(os.homedir(), ".copilot", "mcp-config.json"),
10049
+ keyName: "mcpServers",
10050
+ serverIds: legacyServerIds,
10051
+ dryRun,
10052
+ }),
10053
+ );
10054
+ cleanupResults.push(
10055
+ await removeMcpRuntimeEntriesCodexToml({
10056
+ filePath: path.join(os.homedir(), ".codex", "config.toml"),
10057
+ serverIds: legacyServerIds,
10058
+ dryRun,
10059
+ cwd,
10060
+ }),
10061
+ );
10062
+ } else {
10063
+ cleanupResults.push(
10064
+ await removeMcpRuntimeEntriesJson({
10065
+ filePath: path.join(workspaceRoot, ".vscode", "mcp.json"),
10066
+ keyName: "servers",
10067
+ serverIds: legacyServerIds,
10068
+ dryRun,
10069
+ }),
10070
+ );
10071
+ }
10072
+
10073
+ for (const platform of Object.keys(WORKFLOW_PROFILES)) {
10074
+ cleanupResults.push(
10075
+ await removeGeneratedArtifactIfExists({
10076
+ targetPath: resolvePostmanMcpDefinitionPath({ platform, scope, cwd }),
10077
+ dryRun,
10078
+ }),
10079
+ );
10080
+ cleanupResults.push(
10081
+ await removeGeneratedArtifactIfExists({
10082
+ targetPath: resolveStitchMcpDefinitionPath({ platform, scope, cwd }),
10083
+ dryRun,
10084
+ }),
10085
+ );
10086
+ }
10087
+
10088
+ return cleanupResults.filter(
10089
+ (item) => item.action !== "missing" && item.action !== "unchanged",
10090
+ );
10091
+ }
10092
+
9906
10093
  async function runWorkflowConfigKeysList(options) {
9907
10094
  try {
9908
10095
  const opts = resolveActionOptions(options);
@@ -10178,6 +10365,7 @@ async function runWorkflowConfigKeysMigrateInline(options) {
10178
10365
  const scopeArg = readCliOptionFromArgv("--scope");
10179
10366
  const scope = normalizeMcpScope(scopeArg ?? opts.scope, "global");
10180
10367
  const dryRun = hasCliFlag("--dry-run") || Boolean(opts.dryRun);
10368
+ await loadManagedCredentialsEnv();
10181
10369
 
10182
10370
  const { configPath, existing, existingValue } = await loadConfigForScope({
10183
10371
  scope,
@@ -10194,6 +10382,22 @@ async function runWorkflowConfigKeysMigrateInline(options) {
10194
10382
  existingExists: existing.exists,
10195
10383
  dryRun,
10196
10384
  });
10385
+ const cleanupResults = await cleanupLegacyDirectCredentialArtifacts({
10386
+ scope,
10387
+ dryRun,
10388
+ cwd,
10389
+ });
10390
+ const platform = normalizePlatform(result.next?.mcp?.platform);
10391
+ const secureArtifacts =
10392
+ platform && WORKFLOW_PROFILES[platform]
10393
+ ? await applyPostmanConfigArtifacts({
10394
+ platform,
10395
+ mcpScope: resolveMcpScopeFromConfigDocument(result.next, scope),
10396
+ configValue: result.next,
10397
+ dryRun,
10398
+ cwd,
10399
+ })
10400
+ : null;
10197
10401
 
10198
10402
  console.log(`Config file: ${configPath}`);
10199
10403
  console.log(`Action: ${action}`);
@@ -10209,6 +10413,21 @@ async function runWorkflowConfigKeysMigrateInline(options) {
10209
10413
  console.log(`- ${envVar}`);
10210
10414
  }
10211
10415
  }
10416
+ console.log(`Legacy direct MCP cleanup actions: ${cleanupResults.length}`);
10417
+ for (const cleanup of cleanupResults) {
10418
+ console.log(`- ${cleanup.action} ${cleanup.path}`);
10419
+ }
10420
+ if (secureArtifacts?.mcpRuntimeResult) {
10421
+ console.log(
10422
+ `Secure platform MCP target: ${secureArtifacts.mcpRuntimeResult.action} (${secureArtifacts.mcpRuntimeResult.path || "n/a"})`,
10423
+ );
10424
+ }
10425
+ for (const cleanup of secureArtifacts?.legacyDefinitionCleanupResults || []) {
10426
+ console.log(`- ${cleanup.action} ${cleanup.path}`);
10427
+ }
10428
+ for (const warning of secureArtifacts?.warnings || []) {
10429
+ console.log(`Warning: ${warning}`);
10430
+ }
10212
10431
  } catch (error) {
10213
10432
  if (error?.name === "ExitPromptError") {
10214
10433
  console.error("\nCancelled.");
@@ -10225,6 +10444,7 @@ async function runWorkflowConfigKeysDoctor(options) {
10225
10444
  const cwd = process.cwd();
10226
10445
  const scopeArg = readCliOptionFromArgv("--scope");
10227
10446
  const scope = normalizeMcpScope(scopeArg ?? opts.scope, "global");
10447
+ await loadManagedCredentialsEnv();
10228
10448
  const { configPath, existing, existingValue } = await loadConfigForScope({
10229
10449
  scope,
10230
10450
  cwd,
@@ -10237,7 +10457,7 @@ async function runWorkflowConfigKeysDoctor(options) {
10237
10457
  }
10238
10458
 
10239
10459
  const configFindings = collectInlineCredentialFindings(existingValue);
10240
- const artifactFindings = await collectInlineHeaderFindings({ scope, cwd });
10460
+ const artifactFindings = await collectCredentialLeakFindings({ scope, cwd });
10241
10461
  const migrationPreview = migrateInlineCredentialsInConfig(existingValue);
10242
10462
 
10243
10463
  console.log(`Inline key findings: ${configFindings.length}`);
@@ -10245,9 +10465,9 @@ async function runWorkflowConfigKeysDoctor(options) {
10245
10465
  console.log(`- ${finding.path}`);
10246
10466
  }
10247
10467
 
10248
- console.log(`Unsafe header findings: ${artifactFindings.length}`);
10249
- for (const filePath of artifactFindings) {
10250
- console.log(`- ${filePath}`);
10468
+ console.log(`Credential leak findings: ${artifactFindings.length}`);
10469
+ for (const finding of artifactFindings) {
10470
+ console.log(`- ${finding.filePath} [${finding.matches.join(", ")}]`);
10251
10471
  }
10252
10472
 
10253
10473
  if (migrationPreview.requiredEnvVars.length > 0) {
@@ -10263,7 +10483,7 @@ async function runWorkflowConfigKeysDoctor(options) {
10263
10483
  console.log(
10264
10484
  "Doctor result: issues detected. Run `cbx workflows config keys migrate-inline --scope " +
10265
10485
  scope +
10266
- "` and reinstall with `--overwrite`.",
10486
+ "` to scrub keys and reapply secure Foundry MCP wiring.",
10267
10487
  );
10268
10488
  }
10269
10489
  } catch (error) {
@@ -10501,6 +10721,7 @@ async function runWorkflowConfig(options) {
10501
10721
  if (!next.mcp || typeof next.mcp !== "object" || Array.isArray(next.mcp)) {
10502
10722
  next.mcp = {};
10503
10723
  }
10724
+ next.mcp.server = FOUNDRY_MCP_SERVER_ID;
10504
10725
  if (hasMcpRuntimeOption) {
10505
10726
  next.mcp.runtime = mcpRuntime;
10506
10727
  next.mcp.effectiveRuntime = mcpRuntime;
@@ -10572,15 +10793,10 @@ async function runWorkflowConfig(options) {
10572
10793
  console.log(`postman.mode: ${effectivePostmanMode}`);
10573
10794
  console.log(`postman.mcpUrl: ${effectivePostmanState.mcpUrl}`);
10574
10795
  if (postmanArtifacts) {
10575
- console.log(
10576
- `postman.definition: ${postmanArtifacts.mcpDefinitionResult.action} (${postmanArtifacts.mcpDefinitionPath})`,
10577
- );
10578
- if (
10579
- postmanArtifacts.stitchMcpDefinitionPath &&
10580
- postmanArtifacts.stitchMcpDefinitionResult
10581
- ) {
10796
+ for (const cleanupResult of postmanArtifacts.legacyDefinitionCleanupResults ||
10797
+ []) {
10582
10798
  console.log(
10583
- `stitch.definition: ${postmanArtifacts.stitchMcpDefinitionResult.action} (${postmanArtifacts.stitchMcpDefinitionPath})`,
10799
+ `legacy.definition.cleanup: ${cleanupResult.action} (${cleanupResult.path})`,
10584
10800
  );
10585
10801
  }
10586
10802
  if (postmanArtifacts.mcpRuntimeResult) {
@@ -11884,7 +12100,12 @@ function normalizeInitPlatforms(value) {
11884
12100
  }
11885
12101
 
11886
12102
  function normalizeInitMcpSelections(value) {
11887
- const allowed = new Set(["cubis-foundry", "postman", "stitch"]);
12103
+ const allowed = new Set([
12104
+ "cubis-foundry",
12105
+ "postman",
12106
+ "stitch",
12107
+ "playwright",
12108
+ ]);
11888
12109
  const items = Array.isArray(value) ? value : parseCsvOption(value);
11889
12110
  const normalized = [];
11890
12111
  for (const item of items) {
@@ -12012,7 +12233,9 @@ async function runInitWizard(options) {
12012
12233
  throw new Error("No platforms selected.");
12013
12234
  }
12014
12235
 
12015
- const runtimeSelectableMcp = selections.selectedMcps.length > 0;
12236
+ const runtimeSelectableMcp = selections.selectedMcps.some(
12237
+ (item) => item !== "playwright",
12238
+ );
12016
12239
 
12017
12240
  if (runtimeSelectableMcp && isInteractive) {
12018
12241
  const runtimeSelection = await promptInitMcpRuntime({
@@ -12185,11 +12408,16 @@ async function runInitWizard(options) {
12185
12408
  }
12186
12409
 
12187
12410
  if (emitJson) {
12411
+ const sanitizedSelections = {
12412
+ ...selections,
12413
+ postmanApiKey: selections.postmanApiKey ? "***REDACTED***" : null,
12414
+ stitchApiKey: selections.stitchApiKey ? "***REDACTED***" : null,
12415
+ };
12188
12416
  console.log(
12189
12417
  JSON.stringify(
12190
12418
  {
12191
12419
  dryRun,
12192
- selections,
12420
+ selections: sanitizedSelections,
12193
12421
  results,
12194
12422
  persistedCredentials,
12195
12423
  },