aios-core 4.2.15 → 4.4.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 (329) hide show
  1. package/.aios-core/cli/commands/validate/index.js +1 -1
  2. package/.aios-core/core/code-intel/code-intel-client.js +19 -5
  3. package/.aios-core/core/code-intel/helpers/creation-helper.js +183 -0
  4. package/.aios-core/core/code-intel/helpers/devops-helper.js +166 -0
  5. package/.aios-core/core/code-intel/helpers/planning-helper.js +248 -0
  6. package/.aios-core/core/code-intel/helpers/qa-helper.js +187 -0
  7. package/.aios-core/core/code-intel/helpers/story-helper.js +146 -0
  8. package/.aios-core/core/code-intel/hook-runtime.js +186 -0
  9. package/.aios-core/core/code-intel/index.js +2 -0
  10. package/.aios-core/core/code-intel/providers/code-graph-provider.js +8 -0
  11. package/.aios-core/core/code-intel/providers/provider-interface.js +9 -0
  12. package/.aios-core/core/code-intel/providers/registry-provider.js +515 -0
  13. package/.aios-core/core/config/schemas/framework-config.schema.json +155 -7
  14. package/.aios-core/core/config/schemas/project-config.schema.json +329 -15
  15. package/.aios-core/core/config/template-overrides.js +84 -0
  16. package/.aios-core/core/docs/troubleshooting-guide.md +1 -1
  17. package/.aios-core/core/doctor/checks/agent-memory.js +63 -0
  18. package/.aios-core/core/doctor/checks/claude-md.js +56 -0
  19. package/.aios-core/core/doctor/checks/code-intel.js +131 -0
  20. package/.aios-core/core/doctor/checks/commands-count.js +81 -0
  21. package/.aios-core/core/doctor/checks/core-config.js +53 -0
  22. package/.aios-core/core/doctor/checks/entity-registry.js +53 -0
  23. package/.aios-core/core/doctor/checks/git-hooks.js +50 -0
  24. package/.aios-core/core/doctor/checks/graph-dashboard.js +48 -0
  25. package/.aios-core/core/doctor/checks/hooks-claude-count.js +118 -0
  26. package/.aios-core/core/doctor/checks/ide-sync.js +85 -0
  27. package/.aios-core/core/doctor/checks/index.js +46 -0
  28. package/.aios-core/core/doctor/checks/node-version.js +33 -0
  29. package/.aios-core/core/doctor/checks/npm-packages.js +35 -0
  30. package/.aios-core/core/doctor/checks/rules-files.js +61 -0
  31. package/.aios-core/core/doctor/checks/settings-json.js +121 -0
  32. package/.aios-core/core/doctor/checks/skills-count.js +72 -0
  33. package/.aios-core/core/doctor/fix-handler.js +165 -0
  34. package/.aios-core/core/doctor/formatters/json.js +14 -0
  35. package/.aios-core/core/doctor/formatters/text.js +59 -0
  36. package/.aios-core/core/doctor/index.js +94 -0
  37. package/.aios-core/core/graph-dashboard/cli.js +361 -0
  38. package/.aios-core/core/graph-dashboard/data-sources/code-intel-source.js +234 -0
  39. package/.aios-core/core/graph-dashboard/data-sources/metrics-source.js +95 -0
  40. package/.aios-core/core/graph-dashboard/data-sources/registry-source.js +106 -0
  41. package/.aios-core/core/graph-dashboard/formatters/dot-formatter.js +45 -0
  42. package/.aios-core/core/graph-dashboard/formatters/html-formatter.js +1437 -0
  43. package/.aios-core/core/graph-dashboard/formatters/json-formatter.js +13 -0
  44. package/.aios-core/core/graph-dashboard/formatters/mermaid-formatter.js +59 -0
  45. package/.aios-core/core/graph-dashboard/index.js +21 -0
  46. package/.aios-core/core/graph-dashboard/renderers/stats-renderer.js +217 -0
  47. package/.aios-core/core/graph-dashboard/renderers/status-renderer.js +125 -0
  48. package/.aios-core/core/graph-dashboard/renderers/tree-renderer.js +119 -0
  49. package/.aios-core/core/health-check/base-check.js +1 -1
  50. package/.aios-core/core/health-check/check-registry.js +1 -1
  51. package/.aios-core/core/health-check/checks/deployment/build-config.js +1 -1
  52. package/.aios-core/core/health-check/checks/deployment/ci-config.js +1 -1
  53. package/.aios-core/core/health-check/checks/deployment/deployment-readiness.js +1 -1
  54. package/.aios-core/core/health-check/checks/deployment/docker-config.js +1 -1
  55. package/.aios-core/core/health-check/checks/deployment/env-file.js +1 -1
  56. package/.aios-core/core/health-check/checks/deployment/index.js +1 -1
  57. package/.aios-core/core/health-check/checks/index.js +1 -1
  58. package/.aios-core/core/health-check/checks/local/disk-space.js +1 -1
  59. package/.aios-core/core/health-check/checks/local/environment-vars.js +1 -1
  60. package/.aios-core/core/health-check/checks/local/git-install.js +1 -1
  61. package/.aios-core/core/health-check/checks/local/ide-detection.js +1 -1
  62. package/.aios-core/core/health-check/checks/local/index.js +1 -1
  63. package/.aios-core/core/health-check/checks/local/memory.js +1 -1
  64. package/.aios-core/core/health-check/checks/local/network.js +1 -1
  65. package/.aios-core/core/health-check/checks/local/npm-install.js +1 -1
  66. package/.aios-core/core/health-check/checks/local/shell-environment.js +1 -1
  67. package/.aios-core/core/health-check/checks/project/agent-config.js +1 -1
  68. package/.aios-core/core/health-check/checks/project/aios-directory.js +1 -1
  69. package/.aios-core/core/health-check/checks/project/dependencies.js +1 -1
  70. package/.aios-core/core/health-check/checks/project/framework-config.js +1 -1
  71. package/.aios-core/core/health-check/checks/project/index.js +1 -1
  72. package/.aios-core/core/health-check/checks/project/node-version.js +1 -1
  73. package/.aios-core/core/health-check/checks/project/package-json.js +1 -1
  74. package/.aios-core/core/health-check/checks/project/task-definitions.js +1 -1
  75. package/.aios-core/core/health-check/checks/project/workflow-dependencies.js +1 -1
  76. package/.aios-core/core/health-check/checks/repository/branch-protection.js +1 -1
  77. package/.aios-core/core/health-check/checks/repository/commit-history.js +1 -1
  78. package/.aios-core/core/health-check/checks/repository/conflicts.js +1 -1
  79. package/.aios-core/core/health-check/checks/repository/git-repo.js +1 -1
  80. package/.aios-core/core/health-check/checks/repository/git-status.js +1 -1
  81. package/.aios-core/core/health-check/checks/repository/gitignore.js +1 -1
  82. package/.aios-core/core/health-check/checks/repository/index.js +1 -1
  83. package/.aios-core/core/health-check/checks/repository/large-files.js +1 -1
  84. package/.aios-core/core/health-check/checks/repository/lockfile-integrity.js +1 -1
  85. package/.aios-core/core/health-check/checks/services/api-endpoints.js +1 -1
  86. package/.aios-core/core/health-check/checks/services/claude-code.js +1 -1
  87. package/.aios-core/core/health-check/checks/services/gemini-cli.js +1 -1
  88. package/.aios-core/core/health-check/checks/services/github-cli.js +1 -1
  89. package/.aios-core/core/health-check/checks/services/index.js +1 -1
  90. package/.aios-core/core/health-check/checks/services/mcp-integration.js +1 -1
  91. package/.aios-core/core/health-check/engine.js +1 -1
  92. package/.aios-core/core/health-check/healers/backup-manager.js +1 -1
  93. package/.aios-core/core/health-check/healers/index.js +1 -1
  94. package/.aios-core/core/health-check/index.js +9 -2
  95. package/.aios-core/core/health-check/reporters/console.js +1 -1
  96. package/.aios-core/core/health-check/reporters/index.js +1 -1
  97. package/.aios-core/core/health-check/reporters/json.js +1 -1
  98. package/.aios-core/core/health-check/reporters/markdown.js +1 -1
  99. package/.aios-core/core/ids/layer-classifier.js +65 -0
  100. package/.aios-core/core/ids/registry-updater.js +49 -0
  101. package/.aios-core/core/index.esm.js +1 -1
  102. package/.aios-core/core/index.js +1 -1
  103. package/.aios-core/core/session/context-detector.js +2 -7
  104. package/.aios-core/core/synapse/context/context-tracker.js +9 -1
  105. package/.aios-core/core/synapse/engine.js +33 -13
  106. package/.aios-core/core/synapse/memory/memory-bridge.js +17 -43
  107. package/.aios-core/core/synapse/memory/synapse-memory-provider.js +201 -0
  108. package/.aios-core/core/synapse/runtime/hook-runtime.js +40 -2
  109. package/.aios-core/core/synapse/session/session-manager.js +3 -2
  110. package/.aios-core/core/synapse/utils/atomic-write.js +79 -0
  111. package/.aios-core/core-config.yaml +34 -1
  112. package/.aios-core/data/aios-kb.md +2 -2
  113. package/.aios-core/data/capability-detection.js +290 -0
  114. package/.aios-core/data/entity-registry.yaml +10450 -2129
  115. package/.aios-core/data/mcp-discipline.js +166 -0
  116. package/.aios-core/data/mcp-tool-examples.yaml +215 -0
  117. package/.aios-core/data/tok2-validation.js +168 -0
  118. package/.aios-core/data/tok3-token-comparison.js +123 -0
  119. package/.aios-core/data/tool-registry.yaml +648 -0
  120. package/.aios-core/data/tool-search-validation.js +174 -0
  121. package/.aios-core/data/workflow-chains.yaml +156 -0
  122. package/.aios-core/development/agents/aios-master.md +17 -10
  123. package/.aios-core/development/agents/analyst/MEMORY.md +33 -0
  124. package/.aios-core/development/agents/analyst.md +17 -10
  125. package/.aios-core/development/agents/architect/MEMORY.md +39 -0
  126. package/.aios-core/development/agents/architect.md +17 -10
  127. package/.aios-core/development/agents/data-engineer/MEMORY.md +32 -0
  128. package/.aios-core/development/agents/data-engineer.md +17 -10
  129. package/.aios-core/development/agents/dev/MEMORY.md +46 -0
  130. package/.aios-core/development/agents/dev.md +18 -11
  131. package/.aios-core/development/agents/devops/MEMORY.md +39 -0
  132. package/.aios-core/development/agents/devops.md +44 -10
  133. package/.aios-core/development/agents/pm/MEMORY.md +38 -0
  134. package/.aios-core/development/agents/pm.md +17 -10
  135. package/.aios-core/development/agents/po/MEMORY.md +45 -0
  136. package/.aios-core/development/agents/po.md +17 -10
  137. package/.aios-core/development/agents/qa/MEMORY.md +42 -0
  138. package/.aios-core/development/agents/qa.md +18 -11
  139. package/.aios-core/development/agents/sm/MEMORY.md +31 -0
  140. package/.aios-core/development/agents/sm.md +17 -10
  141. package/.aios-core/development/agents/squad-creator.md +18 -9
  142. package/.aios-core/development/agents/ux/MEMORY.md +31 -0
  143. package/.aios-core/development/agents/ux-design-expert.md +16 -9
  144. package/.aios-core/development/checklists/issue-triage-checklist.md +35 -0
  145. package/.aios-core/development/checklists/memory-audit-checklist.md +53 -0
  146. package/.aios-core/development/scripts/issue-triage.js +171 -0
  147. package/.aios-core/development/scripts/populate-entity-registry.js +412 -19
  148. package/.aios-core/development/scripts/unified-activation-pipeline.js +31 -10
  149. package/.aios-core/development/tasks/analyze-project-structure.md +48 -0
  150. package/.aios-core/development/tasks/apply-qa-fixes.md +7 -0
  151. package/.aios-core/development/tasks/architect-analyze-impact.md +8 -1
  152. package/.aios-core/development/tasks/brownfield-create-epic.md +41 -0
  153. package/.aios-core/development/tasks/brownfield-create-story.md +7 -0
  154. package/.aios-core/development/tasks/build-autonomous.md +7 -0
  155. package/.aios-core/development/tasks/create-deep-research-prompt.md +7 -0
  156. package/.aios-core/development/tasks/create-doc.md +44 -0
  157. package/.aios-core/development/tasks/create-next-story.md +17 -0
  158. package/.aios-core/development/tasks/create-suite.md +7 -0
  159. package/.aios-core/development/tasks/dev-develop-story.md +9 -1
  160. package/.aios-core/development/tasks/execute-checklist.md +7 -0
  161. package/.aios-core/development/tasks/github-devops-github-pr-automation.md +56 -0
  162. package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +70 -0
  163. package/.aios-core/development/tasks/github-issue-triage.md +118 -0
  164. package/.aios-core/development/tasks/health-check.yaml +206 -171
  165. package/.aios-core/development/tasks/kb-mode-interaction.md +3 -3
  166. package/.aios-core/development/tasks/plan-create-context.md +47 -1
  167. package/.aios-core/development/tasks/plan-create-implementation.md +55 -0
  168. package/.aios-core/development/tasks/po-close-story.md +7 -0
  169. package/.aios-core/development/tasks/pr-automation.md +5 -5
  170. package/.aios-core/development/tasks/qa-create-fix-request.md +7 -0
  171. package/.aios-core/development/tasks/qa-fix-issues.md +7 -0
  172. package/.aios-core/development/tasks/qa-gate.md +56 -0
  173. package/.aios-core/development/tasks/qa-review-story.md +32 -1
  174. package/.aios-core/development/tasks/release-management.md +7 -0
  175. package/.aios-core/development/tasks/resolve-github-issue.md +608 -0
  176. package/.aios-core/development/tasks/review-contributor-pr.md +152 -0
  177. package/.aios-core/development/tasks/setup-llm-routing.md +1 -1
  178. package/.aios-core/development/tasks/spec-critique.md +8 -0
  179. package/.aios-core/development/tasks/spec-gather-requirements.md +7 -0
  180. package/.aios-core/development/tasks/spec-research-dependencies.md +4 -0
  181. package/.aios-core/development/tasks/spec-write-spec.md +5 -0
  182. package/.aios-core/development/tasks/triage-github-issues.md +356 -0
  183. package/.aios-core/development/tasks/validate-agents.md +4 -0
  184. package/.aios-core/development/tasks/validate-next-story.md +17 -0
  185. package/.aios-core/development/templates/agent-handoff-tmpl.yaml +48 -0
  186. package/.aios-core/development/templates/code-intel-integration-pattern.md +199 -0
  187. package/.aios-core/development/templates/ptc-entity-validation.md +113 -0
  188. package/.aios-core/development/templates/ptc-qa-gate.md +100 -0
  189. package/.aios-core/development/templates/ptc-research-aggregation.md +94 -0
  190. package/.aios-core/development/templates/service-template/README.md.hbs +158 -158
  191. package/.aios-core/development/templates/service-template/__tests__/index.test.ts.hbs +237 -237
  192. package/.aios-core/development/templates/service-template/client.ts.hbs +403 -403
  193. package/.aios-core/development/templates/service-template/errors.ts.hbs +182 -182
  194. package/.aios-core/development/templates/service-template/index.ts.hbs +120 -120
  195. package/.aios-core/development/templates/service-template/package.json.hbs +87 -87
  196. package/.aios-core/development/templates/service-template/types.ts.hbs +145 -145
  197. package/.aios-core/development/templates/squad/agent-template.md +11 -0
  198. package/.aios-core/development/templates/squad/task-template.md +21 -0
  199. package/.aios-core/development/templates/squad-template/LICENSE +21 -21
  200. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +1 -1
  201. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.2-SUMMARY.md +1 -1
  202. package/.aios-core/framework-config.yaml +8 -0
  203. package/.aios-core/index.esm.js +1 -1
  204. package/.aios-core/index.js +1 -1
  205. package/.aios-core/infrastructure/integrations/ai-providers/index.js +1 -1
  206. package/.aios-core/infrastructure/schemas/task-v3-schema.json +6 -0
  207. package/.aios-core/infrastructure/scripts/collect-tool-usage.js +311 -0
  208. package/.aios-core/infrastructure/scripts/generate-optimization-report.js +497 -0
  209. package/.aios-core/infrastructure/scripts/generate-settings-json.js +300 -0
  210. package/.aios-core/infrastructure/scripts/git-config-detector.js +65 -9
  211. package/.aios-core/infrastructure/scripts/ide-sync/index.js +3 -1
  212. package/.aios-core/infrastructure/scripts/ide-sync/transformers/github-copilot.js +184 -0
  213. package/.aios-core/infrastructure/scripts/repository-detector.js +3 -3
  214. package/.aios-core/infrastructure/templates/aios-sync.yaml.template +182 -182
  215. package/.aios-core/infrastructure/templates/coderabbit.yaml.template +279 -279
  216. package/.aios-core/infrastructure/templates/github-workflows/ci.yml.template +169 -169
  217. package/.aios-core/infrastructure/templates/github-workflows/pr-automation.yml.template +330 -330
  218. package/.aios-core/infrastructure/templates/github-workflows/release.yml.template +196 -196
  219. package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +63 -63
  220. package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +18 -18
  221. package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +85 -85
  222. package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +145 -145
  223. package/.aios-core/install-manifest.yaml +613 -305
  224. package/.aios-core/lib/build.json +1 -0
  225. package/.aios-core/local-config.yaml.template +71 -71
  226. package/.aios-core/monitor/hooks/lib/__init__.py +1 -1
  227. package/.aios-core/monitor/hooks/lib/enrich.py +58 -58
  228. package/.aios-core/monitor/hooks/lib/send_event.py +47 -47
  229. package/.aios-core/monitor/hooks/notification.py +29 -29
  230. package/.aios-core/monitor/hooks/post_tool_use.py +45 -45
  231. package/.aios-core/monitor/hooks/pre_compact.py +29 -29
  232. package/.aios-core/monitor/hooks/pre_tool_use.py +40 -40
  233. package/.aios-core/monitor/hooks/stop.py +29 -29
  234. package/.aios-core/monitor/hooks/subagent_stop.py +29 -29
  235. package/.aios-core/monitor/hooks/user_prompt_submit.py +38 -38
  236. package/.aios-core/product/templates/adr.hbs +125 -125
  237. package/.aios-core/product/templates/dbdr.hbs +241 -241
  238. package/.aios-core/product/templates/epic.hbs +212 -212
  239. package/.aios-core/product/templates/ide-rules/claude-rules.md +125 -0
  240. package/.aios-core/product/templates/pmdr.hbs +186 -186
  241. package/.aios-core/product/templates/prd-v2.0.hbs +216 -216
  242. package/.aios-core/product/templates/prd.hbs +201 -201
  243. package/.aios-core/product/templates/story.hbs +263 -263
  244. package/.aios-core/product/templates/task.hbs +170 -170
  245. package/.aios-core/product/templates/tmpl-comment-on-examples.sql +158 -158
  246. package/.aios-core/product/templates/tmpl-migration-script.sql +91 -91
  247. package/.aios-core/product/templates/tmpl-rls-granular-policies.sql +104 -104
  248. package/.aios-core/product/templates/tmpl-rls-kiss-policy.sql +10 -10
  249. package/.aios-core/product/templates/tmpl-rls-roles.sql +135 -135
  250. package/.aios-core/product/templates/tmpl-rls-simple.sql +77 -77
  251. package/.aios-core/product/templates/tmpl-rls-tenant.sql +152 -152
  252. package/.aios-core/product/templates/tmpl-rollback-script.sql +77 -77
  253. package/.aios-core/product/templates/tmpl-seed-data.sql +140 -140
  254. package/.aios-core/product/templates/tmpl-smoke-test.sql +16 -16
  255. package/.aios-core/product/templates/tmpl-staging-copy-merge.sql +139 -139
  256. package/.aios-core/product/templates/tmpl-stored-proc.sql +140 -140
  257. package/.aios-core/product/templates/tmpl-trigger.sql +152 -152
  258. package/.aios-core/product/templates/tmpl-view-materialized.sql +133 -133
  259. package/.aios-core/product/templates/tmpl-view.sql +177 -177
  260. package/.aios-core/scripts/pm.sh +0 -0
  261. package/.aios-core/user-guide.md +15 -15
  262. package/.aios-core/utils/filters/constants.js +10 -0
  263. package/.aios-core/utils/filters/content-filter.js +223 -0
  264. package/.aios-core/utils/filters/field-filter.js +126 -0
  265. package/.aios-core/utils/filters/index.js +180 -0
  266. package/.aios-core/utils/filters/schema-filter.js +157 -0
  267. package/.claude/CLAUDE.md +62 -0
  268. package/.claude/hooks/enforce-architecture-first.py +196 -196
  269. package/.claude/hooks/enforce-git-push-authority.sh +33 -0
  270. package/.claude/hooks/mind-clone-governance.py +192 -192
  271. package/.claude/hooks/read-protection.py +151 -151
  272. package/.claude/hooks/slug-validation.py +176 -176
  273. package/.claude/hooks/sql-governance.py +182 -182
  274. package/.claude/hooks/synapse-engine.cjs +28 -5
  275. package/.claude/hooks/write-path-validation.py +194 -194
  276. package/.claude/rules/agent-authority.md +105 -0
  277. package/.claude/rules/agent-handoff.md +97 -0
  278. package/.claude/rules/agent-memory-imports.md +15 -0
  279. package/.claude/rules/coderabbit-integration.md +101 -0
  280. package/.claude/rules/ids-principles.md +119 -0
  281. package/.claude/rules/story-lifecycle.md +145 -0
  282. package/.claude/rules/tool-examples.md +64 -0
  283. package/.claude/rules/tool-response-filtering.md +57 -0
  284. package/.claude/rules/workflow-execution.md +150 -0
  285. package/LICENSE +33 -33
  286. package/bin/aios-graph.js +9 -0
  287. package/bin/aios-init.js +2 -2
  288. package/bin/aios-minimal.js +0 -0
  289. package/bin/aios.js +17 -221
  290. package/bin/utils/detect-fsmonitor.js +70 -0
  291. package/bin/utils/framework-guard.js +238 -0
  292. package/bin/utils/validate-publish.js +108 -0
  293. package/package.json +6 -3
  294. package/packages/aios-install/bin/aios-install.js +0 -0
  295. package/packages/aios-install/bin/edmcp.js +0 -0
  296. package/packages/aios-pro-cli/bin/aios-pro.js +2 -0
  297. package/packages/installer/src/config/templates/core-config-template.js +25 -0
  298. package/packages/installer/src/installer/brownfield-upgrader.js +68 -5
  299. package/packages/installer/src/merger/index.js +3 -0
  300. package/packages/installer/src/merger/strategies/index.js +6 -0
  301. package/packages/installer/src/merger/strategies/yaml-merger.js +181 -0
  302. package/packages/installer/src/updater/index.js +4 -4
  303. package/packages/installer/src/wizard/i18n.js +321 -3
  304. package/packages/installer/src/wizard/ide-config-generator.js +173 -25
  305. package/packages/installer/src/wizard/index.js +119 -1
  306. package/packages/installer/src/wizard/pro-setup.js +137 -121
  307. package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +271 -0
  308. package/packages/installer/tests/unit/claude-md-template-v5/claude-md-template-v5.test.js +192 -0
  309. package/packages/installer/tests/unit/doctor/doctor-checks.test.js +610 -0
  310. package/packages/installer/tests/unit/doctor/doctor-orchestrator.test.js +134 -0
  311. package/packages/installer/tests/unit/entity-registry-bootstrap.test.js +186 -0
  312. package/packages/installer/tests/unit/generate-settings-json/generate-settings-json.test.js +309 -0
  313. package/packages/installer/tests/unit/ide-sync-integration/ide-sync-integration.test.js +230 -0
  314. package/packages/installer/tests/unit/merger/strategies.test.js +2 -2
  315. package/packages/installer/tests/unit/merger/yaml-merger.test.js +327 -0
  316. package/scripts/check-markdown-links.py +352 -352
  317. package/scripts/dashboard-parallel-dev.sh +0 -0
  318. package/scripts/dashboard-parallel-phase3.sh +0 -0
  319. package/scripts/dashboard-parallel-phase4.sh +0 -0
  320. package/scripts/install-monitor-hooks.sh +0 -0
  321. package/scripts/package-synapse.js +2 -1
  322. package/pro/README.md +0 -66
  323. package/pro/license/degradation.js +0 -220
  324. package/pro/license/errors.js +0 -450
  325. package/pro/license/feature-gate.js +0 -354
  326. package/pro/license/index.js +0 -181
  327. package/pro/license/license-api.js +0 -651
  328. package/pro/license/license-cache.js +0 -523
  329. package/pro/license/license-crypto.js +0 -303
@@ -0,0 +1,152 @@
1
+ # Task: Review External Contributor PR
2
+
3
+ ## Metadata
4
+
5
+ ```yaml
6
+ id: review-contributor-pr
7
+ agent: devops
8
+ elicit: true
9
+ category: security
10
+ priority: high
11
+ story: NOG-17
12
+ ```
13
+
14
+ ## Description
15
+
16
+ Formal security review process for external contributor PRs before merging. This task ensures PRs from fork contributors are reviewed for security risks not present in internal team PRs.
17
+
18
+ ## Pre-Conditions
19
+
20
+ - PR is from an external contributor (fork-based)
21
+ - PR has passed automated CI checks (or CI was skipped due to fork restrictions)
22
+ - CodeRabbit review completed (check for hidden content in PR description)
23
+
24
+ ## Inputs
25
+
26
+ - `{pr_number}` - GitHub PR number to review
27
+
28
+ ## Execution
29
+
30
+ ### Step 1: Identify PR Scope
31
+
32
+ ```bash
33
+ # Get PR details
34
+ gh pr view {pr_number} --json files,additions,deletions,author,body
35
+
36
+ # Classify PR type
37
+ # CI/Workflow = .github/
38
+ # Test = tests/
39
+ # Code = packages/, .aios-core/, bin/
40
+ # Config = .gitmodules, *.config.*
41
+ # Docs = docs/, *.md
42
+ ```
43
+
44
+ **Elicit:** "PR #{pr_number} classified as: {type}. Proceeding with {type} security checklist."
45
+
46
+ ### Step 2: Security Checklist (by PR type)
47
+
48
+ #### For CI/Workflow PRs (.github/)
49
+
50
+ - [ ] No `pull_request_target` with explicit checkout added
51
+ - [ ] No new secrets references (`${{ secrets.* }}`)
52
+ - [ ] No permission escalation (`permissions: write-all`, `contents: write` where unnecessary)
53
+ - [ ] Action versions use known, trusted publishers
54
+ - [ ] Action versions are SHA-pinned (not tag-based)
55
+ - [ ] No `workflow_dispatch` with dangerous inputs
56
+ - [ ] No new `env:` blocks exposing sensitive data
57
+
58
+ #### For Test PRs (tests/)
59
+
60
+ - [ ] No `require('https')`, `require('http')`, `require('net')`, `require('dns')` imports
61
+ - [ ] No `fetch()`, `XMLHttpRequest`, or network calls
62
+ - [ ] No `fs.readFileSync` outside test fixtures
63
+ - [ ] No `process.env` access to sensitive variables
64
+ - [ ] No `child_process` usage (`execSync`, `spawn`, etc.)
65
+ - [ ] `require()` paths point to legitimate project modules only
66
+ - [ ] No exfiltration patterns (base64 encoding + network call)
67
+
68
+ #### For Code PRs (packages/, .aios-core/, bin/)
69
+
70
+ - [ ] No new dependencies added without justification
71
+ - [ ] No changes to `package.json` scripts (`preinstall`, `postinstall`)
72
+ - [ ] No `.env` file reads or credential handling changes
73
+ - [ ] No `shell: true` in any exec/spawn calls
74
+ - [ ] No string-based command construction (use array args)
75
+ - [ ] CodeRabbit review completed (check for hidden content in PR description)
76
+
77
+ #### For Config PRs (.gitmodules, *.config.*)
78
+
79
+ - [ ] No URL changes to external/unknown repositories
80
+ - [ ] No new submodule additions
81
+ - [ ] Config values are expected and documented
82
+ - [ ] No hooks modifications that could alter behavior
83
+
84
+ ### Step 3: Automated Scan
85
+
86
+ Run the appropriate grep command based on PR type:
87
+
88
+ ```bash
89
+ # For test PRs - check for suspicious patterns
90
+ gh pr diff {pr_number} -- 'tests/' | grep -E "(require\('https|require\('http|require\('net|require\('dns|fetch\(|\.readFileSync|process\.env|child_process|execSync|spawn)"
91
+
92
+ # For code PRs - check for shell execution patterns
93
+ gh pr diff {pr_number} -- 'packages/' '.aios-core/' 'bin/' | grep -E "(shell:\s*true|execSync\(|\.exec\(|eval\(|Function\()"
94
+
95
+ # For CI PRs - check for permission/secret changes
96
+ gh pr diff {pr_number} -- '.github/' | grep -E "(permissions:|secrets\.|pull_request_target|workflow_dispatch)"
97
+
98
+ # For any PR - check for hidden content in PR body
99
+ gh pr view {pr_number} --json body --jq '.body' | grep -iE "(<picture|<source|<img.*onerror|<!--.*ignore.*instruct)"
100
+ ```
101
+
102
+ **Elicit:** "Scan results: {summary}. {findings_count} suspicious patterns found."
103
+
104
+ ### Step 4: Decision Matrix
105
+
106
+ | PR Changes | Risk Level | Required Actions |
107
+ |-----------|-----------|-----------------|
108
+ | Documentation only | LOW | Standard review |
109
+ | Test files only | MEDIUM | Security scan + grep |
110
+ | Source code | MEDIUM-HIGH | Security scan + careful review |
111
+ | CI/Workflows | HIGH | Security scan + SHA audit + 2 approvals |
112
+ | package.json | HIGH | Block until verified |
113
+ | .gitmodules | MEDIUM | URL verification required |
114
+ | Config files | MEDIUM | Value verification required |
115
+
116
+ ### Step 5: Merge Decision
117
+
118
+ **Elicit:** Present checklist results and ask for confirmation:
119
+
120
+ ```
121
+ ## Contributor PR Security Review Summary
122
+
123
+ **PR:** #{pr_number}
124
+ **Author:** {author} (external contributor)
125
+ **Type:** {pr_type}
126
+ **Files Changed:** {file_count}
127
+
128
+ ### Checklist Results
129
+ - Security scan: {PASS|WARN|FAIL}
130
+ - Automated grep: {PASS|WARN|FAIL}
131
+ - CodeRabbit: {APPROVED|CHANGES_REQUESTED|PENDING}
132
+ - Hidden content check: {CLEAN|SUSPICIOUS}
133
+
134
+ ### Recommendation
135
+ {APPROVE|APPROVE_WITH_NOTES|REQUEST_CHANGES|BLOCK}
136
+
137
+ Proceed with merge? (y/n)
138
+ ```
139
+
140
+ ## Post-Conditions
141
+
142
+ - PR reviewed with security checklist appropriate to its type
143
+ - Automated scan completed with no unresolved findings
144
+ - Decision logged (approve, request changes, or block)
145
+ - If merged: enforce_admins temporarily disabled if needed, then re-enabled
146
+
147
+ ## Notes
148
+
149
+ - For PRs that modify `.github/workflows/`, require 2 maintainer approvals
150
+ - For PRs from **trusted contributors** (e.g., @riaworks with prior merged security PRs), standard review may suffice for docs/test PRs
151
+ - Always re-enable enforce_admins immediately after merge
152
+ - Reference research: `docs/research/2026-02-21-ci-security-external-prs/`
@@ -210,7 +210,7 @@ claude-free
210
210
  ```yaml
211
211
  story: "6.7"
212
212
  version: 1.1.0
213
- migrated_from: @synkra/aios-core
213
+ migrated_from: aios-core
214
214
  dependencies:
215
215
  - install-llm-routing.js
216
216
  - llm-routing.yaml
@@ -593,3 +593,11 @@ metadata:
593
593
  - quality-gate
594
594
  - qa
595
595
  ```
596
+
597
+ ## Handoff
598
+ next_agent: @architect
599
+ next_command: *plan
600
+ condition: Critique verdict is APPROVED
601
+ alternatives:
602
+ - agent: @pm, command: *write-spec, condition: Critique verdict is NEEDS_REVISION
603
+ - agent: @architect, command: *analyze-impact, condition: Critique verdict is BLOCKED
@@ -543,3 +543,10 @@ metadata:
543
543
  - sdd-adoption
544
544
  inspiration: GitHub Spec-Kit 9-category taxonomy
545
545
  ```
546
+
547
+ ## Handoff
548
+ next_agent: @architect
549
+ next_command: *analyze-impact
550
+ condition: Requirements gathered (requirements.json created)
551
+ alternatives:
552
+ - agent: @pm, command: *write-spec, condition: SIMPLE complexity, skip assessment
@@ -1,5 +1,9 @@
1
1
  # Spec Pipeline: Research Dependencies
2
2
 
3
+ ---
4
+ execution_mode: programmatic # TOK-3: PTC-eligible (Bash batch) — multi-search + filter in single block
5
+ ---
6
+
3
7
  > **Phase:** 3 - Research
4
8
  > **Owner Agent:** @analyst
5
9
  > **Pipeline:** spec-pipeline
@@ -529,3 +529,8 @@ metadata:
529
529
  - documentation
530
530
  - prompt-engineering
531
531
  ```
532
+
533
+ ## Handoff
534
+ next_agent: @qa
535
+ next_command: *critique-spec {story-id}
536
+ condition: Spec written (spec.md created)
@@ -0,0 +1,356 @@
1
+ # triage-github-issues.md
2
+
3
+ **Task**: GitHub Issues Triage & Prioritization
4
+
5
+ **Purpose**: Analyze open GitHub issues, classify by type/severity/effort, prioritize based on impact, and recommend resolution order to the user.
6
+
7
+ **When to use**: Periodically or when user asks to review the issue backlog, via `@devops *triage-issues` or user request like "what issues should we resolve next?".
8
+
9
+ ## Execution Modes
10
+
11
+ **Choose your execution mode:**
12
+
13
+ ### 1. YOLO Mode - Fast, Autonomous (0-1 prompts)
14
+ - Fetch, classify, and present prioritized list
15
+ - Minimal user interaction
16
+ - **Best for:** Quick overview of issue backlog
17
+
18
+ ### 2. Interactive Mode - Balanced, Educational (5-10 prompts) **[DEFAULT]**
19
+ - Present classification, ask user for priority adjustments
20
+ - Discuss trade-offs between quick wins vs high-impact
21
+ - **Best for:** Sprint planning, deciding next work
22
+
23
+ ### 3. Pre-Flight Planning - Comprehensive Upfront Planning
24
+ - Deep analysis of each issue with cross-references
25
+ - Dependency mapping between issues
26
+ - **Best for:** Major backlog grooming sessions
27
+
28
+ **Parameter:** `mode` (optional, default: `interactive`)
29
+
30
+ ---
31
+
32
+ ## Task Definition (AIOS Task Format V1.0)
33
+
34
+ ```yaml
35
+ task: triageGithubIssues()
36
+ responsavel: Gage (Operator)
37
+ responsavel_type: Agente
38
+ atomic_layer: Organism
39
+
40
+ **Entrada:**
41
+ - campo: filters
42
+ tipo: object
43
+ origem: User Input
44
+ obrigatorio: false
45
+ validacao: |
46
+ Optional filters: { state: 'open', labels: [], assignee: '', limit: 30 }
47
+ default: { state: 'open', limit: 30 }
48
+
49
+ - campo: mode
50
+ tipo: string
51
+ origem: User Input
52
+ obrigatorio: false
53
+ validacao: yolo|interactive|pre-flight
54
+
55
+ **Saida:**
56
+ - campo: triage_report
57
+ tipo: object
58
+ destino: User Display
59
+ persistido: false
60
+ formato: |
61
+ Tabela priorizada com: issue#, titulo, tipo, severidade, esforco, recomendacao
62
+
63
+ - campo: recommended_next
64
+ tipo: array
65
+ destino: User Display
66
+ persistido: false
67
+ formato: |
68
+ Top 3-5 issues recomendados para resolver em ordem
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Pre-Conditions
74
+
75
+ **Purpose:** Validate prerequisites BEFORE task execution (blocking)
76
+
77
+ **Checklist:**
78
+
79
+ ```yaml
80
+ pre-conditions:
81
+ - [ ] GitHub CLI authenticated (gh auth status)
82
+ tipo: pre-condition
83
+ blocker: true
84
+ validacao: |
85
+ Run: gh auth status
86
+ Must show authenticated user
87
+ error_message: "GitHub CLI not authenticated. Run: gh auth login"
88
+
89
+ - [ ] Repository has GitHub remote configured
90
+ tipo: pre-condition
91
+ blocker: true
92
+ validacao: |
93
+ Run: git remote -v
94
+ Must show github.com remote
95
+ error_message: "No GitHub remote found. Add with: git remote add origin <url>"
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Workflow Steps
101
+
102
+ ### Phase 1: Fetch Issues
103
+
104
+ ```bash
105
+ # Fetch all open issues with labels and metadata
106
+ gh issue list --state open --limit 50 --json number,title,labels,createdAt,updatedAt,comments,assignees,milestone
107
+
108
+ # Also check for stale issues (>90 days without activity)
109
+ gh issue list --state open --limit 50 --json number,title,updatedAt --jq '.[] | select(.updatedAt < (now - 7776000 | todate))'
110
+ ```
111
+
112
+ ### Phase 2: Classify Each Issue
113
+
114
+ For each issue, determine:
115
+
116
+ | Dimension | Values | How to Determine |
117
+ |-----------|--------|-----------------|
118
+ | **Type** | BUG, FEATURE, ENHANCEMENT, DOCS, CHORE, SECURITY | From labels + title keywords + issue body |
119
+ | **Severity** | P0-Critical, P1-High, P2-Medium, P3-Low, P4-Cosmetic | Impact on users, workaround availability |
120
+ | **Effort** | XS (<1h), S (1-4h), M (4-8h), L (1-2d), XL (>2d) | Files affected, complexity, research needed |
121
+ | **Impact** | HIGH, MEDIUM, LOW | Users affected x frequency x severity |
122
+ | **Quick Win** | YES/NO | Effort <= S AND Severity >= P2 |
123
+
124
+ **Classification Heuristics:**
125
+
126
+ ```yaml
127
+ type_detection:
128
+ BUG: title contains "bug", "broken", "error", "fix", "crash", "fail"
129
+ SECURITY: title contains "security", "vulnerability", "CVE", labels include "security"
130
+ DOCS: title contains "docs", "documentation", "readme", labels include "documentation"
131
+ CHORE: title contains "chore", "cleanup", "refactor", "rename", "update"
132
+ FEATURE: title contains "feat", "add", "implement", "new"
133
+ ENHANCEMENT: title contains "improve", "enhance", "optimize", "better"
134
+
135
+ severity_detection:
136
+ P0: labels include "critical", body mentions "production down" or "data loss"
137
+ P1: labels include "high", "important", type is SECURITY
138
+ P2: labels include "medium", type is BUG without workaround
139
+ P3: labels include "low", type is ENHANCEMENT
140
+ P4: type is DOCS or CHORE with no user impact
141
+
142
+ effort_estimation:
143
+ - Read issue body for scope indicators
144
+ - Check if issue references specific files/modules
145
+ - Check if similar issues were resolved (time taken)
146
+ - Consider: research needed? multiple files? tests required? installer changes?
147
+ ```
148
+
149
+ ### Phase 3: Prioritize
150
+
151
+ **Priority Score Formula:**
152
+
153
+ ```
154
+ priority_score = (severity_weight * 3) + (impact_weight * 2) + (quick_win_bonus) - (effort_penalty)
155
+
156
+ severity_weight: P0=10, P1=8, P2=5, P3=3, P4=1
157
+ impact_weight: HIGH=10, MEDIUM=5, LOW=2
158
+ quick_win_bonus: YES=5, NO=0
159
+ effort_penalty: XS=0, S=1, M=3, L=5, XL=8
160
+ ```
161
+
162
+ **Priority Tiers:**
163
+
164
+ | Tier | Score Range | Action |
165
+ |------|------------|--------|
166
+ | **NOW** | >= 30 | Resolve immediately (P0/P1, security) |
167
+ | **NEXT** | 20-29 | Resolve in current sprint |
168
+ | **SOON** | 10-19 | Schedule for next sprint |
169
+ | **BACKLOG** | < 10 | Keep in backlog, review monthly |
170
+
171
+ ### Phase 4: Present to User
172
+
173
+ **Output Format:**
174
+
175
+ ```
176
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
177
+ GitHub Issues Triage Report
178
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
179
+
180
+ Repository: {owner}/{repo}
181
+ Open Issues: {count}
182
+ Date: {date}
183
+
184
+ NOW (resolve immediately):
185
+ #123 [BUG/P1] Agent files not recognized by Copilot S ← Quick Win
186
+ #456 [SECURITY/P0] Exposed credentials in config M
187
+
188
+ NEXT (current sprint):
189
+ #789 [BUG/P2] Submodule blocks push after merge M
190
+ #101 [ENHANCEMENT/P2] Add batch rename support S ← Quick Win
191
+
192
+ SOON (next sprint):
193
+ #202 [FEATURE/P3] English README L
194
+ #303 [DOCS/P3] Update API documentation S
195
+
196
+ BACKLOG:
197
+ #404 [CHORE/P4] Remove deprecated methods XS
198
+ ...
199
+
200
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
201
+
202
+ Recommendation: Start with #{top_issue} ({reason}).
203
+ Pick an issue number to investigate, or say "resolve #N".
204
+
205
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
206
+ ```
207
+
208
+ ### Phase 5: User Decision
209
+
210
+ **elicit: true**
211
+
212
+ Present the triage report and wait for user to:
213
+ 1. Select an issue to investigate → hand off to `*resolve-issue {number}`
214
+ 2. Adjust priorities → re-sort and present again
215
+ 3. Close stale issues → `gh issue close {number} --comment "Closing as stale"`
216
+ 4. Request more detail on specific issue → `gh issue view {number}`
217
+
218
+ ---
219
+
220
+ ## Post-Conditions
221
+
222
+ **Purpose:** Validate execution success AFTER task completes
223
+
224
+ **Checklist:**
225
+
226
+ ```yaml
227
+ post-conditions:
228
+ - [ ] All open issues classified with type, severity, and effort
229
+ tipo: post-condition
230
+ blocker: false
231
+ validacao: |
232
+ Every issue in report has Type, Severity, and Effort columns filled
233
+
234
+ - [ ] Priority ranking presented to user
235
+ tipo: post-condition
236
+ blocker: true
237
+ validacao: |
238
+ User has seen the prioritized triage report
239
+
240
+ - [ ] User has selected next action (resolve, close, or defer)
241
+ tipo: post-condition
242
+ blocker: false
243
+ validacao: |
244
+ User has made a decision on at least one issue
245
+ ```
246
+
247
+ ---
248
+
249
+ ## Acceptance Criteria
250
+
251
+ **Purpose:** Definitive pass/fail criteria for task completion
252
+
253
+ **Checklist:**
254
+
255
+ ```yaml
256
+ acceptance-criteria:
257
+ - [ ] Triage report covers all open issues (or up to limit)
258
+ tipo: acceptance-criterion
259
+ blocker: true
260
+
261
+ - [ ] Each issue has type, severity, effort, and priority tier
262
+ tipo: acceptance-criterion
263
+ blocker: true
264
+
265
+ - [ ] Quick wins are clearly identified
266
+ tipo: acceptance-criterion
267
+ blocker: true
268
+
269
+ - [ ] User-facing output is a clean, scannable table
270
+ tipo: acceptance-criterion
271
+ blocker: true
272
+ ```
273
+
274
+ ---
275
+
276
+ ## Tools
277
+
278
+ **External/shared resources used by this task:**
279
+
280
+ - **Tool:** gh (GitHub CLI)
281
+ - **Purpose:** Fetch issues, labels, comments, close stale issues
282
+ - **Source:** System CLI
283
+ - **Required:** true
284
+
285
+ - **Tool:** git
286
+ - **Purpose:** Detect repository remote URL
287
+ - **Source:** System CLI
288
+ - **Required:** true
289
+
290
+ ---
291
+
292
+ ## Error Handling
293
+
294
+ **Strategy:** graceful-fallback
295
+
296
+ **Common Errors:**
297
+
298
+ 1. **Error:** GitHub CLI not authenticated
299
+ - **Cause:** `gh` not logged in
300
+ - **Resolution:** Run `gh auth login`
301
+ - **Recovery:** Prompt user to authenticate
302
+
303
+ 2. **Error:** Rate limit exceeded
304
+ - **Cause:** Too many API calls
305
+ - **Resolution:** Wait and retry, or use `--limit` to reduce scope
306
+ - **Recovery:** Present partial results
307
+
308
+ 3. **Error:** No open issues
309
+ - **Cause:** Repository has no open issues
310
+ - **Resolution:** Report clean backlog
311
+ - **Recovery:** Suggest checking closed issues or creating new ones
312
+
313
+ ---
314
+
315
+ ## Performance
316
+
317
+ **Expected Metrics:**
318
+
319
+ ```yaml
320
+ duration_expected: 1-3 min
321
+ cost_estimated: $0.001-0.005
322
+ token_usage: ~2,000-5,000 tokens
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Metadata
328
+
329
+ ```yaml
330
+ story: N/A (operational task)
331
+ version: 1.0.0
332
+ dependencies:
333
+ tasks: []
334
+ checklists: []
335
+ templates: []
336
+ tools:
337
+ - gh (GitHub CLI)
338
+ - git
339
+ tags:
340
+ - devops
341
+ - issue-management
342
+ - triage
343
+ - backlog
344
+ created_at: 2026-02-21
345
+ updated_at: 2026-02-21
346
+ related_tasks:
347
+ - resolve-github-issue.md
348
+ ```
349
+
350
+ ---
351
+
352
+ ## Integration with @devops Agent
353
+
354
+ Called via `@devops *triage-issues` command or user request to analyze the issue backlog.
355
+
356
+ **Handoff:** When user selects an issue to resolve, hand off to `*resolve-issue {number}`.
@@ -1,5 +1,9 @@
1
1
  # Validate Agents Task
2
2
 
3
+ ---
4
+ execution_mode: programmatic # TOK-3: PTC-eligible — batch-scan all agent files in single Bash block
5
+ ---
6
+
3
7
  ## Purpose
4
8
 
5
9
  Validate all agent definition files for structural integrity, required fields,
@@ -374,6 +374,16 @@ To comprehensively validate a story draft before implementation begins, ensuring
374
374
  - [ ] FAIL: Section missing or critically incomplete
375
375
  - [ ] N/A: CodeRabbit disabled in core-config.yaml
376
376
 
377
+ ### 8.1 Code Intelligence: No Duplicate Functionality (Auto-skip if unavailable)
378
+
379
+ - **Check code intelligence availability:** Call `isCodeIntelAvailable()` from `.aios-core/core/code-intel`
380
+ - **If available:**
381
+ - Call `validateNoDuplicates(storyDescription)` from `.aios-core/core/code-intel/helpers/story-helper`
382
+ - If `hasDuplicates: true`: Add to validation report as **Should-Fix** issue — "Potential duplicate functionality detected: {suggestion}". This is **advisory only** and does NOT block validation.
383
+ - If `hasDuplicates: false`: Add to report as PASS — "No duplicate functionality detected"
384
+ - Include result in the **Validation Result** section under "Code Intelligence Check"
385
+ - **If NOT available:** Skip this step silently — validation proceeds exactly as before with no code intelligence items in report
386
+
377
387
  ### 9. Anti-Hallucination Verification
378
388
 
379
389
  - **Epic Context Enrichment**: Import `EpicContextAccumulator` from `core/orchestration` and call `buildAccumulatedContext(epicId, storyN)` to enrich validation with accumulated epic context (progressive summarization within token limits)
@@ -452,4 +462,11 @@ Provide a structured validation report including:
452
462
  - **NO-GO**: Story requires fixes before implementation
453
463
  - **Implementation Readiness Score**: 1-10 scale
454
464
  - **Confidence Level**: High/Medium/Low for successful implementation
465
+
466
+ ## Handoff
467
+ next_agent: @dev
468
+ next_command: *develop {story-id}
469
+ condition: Story status is Approved (GO decision)
470
+ alternatives:
471
+ - agent: @sm, command: *draft, condition: Story rejected (NO-GO), needs rework
455
472
 
@@ -0,0 +1,48 @@
1
+ # Agent Handoff Artifact Template
2
+ # Story: TOK-4A — Agent Handoff Context Strategy
3
+ # Purpose: Compact summary of previous agent's work for context-efficient agent switches.
4
+ # Constraint: Filled artifact MUST be < 500 tokens.
5
+ #
6
+ # Usage: On agent switch (@agent command), the outgoing agent populates this template.
7
+ # The incoming agent receives: own full profile + this artifact (not previous agent's full persona).
8
+ #
9
+ # Reference: OpenAI Swarm handoff pattern, TOK-4A ACs 1-3
10
+
11
+ handoff:
12
+ version: "1.0"
13
+ timestamp: "" # ISO 8601 (e.g., 2026-02-23T17:00:00Z)
14
+ from_agent: "" # Agent ID of outgoing agent (e.g., dev, qa, sm)
15
+ to_agent: "" # Agent ID of incoming agent (e.g., qa, devops)
16
+
17
+ # What story/task is being worked on
18
+ story_context:
19
+ story_id: "" # e.g., TOK-4A
20
+ story_path: "" # e.g., docs/stories/epics/epic-token-optimization/story-TOK-4A-...md
21
+ story_status: "" # e.g., In Progress, Ready for Review
22
+ current_task: "" # e.g., Task 3: Integration point & limits
23
+ branch: "" # e.g., feat/epic-token-optimization
24
+
25
+ # Key decisions made by outgoing agent (max 5)
26
+ decisions:
27
+ - "" # e.g., "Used CLAUDE.md instructions for compaction (not code module)"
28
+ # - ""
29
+
30
+ # Files created or modified by outgoing agent (max 10)
31
+ files_modified:
32
+ - "" # e.g., ".aios-core/development/templates/agent-handoff-tmpl.yaml"
33
+ # - ""
34
+
35
+ # Active blockers or issues (max 3)
36
+ blockers:
37
+ - "" # e.g., "NOG-18 not Done — Phase 2 SYNAPSE integration deferred"
38
+ # - ""
39
+
40
+ # What the incoming agent should do next (max 2 sentences)
41
+ next_action: "" # e.g., "Run QA gate on TOK-4A. Verify handoff preserves story context."
42
+
43
+ # --- Compaction Limits (AC 9) ---
44
+ # Max artifact size: 500 tokens (~375 words)
45
+ # Max retained summaries: 3 (oldest discarded on 4th switch)
46
+ # Max decisions: 5
47
+ # Max files_modified: 10
48
+ # Max blockers: 3