xcoder-dna 0.0.0-stage → 1.3.1

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 (390) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +87 -2
  3. package/dist/agents/ai-chat-debate.d.ts +36 -0
  4. package/dist/agents/ai-chat-debate.js +300 -0
  5. package/dist/agents/ai-chat-report-writer.d.ts +7 -0
  6. package/dist/agents/ai-chat-report-writer.js +100 -0
  7. package/dist/agents/duplicate-detector.d.ts +41 -0
  8. package/dist/agents/duplicate-detector.js +65 -0
  9. package/dist/agents/genesis-agent.d.ts +61 -0
  10. package/dist/agents/genesis-agent.js +340 -0
  11. package/dist/agents/samurai-agent.d.ts +53 -0
  12. package/dist/agents/samurai-agent.js +279 -0
  13. package/dist/agents/sub-agent.d.ts +56 -0
  14. package/dist/agents/sub-agent.js +353 -0
  15. package/dist/backlog/backlog-requirement-validator.d.ts +10 -0
  16. package/dist/backlog/backlog-requirement-validator.js +60 -0
  17. package/dist/backlog/backlog-store.d.ts +29 -0
  18. package/dist/backlog/backlog-store.js +148 -0
  19. package/dist/backlog/po-agent.d.ts +16 -0
  20. package/dist/backlog/po-agent.js +121 -0
  21. package/dist/backlog/types.d.ts +25 -0
  22. package/dist/backlog/types.js +4 -0
  23. package/dist/bench/run.d.ts +11 -0
  24. package/dist/bench/run.js +185 -0
  25. package/dist/bench/types.d.ts +50 -0
  26. package/dist/bench/types.js +1 -0
  27. package/dist/cli/swarm.d.ts +10 -0
  28. package/dist/cli/swarm.js +100 -0
  29. package/dist/cli/task.d.ts +14 -0
  30. package/dist/cli/task.js +121 -0
  31. package/dist/cli/wbc-arg.d.ts +6 -0
  32. package/dist/cli/wbc-arg.js +40 -0
  33. package/dist/cli/wbc.d.ts +45 -0
  34. package/dist/cli/wbc.js +98 -0
  35. package/dist/commands/license.d.ts +9 -0
  36. package/dist/commands/license.js +140 -0
  37. package/dist/commands/release.d.ts +44 -0
  38. package/dist/commands/release.js +180 -0
  39. package/dist/commands/test.d.ts +50 -0
  40. package/dist/commands/test.js +385 -0
  41. package/dist/config/loadConfig.d.ts +82 -0
  42. package/dist/config/loadConfig.js +240 -0
  43. package/dist/config/secure-mode.d.ts +29 -0
  44. package/dist/config/secure-mode.js +63 -0
  45. package/dist/config/user-config.d.ts +39 -0
  46. package/dist/config/user-config.js +202 -0
  47. package/dist/engine/reasoning-engine.d.ts +21 -0
  48. package/dist/engine/reasoning-engine.js +59 -0
  49. package/dist/events/bus.d.ts +22 -0
  50. package/dist/events/bus.js +18 -0
  51. package/dist/index.d.ts +79 -0
  52. package/dist/index.js +77 -0
  53. package/dist/indexing/ignoreRules.d.ts +1 -0
  54. package/dist/indexing/ignoreRules.js +53 -0
  55. package/dist/instance-swarm/instance-swarm-orchestrator.d.ts +57 -0
  56. package/dist/instance-swarm/instance-swarm-orchestrator.js +204 -0
  57. package/dist/instance-swarm/protocol-name-resolver.d.ts +23 -0
  58. package/dist/instance-swarm/protocol-name-resolver.js +64 -0
  59. package/dist/license/gate.d.ts +31 -0
  60. package/dist/license/gate.js +188 -0
  61. package/dist/license/http-client.d.ts +43 -0
  62. package/dist/license/http-client.js +195 -0
  63. package/dist/license/manager.d.ts +39 -0
  64. package/dist/license/manager.js +175 -0
  65. package/dist/license/receipt.d.ts +27 -0
  66. package/dist/license/receipt.js +108 -0
  67. package/dist/license/state-codec.d.ts +72 -0
  68. package/dist/license/state-codec.js +218 -0
  69. package/dist/license/state-paths.d.ts +17 -0
  70. package/dist/license/state-paths.js +64 -0
  71. package/dist/license/store.d.ts +44 -0
  72. package/dist/license/store.js +223 -0
  73. package/dist/license/trust-anchor.d.ts +24 -0
  74. package/dist/license/trust-anchor.js +74 -0
  75. package/dist/license/types.d.ts +34 -0
  76. package/dist/license/types.js +19 -0
  77. package/dist/llm/budget.d.ts +23 -0
  78. package/dist/llm/budget.js +58 -0
  79. package/dist/llm/client.d.ts +53 -0
  80. package/dist/llm/client.js +122 -0
  81. package/dist/llm/factory.d.ts +14 -0
  82. package/dist/llm/factory.js +32 -0
  83. package/dist/orchestrator/defect-logger.d.ts +31 -0
  84. package/dist/orchestrator/defect-logger.js +101 -0
  85. package/dist/orchestrator/defect-manager.d.ts +118 -0
  86. package/dist/orchestrator/defect-manager.js +338 -0
  87. package/dist/orchestrator/defect-migration.d.ts +14 -0
  88. package/dist/orchestrator/defect-migration.js +174 -0
  89. package/dist/orchestrator/defect-store.d.ts +48 -0
  90. package/dist/orchestrator/defect-store.js +76 -0
  91. package/dist/orchestrator/healing.d.ts +14 -0
  92. package/dist/orchestrator/healing.js +11 -0
  93. package/dist/orchestrator/interactive-steering.d.ts +64 -0
  94. package/dist/orchestrator/interactive-steering.js +107 -0
  95. package/dist/orchestrator/interrupt-handler.d.ts +30 -0
  96. package/dist/orchestrator/interrupt-handler.js +70 -0
  97. package/dist/orchestrator/lesson-manager.d.ts +25 -0
  98. package/dist/orchestrator/lesson-manager.js +122 -0
  99. package/dist/orchestrator/progress-summary.d.ts +15 -0
  100. package/dist/orchestrator/progress-summary.js +106 -0
  101. package/dist/orchestrator/reasoning-score.d.ts +49 -0
  102. package/dist/orchestrator/reasoning-score.js +117 -0
  103. package/dist/orchestrator/swarm.d.ts +36 -0
  104. package/dist/orchestrator/swarm.js +77 -0
  105. package/dist/orchestrator/task-factory.d.ts +15 -0
  106. package/dist/orchestrator/task-factory.js +176 -0
  107. package/dist/orchestrator/validation-gate.d.ts +23 -0
  108. package/dist/orchestrator/validation-gate.js +155 -0
  109. package/dist/protocol/react-contract.d.ts +136 -0
  110. package/dist/protocol/react-contract.js +698 -0
  111. package/dist/protocol/wks-protocol-manager.d.ts +22 -0
  112. package/dist/protocol/wks-protocol-manager.js +72 -0
  113. package/dist/sdlc-runtime/conversation-runner.d.ts +8 -0
  114. package/dist/sdlc-runtime/conversation-runner.js +64 -0
  115. package/dist/sdlc-runtime/dag-utils.d.ts +15 -0
  116. package/dist/sdlc-runtime/dag-utils.js +67 -0
  117. package/dist/sdlc-runtime/defect-integration.d.ts +7 -0
  118. package/dist/sdlc-runtime/defect-integration.js +99 -0
  119. package/dist/sdlc-runtime/execution-loop.d.ts +38 -0
  120. package/dist/sdlc-runtime/execution-loop.js +274 -0
  121. package/dist/sdlc-runtime/lesson-recorder.d.ts +9 -0
  122. package/dist/sdlc-runtime/lesson-recorder.js +27 -0
  123. package/dist/sdlc-runtime/plan-initializer.d.ts +47 -0
  124. package/dist/sdlc-runtime/plan-initializer.js +135 -0
  125. package/dist/sdlc-runtime/progress-persister.d.ts +10 -0
  126. package/dist/sdlc-runtime/progress-persister.js +34 -0
  127. package/dist/sdlc-runtime/protocol-loader.d.ts +10 -0
  128. package/dist/sdlc-runtime/protocol-loader.js +21 -0
  129. package/dist/sdlc-runtime/reporting.d.ts +24 -0
  130. package/dist/sdlc-runtime/reporting.js +68 -0
  131. package/dist/sdlc-runtime/sdlc-orchestrator.d.ts +59 -0
  132. package/dist/sdlc-runtime/sdlc-orchestrator.js +170 -0
  133. package/dist/sdlc-runtime/sdlc-skill.d.ts +44 -0
  134. package/dist/sdlc-runtime/sdlc-skill.js +148 -0
  135. package/dist/sdlc-runtime/steering-handler.d.ts +14 -0
  136. package/dist/sdlc-runtime/steering-handler.js +51 -0
  137. package/dist/sdlc-runtime/trace-recorder.d.ts +10 -0
  138. package/dist/sdlc-runtime/trace-recorder.js +7 -0
  139. package/dist/security/index.d.ts +16 -0
  140. package/dist/security/index.js +12 -0
  141. package/dist/security/input-screen.d.ts +30 -0
  142. package/dist/security/input-screen.js +75 -0
  143. package/dist/security/tool-call-guard.d.ts +16 -0
  144. package/dist/security/tool-call-guard.js +163 -0
  145. package/dist/security/untrusted-content.d.ts +34 -0
  146. package/dist/security/untrusted-content.js +63 -0
  147. package/dist/skills/advanced-dfir/SKILL.md +85 -0
  148. package/dist/skills/advanced-pentest-lab/SKILL.md +88 -0
  149. package/dist/skills/analyst/SKILL.md +55 -0
  150. package/dist/skills/architect/SKILL.md +54 -0
  151. package/dist/skills/aws/SKILL.md +92 -0
  152. package/dist/skills/azure/SKILL.md +90 -0
  153. package/dist/skills/bylaw-context.d.ts +45 -0
  154. package/dist/skills/bylaw-context.js +61 -0
  155. package/dist/skills/bylaw-review.d.ts +20 -0
  156. package/dist/skills/bylaw-review.js +101 -0
  157. package/dist/skills/conversation/SKILL.md +29 -0
  158. package/dist/skills/design-patterns/SKILL.md +190 -0
  159. package/dist/skills/devops/SKILL.md +55 -0
  160. package/dist/skills/directives.d.ts +20 -0
  161. package/dist/skills/directives.js +313 -0
  162. package/dist/skills/docker/SKILL.md +76 -0
  163. package/dist/skills/docker-expert/SKILL.md +56 -0
  164. package/dist/skills/enterprise-systems-analyst/SKILL.md +83 -0
  165. package/dist/skills/enterprise-systems-analyst/references/crm.md +41 -0
  166. package/dist/skills/enterprise-systems-analyst/references/erp.md +40 -0
  167. package/dist/skills/enterprise-systems-analyst/references/financial-systems.md +35 -0
  168. package/dist/skills/enterprise-systems-analyst/references/hcm.md +38 -0
  169. package/dist/skills/enterprise-systems-analyst/references/mrp.md +37 -0
  170. package/dist/skills/enterprise-systems-analyst/references/scm.md +32 -0
  171. package/dist/skills/ethical-hacking-methodology/SKILL.md +119 -0
  172. package/dist/skills/externalSkillLoader.d.ts +25 -0
  173. package/dist/skills/externalSkillLoader.js +65 -0
  174. package/dist/skills/externalSkillRegistry.d.ts +33 -0
  175. package/dist/skills/externalSkillRegistry.js +94 -0
  176. package/dist/skills/filesystem-management/SKILL.md +61 -0
  177. package/dist/skills/first-run-seed.d.ts +26 -0
  178. package/dist/skills/first-run-seed.js +75 -0
  179. package/dist/skills/git-vcs/SKILL.md +84 -0
  180. package/dist/skills/kafka/SKILL.md +89 -0
  181. package/dist/skills/kubernetes/SKILL.md +93 -0
  182. package/dist/skills/kubernetes-expert/SKILL.md +54 -0
  183. package/dist/skills/openshift/SKILL.md +93 -0
  184. package/dist/skills/pentester/SKILL.md +59 -0
  185. package/dist/skills/performance-tester/SKILL.md +57 -0
  186. package/dist/skills/playwright-ui-tester/SKILL.md +67 -0
  187. package/dist/skills/programmer/SKILL.md +58 -0
  188. package/dist/skills/project-scaffolding/SKILL.md +133 -0
  189. package/dist/skills/qa-engineer/SKILL.md +91 -0
  190. package/dist/skills/rca/SKILL.md +58 -0
  191. package/dist/skills/redhat/SKILL.md +92 -0
  192. package/dist/skills/rosa/SKILL.md +80 -0
  193. package/dist/skills/scrum-framework/SKILL.md +74 -0
  194. package/dist/skills/scrum-framework/references/artifacts_and_quality.md +79 -0
  195. package/dist/skills/scrum-framework/references/roles_and_events.md +105 -0
  196. package/dist/skills/scrum-master-agent/SKILL.md +74 -0
  197. package/dist/skills/scrum-master-agent/references/behaviors.md +56 -0
  198. package/dist/skills/sdlc-skill.d.ts +1 -0
  199. package/dist/skills/sdlc-skill.js +4 -0
  200. package/dist/skills/secops/SKILL.md +52 -0
  201. package/dist/skills/secure-architect.bylaws.d.ts +68 -0
  202. package/dist/skills/secure-architect.bylaws.js +525 -0
  203. package/dist/skills/seed-skills.d.ts +48 -0
  204. package/dist/skills/seed-skills.js +213 -0
  205. package/dist/skills/skill-authoring/SKILL.md +123 -0
  206. package/dist/skills/skill-header.d.ts +51 -0
  207. package/dist/skills/skill-header.js +163 -0
  208. package/dist/skills/skill-path-guard.d.ts +41 -0
  209. package/dist/skills/skill-path-guard.js +95 -0
  210. package/dist/skills/skillRouter.d.ts +51 -0
  211. package/dist/skills/skillRouter.js +90 -0
  212. package/dist/skills/skills-root.d.ts +64 -0
  213. package/dist/skills/skills-root.js +168 -0
  214. package/dist/skills/software-architect/SKILL.md +77 -0
  215. package/dist/skills/software-engineer/SKILL.md +74 -0
  216. package/dist/skills/solid-principles/SKILL.md +94 -0
  217. package/dist/skills/task-planning/SKILL.md +115 -0
  218. package/dist/skills/tester/SKILL.md +54 -0
  219. package/dist/skills/ubuntu/SKILL.md +87 -0
  220. package/dist/skills/ui-ux-design/SKILL.md +114 -0
  221. package/dist/skills/workspace-context/SKILL.md +103 -0
  222. package/dist/sprint/controller.d.ts +37 -0
  223. package/dist/sprint/controller.js +220 -0
  224. package/dist/sprint/dag-builder.d.ts +14 -0
  225. package/dist/sprint/dag-builder.js +105 -0
  226. package/dist/sprint/reporter.d.ts +11 -0
  227. package/dist/sprint/reporter.js +97 -0
  228. package/dist/sprint/state-store.d.ts +10 -0
  229. package/dist/sprint/state-store.js +71 -0
  230. package/dist/sprint/types.d.ts +24 -0
  231. package/dist/sprint/types.js +4 -0
  232. package/dist/store/file-version-store.d.ts +24 -0
  233. package/dist/store/file-version-store.js +73 -0
  234. package/dist/store/task-store.d.ts +90 -0
  235. package/dist/store/task-store.js +166 -0
  236. package/dist/task-ingest/architect-detailer.d.ts +43 -0
  237. package/dist/task-ingest/architect-detailer.js +141 -0
  238. package/dist/task-ingest/detail-schema.d.ts +9 -0
  239. package/dist/task-ingest/detail-schema.js +195 -0
  240. package/dist/task-ingest/detailed-run.d.ts +36 -0
  241. package/dist/task-ingest/detailed-run.js +108 -0
  242. package/dist/task-ingest/extract-id.d.ts +9 -0
  243. package/dist/task-ingest/extract-id.js +24 -0
  244. package/dist/task-ingest/index.d.ts +23 -0
  245. package/dist/task-ingest/index.js +14 -0
  246. package/dist/task-ingest/ingest.d.ts +45 -0
  247. package/dist/task-ingest/ingest.js +163 -0
  248. package/dist/task-ingest/list-ingested.d.ts +13 -0
  249. package/dist/task-ingest/list-ingested.js +30 -0
  250. package/dist/task-ingest/pending-filter.d.ts +30 -0
  251. package/dist/task-ingest/pending-filter.js +59 -0
  252. package/dist/task-ingest/scanner.d.ts +56 -0
  253. package/dist/task-ingest/scanner.js +216 -0
  254. package/dist/task-ingest/source-reader.d.ts +25 -0
  255. package/dist/task-ingest/source-reader.js +93 -0
  256. package/dist/task-ingest/spec-builder.d.ts +34 -0
  257. package/dist/task-ingest/spec-builder.js +89 -0
  258. package/dist/task-ingest/wbs-extract.d.ts +50 -0
  259. package/dist/task-ingest/wbs-extract.js +226 -0
  260. package/dist/task-ingest/wbs-parser.d.ts +36 -0
  261. package/dist/task-ingest/wbs-parser.js +170 -0
  262. package/dist/tools/apiTestTool.d.ts +37 -0
  263. package/dist/tools/apiTestTool.js +128 -0
  264. package/dist/tools/ast-tools.d.ts +183 -0
  265. package/dist/tools/ast-tools.js +853 -0
  266. package/dist/tools/browse-tool.d.ts +105 -0
  267. package/dist/tools/browse-tool.js +394 -0
  268. package/dist/tools/credential.d.ts +17 -0
  269. package/dist/tools/credential.js +32 -0
  270. package/dist/tools/dependency-graph.d.ts +23 -0
  271. package/dist/tools/dependency-graph.js +164 -0
  272. package/dist/tools/edit-tool.d.ts +34 -0
  273. package/dist/tools/edit-tool.js +95 -0
  274. package/dist/tools/file-header-manager.d.ts +27 -0
  275. package/dist/tools/file-header-manager.js +153 -0
  276. package/dist/tools/fs-tools.d.ts +154 -0
  277. package/dist/tools/fs-tools.js +337 -0
  278. package/dist/tools/git-tools.d.ts +79 -0
  279. package/dist/tools/git-tools.js +348 -0
  280. package/dist/tools/github-tool.d.ts +48 -0
  281. package/dist/tools/github-tool.js +147 -0
  282. package/dist/tools/globTool.d.ts +20 -0
  283. package/dist/tools/globTool.js +34 -0
  284. package/dist/tools/grepTool.d.ts +19 -0
  285. package/dist/tools/grepTool.js +44 -0
  286. package/dist/tools/index-freshness.d.ts +58 -0
  287. package/dist/tools/index-freshness.js +190 -0
  288. package/dist/tools/index-glob.d.ts +48 -0
  289. package/dist/tools/index-glob.js +175 -0
  290. package/dist/tools/load-skill-tool.d.ts +15 -0
  291. package/dist/tools/load-skill-tool.js +114 -0
  292. package/dist/tools/patch-tools.d.ts +58 -0
  293. package/dist/tools/patch-tools.js +153 -0
  294. package/dist/tools/playwright-tool.d.ts +66 -0
  295. package/dist/tools/playwright-tool.js +121 -0
  296. package/dist/tools/project-detect.d.ts +20 -0
  297. package/dist/tools/project-detect.js +87 -0
  298. package/dist/tools/prompt-guidance.d.ts +22 -0
  299. package/dist/tools/prompt-guidance.js +23 -0
  300. package/dist/tools/scheduleTool.d.ts +19 -0
  301. package/dist/tools/scheduleTool.js +181 -0
  302. package/dist/tools/search-tools.d.ts +27 -0
  303. package/dist/tools/search-tools.js +78 -0
  304. package/dist/tools/sed-tool.d.ts +66 -0
  305. package/dist/tools/sed-tool.js +402 -0
  306. package/dist/tools/shell-result.d.ts +11 -0
  307. package/dist/tools/shell-result.js +1 -0
  308. package/dist/tools/shell-tool.d.ts +45 -0
  309. package/dist/tools/shell-tool.js +141 -0
  310. package/dist/tools/siteCrawlerTool.d.ts +32 -0
  311. package/dist/tools/siteCrawlerTool.js +205 -0
  312. package/dist/tools/tool-registry.d.ts +67 -0
  313. package/dist/tools/tool-registry.js +596 -0
  314. package/dist/tools/validate-tool.d.ts +23 -0
  315. package/dist/tools/validate-tool.js +201 -0
  316. package/dist/tools/workspace-index.d.ts +46 -0
  317. package/dist/tools/workspace-index.js +173 -0
  318. package/dist/types.d.ts +222 -0
  319. package/dist/types.js +7 -0
  320. package/dist/updater/index.d.ts +14 -0
  321. package/dist/updater/index.js +120 -0
  322. package/dist/util/banner.d.ts +25 -0
  323. package/dist/util/banner.js +140 -0
  324. package/dist/util/command-suggester.d.ts +6 -0
  325. package/dist/util/command-suggester.js +25 -0
  326. package/dist/util/confirm-interrupt.d.ts +10 -0
  327. package/dist/util/confirm-interrupt.js +31 -0
  328. package/dist/util/continue-trigger.d.ts +11 -0
  329. package/dist/util/continue-trigger.js +20 -0
  330. package/dist/util/env-info.d.ts +18 -0
  331. package/dist/util/env-info.js +37 -0
  332. package/dist/util/file-access-log.d.ts +35 -0
  333. package/dist/util/file-access-log.js +140 -0
  334. package/dist/util/footer-manager.d.ts +124 -0
  335. package/dist/util/footer-manager.js +195 -0
  336. package/dist/util/footer-renderer.d.ts +67 -0
  337. package/dist/util/footer-renderer.js +319 -0
  338. package/dist/util/footer-state.d.ts +34 -0
  339. package/dist/util/footer-state.js +18 -0
  340. package/dist/util/footer-text.d.ts +51 -0
  341. package/dist/util/footer-text.js +74 -0
  342. package/dist/util/ids.d.ts +1 -0
  343. package/dist/util/ids.js +4 -0
  344. package/dist/util/levenshtein.d.ts +6 -0
  345. package/dist/util/levenshtein.js +34 -0
  346. package/dist/util/logger.d.ts +10 -0
  347. package/dist/util/logger.js +41 -0
  348. package/dist/util/logs.d.ts +26 -0
  349. package/dist/util/logs.js +88 -0
  350. package/dist/util/output-handler.d.ts +89 -0
  351. package/dist/util/output-handler.js +193 -0
  352. package/dist/util/output-interceptor.d.ts +18 -0
  353. package/dist/util/output-interceptor.js +49 -0
  354. package/dist/util/output-paths.d.ts +43 -0
  355. package/dist/util/output-paths.js +121 -0
  356. package/dist/util/package-json.d.ts +6 -0
  357. package/dist/util/package-json.js +36 -0
  358. package/dist/util/process-kill.d.ts +27 -0
  359. package/dist/util/process-kill.js +148 -0
  360. package/dist/util/protocol-error-logger.d.ts +33 -0
  361. package/dist/util/protocol-error-logger.js +73 -0
  362. package/dist/util/redact.d.ts +25 -0
  363. package/dist/util/redact.js +103 -0
  364. package/dist/util/scroll-region-guard.d.ts +33 -0
  365. package/dist/util/scroll-region-guard.js +63 -0
  366. package/dist/util/spinner.d.ts +15 -0
  367. package/dist/util/spinner.js +49 -0
  368. package/dist/util/terminal-output.d.ts +34 -0
  369. package/dist/util/terminal-output.js +1 -0
  370. package/dist/util/terminal-silent.d.ts +6 -0
  371. package/dist/util/terminal-silent.js +20 -0
  372. package/dist/util/terminal.d.ts +56 -0
  373. package/dist/util/terminal.js +124 -0
  374. package/dist/util/text-sanitize.d.ts +8 -0
  375. package/dist/util/text-sanitize.js +45 -0
  376. package/dist/util/thinking-spinner.d.ts +27 -0
  377. package/dist/util/thinking-spinner.js +189 -0
  378. package/dist/util/tool-error-logger.d.ts +33 -0
  379. package/dist/util/tool-error-logger.js +77 -0
  380. package/dist/util/tty.d.ts +13 -0
  381. package/dist/util/tty.js +16 -0
  382. package/dist/util/xcoder-paths.d.ts +56 -0
  383. package/dist/util/xcoder-paths.js +63 -0
  384. package/dist/version.d.ts +2 -0
  385. package/dist/version.js +4 -0
  386. package/dist/worker-agent/to-subtask-node.d.ts +35 -0
  387. package/dist/worker-agent/to-subtask-node.js +41 -0
  388. package/dist/worker-agent/worker-orchestrator.d.ts +104 -0
  389. package/dist/worker-agent/worker-orchestrator.js +201 -0
  390. package/package.json +38 -3
@@ -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.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: docker-expert
3
+ role: Container/Docker Specialist
4
+ description: >
5
+ Designs Dockerfiles, container images, and local multi-container setups. Load whenever the
6
+ task involves Dockerfiles, image builds, docker-compose, image size/security, or container
7
+ runtime issues.
8
+ triggers: [docker, dockerfile, container, image, "docker-compose", "docker build", "multi-stage build"]
9
+ version: 1.0
10
+ requires_tools: [read_tool, glob_tool, grep_tool, write_edit_tool, run_command_tool, docker_deploy_ssh_tool]
11
+ composes_with: [kubernetes-expert, devops, secops, performance-tester]
12
+ ---
13
+
14
+ ## Role
15
+ Owns container image correctness, size, and security: Dockerfile design, build efficiency,
16
+ and local orchestration via docker-compose.
17
+
18
+ ## Process
19
+ 1. **Pick base image** — smallest image that satisfies runtime needs (distroless/alpine
20
+ where compatible); pin versions, don't float `:latest`.
21
+ 2. **Author Dockerfile** — multi-stage build (build deps separate from runtime), minimal
22
+ final layer, non-root user.
23
+ 3. **Order layers for cache efficiency** — dependency install before source copy, so code
24
+ changes don't invalidate dependency layers.
25
+ 4. **Build and validate** — `docker build`, check image size, run the container, hit health
26
+ endpoints/smoke test before declaring done.
27
+ 5. **Compose for local dev** — docker-compose.yml wiring dependent services, volumes, and
28
+ networks as needed.
29
+
30
+ ## Strategies
31
+ - Multi-stage builds: keep build toolchain out of the runtime image.
32
+ - Run as non-root user in the final image; drop unnecessary capabilities.
33
+ - Pin base image digests/tags for reproducibility, not floating tags.
34
+ - .dockerignore mirrors .gitignore intent — keep build context minimal.
35
+
36
+ ## Planning Approach
37
+ - Decide build vs runtime image split before writing the Dockerfile, not after hitting a
38
+ bloated image.
39
+ - Plan volume/network topology for docker-compose based on actual service dependencies.
40
+
41
+ ## Instructions for This Task Type
42
+ - Always build and run the image (Validation) before declaring the Dockerfile done — don't
43
+ just review syntax.
44
+ - Report final image size and flag if it's unexpectedly large relative to the app.
45
+
46
+ ## Experience / Common Pitfalls
47
+ - Single-stage builds bloated with build tooling in the runtime image are the most common
48
+ inefficiency.
49
+ - Running as root in the container is a recurring security gap easily fixed at build time.
50
+
51
+ ## Output Artifacts
52
+ - Dockerfile
53
+ - docker-compose.yml (if applicable)
54
+ - .dockerignore
55
+ - Build/run validation report
56
+ - Deploy report (via docker_deploy_ssh_tool: pre-check results, rollback status, per-service health)
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: enterprise-systems-analyst
3
+ role: Business Analyst / Enterprise Systems Consultant
4
+ description: >
5
+ Expert guidance across requirements elicitation, documentation (BRD/FRD/user stories/use cases),
6
+ process mapping, stakeholder management, and gap analysis, with deep domain expertise in
7
+ enterprise business systems (ERP, MRP, CRM, SCM, HCM, Financials). Load whenever gathering
8
+ business requirements, documenting end-to-end workflows, conducting fit-gap analyses, or
9
+ evaluating enterprise software solutions.
10
+ triggers: [requirements, brd, frd, "user story", "use case", "process map", erp, mrp, crm, scm, hcm, "gap analysis", "stakeholder analysis", "fit-gap"]
11
+ version: 1.0
12
+ requires_tools: [read_tool, glob_tool, grep_tool]
13
+ composes_with: [architect, product-manager, process-engineer, domain-expert]
14
+ ---
15
+
16
+ # Business Analyst
17
+
18
+ Acts as an experienced Business Analyst (BA) who can run requirements work end-to-end and speak fluently in specific enterprise domains.
19
+
20
+ ## How to use this skill
21
+
22
+ 1. **Requirements/process work** (BRD, FRD, user stories, use cases, process maps, stakeholder or gap analysis) → use the **BA Core Toolkit** below.
23
+ 2. **Domain-specific question** (ERP, MRP, CRM, SCM, HCM, Financial Systems) → open the matching file in `references/` for module breakdowns, terminology, common pain points, and sample requirements. Load only the reference file(s) relevant to the user's question.
24
+ 3. **Mixed request** (e.g. "write a BRD for a CRM implementation") → combine both: use the BA Core Toolkit for structure/format, and the relevant domain reference for accurate content and terminology.
25
+ 4. If the domain isn't listed in `references/`, apply general BA method and note that domain-specific detail wasn't available rather than inventing terminology.
26
+
27
+ ---
28
+
29
+ ## BA Core Toolkit
30
+
31
+ ### Elicitation techniques
32
+ - **Interviews** — 1:1 with stakeholders for depth; best early in discovery.
33
+ - **Workshops (JAD sessions)** — group requirements gathering; good for resolving cross-functional conflicts fast.
34
+ - **Document analysis** — mining existing SOPs, contracts, system docs for as-is state.
35
+ - **Observation (job shadowing)** — watching actual work to catch requirements people don't think to mention.
36
+ - **Surveys** — scaling input across many stakeholders when interviews aren't feasible.
37
+ - **Prototyping** — mockups/wireframes to validate understanding before full build.
38
+
39
+ ### Documentation types
40
+ | Document | Purpose | Audience |
41
+ |---|---|---|
42
+ | **BRD** (Business Requirements Document) | Captures *why* — business needs, objectives, scope, success criteria | Sponsors, stakeholders |
43
+ | **FRD** (Functional Requirements Document) | Captures *what* the system must do, in detail | Dev/QA teams |
44
+ | **User Story** | Small, testable slice of functionality: *"As a [role], I want [goal], so that [benefit]"* | Agile teams |
45
+ | **Use Case** | Actor-system interaction flow, incl. alternate/exception paths | Dev/QA, detailed design |
46
+ | **Process Map (BPMN)** | Visual as-is/to-be workflow | Cross-functional stakeholders |
47
+
48
+ ### Analysis techniques
49
+ - **Gap Analysis** — compare current state ("as-is") to desired state ("to-be"); identify what's missing.
50
+ - **SWOT** — Strengths, Weaknesses, Opportunities, Threats; used in strategic/initial scoping.
51
+ - **MoSCoW prioritization** — Must have / Should have / Could have / Won't have, for scope negotiation.
52
+ - **RACI matrix** — Responsible, Accountable, Consulted, Informed; clarifies decision rights across stakeholders.
53
+ - **Root Cause Analysis (5 Whys, fishbone)** — for diagnosing a business problem before jumping to a solution.
54
+ - **Cost-Benefit / ROI analysis** — justifies a proposed change financially.
55
+
56
+ ### Stakeholder analysis
57
+ - Map stakeholders on **power vs. interest** to decide engagement level (manage closely, keep satisfied, keep informed, monitor).
58
+ - Identify the **process owner** (accountable for outcomes) vs. **end users** (day-to-day operators) — their requirements often differ and both matter.
59
+
60
+ ### Requirements quality checklist
61
+ A good requirement is: Clear, Unambiguous, Testable, Traceable (to a business objective), and Feasible. Flag requirements that fail these — e.g. vague ("system should be fast") needs a measurable target ("page load under 2 seconds").
62
+
63
+ ---
64
+
65
+ ## Domain References
66
+
67
+ | Domain | File | Covers |
68
+ |---|---|---|
69
+ | ERP | `references/erp.md` | Core modules, major vendors, fit-gap, data migration, integration |
70
+ | MRP | `references/mrp.md` | BOM, MPS, lot sizing, capacity planning, MRP I vs II |
71
+ | CRM | `references/crm.md` | Lead-to-cash pipeline, marketing automation, service/support, vendors |
72
+ | SCM | `references/scm.md` | Procurement, logistics, warehouse mgmt, demand planning, S&OP |
73
+ | HCM | `references/hcm.md` | Payroll, recruiting (ATS), performance mgmt, benefits admin |
74
+ | Financial Systems | `references/financial-systems.md` | GL, AP/AR, budgeting, financial close, compliance (SOX) |
75
+
76
+ ---
77
+
78
+ ## General Directives
79
+ - Lead with the **business problem**, not the system — a BA's job is translating business need into requirements, not selling a tool.
80
+ - Always distinguish **as-is vs. to-be** explicitly; conflating them causes scope confusion.
81
+ - When comparing systems/modules, note tradeoffs rather than declaring a single "best" — fit depends on company size, industry, and existing tech stack.
82
+ - Flag when a "requirement" is actually a **solution in disguise** (e.g. "we need a dropdown for X" is a UI solution — the real requirement is what decision that dropdown supports).
83
+ - Keep terminology consistent with the domain reference in use; enterprise systems overload terms (e.g. "order" means different things in CRM vs. ERP vs. MRP).
@@ -0,0 +1,41 @@
1
+ # CRM (Customer Relationship Management)
2
+
3
+ ## What it is
4
+ A system for managing all interactions with prospects and customers across marketing, sales, and service — the goal is a single view of the customer relationship instead of contact info scattered across inboxes and spreadsheets.
5
+
6
+ ## Core functional areas
7
+ - **Lead/Contact Management** — capturing and qualifying prospects, deduplication, contact/account hierarchy.
8
+ - **Sales Pipeline Management** — opportunity stages, forecasting, quote generation, deal tracking.
9
+ - **Marketing Automation** — email campaigns, lead scoring, nurture sequences, campaign ROI tracking.
10
+ - **Customer Service/Support** — case/ticket management, SLAs, knowledge base, omnichannel support (chat, email, phone).
11
+ - **Reporting/Analytics** — pipeline health, conversion rates, customer lifetime value (CLV), churn.
12
+
13
+ ## The lead-to-cash flow (typical)
14
+ Lead → Marketing Qualified Lead (MQL) → Sales Qualified Lead (SQL) → Opportunity → Quote → Closed-Won/Lost → (handoff to ERP for order fulfillment/invoicing, if separate systems).
15
+
16
+ ## Major vendors (landscape, not endorsements)
17
+ - **Enterprise:** Salesforce, Microsoft Dynamics 365 Sales, Oracle CX
18
+ - **Mid-market/SMB:** HubSpot, Zoho CRM, Pipedrive
19
+ - **Industry-specific:** Veeva (life sciences), ServiceTitan (field service)
20
+
21
+ ## Common BA tasks
22
+ - Defining lead scoring/qualification criteria (what makes a lead "sales-ready").
23
+ - Mapping the sales stage definitions and required exit criteria per stage (prevents deals "stuck" in a stage indefinitely).
24
+ - Specifying CRM-to-ERP integration points (e.g. Closed-Won opportunity should create a sales order in ERP without duplicate data entry).
25
+ - Data quality/dedup rules — CRM data rots fast without governance (duplicate accounts, stale contacts).
26
+ - Defining SLA rules for support cases (response time by priority/tier).
27
+
28
+ ## Common pain points driving CRM projects
29
+ - Sales reps tracking deals in personal spreadsheets — no pipeline visibility for leadership.
30
+ - Marketing and sales disagreeing on what counts as a qualified lead (misalignment kills conversion).
31
+ - No single customer view — support doesn't know what sales promised, sales doesn't know open support issues.
32
+ - Manual, error-prone handoff from "deal closed" to actual order fulfillment.
33
+
34
+ ## Sample requirements (illustrative)
35
+ - *"As a Sales Manager, I want automated stage-to-stage validation (e.g. can't move to 'Proposal' without an attached quote), so that pipeline data reflects real deal status."*
36
+ - *"As a Marketing Manager, I want leads auto-routed to the right sales rep based on territory and lead score, so that hot leads aren't sitting unassigned."*
37
+ - *"As a Support Agent, I want to see a customer's full purchase history and open opportunities on the case screen, so that I can respond with full context."*
38
+
39
+ ## Terminology notes
40
+ - "Opportunity" (CRM) ≠ "Order" (ERP) — an opportunity becomes an order only after it's won; conflating them in requirements causes integration design errors.
41
+ - "Account" in CRM usually means a company/organization, not a financial ledger account (as in ERP) — always clarify in cross-domain requirements docs.
@@ -0,0 +1,40 @@
1
+ # ERP (Enterprise Resource Planning)
2
+
3
+ ## What it is
4
+ A single integrated system that manages core business processes — finance, procurement, inventory, manufacturing, sales, HR — on one shared database, so departments stop working off disconnected spreadsheets and siloed tools.
5
+
6
+ ## Core modules
7
+ - **Financials / GL** — general ledger, accounts payable/receivable, fixed assets, financial close.
8
+ - **Procurement** — purchase requisitions, purchase orders, vendor management, three-way match (PO/receipt/invoice).
9
+ - **Inventory Management** — stock levels, warehouse locations, stock transfers, cycle counting.
10
+ - **Manufacturing/Production** — work orders, BOM, shop floor control (often integrates with or includes MRP — see `mrp.md`).
11
+ - **Sales & Order Management** — quote-to-order, order fulfillment, invoicing.
12
+ - **HR/Payroll** — often a lighter module vs. dedicated HCM systems (see `hcm.md`).
13
+ - **Reporting/BI** — cross-module dashboards and analytics.
14
+
15
+ ## Major vendors (landscape, not endorsements)
16
+ - **Enterprise/large:** SAP S/4HANA, Oracle Fusion Cloud ERP
17
+ - **Mid-market:** Microsoft Dynamics 365, NetSuite, Infor, Epicor
18
+ - **Manufacturing-focused:** SAP Business One, Sage X3
19
+
20
+ ## Common BA tasks on ERP projects
21
+ - **Fit-gap analysis** — compare out-of-box ERP functionality against documented business requirements; classify gaps as configuration, customization, or process-change-instead.
22
+ - **Business process reengineering** — ERP implementations often force process standardization; BA reconciles "how we do it today" against the system's native workflow.
23
+ - **Data migration requirements** — define what master data (customers, vendors, items, chart of accounts) must migrate, cleansing rules, and mapping from legacy systems.
24
+ - **Integration mapping** — document what other systems (CRM, e-commerce, banking, EDI) must connect to the ERP, and via what method (API, middleware, flat file).
25
+ - **Role/security matrix** — define who can see/do what (segregation of duties matters a lot here for financial controls).
26
+
27
+ ## Common pain points driving ERP projects
28
+ - Disconnected systems causing duplicate data entry and reconciliation effort.
29
+ - No real-time visibility into inventory, cash position, or order status.
30
+ - Manual, error-prone month-end close.
31
+ - Inability to scale reporting/compliance as the company grows (e.g. multi-entity, multi-currency).
32
+
33
+ ## Sample requirements (illustrative)
34
+ - *"As a Controller, I want the system to auto-post inventory transactions to the GL in real time, so that financial reports reflect current inventory value without manual journal entries."*
35
+ - *"As a Purchasing Manager, I want a three-way match between PO, receipt, and invoice before an invoice can be paid, so that we prevent duplicate or fraudulent payments."*
36
+ - *"As an Operations Director, I want role-based dashboards showing open orders by warehouse, so that fulfillment bottlenecks are visible without pulling manual reports."*
37
+
38
+ ## Terminology notes
39
+ - "Order" in ERP usually means a **sales order** or **purchase order** — distinct from a CRM "opportunity" or MRP "work order."
40
+ - "Chart of Accounts" (COA) is the backbone of financial reporting — changes to it late in a project are costly.
@@ -0,0 +1,35 @@
1
+ # Financial Systems
2
+
3
+ ## What it is
4
+ Covers the systems and processes for recording, controlling, and reporting a company's financial position — usually the financial core of an ERP, but sometimes a standalone/best-of-breed system.
5
+
6
+ ## Core functional areas
7
+ - **General Ledger (GL)** — the system of record for all financial transactions, organized by Chart of Accounts.
8
+ - **Accounts Payable (AP)** — vendor invoices, payment processing, three-way match (PO/receipt/invoice).
9
+ - **Accounts Receivable (AR)** — customer invoicing, cash application, collections, aging.
10
+ - **Fixed Assets** — asset tracking, depreciation schedules, disposal.
11
+ - **Budgeting/Planning (FP&A)** — budget creation, forecasting, variance analysis.
12
+ - **Financial Close/Consolidation** — month/quarter/year-end close process, multi-entity consolidation, intercompany eliminations.
13
+ - **Financial Reporting/Compliance** — statutory reporting, audit trail, controls (e.g. SOX in the US).
14
+
15
+ ## Common BA tasks
16
+ - Documenting the close process calendar and identifying manual/bottleneck steps (a classic driver for financial systems projects).
17
+ - Defining approval workflows and segregation-of-duties requirements (who can create a vendor vs. approve a payment — critical for fraud prevention and audit).
18
+ - Mapping Chart of Accounts structure and multi-entity/multi-currency requirements.
19
+ - Specifying audit trail requirements (who changed what, when — often a hard compliance requirement, not optional).
20
+ - Reconciliation requirements between subledgers (AP, AR, Fixed Assets) and the GL.
21
+
22
+ ## Common pain points driving financial systems projects
23
+ - Slow, manual month-end close (spreadsheet consolidation across entities).
24
+ - Weak controls — same person can create and approve a payment (audit finding waiting to happen).
25
+ - No real-time visibility into cash position or budget-vs-actual.
26
+ - Difficulty supporting multi-entity/multi-currency/multi-GAAP reporting as the company scales.
27
+
28
+ ## Sample requirements (illustrative)
29
+ - *"As a Controller, I want automated intercompany elimination entries during consolidation, so that the close process doesn't rely on manual spreadsheet reconciliation."*
30
+ - *"As an AP Clerk, I want the system to block invoice approval when a vendor is flagged as a duplicate or inactive, so that we prevent erroneous payments."*
31
+ - *"As a CFO, I want real-time budget-vs-actual dashboards by department, so that spending overruns are visible before period-end instead of after."*
32
+
33
+ ## Terminology notes
34
+ - "Close" refers to the period-end financial close process — distinct from "closing" a sales opportunity (CRM) or "closing" a work order (MRP/manufacturing). Always disambiguate in cross-domain documentation.
35
+ - SOX (Sarbanes-Oxley) compliance applies to US public companies and drives strict controls/audit-trail requirements — flag as a hard constraint, not a nice-to-have, when applicable.