squadfoundry 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/AGENTS.md +76 -0
  2. package/PROJECT.md +79 -0
  3. package/README.md +255 -0
  4. package/dist/orchestrator/adapters/context/IContextAdapter.d.ts +65 -0
  5. package/dist/orchestrator/adapters/context/IContextAdapter.d.ts.map +1 -0
  6. package/dist/orchestrator/adapters/context/IContextAdapter.js +12 -0
  7. package/dist/orchestrator/adapters/context/IContextAdapter.js.map +1 -0
  8. package/dist/orchestrator/adapters/context/filesystem.context-adapter.d.ts +33 -0
  9. package/dist/orchestrator/adapters/context/filesystem.context-adapter.d.ts.map +1 -0
  10. package/dist/orchestrator/adapters/context/filesystem.context-adapter.js +179 -0
  11. package/dist/orchestrator/adapters/context/filesystem.context-adapter.js.map +1 -0
  12. package/dist/orchestrator/adapters/deploy/IDeployAdapter.d.ts +78 -0
  13. package/dist/orchestrator/adapters/deploy/IDeployAdapter.d.ts.map +1 -0
  14. package/dist/orchestrator/adapters/deploy/IDeployAdapter.js +14 -0
  15. package/dist/orchestrator/adapters/deploy/IDeployAdapter.js.map +1 -0
  16. package/dist/orchestrator/adapters/deploy/vercel.adapter.d.ts +31 -0
  17. package/dist/orchestrator/adapters/deploy/vercel.adapter.d.ts.map +1 -0
  18. package/dist/orchestrator/adapters/deploy/vercel.adapter.js +83 -0
  19. package/dist/orchestrator/adapters/deploy/vercel.adapter.js.map +1 -0
  20. package/dist/orchestrator/adapters/host/IHostAdapter.d.ts +89 -0
  21. package/dist/orchestrator/adapters/host/IHostAdapter.d.ts.map +1 -0
  22. package/dist/orchestrator/adapters/host/IHostAdapter.js +10 -0
  23. package/dist/orchestrator/adapters/host/IHostAdapter.js.map +1 -0
  24. package/dist/orchestrator/adapters/host/anthropic.adapter.d.ts +27 -0
  25. package/dist/orchestrator/adapters/host/anthropic.adapter.d.ts.map +1 -0
  26. package/dist/orchestrator/adapters/host/anthropic.adapter.js +118 -0
  27. package/dist/orchestrator/adapters/host/anthropic.adapter.js.map +1 -0
  28. package/dist/orchestrator/adapters/host/antigravity.adapter.d.ts +53 -0
  29. package/dist/orchestrator/adapters/host/antigravity.adapter.d.ts.map +1 -0
  30. package/dist/orchestrator/adapters/host/antigravity.adapter.js +148 -0
  31. package/dist/orchestrator/adapters/host/antigravity.adapter.js.map +1 -0
  32. package/dist/orchestrator/adapters/host/claude-code.adapter.d.ts +13 -0
  33. package/dist/orchestrator/adapters/host/claude-code.adapter.d.ts.map +1 -0
  34. package/dist/orchestrator/adapters/host/claude-code.adapter.js +27 -0
  35. package/dist/orchestrator/adapters/host/claude-code.adapter.js.map +1 -0
  36. package/dist/orchestrator/adapters/host/command-model-invoker.d.ts +8 -0
  37. package/dist/orchestrator/adapters/host/command-model-invoker.d.ts.map +1 -0
  38. package/dist/orchestrator/adapters/host/command-model-invoker.js +46 -0
  39. package/dist/orchestrator/adapters/host/command-model-invoker.js.map +1 -0
  40. package/dist/orchestrator/adapters/host/ide.adapter.d.ts +61 -0
  41. package/dist/orchestrator/adapters/host/ide.adapter.d.ts.map +1 -0
  42. package/dist/orchestrator/adapters/host/ide.adapter.js +173 -0
  43. package/dist/orchestrator/adapters/host/ide.adapter.js.map +1 -0
  44. package/dist/orchestrator/adapters/host/local.adapter.d.ts +26 -0
  45. package/dist/orchestrator/adapters/host/local.adapter.d.ts.map +1 -0
  46. package/dist/orchestrator/adapters/host/local.adapter.js +82 -0
  47. package/dist/orchestrator/adapters/host/local.adapter.js.map +1 -0
  48. package/dist/orchestrator/adapters/host/openai.adapter.d.ts +26 -0
  49. package/dist/orchestrator/adapters/host/openai.adapter.d.ts.map +1 -0
  50. package/dist/orchestrator/adapters/host/openai.adapter.js +77 -0
  51. package/dist/orchestrator/adapters/host/openai.adapter.js.map +1 -0
  52. package/dist/orchestrator/adapters/host/opencode.adapter.d.ts +13 -0
  53. package/dist/orchestrator/adapters/host/opencode.adapter.d.ts.map +1 -0
  54. package/dist/orchestrator/adapters/host/opencode.adapter.js +27 -0
  55. package/dist/orchestrator/adapters/host/opencode.adapter.js.map +1 -0
  56. package/dist/orchestrator/adapters/model/IModelAdapter.d.ts +68 -0
  57. package/dist/orchestrator/adapters/model/IModelAdapter.d.ts.map +1 -0
  58. package/dist/orchestrator/adapters/model/IModelAdapter.js +11 -0
  59. package/dist/orchestrator/adapters/model/IModelAdapter.js.map +1 -0
  60. package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.d.ts +93 -0
  61. package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.d.ts.map +1 -0
  62. package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.js +10 -0
  63. package/dist/orchestrator/adapters/publishing/ISocialMediaAdapter.js.map +1 -0
  64. package/dist/orchestrator/adapters/publishing/instagram.adapter.d.ts +34 -0
  65. package/dist/orchestrator/adapters/publishing/instagram.adapter.d.ts.map +1 -0
  66. package/dist/orchestrator/adapters/publishing/instagram.adapter.js +105 -0
  67. package/dist/orchestrator/adapters/publishing/instagram.adapter.js.map +1 -0
  68. package/dist/orchestrator/adapters/tools/IToolAdapter.d.ts +52 -0
  69. package/dist/orchestrator/adapters/tools/IToolAdapter.d.ts.map +1 -0
  70. package/dist/orchestrator/adapters/tools/IToolAdapter.js +10 -0
  71. package/dist/orchestrator/adapters/tools/IToolAdapter.js.map +1 -0
  72. package/dist/orchestrator/adapters/vcs/IVCSAdapter.d.ts +89 -0
  73. package/dist/orchestrator/adapters/vcs/IVCSAdapter.d.ts.map +1 -0
  74. package/dist/orchestrator/adapters/vcs/IVCSAdapter.js +11 -0
  75. package/dist/orchestrator/adapters/vcs/IVCSAdapter.js.map +1 -0
  76. package/dist/orchestrator/adapters/vcs/github.adapter.d.ts +36 -0
  77. package/dist/orchestrator/adapters/vcs/github.adapter.d.ts.map +1 -0
  78. package/dist/orchestrator/adapters/vcs/github.adapter.js +110 -0
  79. package/dist/orchestrator/adapters/vcs/github.adapter.js.map +1 -0
  80. package/dist/orchestrator/artifacts/artifact-store.d.ts +47 -0
  81. package/dist/orchestrator/artifacts/artifact-store.d.ts.map +1 -0
  82. package/dist/orchestrator/artifacts/artifact-store.js +135 -0
  83. package/dist/orchestrator/artifacts/artifact-store.js.map +1 -0
  84. package/dist/orchestrator/builder/domain-classifier.d.ts +24 -0
  85. package/dist/orchestrator/builder/domain-classifier.d.ts.map +1 -0
  86. package/dist/orchestrator/builder/domain-classifier.js +156 -0
  87. package/dist/orchestrator/builder/domain-classifier.js.map +1 -0
  88. package/dist/orchestrator/builder/interview-questions.d.ts +13 -0
  89. package/dist/orchestrator/builder/interview-questions.d.ts.map +1 -0
  90. package/dist/orchestrator/builder/interview-questions.js +127 -0
  91. package/dist/orchestrator/builder/interview-questions.js.map +1 -0
  92. package/dist/orchestrator/builder/squad-builder.d.ts +53 -0
  93. package/dist/orchestrator/builder/squad-builder.d.ts.map +1 -0
  94. package/dist/orchestrator/builder/squad-builder.js +107 -0
  95. package/dist/orchestrator/builder/squad-builder.js.map +1 -0
  96. package/dist/orchestrator/builder/squad-generator.d.ts +33 -0
  97. package/dist/orchestrator/builder/squad-generator.d.ts.map +1 -0
  98. package/dist/orchestrator/builder/squad-generator.js +360 -0
  99. package/dist/orchestrator/builder/squad-generator.js.map +1 -0
  100. package/dist/orchestrator/cli/index.d.ts +3 -0
  101. package/dist/orchestrator/cli/index.d.ts.map +1 -0
  102. package/dist/orchestrator/cli/index.js +8 -0
  103. package/dist/orchestrator/cli/index.js.map +1 -0
  104. package/dist/orchestrator/context/context-index.d.ts +48 -0
  105. package/dist/orchestrator/context/context-index.d.ts.map +1 -0
  106. package/dist/orchestrator/context/context-index.js +116 -0
  107. package/dist/orchestrator/context/context-index.js.map +1 -0
  108. package/dist/orchestrator/context/context-loader.d.ts +49 -0
  109. package/dist/orchestrator/context/context-loader.d.ts.map +1 -0
  110. package/dist/orchestrator/context/context-loader.js +111 -0
  111. package/dist/orchestrator/context/context-loader.js.map +1 -0
  112. package/dist/orchestrator/core/guardrails.d.ts +33 -0
  113. package/dist/orchestrator/core/guardrails.d.ts.map +1 -0
  114. package/dist/orchestrator/core/guardrails.js +272 -0
  115. package/dist/orchestrator/core/guardrails.js.map +1 -0
  116. package/dist/orchestrator/core/state-machine.d.ts +65 -0
  117. package/dist/orchestrator/core/state-machine.d.ts.map +1 -0
  118. package/dist/orchestrator/core/state-machine.js +227 -0
  119. package/dist/orchestrator/core/state-machine.js.map +1 -0
  120. package/dist/orchestrator/core/types.d.ts +364 -0
  121. package/dist/orchestrator/core/types.d.ts.map +1 -0
  122. package/dist/orchestrator/core/types.js +10 -0
  123. package/dist/orchestrator/core/types.js.map +1 -0
  124. package/dist/orchestrator/index.d.ts +75 -0
  125. package/dist/orchestrator/index.d.ts.map +1 -0
  126. package/dist/orchestrator/index.js +64 -0
  127. package/dist/orchestrator/index.js.map +1 -0
  128. package/dist/orchestrator/mcp/server.d.ts +35 -0
  129. package/dist/orchestrator/mcp/server.d.ts.map +1 -0
  130. package/dist/orchestrator/mcp/server.js +378 -0
  131. package/dist/orchestrator/mcp/server.js.map +1 -0
  132. package/dist/orchestrator/runtime/agent-dispatcher.d.ts +25 -0
  133. package/dist/orchestrator/runtime/agent-dispatcher.d.ts.map +1 -0
  134. package/dist/orchestrator/runtime/agent-dispatcher.js +82 -0
  135. package/dist/orchestrator/runtime/agent-dispatcher.js.map +1 -0
  136. package/dist/orchestrator/runtime/approval-gate.d.ts +55 -0
  137. package/dist/orchestrator/runtime/approval-gate.d.ts.map +1 -0
  138. package/dist/orchestrator/runtime/approval-gate.js +104 -0
  139. package/dist/orchestrator/runtime/approval-gate.js.map +1 -0
  140. package/dist/orchestrator/runtime/handoff-manager.d.ts +29 -0
  141. package/dist/orchestrator/runtime/handoff-manager.d.ts.map +1 -0
  142. package/dist/orchestrator/runtime/handoff-manager.js +80 -0
  143. package/dist/orchestrator/runtime/handoff-manager.js.map +1 -0
  144. package/dist/orchestrator/runtime/job-manager.d.ts +39 -0
  145. package/dist/orchestrator/runtime/job-manager.d.ts.map +1 -0
  146. package/dist/orchestrator/runtime/job-manager.js +132 -0
  147. package/dist/orchestrator/runtime/job-manager.js.map +1 -0
  148. package/dist/orchestrator/runtime/squad-runtime.d.ts +70 -0
  149. package/dist/orchestrator/runtime/squad-runtime.d.ts.map +1 -0
  150. package/dist/orchestrator/runtime/squad-runtime.js +249 -0
  151. package/dist/orchestrator/runtime/squad-runtime.js.map +1 -0
  152. package/dist/orchestrator/shell/cli.d.ts +4 -0
  153. package/dist/orchestrator/shell/cli.d.ts.map +1 -0
  154. package/dist/orchestrator/shell/cli.js +27 -0
  155. package/dist/orchestrator/shell/cli.js.map +1 -0
  156. package/dist/orchestrator/shell/commands/create.command.d.ts +3 -0
  157. package/dist/orchestrator/shell/commands/create.command.d.ts.map +1 -0
  158. package/dist/orchestrator/shell/commands/create.command.js +41 -0
  159. package/dist/orchestrator/shell/commands/create.command.js.map +1 -0
  160. package/dist/orchestrator/shell/commands/edit.command.d.ts +3 -0
  161. package/dist/orchestrator/shell/commands/edit.command.d.ts.map +1 -0
  162. package/dist/orchestrator/shell/commands/edit.command.js +49 -0
  163. package/dist/orchestrator/shell/commands/edit.command.js.map +1 -0
  164. package/dist/orchestrator/shell/commands/hosts.command.d.ts +3 -0
  165. package/dist/orchestrator/shell/commands/hosts.command.d.ts.map +1 -0
  166. package/dist/orchestrator/shell/commands/hosts.command.js +27 -0
  167. package/dist/orchestrator/shell/commands/hosts.command.js.map +1 -0
  168. package/dist/orchestrator/shell/commands/init.command.d.ts +3 -0
  169. package/dist/orchestrator/shell/commands/init.command.d.ts.map +1 -0
  170. package/dist/orchestrator/shell/commands/init.command.js +13 -0
  171. package/dist/orchestrator/shell/commands/init.command.js.map +1 -0
  172. package/dist/orchestrator/shell/commands/list.command.d.ts +3 -0
  173. package/dist/orchestrator/shell/commands/list.command.d.ts.map +1 -0
  174. package/dist/orchestrator/shell/commands/list.command.js +18 -0
  175. package/dist/orchestrator/shell/commands/list.command.js.map +1 -0
  176. package/dist/orchestrator/shell/commands/run.command.d.ts +3 -0
  177. package/dist/orchestrator/shell/commands/run.command.d.ts.map +1 -0
  178. package/dist/orchestrator/shell/commands/run.command.js +71 -0
  179. package/dist/orchestrator/shell/commands/run.command.js.map +1 -0
  180. package/dist/orchestrator/shell/commands/status.command.d.ts +3 -0
  181. package/dist/orchestrator/shell/commands/status.command.d.ts.map +1 -0
  182. package/dist/orchestrator/shell/commands/status.command.js +29 -0
  183. package/dist/orchestrator/shell/commands/status.command.js.map +1 -0
  184. package/dist/orchestrator/shell/services/active-host-detector.service.d.ts +25 -0
  185. package/dist/orchestrator/shell/services/active-host-detector.service.d.ts.map +1 -0
  186. package/dist/orchestrator/shell/services/active-host-detector.service.js +128 -0
  187. package/dist/orchestrator/shell/services/active-host-detector.service.js.map +1 -0
  188. package/dist/orchestrator/shell/services/host-resolution.service.d.ts +42 -0
  189. package/dist/orchestrator/shell/services/host-resolution.service.d.ts.map +1 -0
  190. package/dist/orchestrator/shell/services/host-resolution.service.js +108 -0
  191. package/dist/orchestrator/shell/services/host-resolution.service.js.map +1 -0
  192. package/dist/orchestrator/shell/services/host-runtime.service.d.ts +23 -0
  193. package/dist/orchestrator/shell/services/host-runtime.service.d.ts.map +1 -0
  194. package/dist/orchestrator/shell/services/host-runtime.service.js +167 -0
  195. package/dist/orchestrator/shell/services/host-runtime.service.js.map +1 -0
  196. package/dist/orchestrator/shell/services/interview-host-bridge.service.d.ts +14 -0
  197. package/dist/orchestrator/shell/services/interview-host-bridge.service.d.ts.map +1 -0
  198. package/dist/orchestrator/shell/services/interview-host-bridge.service.js +16 -0
  199. package/dist/orchestrator/shell/services/interview-host-bridge.service.js.map +1 -0
  200. package/dist/orchestrator/shell/services/job-execution.service.d.ts +22 -0
  201. package/dist/orchestrator/shell/services/job-execution.service.d.ts.map +1 -0
  202. package/dist/orchestrator/shell/services/job-execution.service.js +39 -0
  203. package/dist/orchestrator/shell/services/job-execution.service.js.map +1 -0
  204. package/dist/orchestrator/shell/services/project-bootstrap.service.d.ts +6 -0
  205. package/dist/orchestrator/shell/services/project-bootstrap.service.d.ts.map +1 -0
  206. package/dist/orchestrator/shell/services/project-bootstrap.service.js +111 -0
  207. package/dist/orchestrator/shell/services/project-bootstrap.service.js.map +1 -0
  208. package/dist/orchestrator/shell/services/squad-scaffold.service.d.ts +3 -0
  209. package/dist/orchestrator/shell/services/squad-scaffold.service.d.ts.map +1 -0
  210. package/dist/orchestrator/shell/services/squad-scaffold.service.js +30 -0
  211. package/dist/orchestrator/shell/services/squad-scaffold.service.js.map +1 -0
  212. package/dist/tests/integration/instagram-squad.test.d.ts +8 -0
  213. package/dist/tests/integration/instagram-squad.test.d.ts.map +1 -0
  214. package/dist/tests/integration/instagram-squad.test.js +187 -0
  215. package/dist/tests/integration/instagram-squad.test.js.map +1 -0
  216. package/dist/tests/integration/shell/cli-run-host-native.test.d.ts +2 -0
  217. package/dist/tests/integration/shell/cli-run-host-native.test.d.ts.map +1 -0
  218. package/dist/tests/integration/shell/cli-run-host-native.test.js +42 -0
  219. package/dist/tests/integration/shell/cli-run-host-native.test.js.map +1 -0
  220. package/dist/tests/integration/software-squad.test.d.ts +8 -0
  221. package/dist/tests/integration/software-squad.test.d.ts.map +1 -0
  222. package/dist/tests/integration/software-squad.test.js +207 -0
  223. package/dist/tests/integration/software-squad.test.js.map +1 -0
  224. package/dist/tests/unit/artifact-store.test.d.ts +2 -0
  225. package/dist/tests/unit/artifact-store.test.d.ts.map +1 -0
  226. package/dist/tests/unit/artifact-store.test.js +137 -0
  227. package/dist/tests/unit/artifact-store.test.js.map +1 -0
  228. package/dist/tests/unit/context-loader.test.d.ts +2 -0
  229. package/dist/tests/unit/context-loader.test.d.ts.map +1 -0
  230. package/dist/tests/unit/context-loader.test.js +109 -0
  231. package/dist/tests/unit/context-loader.test.js.map +1 -0
  232. package/dist/tests/unit/docs/host-native-docs.test.d.ts +2 -0
  233. package/dist/tests/unit/docs/host-native-docs.test.d.ts.map +1 -0
  234. package/dist/tests/unit/docs/host-native-docs.test.js +18 -0
  235. package/dist/tests/unit/docs/host-native-docs.test.js.map +1 -0
  236. package/dist/tests/unit/guardrails.test.d.ts +2 -0
  237. package/dist/tests/unit/guardrails.test.d.ts.map +1 -0
  238. package/dist/tests/unit/guardrails.test.js +202 -0
  239. package/dist/tests/unit/guardrails.test.js.map +1 -0
  240. package/dist/tests/unit/host/host-adapter-contract.test.d.ts +2 -0
  241. package/dist/tests/unit/host/host-adapter-contract.test.d.ts.map +1 -0
  242. package/dist/tests/unit/host/host-adapter-contract.test.js +53 -0
  243. package/dist/tests/unit/host/host-adapter-contract.test.js.map +1 -0
  244. package/dist/tests/unit/host/ide.adapter.test.d.ts +2 -0
  245. package/dist/tests/unit/host/ide.adapter.test.d.ts.map +1 -0
  246. package/dist/tests/unit/host/ide.adapter.test.js +17 -0
  247. package/dist/tests/unit/host/ide.adapter.test.js.map +1 -0
  248. package/dist/tests/unit/host/native-ide-adapters.test.d.ts +2 -0
  249. package/dist/tests/unit/host/native-ide-adapters.test.d.ts.map +1 -0
  250. package/dist/tests/unit/host/native-ide-adapters.test.js +26 -0
  251. package/dist/tests/unit/host/native-ide-adapters.test.js.map +1 -0
  252. package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.d.ts +2 -0
  253. package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.d.ts.map +1 -0
  254. package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.js +128 -0
  255. package/dist/tests/unit/runtime/squad-runtime-host-metadata.test.js.map +1 -0
  256. package/dist/tests/unit/shell/active-host-detector.test.d.ts +2 -0
  257. package/dist/tests/unit/shell/active-host-detector.test.d.ts.map +1 -0
  258. package/dist/tests/unit/shell/active-host-detector.test.js +85 -0
  259. package/dist/tests/unit/shell/active-host-detector.test.js.map +1 -0
  260. package/dist/tests/unit/shell/host-resolution.service.test.d.ts +2 -0
  261. package/dist/tests/unit/shell/host-resolution.service.test.d.ts.map +1 -0
  262. package/dist/tests/unit/shell/host-resolution.service.test.js +252 -0
  263. package/dist/tests/unit/shell/host-resolution.service.test.js.map +1 -0
  264. package/dist/tests/unit/shell/interview-host-bridge.test.d.ts +2 -0
  265. package/dist/tests/unit/shell/interview-host-bridge.test.d.ts.map +1 -0
  266. package/dist/tests/unit/shell/interview-host-bridge.test.js +58 -0
  267. package/dist/tests/unit/shell/interview-host-bridge.test.js.map +1 -0
  268. package/dist/tests/unit/shell/project-bootstrap.service.test.d.ts +2 -0
  269. package/dist/tests/unit/shell/project-bootstrap.service.test.d.ts.map +1 -0
  270. package/dist/tests/unit/shell/project-bootstrap.service.test.js +58 -0
  271. package/dist/tests/unit/shell/project-bootstrap.service.test.js.map +1 -0
  272. package/dist/tests/unit/shell/squad-scaffold.service.test.d.ts +2 -0
  273. package/dist/tests/unit/shell/squad-scaffold.service.test.d.ts.map +1 -0
  274. package/dist/tests/unit/shell/squad-scaffold.service.test.js +40 -0
  275. package/dist/tests/unit/shell/squad-scaffold.service.test.js.map +1 -0
  276. package/dist/tests/unit/squad-builder.test.d.ts +2 -0
  277. package/dist/tests/unit/squad-builder.test.d.ts.map +1 -0
  278. package/dist/tests/unit/squad-builder.test.js +126 -0
  279. package/dist/tests/unit/squad-builder.test.js.map +1 -0
  280. package/dist/tests/unit/state-machine.test.d.ts +2 -0
  281. package/dist/tests/unit/state-machine.test.d.ts.map +1 -0
  282. package/dist/tests/unit/state-machine.test.js +133 -0
  283. package/dist/tests/unit/state-machine.test.js.map +1 -0
  284. package/docs/architecture/overview.md +115 -0
  285. package/docs/development/adding-agents.md +75 -0
  286. package/docs/development/adding-hosts.md +104 -0
  287. package/docs/development/adding-integrations.md +83 -0
  288. package/docs/development/host-detection-and-resolution.md +59 -0
  289. package/docs/squads/how-to-create.md +85 -0
  290. package/docs/squads/how-to-execute.md +139 -0
  291. package/docs/superpowers/plans/2026-04-01-host-native-cli-shell-implementation.md +617 -0
  292. package/docs/superpowers/specs/2026-04-01-host-native-cli-shell-design.md +253 -0
  293. package/package.json +103 -0
  294. package/squads/examples/instagram-content/AGENTS.md +63 -0
  295. package/squads/examples/instagram-content/POLICIES.md +45 -0
  296. package/squads/examples/instagram-content/SQUAD.md +63 -0
  297. package/squads/examples/instagram-content/WORKFLOW.md +58 -0
  298. package/squads/examples/instagram-content/config/squad.json +474 -0
  299. package/squads/examples/software-development/AGENTS.md +88 -0
  300. package/squads/examples/software-development/POLICIES.md +44 -0
  301. package/squads/examples/software-development/SQUAD.md +65 -0
  302. package/squads/examples/software-development/WORKFLOW.md +78 -0
  303. package/squads/examples/software-development/config/squad.json +442 -0
  304. package/templates/AGENTS.md +46 -0
  305. package/templates/POLICIES.md +24 -0
  306. package/templates/PROJECT.md +52 -0
  307. package/templates/SQUAD.md +52 -0
  308. package/templates/TASKS.md +31 -0
  309. package/templates/WORKFLOW.md +35 -0
@@ -0,0 +1,617 @@
1
+ # Host-Native CLI Shell Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+ **Goal:** Deliver a CLI-first Squad Foundry experience that feels OpenSquad-like in usability while remaining fully host/model agnostic and using the active IDE model for interviews and execution.
6
+
7
+ **Architecture:** Add a new shell layer (`orchestrator/shell/*`) that orchestrates existing builder/runtime modules without moving business logic into CLI handlers. Host selection runs through a detector + resolver pipeline with confidence scoring, assisted fallback, and persisted preferences. Existing core and runtime remain adapter-driven and vendor-neutral.
8
+
9
+ **Tech Stack:** TypeScript (Node.js ESM), Commander, Vitest, existing Squad Foundry orchestrator modules.
10
+
11
+ ---
12
+
13
+ ## File Structure Map
14
+
15
+ ### New files
16
+ - `orchestrator/shell/cli.ts` — new shell entrypoint and command registration.
17
+ - `orchestrator/shell/commands/init.command.ts` — project bootstrap command.
18
+ - `orchestrator/shell/commands/create.command.ts` — guided squad creation via host-native interview.
19
+ - `orchestrator/shell/commands/edit.command.ts` — guided squad editing via host-native interview.
20
+ - `orchestrator/shell/commands/run.command.ts` — job execution using resolved host.
21
+ - `orchestrator/shell/commands/list.command.ts` — list squads/jobs (including examples).
22
+ - `orchestrator/shell/commands/status.command.ts` — status command with actionable diagnostics.
23
+ - `orchestrator/shell/commands/hosts.command.ts` — inspect and manage host preferences.
24
+ - `orchestrator/shell/services/project-bootstrap.service.ts` — init scaffolding and config writing.
25
+ - `orchestrator/shell/services/squad-scaffold.service.ts` — common squad load/save/path helpers.
26
+ - `orchestrator/shell/services/active-host-detector.service.ts` — signal-based host detection.
27
+ - `orchestrator/shell/services/host-resolution.service.ts` — confidence resolution + assisted selection.
28
+ - `orchestrator/shell/services/interview-host-bridge.service.ts` — host-driven interview loop interface.
29
+ - `orchestrator/shell/services/job-execution.service.ts` — runtime invocation and report metadata.
30
+ - `tests/unit/shell/project-bootstrap.service.test.ts` — init config persistence tests.
31
+ - `tests/unit/shell/active-host-detector.test.ts` — detector scoring tests.
32
+ - `tests/unit/shell/host-resolution.service.test.ts` — fallback and persistence tests.
33
+ - `tests/unit/host/host-adapter-contract.test.ts` — host adapter contract compliance tests.
34
+ - `tests/unit/shell/interview-host-bridge.test.ts` — interview bridge tests.
35
+ - `tests/integration/shell/cli-run-host-native.test.ts` — init/create/run/status flow tests.
36
+
37
+ ### Modified files
38
+ - `orchestrator/cli/index.ts` — become compatibility wrapper or delegate to shell.
39
+ - `orchestrator/adapters/host/IHostAdapter.ts` — extend host contract for detection/interview/model metadata.
40
+ - `orchestrator/adapters/host/ide.adapter.ts` — fix handoff parsing and implement new optional APIs.
41
+ - `orchestrator/mcp/server.ts` — remove hardcoded host for `squad_run`, use shared resolver path.
42
+ - `orchestrator/index.ts` — export shell APIs and updated adapter types.
43
+ - `package.json` — wire bin entry to shell CLI if needed.
44
+ - `docs/squads/how-to-execute.md` — update with host-native CLI flow.
45
+ - `docs/development/adding-hosts.md` — document new host adapter contract.
46
+
47
+ ### Runtime config files created by `init`
48
+ - `squad-foundry.config.json`
49
+ - `squad-foundry.hosts.json`
50
+
51
+ ## Chunk 1: Shell Foundation and Host Resolution
52
+
53
+ ### Task 1: Create shell entrypoint and command wiring
54
+
55
+ **Files:**
56
+ - Create: `orchestrator/shell/cli.ts`
57
+ - Create: `orchestrator/shell/commands/init.command.ts`
58
+ - Create: `orchestrator/shell/commands/create.command.ts`
59
+ - Create: `orchestrator/shell/commands/edit.command.ts`
60
+ - Create: `orchestrator/shell/commands/run.command.ts`
61
+ - Create: `orchestrator/shell/commands/list.command.ts`
62
+ - Create: `orchestrator/shell/commands/status.command.ts`
63
+ - Create: `orchestrator/shell/commands/hosts.command.ts`
64
+ - Modify: `orchestrator/cli/index.ts`
65
+ - Test: `tests/integration/shell/cli-run-host-native.test.ts`
66
+
67
+ - [ ] **Step 1: Write failing integration test for command registration**
68
+
69
+ ```ts
70
+ it('prints help with init/create/edit/run/list/status/hosts', async () => {
71
+ const output = await runCli(['--help'])
72
+ expect(output).toContain('init')
73
+ expect(output).toContain('create')
74
+ expect(output).toContain('edit')
75
+ expect(output).toContain('run')
76
+ expect(output).toContain('list')
77
+ expect(output).toContain('status')
78
+ expect(output).toContain('hosts')
79
+ })
80
+ ```
81
+
82
+ - [ ] **Step 2: Run test to verify failure**
83
+
84
+ Run: `npx vitest run tests/integration/shell/cli-run-host-native.test.ts -t "prints help"`
85
+ Expected: FAIL because shell CLI does not exist yet.
86
+
87
+ - [ ] **Step 3: Implement minimal shell CLI and command modules**
88
+
89
+ ```ts
90
+ // orchestrator/shell/cli.ts
91
+ const program = new Command()
92
+ registerInit(program)
93
+ registerCreate(program)
94
+ registerEdit(program)
95
+ registerRun(program)
96
+ registerList(program)
97
+ registerStatus(program)
98
+ registerHosts(program)
99
+ ```
100
+
101
+ - [ ] **Step 4: Run targeted test to verify pass**
102
+
103
+ Run: `npx vitest run tests/integration/shell/cli-run-host-native.test.ts -t "prints help"`
104
+ Expected: PASS.
105
+
106
+ - [ ] **Step 5: Commit**
107
+
108
+ ```bash
109
+ git add orchestrator/shell orchestrator/cli/index.ts tests/integration/shell/cli-run-host-native.test.ts
110
+ git commit -m "feat(cli): add shell entrypoint and command modules"
111
+ ```
112
+
113
+ ### Task 2: Add config and host preference persistence
114
+
115
+ **Files:**
116
+ - Create: `orchestrator/shell/services/project-bootstrap.service.ts`
117
+ - Create: `orchestrator/shell/services/squad-scaffold.service.ts`
118
+ - Test: `tests/unit/shell/project-bootstrap.service.test.ts`
119
+
120
+ - [ ] **Step 1: Write failing unit test for default config creation**
121
+
122
+ ```ts
123
+ it('writes squad-foundry.config.json and squad-foundry.hosts.json on init', async () => {
124
+ await initProject(tmpDir)
125
+ expect(existsSync(join(tmpDir, 'squad-foundry.config.json'))).toBe(true)
126
+ expect(existsSync(join(tmpDir, 'squad-foundry.hosts.json'))).toBe(true)
127
+ })
128
+ ```
129
+
130
+ - [ ] **Step 2: Run test to verify failure**
131
+
132
+ Run: `npx vitest run tests/unit/shell/project-bootstrap.service.test.ts -t "writes squad-foundry"`
133
+ Expected: FAIL.
134
+
135
+ - [ ] **Step 3: Implement minimal bootstrap persistence**
136
+
137
+ ```ts
138
+ await writeJson('squad-foundry.config.json', { version: 1, cliMode: 'shell' })
139
+ await writeJson('squad-foundry.hosts.json', { preferredHost: null, lastValidated: null, hosts: [] })
140
+ ```
141
+
142
+ - [ ] **Step 4: Re-run test**
143
+
144
+ Run: `npx vitest run tests/unit/shell/project-bootstrap.service.test.ts -t "writes squad-foundry"`
145
+ Expected: PASS.
146
+
147
+ - [ ] **Step 5: Commit**
148
+
149
+ ```bash
150
+ git add orchestrator/shell/services/project-bootstrap.service.ts orchestrator/shell/services/squad-scaffold.service.ts tests/unit/shell/project-bootstrap.service.test.ts
151
+ git commit -m "feat(cli): persist foundry project and host preference configs"
152
+ ```
153
+
154
+ ### Task 3: Implement ActiveHostDetector service
155
+
156
+ **Files:**
157
+ - Create: `orchestrator/shell/services/active-host-detector.service.ts`
158
+ - Test: `tests/unit/shell/active-host-detector.test.ts`
159
+
160
+ - [ ] **Step 1: Write failing detector scoring tests**
161
+
162
+ ```ts
163
+ it('returns high confidence for strong host signals', async () => {
164
+ const result = await detector.detect({ cwd: fixtureClaude })
165
+ expect(result.confidence).toBe('high')
166
+ expect(result.detectedHostId).toBe('claude-code')
167
+ })
168
+
169
+ it('returns deterministic winner and reasons on tie', async () => {
170
+ const result = await detector.detect({ cwd: fixtureAmbiguous })
171
+ expect(result.reasons).toEqual([...result.reasons].sort())
172
+ expect(result.detectedHostId).toBeDefined()
173
+ })
174
+
175
+ it('returns low confidence when no meaningful signals exist', async () => {
176
+ const result = await detector.detect({ cwd: fixtureNoSignals })
177
+ expect(result.confidence).toBe('low')
178
+ })
179
+ ```
180
+
181
+ - [ ] **Step 2: Run tests to verify failure**
182
+
183
+ Run: `npx vitest run tests/unit/shell/active-host-detector.test.ts`
184
+ Expected: FAIL.
185
+
186
+ - [ ] **Step 3: Implement detector with weighted signals**
187
+
188
+ ```ts
189
+ score += signal.type === 'strong' ? 100 : signal.type === 'medium' ? 30 : 10
190
+ ```
191
+
192
+ - [ ] **Step 4: Re-run detector tests**
193
+
194
+ Run: `npx vitest run tests/unit/shell/active-host-detector.test.ts`
195
+ Expected: PASS.
196
+
197
+ - [ ] **Step 5: Commit**
198
+
199
+ ```bash
200
+ git add orchestrator/shell/services/active-host-detector.service.ts tests/unit/shell/active-host-detector.test.ts
201
+ git commit -m "feat(host): add active host detector with confidence scoring"
202
+ ```
203
+
204
+ ### Task 4: Implement HostResolutionService with assisted fallback
205
+
206
+ **Files:**
207
+ - Create: `orchestrator/shell/services/host-resolution.service.ts`
208
+ - Test: `tests/unit/shell/host-resolution.service.test.ts`
209
+
210
+ - [ ] **Step 1: Write failing tests for medium/low confidence rules**
211
+
212
+ ```ts
213
+ it('prompts user when confidence is low', async () => {
214
+ const result = await resolver.resolve({ confidence: 'low' })
215
+ expect(result.path).toBe('assisted-selection')
216
+ })
217
+
218
+ it('rejects persisted host when adapter initialization fails', async () => {
219
+ const result = await resolver.resolve(withBrokenPersistedHost())
220
+ expect(result.path).toBe('assisted-selection')
221
+ })
222
+
223
+ it('rejects persisted host when capability check fails for command', async () => {
224
+ const result = await resolver.resolve(withUnsupportedCapabilities('create'))
225
+ expect(result.path).toBe('assisted-selection')
226
+ })
227
+
228
+ it('rejects persisted host without medium/strong signal match', async () => {
229
+ const result = await resolver.resolve(withSignalMismatch())
230
+ expect(result.path).toBe('assisted-selection')
231
+ })
232
+
233
+ it('persists validation metadata for accepted host', async () => {
234
+ const result = await resolver.resolve(withValidPersistedHost())
235
+ expect(result.validation?.timestamp).toBeDefined()
236
+ expect((result.validation?.matchedSignals ?? []).length).toBeGreaterThan(0)
237
+ })
238
+ ```
239
+
240
+ - [ ] **Step 2: Run tests to verify failure**
241
+
242
+ Run: `npx vitest run tests/unit/shell/host-resolution.service.test.ts -t "confidence is low"`
243
+ Expected: FAIL.
244
+
245
+ - [ ] **Step 3: Implement resolver validity checks and persistence**
246
+
247
+ ```ts
248
+ if (confidence === 'low') return promptUserSelection()
249
+ if (confidence === 'medium' && !matchesPriorSignals) return promptUserSelection()
250
+ ```
251
+
252
+ - [ ] **Step 4: Re-run resolver tests**
253
+
254
+ Run: `npx vitest run tests/unit/shell/host-resolution.service.test.ts`
255
+ Expected: PASS.
256
+
257
+ - [ ] **Step 5: Commit**
258
+
259
+ ```bash
260
+ git add orchestrator/shell/services/host-resolution.service.ts tests/unit/shell/host-resolution.service.test.ts
261
+ git commit -m "feat(host): add resolution flow with assisted fallback and validation"
262
+ ```
263
+
264
+ ### Task 5: Extend host adapter contract for detection/interview/model metadata
265
+
266
+ **Files:**
267
+ - Modify: `orchestrator/adapters/host/IHostAdapter.ts`
268
+ - Modify: `orchestrator/adapters/host/ide.adapter.ts`
269
+ - Modify: `orchestrator/adapters/host/local.adapter.ts`
270
+ - Modify: `orchestrator/adapters/host/antigravity.adapter.ts`
271
+ - Modify: `orchestrator/index.ts`
272
+ - Test: `tests/unit/host/host-adapter-contract.test.ts`
273
+
274
+ - [ ] **Step 1: Write failing type-level and behavior tests for new host APIs**
275
+
276
+ ```ts
277
+ expect(typeof adapter.getActiveModel).toBe('function')
278
+ expect(typeof adapter.runInterviewTurn).toBe('function')
279
+ expect(typeof adapter.detect).toBe('function')
280
+ ```
281
+
282
+ - [ ] **Step 2: Run targeted tests**
283
+
284
+ Run: `npx vitest run tests/unit/host/host-adapter-contract.test.ts`
285
+ Expected: FAIL.
286
+
287
+ - [ ] **Step 3: Add required contract methods and implement adapter defaults**
288
+
289
+ ```ts
290
+ getActiveModel(): Promise<string | null>
291
+ runInterviewTurn(...): Promise<InterviewTurnResult>
292
+ detect(context): DetectionResult
293
+ ```
294
+
295
+ - [ ] **Step 4: Re-run tests**
296
+
297
+ Run: `npx vitest run tests/unit/host/host-adapter-contract.test.ts`
298
+ Expected: PASS.
299
+
300
+ - [ ] **Step 5: Commit**
301
+
302
+ ```bash
303
+ git add orchestrator/adapters/host/IHostAdapter.ts orchestrator/adapters/host/ide.adapter.ts orchestrator/adapters/host/local.adapter.ts orchestrator/adapters/host/antigravity.adapter.ts orchestrator/index.ts tests/unit/host/host-adapter-contract.test.ts
304
+ git commit -m "feat(host): extend adapter contract for detection interview and active model"
305
+ ```
306
+
307
+ ## Chunk 2: Host-Native Interview, Runtime Integration, and Hardening
308
+
309
+ ### Task 6: Implement interview host bridge and wire create/edit to host-native model
310
+
311
+ **Files:**
312
+ - Create: `orchestrator/shell/services/interview-host-bridge.service.ts`
313
+ - Modify: `orchestrator/shell/commands/create.command.ts`
314
+ - Modify: `orchestrator/shell/commands/edit.command.ts`
315
+ - Test: `tests/unit/shell/interview-host-bridge.test.ts`
316
+
317
+ - [ ] **Step 1: Write failing tests for host-driven interview turns**
318
+
319
+ ```ts
320
+ it('uses resolved host adapter for interview turns', async () => {
321
+ await runCreateWithHost(mockHost)
322
+ expect(mockHost.runInterviewTurn).toHaveBeenCalled()
323
+ expect(getInterviewState().activeModel).toBe(mockHostModel)
324
+ })
325
+
326
+ it('uses resolved host adapter for edit interview turns', async () => {
327
+ await runEditWithHost(mockHost)
328
+ expect(mockHost.runInterviewTurn).toHaveBeenCalled()
329
+ expect(getInterviewState().activeModel).toBe(mockHostModel)
330
+ })
331
+
332
+ it('stores host-default when host cannot expose active model', async () => {
333
+ await runCreateWithHost(mockHostWithoutModel)
334
+ expect(getInterviewState().activeModel).toBe('host-default')
335
+ })
336
+ ```
337
+
338
+ - [ ] **Step 2: Run test to verify failure**
339
+
340
+ Run: `npx vitest run tests/unit/shell/interview-host-bridge.test.ts -t "interview turns"`
341
+ Expected: FAIL.
342
+
343
+ - [ ] **Step 3: Implement bridge and command integration**
344
+
345
+ ```ts
346
+ const turn = await interviewBridge.nextTurn({ hostAdapter, userInput, state })
347
+ ```
348
+
349
+ - [ ] **Step 4: Re-run tests**
350
+
351
+ Run: `npx vitest run tests/unit/shell/interview-host-bridge.test.ts`
352
+ Expected: PASS.
353
+
354
+ - [ ] **Step 5: Commit**
355
+
356
+ ```bash
357
+ git add orchestrator/shell/services/interview-host-bridge.service.ts orchestrator/shell/commands/create.command.ts orchestrator/shell/commands/edit.command.ts tests/unit/shell/interview-host-bridge.test.ts
358
+ git commit -m "feat(builder): run create/edit interviews on resolved host native model"
359
+ ```
360
+
361
+ ### Task 7: Implement job execution service and wire run/status/list/hosts commands
362
+
363
+ **Files:**
364
+ - Create: `orchestrator/shell/services/job-execution.service.ts`
365
+ - Modify: `orchestrator/shell/commands/run.command.ts`
366
+ - Modify: `orchestrator/shell/commands/status.command.ts`
367
+ - Modify: `orchestrator/shell/commands/list.command.ts`
368
+ - Modify: `orchestrator/shell/commands/hosts.command.ts`
369
+ - Test: `tests/integration/shell/cli-run-host-native.test.ts`
370
+
371
+ - [ ] **Step 1: Write failing integration test for init->run->status metadata**
372
+
373
+ ```ts
374
+ expect(statusOutput).toContain('resolvedHost')
375
+ expect(statusOutput).toContain('activeModel')
376
+ expect(statusOutput).toContain('confidence')
377
+ expect(statusOutput).toContain('reasons')
378
+ expect(statusOutput).toContain('fallbackPath')
379
+ expect(await runCli(['list'])).toContain('software-development')
380
+ expect(await runCli(['hosts'])).toContain('preferredHost')
381
+ ```
382
+
383
+ - [ ] **Step 2: Run test to verify failure**
384
+
385
+ Run: `npx vitest run tests/integration/shell/cli-run-host-native.test.ts -t "resolvedHost"`
386
+ Expected: FAIL.
387
+
388
+ - [ ] **Step 3: Implement service and command wiring**
389
+
390
+ ```ts
391
+ const resolution = await resolver.resolve(ctx)
392
+ const runtime = createSquadRuntime({ hostAdapter: resolution.adapter, ... })
393
+ ```
394
+
395
+ - [ ] **Step 4: Re-run integration test**
396
+
397
+ Run: `npx vitest run tests/integration/shell/cli-run-host-native.test.ts`
398
+ Expected: PASS.
399
+
400
+ - [ ] **Step 5: Commit**
401
+
402
+ ```bash
403
+ git add orchestrator/shell/services/job-execution.service.ts orchestrator/shell/commands/run.command.ts orchestrator/shell/commands/status.command.ts orchestrator/shell/commands/list.command.ts orchestrator/shell/commands/hosts.command.ts tests/integration/shell/cli-run-host-native.test.ts
404
+ git commit -m "feat(runtime): resolve host for run and report host/model provenance"
405
+ ```
406
+
407
+ ### Task 8: Fix IDE host handoff parsing bug
408
+
409
+ **Files:**
410
+ - Modify: `orchestrator/adapters/host/ide.adapter.ts`
411
+ - Test: `tests/unit/host/ide.adapter.test.ts`
412
+
413
+ - [ ] **Step 1: Write failing unit test for HANDOFF parsing against squad agents**
414
+
415
+ ```ts
416
+ expect(response.handoffSignal?.targetAgentId).toBe('reviewer-agent')
417
+ ```
418
+
419
+ - [ ] **Step 2: Run test to verify failure**
420
+
421
+ Run: `npx vitest run tests/unit/host/ide.adapter.test.ts -t "HANDOFF"`
422
+ Expected: FAIL.
423
+
424
+ - [ ] **Step 3: Implement fix using squad agent IDs, not context docs**
425
+
426
+ ```ts
427
+ const agentIds = squad.agents.map((a) => a.id)
428
+ ```
429
+
430
+ - [ ] **Step 4: Re-run test**
431
+
432
+ Run: `npx vitest run tests/unit/host/ide.adapter.test.ts`
433
+ Expected: PASS.
434
+
435
+ - [ ] **Step 5: Commit**
436
+
437
+ ```bash
438
+ git add orchestrator/adapters/host/ide.adapter.ts tests/unit/host/ide.adapter.test.ts
439
+ git commit -m "fix(host): parse ide handoff using squad agent ids"
440
+ ```
441
+
442
+ ### Task 9: Fix squad path handling for generated and example squads
443
+
444
+ **Files:**
445
+ - Modify: `orchestrator/shell/services/squad-scaffold.service.ts`
446
+ - Modify: `orchestrator/shell/commands/run.command.ts`
447
+ - Modify: `orchestrator/shell/commands/list.command.ts`
448
+ - Test: `tests/integration/shell/cli-run-host-native.test.ts`
449
+
450
+ - [ ] **Step 1: Write failing integration test for example squad discovery**
451
+
452
+ ```ts
453
+ expect(await runCli(['list'])).toContain('software-development')
454
+ ```
455
+
456
+ - [ ] **Step 2: Run test to verify failure**
457
+
458
+ Run: `npx vitest run tests/integration/shell/cli-run-host-native.test.ts -t "example squad"`
459
+ Expected: FAIL.
460
+
461
+ - [ ] **Step 3: Implement unified squad lookup order**
462
+
463
+ ```ts
464
+ lookup: squads/<id> first, then squads/examples/<id>
465
+ ```
466
+
467
+ - [ ] **Step 4: Re-run integration test**
468
+
469
+ Run: `npx vitest run tests/integration/shell/cli-run-host-native.test.ts -t "example squad"`
470
+ Expected: PASS.
471
+
472
+ - [ ] **Step 5: Commit**
473
+
474
+ ```bash
475
+ git add orchestrator/shell/services/squad-scaffold.service.ts orchestrator/shell/commands/run.command.ts orchestrator/shell/commands/list.command.ts tests/integration/shell/cli-run-host-native.test.ts
476
+ git commit -m "fix(cli): resolve both generated and example squads consistently"
477
+ ```
478
+
479
+ ### Task 10: De-hardcode MCP host selection (secondary path)
480
+
481
+ **Files:**
482
+ - Modify: `orchestrator/mcp/server.ts`
483
+ - Test: `tests/integration/mcp/squad-run-host-selection.test.ts`
484
+
485
+ - [ ] **Step 1: Write failing MCP integration test for non-hardcoded host resolution**
486
+
487
+ ```ts
488
+ expect(hostResolutionServiceResolveSpy).toHaveBeenCalled()
489
+ expect(result.usedResolutionPath).toMatch(/detected|persisted|assisted-selection/)
490
+ ```
491
+
492
+ - [ ] **Step 2: Run test to verify failure**
493
+
494
+ Run: `npx vitest run tests/integration/mcp/squad-run-host-selection.test.ts`
495
+ Expected: FAIL.
496
+
497
+ - [ ] **Step 3: Route MCP `squad_run` through shared resolver path**
498
+
499
+ ```ts
500
+ const hostAdapter = await hostResolutionService.resolve(...)
501
+ ```
502
+
503
+ - [ ] **Step 4: Re-run MCP test**
504
+
505
+ Run: `npx vitest run tests/integration/mcp/squad-run-host-selection.test.ts`
506
+ Expected: PASS.
507
+
508
+ - [ ] **Step 5: Commit**
509
+
510
+ ```bash
511
+ git add orchestrator/mcp/server.ts tests/integration/mcp/squad-run-host-selection.test.ts
512
+ git commit -m "refactor(mcp): use shared host resolution instead of hardcoded antigravity"
513
+ ```
514
+
515
+ ### Task 11: Add and stabilize full test matrix
516
+
517
+ **Files:**
518
+ - Modify: `tests/unit/shell/host-resolution.service.test.ts`
519
+ - Modify: `tests/unit/shell/active-host-detector.test.ts`
520
+ - Modify: `tests/unit/shell/interview-host-bridge.test.ts`
521
+ - Modify: `tests/integration/shell/cli-run-host-native.test.ts`
522
+ - Modify: `tests/integration/software-squad.test.ts`
523
+ - Modify: `tests/integration/instagram-squad.test.ts`
524
+ - Modify: `orchestrator/shell/services/host-resolution.service.ts`
525
+ - Modify: `orchestrator/shell/services/job-execution.service.ts`
526
+
527
+ - [ ] **Step 1: Add failing cases for low-confidence assisted prompt and persistence validity checks**
528
+
529
+ ```ts
530
+ expect(result.path).toBe('assisted-selection')
531
+ expect(result.validity.matchedSignals).toBeGreaterThan(0)
532
+ ```
533
+
534
+ - [ ] **Step 2: Run targeted shell tests**
535
+
536
+ Run: `npx vitest run tests/unit/shell tests/integration/shell`
537
+ Expected: at least one FAIL before implementation completion.
538
+
539
+ - [ ] **Step 3: Implement only failing behaviors from Step 1 tests**
540
+
541
+ ```ts
542
+ // 3a: persist assisted-selection metadata in host-resolution.service.ts
543
+ // 3b: persist matchedSignals in validation metadata
544
+ // 3c: include fallbackPath and reasons[] in run report payload from job-execution.service.ts
545
+ ```
546
+
547
+ - [ ] **Step 4: Run full suite**
548
+
549
+ Run: `npm test`
550
+ Expected: PASS all tests.
551
+
552
+ - [ ] **Step 5: Commit**
553
+
554
+ ```bash
555
+ git add tests/unit/shell/host-resolution.service.test.ts tests/unit/shell/active-host-detector.test.ts tests/unit/shell/interview-host-bridge.test.ts tests/integration/shell/cli-run-host-native.test.ts tests/integration/software-squad.test.ts tests/integration/instagram-squad.test.ts orchestrator/shell/services/host-resolution.service.ts orchestrator/shell/services/job-execution.service.ts
556
+ git commit -m "test(shell): add resolver and runtime provenance coverage"
557
+ ```
558
+
559
+ ### Task 12: Update docs and migration notes
560
+
561
+ **Files:**
562
+ - Modify: `README.md`
563
+ - Modify: `docs/squads/how-to-execute.md`
564
+ - Modify: `docs/development/adding-hosts.md`
565
+ - Create: `docs/development/host-detection-and-resolution.md`
566
+ - Create: `tests/unit/docs/host-native-docs.test.ts`
567
+
568
+ - [ ] **Step 1: Write failing doc-check test or checklist assertion**
569
+
570
+ ```ts
571
+ expect(readme).toContain('squad-foundry init')
572
+ expect(readme).toContain('host-native')
573
+ ```
574
+
575
+ - [ ] **Step 2: Run check to verify failure**
576
+
577
+ Run: `npx vitest run tests/unit/docs/host-native-docs.test.ts`
578
+ Expected: FAIL with missing host-native CLI documentation assertions before docs updates.
579
+
580
+ - [ ] **Step 3: Update docs with CLI-first and host-native behavior**
581
+
582
+ ```md
583
+ Document: detection flow, assisted fallback, active model rule, and override flags.
584
+ ```
585
+
586
+ - [ ] **Step 4: Re-run docs check and full tests**
587
+
588
+ Run: `npx vitest run tests/unit/docs/host-native-docs.test.ts && npm test`
589
+ Expected: PASS.
590
+
591
+ - [ ] **Step 5: Commit**
592
+
593
+ ```bash
594
+ git add README.md docs/squads/how-to-execute.md docs/development/adding-hosts.md docs/development/host-detection-and-resolution.md tests/unit/docs/host-native-docs.test.ts
595
+ git commit -m "docs: document host-native cli flow and adapter extension contract"
596
+ ```
597
+
598
+ ## Verification Gate (Before Merge)
599
+
600
+ - [ ] Run: `npm test` and confirm all unit/integration suites pass.
601
+ - [ ] Run: `npm run build` and confirm TypeScript compiles cleanly.
602
+ - [ ] Validate run report includes: `resolvedHost`, `confidence`, `reasons[]`, `activeModel` (or `host-default`), and `fallbackPath`.
603
+ - [ ] Validate no-silent-fallback rule: unresolved host must trigger assisted selection, not API-key provider auto-switch.
604
+ - [ ] Manual smoke test in workspace:
605
+ - `squad-foundry init`
606
+ - `squad-foundry create`
607
+ - `squad-foundry edit <squad_id>`
608
+ - `squad-foundry run software-development --objective "smoke" --input "smoke"`
609
+ - `squad-foundry status <squad_id> <job_id>`
610
+
611
+ ## Notes for Implementation Worker
612
+
613
+ - Keep core/runtime logic out of command handlers; use shell services.
614
+ - Preserve existing state machine and guardrail behaviors.
615
+ - Do not add automatic deploy/publish side effects.
616
+ - If a host does not expose active model, store `host-default` and continue.
617
+ - Keep changes DRY and avoid speculative abstractions beyond current Tier 1 hosts.