@neural-node-labs/xcoder-dna 0.0.0-stage → 1.5.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 (406) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -2
  3. package/dist/agents/agent-catalog.d.ts +87 -0
  4. package/dist/agents/agent-catalog.js +159 -0
  5. package/dist/agents/agent-registry.d.ts +76 -0
  6. package/dist/agents/agent-registry.js +189 -0
  7. package/dist/agents/ai-chat-debate.d.ts +36 -0
  8. package/dist/agents/ai-chat-debate.js +300 -0
  9. package/dist/agents/ai-chat-report-writer.d.ts +7 -0
  10. package/dist/agents/ai-chat-report-writer.js +100 -0
  11. package/dist/agents/duplicate-detector.d.ts +41 -0
  12. package/dist/agents/duplicate-detector.js +65 -0
  13. package/dist/agents/genesis-agent.d.ts +61 -0
  14. package/dist/agents/genesis-agent.js +340 -0
  15. package/dist/agents/samurai-agent.d.ts +53 -0
  16. package/dist/agents/samurai-agent.js +279 -0
  17. package/dist/agents/sub-agent.d.ts +56 -0
  18. package/dist/agents/sub-agent.js +353 -0
  19. package/dist/backlog/backlog-requirement-validator.d.ts +10 -0
  20. package/dist/backlog/backlog-requirement-validator.js +60 -0
  21. package/dist/backlog/backlog-store.d.ts +29 -0
  22. package/dist/backlog/backlog-store.js +148 -0
  23. package/dist/backlog/po-agent.d.ts +16 -0
  24. package/dist/backlog/po-agent.js +121 -0
  25. package/dist/backlog/types.d.ts +25 -0
  26. package/dist/backlog/types.js +4 -0
  27. package/dist/bench/run.d.ts +11 -0
  28. package/dist/bench/run.js +185 -0
  29. package/dist/bench/types.d.ts +50 -0
  30. package/dist/bench/types.js +1 -0
  31. package/dist/cli/delegate.d.ts +90 -0
  32. package/dist/cli/delegate.js +220 -0
  33. package/dist/cli/swarm.d.ts +10 -0
  34. package/dist/cli/swarm.js +100 -0
  35. package/dist/cli/task.d.ts +14 -0
  36. package/dist/cli/task.js +121 -0
  37. package/dist/cli/wbc-arg.d.ts +6 -0
  38. package/dist/cli/wbc-arg.js +40 -0
  39. package/dist/cli/wbc.d.ts +45 -0
  40. package/dist/cli/wbc.js +98 -0
  41. package/dist/commands/license.d.ts +9 -0
  42. package/dist/commands/license.js +140 -0
  43. package/dist/commands/release.d.ts +44 -0
  44. package/dist/commands/release.js +180 -0
  45. package/dist/commands/test.d.ts +50 -0
  46. package/dist/commands/test.js +385 -0
  47. package/dist/config/env-guard.d.ts +35 -0
  48. package/dist/config/env-guard.js +100 -0
  49. package/dist/config/env-snapshot.d.ts +18 -0
  50. package/dist/config/env-snapshot.js +30 -0
  51. package/dist/config/loadConfig.d.ts +82 -0
  52. package/dist/config/loadConfig.js +249 -0
  53. package/dist/config/secure-mode.d.ts +29 -0
  54. package/dist/config/secure-mode.js +63 -0
  55. package/dist/config/user-config.d.ts +39 -0
  56. package/dist/config/user-config.js +202 -0
  57. package/dist/engine/reasoning-engine.d.ts +21 -0
  58. package/dist/engine/reasoning-engine.js +59 -0
  59. package/dist/events/bus.d.ts +22 -0
  60. package/dist/events/bus.js +18 -0
  61. package/dist/index.d.ts +87 -0
  62. package/dist/index.js +88 -0
  63. package/dist/indexing/ignoreRules.d.ts +1 -0
  64. package/dist/indexing/ignoreRules.js +53 -0
  65. package/dist/instance-swarm/instance-swarm-orchestrator.d.ts +57 -0
  66. package/dist/instance-swarm/instance-swarm-orchestrator.js +204 -0
  67. package/dist/instance-swarm/protocol-name-resolver.d.ts +23 -0
  68. package/dist/instance-swarm/protocol-name-resolver.js +64 -0
  69. package/dist/license/gate.d.ts +31 -0
  70. package/dist/license/gate.js +188 -0
  71. package/dist/license/http-client.d.ts +43 -0
  72. package/dist/license/http-client.js +195 -0
  73. package/dist/license/manager.d.ts +39 -0
  74. package/dist/license/manager.js +175 -0
  75. package/dist/license/receipt.d.ts +27 -0
  76. package/dist/license/receipt.js +108 -0
  77. package/dist/license/state-codec.d.ts +72 -0
  78. package/dist/license/state-codec.js +218 -0
  79. package/dist/license/state-paths.d.ts +17 -0
  80. package/dist/license/state-paths.js +64 -0
  81. package/dist/license/store.d.ts +44 -0
  82. package/dist/license/store.js +223 -0
  83. package/dist/license/trust-anchor.d.ts +24 -0
  84. package/dist/license/trust-anchor.js +74 -0
  85. package/dist/license/types.d.ts +34 -0
  86. package/dist/license/types.js +19 -0
  87. package/dist/llm/budget.d.ts +23 -0
  88. package/dist/llm/budget.js +58 -0
  89. package/dist/llm/client.d.ts +53 -0
  90. package/dist/llm/client.js +122 -0
  91. package/dist/llm/factory.d.ts +14 -0
  92. package/dist/llm/factory.js +32 -0
  93. package/dist/orchestrator/defect-logger.d.ts +31 -0
  94. package/dist/orchestrator/defect-logger.js +101 -0
  95. package/dist/orchestrator/defect-manager.d.ts +118 -0
  96. package/dist/orchestrator/defect-manager.js +338 -0
  97. package/dist/orchestrator/defect-migration.d.ts +14 -0
  98. package/dist/orchestrator/defect-migration.js +174 -0
  99. package/dist/orchestrator/defect-store.d.ts +48 -0
  100. package/dist/orchestrator/defect-store.js +76 -0
  101. package/dist/orchestrator/healing.d.ts +14 -0
  102. package/dist/orchestrator/healing.js +11 -0
  103. package/dist/orchestrator/interactive-steering.d.ts +64 -0
  104. package/dist/orchestrator/interactive-steering.js +107 -0
  105. package/dist/orchestrator/interrupt-handler.d.ts +30 -0
  106. package/dist/orchestrator/interrupt-handler.js +70 -0
  107. package/dist/orchestrator/lesson-manager.d.ts +25 -0
  108. package/dist/orchestrator/lesson-manager.js +122 -0
  109. package/dist/orchestrator/progress-summary.d.ts +15 -0
  110. package/dist/orchestrator/progress-summary.js +106 -0
  111. package/dist/orchestrator/reasoning-score.d.ts +49 -0
  112. package/dist/orchestrator/reasoning-score.js +117 -0
  113. package/dist/orchestrator/swarm.d.ts +36 -0
  114. package/dist/orchestrator/swarm.js +77 -0
  115. package/dist/orchestrator/task-factory.d.ts +15 -0
  116. package/dist/orchestrator/task-factory.js +176 -0
  117. package/dist/orchestrator/validation-gate.d.ts +23 -0
  118. package/dist/orchestrator/validation-gate.js +155 -0
  119. package/dist/protocol/react-contract.d.ts +136 -0
  120. package/dist/protocol/react-contract.js +698 -0
  121. package/dist/protocol/wks-protocol-manager.d.ts +22 -0
  122. package/dist/protocol/wks-protocol-manager.js +72 -0
  123. package/dist/sdlc-runtime/conversation-runner.d.ts +8 -0
  124. package/dist/sdlc-runtime/conversation-runner.js +64 -0
  125. package/dist/sdlc-runtime/dag-utils.d.ts +15 -0
  126. package/dist/sdlc-runtime/dag-utils.js +67 -0
  127. package/dist/sdlc-runtime/defect-integration.d.ts +7 -0
  128. package/dist/sdlc-runtime/defect-integration.js +99 -0
  129. package/dist/sdlc-runtime/execution-loop.d.ts +38 -0
  130. package/dist/sdlc-runtime/execution-loop.js +274 -0
  131. package/dist/sdlc-runtime/lesson-recorder.d.ts +9 -0
  132. package/dist/sdlc-runtime/lesson-recorder.js +27 -0
  133. package/dist/sdlc-runtime/plan-initializer.d.ts +47 -0
  134. package/dist/sdlc-runtime/plan-initializer.js +135 -0
  135. package/dist/sdlc-runtime/progress-persister.d.ts +10 -0
  136. package/dist/sdlc-runtime/progress-persister.js +34 -0
  137. package/dist/sdlc-runtime/protocol-loader.d.ts +10 -0
  138. package/dist/sdlc-runtime/protocol-loader.js +21 -0
  139. package/dist/sdlc-runtime/reporting.d.ts +24 -0
  140. package/dist/sdlc-runtime/reporting.js +68 -0
  141. package/dist/sdlc-runtime/run-task.d.ts +81 -0
  142. package/dist/sdlc-runtime/run-task.js +210 -0
  143. package/dist/sdlc-runtime/sdlc-orchestrator.d.ts +59 -0
  144. package/dist/sdlc-runtime/sdlc-orchestrator.js +170 -0
  145. package/dist/sdlc-runtime/sdlc-skill.d.ts +44 -0
  146. package/dist/sdlc-runtime/sdlc-skill.js +148 -0
  147. package/dist/sdlc-runtime/steering-handler.d.ts +14 -0
  148. package/dist/sdlc-runtime/steering-handler.js +51 -0
  149. package/dist/sdlc-runtime/trace-recorder.d.ts +10 -0
  150. package/dist/sdlc-runtime/trace-recorder.js +7 -0
  151. package/dist/security/index.d.ts +16 -0
  152. package/dist/security/index.js +12 -0
  153. package/dist/security/input-screen.d.ts +30 -0
  154. package/dist/security/input-screen.js +75 -0
  155. package/dist/security/tool-call-guard.d.ts +16 -0
  156. package/dist/security/tool-call-guard.js +174 -0
  157. package/dist/security/untrusted-content.d.ts +34 -0
  158. package/dist/security/untrusted-content.js +63 -0
  159. package/dist/skills/advanced-dfir/SKILL.md +85 -0
  160. package/dist/skills/advanced-pentest-lab/SKILL.md +88 -0
  161. package/dist/skills/analyst/SKILL.md +55 -0
  162. package/dist/skills/architect/SKILL.md +54 -0
  163. package/dist/skills/aws/SKILL.md +92 -0
  164. package/dist/skills/azure/SKILL.md +90 -0
  165. package/dist/skills/bylaw-context.d.ts +45 -0
  166. package/dist/skills/bylaw-context.js +61 -0
  167. package/dist/skills/bylaw-review.d.ts +20 -0
  168. package/dist/skills/bylaw-review.js +101 -0
  169. package/dist/skills/conversation/SKILL.md +29 -0
  170. package/dist/skills/design-patterns/SKILL.md +190 -0
  171. package/dist/skills/devops/SKILL.md +55 -0
  172. package/dist/skills/directives.d.ts +20 -0
  173. package/dist/skills/directives.js +313 -0
  174. package/dist/skills/docker/SKILL.md +76 -0
  175. package/dist/skills/docker-expert/SKILL.md +56 -0
  176. package/dist/skills/enterprise-systems-analyst/SKILL.md +83 -0
  177. package/dist/skills/enterprise-systems-analyst/references/crm.md +41 -0
  178. package/dist/skills/enterprise-systems-analyst/references/erp.md +40 -0
  179. package/dist/skills/enterprise-systems-analyst/references/financial-systems.md +35 -0
  180. package/dist/skills/enterprise-systems-analyst/references/hcm.md +38 -0
  181. package/dist/skills/enterprise-systems-analyst/references/mrp.md +37 -0
  182. package/dist/skills/enterprise-systems-analyst/references/scm.md +32 -0
  183. package/dist/skills/ethical-hacking-methodology/SKILL.md +119 -0
  184. package/dist/skills/externalSkillLoader.d.ts +25 -0
  185. package/dist/skills/externalSkillLoader.js +65 -0
  186. package/dist/skills/externalSkillRegistry.d.ts +33 -0
  187. package/dist/skills/externalSkillRegistry.js +94 -0
  188. package/dist/skills/filesystem-management/SKILL.md +61 -0
  189. package/dist/skills/first-run-seed.d.ts +26 -0
  190. package/dist/skills/first-run-seed.js +75 -0
  191. package/dist/skills/git-vcs/SKILL.md +84 -0
  192. package/dist/skills/kafka/SKILL.md +89 -0
  193. package/dist/skills/kubernetes/SKILL.md +93 -0
  194. package/dist/skills/kubernetes-expert/SKILL.md +54 -0
  195. package/dist/skills/openshift/SKILL.md +93 -0
  196. package/dist/skills/pentester/SKILL.md +59 -0
  197. package/dist/skills/performance-tester/SKILL.md +57 -0
  198. package/dist/skills/playwright-ui-tester/SKILL.md +67 -0
  199. package/dist/skills/programmer/SKILL.md +58 -0
  200. package/dist/skills/project-scaffolding/SKILL.md +133 -0
  201. package/dist/skills/qa-engineer/SKILL.md +91 -0
  202. package/dist/skills/rca/SKILL.md +58 -0
  203. package/dist/skills/redhat/SKILL.md +92 -0
  204. package/dist/skills/rosa/SKILL.md +80 -0
  205. package/dist/skills/scrum-framework/SKILL.md +74 -0
  206. package/dist/skills/scrum-framework/references/artifacts_and_quality.md +79 -0
  207. package/dist/skills/scrum-framework/references/roles_and_events.md +105 -0
  208. package/dist/skills/scrum-master-agent/SKILL.md +74 -0
  209. package/dist/skills/scrum-master-agent/references/behaviors.md +56 -0
  210. package/dist/skills/sdlc-skill.d.ts +1 -0
  211. package/dist/skills/sdlc-skill.js +4 -0
  212. package/dist/skills/secops/SKILL.md +52 -0
  213. package/dist/skills/secure-architect.bylaws.d.ts +68 -0
  214. package/dist/skills/secure-architect.bylaws.js +525 -0
  215. package/dist/skills/seed-skills.d.ts +48 -0
  216. package/dist/skills/seed-skills.js +213 -0
  217. package/dist/skills/skill-authoring/SKILL.md +123 -0
  218. package/dist/skills/skill-header.d.ts +51 -0
  219. package/dist/skills/skill-header.js +163 -0
  220. package/dist/skills/skill-path-guard.d.ts +41 -0
  221. package/dist/skills/skill-path-guard.js +95 -0
  222. package/dist/skills/skillRouter.d.ts +51 -0
  223. package/dist/skills/skillRouter.js +90 -0
  224. package/dist/skills/skills-root.d.ts +64 -0
  225. package/dist/skills/skills-root.js +168 -0
  226. package/dist/skills/software-architect/SKILL.md +77 -0
  227. package/dist/skills/software-engineer/SKILL.md +74 -0
  228. package/dist/skills/solid-principles/SKILL.md +94 -0
  229. package/dist/skills/task-planning/SKILL.md +115 -0
  230. package/dist/skills/tester/SKILL.md +54 -0
  231. package/dist/skills/ubuntu/SKILL.md +87 -0
  232. package/dist/skills/ui-ux-design/SKILL.md +114 -0
  233. package/dist/skills/workspace-context/SKILL.md +103 -0
  234. package/dist/sprint/controller.d.ts +37 -0
  235. package/dist/sprint/controller.js +220 -0
  236. package/dist/sprint/dag-builder.d.ts +14 -0
  237. package/dist/sprint/dag-builder.js +105 -0
  238. package/dist/sprint/reporter.d.ts +11 -0
  239. package/dist/sprint/reporter.js +97 -0
  240. package/dist/sprint/state-store.d.ts +10 -0
  241. package/dist/sprint/state-store.js +71 -0
  242. package/dist/sprint/types.d.ts +24 -0
  243. package/dist/sprint/types.js +4 -0
  244. package/dist/store/file-version-store.d.ts +24 -0
  245. package/dist/store/file-version-store.js +73 -0
  246. package/dist/store/task-store.d.ts +90 -0
  247. package/dist/store/task-store.js +166 -0
  248. package/dist/task-ingest/architect-detailer.d.ts +43 -0
  249. package/dist/task-ingest/architect-detailer.js +141 -0
  250. package/dist/task-ingest/detail-schema.d.ts +9 -0
  251. package/dist/task-ingest/detail-schema.js +195 -0
  252. package/dist/task-ingest/detailed-run.d.ts +36 -0
  253. package/dist/task-ingest/detailed-run.js +108 -0
  254. package/dist/task-ingest/extract-id.d.ts +9 -0
  255. package/dist/task-ingest/extract-id.js +24 -0
  256. package/dist/task-ingest/index.d.ts +23 -0
  257. package/dist/task-ingest/index.js +14 -0
  258. package/dist/task-ingest/ingest.d.ts +45 -0
  259. package/dist/task-ingest/ingest.js +163 -0
  260. package/dist/task-ingest/list-ingested.d.ts +13 -0
  261. package/dist/task-ingest/list-ingested.js +30 -0
  262. package/dist/task-ingest/pending-filter.d.ts +30 -0
  263. package/dist/task-ingest/pending-filter.js +59 -0
  264. package/dist/task-ingest/scanner.d.ts +56 -0
  265. package/dist/task-ingest/scanner.js +216 -0
  266. package/dist/task-ingest/source-reader.d.ts +25 -0
  267. package/dist/task-ingest/source-reader.js +93 -0
  268. package/dist/task-ingest/spec-builder.d.ts +34 -0
  269. package/dist/task-ingest/spec-builder.js +89 -0
  270. package/dist/task-ingest/wbs-extract.d.ts +50 -0
  271. package/dist/task-ingest/wbs-extract.js +226 -0
  272. package/dist/task-ingest/wbs-parser.d.ts +36 -0
  273. package/dist/task-ingest/wbs-parser.js +170 -0
  274. package/dist/tools/apiTestTool.d.ts +37 -0
  275. package/dist/tools/apiTestTool.js +128 -0
  276. package/dist/tools/ast-tools.d.ts +183 -0
  277. package/dist/tools/ast-tools.js +853 -0
  278. package/dist/tools/browse-tool.d.ts +105 -0
  279. package/dist/tools/browse-tool.js +394 -0
  280. package/dist/tools/credential.d.ts +17 -0
  281. package/dist/tools/credential.js +32 -0
  282. package/dist/tools/dependency-graph.d.ts +23 -0
  283. package/dist/tools/dependency-graph.js +164 -0
  284. package/dist/tools/edit-tool.d.ts +34 -0
  285. package/dist/tools/edit-tool.js +95 -0
  286. package/dist/tools/file-header-manager.d.ts +27 -0
  287. package/dist/tools/file-header-manager.js +153 -0
  288. package/dist/tools/fs-tools.d.ts +154 -0
  289. package/dist/tools/fs-tools.js +337 -0
  290. package/dist/tools/git-tools.d.ts +79 -0
  291. package/dist/tools/git-tools.js +348 -0
  292. package/dist/tools/github-tool.d.ts +48 -0
  293. package/dist/tools/github-tool.js +147 -0
  294. package/dist/tools/globTool.d.ts +20 -0
  295. package/dist/tools/globTool.js +34 -0
  296. package/dist/tools/grepTool.d.ts +19 -0
  297. package/dist/tools/grepTool.js +44 -0
  298. package/dist/tools/index-freshness.d.ts +58 -0
  299. package/dist/tools/index-freshness.js +196 -0
  300. package/dist/tools/index-glob.d.ts +48 -0
  301. package/dist/tools/index-glob.js +175 -0
  302. package/dist/tools/load-skill-tool.d.ts +15 -0
  303. package/dist/tools/load-skill-tool.js +114 -0
  304. package/dist/tools/patch-tools.d.ts +58 -0
  305. package/dist/tools/patch-tools.js +153 -0
  306. package/dist/tools/playwright-tool.d.ts +66 -0
  307. package/dist/tools/playwright-tool.js +121 -0
  308. package/dist/tools/project-detect.d.ts +20 -0
  309. package/dist/tools/project-detect.js +87 -0
  310. package/dist/tools/prompt-guidance.d.ts +22 -0
  311. package/dist/tools/prompt-guidance.js +23 -0
  312. package/dist/tools/schedule-audit.d.ts +50 -0
  313. package/dist/tools/schedule-audit.js +124 -0
  314. package/dist/tools/schedule-validation.d.ts +67 -0
  315. package/dist/tools/schedule-validation.js +210 -0
  316. package/dist/tools/scheduleTool.d.ts +62 -0
  317. package/dist/tools/scheduleTool.js +313 -0
  318. package/dist/tools/search-tools.d.ts +27 -0
  319. package/dist/tools/search-tools.js +78 -0
  320. package/dist/tools/sed-tool.d.ts +66 -0
  321. package/dist/tools/sed-tool.js +402 -0
  322. package/dist/tools/shell-result.d.ts +11 -0
  323. package/dist/tools/shell-result.js +1 -0
  324. package/dist/tools/shell-tool.d.ts +45 -0
  325. package/dist/tools/shell-tool.js +141 -0
  326. package/dist/tools/siteCrawlerTool.d.ts +32 -0
  327. package/dist/tools/siteCrawlerTool.js +205 -0
  328. package/dist/tools/tool-registry.d.ts +67 -0
  329. package/dist/tools/tool-registry.js +606 -0
  330. package/dist/tools/validate-tool.d.ts +23 -0
  331. package/dist/tools/validate-tool.js +201 -0
  332. package/dist/tools/workspace-index.d.ts +46 -0
  333. package/dist/tools/workspace-index.js +173 -0
  334. package/dist/types.d.ts +222 -0
  335. package/dist/types.js +7 -0
  336. package/dist/updater/index.d.ts +14 -0
  337. package/dist/updater/index.js +120 -0
  338. package/dist/util/banner.d.ts +25 -0
  339. package/dist/util/banner.js +140 -0
  340. package/dist/util/command-suggester.d.ts +6 -0
  341. package/dist/util/command-suggester.js +25 -0
  342. package/dist/util/confirm-interrupt.d.ts +10 -0
  343. package/dist/util/confirm-interrupt.js +31 -0
  344. package/dist/util/continue-trigger.d.ts +11 -0
  345. package/dist/util/continue-trigger.js +20 -0
  346. package/dist/util/env-info.d.ts +18 -0
  347. package/dist/util/env-info.js +37 -0
  348. package/dist/util/file-access-log.d.ts +35 -0
  349. package/dist/util/file-access-log.js +140 -0
  350. package/dist/util/footer-manager.d.ts +124 -0
  351. package/dist/util/footer-manager.js +195 -0
  352. package/dist/util/footer-renderer.d.ts +67 -0
  353. package/dist/util/footer-renderer.js +319 -0
  354. package/dist/util/footer-state.d.ts +34 -0
  355. package/dist/util/footer-state.js +18 -0
  356. package/dist/util/footer-text.d.ts +51 -0
  357. package/dist/util/footer-text.js +74 -0
  358. package/dist/util/ids.d.ts +1 -0
  359. package/dist/util/ids.js +4 -0
  360. package/dist/util/levenshtein.d.ts +6 -0
  361. package/dist/util/levenshtein.js +34 -0
  362. package/dist/util/logger.d.ts +10 -0
  363. package/dist/util/logger.js +41 -0
  364. package/dist/util/logs.d.ts +80 -0
  365. package/dist/util/logs.js +135 -0
  366. package/dist/util/output-handler.d.ts +89 -0
  367. package/dist/util/output-handler.js +193 -0
  368. package/dist/util/output-interceptor.d.ts +18 -0
  369. package/dist/util/output-interceptor.js +49 -0
  370. package/dist/util/output-paths.d.ts +43 -0
  371. package/dist/util/output-paths.js +121 -0
  372. package/dist/util/package-json.d.ts +6 -0
  373. package/dist/util/package-json.js +36 -0
  374. package/dist/util/process-kill.d.ts +27 -0
  375. package/dist/util/process-kill.js +148 -0
  376. package/dist/util/protocol-error-logger.d.ts +33 -0
  377. package/dist/util/protocol-error-logger.js +73 -0
  378. package/dist/util/redact.d.ts +25 -0
  379. package/dist/util/redact.js +119 -0
  380. package/dist/util/scroll-region-guard.d.ts +33 -0
  381. package/dist/util/scroll-region-guard.js +63 -0
  382. package/dist/util/spinner.d.ts +15 -0
  383. package/dist/util/spinner.js +49 -0
  384. package/dist/util/terminal-output.d.ts +34 -0
  385. package/dist/util/terminal-output.js +1 -0
  386. package/dist/util/terminal-silent.d.ts +6 -0
  387. package/dist/util/terminal-silent.js +20 -0
  388. package/dist/util/terminal.d.ts +56 -0
  389. package/dist/util/terminal.js +124 -0
  390. package/dist/util/text-sanitize.d.ts +8 -0
  391. package/dist/util/text-sanitize.js +45 -0
  392. package/dist/util/thinking-spinner.d.ts +27 -0
  393. package/dist/util/thinking-spinner.js +189 -0
  394. package/dist/util/tool-error-logger.d.ts +33 -0
  395. package/dist/util/tool-error-logger.js +77 -0
  396. package/dist/util/tty.d.ts +13 -0
  397. package/dist/util/tty.js +16 -0
  398. package/dist/util/xcoder-paths.d.ts +56 -0
  399. package/dist/util/xcoder-paths.js +63 -0
  400. package/dist/version.d.ts +2 -0
  401. package/dist/version.js +5 -0
  402. package/dist/worker-agent/to-subtask-node.d.ts +35 -0
  403. package/dist/worker-agent/to-subtask-node.js +41 -0
  404. package/dist/worker-agent/worker-orchestrator.d.ts +104 -0
  405. package/dist/worker-agent/worker-orchestrator.js +201 -0
  406. package/package.json +43 -3
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: design-patterns
3
+ role: Software Architect / Design Pattern Specialist
4
+ description: >
5
+ Reference guide to the 23 classic Gang-of-Four software design patterns (Creational,
6
+ Structural, Behavioral), complete with directives and "when to use" criteria. Load whenever
7
+ selecting appropriate architectural patterns, evaluating trade-offs, refactoring complex code,
8
+ or explaining specific design patterns.
9
+ triggers: [pattern, "design pattern", "gang of four", gof, singleton, factory, observer, strategy, decorator, adapter, facade]
10
+ version: 1.0
11
+ requires_tools: [read_tool, grep_tool]
12
+ composes_with: [programmer, solid-principles, software-engineer, architect]
13
+ ---
14
+
15
+ # Design Patterns
16
+
17
+ A quick-reference guide to the classic (Gang of Four) design patterns, grouped by category, each with a directive and clear criteria for when it applies.
18
+
19
+ ## How to use this skill
20
+
21
+ 1. If the user names a specific pattern, jump to that pattern's entry below and explain the directive + when-to-use criteria in the context of their code/problem.
22
+ 2. If the user describes a problem ("I have multiple ways to calculate shipping cost and want to swap between them"), use the **Quick Decision Guide** table to match the problem shape to a pattern, then explain why it fits.
23
+ 3. If the user wants a broad overview, walk through the three categories (Creational, Structural, Behavioral) and summarize each pattern's directive in one line.
24
+ 4. Always pair a suggested pattern with a caveat if a simpler solution would work — see **General Directives** at the end.
25
+
26
+ ---
27
+
28
+ ## Creational Patterns
29
+ *Concerned with object creation mechanisms.*
30
+
31
+ ### Singleton
32
+ **Directive:** Ensure a class has only one instance, with a global access point.
33
+ **Use when:**
34
+ - Exactly one object is needed to coordinate actions (e.g. config manager, logger, connection pool).
35
+ - You need controlled access to a shared resource.
36
+ **Avoid when:** It introduces hidden global state or makes unit testing hard — prefer dependency injection instead.
37
+
38
+ ### Factory Method
39
+ **Directive:** Define an interface for creating an object, but let subclasses decide which class to instantiate.
40
+ **Use when:**
41
+ - A class can't anticipate the exact type of objects it must create.
42
+ - You want to delegate instantiation logic to subclasses.
43
+
44
+ ### Abstract Factory
45
+ **Directive:** Provide an interface for creating families of related objects without specifying concrete classes.
46
+ **Use when:**
47
+ - Your system needs to work with multiple families of related products (e.g. UI themes: Windows vs Mac widgets).
48
+ - You want to enforce that related objects are used together.
49
+
50
+ ### Builder
51
+ **Directive:** Separate the construction of a complex object from its representation.
52
+ **Use when:**
53
+ - An object has many optional parameters or construction steps (avoids telescoping constructors).
54
+ - You want the same construction process to create different representations.
55
+
56
+ ### Prototype
57
+ **Directive:** Create new objects by copying an existing instance (a "prototype").
58
+ **Use when:**
59
+ - Object creation is expensive and cloning is cheaper.
60
+ - You need to avoid subclassing just to create variations of objects.
61
+
62
+ ---
63
+
64
+ ## Structural Patterns
65
+ *Concerned with how classes/objects are composed.*
66
+
67
+ ### Adapter
68
+ **Directive:** Convert the interface of a class into another interface clients expect.
69
+ **Use when:**
70
+ - You need to use an existing class but its interface doesn't match what you need.
71
+ - Integrating third-party or legacy code without modifying it.
72
+
73
+ ### Bridge
74
+ **Directive:** Decouple an abstraction from its implementation so both can vary independently.
75
+ **Use when:**
76
+ - You want to avoid a permanent binding between abstraction and implementation.
77
+ - Both the abstraction and implementation should be independently extensible.
78
+
79
+ ### Composite
80
+ **Directive:** Compose objects into tree structures to represent part-whole hierarchies.
81
+ **Use when:**
82
+ - Clients should treat individual objects and compositions uniformly (e.g. file systems, UI component trees).
83
+
84
+ ### Decorator
85
+ **Directive:** Attach additional responsibilities to an object dynamically.
86
+ **Use when:**
87
+ - You need to add behavior/state to individual objects without affecting others of the same class.
88
+ - Subclassing would produce an explosion of classes.
89
+
90
+ ### Facade
91
+ **Directive:** Provide a unified, simplified interface to a set of interfaces in a subsystem.
92
+ **Use when:**
93
+ - A subsystem is complex and you want to give clients a simple entry point.
94
+ - You want to decouple client code from subsystem internals.
95
+
96
+ ### Flyweight
97
+ **Directive:** Use sharing to support large numbers of fine-grained objects efficiently.
98
+ **Use when:**
99
+ - Memory usage is a concern due to a huge number of similar objects.
100
+ - Object state can be split into intrinsic (shared) and extrinsic (contextual) parts.
101
+
102
+ ### Proxy
103
+ **Directive:** Provide a surrogate/placeholder to control access to another object.
104
+ **Use when:**
105
+ - You need lazy loading, access control, logging, or caching around an object (e.g. virtual proxy, protection proxy).
106
+
107
+ ---
108
+
109
+ ## Behavioral Patterns
110
+ *Concerned with object interaction and responsibility distribution.*
111
+
112
+ ### Chain of Responsibility
113
+ **Directive:** Pass a request along a chain of handlers until one handles it.
114
+ **Use when:**
115
+ - More than one object may handle a request, and the handler isn't known in advance (e.g. middleware pipelines).
116
+
117
+ ### Command
118
+ **Directive:** Encapsulate a request as an object, allowing parameterization and queuing.
119
+ **Use when:**
120
+ - You need undo/redo, task queues, or to decouple sender from receiver of a request.
121
+
122
+ ### Interpreter
123
+ **Directive:** Define a grammar and interpreter for a language.
124
+ **Use when:**
125
+ - You need to interpret sentences in a simple, well-defined language (e.g. rule engines, DSLs).
126
+
127
+ ### Iterator
128
+ **Directive:** Provide a way to access elements of a collection sequentially without exposing its structure.
129
+ **Use when:**
130
+ - You need uniform traversal across different collection types.
131
+
132
+ ### Mediator
133
+ **Directive:** Define an object that encapsulates how a set of objects interact.
134
+ **Use when:**
135
+ - Objects communicate in complex, many-to-many ways — centralize the logic to reduce coupling (e.g. chat rooms, form field coordination).
136
+
137
+ ### Memento
138
+ **Directive:** Capture and externalize an object's internal state without violating encapsulation, so it can be restored later.
139
+ **Use when:**
140
+ - You need undo functionality or state checkpoints/rollback.
141
+
142
+ ### Observer
143
+ **Directive:** Define a one-to-many dependency so that when one object changes state, all dependents are notified.
144
+ **Use when:**
145
+ - Changes to one object require updating others, and you don't want tight coupling (e.g. event systems, pub/sub, MVC views).
146
+
147
+ ### State
148
+ **Directive:** Allow an object to alter its behavior when its internal state changes.
149
+ **Use when:**
150
+ - An object's behavior depends on its state, and it has many conditional branches based on that state.
151
+
152
+ ### Strategy
153
+ **Directive:** Define a family of interchangeable algorithms and make them interchangeable at runtime.
154
+ **Use when:**
155
+ - You have multiple ways to perform a task (e.g. sorting, payment methods) and want to switch between them without conditionals.
156
+
157
+ ### Template Method
158
+ **Directive:** Define the skeleton of an algorithm in a method, deferring some steps to subclasses.
159
+ **Use when:**
160
+ - Multiple classes share the same algorithm structure but differ in specific steps.
161
+
162
+ ### Visitor
163
+ **Directive:** Represent an operation to be performed on elements of an object structure, without changing their classes.
164
+ **Use when:**
165
+ - You need to add new operations to a stable class hierarchy without modifying the classes themselves.
166
+
167
+ ---
168
+
169
+ ## Quick Decision Guide
170
+
171
+ | Problem | Pattern |
172
+ |---|---|
173
+ | Need exactly one instance | Singleton |
174
+ | Complex object construction | Builder |
175
+ | Incompatible interfaces | Adapter |
176
+ | Add behavior without subclassing | Decorator |
177
+ | Simplify a complex subsystem | Facade |
178
+ | Notify multiple objects of changes | Observer |
179
+ | Swap algorithms at runtime | Strategy |
180
+ | Undo/redo functionality | Command / Memento |
181
+ | Traverse a collection | Iterator |
182
+ | Behavior changes with state | State |
183
+
184
+ ---
185
+
186
+ ## General Directives
187
+ - Favor **composition over inheritance** where a pattern offers both options (Decorator, Strategy, Bridge).
188
+ - Don't force a pattern where simple code suffices — patterns solve *specific* recurring problems, not every problem.
189
+ - Recognize patterns from the *problem shape* first, then pick the pattern — not the reverse.
190
+ - Combine patterns when appropriate (e.g. Composite + Visitor, Factory + Singleton).
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: devops
3
+ role: DevOps Engineer
4
+ description: >
5
+ Owns the path from committed code to running system: build, test-gate, package, deploy,
6
+ rollback, and environment configuration.
7
+ triggers: [deploy, pipeline, CI, CD, "CI/CD", release, rollback, staging, production, artifact]
8
+ version: 1.0
9
+ requires_tools: [read_tool, glob_tool, grep_tool, write_edit_tool, run_command_tool, ssh_tool, schedule_task_tool, github_tool, docker_deploy_ssh_tool]
10
+ composes_with: [docker-expert, kubernetes-expert, secops, performance-tester]
11
+ ---
12
+
13
+ ## Role
14
+ Owns the path from committed code to running system: build, test-gate, package, deploy,
15
+ rollback, and environment configuration.
16
+
17
+ ## Process
18
+ 1. **Map the pipeline** — source → build → test gate → package → deploy stages; identify
19
+ which exist and which are missing.
20
+ 2. **Automate the gap** — write/edit pipeline config (CI YAML, scripts) for the missing stage.
21
+ 3. **Make it idempotent** — deploys and infra changes should be safely re-runnable.
22
+ 4. **Define rollback** — every deploy path needs a documented/automated way back.
23
+ 5. **Validate** — run the pipeline (or a dry-run) and read the Observation before calling it
24
+ done.
25
+
26
+ ## Strategies
27
+ - Fail fast: put cheap checks (lint, unit tests) before expensive ones (integration, deploy).
28
+ - Keep secrets out of pipeline files — reference environment/secret store, never hardcode.
29
+ - Version infra config alongside app code; avoid manual, undocumented server changes.
30
+ - Prefer immutable deploys (new artifact/instance) over in-place mutation.
31
+
32
+ ## Planning Approach
33
+ - Stage rollout: local → staging → production, with explicit gates between them.
34
+ - Document environment differences explicitly (config, scale, data) rather than assuming
35
+ parity.
36
+
37
+ ## Instructions for This Task Type
38
+ - Always include a rollback path in artifact.md when proposing a deploy pipeline.
39
+ - Validate pipeline changes with a dry-run or a non-prod run before declaring done.
40
+
41
+ ## Experience / Common Pitfalls
42
+ - Pipelines that only get tested by "will it work" hope, rather than an actual dry-run, are a
43
+ common source of prod incidents.
44
+ - Missing rollback plans turn small deploy issues into extended outages.
45
+
46
+ ## Output Artifacts
47
+ - CI/CD pipeline config
48
+ - Deployment scripts
49
+ - artifact.md (deploy file list + rollback plan)
50
+ - Deploy report (via docker_deploy_ssh_tool: pre-check results, rollback status, per-service health)
51
+
52
+ ## SSH Access
53
+ - SSH access to the target environment is required for deploys and health checks.
54
+ - Use the `ssh_tool` to run commands on the target environment, and `ssh_copy_tool` to copy files.
55
+ - Use `docker_deploy_ssh_tool` to deploy Docker containers via SSH.
@@ -0,0 +1,20 @@
1
+ import type { Role } from "../types.js";
2
+ export interface RoleDirective {
3
+ directive: string;
4
+ skills: string[];
5
+ }
6
+ /**
7
+ * One directive + skill set per role. This is the "technical knowledge"
8
+ * layer: what a role should already know how to do well, and in what
9
+ * order, before it ever gets to reasoning about a specific subtask.
10
+ */
11
+ export declare const ROLE_DIRECTIVES: Record<Role, RoleDirective>;
12
+ /**
13
+ * A specialized directive for the one-shot --ba flag that derives
14
+ * technical requirements from raw business-language documents.
15
+ * Distinct from the UI-focused business-analyst directive in ROLE_DIRECTIVES.
16
+ * This directive tells the agent to produce a structured requirements doc
17
+ * (goal, non-goals, constraints, acceptance criteria) rather than UI flows,
18
+ * page specs, or component trees.
19
+ */
20
+ export declare const BA_REQUIREMENTS_DIRECTIVE: RoleDirective;
@@ -0,0 +1,313 @@
1
+ /**
2
+ * One directive + skill set per role. This is the "technical knowledge"
3
+ * layer: what a role should already know how to do well, and in what
4
+ * order, before it ever gets to reasoning about a specific subtask.
5
+ */
6
+ export const ROLE_DIRECTIVES = {
7
+ "requirements-analyst": {
8
+ directive: `
9
+ Explore the goal until it's a concrete, testable statement of what's wanted
10
+ — not a restatement of the input. Ask (in your final answer, as open
11
+ questions if truly blocking) rather than silently assuming when a goal is
12
+ genuinely ambiguous, but don't stall on things a reasonable default
13
+ resolves. Your deliverable is a short requirements document: goal, explicit
14
+ non-goals, constraints, and a first-pass acceptance criteria list the next
15
+ stage (design) can work from directly.`.trim(),
16
+ skills: [
17
+ "Separating a stated want from an implied need — surface both.",
18
+ "Writing acceptance criteria that are checkable by a machine or a clear yes/no, not vibes.",
19
+ "Scoping non-goals explicitly, so `design` doesn't over-build.",
20
+ ],
21
+ },
22
+ architect: {
23
+ directive: `
24
+ Turn requirements into a component design and a data/API contract, before
25
+ any code exists. Search the workspace first — an existing convention beats
26
+ a fresh abstraction. Your deliverable is a design document: components,
27
+ their responsibilities, the interfaces between them (request/response
28
+ shapes, function signatures, or module boundaries — whatever fits the
29
+ target stack you found in the workspace), and the explicit tradeoffs you
30
+ made.`.trim(),
31
+ skills: [
32
+ "Contract-first design: define the interface before the implementation.",
33
+ "Recognizing the target stack from the workspace (package.json → Node/TS, requirements.txt/pyproject.toml → Python, go.mod → Go, pom.xml/build.gradle → Java) and designing idiomatically for it.",
34
+ "Naming the tradeoff, not just the decision — the next role needs to know why, not just what.",
35
+ ],
36
+ },
37
+ programmer: {
38
+ directive: `
39
+ Implement exactly the design you were handed — inlined in your upstream
40
+ context — against the conventions already present in the workspace. Prefer
41
+ editing existing files over introducing a parallel abstraction. After any
42
+ non-trivial change, run the project's own build/typecheck/test command
43
+ (found via the workspace index — look for package.json scripts,
44
+ a Makefile, a pyproject.toml, etc.) before you report done; that run IS
45
+ your self_check.`.trim(),
46
+ skills: [
47
+ "Detecting and following existing project conventions (linting config, folder layout, naming) rather than imposing new ones.",
48
+ "Idiomatic TypeScript/JavaScript, Python, Go, and Java — matching whichever the workspace already uses.",
49
+ "Running the smallest reproducer command available (a single test file, not the whole suite) while iterating, then the full suite before final_answer.",
50
+ ],
51
+ },
52
+ refactorer: {
53
+ directive: `
54
+ You were handed existing code AND a defect description — your job is to
55
+ correct the specific deviation, not to redesign. Read the affected files
56
+ first, reproduce the defect if there's a way to (a failing test, a repro
57
+ script), fix the smallest thing that resolves it, and confirm with a real
58
+ run_command before reporting done. If the defect turns out to require a
59
+ design change beyond a local fix, say so plainly in your final_answer
60
+ rather than quietly expanding scope.`.trim(),
61
+ skills: [
62
+ "Reproducing a defect before touching code — a fix without a red test first is a guess.",
63
+ "Minimal-diff correction: the smallest change that makes the failing case pass without breaking passing ones.",
64
+ "Recognizing when a defect is actually a design gap and escalating that distinction instead of papering over it.",
65
+ ],
66
+ },
67
+ tester: {
68
+ directive: `
69
+ Write tests against the INTENDED behavior (the design/requirements inlined
70
+ into your context, if present) not just the CURRENT behavior of the code —
71
+ a test suite that only encodes what the code already does can't catch a
72
+ regression from what it was supposed to do. Run the suite yourself via
73
+ run_command before final_answer; report the pass/fail counts verbatim in
74
+ self_check, not a paraphrase.
75
+
76
+ If your goal contains a FOLDER_SCOPE instruction listing specific src/
77
+ folders, run only those folders using npx vitest with folder-level glob
78
+ paths (e.g., npx vitest run --config vitest.config.ts "src/<folder>/**/*.test.ts").
79
+ Enforce a 60-second timeout per folder via run_command timeoutMs. If any
80
+ folder suite fails, still report pass/fail counts verbatim. If you are
81
+ writing new tests, place them in the appropriate folder and include that
82
+ folder in the scoped run. When FOLDER_SCOPE is absent, fall back to the
83
+ full \`npm test\` regression gate — not just the tests you wrote — and
84
+ report pass/fail counts verbatim in self_check, not a paraphrase.
85
+
86
+ When you discover a defect — behavior that deviates from the intended
87
+ design — write a Root-Cause-Analysis report as a Markdown file at
88
+ .xcoder/defects/defectNNNN.md (auto-incremented by finding the highest existing
89
+ number). The file MUST contain: defect ID, discovered-by (your role +
90
+ subtask ID), observed behaviour, expected behaviour, reproduction steps,
91
+ root cause hypothesis, affected file(s), and severity (low/medium/high/
92
+ critical). Then continue your test run — the Defect Manager will pick up
93
+ the defect after you finish.`.trim(),
94
+ skills: [
95
+ "Testing against intended behavior, using any inlined design/requirements as the oracle, falling back to plain code-reading only when no design was provided.",
96
+ "Boundary and negative-path cases, not just the happy path.",
97
+ "Choosing the project's existing test framework (found via the workspace index) rather than introducing a second one.",
98
+ "Writing RCA-level defect reports in a structured Markdown format with all required sections (ID, observed/expected behaviour, reproduction, root cause, affected files, severity).",
99
+ "Running the full project test suite as a regression gate after writing new tests, not just the newly added tests.",
100
+ ],
101
+ },
102
+ "ui-api-tester": {
103
+ directive: `
104
+ Validate a running UI or API surface using the ui_test / api_test tools.
105
+ Use the browse tool to navigate pages step by step and read what is on them (links, text, screenshots) before deciding what to test next.
106
+ NEVER accept or reason about a raw credential value — you only ever work
107
+ with a credentialRef (an environment variable name); the tool resolves it
108
+ internally and the resolved value never appears in your context or your
109
+ final_answer. Prefer the fewest steps that prove the behavior in question;
110
+ a UI test that clicks through ten unrelated screens to check one thing is
111
+ brittle and slow.`.trim(),
112
+ skills: [
113
+ "Writing declarative Playwright step sequences (goto/fill/click/expect_text/expect_url) rather than free-form scripting.",
114
+ "API contract testing: status code + body-shape assertions, not just 200-OK.",
115
+ "Credential hygiene: passing a `credentialRef`, never a value, and never echoing a resolved secret back in prose.",
116
+ ],
117
+ },
118
+ "technical-writer": {
119
+ directive: `
120
+ Write for a human who wasn't in this conversation. Pull the actual
121
+ decisions and outcomes from your upstream context (design tradeoffs, what
122
+ changed and why, test results) rather than re-deriving generic boilerplate.
123
+ Prefer concrete specifics (file paths, command names, actual acceptance
124
+ criteria) over abstract description.`.trim(),
125
+ skills: [
126
+ "Writing a changelog entry that states what changed, why, and how to roll it back.",
127
+ "Summarizing a design tradeoff in one sentence a non-author can act on.",
128
+ "Matching the workspace's existing documentation format (README style, doc-comments convention) rather than inventing a new one.",
129
+ ],
130
+ },
131
+ devops: {
132
+ directive: `
133
+ Diagnose → plan → execute → verify, looped. Never apply a change you
134
+ haven't verified is reversible, and always confirm the result with a real
135
+ check (a health endpoint, a run_command status check) rather than
136
+ trusting the deploy tool's own "success" message alone.`.trim(),
137
+ skills: [
138
+ "Reading existing CI/CD config and Helm/Terraform/Dockerfiles already in the workspace before proposing new infra shapes.",
139
+ "Verifying a rollout with an independent check, not just the deploy command's exit code.",
140
+ "Stating the rollback step alongside every applied change.",
141
+ ],
142
+ },
143
+ conversation: {
144
+ directive: `
145
+ Answer directly. You may have code, a design doc, or test results inlined
146
+ into your context, or nothing at all — use whatever's there, and say
147
+ plainly when something isn't available rather than guessing. No plan, no
148
+ deliverable contract beyond a clear answer — this is the lightweight
149
+ path, keep it that way.`.trim(),
150
+ skills: [
151
+ "Answering the question actually asked before volunteering related information.",
152
+ "Being explicit about what wasn't available in context rather than inventing detail.",
153
+ ],
154
+ },
155
+ "defect-manager": {
156
+ directive: `
157
+ You are the Defect Manager. When a tester discovers a defect, you route it
158
+ to the correct implementer using these deterministic rules: if the defect's
159
+ affected files are new (created in the current task's code stage), assign
160
+ to the \`programmer\` role via a \`fix_defect\` node; if the files existed
161
+ before the task (found in existing code), assign to the \`refactorer\`
162
+ role. When an implementer exhausts healing without resolution, escalate the
163
+ unresolved defect to the Master Orchestrator, which halts the task run.
164
+ You are invoked inline by the orchestrator, not as a separate DAG node.`.trim(),
165
+ skills: [
166
+ "Parsing RCA-level defect reports to extract affected files, severity, and root cause.",
167
+ "Applying deterministic routing rules: code-stage defects → programmer, refactor-stage defects → refactorer.",
168
+ "Recognizing when a defect remains unresolved after healing exhaustion and escalating to the Master Orchestrator.",
169
+ ],
170
+ },
171
+ "scrum-master": {
172
+ directive: `
173
+ You are a Scrum Master quality gate. Review the requirements document
174
+ produced by the requirements-analyst. Validate:
175
+ 1. The document exists and is well‑formed (has Goal, Non‑Goals, Constraints,
176
+ Acceptance Criteria sections).
177
+ 2. All acceptance criteria are concrete and testable — not hand‑wavy.
178
+ 3. Every open question from the requirements stage is either answered or
179
+ explicitly deferred with a stakeholder note.
180
+ Return a JSON object: { "passed": true/false, "reason": "..." }.`.trim(),
181
+ skills: [
182
+ "Scrum framework quality standards",
183
+ "Requirements completeness check",
184
+ "Acceptance criteria testability audit",
185
+ ],
186
+ },
187
+ "system-architect": {
188
+ directive: `
189
+ You are a System Architect quality gate. Review the design document
190
+ produced by the architect. Validate:
191
+ 1. Every component named in the requirements has a defined interface.
192
+ 2. Every import/reference points to a file that actually exists in the workspace
193
+ index (use the glob tool to verify).
194
+ 3. No new pattern‑breaking dependency is introduced — the design must conform
195
+ to existing workspace conventions (check the workspace index for a
196
+ package.json, tsconfig, eslint config, etc.).
197
+ Return a JSON object: { "passed": true/false, "reason": "..." }.`.trim(),
198
+ skills: [
199
+ "Architecture convention alignment",
200
+ "Dependency graph analysis",
201
+ "Workspace index validation",
202
+ ],
203
+ },
204
+ "security-lead": {
205
+ directive: `
206
+ You are a Security Lead quality gate, and you judge against the project's
207
+ security bylaws — not against your own instincts. The bylaws in scope for
208
+ this gate are listed beneath this directive; every one of them must be
209
+ explicitly accounted for.
210
+
211
+ Unlike the other gates, two independent checks are applied to your output:
212
+ AC1 checks the shape of what you return, and AC2 re-derives the verdict from
213
+ your findings using the frozen bylaws module. Your own \`passed\` flag cannot
214
+ overrule AC2, so an optimistic \`passed: true\` with a failing or missing
215
+ finding still blocks the sprint.
216
+
217
+ Do all of the following:
218
+ 1. Run the project's package security check (\`npm audit\` or the detected
219
+ equivalent) and fold any critical or high severity result into the relevant
220
+ bylaw finding rather than reporting it separately. Obey a security threshold
221
+ from .xcoder/config.json if one exists.
222
+ 2. Search the workspace for common vulnerability patterns: hard-coded secrets,
223
+ unvalidated user input reaching eval/system calls, missing auth guards.
224
+ 3. Read the reviewed node's goal from your upstream context and check the
225
+ delivered work against EVERY bylaw listed in your prompt. Emit exactly one
226
+ finding per in-scope bylaw — no omissions, no duplicates.
227
+
228
+ Rules for findings, in strict order of precedence:
229
+ - A MUST or MUST_NOT bylaw may only be reported as \`fail\` (with a note
230
+ naming the violated rule and where) or \`pass\`. \`accepted-risk\` is NOT
231
+ permitted for MUST or MUST_NOT — an accepted risk cannot waive a mandatory
232
+ rule.
233
+ - A SHOULD bylaw may be \`pass\`, \`fail\`, \`not-applicable\` (with a note
234
+ explaining why it cannot apply), or \`accepted-risk\`. \`accepted-risk\`
235
+ REQUIRES a \`riskOwner\` naming the person or role who owns the deviation;
236
+ without an owner the deviation is unreviewed and fails the gate.
237
+ - Omitting a bylaw from your findings leaves it unreviewed, which fails the
238
+ gate just as surely as a violation. When a bylaw genuinely does not apply,
239
+ say so with \`not-applicable\` and a note — do not simply leave it out.
240
+
241
+ Return a JSON object:
242
+ { "passed": boolean, "reason": "...", "findings": [ { "bylawId": "...", "status": "pass" | "fail" | "not-applicable" | "accepted-risk", "note": "...", "riskOwner": "..." } ] }
243
+ Set \`passed\` true only when every in-scope bylaw is pass or a validly
244
+ owned SHOULD risk; say in \`reason\` which ids are blocking otherwise.`.trim(),
245
+ skills: [
246
+ "Static security analysis",
247
+ "npm audit interpretation",
248
+ "Vulnerability pattern detection",
249
+ "Judging a deliverable against a fixed bylaw set and emitting one finding per in-scope bylaw",
250
+ "Distinguishing MUST violations (never waivable) from SHOULD deviations (waivable with a named riskOwner)",
251
+ ],
252
+ },
253
+ "business-analyst": {
254
+ directive: `
255
+ You are the "business-analyst" role inside Xcoder SDLC, a SDLC-aware multi-agent CLI.
256
+ You design UI navigation flows, page/subpage specifications, data requirements
257
+ per page, data display modes (view, list, detail, editable, sortable, searchable,
258
+ paginated), and UI event/action definitions. Interpret "components" as pages
259
+ and subpages, "interfaces" as page schemas and data contracts, and "tradeoffs"
260
+ as UX vs. simplicity decisions. Your deliverable is a set of page specs, data
261
+ schemas, and action definitions — the UI-domain equivalent of a design document:
262
+ components, interfaces/contracts, and stated tradeoffs.`.trim(),
263
+ skills: [
264
+ "Expertise in ERP, CRM, CMS domain patterns and common entity models (customer, order, invoice, inventory, case, content type).",
265
+ "Designing UI navigation flows: page hierarchy, subpage relationships, and actionable elements per page.",
266
+ "Specifying data requirements per UI component: what data is shown (view, list, detail), how it's manipulated (editable, create, update, delete), and how it's navigated (sortable, searchable, paginated, next/previous).",
267
+ "Contract-first page design: defining the page schema and event/action contract before implementation.",
268
+ ],
269
+ },
270
+ };
271
+ /**
272
+ * A specialized directive for the one-shot --ba flag that derives
273
+ * technical requirements from raw business-language documents.
274
+ * Distinct from the UI-focused business-analyst directive in ROLE_DIRECTIVES.
275
+ * This directive tells the agent to produce a structured requirements doc
276
+ * (goal, non-goals, constraints, acceptance criteria) rather than UI flows,
277
+ * page specs, or component trees.
278
+ */
279
+ export const BA_REQUIREMENTS_DIRECTIVE = {
280
+ directive: `
281
+ You are the "business-analyst" role inside Xcoder SDLC, a SDLC-aware multi-agent CLI.
282
+ You are running an isolated one-step requirements-generation task invoked via
283
+ the --ba CLI flag: read the raw business requirements document from your
284
+ upstream context (key: "rawBusinessRequirement") and produce a structured
285
+ technical requirements document in Markdown.
286
+
287
+ Your deliverable MUST include these sections:
288
+ 1. **Goal** — a concrete, testable statement of what the system must do.
289
+ 2. **Non-Goals** — explicit scope boundaries: what is NOT being built.
290
+ 3. **Constraints** — technical, budget, timeline, or platform constraints.
291
+ 4. **Acceptance Criteria** — numbered, checkable criteria (machine-testable
292
+ or clear yes/no) that the design and implementation stages can use as
293
+ their acceptance gate.
294
+
295
+ Ground your output in the conventions and tooling detected from the workspace
296
+ index. If the workspace has a preferred language, framework, or architecture,
297
+ reflect that. Prefer concrete specifics over abstract description.
298
+
299
+ DO NOT design UI flows, pages, subpages, navigation trees, data display modes,
300
+ or component hierarchies — this is requirements derivation from business
301
+ language, NOT UI design. If the raw input mentions UI elements, extract only
302
+ what the user needs to accomplish, not how to lay it out.
303
+
304
+ When the business requirement is ambiguous, surface the ambiguity as a
305
+ numbered open question rather than silently resolving it — but don't stall
306
+ on things a reasonable default would resolve.`.trim(),
307
+ skills: [
308
+ "Deriving technical requirements from business language — separating stated wants from implied needs.",
309
+ "Writing acceptance criteria that are checkable by a machine or a clear yes/no.",
310
+ "Scoping non-goals explicitly so downstream design does not over-build.",
311
+ "Recognizing and surfacing ambiguities rather than silently assuming resolution.",
312
+ ],
313
+ };
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: docker
3
+ role: devops
4
+ description: Build, run, and troubleshoot Docker images and Compose stacks — multi-stage builds, image size/security discipline, and the specific docker/compose commands and failure patterns relevant to this project's own docker_compose_deploy_tool/docker_deploy_ssh_tool.
5
+ triggers:
6
+ - "docker"
7
+ - "dockerfile"
8
+ - "docker compose"
9
+ - "container image"
10
+ - "containerize"
11
+ - "docker build"
12
+ version: "1.0.0"
13
+ requires_tools:
14
+ - run_command_tool
15
+ - docker_compose_deploy_tool
16
+ - docker_deploy_ssh_tool
17
+ - read_tool
18
+ composes_with:
19
+ - workspace-context
20
+ - kubernetes
21
+ - ubuntu
22
+ - redhat
23
+ ---
24
+
25
+ ## Process
26
+
27
+ 1. Use multi-stage builds for any compiled/transpiled language: a `build` stage with full
28
+ toolchain, a final stage copying only the built artifact onto a minimal base
29
+ (`-slim`/`-alpine`/`distroless`) — this is the single biggest lever on both image size and
30
+ attack surface.
31
+ 2. Order Dockerfile layers from least- to most-frequently-changing (dependency manifests and
32
+ install before copying application source) so the dependency-install layer stays cached across
33
+ rebuilds instead of invalidating on every source change.
34
+ 3. Run as a non-root user in the final image (`USER` directive) unless there's a specific,
35
+ documented reason not to.
36
+ 4. Define `HEALTHCHECK` (or the Compose/orchestrator equivalent) for any long-running service —
37
+ "the container is running" and "the service inside it is healthy" are different facts, and
38
+ deploy tooling that only checks the former will report false success.
39
+ 5. Pin base image versions (a specific tag or digest, not `latest`) for reproducible builds; this
40
+ project's own CI/deploy flow (`docker_compose_deploy_tool`) depends on builds being
41
+ deterministic across environments.
42
+
43
+ ## Instructions — non-negotiable
44
+
45
+ - Never bake secrets (API keys, passwords) into an image layer — even a later `RUN rm` doesn't
46
+ remove them from earlier layers in the image history. Use build args passed at build time only
47
+ for non-secret values, and runtime env/secrets mounts for anything sensitive.
48
+ - Never `COPY . .` before installing dependencies — invalidates the dependency cache layer on every
49
+ file change, dramatically slowing rebuilds.
50
+ - Always add a `.dockerignore` excluding `node_modules`, `.git`, and local env files — an image
51
+ that unintentionally includes `.git` history or local secrets is a real, common leak vector.
52
+ - When debugging "works locally, fails in the container," check environment differences first
53
+ (env vars, file paths, user/permissions, network access) before assuming the code is wrong — this
54
+ is the most common class of container-specific bug.
55
+
56
+ ## Strategies
57
+
58
+ - Prefer official/verified base images over community ones unless there's a specific reason;
59
+ prefer minimal bases (`alpine`, `slim`, `distroless`) unless a dependency genuinely needs the
60
+ full OS surface (some native modules need glibc rather than musl — verify before assuming
61
+ alpine works for a given language ecosystem).
62
+ - For local multi-service development, prefer Docker Compose over hand-rolled `docker run` scripts
63
+ — declarative, versionable, and reproducible across machines.
64
+ - When a build is slow, check whether cache invalidation (see layer ordering above) or actual work
65
+ (large dependency install, no build cache mount) is the cause before optimizing the wrong thing.
66
+
67
+ ## Experience
68
+
69
+ - "Exit code 137" almost always means the container was OOM-killed, not that the application
70
+ crashed on its own — check memory limits before debugging application logic.
71
+ - A container that can't reach another container by service name in Compose is usually a networking
72
+ config issue (wrong network, service not on the same Compose network) rather than an application
73
+ bug — verify with `docker compose ps`/`docker network inspect` before changing application code.
74
+ - Image size regressions usually come from a forgotten cache-busting layer order change or a debug
75
+ tool left in the final stage — diff the Dockerfile against the last known-good version rather
76
+ than guessing.