@cubis/foundry 0.3.81 → 0.3.83

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 (645) hide show
  1. package/README.md +25 -9
  2. package/dist/cli/core.js +828 -496
  3. package/dist/cli/core.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/cli/core.ts +996 -666
  6. package/workflows/skills/_schema/platform-notes/antigravity.md +8 -5
  7. package/workflows/skills/_schema/platform-notes/claude.md +7 -0
  8. package/workflows/skills/_schema/platform-notes/codex.md +9 -2
  9. package/workflows/skills/_schema/platform-notes/copilot.md +7 -3
  10. package/workflows/skills/_schema/platform-notes/gemini.md +8 -4
  11. package/workflows/workflows/agent-environment-setup/generated/route-manifest.json +339 -231
  12. package/workflows/workflows/agent-environment-setup/manifest.json +142 -250
  13. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/accessibility.toml +69 -4
  14. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-backend-specialist.toml +86 -0
  15. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-code-archaeologist.toml +67 -0
  16. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-database-architect.toml +79 -0
  17. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-debugger.toml +76 -0
  18. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-devops-engineer.toml +74 -0
  19. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-documentation-writer.toml +65 -0
  20. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-frontend-specialist.toml +76 -0
  21. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-game-developer.toml +52 -0
  22. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-mobile-developer.toml +76 -0
  23. package/workflows/workflows/agent-environment-setup/platforms/{codex/agents/orchestrator.md → antigravity/commands/agent-orchestrator.toml} +26 -23
  24. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-penetration-tester.toml +70 -0
  25. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-performance-optimizer.toml +69 -0
  26. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-product-manager.toml +56 -0
  27. package/workflows/workflows/agent-environment-setup/platforms/{codex/agents/project-planner.md → antigravity/commands/agent-project-planner.toml} +19 -16
  28. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-qa-automation-engineer.toml +63 -0
  29. package/workflows/workflows/agent-environment-setup/platforms/{codex/agents/researcher.md → antigravity/commands/agent-researcher.toml} +22 -29
  30. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-security-auditor.toml +73 -0
  31. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-seo-specialist.toml +52 -0
  32. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-sre-engineer.toml +74 -0
  33. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-test-engineer.toml +71 -0
  34. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-validator.toml +76 -0
  35. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/agent-vercel-expert.toml +59 -0
  36. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/architecture.toml +120 -5
  37. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/backend.toml +71 -4
  38. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/create.toml +68 -4
  39. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/database.toml +67 -4
  40. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/debug.toml +63 -4
  41. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/devops.toml +64 -4
  42. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/implement-track.toml +71 -4
  43. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/migrate.toml +70 -4
  44. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/mobile.toml +71 -4
  45. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/onboard.toml +65 -4
  46. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/orchestrate.toml +73 -4
  47. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/plan.toml +79 -4
  48. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/refactor.toml +67 -4
  49. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/release.toml +70 -4
  50. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/review.toml +66 -4
  51. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/security.toml +69 -4
  52. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/spec.toml +71 -4
  53. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/test.toml +66 -4
  54. package/workflows/workflows/agent-environment-setup/platforms/antigravity/commands/vercel.toml +67 -4
  55. package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +12 -14
  56. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/api-design/SKILL.md +8 -5
  57. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/architecture-doc/SKILL.md +8 -5
  58. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/ci-cd-pipeline/SKILL.md +8 -5
  59. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/code-review/SKILL.md +8 -5
  60. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/csharp-best-practices/SKILL.md +8 -5
  61. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/database-design/SKILL.md +8 -5
  62. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/deep-research/SKILL.md +8 -5
  63. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/django-drf/SKILL.md +8 -5
  64. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/docker-compose-dev/SKILL.md +8 -5
  65. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/drizzle-orm/SKILL.md +8 -5
  66. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/electron-qa/SKILL.md +8 -5
  67. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/expo-app/SKILL.md +8 -5
  68. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/express-nodejs/SKILL.md +8 -5
  69. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/fastapi/SKILL.md +8 -5
  70. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/frontend-design/SKILL.md +8 -5
  71. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/gin-golang/SKILL.md +8 -5
  72. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/git-workflow/SKILL.md +8 -5
  73. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/go-fiber/SKILL.md +8 -5
  74. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/golang-best-practices/SKILL.md +8 -5
  75. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/google-workspace/SKILL.md +8 -5
  76. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/huggingface-ml/SKILL.md +8 -5
  77. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/integration-testing/SKILL.md +8 -5
  78. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/java-best-practices/SKILL.md +8 -5
  79. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/javascript-best-practices/SKILL.md +8 -5
  80. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/kaizen-iteration/SKILL.md +8 -5
  81. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/kotlin-best-practices/SKILL.md +8 -5
  82. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/kubernetes-deploy/SKILL.md +8 -5
  83. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/laravel/SKILL.md +8 -5
  84. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/llm-eval/SKILL.md +8 -5
  85. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/mcp-server-builder/SKILL.md +8 -5
  86. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/microservices-design/SKILL.md +8 -5
  87. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/nestjs/SKILL.md +8 -5
  88. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/nextjs/SKILL.md +8 -5
  89. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/observability/SKILL.md +8 -5
  90. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/owasp-security-review/SKILL.md +8 -5
  91. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/pentest-skill/SKILL.md +8 -5
  92. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/performance-testing/SKILL.md +8 -5
  93. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/php-best-practices/SKILL.md +8 -5
  94. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/playwright-interactive/SKILL.md +8 -5
  95. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/playwright-persistent-browser/SKILL.md +8 -5
  96. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/prisma/SKILL.md +8 -5
  97. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/prompt-engineering/SKILL.md +8 -5
  98. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/python-best-practices/SKILL.md +8 -5
  99. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/rag-patterns/SKILL.md +8 -5
  100. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/react/SKILL.md +8 -5
  101. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/react-native/SKILL.md +8 -5
  102. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/react-native-callstack/SKILL.md +8 -5
  103. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/receiving-code-review/SKILL.md +8 -5
  104. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/remix/SKILL.md +8 -5
  105. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/requesting-code-review/SKILL.md +8 -5
  106. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/rust-best-practices/SKILL.md +8 -5
  107. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/sadd/SKILL.md +8 -5
  108. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/sanitize-pii/SKILL.md +8 -5
  109. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/secret-management/SKILL.md +8 -5
  110. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/skill-creator/SKILL.md +8 -5
  111. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/spec-driven-delivery/SKILL.md +8 -5
  112. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/spring-boot/SKILL.md +8 -5
  113. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/sqlalchemy/SKILL.md +8 -5
  114. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stitch/SKILL.md +8 -5
  115. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/stripe-integration/SKILL.md +8 -5
  116. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/svelte-sveltekit/SKILL.md +8 -5
  117. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/swift-best-practices/SKILL.md +8 -5
  118. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/system-design/SKILL.md +8 -5
  119. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/systematic-debugging/SKILL.md +8 -5
  120. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/t3-stack/SKILL.md +8 -5
  121. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/tech-doc/SKILL.md +8 -5
  122. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/typescript-best-practices/SKILL.md +8 -5
  123. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/unit-testing/SKILL.md +8 -5
  124. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/vibesec/SKILL.md +8 -5
  125. package/workflows/workflows/agent-environment-setup/platforms/antigravity/skills/vuejs/SKILL.md +8 -5
  126. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/accessibility.md → generated-skills/accessibility/SKILL.md} +16 -17
  127. package/workflows/workflows/agent-environment-setup/platforms/claude/generated-skills/architecture/SKILL.md +124 -0
  128. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/backend.md → claude/generated-skills/backend/SKILL.md} +16 -24
  129. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/create.md → generated-skills/create/SKILL.md} +13 -6
  130. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/database.md → claude/generated-skills/database/SKILL.md} +16 -9
  131. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/debug.md → claude/generated-skills/debug/SKILL.md} +16 -9
  132. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/devops.md → claude/generated-skills/devops/SKILL.md} +20 -27
  133. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/implement-track.md → claude/generated-skills/implement-track/SKILL.md} +14 -7
  134. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/migrate.md → generated-skills/migrate/SKILL.md} +17 -18
  135. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/mobile.md → claude/generated-skills/mobile/SKILL.md} +18 -11
  136. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/onboard.md → claude/generated-skills/onboard/SKILL.md} +15 -15
  137. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/orchestrate.md → claude/generated-skills/orchestrate/SKILL.md} +14 -7
  138. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/plan.md → claude/generated-skills/plan/SKILL.md} +13 -17
  139. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/refactor.md → claude/generated-skills/refactor/SKILL.md} +17 -10
  140. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/release.md → claude/generated-skills/release/SKILL.md} +19 -12
  141. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/review.md → generated-skills/review/SKILL.md} +16 -9
  142. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/security.md → generated-skills/security/SKILL.md} +16 -9
  143. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/spec.md → generated-skills/spec/SKILL.md} +12 -15
  144. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/test.md → generated-skills/test/SKILL.md} +16 -9
  145. package/workflows/workflows/agent-environment-setup/platforms/claude/{workflows/vercel.md → generated-skills/vercel/SKILL.md} +18 -20
  146. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/api-design/SKILL.md +7 -0
  147. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/architecture-doc/SKILL.md +7 -0
  148. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/ci-cd-pipeline/SKILL.md +7 -0
  149. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/code-review/SKILL.md +7 -0
  150. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/csharp-best-practices/SKILL.md +7 -0
  151. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/database-design/SKILL.md +7 -0
  152. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/deep-research/SKILL.md +7 -0
  153. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/django-drf/SKILL.md +7 -0
  154. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/docker-compose-dev/SKILL.md +7 -0
  155. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/drizzle-orm/SKILL.md +7 -0
  156. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/electron-qa/SKILL.md +7 -0
  157. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/expo-app/SKILL.md +7 -0
  158. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/express-nodejs/SKILL.md +7 -0
  159. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/fastapi/SKILL.md +7 -0
  160. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/frontend-design/SKILL.md +7 -0
  161. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/gin-golang/SKILL.md +7 -0
  162. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/git-workflow/SKILL.md +7 -0
  163. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/go-fiber/SKILL.md +7 -0
  164. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/golang-best-practices/SKILL.md +7 -0
  165. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/google-workspace/SKILL.md +7 -0
  166. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/huggingface-ml/SKILL.md +7 -0
  167. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/integration-testing/SKILL.md +7 -0
  168. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/java-best-practices/SKILL.md +7 -0
  169. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/javascript-best-practices/SKILL.md +7 -0
  170. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/kaizen-iteration/SKILL.md +7 -0
  171. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/kotlin-best-practices/SKILL.md +7 -0
  172. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/kubernetes-deploy/SKILL.md +7 -0
  173. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/laravel/SKILL.md +7 -0
  174. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/llm-eval/SKILL.md +7 -0
  175. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/mcp-server-builder/SKILL.md +7 -0
  176. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/microservices-design/SKILL.md +7 -0
  177. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/nestjs/SKILL.md +7 -0
  178. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/nextjs/SKILL.md +7 -0
  179. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/observability/SKILL.md +7 -0
  180. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/owasp-security-review/SKILL.md +7 -0
  181. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/pentest-skill/SKILL.md +7 -0
  182. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/performance-testing/SKILL.md +7 -0
  183. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/php-best-practices/SKILL.md +7 -0
  184. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/playwright-interactive/SKILL.md +7 -0
  185. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/playwright-persistent-browser/SKILL.md +7 -0
  186. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/prisma/SKILL.md +7 -0
  187. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/prompt-engineering/SKILL.md +7 -0
  188. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/python-best-practices/SKILL.md +7 -0
  189. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/rag-patterns/SKILL.md +7 -0
  190. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/react/SKILL.md +7 -0
  191. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/react-native/SKILL.md +7 -0
  192. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/react-native-callstack/SKILL.md +7 -0
  193. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/receiving-code-review/SKILL.md +7 -0
  194. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/remix/SKILL.md +7 -0
  195. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/requesting-code-review/SKILL.md +7 -0
  196. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/rust-best-practices/SKILL.md +7 -0
  197. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/sadd/SKILL.md +7 -0
  198. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/sanitize-pii/SKILL.md +7 -0
  199. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/secret-management/SKILL.md +7 -0
  200. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/skill-creator/SKILL.md +7 -0
  201. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/spec-driven-delivery/SKILL.md +7 -0
  202. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/spring-boot/SKILL.md +7 -0
  203. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/sqlalchemy/SKILL.md +7 -0
  204. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stitch/SKILL.md +7 -0
  205. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/stripe-integration/SKILL.md +7 -0
  206. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/svelte-sveltekit/SKILL.md +7 -0
  207. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/swift-best-practices/SKILL.md +7 -0
  208. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/system-design/SKILL.md +7 -0
  209. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/systematic-debugging/SKILL.md +7 -0
  210. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/t3-stack/SKILL.md +7 -0
  211. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/tech-doc/SKILL.md +7 -0
  212. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/typescript-best-practices/SKILL.md +7 -0
  213. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/unit-testing/SKILL.md +7 -0
  214. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/vibesec/SKILL.md +7 -0
  215. package/workflows/workflows/agent-environment-setup/platforms/claude/skills/vuejs/SKILL.md +7 -0
  216. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/backend-specialist.md → codex/agents/backend-specialist.toml} +4 -16
  217. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/code-archaeologist.md → codex/agents/code-archaeologist.toml} +4 -31
  218. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/database-architect.md → codex/agents/database-architect.toml} +4 -16
  219. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/debugger.md → codex/agents/debugger.toml} +4 -17
  220. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/devops-engineer.md → codex/agents/devops-engineer.toml} +4 -16
  221. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/documentation-writer.md → codex/agents/documentation-writer.toml} +4 -14
  222. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/frontend-specialist.md → codex/agents/frontend-specialist.toml} +4 -34
  223. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/game-developer.md → codex/agents/game-developer.toml} +4 -11
  224. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/mobile-developer.md → codex/agents/mobile-developer.toml} +4 -16
  225. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/orchestrator.md → codex/agents/orchestrator.toml} +4 -18
  226. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/penetration-tester.md → codex/agents/penetration-tester.toml} +4 -32
  227. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/performance-optimizer.md → codex/agents/performance-optimizer.toml} +4 -14
  228. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/product-manager.md → codex/agents/product-manager.toml} +4 -26
  229. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/project-planner.md → codex/agents/project-planner.toml} +4 -18
  230. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/qa-automation-engineer.md → codex/agents/qa-automation-engineer.toml} +4 -26
  231. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/researcher.md → codex/agents/researcher.toml} +4 -28
  232. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/security-auditor.md → codex/agents/security-auditor.toml} +4 -42
  233. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/seo-specialist.md → codex/agents/seo-specialist.toml} +4 -11
  234. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/sre-engineer.md → codex/agents/sre-engineer.toml} +4 -35
  235. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/test-engineer.md → codex/agents/test-engineer.toml} +4 -30
  236. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/validator.md → codex/agents/validator.toml} +4 -22
  237. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/agents/vercel-expert.md → codex/agents/vercel-expert.toml} +4 -11
  238. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/accessibility.md → codex/generated-skills/accessibility/SKILL.md} +16 -17
  239. package/workflows/workflows/agent-environment-setup/platforms/codex/generated-skills/architecture/SKILL.md +124 -0
  240. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/backend.md → codex/generated-skills/backend/SKILL.md} +16 -24
  241. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/create.md → codex/generated-skills/create/SKILL.md} +13 -6
  242. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/database.md → codex/generated-skills/database/SKILL.md} +16 -9
  243. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/debug.md → codex/generated-skills/debug/SKILL.md} +16 -9
  244. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/devops.md → codex/generated-skills/devops/SKILL.md} +20 -27
  245. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/implement-track.md → codex/generated-skills/implement-track/SKILL.md} +14 -7
  246. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/migrate.md → codex/generated-skills/migrate/SKILL.md} +17 -18
  247. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/mobile.md → codex/generated-skills/mobile/SKILL.md} +18 -11
  248. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/onboard.md → codex/generated-skills/onboard/SKILL.md} +15 -15
  249. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/orchestrate.md → codex/generated-skills/orchestrate/SKILL.md} +14 -7
  250. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/plan.md → codex/generated-skills/plan/SKILL.md} +13 -17
  251. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/refactor.md → codex/generated-skills/refactor/SKILL.md} +17 -10
  252. package/workflows/workflows/agent-environment-setup/platforms/{claude/workflows/release.md → codex/generated-skills/release/SKILL.md} +19 -12
  253. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/review.md → codex/generated-skills/review/SKILL.md} +16 -9
  254. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/security.md → codex/generated-skills/security/SKILL.md} +16 -9
  255. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/spec.md → codex/generated-skills/spec/SKILL.md} +12 -15
  256. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/test.md → codex/generated-skills/test/SKILL.md} +16 -9
  257. package/workflows/workflows/agent-environment-setup/platforms/{copilot/workflows/vercel.md → codex/generated-skills/vercel/SKILL.md} +18 -20
  258. package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +19 -19
  259. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/api-design/SKILL.md +9 -2
  260. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/architecture-doc/SKILL.md +9 -2
  261. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/ci-cd-pipeline/SKILL.md +9 -2
  262. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/code-review/SKILL.md +9 -2
  263. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/csharp-best-practices/SKILL.md +9 -2
  264. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/database-design/SKILL.md +9 -2
  265. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/deep-research/SKILL.md +9 -2
  266. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/django-drf/SKILL.md +9 -2
  267. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/docker-compose-dev/SKILL.md +9 -2
  268. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/drizzle-orm/SKILL.md +9 -2
  269. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/electron-qa/SKILL.md +9 -2
  270. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/expo-app/SKILL.md +9 -2
  271. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/express-nodejs/SKILL.md +9 -2
  272. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/fastapi/SKILL.md +9 -2
  273. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/frontend-design/SKILL.md +9 -2
  274. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/gin-golang/SKILL.md +9 -2
  275. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/git-workflow/SKILL.md +9 -2
  276. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/go-fiber/SKILL.md +9 -2
  277. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/golang-best-practices/SKILL.md +9 -2
  278. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/google-workspace/SKILL.md +9 -2
  279. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/huggingface-ml/SKILL.md +9 -2
  280. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/integration-testing/SKILL.md +9 -2
  281. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/java-best-practices/SKILL.md +9 -2
  282. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/javascript-best-practices/SKILL.md +9 -2
  283. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/kaizen-iteration/SKILL.md +9 -2
  284. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/kotlin-best-practices/SKILL.md +9 -2
  285. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/kubernetes-deploy/SKILL.md +9 -2
  286. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/laravel/SKILL.md +9 -2
  287. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/llm-eval/SKILL.md +9 -2
  288. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/mcp-server-builder/SKILL.md +9 -2
  289. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/microservices-design/SKILL.md +9 -2
  290. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/nestjs/SKILL.md +9 -2
  291. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/nextjs/SKILL.md +9 -2
  292. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/observability/SKILL.md +9 -2
  293. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/owasp-security-review/SKILL.md +9 -2
  294. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/pentest-skill/SKILL.md +9 -2
  295. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/performance-testing/SKILL.md +9 -2
  296. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/php-best-practices/SKILL.md +9 -2
  297. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/playwright-interactive/SKILL.md +9 -2
  298. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/playwright-persistent-browser/SKILL.md +9 -2
  299. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/prisma/SKILL.md +9 -2
  300. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/prompt-engineering/SKILL.md +9 -2
  301. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/python-best-practices/SKILL.md +9 -2
  302. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/rag-patterns/SKILL.md +9 -2
  303. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/react/SKILL.md +9 -2
  304. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/react-native/SKILL.md +9 -2
  305. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/react-native-callstack/SKILL.md +9 -2
  306. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/receiving-code-review/SKILL.md +9 -2
  307. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/remix/SKILL.md +9 -2
  308. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/requesting-code-review/SKILL.md +9 -2
  309. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/rust-best-practices/SKILL.md +9 -2
  310. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/sadd/SKILL.md +9 -2
  311. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/sanitize-pii/SKILL.md +9 -2
  312. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/secret-management/SKILL.md +9 -2
  313. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/skill-creator/SKILL.md +9 -2
  314. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/spec-driven-delivery/SKILL.md +9 -2
  315. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/spring-boot/SKILL.md +9 -2
  316. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/sqlalchemy/SKILL.md +9 -2
  317. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stitch/SKILL.md +9 -2
  318. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/stripe-integration/SKILL.md +9 -2
  319. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/svelte-sveltekit/SKILL.md +9 -2
  320. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/swift-best-practices/SKILL.md +9 -2
  321. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/system-design/SKILL.md +9 -2
  322. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/systematic-debugging/SKILL.md +9 -2
  323. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/t3-stack/SKILL.md +9 -2
  324. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/tech-doc/SKILL.md +9 -2
  325. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/typescript-best-practices/SKILL.md +9 -2
  326. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/unit-testing/SKILL.md +9 -2
  327. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/vibesec/SKILL.md +9 -2
  328. package/workflows/workflows/agent-environment-setup/platforms/codex/skills/vuejs/SKILL.md +9 -2
  329. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/accessibility.prompt.md +78 -0
  330. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/architecture.prompt.md +128 -0
  331. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/backend.prompt.md +80 -0
  332. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/create.prompt.md +77 -0
  333. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/database.prompt.md +76 -0
  334. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/debug.prompt.md +72 -0
  335. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/devops.prompt.md +73 -0
  336. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/implement-track.prompt.md +80 -0
  337. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/migrate.prompt.md +79 -0
  338. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/mobile.prompt.md +80 -0
  339. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/onboard.prompt.md +74 -0
  340. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/workflows/orchestrate.md → copilot/prompts/orchestrate.prompt.md} +22 -13
  341. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/workflows/plan.md → copilot/prompts/plan.prompt.md} +22 -24
  342. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/refactor.prompt.md +76 -0
  343. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/release.prompt.md +79 -0
  344. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/review.prompt.md +75 -0
  345. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/security.prompt.md +78 -0
  346. package/workflows/workflows/agent-environment-setup/platforms/{antigravity/workflows/spec.md → copilot/prompts/spec.prompt.md} +22 -23
  347. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/test.prompt.md +75 -0
  348. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/vercel.prompt.md +76 -0
  349. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +0 -1
  350. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/api-design/SKILL.md +7 -3
  351. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/architecture-doc/SKILL.md +7 -3
  352. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/ci-cd-pipeline/SKILL.md +7 -3
  353. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/code-review/SKILL.md +7 -3
  354. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/csharp-best-practices/SKILL.md +7 -3
  355. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/database-design/SKILL.md +7 -3
  356. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/deep-research/SKILL.md +7 -3
  357. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/django-drf/SKILL.md +7 -3
  358. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/docker-compose-dev/SKILL.md +7 -3
  359. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/drizzle-orm/SKILL.md +7 -3
  360. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/electron-qa/SKILL.md +7 -3
  361. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/expo-app/SKILL.md +7 -3
  362. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/express-nodejs/SKILL.md +7 -3
  363. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/fastapi/SKILL.md +7 -3
  364. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/frontend-design/SKILL.md +7 -3
  365. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/gin-golang/SKILL.md +7 -3
  366. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/git-workflow/SKILL.md +7 -3
  367. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/go-fiber/SKILL.md +7 -3
  368. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/golang-best-practices/SKILL.md +7 -3
  369. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/google-workspace/SKILL.md +7 -3
  370. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/huggingface-ml/SKILL.md +7 -3
  371. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/integration-testing/SKILL.md +7 -3
  372. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/java-best-practices/SKILL.md +7 -3
  373. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/javascript-best-practices/SKILL.md +7 -3
  374. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/kaizen-iteration/SKILL.md +7 -3
  375. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/kotlin-best-practices/SKILL.md +7 -3
  376. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/kubernetes-deploy/SKILL.md +7 -3
  377. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/laravel/SKILL.md +7 -3
  378. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/llm-eval/SKILL.md +7 -3
  379. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/mcp-server-builder/SKILL.md +7 -3
  380. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/microservices-design/SKILL.md +7 -3
  381. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/nestjs/SKILL.md +7 -3
  382. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/nextjs/SKILL.md +7 -3
  383. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/observability/SKILL.md +7 -3
  384. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/owasp-security-review/SKILL.md +7 -3
  385. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/pentest-skill/SKILL.md +7 -3
  386. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/performance-testing/SKILL.md +7 -3
  387. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/php-best-practices/SKILL.md +7 -3
  388. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/playwright-interactive/SKILL.md +7 -3
  389. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/playwright-persistent-browser/SKILL.md +7 -3
  390. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/prisma/SKILL.md +7 -3
  391. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/prompt-engineering/SKILL.md +7 -3
  392. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/python-best-practices/SKILL.md +7 -3
  393. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/rag-patterns/SKILL.md +7 -3
  394. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/react/SKILL.md +7 -3
  395. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/react-native/SKILL.md +7 -3
  396. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/react-native-callstack/SKILL.md +7 -3
  397. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/receiving-code-review/SKILL.md +7 -3
  398. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/remix/SKILL.md +7 -3
  399. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/requesting-code-review/SKILL.md +7 -3
  400. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/rust-best-practices/SKILL.md +7 -3
  401. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/sadd/SKILL.md +7 -3
  402. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/sanitize-pii/SKILL.md +7 -3
  403. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/secret-management/SKILL.md +7 -3
  404. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/skill-creator/SKILL.md +7 -3
  405. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/spec-driven-delivery/SKILL.md +7 -3
  406. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/spring-boot/SKILL.md +7 -3
  407. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/sqlalchemy/SKILL.md +7 -3
  408. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stitch/SKILL.md +7 -3
  409. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/stripe-integration/SKILL.md +7 -3
  410. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/svelte-sveltekit/SKILL.md +7 -3
  411. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/swift-best-practices/SKILL.md +7 -3
  412. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/system-design/SKILL.md +7 -3
  413. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/systematic-debugging/SKILL.md +7 -3
  414. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/t3-stack/SKILL.md +7 -3
  415. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/tech-doc/SKILL.md +7 -3
  416. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/typescript-best-practices/SKILL.md +7 -3
  417. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/unit-testing/SKILL.md +7 -3
  418. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/vibesec/SKILL.md +7 -3
  419. package/workflows/workflows/agent-environment-setup/platforms/copilot/skills/vuejs/SKILL.md +7 -3
  420. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/accessibility.toml +69 -4
  421. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-backend-specialist.toml +86 -0
  422. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-code-archaeologist.toml +67 -0
  423. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-database-architect.toml +79 -0
  424. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-debugger.toml +76 -0
  425. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-devops-engineer.toml +74 -0
  426. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-documentation-writer.toml +65 -0
  427. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-frontend-specialist.toml +76 -0
  428. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-game-developer.toml +52 -0
  429. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-mobile-developer.toml +76 -0
  430. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-orchestrator.toml +194 -0
  431. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-penetration-tester.toml +70 -0
  432. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-performance-optimizer.toml +69 -0
  433. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-product-manager.toml +56 -0
  434. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-project-planner.toml +72 -0
  435. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-qa-automation-engineer.toml +63 -0
  436. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-researcher.toml +73 -0
  437. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-security-auditor.toml +73 -0
  438. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-seo-specialist.toml +52 -0
  439. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-sre-engineer.toml +74 -0
  440. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-test-engineer.toml +71 -0
  441. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-validator.toml +76 -0
  442. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/agent-vercel-expert.toml +59 -0
  443. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/architecture.toml +120 -5
  444. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/backend.toml +71 -4
  445. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/create.toml +68 -4
  446. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/database.toml +67 -4
  447. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/debug.toml +63 -4
  448. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/devops.toml +64 -4
  449. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/implement-track.toml +71 -4
  450. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/migrate.toml +70 -4
  451. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/mobile.toml +71 -4
  452. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/onboard.toml +65 -4
  453. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/orchestrate.toml +73 -4
  454. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/plan.toml +79 -4
  455. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/refactor.toml +67 -4
  456. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/release.toml +70 -4
  457. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/review.toml +66 -4
  458. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/security.toml +69 -4
  459. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/spec.toml +71 -4
  460. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/test.toml +66 -4
  461. package/workflows/workflows/agent-environment-setup/platforms/gemini/commands/vercel.toml +67 -4
  462. package/workflows/workflows/agent-environment-setup/platforms/gemini/rules/GEMINI.md +17 -17
  463. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/api-design/SKILL.md +8 -4
  464. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/architecture-doc/SKILL.md +8 -4
  465. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/ci-cd-pipeline/SKILL.md +8 -4
  466. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/code-review/SKILL.md +8 -4
  467. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/csharp-best-practices/SKILL.md +8 -4
  468. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/database-design/SKILL.md +8 -4
  469. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/deep-research/SKILL.md +8 -4
  470. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/django-drf/SKILL.md +8 -4
  471. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/docker-compose-dev/SKILL.md +8 -4
  472. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/drizzle-orm/SKILL.md +8 -4
  473. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/electron-qa/SKILL.md +8 -4
  474. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/expo-app/SKILL.md +8 -4
  475. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/express-nodejs/SKILL.md +8 -4
  476. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/fastapi/SKILL.md +8 -4
  477. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/frontend-design/SKILL.md +8 -4
  478. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/gin-golang/SKILL.md +8 -4
  479. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/git-workflow/SKILL.md +8 -4
  480. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/go-fiber/SKILL.md +8 -4
  481. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/golang-best-practices/SKILL.md +8 -4
  482. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/google-workspace/SKILL.md +8 -4
  483. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/huggingface-ml/SKILL.md +8 -4
  484. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/integration-testing/SKILL.md +8 -4
  485. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/java-best-practices/SKILL.md +8 -4
  486. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/javascript-best-practices/SKILL.md +8 -4
  487. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/kaizen-iteration/SKILL.md +8 -4
  488. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/kotlin-best-practices/SKILL.md +8 -4
  489. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/kubernetes-deploy/SKILL.md +8 -4
  490. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/laravel/SKILL.md +8 -4
  491. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/llm-eval/SKILL.md +8 -4
  492. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/mcp-server-builder/SKILL.md +8 -4
  493. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/microservices-design/SKILL.md +8 -4
  494. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/nestjs/SKILL.md +8 -4
  495. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/nextjs/SKILL.md +8 -4
  496. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/observability/SKILL.md +8 -4
  497. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/owasp-security-review/SKILL.md +8 -4
  498. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/pentest-skill/SKILL.md +8 -4
  499. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/performance-testing/SKILL.md +8 -4
  500. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/php-best-practices/SKILL.md +8 -4
  501. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/playwright-interactive/SKILL.md +8 -4
  502. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/playwright-persistent-browser/SKILL.md +8 -4
  503. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/prisma/SKILL.md +8 -4
  504. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/prompt-engineering/SKILL.md +8 -4
  505. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/python-best-practices/SKILL.md +8 -4
  506. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/rag-patterns/SKILL.md +8 -4
  507. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/react/SKILL.md +8 -4
  508. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/react-native/SKILL.md +8 -4
  509. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/react-native-callstack/SKILL.md +8 -4
  510. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/receiving-code-review/SKILL.md +8 -4
  511. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/remix/SKILL.md +8 -4
  512. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/requesting-code-review/SKILL.md +8 -4
  513. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/rust-best-practices/SKILL.md +8 -4
  514. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/sadd/SKILL.md +8 -4
  515. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/sanitize-pii/SKILL.md +8 -4
  516. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/secret-management/SKILL.md +8 -4
  517. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/skill-creator/SKILL.md +8 -4
  518. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/spec-driven-delivery/SKILL.md +8 -4
  519. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/spring-boot/SKILL.md +8 -4
  520. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/sqlalchemy/SKILL.md +8 -4
  521. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stitch/SKILL.md +8 -4
  522. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/stripe-integration/SKILL.md +8 -4
  523. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/svelte-sveltekit/SKILL.md +8 -4
  524. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/swift-best-practices/SKILL.md +8 -4
  525. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/system-design/SKILL.md +8 -4
  526. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/systematic-debugging/SKILL.md +8 -4
  527. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/t3-stack/SKILL.md +8 -4
  528. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/tech-doc/SKILL.md +8 -4
  529. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/typescript-best-practices/SKILL.md +8 -4
  530. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/unit-testing/SKILL.md +8 -4
  531. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/vibesec/SKILL.md +8 -4
  532. package/workflows/workflows/agent-environment-setup/platforms/gemini/skills/vuejs/SKILL.md +8 -4
  533. package/workflows/workflows/agent-environment-setup/shared/rules/STEERING.md +1 -1
  534. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/antigravity.md +4 -5
  535. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/codex.md +7 -6
  536. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/copilot.md +1 -2
  537. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/gemini.md +1 -3
  538. package/workflows/workflows/agent-environment-setup/shared/workflows/architecture.md +49 -10
  539. package/workflows/workflows/agent-environment-setup/shared/workflows/implement-track.md +1 -1
  540. package/workflows/workflows/agent-environment-setup/shared/workflows/migrate.md +1 -1
  541. package/workflows/workflows/agent-environment-setup/shared/workflows/mobile.md +1 -1
  542. package/workflows/workflows/agent-environment-setup/shared/workflows/onboard.md +1 -1
  543. package/workflows/workflows/agent-environment-setup/shared/workflows/orchestrate.md +1 -1
  544. package/workflows/workflows/agent-environment-setup/shared/workflows/plan.md +1 -1
  545. package/workflows/workflows/agent-environment-setup/shared/workflows/refactor.md +1 -1
  546. package/workflows/workflows/agent-environment-setup/shared/workflows/release.md +1 -1
  547. package/workflows/workflows/agent-environment-setup/shared/workflows/spec.md +1 -1
  548. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/accessibility.md +0 -77
  549. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/architecture.md +0 -90
  550. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/backend.md +0 -86
  551. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/create.md +0 -68
  552. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/database.md +0 -67
  553. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/debug.md +0 -63
  554. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/devops.md +0 -78
  555. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/implement-track.md +0 -71
  556. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/migrate.md +0 -78
  557. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/mobile.md +0 -71
  558. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/onboard.md +0 -72
  559. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/refactor.md +0 -67
  560. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/release.md +0 -70
  561. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/review.md +0 -66
  562. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/security.md +0 -69
  563. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/test.md +0 -66
  564. package/workflows/workflows/agent-environment-setup/platforms/antigravity/workflows/vercel.md +0 -76
  565. package/workflows/workflows/agent-environment-setup/platforms/claude/workflows/architecture.md +0 -88
  566. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/backend-specialist.md +0 -81
  567. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/code-archaeologist.md +0 -77
  568. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/database-architect.md +0 -74
  569. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/debugger.md +0 -72
  570. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/devops-engineer.md +0 -69
  571. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/documentation-writer.md +0 -58
  572. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/frontend-specialist.md +0 -89
  573. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/game-developer.md +0 -42
  574. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/mobile-developer.md +0 -71
  575. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/penetration-tester.md +0 -81
  576. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/performance-optimizer.md +0 -62
  577. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/product-manager.md +0 -61
  578. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/qa-automation-engineer.md +0 -68
  579. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/security-auditor.md +0 -94
  580. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/seo-specialist.md +0 -42
  581. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/sre-engineer.md +0 -88
  582. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/test-engineer.md +0 -80
  583. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/validator.md +0 -77
  584. package/workflows/workflows/agent-environment-setup/platforms/codex/agents/vercel-expert.md +0 -49
  585. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/accessibility.md +0 -77
  586. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/architecture.md +0 -90
  587. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/backend.md +0 -86
  588. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/create.md +0 -68
  589. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/database.md +0 -67
  590. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/debug.md +0 -63
  591. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/devops.md +0 -78
  592. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/implement-track.md +0 -71
  593. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/migrate.md +0 -78
  594. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/mobile.md +0 -71
  595. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/onboard.md +0 -72
  596. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/orchestrate.md +0 -73
  597. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/plan.md +0 -90
  598. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/refactor.md +0 -67
  599. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/release.md +0 -70
  600. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/review.md +0 -66
  601. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/security.md +0 -69
  602. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/spec.md +0 -81
  603. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/test.md +0 -66
  604. package/workflows/workflows/agent-environment-setup/platforms/codex/workflows/vercel.md +0 -76
  605. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-accessibility.prompt.md +0 -18
  606. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-architecture.prompt.md +0 -18
  607. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-backend.prompt.md +0 -18
  608. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-create.prompt.md +0 -18
  609. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-database.prompt.md +0 -18
  610. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-debug.prompt.md +0 -18
  611. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-devops.prompt.md +0 -18
  612. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-implement-track.prompt.md +0 -18
  613. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-migrate.prompt.md +0 -18
  614. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-mobile.prompt.md +0 -18
  615. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-onboard.prompt.md +0 -18
  616. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-orchestrate.prompt.md +0 -18
  617. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-plan.prompt.md +0 -18
  618. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-refactor.prompt.md +0 -18
  619. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-release.prompt.md +0 -18
  620. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-review.prompt.md +0 -18
  621. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-security.prompt.md +0 -18
  622. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-spec.prompt.md +0 -18
  623. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-test.prompt.md +0 -18
  624. package/workflows/workflows/agent-environment-setup/platforms/copilot/prompts/workflow-vercel.prompt.md +0 -18
  625. package/workflows/workflows/agent-environment-setup/platforms/copilot/workflows/architecture.md +0 -88
  626. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/accessibility.md +0 -77
  627. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/architecture.md +0 -90
  628. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/backend.md +0 -86
  629. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/create.md +0 -68
  630. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/database.md +0 -67
  631. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/debug.md +0 -63
  632. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/devops.md +0 -78
  633. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/implement-track.md +0 -71
  634. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/migrate.md +0 -78
  635. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/mobile.md +0 -71
  636. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/onboard.md +0 -72
  637. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/orchestrate.md +0 -73
  638. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/plan.md +0 -90
  639. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/refactor.md +0 -67
  640. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/release.md +0 -70
  641. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/review.md +0 -66
  642. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/security.md +0 -69
  643. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/spec.md +0 -81
  644. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/test.md +0 -66
  645. package/workflows/workflows/agent-environment-setup/platforms/gemini/workflows/vercel.md +0 -76
package/src/cli/core.ts CHANGED
@@ -71,18 +71,26 @@ const PRODUCT_FOUNDATION_BLOCK_END_RE =
71
71
  /<!--\s*cbx:product:foundation:end\s*-->/g;
72
72
  const ARCHITECTURE_DOC_BLOCK_START_RE =
73
73
  /<!--\s*cbx:architecture:doc:start[^>]*-->/g;
74
- const ARCHITECTURE_DOC_BLOCK_END_RE =
75
- /<!--\s*cbx:architecture:doc:end\s*-->/g;
74
+ const ARCHITECTURE_DOC_BLOCK_END_RE = /<!--\s*cbx:architecture:doc:end\s*-->/g;
76
75
  const TECH_ARCHITECTURE_BLOCK_START_RE =
77
76
  /<!--\s*cbx:architecture:tech:start[^>]*-->/g;
78
77
  const TECH_ARCHITECTURE_BLOCK_END_RE =
79
78
  /<!--\s*cbx:architecture:tech:end\s*-->/g;
79
+ const MEMORY_FOUNDATION_BLOCK_START_RE =
80
+ /<!--\s*cbx:memory:index:start[^>]*-->/g;
81
+ const MEMORY_FOUNDATION_BLOCK_END_RE =
82
+ /<!--\s*cbx:memory:index:end\s*-->/g;
83
+ const MEMORY_TOPIC_BLOCK_START_RE =
84
+ /<!--\s*cbx:memory:topic:start[^>]*-->/g;
85
+ const MEMORY_TOPIC_BLOCK_END_RE =
86
+ /<!--\s*cbx:memory:topic:end\s*-->/g;
80
87
  const ROADMAP_FOUNDATION_BLOCK_START_RE =
81
88
  /<!--\s*cbx:roadmap:foundation:start[^>]*-->/g;
82
89
  const ROADMAP_FOUNDATION_BLOCK_END_RE =
83
90
  /<!--\s*cbx:roadmap:foundation:end\s*-->/g;
84
91
  const FOUNDATION_DOCS_DIR = path.join("docs", "foundation");
85
92
  const FOUNDATION_ADR_DIR = path.join(FOUNDATION_DOCS_DIR, "adr");
93
+ const FOUNDATION_MEMORY_DIR = path.join(FOUNDATION_DOCS_DIR, "memory");
86
94
  const COPILOT_ALLOWED_SKILL_FRONTMATTER_KEYS = new Set([
87
95
  "compatibility",
88
96
  "description",
@@ -107,57 +115,59 @@ const WORKFLOW_PROFILES = {
107
115
  antigravity: {
108
116
  id: "antigravity",
109
117
  label: "Antigravity",
110
- installsCustomAgents: true,
118
+ installsCustomAgents: false,
111
119
  project: {
112
- workflowDirs: [".agent/workflows"],
113
- agentDirs: [".agent/agents"],
114
- skillDirs: [".agent/skills"],
120
+ workflowDirs: [],
121
+ agentDirs: [],
122
+ skillDirs: [".agents/skills"],
115
123
  commandDirs: [".gemini/commands"],
116
- ruleFilesByPriority: [".agent/rules/GEMINI.md"],
124
+ ruleFilesByPriority: [".agents/rules/GEMINI.md"],
117
125
  },
118
126
  global: {
119
- workflowDirs: [
120
- "~/.gemini/antigravity/workflows",
121
- "~/.gemini/antigravity/global_workflows",
122
- ],
123
- agentDirs: [
124
- "~/.gemini/antigravity/agents",
125
- "~/.gemini/antigravity/global_agents",
126
- ],
127
+ workflowDirs: [],
128
+ agentDirs: [],
127
129
  skillDirs: [
128
130
  "~/.gemini/antigravity/skills",
129
- "~/.gemini/antigravity/global_skills",
130
131
  ],
131
132
  commandDirs: ["~/.gemini/commands"],
132
133
  ruleFilesByPriority: ["~/.gemini/GEMINI.md"],
133
134
  },
134
- detectorPaths: [".agent", ".agent/workflows", ".agent/rules/GEMINI.md"],
135
- legacyDetectorPaths: [],
135
+ detectorPaths: [
136
+ ".agents/skills",
137
+ ".agents/rules/GEMINI.md",
138
+ ".gemini/commands",
139
+ ],
140
+ legacyDetectorPaths: [
141
+ ".agent",
142
+ ".agent/workflows",
143
+ ".agent/agents",
144
+ ".agent/skills",
145
+ ".agent/rules/GEMINI.md",
146
+ ],
136
147
  ruleHintName: "GEMINI.md",
137
148
  },
138
149
  codex: {
139
150
  id: "codex",
140
151
  label: "Codex",
141
- installsCustomAgents: false,
152
+ installsCustomAgents: true,
142
153
  project: {
143
- workflowDirs: [".agents/workflows"],
144
- agentDirs: [".agents/agents"],
154
+ workflowDirs: [],
155
+ agentDirs: [".codex/agents"],
145
156
  skillDirs: [".agents/skills"],
146
157
  ruleFilesByPriority: ["AGENTS.md"],
147
158
  },
148
159
  global: {
149
- workflowDirs: ["~/.agents/workflows"],
150
- agentDirs: ["~/.agents/agents"],
160
+ workflowDirs: [],
161
+ agentDirs: ["~/.codex/agents"],
151
162
  skillDirs: ["~/.agents/skills"],
152
163
  ruleFilesByPriority: ["~/.codex/AGENTS.md"],
153
164
  },
154
165
  detectorPaths: [
155
- ".agents",
156
- ".agents/workflows",
166
+ ".codex/agents",
157
167
  ".agents/skills",
158
168
  "AGENTS.md",
159
169
  ],
160
- legacyDetectorPaths: [".codex/skills"],
170
+ legacyDetectorPaths: [".agents/workflows", ".agents/agents", ".codex/skills"],
161
171
  ruleHintName: "AGENTS.md",
162
172
  },
163
173
  copilot: {
@@ -165,14 +175,14 @@ const WORKFLOW_PROFILES = {
165
175
  label: "GitHub Copilot",
166
176
  installsCustomAgents: true,
167
177
  project: {
168
- workflowDirs: [".github/copilot/workflows"],
178
+ workflowDirs: [],
169
179
  agentDirs: [".github/agents"],
170
180
  skillDirs: [".github/skills"],
171
181
  promptDirs: [".github/prompts"],
172
182
  ruleFilesByPriority: [".github/copilot-instructions.md"],
173
183
  },
174
184
  global: {
175
- workflowDirs: ["~/.copilot/workflows"],
185
+ workflowDirs: [],
176
186
  agentDirs: ["~/.copilot/agents"],
177
187
  skillDirs: ["~/.copilot/skills"],
178
188
  promptDirs: ["~/.copilot/prompts"],
@@ -194,14 +204,14 @@ const WORKFLOW_PROFILES = {
194
204
  label: "Claude Code",
195
205
  installsCustomAgents: true,
196
206
  project: {
197
- workflowDirs: [".claude/workflows"],
207
+ workflowDirs: [],
198
208
  agentDirs: [".claude/agents"],
199
209
  skillDirs: [".claude/skills"],
200
210
  hookDirs: [".claude/hooks"],
201
211
  ruleFilesByPriority: ["CLAUDE.md"],
202
212
  },
203
213
  global: {
204
- workflowDirs: ["~/.claude/workflows"],
214
+ workflowDirs: [],
205
215
  agentDirs: ["~/.claude/agents"],
206
216
  skillDirs: ["~/.claude/skills"],
207
217
  hookDirs: ["~/.claude/hooks"],
@@ -214,7 +224,7 @@ const WORKFLOW_PROFILES = {
214
224
  ".claude/rules",
215
225
  ".claude/settings.json",
216
226
  ],
217
- legacyDetectorPaths: [],
227
+ legacyDetectorPaths: [".claude/workflows"],
218
228
  ruleHintName: "CLAUDE.md",
219
229
  },
220
230
  gemini: {
@@ -222,32 +232,29 @@ const WORKFLOW_PROFILES = {
222
232
  label: "Gemini CLI",
223
233
  installsCustomAgents: false,
224
234
  project: {
225
- workflowDirs: [".gemini/workflows"],
226
- skillDirs: [".gemini/skills"],
235
+ workflowDirs: [],
236
+ skillDirs: [],
227
237
  commandDirs: [".gemini/commands"],
228
238
  ruleFilesByPriority: [".gemini/GEMINI.md", "GEMINI.md"],
229
239
  },
230
240
  global: {
231
- workflowDirs: ["~/.gemini/workflows"],
232
- skillDirs: ["~/.gemini/skills"],
241
+ workflowDirs: [],
242
+ skillDirs: [],
233
243
  commandDirs: ["~/.gemini/commands"],
234
244
  ruleFilesByPriority: ["~/.gemini/GEMINI.md"],
235
245
  },
236
246
  detectorPaths: [
237
247
  ".gemini",
238
- ".gemini/workflows",
239
248
  ".gemini/commands",
240
249
  ".gemini/GEMINI.md",
241
250
  "GEMINI.md",
242
251
  ],
243
- legacyDetectorPaths: [],
252
+ legacyDetectorPaths: [".gemini/workflows", ".gemini/skills"],
244
253
  ruleHintName: "GEMINI.md",
245
254
  },
246
255
  };
247
256
 
248
257
  const PLATFORM_IDS = Object.keys(WORKFLOW_PROFILES);
249
- const CODEX_WORKFLOW_SKILL_PREFIX = "workflow-";
250
- const CODEX_AGENT_SKILL_PREFIX = "agent-";
251
258
  const TERMINAL_VERIFIER_PROVIDERS = ["codex", "gemini"];
252
259
  const DEFAULT_TERMINAL_VERIFIER = "codex";
253
260
  const POSTMAN_API_KEY_ENV_VAR = "POSTMAN_API_KEY_DEFAULT";
@@ -283,6 +290,7 @@ const RESERVED_CREDENTIAL_PROFILE_NAMES = new Set(["all"]);
283
290
  const CREDENTIAL_SERVICES = new Set(["postman", "stitch"]);
284
291
  const MCP_RUNTIMES = new Set(["docker", "local"]);
285
292
  const ARCHITECTURE_BUILD_PLATFORMS = new Set([
293
+ "antigravity",
286
294
  "codex",
287
295
  "claude",
288
296
  "gemini",
@@ -839,10 +847,12 @@ function toPosixPath(value) {
839
847
  }
840
848
 
841
849
  function getAntigravityTerminalIntegrationDir(profilePaths) {
842
- return path.join(
843
- path.dirname(profilePaths.workflowsDir),
844
- "terminal-integration",
845
- );
850
+ const baseDir =
851
+ profilePaths.rulesDir ||
852
+ profilePaths.skillsDir ||
853
+ profilePaths.commandsDir ||
854
+ profilePaths.rootDir;
855
+ return path.join(path.dirname(baseDir), "terminal-integration");
846
856
  }
847
857
 
848
858
  function buildTerminalVerifierDefaultPrompt() {
@@ -1056,7 +1066,8 @@ function inferArchitectureContractProfile(snapshot) {
1056
1066
  snapshot.topDirs.includes("app")
1057
1067
  ? "App-level UI patterns should be centralized and reused across screens."
1058
1068
  : null,
1059
- ]) || "No dedicated design-system directory detected; infer shared UI rules from current components and screens.";
1069
+ ]) ||
1070
+ "No dedicated design-system directory detected; infer shared UI rules from current components and screens.";
1060
1071
 
1061
1072
  const testingStrategy = [];
1062
1073
  if (snapshot.keyScripts.some((script) => script.name === "lint")) {
@@ -1107,7 +1118,8 @@ function buildArchitectureMermaid(snapshot) {
1107
1118
  ' user["User / Entry Point"] --> app["Application Surface"]',
1108
1119
  ];
1109
1120
  for (let index = 0; index < flowNodes.length; index += 1) {
1110
- const nodeName = flowNodes[index].replace(/[^A-Za-z0-9]/g, "") || `N${index}`;
1121
+ const nodeName =
1122
+ flowNodes[index].replace(/[^A-Za-z0-9]/g, "") || `N${index}`;
1111
1123
  lines.push(` app --> ${nodeName}["${flowNodes[index]}/"]`);
1112
1124
  }
1113
1125
  if (snapshot.isMcpServer || snapshot.mcpSignals.length > 0) {
@@ -1123,21 +1135,31 @@ function inferProductFoundationProfile(snapshot, specRoots = []) {
1123
1135
  const appRoots = (snapshot.architectureByApp || [])
1124
1136
  .map((item) => item.rootPath)
1125
1137
  .filter((value) => value && value !== ".");
1126
- const primarySurfaces = appRoots.length > 0 ? appRoots : snapshot.topDirs.slice(0, 6);
1138
+ const primarySurfaces =
1139
+ appRoots.length > 0 ? appRoots : snapshot.topDirs.slice(0, 6);
1127
1140
  const userPersonas = [];
1128
1141
 
1129
1142
  if (snapshot.frameworks.includes("Flutter")) {
1130
- userPersonas.push("End users interacting through mobile or desktop app surfaces");
1143
+ userPersonas.push(
1144
+ "End users interacting through mobile or desktop app surfaces",
1145
+ );
1131
1146
  }
1132
1147
  if (
1133
1148
  snapshot.frameworks.includes("Next.js") ||
1134
1149
  snapshot.frameworks.includes("React") ||
1135
1150
  snapshot.topDirs.includes("web")
1136
1151
  ) {
1137
- userPersonas.push("Browser users and internal operators using web-facing flows");
1152
+ userPersonas.push(
1153
+ "Browser users and internal operators using web-facing flows",
1154
+ );
1138
1155
  }
1139
- if (snapshot.frameworks.includes("NestJS") || snapshot.topDirs.includes("api")) {
1140
- userPersonas.push("Internal services, operators, or partner systems consuming API boundaries");
1156
+ if (
1157
+ snapshot.frameworks.includes("NestJS") ||
1158
+ snapshot.topDirs.includes("api")
1159
+ ) {
1160
+ userPersonas.push(
1161
+ "Internal services, operators, or partner systems consuming API boundaries",
1162
+ );
1141
1163
  }
1142
1164
  if (userPersonas.length === 0) {
1143
1165
  userPersonas.push(
@@ -1157,7 +1179,9 @@ function inferProductFoundationProfile(snapshot, specRoots = []) {
1157
1179
  );
1158
1180
  }
1159
1181
  if (snapshot.isMcpServer || snapshot.mcpSignals.length > 0) {
1160
- coreJourneys.push("Tool-assisted and MCP-driven workflows are part of the operating model and should stay stable.");
1182
+ coreJourneys.push(
1183
+ "Tool-assisted and MCP-driven workflows are part of the operating model and should stay stable.",
1184
+ );
1161
1185
  }
1162
1186
  if (coreJourneys.length === 0) {
1163
1187
  coreJourneys.push(
@@ -1266,12 +1290,16 @@ function buildArchitectureDocSection(snapshot, specRoots = []) {
1266
1290
  "### Bounded Contexts and Module Boundaries",
1267
1291
  ...(profile.moduleBoundaries.length > 0
1268
1292
  ? profile.moduleBoundaries.map((item) => `- ${item}`)
1269
- : ["- No strong top-level module boundaries were detected automatically."]),
1293
+ : [
1294
+ "- No strong top-level module boundaries were detected automatically.",
1295
+ ]),
1270
1296
  "",
1271
1297
  "### Architecture Signals by Surface",
1272
1298
  ...(profile.architectureSignals.length > 0
1273
1299
  ? profile.architectureSignals.map((item) => `- ${item}`)
1274
- : ["- No app-level architecture signals were inferred from the repo scan."]),
1300
+ : [
1301
+ "- No app-level architecture signals were inferred from the repo scan.",
1302
+ ]),
1275
1303
  "",
1276
1304
  "### Decision Areas to Preserve",
1277
1305
  ...profile.decisionAreas.map((item) => `- ${item}`),
@@ -1309,12 +1337,14 @@ function buildEngineeringArchitectureSection(snapshot) {
1309
1337
  "- Module and package boundaries to preserve:",
1310
1338
  ...(profile.moduleBoundaries.length > 0
1311
1339
  ? profile.moduleBoundaries.map((rule) => ` - ${rule}`)
1312
- : [" - No strong module boundary was detected automatically; keep new boundaries explicit in specs and ADRs."]),
1340
+ : [
1341
+ " - No strong module boundary was detected automatically; keep new boundaries explicit in specs and ADRs.",
1342
+ ]),
1313
1343
  "- Testability expectations:",
1314
1344
  ...profile.testingStrategy.map((rule) => ` - ${rule}`),
1315
1345
  "- Doc refresh policy:",
1316
1346
  " - Update these managed sections when architecture, scale, boundaries, design-system rules, or testing strategy changes.",
1317
- ` - For non-trivial work, read ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ENGINEERING_RULES.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, and ${FOUNDATION_DOCS_DIR}/TECH.md in that order when they exist.`,
1347
+ ` - For non-trivial work, read ${FOUNDATION_DOCS_DIR}/MEMORY.md first. Then load ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ENGINEERING_RULES.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, ${FOUNDATION_MEMORY_DIR}/*, and ADRs only when the active task needs that deeper context.`,
1318
1348
  "<!-- cbx:architecture:rules:end -->",
1319
1349
  "",
1320
1350
  ].join("\n");
@@ -1374,7 +1404,9 @@ function buildTechArchitectureSection(snapshot) {
1374
1404
  "### Module / App Topology",
1375
1405
  ...(profile.moduleBoundaries.length > 0
1376
1406
  ? profile.moduleBoundaries.map((item) => `- ${item}`)
1377
- : ["- No significant top-level module boundaries detected automatically."]),
1407
+ : [
1408
+ "- No significant top-level module boundaries detected automatically.",
1409
+ ]),
1378
1410
  "",
1379
1411
  "### Flow Narratives",
1380
1412
  "- Describe the primary request, data, and background-job flows here when architecture generation runs.",
@@ -1402,11 +1434,12 @@ function buildRoadmapFoundationSection(snapshot, specRoots = []) {
1402
1434
  specRoots,
1403
1435
  };
1404
1436
  const hash = hashStableObject(payload);
1405
- const nowItems = specRoots.length > 0
1406
- ? specRoots.map((item) => `Track active change planning in \`${item}\`.`)
1407
- : [
1408
- "No active spec packs detected. Create a spec pack before starting the next non-trivial feature or migration.",
1409
- ];
1437
+ const nowItems =
1438
+ specRoots.length > 0
1439
+ ? specRoots.map((item) => `Track active change planning in \`${item}\`.`)
1440
+ : [
1441
+ "No active spec packs detected. Create a spec pack before starting the next non-trivial feature or migration.",
1442
+ ];
1410
1443
  const nextItems = [];
1411
1444
  if (snapshot.frameworks.length > 0) {
1412
1445
  nextItems.push(
@@ -1438,7 +1471,7 @@ function buildRoadmapFoundationSection(snapshot, specRoots = []) {
1438
1471
  "- Use this section for medium-term scaling themes, major migrations, or cross-team architecture investments.",
1439
1472
  "",
1440
1473
  "### Backbone Maintenance",
1441
- `- Keep ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ENGINEERING_RULES.md, and ${FOUNDATION_DOCS_DIR}/TECH.md aligned when direction or structure changes.`,
1474
+ `- Keep ${FOUNDATION_DOCS_DIR}/MEMORY.md, ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ENGINEERING_RULES.md, and ${FOUNDATION_DOCS_DIR}/TECH.md aligned when direction or structure changes.`,
1442
1475
  "- Link major roadmap themes back to specs and ADRs instead of burying them in chat-only planning.",
1443
1476
  "<!-- cbx:roadmap:foundation:end -->",
1444
1477
  "",
@@ -1523,15 +1556,17 @@ function buildEngineeringRulesTemplate() {
1523
1556
  "- skill-name, workflow-name, or agent-name",
1524
1557
  "- or: none",
1525
1558
  "",
1526
- "## 9) Keep TECH.md Fresh",
1559
+ "## 9) Keep Foundation Docs Fresh",
1527
1560
  "",
1528
- "- `TECH.md` is generated from current codebase reality.",
1529
- "- Re-run `cbx rules tech-md --overwrite` after major stack or architecture changes.",
1561
+ "- `docs/foundation/MEMORY.md` is the AI entrypoint for non-trivial work.",
1562
+ "- Read `docs/foundation/MEMORY.md` first, then load deeper foundation docs only when the active task needs them.",
1563
+ "- Re-run `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>` after major product, architecture, runtime, or tooling changes.",
1564
+ "- Re-run `cbx rules tech-md --overwrite` only when you specifically need the legacy root-level `TECH.md` snapshot refreshed.",
1530
1565
  "",
1531
1566
  "<!-- cbx:architecture:rules:start version=1 profile=bootstrap -->",
1532
1567
  "## 10) Architecture Contract (auto-managed)",
1533
1568
  "",
1534
- "- Declared style: bootstrap placeholder. Re-run `cbx build architecture --platform <codex|claude|gemini|copilot>` to refresh this contract from the repo.",
1569
+ "- Declared style: bootstrap placeholder. Re-run `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>` to refresh this contract from the repo.",
1535
1570
  "- Design-system source of truth: bootstrap placeholder.",
1536
1571
  "- Dependency direction rules:",
1537
1572
  " - Replace this placeholder with the managed architecture block when architecture generation runs.",
@@ -1587,7 +1622,7 @@ function buildProductBuildSkeleton() {
1587
1622
  "This file is managed by `cbx build architecture`.",
1588
1623
  "",
1589
1624
  "<!-- cbx:product:foundation:start version=1 profile=uninitialized -->",
1590
- "Replace this managed section by running `cbx build architecture --platform <codex|claude|gemini|copilot>`.",
1625
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
1591
1626
  "<!-- cbx:product:foundation:end -->",
1592
1627
  "",
1593
1628
  ].join("\n");
@@ -1600,7 +1635,7 @@ function buildArchitectureBuildSkeleton() {
1600
1635
  "This file is managed by `cbx build architecture`.",
1601
1636
  "",
1602
1637
  "<!-- cbx:architecture:doc:start version=1 profile=uninitialized -->",
1603
- "Replace this managed section by running `cbx build architecture --platform <codex|claude|gemini|copilot>`.",
1638
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
1604
1639
  "<!-- cbx:architecture:doc:end -->",
1605
1640
  "",
1606
1641
  ].join("\n");
@@ -1613,12 +1648,38 @@ function buildTechBuildSkeleton() {
1613
1648
  "This file is managed by `cbx build architecture`.",
1614
1649
  "",
1615
1650
  "<!-- cbx:architecture:tech:start version=1 snapshot=uninitialized -->",
1616
- "Replace this managed section by running `cbx build architecture --platform <codex|claude|gemini|copilot>`.",
1651
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
1617
1652
  "<!-- cbx:architecture:tech:end -->",
1618
1653
  "",
1619
1654
  ].join("\n");
1620
1655
  }
1621
1656
 
1657
+ function buildMemoryBuildSkeleton() {
1658
+ return [
1659
+ "# Memory",
1660
+ "",
1661
+ "This file is managed by `cbx build architecture` as the durable AI entrypoint for the project.",
1662
+ "",
1663
+ "<!-- cbx:memory:index:start version=1 profile=uninitialized -->",
1664
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
1665
+ "<!-- cbx:memory:index:end -->",
1666
+ "",
1667
+ ].join("\n");
1668
+ }
1669
+
1670
+ function buildMemoryTopicSkeleton(title, topicId) {
1671
+ return [
1672
+ `# ${title}`,
1673
+ "",
1674
+ "This file is managed by `cbx build architecture`.",
1675
+ "",
1676
+ `<!-- cbx:memory:topic:start version=1 topic=${topicId} profile=uninitialized -->`,
1677
+ "Replace this managed section by running `cbx build architecture`.",
1678
+ "<!-- cbx:memory:topic:end -->",
1679
+ "",
1680
+ ].join("\n");
1681
+ }
1682
+
1622
1683
  function buildAdrReadme() {
1623
1684
  return [
1624
1685
  "# Architecture Decision Records",
@@ -1673,6 +1734,7 @@ function buildAdrTemplate() {
1673
1734
 
1674
1735
  function buildEngineeringRulesManagedBlock({
1675
1736
  platform,
1737
+ memoryFilePath,
1676
1738
  productFilePath,
1677
1739
  architectureFilePath,
1678
1740
  engineeringRulesFilePath,
@@ -1680,6 +1742,7 @@ function buildEngineeringRulesManagedBlock({
1680
1742
  roadmapFilePath,
1681
1743
  ruleFilePath,
1682
1744
  }) {
1745
+ const memoryRef = toPosixPath(path.resolve(memoryFilePath));
1683
1746
  const productRef = toPosixPath(path.resolve(productFilePath));
1684
1747
  const architectureRef = toPosixPath(path.resolve(architectureFilePath));
1685
1748
  const engineeringRef = toPosixPath(path.resolve(engineeringRulesFilePath));
@@ -1687,28 +1750,58 @@ function buildEngineeringRulesManagedBlock({
1687
1750
  const roadmapRef = toPosixPath(path.resolve(roadmapFilePath));
1688
1751
  const ruleRef = toPosixPath(path.resolve(ruleFilePath));
1689
1752
 
1753
+ const supportsAtImport = platform === "claude" || platform === "gemini";
1754
+ const ruleFileDir = path.dirname(path.resolve(ruleFilePath));
1755
+ const relMemory = toPosixPath(
1756
+ path.relative(ruleFileDir, path.resolve(memoryFilePath)),
1757
+ );
1758
+ const relProduct = toPosixPath(
1759
+ path.relative(ruleFileDir, path.resolve(productFilePath)),
1760
+ );
1761
+ const relArchitecture = toPosixPath(
1762
+ path.relative(ruleFileDir, path.resolve(architectureFilePath)),
1763
+ );
1764
+ const relTech = toPosixPath(
1765
+ path.relative(ruleFileDir, path.resolve(techMdFilePath)),
1766
+ );
1767
+
1768
+ const importLines = supportsAtImport
1769
+ ? [
1770
+ "",
1771
+ "Foundation memory index (auto-imported into context):",
1772
+ `@${relMemory}`,
1773
+ "Load deeper docs from MEMORY.md only when needed:",
1774
+ `- ${relProduct}`,
1775
+ `- ${relArchitecture}`,
1776
+ `- ${relTech}`,
1777
+ ]
1778
+ : [];
1779
+
1690
1780
  return [
1691
1781
  `<!-- cbx:engineering:auto:start platform=${platform} version=1 -->`,
1692
1782
  "## Engineering Guardrails (auto-managed)",
1693
1783
  "Apply these before planning, coding, review, and release:",
1694
1784
  "",
1785
+ `- Shared memory index: \`${memoryRef}\``,
1695
1786
  `- Product backbone: \`${productRef}\``,
1696
1787
  `- Accepted architecture: \`${architectureRef}\``,
1697
1788
  `- Required baseline: \`${engineeringRef}\``,
1698
1789
  `- Project tech map: \`${techRef}\``,
1699
1790
  `- Delivery roadmap: \`${roadmapRef}\``,
1700
1791
  `- Active platform rule file: \`${ruleRef}\``,
1792
+ ...importLines,
1701
1793
  "",
1702
1794
  "Hard policy:",
1703
1795
  "1. Start from product outcomes and ship the smallest valuable slice.",
1704
1796
  "2. Keep architecture simple (KISS) and avoid speculative work (YAGNI).",
1705
1797
  "3. Apply SOLID pragmatically to reduce change risk, not add ceremony.",
1706
1798
  "4. Use clear naming with focused responsibilities and explicit boundaries.",
1707
- `5. For non-trivial work, read ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ENGINEERING_RULES.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, and ${FOUNDATION_DOCS_DIR}/TECH.md in that order when they exist before planning or implementation.`,
1708
- "6. Require validation evidence (lint/types/tests) before merge.",
1709
- "7. Use Decision Log response style.",
1710
- "8. Every Decision Log must include a `Skills Used` section listing skill, workflow, or agent names.",
1711
- "9. If no skill loaded, `Skills Used: none` is mandatory.",
1799
+ `5. For non-trivial work, read ${FOUNDATION_DOCS_DIR}/MEMORY.md first. Then load ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, ${FOUNDATION_MEMORY_DIR}/*, and ADRs only when the active task needs that deeper context. Check ${FOUNDATION_DOCS_DIR}/PRODUCT.md for domain glossary and ${FOUNDATION_DOCS_DIR}/TECH.md for build/validation commands.`,
1800
+ "6. Use MEMORY.md's load map and consumer notes to decide which deeper docs the active workflow, agent, or skill should consult.",
1801
+ "7. Require validation evidence (lint/types/tests) before merge.",
1802
+ "8. Use Decision Log response style.",
1803
+ "9. Every Decision Log must include a `Skills Used` section listing skill, workflow, or agent names.",
1804
+ "10. If no skill loaded, `Skills Used: none` is mandatory.",
1712
1805
  "",
1713
1806
  "<!-- cbx:engineering:auto:end -->",
1714
1807
  ].join("\n");
@@ -1829,6 +1922,7 @@ async function upsertEngineeringRulesFile({
1829
1922
  async function upsertEngineeringRulesBlock({
1830
1923
  ruleFilePath,
1831
1924
  platform,
1925
+ memoryFilePath,
1832
1926
  productFilePath,
1833
1927
  architectureFilePath,
1834
1928
  engineeringRulesFilePath,
@@ -1838,6 +1932,7 @@ async function upsertEngineeringRulesBlock({
1838
1932
  }) {
1839
1933
  const block = buildEngineeringRulesManagedBlock({
1840
1934
  platform,
1935
+ memoryFilePath,
1841
1936
  productFilePath,
1842
1937
  architectureFilePath,
1843
1938
  engineeringRulesFilePath,
@@ -2095,6 +2190,12 @@ async function ensureArchitectureBuildScaffold({
2095
2190
  const productPath = path.join(foundationRoot, "PRODUCT.md");
2096
2191
  const architectureDocPath = path.join(foundationRoot, "ARCHITECTURE.md");
2097
2192
  const techMdPath = path.join(foundationRoot, "TECH.md");
2193
+ const memoryPath = path.join(foundationRoot, "MEMORY.md");
2194
+ const memoryDir = path.join(workspaceRoot, FOUNDATION_MEMORY_DIR);
2195
+ const domainMemoryPath = path.join(memoryDir, "domain.md");
2196
+ const runtimeMemoryPath = path.join(memoryDir, "runtime.md");
2197
+ const integrationsMemoryPath = path.join(memoryDir, "integrations.md");
2198
+ const debuggingMemoryPath = path.join(memoryDir, "debugging.md");
2098
2199
  const adrDir = path.join(workspaceRoot, FOUNDATION_ADR_DIR);
2099
2200
  const adrReadmePath = path.join(adrDir, "README.md");
2100
2201
  const adrTemplatePath = path.join(adrDir, "0000-template.md");
@@ -2104,7 +2205,7 @@ async function ensureArchitectureBuildScaffold({
2104
2205
  initialContent: `${buildProductBuildSkeleton()}\n`,
2105
2206
  block: [
2106
2207
  "<!-- cbx:product:foundation:start version=1 profile=uninitialized -->",
2107
- "Replace this managed section by running `cbx build architecture --platform <codex|claude|gemini|copilot>`.",
2208
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
2108
2209
  "<!-- cbx:product:foundation:end -->",
2109
2210
  "",
2110
2211
  ].join("\n"),
@@ -2118,7 +2219,7 @@ async function ensureArchitectureBuildScaffold({
2118
2219
  initialContent: `${buildArchitectureBuildSkeleton()}\n`,
2119
2220
  block: [
2120
2221
  "<!-- cbx:architecture:doc:start version=1 profile=uninitialized -->",
2121
- "Replace this managed section by running `cbx build architecture --platform <codex|claude|gemini|copilot>`.",
2222
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
2122
2223
  "<!-- cbx:architecture:doc:end -->",
2123
2224
  "",
2124
2225
  ].join("\n"),
@@ -2132,7 +2233,7 @@ async function ensureArchitectureBuildScaffold({
2132
2233
  initialContent: `${buildTechBuildSkeleton()}\n`,
2133
2234
  block: [
2134
2235
  "<!-- cbx:architecture:tech:start version=1 snapshot=uninitialized -->",
2135
- "Replace this managed section by running `cbx build architecture --platform <codex|claude|gemini|copilot>`.",
2236
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
2136
2237
  "<!-- cbx:architecture:tech:end -->",
2137
2238
  "",
2138
2239
  ].join("\n"),
@@ -2141,6 +2242,76 @@ async function ensureArchitectureBuildScaffold({
2141
2242
  dryRun,
2142
2243
  });
2143
2244
 
2245
+ const memoryResult = await upsertTaggedSectionInFile({
2246
+ targetPath: memoryPath,
2247
+ initialContent: `${buildMemoryBuildSkeleton()}\n`,
2248
+ block: [
2249
+ "<!-- cbx:memory:index:start version=1 profile=uninitialized -->",
2250
+ "Replace this managed section by running `cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>`.",
2251
+ "<!-- cbx:memory:index:end -->",
2252
+ "",
2253
+ ].join("\n"),
2254
+ startPattern: MEMORY_FOUNDATION_BLOCK_START_RE,
2255
+ endPattern: MEMORY_FOUNDATION_BLOCK_END_RE,
2256
+ dryRun,
2257
+ });
2258
+
2259
+ const domainMemoryResult = await upsertTaggedSectionInFile({
2260
+ targetPath: domainMemoryPath,
2261
+ initialContent: `${buildMemoryTopicSkeleton("Domain Memory", "domain")}\n`,
2262
+ block: [
2263
+ "<!-- cbx:memory:topic:start version=1 topic=domain profile=uninitialized -->",
2264
+ "Replace this managed section by running `cbx build architecture`.",
2265
+ "<!-- cbx:memory:topic:end -->",
2266
+ "",
2267
+ ].join("\n"),
2268
+ startPattern: MEMORY_TOPIC_BLOCK_START_RE,
2269
+ endPattern: MEMORY_TOPIC_BLOCK_END_RE,
2270
+ dryRun,
2271
+ });
2272
+
2273
+ const runtimeMemoryResult = await upsertTaggedSectionInFile({
2274
+ targetPath: runtimeMemoryPath,
2275
+ initialContent: `${buildMemoryTopicSkeleton("Runtime Memory", "runtime")}\n`,
2276
+ block: [
2277
+ "<!-- cbx:memory:topic:start version=1 topic=runtime profile=uninitialized -->",
2278
+ "Replace this managed section by running `cbx build architecture`.",
2279
+ "<!-- cbx:memory:topic:end -->",
2280
+ "",
2281
+ ].join("\n"),
2282
+ startPattern: MEMORY_TOPIC_BLOCK_START_RE,
2283
+ endPattern: MEMORY_TOPIC_BLOCK_END_RE,
2284
+ dryRun,
2285
+ });
2286
+
2287
+ const integrationsMemoryResult = await upsertTaggedSectionInFile({
2288
+ targetPath: integrationsMemoryPath,
2289
+ initialContent: `${buildMemoryTopicSkeleton("Integrations Memory", "integrations")}\n`,
2290
+ block: [
2291
+ "<!-- cbx:memory:topic:start version=1 topic=integrations profile=uninitialized -->",
2292
+ "Replace this managed section by running `cbx build architecture`.",
2293
+ "<!-- cbx:memory:topic:end -->",
2294
+ "",
2295
+ ].join("\n"),
2296
+ startPattern: MEMORY_TOPIC_BLOCK_START_RE,
2297
+ endPattern: MEMORY_TOPIC_BLOCK_END_RE,
2298
+ dryRun,
2299
+ });
2300
+
2301
+ const debuggingMemoryResult = await upsertTaggedSectionInFile({
2302
+ targetPath: debuggingMemoryPath,
2303
+ initialContent: `${buildMemoryTopicSkeleton("Debugging Memory", "debugging")}\n`,
2304
+ block: [
2305
+ "<!-- cbx:memory:topic:start version=1 topic=debugging profile=uninitialized -->",
2306
+ "Replace this managed section by running `cbx build architecture`.",
2307
+ "<!-- cbx:memory:topic:end -->",
2308
+ "",
2309
+ ].join("\n"),
2310
+ startPattern: MEMORY_TOPIC_BLOCK_START_RE,
2311
+ endPattern: MEMORY_TOPIC_BLOCK_END_RE,
2312
+ dryRun,
2313
+ });
2314
+
2144
2315
  const adrReadmeResult = await writeTextFile({
2145
2316
  targetPath: adrReadmePath,
2146
2317
  content: `${buildAdrReadme()}\n`,
@@ -2158,11 +2329,21 @@ async function ensureArchitectureBuildScaffold({
2158
2329
  productPath,
2159
2330
  architectureDocPath,
2160
2331
  techMdPath,
2332
+ memoryPath,
2333
+ domainMemoryPath,
2334
+ runtimeMemoryPath,
2335
+ integrationsMemoryPath,
2336
+ debuggingMemoryPath,
2161
2337
  adrReadmePath,
2162
2338
  adrTemplatePath,
2163
2339
  productResult,
2164
2340
  architectureDocResult,
2165
2341
  techResult,
2342
+ memoryResult,
2343
+ domainMemoryResult,
2344
+ runtimeMemoryResult,
2345
+ integrationsMemoryResult,
2346
+ debuggingMemoryResult,
2166
2347
  adrReadmeResult,
2167
2348
  adrTemplateResult,
2168
2349
  };
@@ -3557,7 +3738,8 @@ function targetStateKey(platform, scope) {
3557
3738
  }
3558
3739
 
3559
3740
  function getStateFilePath(scope, cwd = process.cwd()) {
3560
- if (scope === "global") return path.join(os.homedir(), ".cbx", "state.json");
3741
+ if (scope === "global")
3742
+ return path.join(resolveManagedHomeDir(), ".cbx", "state.json");
3561
3743
  return path.join(cwd, ".cbx", "workflows-state.json");
3562
3744
  }
3563
3745
 
@@ -3751,9 +3933,9 @@ async function resolveProfilePaths(profileId, scope, cwd = process.cwd()) {
3751
3933
  workflowsDir: await resolvePreferredDir(workflowDirs),
3752
3934
  agentsDir: await resolvePreferredDir(agentDirs),
3753
3935
  skillsDir: await resolvePreferredDir(skillDirs),
3754
- commandsDir: commandDirs[0] ? expandPath(commandDirs[0], cwd) : null,
3755
- promptsDir: promptDirs[0] ? expandPath(promptDirs[0], cwd) : null,
3756
- hooksDir: hookDirs[0] ? expandPath(hookDirs[0], cwd) : null,
3936
+ commandsDir: await resolvePreferredDir(commandDirs),
3937
+ promptsDir: await resolvePreferredDir(promptDirs),
3938
+ hooksDir: await resolvePreferredDir(hookDirs),
3757
3939
  ruleFilesByPriority: cfg.ruleFilesByPriority.map((filePath) =>
3758
3940
  expandPath(filePath, cwd),
3759
3941
  ),
@@ -4384,53 +4566,10 @@ function normalizeMarkdownId(fileName) {
4384
4566
  .replace(/^-|-$/g, "");
4385
4567
  }
4386
4568
 
4387
- function yamlSingleQuoted(value) {
4388
- return `'${String(value || "").replace(/'/g, "''")}'`;
4389
- }
4390
-
4391
4569
  function escapeRegExp(value) {
4392
4570
  return String(value).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4393
4571
  }
4394
4572
 
4395
- function rewriteCodexWorkflowAgentReferences(sourceBody, agentIds) {
4396
- if (!sourceBody || !Array.isArray(agentIds) || agentIds.length === 0)
4397
- return normalizeCodexWrapperMentions(sourceBody);
4398
-
4399
- let rewritten = sourceBody;
4400
- const sortedAgentIds = unique(agentIds.filter(Boolean)).sort(
4401
- (a, b) => b.length - a.length,
4402
- );
4403
-
4404
- for (const agentId of sortedAgentIds) {
4405
- const agentPattern = new RegExp(
4406
- `(^|[^A-Za-z0-9_-])@${escapeRegExp(agentId)}(?=$|[^A-Za-z0-9_-])`,
4407
- "g",
4408
- );
4409
- rewritten = rewritten.replace(
4410
- agentPattern,
4411
- (_match, prefix) => `${prefix}$${CODEX_AGENT_SKILL_PREFIX}${agentId}`,
4412
- );
4413
- }
4414
-
4415
- return normalizeCodexWrapperMentions(rewritten);
4416
- }
4417
-
4418
- function rewriteCodexAgentSkillReferences(sourceBody) {
4419
- if (!sourceBody) return sourceBody;
4420
- // Agent source files live under platforms/*/agents, but wrapper skills live
4421
- // under .agents/skills/agent-*. Rebase ../skills/<id> links accordingly.
4422
- const rebased = sourceBody.replace(/\(\.\.\/skills\//g, "(../");
4423
- return normalizeCodexWrapperMentions(rebased);
4424
- }
4425
-
4426
- function normalizeCodexWrapperMentions(sourceBody) {
4427
- if (!sourceBody) return sourceBody;
4428
- return sourceBody.replace(
4429
- /`\$(workflow|agent)-([A-Za-z0-9_-]+|\*)`/g,
4430
- (_match, kind, id) => `$${kind}-${id}`,
4431
- );
4432
- }
4433
-
4434
4573
  async function parseWorkflowMetadata(filePath) {
4435
4574
  const raw = await readFile(filePath, "utf8");
4436
4575
  const { frontmatter, body } = extractFrontmatter(raw);
@@ -4475,217 +4614,6 @@ async function parseAgentMetadata(filePath) {
4475
4614
  };
4476
4615
  }
4477
4616
 
4478
- function buildCodexWorkflowWrapperSkillMarkdown(wrapperSkillId, workflow) {
4479
- const description = `Callable Codex wrapper for ${workflow.command}: ${workflow.description}`;
4480
- const sourceBody =
4481
- workflow.body?.trim() || "No source workflow content found.";
4482
-
4483
- return [
4484
- "---",
4485
- `name: ${wrapperSkillId}`,
4486
- `description: ${yamlSingleQuoted(description)}`,
4487
- "metadata:",
4488
- " source: cubis-foundry",
4489
- " wrapper: workflow",
4490
- " platform: codex",
4491
- ` workflow-id: ${yamlSingleQuoted(workflow.id)}`,
4492
- ` workflow-command: ${yamlSingleQuoted(workflow.command)}`,
4493
- "---",
4494
- "",
4495
- `# Workflow Compatibility Alias: ${workflow.command}`,
4496
- "",
4497
- `Compatibility alias for \`${workflow.command}\` in Codex. Prefer the direct workflow route first and use this wrapper only when older installs or prompts mention $${wrapperSkillId}.`,
4498
- "",
4499
- "## Invocation Contract",
4500
- "1. Resolve the workflow route first; do not use this alias as a substitute for skill discovery.",
4501
- "2. Follow the sequence and guardrails in the source instructions below.",
4502
- "3. Produce actionable output and call out assumptions before edits.",
4503
- "",
4504
- "## Source Workflow Instructions",
4505
- "",
4506
- sourceBody,
4507
- "",
4508
- ].join("\n");
4509
- }
4510
-
4511
- function buildCodexAgentWrapperSkillMarkdown(wrapperSkillId, agent) {
4512
- const description = `Callable Codex wrapper for @${agent.id}: ${agent.description}`;
4513
- const sourceBody = agent.body?.trim() || "No source agent content found.";
4514
- const relatedSkillsLine =
4515
- agent.skills.length > 0
4516
- ? `Related skills from source agent: ${agent.skills.join(", ")}`
4517
- : "Related skills from source agent: (none listed)";
4518
-
4519
- return [
4520
- "---",
4521
- `name: ${wrapperSkillId}`,
4522
- `description: ${yamlSingleQuoted(description)}`,
4523
- "metadata:",
4524
- " source: cubis-foundry",
4525
- " wrapper: agent",
4526
- " platform: codex",
4527
- ` agent-id: ${yamlSingleQuoted(agent.id)}`,
4528
- "---",
4529
- "",
4530
- `# Agent Compatibility Alias: @${agent.id}`,
4531
- "",
4532
- `Compatibility alias for @${agent.id} in Codex. Prefer the direct @agent route first and use this wrapper only when older installs or prompts mention $${wrapperSkillId}.`,
4533
- "",
4534
- "## Invocation Contract",
4535
- "1. Resolve the agent route first; do not use this alias as a substitute for skill discovery.",
4536
- "2. Adopt the role and constraints defined in the source agent content.",
4537
- "3. Apply domain heuristics and escalation rules before coding.",
4538
- "4. Ask clarifying questions when requirements are ambiguous.",
4539
- "",
4540
- `- Source agent name: ${agent.name}`,
4541
- `- Source agent description: ${agent.description}`,
4542
- `- ${relatedSkillsLine}`,
4543
- "",
4544
- "## Source Agent Instructions",
4545
- "",
4546
- sourceBody,
4547
- "",
4548
- ].join("\n");
4549
- }
4550
-
4551
- async function writeGeneratedSkillArtifact({
4552
- destinationDir,
4553
- content,
4554
- overwrite,
4555
- dryRun = false,
4556
- }) {
4557
- const exists = await pathExists(destinationDir);
4558
- if (exists && !overwrite) {
4559
- return { action: dryRun ? "would-skip" : "skipped", path: destinationDir };
4560
- }
4561
-
4562
- if (!dryRun && exists && overwrite) {
4563
- await rm(destinationDir, { recursive: true, force: true });
4564
- }
4565
-
4566
- if (!dryRun) {
4567
- await mkdir(destinationDir, { recursive: true });
4568
- await writeFile(path.join(destinationDir, "SKILL.md"), content, "utf8");
4569
- }
4570
-
4571
- if (dryRun) {
4572
- return {
4573
- action: exists ? "would-replace" : "would-install",
4574
- path: destinationDir,
4575
- };
4576
- }
4577
-
4578
- return { action: exists ? "replaced" : "installed", path: destinationDir };
4579
- }
4580
-
4581
- function buildCodexWrapperSkillIds(platformSpec) {
4582
- const workflowIds = (platformSpec.workflows || []).map((fileName) => {
4583
- const id = normalizeMarkdownId(path.basename(fileName));
4584
- return `${CODEX_WORKFLOW_SKILL_PREFIX}${id}`;
4585
- });
4586
-
4587
- const agentIds = (platformSpec.agents || []).map((fileName) => {
4588
- const id = normalizeMarkdownId(path.basename(fileName));
4589
- return `${CODEX_AGENT_SKILL_PREFIX}${id}`;
4590
- });
4591
-
4592
- return unique([...workflowIds, ...agentIds]);
4593
- }
4594
-
4595
- async function generateCodexWrapperSkills({
4596
- platformRoot,
4597
- platformSpec,
4598
- skillsDir,
4599
- overwrite,
4600
- dryRun = false,
4601
- }) {
4602
- const installed = [];
4603
- const skipped = [];
4604
- const artifacts = [];
4605
- const generated = [];
4606
- const codexAgentIds = (platformSpec.agents || []).map((fileName) =>
4607
- normalizeMarkdownId(path.basename(fileName)),
4608
- );
4609
-
4610
- for (const workflowFile of platformSpec.workflows || []) {
4611
- const source = path.join(platformRoot, "workflows", workflowFile);
4612
- if (!(await pathExists(source))) {
4613
- throw new Error(
4614
- `Missing workflow source file for wrapper generation: ${source}`,
4615
- );
4616
- }
4617
-
4618
- const metadata = await parseWorkflowMetadata(source);
4619
- const raw = await readFile(source, "utf8");
4620
- const sourceBody = extractFrontmatter(raw).body.trim();
4621
- const rewrittenBody = rewriteCodexWorkflowAgentReferences(
4622
- sourceBody,
4623
- codexAgentIds,
4624
- );
4625
- const wrapperSkillId = `${CODEX_WORKFLOW_SKILL_PREFIX}${metadata.id}`;
4626
- const destinationDir = path.join(skillsDir, wrapperSkillId);
4627
- const content = buildCodexWorkflowWrapperSkillMarkdown(wrapperSkillId, {
4628
- ...metadata,
4629
- body: rewrittenBody,
4630
- });
4631
-
4632
- const result = await writeGeneratedSkillArtifact({
4633
- destinationDir,
4634
- content,
4635
- overwrite,
4636
- dryRun,
4637
- });
4638
-
4639
- artifacts.push(destinationDir);
4640
- generated.push({
4641
- kind: "workflow",
4642
- id: metadata.id,
4643
- skillId: wrapperSkillId,
4644
- });
4645
- if (result.action === "skipped" || result.action === "would-skip")
4646
- skipped.push(destinationDir);
4647
- else installed.push(destinationDir);
4648
- }
4649
-
4650
- for (const agentFile of platformSpec.agents || []) {
4651
- const source = path.join(platformRoot, "agents", agentFile);
4652
- if (!(await pathExists(source))) {
4653
- throw new Error(
4654
- `Missing agent source file for wrapper generation: ${source}`,
4655
- );
4656
- }
4657
-
4658
- const metadata = await parseAgentMetadata(source);
4659
- const rewrittenBody = rewriteCodexAgentSkillReferences(metadata.body);
4660
- const wrapperSkillId = `${CODEX_AGENT_SKILL_PREFIX}${metadata.id}`;
4661
- const destinationDir = path.join(skillsDir, wrapperSkillId);
4662
- const content = buildCodexAgentWrapperSkillMarkdown(wrapperSkillId, {
4663
- ...metadata,
4664
- body: rewrittenBody,
4665
- });
4666
-
4667
- const result = await writeGeneratedSkillArtifact({
4668
- destinationDir,
4669
- content,
4670
- overwrite,
4671
- dryRun,
4672
- });
4673
-
4674
- artifacts.push(destinationDir);
4675
- generated.push({ kind: "agent", id: metadata.id, skillId: wrapperSkillId });
4676
- if (result.action === "skipped" || result.action === "would-skip")
4677
- skipped.push(destinationDir);
4678
- else installed.push(destinationDir);
4679
- }
4680
-
4681
- return {
4682
- installed,
4683
- skipped,
4684
- artifacts,
4685
- generated,
4686
- };
4687
- }
4688
-
4689
4617
  async function resolvePlatformAgentSkillDependencies({
4690
4618
  platformRoot,
4691
4619
  platformSpec,
@@ -4707,15 +4635,51 @@ async function collectInstalledWorkflows(
4707
4635
  scope,
4708
4636
  cwd = process.cwd(),
4709
4637
  ) {
4710
- // Global install mode keeps workflows/agents in workspace paths.
4711
- // Index using artifact-aware paths so sync-rules reflects installed workflows.
4638
+ const workflows = [];
4639
+ const state = await readState(scope, cwd);
4640
+ const key = targetStateKey(profileId, scope);
4641
+ const bundleEntries = Object.entries(state.targets?.[key]?.bundles || {});
4642
+ const seen = new Set();
4643
+
4644
+ for (const [bundleId] of bundleEntries) {
4645
+ const sharedWorkflowsDir = path.join(
4646
+ agentAssetsRoot(),
4647
+ "workflows",
4648
+ bundleId,
4649
+ "shared",
4650
+ "workflows",
4651
+ );
4652
+ if (!(await pathExists(sharedWorkflowsDir))) continue;
4653
+ const entries = await readdir(sharedWorkflowsDir, {
4654
+ withFileTypes: true,
4655
+ });
4656
+ for (const entry of entries) {
4657
+ if (
4658
+ !entry.isFile() ||
4659
+ !entry.name.endsWith(".md") ||
4660
+ entry.name.startsWith(".")
4661
+ ) {
4662
+ continue;
4663
+ }
4664
+ const filePath = path.join(sharedWorkflowsDir, entry.name);
4665
+ const metadata = await parseWorkflowMetadata(filePath);
4666
+ if (seen.has(metadata.id)) continue;
4667
+ seen.add(metadata.id);
4668
+ workflows.push(metadata);
4669
+ }
4670
+ }
4671
+
4672
+ if (workflows.length > 0) {
4673
+ return workflows.sort((a, b) => a.command.localeCompare(b.command));
4674
+ }
4675
+
4712
4676
  const profilePaths = await resolveArtifactProfilePaths(profileId, scope, cwd);
4713
- if (!(await pathExists(profilePaths.workflowsDir))) return [];
4677
+ if (!profilePaths.workflowsDir || !(await pathExists(profilePaths.workflowsDir)))
4678
+ return [];
4714
4679
 
4715
4680
  const entries = await readdir(profilePaths.workflowsDir, {
4716
4681
  withFileTypes: true,
4717
4682
  });
4718
- const workflows = [];
4719
4683
 
4720
4684
  for (const entry of entries) {
4721
4685
  if (
@@ -4792,9 +4756,8 @@ function buildManagedWorkflowBlock(platformId, workflows) {
4792
4756
  lines.push("Prefer direct route identifiers first:");
4793
4757
  lines.push("- Workflows: `/workflow-name`");
4794
4758
  lines.push("- Agents: `@agent-name`");
4795
- lines.push(
4796
- "- Compatibility aliases remain available: `$workflow-*`, `$agent-*`",
4797
- );
4759
+ lines.push("- Native agents: `.codex/agents/*.toml`");
4760
+ lines.push("- Native workflow skills: `.agents/skills/<workflow-id>/SKILL.md`");
4798
4761
  lines.push("");
4799
4762
 
4800
4763
  if (workflows.length === 0) {
@@ -4815,9 +4778,7 @@ function buildManagedWorkflowBlock(platformId, workflows) {
4815
4778
  "1. If the user names `/workflow` or `@agent`, use that route directly.",
4816
4779
  );
4817
4780
  lines.push("2. Else map intent to one primary workflow.");
4818
- lines.push(
4819
- "3. Treat `$workflow-*` / `$agent-*` as compatibility aliases only.",
4820
- );
4781
+ lines.push("3. Load supporting skills only after route selection.");
4821
4782
  lines.push("");
4822
4783
  lines.push("<!-- cbx:workflows:auto:end -->");
4823
4784
  return lines.join("\n");
@@ -4825,46 +4786,31 @@ function buildManagedWorkflowBlock(platformId, workflows) {
4825
4786
 
4826
4787
  if (platformId === "copilot") {
4827
4788
  lines.push("Prefer native Copilot route surfaces first:");
4828
- lines.push("- Workflow prompts: `.github/prompts/workflow-*.prompt.md`");
4829
- lines.push("- Workflow files: `.github/copilot/workflows/*.md`");
4789
+ lines.push("- Workflow prompts: `.github/prompts/*.prompt.md`");
4790
+ lines.push("- Agents: `.github/agents/*.md`");
4791
+ lines.push("- Skills: `.github/skills/<skill>/SKILL.md`");
4830
4792
  lines.push("- Agents: `@agent-name`");
4831
4793
  lines.push("- Workspace-first MCP: `.vscode/mcp.json`");
4832
- lines.push(
4833
- "- Do not use `$workflow-*` / `$agent-*` as the primary route surface here; those are Codex compatibility aliases.",
4834
- );
4835
- lines.push(
4836
- "- `.github/skills` is installed by default, but route through workflows and agents before loading skills.",
4837
- );
4838
4794
  lines.push("");
4839
4795
  } else if (platformId === "antigravity") {
4840
4796
  lines.push("Prefer native Antigravity route surfaces first:");
4841
4797
  lines.push("- Commands: `.gemini/commands/*.toml`");
4842
- lines.push("- Workflow files: `.agent/workflows/*.md`");
4843
- lines.push("- Agents: `@agent-name`");
4844
- lines.push(
4845
- "- Do not use `$workflow-*` / `$agent-*` as the primary route surface here; those are Codex compatibility aliases.",
4846
- );
4798
+ lines.push("- Rules: `.agents/rules/GEMINI.md`");
4799
+ lines.push("- Skills: `.agents/skills/<skill>/SKILL.md`");
4800
+ lines.push("- Agent routes compile to native command/rule flows here.");
4847
4801
  lines.push("");
4848
4802
  } else if (platformId === "claude") {
4849
4803
  lines.push("Prefer native Claude Code route surfaces first:");
4850
4804
  lines.push("- Rules: `.claude/rules/*.md`");
4851
- lines.push("- Workflow files: `.claude/workflows/*.md`");
4805
+ lines.push("- Skills: `.claude/skills/<skill>/SKILL.md`");
4806
+ lines.push("- Agents: `.claude/agents/*.md`");
4852
4807
  lines.push("- Memory: `CLAUDE.md`");
4853
- lines.push(
4854
- "- Do not use `$workflow-*` / `$agent-*` as the primary route surface here; those are Codex compatibility aliases.",
4855
- );
4856
4808
  lines.push("");
4857
4809
  } else if (platformId === "gemini") {
4858
4810
  lines.push("Prefer native Gemini route surfaces first:");
4859
4811
  lines.push("- Commands: `.gemini/commands/*.toml`");
4860
- lines.push("- Workflow files: `.gemini/workflows/*.md`");
4861
4812
  lines.push("- Rules: `.gemini/GEMINI.md`");
4862
- lines.push(
4863
- "- Specialists are inline postures here, not standalone agent files.",
4864
- );
4865
- lines.push(
4866
- "- Do not use `$workflow-*` / `$agent-*` as the primary route surface here; those are Codex compatibility aliases.",
4867
- );
4813
+ lines.push("- Route specialists through commands and rule guidance.");
4868
4814
  lines.push("");
4869
4815
  }
4870
4816
 
@@ -4891,39 +4837,21 @@ function buildManagedWorkflowBlock(platformId, workflows) {
4891
4837
  lines.push("");
4892
4838
  lines.push("Selection policy:");
4893
4839
  if (platformId === "copilot") {
4894
- lines.push(
4895
- "1. Match explicit workflow prompt, workflow, or `@agent` first.",
4896
- );
4897
- lines.push(
4898
- "2. Else match user intent to one primary workflow and reuse the matching prompt file when available.",
4899
- );
4900
- lines.push(
4901
- "3. Treat `$workflow-*` / `$agent-*` as Codex compatibility aliases, not as the primary route surface here.",
4902
- );
4840
+ lines.push("1. Match explicit workflow prompt or `@agent` first.");
4841
+ lines.push("2. Else match user intent to one primary workflow and reuse the matching prompt file.");
4842
+ lines.push("3. Use skill_search only when the best workflow or agent route is unclear.");
4903
4843
  } else if (platformId === "antigravity") {
4904
- lines.push(
4905
- "1. Match explicit Gemini command, workflow, or `@agent` first.",
4906
- );
4907
- lines.push(
4908
- "2. Else match user intent to one primary workflow and use the matching command file when available.",
4909
- );
4910
- lines.push(
4911
- "3. Treat `$workflow-*` / `$agent-*` as Codex compatibility aliases, not as the primary route surface here.",
4912
- );
4844
+ lines.push("1. Match explicit Gemini command first.");
4845
+ lines.push("2. Else match user intent to one primary workflow and use the matching command file.");
4846
+ lines.push("3. Use skill_search only when workflow intent is unclear.");
4913
4847
  } else if (platformId === "claude") {
4914
- lines.push("1. Match explicit workflow or scoped rule first.");
4848
+ lines.push("1. Match explicit workflow skill or `@agent` first.");
4915
4849
  lines.push("2. Else match user intent to one primary workflow.");
4916
- lines.push(
4917
- "3. Treat `$workflow-*` / `$agent-*` as Codex compatibility aliases, not as the primary route surface here.",
4918
- );
4850
+ lines.push("3. Use skill_search only when workflow intent is unclear.");
4919
4851
  } else if (platformId === "gemini") {
4920
- lines.push("1. Match explicit Gemini command or workflow first.");
4921
- lines.push(
4922
- "2. Else match user intent to one primary workflow and use the matching command file when available.",
4923
- );
4924
- lines.push(
4925
- "3. Treat specialists as inline postures defined by GEMINI.md, not separate agent files.",
4926
- );
4852
+ lines.push("1. Match explicit Gemini command first.");
4853
+ lines.push("2. Else match user intent to one primary workflow and use the matching command file.");
4854
+ lines.push("3. Keep specialists inside the command plan; there are no standalone agent files.");
4927
4855
  } else {
4928
4856
  lines.push("1. Match explicit slash command first.");
4929
4857
  lines.push(
@@ -5150,7 +5078,24 @@ async function syncRulesForPlatform({
5150
5078
  if (!ruleFilePath)
5151
5079
  throw new Error(`No rule file configured for platform '${platform}'.`);
5152
5080
 
5153
- const workflows = await collectInstalledWorkflows(platform, scope, cwd);
5081
+ let workflows = await collectInstalledWorkflows(platform, scope, cwd);
5082
+ if (scope === "global") {
5083
+ const workspaceRuleFile = await resolveWorkspaceRuleFileForGlobalScope(
5084
+ platform,
5085
+ cwd,
5086
+ );
5087
+ const profile = WORKFLOW_PROFILES[platform];
5088
+ const globalRuleFile = profile
5089
+ ? expandPath(profile.global.ruleFilesByPriority[0], cwd)
5090
+ : null;
5091
+ if (
5092
+ workspaceRuleFile &&
5093
+ globalRuleFile &&
5094
+ path.resolve(workspaceRuleFile) !== path.resolve(globalRuleFile)
5095
+ ) {
5096
+ workflows = await collectInstalledWorkflows(platform, "project", cwd);
5097
+ }
5098
+ }
5154
5099
  const patchResult = await upsertManagedRuleBlock(
5155
5100
  ruleFilePath,
5156
5101
  platform,
@@ -5317,7 +5262,7 @@ async function writeGeneratedArtifact({
5317
5262
 
5318
5263
  function resolveLegacyPostmanConfigPath({ scope, cwd = process.cwd() }) {
5319
5264
  if (scope === "global") {
5320
- return path.join(os.homedir(), ".cbx", LEGACY_POSTMAN_CONFIG_FILENAME);
5265
+ return path.join(resolveManagedHomeDir(), ".cbx", LEGACY_POSTMAN_CONFIG_FILENAME);
5321
5266
  }
5322
5267
  const workspaceRoot = findWorkspaceRoot(cwd);
5323
5268
  return path.join(workspaceRoot, LEGACY_POSTMAN_CONFIG_FILENAME);
@@ -5325,7 +5270,7 @@ function resolveLegacyPostmanConfigPath({ scope, cwd = process.cwd() }) {
5325
5270
 
5326
5271
  function resolveCbxConfigPath({ scope, cwd = process.cwd() }) {
5327
5272
  if (scope === "global") {
5328
- return path.join(os.homedir(), ".cbx", CBX_CONFIG_FILENAME);
5273
+ return path.join(resolveManagedHomeDir(), ".cbx", CBX_CONFIG_FILENAME);
5329
5274
  }
5330
5275
  const workspaceRoot = findWorkspaceRoot(cwd);
5331
5276
  return path.join(workspaceRoot, CBX_CONFIG_FILENAME);
@@ -5345,14 +5290,23 @@ async function assertNoLegacyOnlyPostmanConfig({ scope, cwd = process.cwd() }) {
5345
5290
 
5346
5291
  function resolveMcpRootPath({ scope, cwd = process.cwd() }) {
5347
5292
  if (scope === "global") {
5348
- return path.join(os.homedir(), ".cbx", "mcp");
5293
+ return path.join(resolveManagedHomeDir(), ".cbx", "mcp");
5349
5294
  }
5350
5295
  const workspaceRoot = findWorkspaceRoot(cwd);
5351
5296
  return path.join(workspaceRoot, ".cbx", "mcp");
5352
5297
  }
5353
5298
 
5299
+ function resolveManagedHomeDir() {
5300
+ const override = String(
5301
+ process.env.HOME ||
5302
+ process.env.USERPROFILE ||
5303
+ "",
5304
+ ).trim();
5305
+ return override || os.homedir();
5306
+ }
5307
+
5354
5308
  function resolveManagedCredentialsEnvPath() {
5355
- return path.join(os.homedir(), ".cbx", CBX_CREDENTIALS_ENV_FILENAME);
5309
+ return path.join(resolveManagedHomeDir(), ".cbx", CBX_CREDENTIALS_ENV_FILENAME);
5356
5310
  }
5357
5311
 
5358
5312
  function parseShellEnvValue(rawValue) {
@@ -5491,11 +5445,7 @@ function resolveStitchMcpDefinitionPath({
5491
5445
  scope,
5492
5446
  cwd = process.cwd(),
5493
5447
  }) {
5494
- return path.join(
5495
- resolveMcpRootPath({ scope, cwd }),
5496
- platform,
5497
- "stitch.json",
5498
- );
5448
+ return path.join(resolveMcpRootPath({ scope, cwd }), platform, "stitch.json");
5499
5449
  }
5500
5450
 
5501
5451
  function buildPostmanAuthHeader({
@@ -7109,7 +7059,11 @@ async function configurePostmanInstallArtifacts({
7109
7059
  })
7110
7060
  : null;
7111
7061
  const credentialEnvVarNames = [];
7112
- if (persistCredentials && shouldInstallPostman && effectiveApiKeySource === "env") {
7062
+ if (
7063
+ persistCredentials &&
7064
+ shouldInstallPostman &&
7065
+ effectiveApiKeySource === "env"
7066
+ ) {
7113
7067
  credentialEnvVarNames.push(
7114
7068
  effectiveApiKeyEnvVar || POSTMAN_API_KEY_ENV_VAR,
7115
7069
  );
@@ -7583,34 +7537,66 @@ async function installBundleArtifacts({
7583
7537
  }
7584
7538
 
7585
7539
  const shouldInstallPlatformSkills = true;
7540
+ const workflowFiles = Array.isArray(platformSpec.workflows)
7541
+ ? platformSpec.workflows
7542
+ : [];
7543
+ const generatedSkillDirs = Array.isArray(platformSpec.generatedSkills)
7544
+ ? platformSpec.generatedSkills
7545
+ : [];
7546
+ const agentFiles = platformInstallsCustomAgents(platform)
7547
+ ? Array.isArray(platformSpec.agents)
7548
+ ? platformSpec.agents
7549
+ : []
7550
+ : [];
7551
+ const commandFiles = Array.isArray(platformSpec.commands)
7552
+ ? platformSpec.commands
7553
+ : [];
7554
+ const promptFiles = Array.isArray(platformSpec.prompts)
7555
+ ? platformSpec.prompts
7556
+ : [];
7557
+ const hookFiles = Array.isArray(platformSpec.hooks)
7558
+ ? platformSpec.hooks
7559
+ .map((entry) =>
7560
+ typeof entry === "string"
7561
+ ? entry
7562
+ : typeof entry?.file === "string"
7563
+ ? entry.file
7564
+ : null,
7565
+ )
7566
+ .filter(Boolean)
7567
+ : [];
7586
7568
 
7587
7569
  if (!dryRun) {
7588
- await mkdir(profilePaths.workflowsDir, { recursive: true });
7589
- if (shouldInstallPlatformSkills) {
7570
+ if (workflowFiles.length > 0) {
7571
+ if (!profilePaths.workflowsDir) {
7572
+ throw new Error(
7573
+ `Platform '${platform}' does not define a workflow install directory.`,
7574
+ );
7575
+ }
7576
+ await mkdir(profilePaths.workflowsDir, { recursive: true });
7577
+ }
7578
+ if (
7579
+ shouldInstallPlatformSkills &&
7580
+ profilePaths.skillsDir &&
7581
+ (generatedSkillDirs.length > 0 || Array.isArray(platformSpec.skills))
7582
+ ) {
7590
7583
  await mkdir(profilePaths.skillsDir, { recursive: true });
7591
7584
  }
7592
- if (platformInstallsCustomAgents(platform)) {
7585
+ if (agentFiles.length > 0) {
7586
+ if (!profilePaths.agentsDir) {
7587
+ throw new Error(
7588
+ `Platform '${platform}' does not define an agent install directory.`,
7589
+ );
7590
+ }
7593
7591
  await mkdir(profilePaths.agentsDir, { recursive: true });
7594
7592
  }
7595
- if (
7596
- profilePaths.commandsDir &&
7597
- Array.isArray(platformSpec.commands) &&
7598
- platformSpec.commands.length > 0
7599
- ) {
7593
+ if (profilePaths.commandsDir && commandFiles.length > 0) {
7600
7594
  await mkdir(profilePaths.commandsDir, { recursive: true });
7601
7595
  }
7602
- if (
7603
- profilePaths.promptsDir &&
7604
- Array.isArray(platformSpec.prompts) &&
7605
- platformSpec.prompts.length > 0
7606
- ) {
7596
+ if (profilePaths.promptsDir && promptFiles.length > 0) {
7607
7597
  await mkdir(profilePaths.promptsDir, { recursive: true });
7608
7598
  }
7609
- if (
7610
- profilePaths.hooksDir &&
7611
- Array.isArray(platformSpec.hooks) &&
7612
- platformSpec.hooks.some((entry) => typeof entry?.file === "string")
7613
- ) {
7599
+ if (profilePaths.hooksDir && hookFiles.length > 0) {
7614
7600
  await mkdir(profilePaths.hooksDir, { recursive: true });
7615
7601
  }
7616
7602
  }
@@ -7632,10 +7618,8 @@ async function installBundleArtifacts({
7632
7618
  // Bind useSymlinks into copyArtifact so every call site inherits it
7633
7619
  const copyArt = (args) => copyArtifact({ ...args, useSymlinks });
7634
7620
 
7635
- const workflowFiles = Array.isArray(platformSpec.workflows)
7636
- ? platformSpec.workflows
7637
- : [];
7638
7621
  for (const workflowFile of workflowFiles) {
7622
+ if (!profilePaths.workflowsDir) continue;
7639
7623
  const source = path.join(platformRoot, "workflows", workflowFile);
7640
7624
  const destination = path.join(
7641
7625
  profilePaths.workflowsDir,
@@ -7658,12 +7642,8 @@ async function installBundleArtifacts({
7658
7642
  else installed.push(destination);
7659
7643
  }
7660
7644
 
7661
- const agentFiles = platformInstallsCustomAgents(platform)
7662
- ? Array.isArray(platformSpec.agents)
7663
- ? platformSpec.agents
7664
- : []
7665
- : [];
7666
7645
  for (const agentFile of agentFiles) {
7646
+ if (!profilePaths.agentsDir) continue;
7667
7647
  const source = path.join(platformRoot, "agents", agentFile);
7668
7648
  const destination = path.join(
7669
7649
  profilePaths.agentsDir,
@@ -7686,9 +7666,6 @@ async function installBundleArtifacts({
7686
7666
  else installed.push(destination);
7687
7667
  }
7688
7668
 
7689
- const commandFiles = Array.isArray(platformSpec.commands)
7690
- ? platformSpec.commands
7691
- : [];
7692
7669
  for (const commandFile of commandFiles) {
7693
7670
  if (!profilePaths.commandsDir) continue;
7694
7671
  const source = path.join(platformRoot, "commands", commandFile);
@@ -7713,9 +7690,6 @@ async function installBundleArtifacts({
7713
7690
  else installed.push(destination);
7714
7691
  }
7715
7692
 
7716
- const promptFiles = Array.isArray(platformSpec.prompts)
7717
- ? platformSpec.prompts
7718
- : [];
7719
7693
  for (const promptFile of promptFiles) {
7720
7694
  if (!profilePaths.promptsDir) continue;
7721
7695
  const source = path.join(platformRoot, "prompts", promptFile);
@@ -7739,17 +7713,6 @@ async function installBundleArtifacts({
7739
7713
  skipped.push(destination);
7740
7714
  else installed.push(destination);
7741
7715
  }
7742
- const hookFiles = Array.isArray(platformSpec.hooks)
7743
- ? platformSpec.hooks
7744
- .map((entry) =>
7745
- typeof entry === "string"
7746
- ? entry
7747
- : typeof entry?.file === "string"
7748
- ? entry.file
7749
- : null,
7750
- )
7751
- .filter(Boolean)
7752
- : [];
7753
7716
  for (const hookFile of hookFiles) {
7754
7717
  if (!profilePaths.hooksDir) continue;
7755
7718
  const source = path.join(platformRoot, "hooks", hookFile);
@@ -7773,7 +7736,7 @@ async function installBundleArtifacts({
7773
7736
  skipped.push(destination);
7774
7737
  else installed.push(destination);
7775
7738
  }
7776
- if (shouldInstallPlatformSkills) {
7739
+ if (shouldInstallPlatformSkills && profilePaths.skillsDir) {
7777
7740
  const agentSkillDependencies = await resolvePlatformAgentSkillDependencies({
7778
7741
  platformRoot,
7779
7742
  platformSpec,
@@ -7830,21 +7793,33 @@ async function installBundleArtifacts({
7830
7793
  skipped.push(skillsIndexDest);
7831
7794
  else installed.push(skillsIndexDest);
7832
7795
  }
7833
- }
7834
7796
 
7835
- let generatedWrapperSkills = [];
7836
- if (platform === "codex") {
7837
- const wrapperResult = await generateCodexWrapperSkills({
7838
- platformRoot,
7839
- platformSpec,
7840
- skillsDir: profilePaths.skillsDir,
7841
- overwrite,
7842
- dryRun,
7843
- });
7844
- installed.push(...wrapperResult.installed);
7845
- skipped.push(...wrapperResult.skipped);
7846
- artifacts.skills.push(...wrapperResult.artifacts);
7847
- generatedWrapperSkills = wrapperResult.generated;
7797
+ for (const generatedSkillDir of generatedSkillDirs) {
7798
+ const source = path.join(
7799
+ platformRoot,
7800
+ "generated-skills",
7801
+ generatedSkillDir,
7802
+ );
7803
+ const destination = path.join(
7804
+ profilePaths.skillsDir,
7805
+ path.basename(generatedSkillDir),
7806
+ );
7807
+
7808
+ if (!(await pathExists(source))) {
7809
+ throw new Error(`Missing generated skill source directory: ${source}`);
7810
+ }
7811
+
7812
+ const result = await copyArt({
7813
+ source,
7814
+ destination,
7815
+ overwrite,
7816
+ dryRun,
7817
+ });
7818
+ artifacts.skills.push(destination);
7819
+ if (result.action === "skipped" || result.action === "would-skip")
7820
+ skipped.push(destination);
7821
+ else installed.push(destination);
7822
+ }
7848
7823
  }
7849
7824
 
7850
7825
  let terminalIntegration = null;
@@ -7857,11 +7832,13 @@ async function installBundleArtifacts({
7857
7832
  installed.push(...terminalIntegration.installedPaths);
7858
7833
  }
7859
7834
 
7860
- const duplicateSkillCleanup = await cleanupNestedDuplicateSkills({
7861
- skillsRootDir: profilePaths.skillsDir,
7862
- installedSkillDirs: artifacts.skills,
7863
- dryRun,
7864
- });
7835
+ const duplicateSkillCleanup = profilePaths.skillsDir
7836
+ ? await cleanupNestedDuplicateSkills({
7837
+ skillsRootDir: profilePaths.skillsDir,
7838
+ installedSkillDirs: artifacts.skills,
7839
+ dryRun,
7840
+ })
7841
+ : [];
7865
7842
 
7866
7843
  const sanitizedSkills = await sanitizeInstalledSkillsForPlatform({
7867
7844
  platform,
@@ -7880,64 +7857,12 @@ async function installBundleArtifacts({
7880
7857
  skipped,
7881
7858
  artifacts,
7882
7859
  terminalIntegration,
7883
- generatedWrapperSkills,
7884
7860
  duplicateSkillCleanup,
7885
7861
  sanitizedSkills,
7886
7862
  sanitizedAgents,
7887
7863
  };
7888
7864
  }
7889
7865
 
7890
- async function installCodexProjectWorkflowTemplates({
7891
- bundleId,
7892
- manifest,
7893
- overwrite,
7894
- dryRun = false,
7895
- cwd = process.cwd(),
7896
- }) {
7897
- const platform = "codex";
7898
- const platformSpec = manifest.platforms?.[platform];
7899
- if (!platformSpec) return { installed: [], skipped: [] };
7900
-
7901
- const workflowFiles = Array.isArray(platformSpec.workflows)
7902
- ? platformSpec.workflows
7903
- : [];
7904
- if (workflowFiles.length === 0) return { installed: [], skipped: [] };
7905
-
7906
- const profilePaths = await resolveProfilePaths(platform, "project", cwd);
7907
- if (!dryRun) {
7908
- await mkdir(profilePaths.workflowsDir, { recursive: true });
7909
- }
7910
-
7911
- const bundleRoot = path.join(agentAssetsRoot(), "workflows", bundleId);
7912
- const platformRoot = path.join(bundleRoot, "platforms", platform);
7913
- const installed = [];
7914
- const skipped = [];
7915
-
7916
- for (const workflowFile of workflowFiles) {
7917
- const source = path.join(platformRoot, "workflows", workflowFile);
7918
- const destination = path.join(
7919
- profilePaths.workflowsDir,
7920
- path.basename(workflowFile),
7921
- );
7922
-
7923
- if (!(await pathExists(source))) {
7924
- throw new Error(`Missing workflow source file: ${source}`);
7925
- }
7926
-
7927
- const result = await copyArtifact({
7928
- source,
7929
- destination,
7930
- overwrite,
7931
- dryRun,
7932
- });
7933
- if (result.action === "skipped" || result.action === "would-skip")
7934
- skipped.push(destination);
7935
- else installed.push(destination);
7936
- }
7937
-
7938
- return { installed, skipped };
7939
- }
7940
-
7941
7866
  async function seedRuleFileFromTemplateIfMissing({
7942
7867
  bundleId,
7943
7868
  manifest,
@@ -7987,6 +7912,7 @@ function commandToFilename(command) {
7987
7912
  }
7988
7913
 
7989
7914
  async function findWorkflowFileByTarget(workflowsDir, target) {
7915
+ if (!workflowsDir) return null;
7990
7916
  const direct = target.endsWith(".md") ? target : `${target}.md`;
7991
7917
  const directPath = path.join(workflowsDir, direct);
7992
7918
  if (await pathExists(directPath)) return directPath;
@@ -8035,8 +7961,12 @@ async function removeBundleArtifacts({
8035
7961
  );
8036
7962
 
8037
7963
  const removed = [];
7964
+ const generatedSkillDirs = Array.isArray(platformSpec.generatedSkills)
7965
+ ? platformSpec.generatedSkills
7966
+ : [];
8038
7967
 
8039
7968
  for (const workflowFile of platformSpec.workflows || []) {
7969
+ if (!profilePaths.workflowsDir) continue;
8040
7970
  const destination = path.join(
8041
7971
  profilePaths.workflowsDir,
8042
7972
  path.basename(workflowFile),
@@ -8045,6 +7975,7 @@ async function removeBundleArtifacts({
8045
7975
  }
8046
7976
 
8047
7977
  for (const agentFile of platformSpec.agents || []) {
7978
+ if (!profilePaths.agentsDir) continue;
8048
7979
  const destination = path.join(
8049
7980
  profilePaths.agentsDir,
8050
7981
  path.basename(agentFile),
@@ -8091,63 +8022,83 @@ async function removeBundleArtifacts({
8091
8022
  extraSkillIds: [],
8092
8023
  });
8093
8024
  for (const skillId of skillIds) {
8025
+ if (!profilePaths.skillsDir) continue;
8094
8026
  const destination = path.join(profilePaths.skillsDir, skillId);
8095
8027
  if (await safeRemove(destination, dryRun)) removed.push(destination);
8096
8028
  }
8097
8029
 
8098
- if (platform === "codex") {
8099
- const wrapperSkillIds = buildCodexWrapperSkillIds(platformSpec);
8100
- for (const skillId of wrapperSkillIds) {
8101
- const destination = path.join(profilePaths.skillsDir, skillId);
8102
- if (await safeRemove(destination, dryRun)) removed.push(destination);
8103
- }
8030
+ for (const generatedSkillDir of generatedSkillDirs) {
8031
+ if (!profilePaths.skillsDir) continue;
8032
+ const destination = path.join(
8033
+ profilePaths.skillsDir,
8034
+ path.basename(generatedSkillDir),
8035
+ );
8036
+ if (await safeRemove(destination, dryRun)) removed.push(destination);
8104
8037
  }
8105
8038
 
8106
8039
  return { removed, profilePaths };
8107
8040
  }
8108
8041
 
8109
8042
  function printPlatforms() {
8043
+ const formatPathList = (paths, disabledLabel = "(not used)") =>
8044
+ Array.isArray(paths) && paths.length > 0 ? paths.join(" | ") : disabledLabel;
8110
8045
  console.log("Workflow platforms:");
8111
8046
  for (const profileId of PLATFORM_IDS) {
8112
8047
  const profile = WORKFLOW_PROFILES[profileId];
8113
8048
  const agentsEnabled = platformInstallsCustomAgents(profileId);
8114
8049
  console.log(`- ${profile.id} (${profile.label})`);
8115
- console.log(` project workflows: ${profile.project.workflowDirs[0]}`);
8116
8050
  console.log(
8117
- ` project agents: ${agentsEnabled ? profile.project.agentDirs[0] : "(disabled for this platform)"}`,
8051
+ ` project workflows: ${formatPathList(profile.project.workflowDirs)}`,
8052
+ );
8053
+ console.log(
8054
+ ` project agents: ${agentsEnabled ? formatPathList(profile.project.agentDirs, "(not used)") : "(disabled for this platform)"}`,
8055
+ );
8056
+ console.log(
8057
+ ` project skills: ${formatPathList(profile.project.skillDirs)}`,
8118
8058
  );
8119
- console.log(` project skills: ${profile.project.skillDirs[0]}`);
8120
8059
  if (
8121
8060
  Array.isArray(profile.project.commandDirs) &&
8122
8061
  profile.project.commandDirs.length > 0
8123
8062
  ) {
8124
- console.log(` project commands: ${profile.project.commandDirs[0]}`);
8063
+ console.log(
8064
+ ` project commands: ${formatPathList(profile.project.commandDirs)}`,
8065
+ );
8125
8066
  }
8126
8067
  if (
8127
8068
  Array.isArray(profile.project.promptDirs) &&
8128
8069
  profile.project.promptDirs.length > 0
8129
8070
  ) {
8130
- console.log(` project prompts: ${profile.project.promptDirs[0]}`);
8071
+ console.log(
8072
+ ` project prompts: ${formatPathList(profile.project.promptDirs)}`,
8073
+ );
8131
8074
  }
8132
8075
  console.log(
8133
8076
  ` project rules: ${profile.project.ruleFilesByPriority.join(" | ")}`,
8134
8077
  );
8135
- console.log(` global workflows: ${profile.global.workflowDirs[0]}`);
8136
8078
  console.log(
8137
- ` global agents: ${agentsEnabled ? profile.global.agentDirs[0] : "(disabled for this platform)"}`,
8079
+ ` global workflows: ${formatPathList(profile.global.workflowDirs)}`,
8080
+ );
8081
+ console.log(
8082
+ ` global agents: ${agentsEnabled ? formatPathList(profile.global.agentDirs, "(not used)") : "(disabled for this platform)"}`,
8083
+ );
8084
+ console.log(
8085
+ ` global skills: ${formatPathList(profile.global.skillDirs)}`,
8138
8086
  );
8139
- console.log(` global skills: ${profile.global.skillDirs[0]}`);
8140
8087
  if (
8141
8088
  Array.isArray(profile.global.commandDirs) &&
8142
8089
  profile.global.commandDirs.length > 0
8143
8090
  ) {
8144
- console.log(` global commands: ${profile.global.commandDirs[0]}`);
8091
+ console.log(
8092
+ ` global commands: ${formatPathList(profile.global.commandDirs)}`,
8093
+ );
8145
8094
  }
8146
8095
  if (
8147
8096
  Array.isArray(profile.global.promptDirs) &&
8148
8097
  profile.global.promptDirs.length > 0
8149
8098
  ) {
8150
- console.log(` global prompts: ${profile.global.promptDirs[0]}`);
8099
+ console.log(
8100
+ ` global prompts: ${formatPathList(profile.global.promptDirs)}`,
8101
+ );
8151
8102
  }
8152
8103
  console.log(
8153
8104
  ` global rules: ${profile.global.ruleFilesByPriority.join(" | ")}`,
@@ -8191,7 +8142,6 @@ function printInstallSummary({
8191
8142
  bundleId,
8192
8143
  installed,
8193
8144
  skipped,
8194
- generatedWrapperSkills = [],
8195
8145
  duplicateSkillCleanup = [],
8196
8146
  sanitizedSkills = [],
8197
8147
  sanitizedAgents = [],
@@ -8228,21 +8178,6 @@ function printInstallSummary({
8228
8178
  console.log("\nNo changes made.");
8229
8179
  }
8230
8180
 
8231
- if (generatedWrapperSkills.length > 0) {
8232
- const workflowCount = generatedWrapperSkills.filter(
8233
- (item) => item.kind === "workflow",
8234
- ).length;
8235
- const agentCount = generatedWrapperSkills.filter(
8236
- (item) => item.kind === "agent",
8237
- ).length;
8238
- console.log(
8239
- `\nCodex callable wrapper skills: ${generatedWrapperSkills.length} (workflow=${workflowCount}, agent=${agentCount})`,
8240
- );
8241
- console.log(
8242
- "These remain compatibility aliases. Prefer direct /workflow and @agent routing in Codex when available.",
8243
- );
8244
- }
8245
-
8246
8181
  if (terminalIntegration) {
8247
8182
  console.log("\nAntigravity terminal verification integration:");
8248
8183
  console.log(`- Provider: ${terminalIntegration.provider}`);
@@ -8365,7 +8300,8 @@ function printPostmanSetupSummary({ postmanSetup }) {
8365
8300
  `- .gitignore (${ignoreResult.filePath}): ${ignoreResult.action}`,
8366
8301
  );
8367
8302
  }
8368
- for (const cleanupResult of postmanSetup.legacyDefinitionCleanupResults || []) {
8303
+ for (const cleanupResult of postmanSetup.legacyDefinitionCleanupResults ||
8304
+ []) {
8369
8305
  console.log(
8370
8306
  `- Legacy direct MCP cleanup (${cleanupResult.path}): ${cleanupResult.action}`,
8371
8307
  );
@@ -8620,14 +8556,19 @@ async function createDoctorReport({ platform, scope, cwd = process.cwd() }) {
8620
8556
  const lines = gitignore.split(/\r?\n/).map((line) => line.trim());
8621
8557
  const hasAgentIgnore = lines.some(
8622
8558
  (line) =>
8623
- line === ".agent" || line === ".agent/" || line === "/.agent/",
8559
+ line === ".agent" ||
8560
+ line === ".agent/" ||
8561
+ line === "/.agent/" ||
8562
+ line === ".agents" ||
8563
+ line === ".agents/" ||
8564
+ line === "/.agents/",
8624
8565
  );
8625
8566
  if (hasAgentIgnore) {
8626
8567
  warnings.push(
8627
- ".agent/ is ignored in .gitignore; this can hide team workflow/rule updates.",
8568
+ ".agents/ or legacy .agent/ is ignored in .gitignore; this can hide team workflow/rule updates.",
8628
8569
  );
8629
8570
  recommendations.push(
8630
- "Prefer tracking .agent/ in git. For local-only excludes, use '.git/info/exclude' instead of .gitignore.",
8571
+ "Prefer tracking .agents/ in git. For local-only excludes, use '.git/info/exclude' instead of .gitignore.",
8631
8572
  );
8632
8573
  }
8633
8574
  }
@@ -8842,10 +8783,7 @@ function withInstallOptions(command) {
8842
8783
  "--stitch",
8843
8784
  "optional: configure Stitch profiles and gateway-backed Foundry MCP wiring",
8844
8785
  )
8845
- .option(
8846
- "--playwright",
8847
- "optional: include Playwright MCP server wiring",
8848
- )
8786
+ .option("--playwright", "optional: include Playwright MCP server wiring")
8849
8787
  .option(
8850
8788
  "--postman-api-key <key>",
8851
8789
  "deprecated: inline key mode is disabled. Use env vars + profiles.",
@@ -9141,13 +9079,13 @@ async function cleanupAntigravityTerminalIntegration({
9141
9079
  }) {
9142
9080
  const profilePaths = await resolveArtifactProfilePaths(
9143
9081
  "antigravity",
9144
- scope,
9082
+ "project",
9145
9083
  cwd,
9146
9084
  );
9147
9085
  const integrationDir = getAntigravityTerminalIntegrationDir(profilePaths);
9148
9086
  const dirRemoved = await safeRemove(integrationDir, dryRun);
9149
9087
 
9150
- const primaryRuleFile = await resolveRuleFilePath("antigravity", scope, cwd);
9088
+ const primaryRuleFile = await resolveRuleFilePath("antigravity", "project", cwd);
9151
9089
  const primaryRule = primaryRuleFile
9152
9090
  ? await removeTerminalVerificationBlock(primaryRuleFile, dryRun)
9153
9091
  : { action: "missing-rule-file", filePath: null };
@@ -9262,28 +9200,6 @@ async function performWorkflowInstall(
9262
9200
  cwd,
9263
9201
  });
9264
9202
 
9265
- if (platform === "codex" && scope === "global") {
9266
- const codexProjectPaths = await resolveProfilePaths(
9267
- "codex",
9268
- "project",
9269
- cwd,
9270
- );
9271
- if (
9272
- path.resolve(artifactProfilePaths.workflowsDir) !==
9273
- path.resolve(codexProjectPaths.workflowsDir)
9274
- ) {
9275
- const codexProjectWorkflows = await installCodexProjectWorkflowTemplates({
9276
- bundleId,
9277
- manifest,
9278
- overwrite: Boolean(options.overwrite),
9279
- dryRun,
9280
- cwd,
9281
- });
9282
- installResult.installed.push(...codexProjectWorkflows.installed);
9283
- installResult.skipped.push(...codexProjectWorkflows.skipped);
9284
- }
9285
- }
9286
-
9287
9203
  await seedRuleFileFromTemplateIfMissing({
9288
9204
  bundleId,
9289
9205
  manifest,
@@ -9365,7 +9281,6 @@ async function runWorkflowInstall(options) {
9365
9281
  bundleId: result.bundleId,
9366
9282
  installed: result.installResult.installed,
9367
9283
  skipped: result.installResult.skipped,
9368
- generatedWrapperSkills: result.installResult.generatedWrapperSkills,
9369
9284
  duplicateSkillCleanup: result.installResult.duplicateSkillCleanup,
9370
9285
  sanitizedSkills: result.installResult.sanitizedSkills,
9371
9286
  sanitizedAgents: result.installResult.sanitizedAgents,
@@ -9627,6 +9542,11 @@ async function runWorkflowRemove(target, options) {
9627
9542
  }
9628
9543
  }
9629
9544
  } else {
9545
+ if (!artifactProfilePaths.workflowsDir) {
9546
+ throw new Error(
9547
+ `Platform '${platform}' does not install standalone workflow files. Remove the bundle instead, or remove the native command/prompt/skill artifact directly.`,
9548
+ );
9549
+ }
9630
9550
  const workflowFile = await findWorkflowFileByTarget(
9631
9551
  artifactProfilePaths.workflowsDir,
9632
9552
  target,
@@ -9654,23 +9574,24 @@ async function runWorkflowRemove(target, options) {
9654
9574
  }
9655
9575
  }
9656
9576
 
9657
- const syncResult = await syncRulesForPlatform({
9658
- platform,
9659
- scope: ruleScope,
9660
- dryRun,
9661
- cwd,
9662
- });
9663
-
9664
9577
  if (!dryRun && removedType === "bundle") {
9578
+ const ruleFilePath = await resolveRuleFilePath(platform, ruleScope, cwd);
9665
9579
  await recordBundleRemovalState({
9666
- scope,
9580
+ scope: ruleScope,
9667
9581
  platform,
9668
9582
  bundleId: target,
9669
- ruleFilePath: syncResult.filePath,
9583
+ ruleFilePath,
9670
9584
  cwd,
9671
9585
  });
9672
9586
  }
9673
9587
 
9588
+ const syncResult = await syncRulesForPlatform({
9589
+ platform,
9590
+ scope: ruleScope,
9591
+ dryRun,
9592
+ cwd,
9593
+ });
9594
+
9674
9595
  printRemoveSummary({
9675
9596
  platform,
9676
9597
  scope,
@@ -10114,14 +10035,15 @@ async function runWorkflowRemoveAll(options) {
10114
10035
  const promptFiles = (platformSpec.prompts || []).map((entry) =>
10115
10036
  path.basename(entry),
10116
10037
  );
10038
+ const generatedSkillIds = (platformSpec.generatedSkills || []).map(
10039
+ (entry) => path.basename(entry),
10040
+ );
10117
10041
  const skillIds = await resolveInstallSkillIds({
10118
10042
  platformSpec,
10119
10043
  extraSkillIds: [],
10120
10044
  });
10121
- const wrapperSkillIds =
10122
- platform === "codex" ? buildCodexWrapperSkillIds(platformSpec) : [];
10123
10045
  const bundleSkillIds = [
10124
- ...new Set([...skillIds, ...wrapperSkillIds]),
10046
+ ...new Set([...skillIds, ...generatedSkillIds]),
10125
10047
  ];
10126
10048
 
10127
10049
  for (const workflowsDir of alternateWorkflowsDirs) {
@@ -11010,7 +10932,7 @@ async function runWorkflowConfigKeysList(options) {
11010
10932
  cwd,
11011
10933
  });
11012
10934
 
11013
- console.log(`Config file: ${configPath}`);
10935
+ console.log(`Config file: ${toPosixPath(configPath)}`);
11014
10936
  if (!existing.exists) {
11015
10937
  console.log("Status: missing");
11016
10938
  return;
@@ -11321,15 +11243,16 @@ async function runWorkflowConfigKeysMigrateInline(options) {
11321
11243
  }
11322
11244
  console.log(`Legacy direct MCP cleanup actions: ${cleanupResults.length}`);
11323
11245
  for (const cleanup of cleanupResults) {
11324
- console.log(`- ${cleanup.action} ${cleanup.path}`);
11246
+ console.log(`- ${cleanup.action} ${toPosixPath(cleanup.path)}`);
11325
11247
  }
11326
11248
  if (secureArtifacts?.mcpRuntimeResult) {
11327
11249
  console.log(
11328
- `Secure platform MCP target: ${secureArtifacts.mcpRuntimeResult.action} (${secureArtifacts.mcpRuntimeResult.path || "n/a"})`,
11250
+ `Secure platform MCP target: ${secureArtifacts.mcpRuntimeResult.action} (${secureArtifacts.mcpRuntimeResult.path ? toPosixPath(secureArtifacts.mcpRuntimeResult.path) : "n/a"})`,
11329
11251
  );
11330
11252
  }
11331
- for (const cleanup of secureArtifacts?.legacyDefinitionCleanupResults || []) {
11332
- console.log(`- ${cleanup.action} ${cleanup.path}`);
11253
+ for (const cleanup of secureArtifacts?.legacyDefinitionCleanupResults ||
11254
+ []) {
11255
+ console.log(`- ${cleanup.action} ${toPosixPath(cleanup.path)}`);
11333
11256
  }
11334
11257
  for (const warning of secureArtifacts?.warnings || []) {
11335
11258
  console.log(`Warning: ${warning}`);
@@ -11356,14 +11279,17 @@ async function runWorkflowConfigKeysDoctor(options) {
11356
11279
  cwd,
11357
11280
  });
11358
11281
 
11359
- console.log(`Config file: ${configPath}`);
11282
+ console.log(`Config file: ${toPosixPath(configPath)}`);
11360
11283
  if (!existing.exists) {
11361
11284
  console.log("Status: missing");
11362
11285
  return;
11363
11286
  }
11364
11287
 
11365
11288
  const configFindings = collectInlineCredentialFindings(existingValue);
11366
- const artifactFindings = await collectCredentialLeakFindings({ scope, cwd });
11289
+ const artifactFindings = await collectCredentialLeakFindings({
11290
+ scope,
11291
+ cwd,
11292
+ });
11367
11293
  const migrationPreview = migrateInlineCredentialsInConfig(existingValue);
11368
11294
 
11369
11295
  console.log(`Inline key findings: ${configFindings.length}`);
@@ -11373,7 +11299,7 @@ async function runWorkflowConfigKeysDoctor(options) {
11373
11299
 
11374
11300
  console.log(`Credential leak findings: ${artifactFindings.length}`);
11375
11301
  for (const finding of artifactFindings) {
11376
- console.log(`- ${finding.filePath} [${finding.matches.join(", ")}]`);
11302
+ console.log(`- ${toPosixPath(finding.filePath)} [${finding.matches.join(", ")}]`);
11377
11303
  }
11378
11304
 
11379
11305
  if (migrationPreview.requiredEnvVars.length > 0) {
@@ -12291,7 +12217,7 @@ async function runMcpServe(options) {
12291
12217
 
12292
12218
  function resolveCbxRootPath({ scope, cwd = process.cwd() }) {
12293
12219
  if (scope === "global") {
12294
- return path.join(os.homedir(), ".cbx");
12220
+ return path.join(resolveManagedHomeDir(), ".cbx");
12295
12221
  }
12296
12222
  const workspaceRoot = findWorkspaceRoot(cwd);
12297
12223
  return path.join(workspaceRoot, ".cbx");
@@ -12832,11 +12758,9 @@ function printInstallEngineeringSummary({ engineeringResults, techResult }) {
12832
12758
 
12833
12759
  function printInstallDocumentationNotice() {
12834
12760
  console.log("\nProject backbone docs:");
12761
+ console.log("- Install only wires the rule references and workflow assets.");
12835
12762
  console.log(
12836
- "- Install only wires the rule references and workflow assets.",
12837
- );
12838
- console.log(
12839
- `- Use \`cbx rules init\` to scaffold ENGINEERING_RULES.md and TECH.md, or \`cbx build architecture --platform <codex|claude|gemini|copilot>\` to generate ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, and ADR scaffolds.`,
12763
+ `- Use \`cbx rules init\` to scaffold ENGINEERING_RULES.md and TECH.md, or \`cbx build architecture --platform <antigravity|codex|claude|gemini|copilot>\` to generate ${FOUNDATION_DOCS_DIR}/MEMORY.md, ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, topic memory docs, and ADR scaffolds.`,
12840
12764
  );
12841
12765
  }
12842
12766
 
@@ -12885,6 +12809,7 @@ async function upsertEngineeringArtifacts({
12885
12809
  const blockResult = await upsertEngineeringRulesBlock({
12886
12810
  ruleFilePath: target.ruleFilePath,
12887
12811
  platform,
12812
+ memoryFilePath: path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "MEMORY.md"),
12888
12813
  productFilePath: scaffold.productPath,
12889
12814
  architectureFilePath: scaffold.architectureDocPath,
12890
12815
  engineeringRulesFilePath: scaffold.engineeringRulesPath,
@@ -12895,9 +12820,10 @@ async function upsertEngineeringArtifacts({
12895
12820
  engineeringResults.push({
12896
12821
  ruleFilePath: target.ruleFilePath,
12897
12822
  rulesFilePath: scaffold.engineeringRulesPath,
12898
- rulesFileResult: scaffold.rulesArchitectureResult.action === "unchanged"
12899
- ? scaffold.rulesFileResult
12900
- : scaffold.rulesArchitectureResult,
12823
+ rulesFileResult:
12824
+ scaffold.rulesArchitectureResult.action === "unchanged"
12825
+ ? scaffold.rulesFileResult
12826
+ : scaffold.rulesArchitectureResult,
12901
12827
  blockResult,
12902
12828
  });
12903
12829
  }
@@ -12994,7 +12920,7 @@ function normalizeArchitectureBuildPlatform(value) {
12994
12920
  const normalized = normalizePlatform(value);
12995
12921
  if (!normalized || !ARCHITECTURE_BUILD_PLATFORMS.has(normalized)) {
12996
12922
  throw new Error(
12997
- "Architecture build platform must be one of: codex, claude, gemini, copilot.",
12923
+ "Architecture build platform must be one of: antigravity, codex, claude, gemini, copilot.",
12998
12924
  );
12999
12925
  }
13000
12926
  return normalized;
@@ -13083,7 +13009,11 @@ async function resolveArchitectureInspectionAnchors(
13083
13009
  return ordered.slice(0, 18);
13084
13010
  }
13085
13011
 
13086
- function resolveArchitectureConditionalSkills(snapshot, specRoots, researchMode) {
13012
+ function resolveArchitectureConditionalSkills(
13013
+ snapshot,
13014
+ specRoots,
13015
+ researchMode,
13016
+ ) {
13087
13017
  const conditional = [];
13088
13018
  const frameworks = new Set(snapshot.frameworks || []);
13089
13019
  const topDirs = new Set(snapshot.topDirs || []);
@@ -13137,7 +13067,9 @@ async function resolveArchitectureSkillPathHints(platform, cwd, skillIds) {
13137
13067
  if (!skillsDir) return [];
13138
13068
  return skillIds
13139
13069
  .map((skillId) => path.join(skillsDir, skillId, "SKILL.md"))
13140
- .map((filePath) => toPosixPath(path.relative(findWorkspaceRoot(cwd), filePath)));
13070
+ .map((filePath) =>
13071
+ toPosixPath(path.relative(findWorkspaceRoot(cwd), filePath)),
13072
+ );
13141
13073
  }
13142
13074
 
13143
13075
  function buildArchitecturePrompt({
@@ -13151,9 +13083,14 @@ function buildArchitecturePrompt({
13151
13083
  conditionalSkills,
13152
13084
  skillPathHints,
13153
13085
  }) {
13086
+ const memoryPath = `${FOUNDATION_DOCS_DIR}/MEMORY.md`;
13154
13087
  const productPath = `${FOUNDATION_DOCS_DIR}/PRODUCT.md`;
13155
13088
  const architecturePath = `${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md`;
13156
13089
  const techPath = `${FOUNDATION_DOCS_DIR}/TECH.md`;
13090
+ const domainMemoryPath = `${FOUNDATION_MEMORY_DIR}/domain.md`;
13091
+ const runtimeMemoryPath = `${FOUNDATION_MEMORY_DIR}/runtime.md`;
13092
+ const integrationsMemoryPath = `${FOUNDATION_MEMORY_DIR}/integrations.md`;
13093
+ const debuggingMemoryPath = `${FOUNDATION_MEMORY_DIR}/debugging.md`;
13157
13094
  const adrReadmePath = `${FOUNDATION_ADR_DIR}/README.md`;
13158
13095
  const adrTemplatePath = `${FOUNDATION_ADR_DIR}/0000-template.md`;
13159
13096
  const architectureSignals = snapshot.architectureByApp
@@ -13163,13 +13100,28 @@ function buildArchitecturePrompt({
13163
13100
  return `${label}: ${item.architectureSignals.join(", ")}`;
13164
13101
  });
13165
13102
 
13103
+ const platformCapabilities = {
13104
+ antigravity:
13105
+ "You are generating repo-shared foundation docs for Antigravity. Use the Gemini-family CLI surface available in this environment and optimize the docs for `.agents/rules/GEMINI.md` plus command-driven workflows.",
13106
+ codex:
13107
+ "You can read, write, and execute shell commands. Use `codex exec` mode.",
13108
+ claude:
13109
+ "You can read, write files, and run bash commands. Use non-interactive mode.",
13110
+ gemini:
13111
+ "You can read, write files, and run commands within your sandbox. Follow Gemini CLI conventions.",
13112
+ copilot:
13113
+ "You can read, write files, and use terminal commands. Follow Copilot agent conventions.",
13114
+ };
13115
+
13166
13116
  return [
13167
13117
  `You are running inside ${platform}.`,
13118
+ platformCapabilities[platform] || "",
13168
13119
  "",
13169
13120
  "Objective:",
13170
- `- Inspect the repository at ${toPosixPath(workspaceRoot)} and author or refresh the core foundation docs in ${productPath}, ${architecturePath}, ${techPath}, ${adrReadmePath}, and ${adrTemplatePath}.`,
13121
+ `- Inspect the repository at ${toPosixPath(workspaceRoot)} and author or refresh the core foundation docs in ${memoryPath}, ${productPath}, ${architecturePath}, ${techPath}, ${domainMemoryPath}, ${runtimeMemoryPath}, ${integrationsMemoryPath}, ${debuggingMemoryPath}, ${adrReadmePath}, and ${adrTemplatePath}.`,
13171
13122
  "- The content should be primarily AI-authored from repository inspection, not copied from placeholder scaffolding.",
13172
13123
  "- Preserve manual content outside the managed `cbx:*` markers.",
13124
+ "- The output docs must be immediately useful to any AI agent (Copilot, Claude, Gemini, Codex) inspecting this repo for the first time, reducing search and exploration time.",
13173
13125
  "",
13174
13126
  "Required skill bundle:",
13175
13127
  `- Load these exact skill IDs first: ${coreSkills.map((skillId) => `\`${skillId}\``).join(", ")}`,
@@ -13189,45 +13141,297 @@ function buildArchitecturePrompt({
13189
13141
  ? `- Architecture signals: ${architectureSignals.join(" | ")}`
13190
13142
  : "- Architecture signals: none confidently inferred from the repo scan",
13191
13143
  `- Entry points: ${snapshot.entryPoints.length > 0 ? snapshot.entryPoints.slice(0, 8).join(" | ") : "none detected"}`,
13192
- `- Key scripts: ${snapshot.keyScripts.length > 0 ? snapshot.keyScripts.slice(0, 8).map((item) => `${item.name}=${item.command}`).join(" | ") : "none detected"}`,
13144
+ `- Key scripts: ${
13145
+ snapshot.keyScripts.length > 0
13146
+ ? snapshot.keyScripts
13147
+ .slice(0, 8)
13148
+ .map((item) => `${item.name}=${item.command}`)
13149
+ .join(" | ")
13150
+ : "none detected"
13151
+ }`,
13193
13152
  `- Inspection anchors: ${inspectionAnchors.length > 0 ? inspectionAnchors.join(", ") : "no concrete anchors detected; inspect the repo root, main source trees, and manifest files manually"}`,
13194
13153
  "",
13154
+ "Foundation doc usage contract:",
13155
+ `- ${memoryPath} is the durable AI entrypoint and first-stop index. Keep it concise, keep it under roughly 120 lines when possible, and route readers to deeper docs instead of duplicating every deep detail.`,
13156
+ `- ${productPath} is for planning, scoping, specs, product intent, business rules, and domain vocabulary.`,
13157
+ `- ${architecturePath} is for structure, boundaries, dependency rules, ADR-worthy decisions, refactors, and design-system governance.`,
13158
+ `- ${techPath} is for build, test, run, debug, CI/CD, tooling, runtime operations, and exact commands.`,
13159
+ `- ${domainMemoryPath}, ${runtimeMemoryPath}, ${integrationsMemoryPath}, and ${debuggingMemoryPath} are load-on-demand drill-down docs for their named topics.`,
13160
+ `- ${adrReadmePath} and ${adrTemplatePath} exist for durable architecture decisions; they are not a replacement for the backbone docs.`,
13161
+ "- `.cbx/architecture-build.json` is build metadata for automation and drift checks, not a primary context document for agents.",
13162
+ "- These docs are downstream inputs to `ENGINEERING_RULES.md` and platform rule files such as `AGENTS.md`, `CLAUDE.md`, `.agents/rules/GEMINI.md`, `.gemini/GEMINI.md`, and `.github/copilot-instructions.md`.",
13163
+ "- Each doc should make it easy for future rules, workflows, agents, and skills to decide whether they need to open it.",
13164
+ "",
13165
+ "Markdown formatting rules (apply to all generated docs):",
13166
+ "- Start each file with a single `# Title` heading. Never use more than one H1 per file.",
13167
+ "- Use `## Heading` for major sections, `### Heading` for subsections. Never skip heading levels (e.g., do not jump from `##` to `####`).",
13168
+ "- Separate headings from surrounding content with exactly one blank line above and below.",
13169
+ "- Use fenced code blocks with triple backticks and a language identifier (```bash, ```typescript, ```json, ```yaml, ```mermaid) for all code, commands, and diagrams. Never use indented code blocks.",
13170
+ "- Use `-` for unordered lists. Use `1.` for ordered lists. Indent nested lists by 2 spaces.",
13171
+ "- Use `inline code` backticks for file paths, command names, env vars, config keys, and identifiers.",
13172
+ "- Use Mermaid fenced blocks (```mermaid) for diagrams. Validate that diagram syntax is correct: `graph TD`, `sequenceDiagram`, `flowchart LR`, or `C4Context` style. Every node and edge must be syntactically valid.",
13173
+ "- Tables must have a header row, a separator row with dashes and pipes, and aligned columns. Example:",
13174
+ " ```",
13175
+ " | Column A | Column B |",
13176
+ " | -------- | -------- |",
13177
+ " | value | value |",
13178
+ " ```",
13179
+ "- Use `> blockquote` only for callouts or important notes, prefixed with **Note:** or **Warning:**.",
13180
+ "- Relative links to other repo files should use repo-relative paths: `[ARCHITECTURE.md](docs/foundation/ARCHITECTURE.md)`.",
13181
+ "- End every file with a single trailing newline. No trailing whitespace on lines.",
13182
+ "",
13195
13183
  "Execution contract:",
13196
13184
  "1. Inspect the repository first before writing any backbone doc content. Derive structure, product surfaces, runtime boundaries, and technical constraints from the actual codebase.",
13197
13185
  "2. Complete a real inspection pass before drafting. At minimum, inspect the concrete anchors listed above, plus any adjacent directories needed to understand the main execution paths, data boundaries, and integration surfaces.",
13198
13186
  "3. Do not infer architecture from filenames alone when you can open representative files. Read enough source to validate the main app boundaries, runtime flows, and persistence/integration patterns.",
13199
- `4. Then read ${productPath}, ${architecturePath}, and ${techPath} in that order when they exist so you can preserve useful manual context and update existing managed sections cleanly.`,
13200
- `5. Replace or update only the content between the existing managed markers in ${productPath}, ${architecturePath}, and ${techPath}. Do not append a second marker block.`,
13201
- `6. In ${productPath}, write a concrete product foundation: product purpose, primary users/operators, main journeys, business capabilities, operational constraints, and what future contributors must preserve.`,
13202
- `7. In ${architecturePath}, write a lean but detailed architecture backbone in a pragmatic arc42/C4 style: system purpose and constraints, explicit architecture classification, bounded contexts, major building blocks, dependency rules, data and integration boundaries, runtime flows, deployment/operability notes, testing/debugging strategy, and only the diagram levels that add real value.`,
13203
- `8. ${architecturePath} must include a dedicated folder-structure guide that lists the important apps/packages/directories, what each owns, and how contributors should treat those boundaries when editing code.`,
13204
- `9. In ${techPath}, write the developer-facing technical map: stack, repo layout, key commands, entrypoints, data stores, external services, environment/config surfaces, MCP/tooling footprint, and change hotspots future agents should inspect before editing code.`,
13205
- `10. ${techPath} should complement ${architecturePath}; do not repeat the same structure prose unless it helps a developer act faster.`,
13206
- `11. Use exact required headings in ${productPath}: \`## Product Scope\`, \`## Product Purpose\`, \`## Primary Users And Operators\`, \`## Main Journeys\`, \`## Business Capabilities That Matter\`, \`## Operational Constraints\`, \`## Preservation Rules For Future Contributors\`.`,
13207
- `12. Use exact required headings in ${architecturePath}: \`## Architecture Type\`, \`## System Purpose\`, \`## Constraints And Architectural Drivers\`, \`## Repository Structure Guide\`, \`## Bounded Contexts\`, \`## Major Building Blocks\`, \`## Dependency Rules\`, \`## Data Boundaries\`, \`## Integration Boundaries\`, \`## Runtime Flows\`, \`## Deployment And Operability\`, \`## Testing And Debugging Strategy\`, \`## Architectural Guidance\`.`,
13208
- `13. Use exact required headings in ${techPath}: \`## Stack Snapshot\`, \`## Repository Layout\`, \`## Entrypoints\`, \`## Key Commands\`, \`## Runtime Data Stores\`, \`## External Services And Integration Surfaces\`, \`## Environment And Config Surfaces\`, \`## Generated Artifacts To Respect\`, \`## Change Hotspots\`, \`## Practical Editing Notes\`.`,
13209
- "14. Every major claim should be grounded in repository evidence. Mention concrete repo paths in the docs when a structural claim would otherwise be ambiguous.",
13210
- "15. Avoid placeholder filler, generic checklists, and duplicated content across files. Each doc should have a clear job.",
13211
- "16. Do not create ROADMAP.md, ENGINEERING_RULES.md, or other extra docs unless the prompt explicitly asks for them.",
13187
+ `4. Then read ${memoryPath}, ${productPath}, ${architecturePath}, ${techPath}, ${domainMemoryPath}, ${runtimeMemoryPath}, ${integrationsMemoryPath}, and ${debuggingMemoryPath} in that order when they exist so you can preserve useful manual context and update existing managed sections cleanly.`,
13188
+ `5. Replace or update only the content between the existing managed markers in ${memoryPath}, ${productPath}, ${architecturePath}, ${techPath}, ${domainMemoryPath}, ${runtimeMemoryPath}, ${integrationsMemoryPath}, and ${debuggingMemoryPath}. Do not append a second marker block.`,
13189
+ "",
13190
+ `6. In ${memoryPath}, write the durable AI memory index:`,
13191
+ " - A terse project summary that a fresh agent can absorb in under a minute.",
13192
+ " - A task-based map telling rules, workflows, agents, and skills when to load PRODUCT, ARCHITECTURE, TECH, each topic memory doc, and ADRs.",
13193
+ " - Durable facts and invariants that are expensive to rediscover.",
13194
+ " - Active watchpoints: areas likely to break, drift, or require re-validation after changes.",
13195
+ " - Keep MEMORY.md as an index, not a dump: no long command catalogs, no repeated architecture prose, no copied API contracts, and no verbose troubleshooting playbooks when those belong in deeper docs.",
13196
+ " - If a section needs more than a short paragraph or 5-7 bullets, move the detail into PRODUCT, ARCHITECTURE, TECH, a topic memory doc, or an ADR and link to it from MEMORY.md.",
13197
+ "",
13198
+ `7. In ${productPath}, write a concrete product foundation:`,
13199
+ " - Product purpose with a one-sentence elevator pitch an AI agent can use as context.",
13200
+ " - A short consumer note explaining that PRODUCT is the doc for planning, scoping, specs, UX, and domain-language questions.",
13201
+ " - Primary users/operators with their key goals.",
13202
+ " - Main journeys as numbered sequences an agent can follow to understand the happy path.",
13203
+ " - Business capabilities that matter, linked to repo paths that implement them.",
13204
+ " - Operational constraints and SLA/uptime expectations if evident.",
13205
+ " - What future contributors must preserve (invariants, contracts, compatibility guarantees).",
13206
+ " - A domain glossary defining project-specific terms, abbreviations, and bounded-context language so AI agents use consistent vocabulary.",
13207
+ "",
13208
+ `8. In ${architecturePath}, write a lean but detailed architecture backbone in a pragmatic arc42/C4 style:`,
13209
+ " - Architecture classification (monolith, modular monolith, microservices, serverless, hybrid) with evidence.",
13210
+ " - A short consumer note explaining that ARCHITECTURE is the doc for refactors, boundary decisions, ADR work, and design-system governance.",
13211
+ " - System purpose, constraints, and architectural drivers.",
13212
+ " - Bounded contexts with ownership boundaries mapped to directories.",
13213
+ " - Major building blocks as a table or Mermaid C4 diagram with responsibilities.",
13214
+ " - Dependency rules: what can import what, forbidden coupling, and layering policy.",
13215
+ " - Data and integration boundaries with protocol/format details.",
13216
+ " - Runtime flows as Mermaid sequence diagrams for the top 2-3 critical paths.",
13217
+ " - Crosscutting concerns: logging, auth, error handling, i18n patterns with repo-path evidence.",
13218
+ " - Quality requirements derived from the codebase (performance budgets, test coverage, accessibility).",
13219
+ " - Known risks and tech debt visible in the codebase (TODOs, deprecated deps, missing tests).",
13220
+ " - Deployment/operability notes.",
13221
+ " - Testing/debugging strategy with concrete test commands and coverage tooling.",
13222
+ " - A dedicated folder-structure guide listing every important directory, what it owns, and contributor rules.",
13223
+ "",
13224
+ `9. In ${techPath}, write the developer-facing technical map that an AI agent can use to start working immediately:`,
13225
+ " - Stack snapshot as a table (runtime, language, framework, version if discoverable).",
13226
+ " - A short consumer note explaining that TECH is the doc for build, run, test, debug, CI/CD, and tooling execution.",
13227
+ " - Repository layout: directory tree with one-line purpose per directory.",
13228
+ " - Entrypoints: the exact files that bootstrap each app/service/CLI.",
13229
+ " - Key commands: the exact shell commands for bootstrap, build, test, lint, format, run, and deploy. Validate that these commands actually exist in the project manifests. Document required order and preconditions.",
13230
+ " - Build and validation: the validated sequence of commands to go from clean clone to passing CI locally, including environment prerequisites (Node version, Python version, Docker, etc.).",
13231
+ " - CI/CD pipeline: describe the CI/CD workflow files, their triggers, and what checks must pass before merge.",
13232
+ " - Runtime data stores and migration commands.",
13233
+ " - External services and integration surfaces with protocol details.",
13234
+ " - Environment and config surfaces: list every env var the app reads, its purpose, default value if any, and whether it is required or optional.",
13235
+ " - MCP/tooling footprint if present.",
13236
+ " - Generated artifacts: files that are auto-generated and must not be hand-edited.",
13237
+ " - Error patterns and debugging: common error messages, their causes, and resolution steps discovered during inspection.",
13238
+ " - Change hotspots: files/directories that change most often or have the most coupling, so agents know where to look first.",
13239
+ " - Practical editing notes: conventions for naming, imports, test file placement, and PR hygiene.",
13240
+ "",
13241
+ `10. In ${domainMemoryPath}, write the domain memory topic doc:`,
13242
+ " - Core entities, bounded contexts, business terminology, and invariants.",
13243
+ " - A short consumer note explaining that this topic doc is for domain modeling and product-language alignment.",
13244
+ " - Which files or modules embody each important concept.",
13245
+ " - Ambiguous terminology or overloaded names that agents should avoid misusing.",
13246
+ "",
13247
+ `11. In ${runtimeMemoryPath}, write the runtime memory topic doc:`,
13248
+ " - Runtime topology, entrypoints, queues/jobs, background workers, schedules, and deployment-time assumptions.",
13249
+ " - A short consumer note explaining that this topic doc is for request flow, process lifecycle, workers, and deployment reasoning.",
13250
+ " - The shortest path to understand request flow and process lifecycle.",
13251
+ "",
13252
+ `12. In ${integrationsMemoryPath}, write the integrations memory topic doc:`,
13253
+ " - External services, APIs, auth boundaries, data contracts, webhook/event flows, and migration-sensitive integration notes.",
13254
+ " - A short consumer note explaining that this topic doc is for external-service, API, auth-boundary, and contract-sensitive work.",
13255
+ "",
13256
+ `13. In ${debuggingMemoryPath}, write the debugging memory topic doc:`,
13257
+ " - Common failures, hot logs, exact investigation commands, smoke checks, and repo-specific diagnostic shortcuts.",
13258
+ " - A short consumer note explaining that this topic doc is for triage, incident response, and debugging workflows.",
13259
+ "",
13260
+ "Consumer guidance contract:",
13261
+ "- Near the top of each foundation doc, include a short 'when to consult this doc' cue so future rules, workflows, agents, and skills can decide quickly whether they need that document.",
13262
+ "- In MEMORY.md, name the likely downstream consumers of each deeper doc using concrete route families such as planning/spec, architecture/refactor, build/test/debug, runtime/integration, and ADR work.",
13263
+ "- Keep MEMORY.md lean enough to be imported frequently. Prefer short bullets, compact tables only when necessary, and links outward instead of repeated explanations.",
13264
+ "",
13265
+ `14. ${techPath} should complement ${architecturePath}; do not repeat the same structure prose unless it helps a developer act faster.`,
13266
+ "",
13267
+ `15. Use exact required headings in ${memoryPath}: \`## Project Summary\`, \`## Load These Docs By Task\`, \`## Durable Facts\`, \`## Active Watchpoints\`.`,
13268
+ `16. Use exact required headings in ${productPath}: \`## Product Scope\`, \`## Product Purpose\`, \`## Primary Users And Operators\`, \`## Main Journeys\`, \`## Business Capabilities That Matter\`, \`## Operational Constraints\`, \`## Preservation Rules For Future Contributors\`, \`## Domain Glossary\`.`,
13269
+ `17. Use exact required headings in ${architecturePath}: \`## Architecture Type\`, \`## System Purpose\`, \`## Constraints And Architectural Drivers\`, \`## Repository Structure Guide\`, \`## Bounded Contexts\`, \`## Major Building Blocks\`, \`## Dependency Rules\`, \`## Data Boundaries\`, \`## Integration Boundaries\`, \`## Runtime Flows\`, \`## Crosscutting Concerns\`, \`## Quality Requirements\`, \`## Risks And Tech Debt\`, \`## Deployment And Operability\`, \`## Testing And Debugging Strategy\`, \`## Architectural Guidance\`.`,
13270
+ `18. Use exact required headings in ${techPath}: \`## Stack Snapshot\`, \`## Repository Layout\`, \`## Entrypoints\`, \`## Key Commands\`, \`## Build And Validation\`, \`## CI CD Pipeline\`, \`## Runtime Data Stores\`, \`## External Services And Integration Surfaces\`, \`## Environment And Config Surfaces\`, \`## Generated Artifacts To Respect\`, \`## Error Patterns And Debugging\`, \`## Change Hotspots\`, \`## Practical Editing Notes\`.`,
13271
+ `19. Use exact required headings in ${domainMemoryPath}: \`## Core Concepts\`, \`## Bounded Context Vocabulary\`, \`## Invariants To Preserve\`, \`## File Ownership Map\`.`,
13272
+ `20. Use exact required headings in ${runtimeMemoryPath}: \`## Runtime Topology\`, \`## Entrypoint Paths\`, \`## Background Work\`, \`## Deployment Assumptions\`.`,
13273
+ `21. Use exact required headings in ${integrationsMemoryPath}: \`## External Services\`, \`## Contracts And Schemas\`, \`## Auth And Trust Boundaries\`, \`## Change Risks\`.`,
13274
+ `22. Use exact required headings in ${debuggingMemoryPath}: \`## Fast Triage Paths\`, \`## Logs And Signals\`, \`## Known Failure Modes\`, \`## Verification Shortcuts\`.`,
13275
+ "",
13276
+ "23. Every major claim should be grounded in repository evidence. Mention concrete repo paths in the docs when a structural claim would otherwise be ambiguous.",
13277
+ "24. Avoid placeholder filler, generic checklists, and duplicated content across files. Each doc should have a clear job.",
13278
+ "25. Do not create ROADMAP.md, ENGINEERING_RULES.md, or other extra docs unless the prompt explicitly asks for them.",
13212
13279
  researchMode === "never"
13213
- ? "17. Stay repo-only. Do not use outside research."
13214
- : "17. Use repo evidence first. Use official docs when needed. Treat Reddit or community sources only as labeled secondary evidence.",
13280
+ ? "26. Stay repo-only. Do not use outside research."
13281
+ : "26. Use repo evidence first. Use official docs when needed. Treat Reddit or community sources only as labeled secondary evidence.",
13215
13282
  researchMode === "always"
13216
- ? `18. Include an external research evidence subsection in ${techPath} with clearly labeled primary and secondary evidence.`
13217
- : "18. Include external research notes only if they materially informed the architecture update.",
13218
- `19. If the project clearly follows Clean Architecture, feature-first modules, DDD, modular monolith, or another stable structure, make that explicit in ${architecturePath} with evidence from the repo.`,
13219
- `20. Ensure ${adrReadmePath} and ${adrTemplatePath} exist as ADR entrypoints, but keep them lean.`,
13283
+ ? `27. Include an external research evidence subsection in ${techPath} with clearly labeled primary and secondary evidence.`
13284
+ : "27. Include external research notes only if they materially informed the architecture update.",
13285
+ `28. If the project clearly follows Clean Architecture, feature-first modules, DDD, modular monolith, or another stable structure, make that explicit in ${architecturePath} with evidence from the repo.`,
13286
+ `29. Ensure ${adrReadmePath} and ${adrTemplatePath} exist as ADR entrypoints, but keep them lean.`,
13287
+ "30. In all docs, when referencing other foundation docs, use relative markdown links: `[ARCHITECTURE.md](docs/foundation/ARCHITECTURE.md)`. This lets AI agents and humans navigate between docs.",
13288
+ "31. Validate all Mermaid diagram syntax before writing. Each diagram must render without errors. Use simple node IDs (alphanumeric, no special characters) and quote labels containing spaces.",
13289
+ "32. For each key command documented, note the expected exit code (0 for success) and any common failure modes. This helps AI agents validate their own changes.",
13290
+ "",
13291
+ "Platform context-loading awareness (these docs will be @imported into agent rule files):",
13292
+ "- Claude loads CLAUDE.md at session start via @file imports; each imported doc should be concise and self-contained.",
13293
+ "- Gemini loads GEMINI.md hierarchically with JIT context; structure docs with clear H2 headings so sections are independently useful.",
13294
+ "- Antigravity benefits from the same hierarchical structure because `.agents/rules/GEMINI.md` should point to a small durable memory index, not dump every deep reference by default.",
13295
+ "- Codex concatenates AGENTS.md files root-to-CWD with a default 32 KiB combined limit; keep total foundation doc prose lean.",
13296
+ "- Copilot loads copilot-instructions.md automatically; headings and inline code markers aid discoverability.",
13297
+ "- `ENGINEERING_RULES.md` and platform rule files should treat MEMORY.md as the first-stop shared memory index and load deeper docs only on demand.",
13298
+ "- Target each individual foundation doc under 300 lines so it stays effective when imported into any platform's context window.",
13299
+ "- Treat MEMORY.md as the tightest budget document in the set. It should remain substantially shorter than PRODUCT.md, ARCHITECTURE.md, or TECH.md.",
13300
+ "- Front-load the most actionable information (commands, paths, constraints) in each doc; put supplementary detail later.",
13220
13301
  "",
13221
13302
  "Return one JSON object on the last line with this shape:",
13222
- `{"files_written":["${productPath}","${architecturePath}","${techPath}","${adrReadmePath}","${adrTemplatePath}"],"research_used":false,"gaps":[],"next_actions":[]}`,
13303
+ `{"files_written":["${memoryPath}","${productPath}","${architecturePath}","${techPath}","${domainMemoryPath}","${runtimeMemoryPath}","${integrationsMemoryPath}","${debuggingMemoryPath}","${adrReadmePath}","${adrTemplatePath}"],"research_used":false,"gaps":[],"next_actions":[]}`,
13223
13304
  "",
13224
13305
  "Do not emit placeholder TODOs in the managed sections.",
13225
13306
  ].join("\n");
13226
13307
  }
13227
13308
 
13309
+ let architectureExecFileCaptureOverride = null;
13310
+ let architectureSpawnCaptureOverride = null;
13311
+ const WINDOWS_COMMAND_EXTENSION_PREFERENCE = [
13312
+ ".exe",
13313
+ ".cmd",
13314
+ ".bat",
13315
+ ".com",
13316
+ "",
13317
+ ];
13318
+
13319
+ export function __setArchitectureCommandCaptureForTests(overrides = {}) {
13320
+ architectureExecFileCaptureOverride =
13321
+ overrides.execFileCapture || architectureExecFileCaptureOverride;
13322
+ architectureSpawnCaptureOverride =
13323
+ overrides.spawnCapture || architectureSpawnCaptureOverride;
13324
+ }
13325
+
13326
+ export function __resetArchitectureCommandCaptureForTests() {
13327
+ architectureExecFileCaptureOverride = null;
13328
+ architectureSpawnCaptureOverride = null;
13329
+ }
13330
+
13331
+ function getEnvValueCaseInsensitive(env, key) {
13332
+ if (!env) return "";
13333
+ const match = Object.keys(env).find(
13334
+ (candidate) => candidate.toLowerCase() === key.toLowerCase(),
13335
+ );
13336
+ return match ? String(env[match] || "") : "";
13337
+ }
13338
+
13339
+ function rankWindowsCommandCandidate(command, candidate) {
13340
+ const requestedBase = path.parse(command).name.toLowerCase();
13341
+ const parsedCandidate = path.parse(candidate);
13342
+ if (parsedCandidate.name.toLowerCase() !== requestedBase) return -1;
13343
+ const ext = parsedCandidate.ext.toLowerCase();
13344
+ const rank = WINDOWS_COMMAND_EXTENSION_PREFERENCE.indexOf(ext);
13345
+ if (rank !== -1) {
13346
+ return WINDOWS_COMMAND_EXTENSION_PREFERENCE.length - rank;
13347
+ }
13348
+ return 0;
13349
+ }
13350
+
13351
+ function pickWindowsCommandCandidate(command, candidates) {
13352
+ const normalized = (candidates || [])
13353
+ .map((candidate) => String(candidate || "").trim())
13354
+ .filter(Boolean);
13355
+ if (normalized.length === 0) return null;
13356
+
13357
+ const ranked = normalized
13358
+ .map((candidate) => ({
13359
+ candidate,
13360
+ score: rankWindowsCommandCandidate(command, candidate),
13361
+ }))
13362
+ .sort((left, right) => right.score - left.score);
13363
+
13364
+ return ranked[0]?.candidate || normalized[0];
13365
+ }
13366
+
13367
+ function scanWindowsPathForCommand(command, env = process.env) {
13368
+ const pathValue = getEnvValueCaseInsensitive(env, "PATH");
13369
+ if (!pathValue) return null;
13370
+
13371
+ const pathEntries = pathValue
13372
+ .split(path.delimiter)
13373
+ .map((entry) => entry.trim())
13374
+ .filter(Boolean);
13375
+ const requestedExt = path.extname(command).toLowerCase();
13376
+ const pathExts = getEnvValueCaseInsensitive(env, "PATHEXT")
13377
+ .split(";")
13378
+ .map((ext) => ext.trim().toLowerCase())
13379
+ .filter(Boolean)
13380
+ .map((ext) => (ext.startsWith(".") ? ext : `.${ext}`));
13381
+ const suffixes = requestedExt
13382
+ ? [""]
13383
+ : Array.from(
13384
+ new Set([
13385
+ ...WINDOWS_COMMAND_EXTENSION_PREFERENCE,
13386
+ ...pathExts,
13387
+ ]),
13388
+ );
13389
+ const candidates = [];
13390
+
13391
+ for (const entry of pathEntries) {
13392
+ const basePath = path.join(entry, command);
13393
+ if (requestedExt && existsSync(basePath)) {
13394
+ candidates.push(basePath);
13395
+ continue;
13396
+ }
13397
+ for (const suffix of suffixes) {
13398
+ const candidate = suffix ? `${basePath}${suffix}` : basePath;
13399
+ if (existsSync(candidate)) {
13400
+ candidates.push(candidate);
13401
+ }
13402
+ }
13403
+ }
13404
+
13405
+ return pickWindowsCommandCandidate(command, candidates);
13406
+ }
13407
+
13408
+ export function __pickWindowsCommandCandidateForTests(command, candidates) {
13409
+ return pickWindowsCommandCandidate(command, candidates);
13410
+ }
13411
+
13412
+ export function __scanWindowsPathForCommandForTests(command, env) {
13413
+ return scanWindowsPathForCommand(command, env);
13414
+ }
13415
+
13228
13416
  async function execFileCapture(command, args, options = {}) {
13417
+ if (architectureExecFileCaptureOverride) {
13418
+ return await architectureExecFileCaptureOverride(command, args, options);
13419
+ }
13420
+ const resolvedCommand =
13421
+ process.platform === "win32"
13422
+ ? await resolveWindowsCommand(command, options.env)
13423
+ : command;
13424
+ if (
13425
+ process.platform === "win32" &&
13426
+ /\.(cmd|bat)$/i.test(resolvedCommand)
13427
+ ) {
13428
+ return await spawnCapture(resolvedCommand, args, {
13429
+ ...options,
13430
+ useShell: true,
13431
+ });
13432
+ }
13229
13433
  try {
13230
- const result = await execFile(command, args, {
13434
+ const result = await execFile(resolvedCommand, args, {
13231
13435
  ...options,
13232
13436
  maxBuffer: 8 * 1024 * 1024,
13233
13437
  });
@@ -13238,7 +13442,9 @@ async function execFileCapture(command, args, options = {}) {
13238
13442
  };
13239
13443
  } catch (error) {
13240
13444
  if (error?.code === "ENOENT") {
13241
- throw new Error(`Required CLI '${command}' is not installed or not on PATH.`);
13445
+ throw new Error(
13446
+ `Required CLI '${command}' is not installed or not on PATH.`,
13447
+ );
13242
13448
  }
13243
13449
  return {
13244
13450
  ok: false,
@@ -13249,14 +13455,56 @@ async function execFileCapture(command, args, options = {}) {
13249
13455
  }
13250
13456
  }
13251
13457
 
13458
+ async function resolveWindowsCommand(command, env = process.env) {
13459
+ if (process.platform !== "win32") return command;
13460
+ if (path.isAbsolute(command) || /[\\/]/.test(command)) return command;
13461
+ const pathCandidate = scanWindowsPathForCommand(command, env);
13462
+ try {
13463
+ const result = await execFile("where.exe", [command], {
13464
+ windowsHide: true,
13465
+ maxBuffer: 1024 * 1024,
13466
+ });
13467
+ const candidates = String(result.stdout || "")
13468
+ .split(/\r?\n/)
13469
+ .map((line) => line.trim())
13470
+ .filter(Boolean);
13471
+ const resolved = pickWindowsCommandCandidate(command, candidates);
13472
+ if (resolved) return resolved;
13473
+ } catch (error) {
13474
+ if (error?.code === "ENOENT") {
13475
+ if (pathCandidate) return pathCandidate;
13476
+ throw new Error(`Required CLI '${command}' is not installed or not on PATH.`);
13477
+ }
13478
+ if (pathCandidate) return pathCandidate;
13479
+ }
13480
+ if (pathCandidate) return pathCandidate;
13481
+ const missingError = new Error(
13482
+ `Required CLI '${command}' is not installed or not on PATH.`,
13483
+ );
13484
+ missingError.code = "ENOENT";
13485
+ throw missingError;
13486
+ }
13487
+
13252
13488
  async function spawnCapture(command, args, options = {}) {
13253
- const { cwd, env, streamOutput = false } = options;
13489
+ if (architectureSpawnCaptureOverride) {
13490
+ return await architectureSpawnCaptureOverride(command, args, options);
13491
+ }
13492
+ const { cwd, env, streamOutput = false, useShell } = options;
13493
+ const resolvedCommand =
13494
+ process.platform === "win32"
13495
+ ? await resolveWindowsCommand(command, env)
13496
+ : command;
13497
+ const shell =
13498
+ typeof useShell === "boolean"
13499
+ ? useShell
13500
+ : process.platform === "win32" && /\.(cmd|bat)$/i.test(resolvedCommand);
13254
13501
  return await new Promise((resolve, reject) => {
13255
13502
  let stdout = "";
13256
13503
  let stderr = "";
13257
- const child = spawn(command, args, {
13504
+ const child = spawn(resolvedCommand, args, {
13258
13505
  cwd,
13259
13506
  env,
13507
+ shell,
13260
13508
  stdio: ["ignore", "pipe", "pipe"],
13261
13509
  });
13262
13510
 
@@ -13275,7 +13523,9 @@ async function spawnCapture(command, args, options = {}) {
13275
13523
  child.on("error", (error) => {
13276
13524
  if (error?.code === "ENOENT") {
13277
13525
  reject(
13278
- new Error(`Required CLI '${command}' is not installed or not on PATH.`),
13526
+ new Error(
13527
+ `Required CLI '${command}' is not installed or not on PATH.`,
13528
+ ),
13279
13529
  );
13280
13530
  return;
13281
13531
  }
@@ -13299,7 +13549,7 @@ function explainArchitectureBuildFailure(platform, execution) {
13299
13549
  );
13300
13550
  const notes = [];
13301
13551
 
13302
- if (platform === "gemini") {
13552
+ if (platform === "gemini" || platform === "antigravity") {
13303
13553
  if (
13304
13554
  combined.includes("Error during discovery for MCP server") ||
13305
13555
  combined.includes("[MCP error]")
@@ -13379,7 +13629,7 @@ async function probeArchitectureAdapter(platform, cwd) {
13379
13629
  };
13380
13630
  }
13381
13631
 
13382
- if (platform === "gemini") {
13632
+ if (platform === "gemini" || platform === "antigravity") {
13383
13633
  const help = await execFileCapture("gemini", ["--help"], { cwd });
13384
13634
  const helpText = `${help.stdout}\n${help.stderr}`.trim();
13385
13635
  const promptFlag = helpText.includes("--prompt")
@@ -13543,6 +13793,11 @@ async function collapseDuplicateTaggedBlocks({
13543
13793
  }
13544
13794
 
13545
13795
  async function normalizeArchitectureBuildOutputs(scaffold) {
13796
+ await collapseDuplicateTaggedBlocks({
13797
+ targetPath: scaffold.memoryPath,
13798
+ startPattern: MEMORY_FOUNDATION_BLOCK_START_RE,
13799
+ endPattern: MEMORY_FOUNDATION_BLOCK_END_RE,
13800
+ });
13546
13801
  await collapseDuplicateTaggedBlocks({
13547
13802
  targetPath: scaffold.productPath,
13548
13803
  startPattern: PRODUCT_FOUNDATION_BLOCK_START_RE,
@@ -13558,28 +13813,76 @@ async function normalizeArchitectureBuildOutputs(scaffold) {
13558
13813
  startPattern: TECH_ARCHITECTURE_BLOCK_START_RE,
13559
13814
  endPattern: TECH_ARCHITECTURE_BLOCK_END_RE,
13560
13815
  });
13816
+ for (const targetPath of [
13817
+ scaffold.domainMemoryPath,
13818
+ scaffold.runtimeMemoryPath,
13819
+ scaffold.integrationsMemoryPath,
13820
+ scaffold.debuggingMemoryPath,
13821
+ ]) {
13822
+ await collapseDuplicateTaggedBlocks({
13823
+ targetPath,
13824
+ startPattern: MEMORY_TOPIC_BLOCK_START_RE,
13825
+ endPattern: MEMORY_TOPIC_BLOCK_END_RE,
13826
+ });
13827
+ }
13561
13828
  }
13562
13829
 
13563
13830
  async function readArchitectureDriftStatus(workspaceRoot, snapshot) {
13564
- const productPath = path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "PRODUCT.md");
13831
+ const memoryPath = path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "MEMORY.md");
13832
+ const productPath = path.join(
13833
+ workspaceRoot,
13834
+ FOUNDATION_DOCS_DIR,
13835
+ "PRODUCT.md",
13836
+ );
13565
13837
  const architecturePath = path.join(
13566
13838
  workspaceRoot,
13567
13839
  FOUNDATION_DOCS_DIR,
13568
13840
  "ARCHITECTURE.md",
13569
13841
  );
13570
13842
  const techPath = path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "TECH.md");
13571
- const adrReadmePath = path.join(workspaceRoot, FOUNDATION_ADR_DIR, "README.md");
13843
+ const domainMemoryPath = path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "domain.md");
13844
+ const runtimeMemoryPath = path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "runtime.md");
13845
+ const integrationsMemoryPath = path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "integrations.md");
13846
+ const debuggingMemoryPath = path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "debugging.md");
13847
+ const adrReadmePath = path.join(
13848
+ workspaceRoot,
13849
+ FOUNDATION_ADR_DIR,
13850
+ "README.md",
13851
+ );
13572
13852
  const metadataPath = path.join(
13573
13853
  workspaceRoot,
13574
13854
  ".cbx",
13575
13855
  ARCHITECTURE_BUILD_METADATA_FILENAME,
13576
13856
  );
13857
+ const memoryExists = await pathExists(memoryPath);
13577
13858
  const productExists = await pathExists(productPath);
13578
13859
  const architectureExists = await pathExists(architecturePath);
13579
13860
  const techExists = await pathExists(techPath);
13861
+ const topicPaths = [
13862
+ domainMemoryPath,
13863
+ runtimeMemoryPath,
13864
+ integrationsMemoryPath,
13865
+ debuggingMemoryPath,
13866
+ ];
13580
13867
  const adrReadmeExists = await pathExists(adrReadmePath);
13581
13868
 
13582
13869
  const findings = [];
13870
+ if (!memoryExists) {
13871
+ findings.push(`${FOUNDATION_DOCS_DIR}/MEMORY.md is missing.`);
13872
+ } else {
13873
+ const content = await readFile(memoryPath, "utf8");
13874
+ if (
13875
+ !extractTaggedMarkerAttribute(
13876
+ content,
13877
+ MEMORY_FOUNDATION_BLOCK_START_RE,
13878
+ "profile",
13879
+ )
13880
+ ) {
13881
+ findings.push(
13882
+ `${FOUNDATION_DOCS_DIR}/MEMORY.md is missing the managed memory block.`,
13883
+ );
13884
+ }
13885
+ }
13583
13886
  let actualProductHash = null;
13584
13887
  let actualArchitectureHash = null;
13585
13888
  let actualTechHash = null;
@@ -13635,6 +13938,24 @@ async function readArchitectureDriftStatus(workspaceRoot, snapshot) {
13635
13938
  if (!adrReadmeExists) {
13636
13939
  findings.push(`${FOUNDATION_ADR_DIR}/README.md is missing.`);
13637
13940
  }
13941
+ for (const topicPath of topicPaths) {
13942
+ const exists = await pathExists(topicPath);
13943
+ const relativePath = toPosixPath(path.relative(workspaceRoot, topicPath));
13944
+ if (!exists) {
13945
+ findings.push(`${relativePath} is missing.`);
13946
+ continue;
13947
+ }
13948
+ const content = await readFile(topicPath, "utf8");
13949
+ if (
13950
+ !extractTaggedMarkerAttribute(
13951
+ content,
13952
+ MEMORY_TOPIC_BLOCK_START_RE,
13953
+ "profile",
13954
+ )
13955
+ ) {
13956
+ findings.push(`${relativePath} is missing the managed memory topic block.`);
13957
+ }
13958
+ }
13638
13959
 
13639
13960
  const metadata = await readJsonFileIfExists(metadataPath);
13640
13961
  if (!metadata.exists) {
@@ -13644,6 +13965,7 @@ async function readArchitectureDriftStatus(workspaceRoot, snapshot) {
13644
13965
  return {
13645
13966
  stale: findings.length > 0,
13646
13967
  findings,
13968
+ memoryPath,
13647
13969
  productPath,
13648
13970
  architecturePath,
13649
13971
  techPath,
@@ -13677,7 +13999,7 @@ async function runBuildArchitecture(options) {
13677
13999
  console.log(`Workspace: ${toPosixPath(workspaceRoot)}`);
13678
14000
  console.log(`Status: ${drift.stale ? "stale" : "fresh"}`);
13679
14001
  console.log(
13680
- `Backbone docs: ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, ${FOUNDATION_ADR_DIR}/README.md`,
14002
+ `Backbone docs: ${FOUNDATION_DOCS_DIR}/MEMORY.md, ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, ${FOUNDATION_MEMORY_DIR}/*.md, ${FOUNDATION_ADR_DIR}/README.md`,
13681
14003
  );
13682
14004
  if (drift.findings.length > 0) {
13683
14005
  console.log("Findings:");
@@ -13691,9 +14013,14 @@ async function runBuildArchitecture(options) {
13691
14013
  }
13692
14014
 
13693
14015
  const managedFilePaths = [
14016
+ path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "MEMORY.md"),
13694
14017
  path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "PRODUCT.md"),
13695
14018
  path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "ARCHITECTURE.md"),
13696
14019
  path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "TECH.md"),
14020
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "domain.md"),
14021
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "runtime.md"),
14022
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "integrations.md"),
14023
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "debugging.md"),
13697
14024
  path.join(workspaceRoot, FOUNDATION_ADR_DIR, "README.md"),
13698
14025
  path.join(workspaceRoot, FOUNDATION_ADR_DIR, "0000-template.md"),
13699
14026
  ];
@@ -13733,9 +14060,14 @@ async function runBuildArchitecture(options) {
13733
14060
  const adapter = await probeArchitectureAdapter(platform, workspaceRoot);
13734
14061
  const args = adapter.buildInvocation(prompt);
13735
14062
  const managedTargets = [
14063
+ path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "MEMORY.md"),
13736
14064
  path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "PRODUCT.md"),
13737
14065
  path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "ARCHITECTURE.md"),
13738
14066
  path.join(workspaceRoot, FOUNDATION_DOCS_DIR, "TECH.md"),
14067
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "domain.md"),
14068
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "runtime.md"),
14069
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "integrations.md"),
14070
+ path.join(workspaceRoot, FOUNDATION_MEMORY_DIR, "debugging.md"),
13739
14071
  path.join(workspaceRoot, FOUNDATION_ADR_DIR, "README.md"),
13740
14072
  path.join(workspaceRoot, FOUNDATION_ADR_DIR, "0000-template.md"),
13741
14073
  ].map((filePath) => toPosixPath(filePath));
@@ -13757,9 +14089,7 @@ async function runBuildArchitecture(options) {
13757
14089
  console.log(`Workspace: ${toPosixPath(workspaceRoot)}`);
13758
14090
  console.log(`Adapter: ${adapter.binary}`);
13759
14091
  console.log(`Research mode: ${researchMode}`);
13760
- console.log(
13761
- `Managed targets: ${summary.managedTargets.join(", ")}`,
13762
- );
14092
+ console.log(`Managed targets: ${summary.managedTargets.join(", ")}`);
13763
14093
  console.log(`Skill bundle: ${skillBundle.join(", ")}`);
13764
14094
  console.log(`Invocation: ${[adapter.binary, ...args].join(" ")}`);
13765
14095
  }
@@ -13793,9 +14123,11 @@ async function runBuildArchitecture(options) {
13793
14123
  .map((filePath) => toPosixPath(path.relative(workspaceRoot, filePath)));
13794
14124
 
13795
14125
  const techContent =
13796
- filesAfter[scaffold.techMdPath] ?? (await readFile(scaffold.techMdPath, "utf8"));
14126
+ filesAfter[scaffold.techMdPath] ??
14127
+ (await readFile(scaffold.techMdPath, "utf8"));
13797
14128
  const productContent =
13798
- filesAfter[scaffold.productPath] ?? (await readFile(scaffold.productPath, "utf8"));
14129
+ filesAfter[scaffold.productPath] ??
14130
+ (await readFile(scaffold.productPath, "utf8"));
13799
14131
  const architectureContent =
13800
14132
  filesAfter[scaffold.architectureDocPath] ??
13801
14133
  (await readFile(scaffold.architectureDocPath, "utf8"));
@@ -13809,9 +14141,14 @@ async function runBuildArchitecture(options) {
13809
14141
  platform,
13810
14142
  researchMode,
13811
14143
  managedDocs: [
14144
+ `${FOUNDATION_DOCS_DIR}/MEMORY.md`,
13812
14145
  `${FOUNDATION_DOCS_DIR}/PRODUCT.md`,
13813
14146
  `${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md`,
13814
14147
  `${FOUNDATION_DOCS_DIR}/TECH.md`,
14148
+ `${FOUNDATION_MEMORY_DIR}/domain.md`,
14149
+ `${FOUNDATION_MEMORY_DIR}/runtime.md`,
14150
+ `${FOUNDATION_MEMORY_DIR}/integrations.md`,
14151
+ `${FOUNDATION_MEMORY_DIR}/debugging.md`,
13815
14152
  `${FOUNDATION_ADR_DIR}/README.md`,
13816
14153
  `${FOUNDATION_ADR_DIR}/0000-template.md`,
13817
14154
  ],
@@ -13850,7 +14187,7 @@ async function runBuildArchitecture(options) {
13850
14187
  console.log(`Adapter: ${adapter.binary}`);
13851
14188
  console.log(`Workspace: ${toPosixPath(workspaceRoot)}`);
13852
14189
  console.log(
13853
- `Managed docs: ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md`,
14190
+ `Managed docs: ${FOUNDATION_DOCS_DIR}/MEMORY.md, ${FOUNDATION_DOCS_DIR}/PRODUCT.md, ${FOUNDATION_DOCS_DIR}/ARCHITECTURE.md, ${FOUNDATION_DOCS_DIR}/TECH.md, ${FOUNDATION_MEMORY_DIR}/*.md`,
13854
14191
  );
13855
14192
  console.log(
13856
14193
  `ADR scaffold: ${FOUNDATION_ADR_DIR}/README.md, ${FOUNDATION_ADR_DIR}/0000-template.md`,
@@ -13891,12 +14228,7 @@ function normalizeInitPlatforms(value) {
13891
14228
  }
13892
14229
 
13893
14230
  function normalizeInitMcpSelections(value) {
13894
- const allowed = new Set([
13895
- "cubis-foundry",
13896
- "postman",
13897
- "stitch",
13898
- "playwright",
13899
- ]);
14231
+ const allowed = new Set(["cubis-foundry", "postman", "stitch", "playwright"]);
13900
14232
  const items = Array.isArray(value) ? value : parseCsvOption(value);
13901
14233
  const normalized = [];
13902
14234
  for (const item of items) {
@@ -14120,8 +14452,6 @@ async function runInitWizard(options) {
14120
14452
  bundleId: installOutcome.bundleId,
14121
14453
  installed: installOutcome.installResult.installed,
14122
14454
  skipped: installOutcome.installResult.skipped,
14123
- generatedWrapperSkills:
14124
- installOutcome.installResult.generatedWrapperSkills,
14125
14455
  duplicateSkillCleanup:
14126
14456
  installOutcome.installResult.duplicateSkillCleanup,
14127
14457
  sanitizedSkills: installOutcome.installResult.sanitizedSkills,