claudecode-omc 5.6.5 → 5.6.7

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 (434) hide show
  1. package/.local/commands/code-review.md +416 -0
  2. package/.local/commands/pr.md +250 -0
  3. package/.local/commands/prp-pr.md +244 -0
  4. package/.local/guidelines/CLAUDE.md +47 -0
  5. package/.local/skills/h5-to-swiftui/SKILL.md +201 -0
  6. package/.local/skills/h5-to-swiftui/assets/calibration/README.md +176 -0
  7. package/.local/skills/h5-to-swiftui/assets/calibration/h5-twin/index.html +52 -0
  8. package/.local/skills/h5-to-swiftui/assets/calibration/h5-twin/style.css +133 -0
  9. package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin/Package.swift +26 -0
  10. package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin/Sources/CalibrationScreen/CalibrationScreen.swift +142 -0
  11. package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin-divergent/Package.swift +32 -0
  12. package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin-divergent/Sources/CalibrationScreenDivergent/CalibrationScreenDivergent.swift +122 -0
  13. package/.local/skills/h5-to-swiftui/assets/calibration/tokens.json +42 -0
  14. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/index.html +14 -0
  15. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/package.json +20 -0
  16. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/public/api/articles/001.json +96 -0
  17. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/public/api/articles/index.json +89 -0
  18. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/App.jsx +22 -0
  19. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/App.module.css +11 -0
  20. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/ArticleCard.jsx +53 -0
  21. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/ArticleCard.module.css +139 -0
  22. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/NavBar.jsx +37 -0
  23. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/NavBar.module.css +72 -0
  24. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TagCloud.jsx +30 -0
  25. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TagCloud.module.css +50 -0
  26. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TrendChart.jsx +159 -0
  27. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TrendChart.module.css +21 -0
  28. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/main.jsx +12 -0
  29. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/ArticleScreen.jsx +182 -0
  30. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/ArticleScreen.module.css +294 -0
  31. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/FeedScreen.jsx +147 -0
  32. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/FeedScreen.module.css +161 -0
  33. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/styles/global.css +50 -0
  34. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/styles/tokens.css +103 -0
  35. package/.local/skills/h5-to-swiftui/assets/sample-h5-react/vite.config.js +6 -0
  36. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/data/tasks.js +67 -0
  37. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/index.html +26 -0
  38. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/router.js +73 -0
  39. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/screens/detail.js +164 -0
  40. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/screens/home.js +53 -0
  41. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/screens/list.js +87 -0
  42. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/styles/app.css +342 -0
  43. package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/styles/tokens.css +68 -0
  44. package/.local/skills/h5-to-swiftui/references/css-to-swiftui-map.md +205 -0
  45. package/.local/skills/h5-to-swiftui/references/design-token-extraction.md +209 -0
  46. package/.local/skills/h5-to-swiftui/references/high-risk-triage.md +209 -0
  47. package/.local/skills/h5-to-swiftui/references/render-equivalence-calibration.md +193 -0
  48. package/.local/skills/h5-to-swiftui/references/stack-detection.md +160 -0
  49. package/.local/skills/h5-to-swiftui/references/visual-diff-loop-protocol.md +365 -0
  50. package/.local/skills/h5-to-swiftui/scripts/_calib-consts.mjs +150 -0
  51. package/.local/skills/h5-to-swiftui/scripts/_imglib.mjs +547 -0
  52. package/.local/skills/h5-to-swiftui/scripts/_provenance.mjs +123 -0
  53. package/.local/skills/h5-to-swiftui/scripts/calibrate-render.mjs +625 -0
  54. package/.local/skills/h5-to-swiftui/scripts/capture-reference.mjs +386 -0
  55. package/.local/skills/h5-to-swiftui/scripts/detect-stack.mjs +305 -0
  56. package/.local/skills/h5-to-swiftui/scripts/evaluate-convergence.mjs +1093 -0
  57. package/.local/skills/h5-to-swiftui/scripts/extract-tokens.mjs +600 -0
  58. package/.local/skills/h5-to-swiftui/scripts/mark-overlay.mjs +379 -0
  59. package/.local/skills/h5-to-swiftui/scripts/pixel-diff.mjs +530 -0
  60. package/.local/skills/h5-to-swiftui/scripts/sim-screenshot.sh +544 -0
  61. package/bundled/manifest.json +4 -4
  62. package/bundled/upstream/anthropic-skills/skills/algorithmic-art/LICENSE.txt +1 -1
  63. package/bundled/upstream/anthropic-skills/skills/brand-guidelines/LICENSE.txt +1 -1
  64. package/bundled/upstream/anthropic-skills/skills/canvas-design/LICENSE.txt +1 -1
  65. package/bundled/upstream/anthropic-skills/skills/claude-api/LICENSE.txt +1 -1
  66. package/bundled/upstream/anthropic-skills/skills/claude-api/SKILL.md +120 -58
  67. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/examples.md +9 -9
  68. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/managed-agents.md +336 -0
  69. package/bundled/upstream/anthropic-skills/skills/claude-api/go/managed-agents/README.md +561 -0
  70. package/bundled/upstream/anthropic-skills/skills/claude-api/java/claude-api.md +2 -2
  71. package/bundled/upstream/anthropic-skills/skills/claude-api/java/managed-agents/README.md +442 -0
  72. package/bundled/upstream/anthropic-skills/skills/claude-api/php/claude-api.md +10 -10
  73. package/bundled/upstream/anthropic-skills/skills/claude-api/php/managed-agents/README.md +435 -0
  74. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/README.md +16 -16
  75. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/batches.md +3 -3
  76. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/files-api.md +3 -3
  77. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/streaming.md +7 -7
  78. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/tool-use.md +19 -19
  79. package/bundled/upstream/anthropic-skills/skills/claude-api/python/managed-agents/README.md +332 -0
  80. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/claude-api.md +4 -4
  81. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/managed-agents/README.md +389 -0
  82. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/agent-design.md +101 -0
  83. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/error-codes.md +11 -4
  84. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/live-sources.md +60 -48
  85. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-api-reference.md +372 -0
  86. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-client-patterns.md +209 -0
  87. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-core.md +220 -0
  88. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-environments.md +211 -0
  89. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-events.md +195 -0
  90. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-memory.md +197 -0
  91. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-multiagent.md +99 -0
  92. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-onboarding.md +114 -0
  93. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-outcomes.md +106 -0
  94. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-overview.md +67 -0
  95. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-tools.md +315 -0
  96. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-webhooks.md +110 -0
  97. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/model-migration.md +779 -0
  98. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/models.md +16 -14
  99. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/prompt-caching.md +45 -2
  100. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/tool-use-concepts.md +28 -6
  101. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/README.md +15 -15
  102. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/batches.md +2 -2
  103. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/files-api.md +1 -1
  104. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/streaming.md +5 -5
  105. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/tool-use.md +15 -15
  106. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/managed-agents/README.md +359 -0
  107. package/bundled/upstream/anthropic-skills/skills/internal-comms/LICENSE.txt +1 -1
  108. package/bundled/upstream/anthropic-skills/skills/mcp-builder/LICENSE.txt +1 -1
  109. package/bundled/upstream/anthropic-skills/skills/skill-creator/LICENSE.txt +1 -1
  110. package/bundled/upstream/anthropic-skills/skills/slack-gif-creator/LICENSE.txt +1 -1
  111. package/bundled/upstream/anthropic-skills/skills/theme-factory/LICENSE.txt +1 -1
  112. package/bundled/upstream/anthropic-skills/skills/web-artifacts-builder/LICENSE.txt +1 -1
  113. package/bundled/upstream/anthropic-skills/skills/webapp-testing/LICENSE.txt +1 -1
  114. package/bundled/upstream/ecc/.omc-source/bundle.json +2 -3
  115. package/bundled/upstream/ecc/.omc-source/manifests/.claude-plugin/marketplace.json +4 -4
  116. package/bundled/upstream/ecc/agents/a11y-architect.md +10 -2
  117. package/bundled/upstream/ecc/agents/architect.md +9 -0
  118. package/bundled/upstream/ecc/agents/build-error-resolver.md +9 -0
  119. package/bundled/upstream/ecc/agents/chief-of-staff.md +9 -0
  120. package/bundled/upstream/ecc/agents/code-architect.md +9 -0
  121. package/bundled/upstream/ecc/agents/code-explorer.md +10 -1
  122. package/bundled/upstream/ecc/agents/code-reviewer.md +87 -1
  123. package/bundled/upstream/ecc/agents/code-simplifier.md +9 -0
  124. package/bundled/upstream/ecc/agents/comment-analyzer.md +10 -1
  125. package/bundled/upstream/ecc/agents/conversation-analyzer.md +9 -0
  126. package/bundled/upstream/ecc/agents/cpp-build-resolver.md +9 -0
  127. package/bundled/upstream/ecc/agents/cpp-reviewer.md +9 -0
  128. package/bundled/upstream/ecc/agents/csharp-reviewer.md +9 -0
  129. package/bundled/upstream/ecc/agents/dart-build-resolver.md +9 -0
  130. package/bundled/upstream/ecc/agents/database-reviewer.md +9 -0
  131. package/bundled/upstream/ecc/agents/django-build-resolver.md +252 -0
  132. package/bundled/upstream/ecc/agents/django-reviewer.md +169 -0
  133. package/bundled/upstream/ecc/agents/doc-updater.md +9 -0
  134. package/bundled/upstream/ecc/agents/docs-lookup.md +9 -0
  135. package/bundled/upstream/ecc/agents/e2e-runner.md +9 -0
  136. package/bundled/upstream/ecc/agents/fastapi-reviewer.md +79 -0
  137. package/bundled/upstream/ecc/agents/flutter-reviewer.md +9 -0
  138. package/bundled/upstream/ecc/agents/fsharp-reviewer.md +109 -0
  139. package/bundled/upstream/ecc/agents/gan-evaluator.md +9 -0
  140. package/bundled/upstream/ecc/agents/gan-generator.md +9 -0
  141. package/bundled/upstream/ecc/agents/gan-planner.md +9 -0
  142. package/bundled/upstream/ecc/agents/go-build-resolver.md +9 -0
  143. package/bundled/upstream/ecc/agents/go-reviewer.md +9 -0
  144. package/bundled/upstream/ecc/agents/harmonyos-app-resolver.md +182 -0
  145. package/bundled/upstream/ecc/agents/harness-optimizer.md +9 -0
  146. package/bundled/upstream/ecc/agents/healthcare-reviewer.md +9 -0
  147. package/bundled/upstream/ecc/agents/homelab-architect.md +107 -0
  148. package/bundled/upstream/ecc/agents/java-build-resolver.md +133 -11
  149. package/bundled/upstream/ecc/agents/java-reviewer.md +130 -32
  150. package/bundled/upstream/ecc/agents/kotlin-build-resolver.md +9 -0
  151. package/bundled/upstream/ecc/agents/kotlin-reviewer.md +9 -0
  152. package/bundled/upstream/ecc/agents/loop-operator.md +9 -0
  153. package/bundled/upstream/ecc/agents/mle-reviewer.md +162 -0
  154. package/bundled/upstream/ecc/agents/network-architect.md +106 -0
  155. package/bundled/upstream/ecc/agents/network-config-reviewer.md +106 -0
  156. package/bundled/upstream/ecc/agents/network-troubleshooter.md +128 -0
  157. package/bundled/upstream/ecc/agents/opensource-forker.md +9 -0
  158. package/bundled/upstream/ecc/agents/opensource-packager.md +9 -0
  159. package/bundled/upstream/ecc/agents/opensource-sanitizer.md +9 -0
  160. package/bundled/upstream/ecc/agents/performance-optimizer.md +9 -0
  161. package/bundled/upstream/ecc/agents/planner.md +9 -0
  162. package/bundled/upstream/ecc/agents/pr-test-analyzer.md +9 -0
  163. package/bundled/upstream/ecc/agents/python-reviewer.md +9 -0
  164. package/bundled/upstream/ecc/agents/pytorch-build-resolver.md +12 -3
  165. package/bundled/upstream/ecc/agents/refactor-cleaner.md +9 -0
  166. package/bundled/upstream/ecc/agents/rust-build-resolver.md +9 -0
  167. package/bundled/upstream/ecc/agents/rust-reviewer.md +9 -0
  168. package/bundled/upstream/ecc/agents/security-reviewer.md +9 -0
  169. package/bundled/upstream/ecc/agents/seo-specialist.md +10 -1
  170. package/bundled/upstream/ecc/agents/silent-failure-hunter.md +9 -0
  171. package/bundled/upstream/ecc/agents/swift-build-resolver.md +170 -0
  172. package/bundled/upstream/ecc/agents/swift-reviewer.md +116 -0
  173. package/bundled/upstream/ecc/agents/tdd-guide.md +9 -0
  174. package/bundled/upstream/ecc/agents/type-design-analyzer.md +10 -1
  175. package/bundled/upstream/ecc/agents/typescript-reviewer.md +9 -0
  176. package/bundled/upstream/ecc/commands/auto-update.md +28 -0
  177. package/bundled/upstream/ecc/commands/build-fix.md +4 -0
  178. package/bundled/upstream/ecc/commands/checkpoint.md +4 -0
  179. package/bundled/upstream/ecc/commands/code-review.md +3 -3
  180. package/bundled/upstream/ecc/commands/cost-report.md +107 -0
  181. package/bundled/upstream/ecc/commands/cpp-build.md +1 -1
  182. package/bundled/upstream/ecc/commands/cpp-test.md +1 -1
  183. package/bundled/upstream/ecc/commands/ecc-guide.md +93 -0
  184. package/bundled/upstream/ecc/commands/fastapi-review.md +39 -0
  185. package/bundled/upstream/ecc/commands/flutter-build.md +1 -1
  186. package/bundled/upstream/ecc/commands/flutter-test.md +1 -1
  187. package/bundled/upstream/ecc/commands/gan-build.md +4 -0
  188. package/bundled/upstream/ecc/commands/gan-design.md +4 -0
  189. package/bundled/upstream/ecc/commands/go-build.md +1 -1
  190. package/bundled/upstream/ecc/commands/go-test.md +1 -1
  191. package/bundled/upstream/ecc/commands/harness-audit.md +4 -0
  192. package/bundled/upstream/ecc/commands/jira.md +2 -2
  193. package/bundled/upstream/ecc/commands/kotlin-build.md +1 -1
  194. package/bundled/upstream/ecc/commands/kotlin-test.md +1 -1
  195. package/bundled/upstream/ecc/commands/learn.md +4 -0
  196. package/bundled/upstream/ecc/commands/loop-start.md +4 -0
  197. package/bundled/upstream/ecc/commands/loop-status.md +54 -1
  198. package/bundled/upstream/ecc/commands/model-route.md +4 -0
  199. package/bundled/upstream/ecc/commands/multi-backend.md +4 -0
  200. package/bundled/upstream/ecc/commands/multi-execute.md +4 -0
  201. package/bundled/upstream/ecc/commands/multi-frontend.md +4 -0
  202. package/bundled/upstream/ecc/commands/multi-plan.md +4 -0
  203. package/bundled/upstream/ecc/commands/multi-workflow.md +4 -0
  204. package/bundled/upstream/ecc/commands/plan-prd.md +160 -0
  205. package/bundled/upstream/ecc/commands/plan.md +96 -13
  206. package/bundled/upstream/ecc/commands/pm2.md +4 -0
  207. package/bundled/upstream/ecc/commands/pr.md +184 -0
  208. package/bundled/upstream/ecc/commands/project-init.md +86 -0
  209. package/bundled/upstream/ecc/commands/python-review.md +1 -1
  210. package/bundled/upstream/ecc/commands/quality-gate.md +4 -0
  211. package/bundled/upstream/ecc/commands/refactor-clean.md +4 -0
  212. package/bundled/upstream/ecc/commands/rust-build.md +1 -1
  213. package/bundled/upstream/ecc/commands/rust-test.md +1 -1
  214. package/bundled/upstream/ecc/commands/security-scan.md +92 -0
  215. package/bundled/upstream/ecc/commands/sessions.md +6 -6
  216. package/bundled/upstream/ecc/commands/skill-health.md +3 -3
  217. package/bundled/upstream/ecc/commands/test-coverage.md +4 -0
  218. package/bundled/upstream/ecc/commands/update-codemaps.md +4 -0
  219. package/bundled/upstream/ecc/commands/update-docs.md +4 -0
  220. package/bundled/upstream/ecc/skills/accessibility/SKILL.md +1 -1
  221. package/bundled/upstream/ecc/skills/agent-architecture-audit/SKILL.md +256 -0
  222. package/bundled/upstream/ecc/skills/agent-payment-x402/SKILL.md +49 -3
  223. package/bundled/upstream/ecc/skills/agentic-os/SKILL.md +387 -0
  224. package/bundled/upstream/ecc/skills/angular-developer/SKILL.md +154 -0
  225. package/bundled/upstream/ecc/skills/angular-developer/references/angular-animations.md +160 -0
  226. package/bundled/upstream/ecc/skills/angular-developer/references/angular-aria.md +410 -0
  227. package/bundled/upstream/ecc/skills/angular-developer/references/cli.md +86 -0
  228. package/bundled/upstream/ecc/skills/angular-developer/references/component-harnesses.md +59 -0
  229. package/bundled/upstream/ecc/skills/angular-developer/references/component-styling.md +91 -0
  230. package/bundled/upstream/ecc/skills/angular-developer/references/components.md +117 -0
  231. package/bundled/upstream/ecc/skills/angular-developer/references/creating-services.md +97 -0
  232. package/bundled/upstream/ecc/skills/angular-developer/references/data-resolvers.md +69 -0
  233. package/bundled/upstream/ecc/skills/angular-developer/references/define-routes.md +67 -0
  234. package/bundled/upstream/ecc/skills/angular-developer/references/defining-providers.md +72 -0
  235. package/bundled/upstream/ecc/skills/angular-developer/references/di-fundamentals.md +120 -0
  236. package/bundled/upstream/ecc/skills/angular-developer/references/e2e-testing.md +56 -0
  237. package/bundled/upstream/ecc/skills/angular-developer/references/effects.md +83 -0
  238. package/bundled/upstream/ecc/skills/angular-developer/references/hierarchical-injectors.md +43 -0
  239. package/bundled/upstream/ecc/skills/angular-developer/references/host-elements.md +80 -0
  240. package/bundled/upstream/ecc/skills/angular-developer/references/injection-context.md +63 -0
  241. package/bundled/upstream/ecc/skills/angular-developer/references/inputs.md +101 -0
  242. package/bundled/upstream/ecc/skills/angular-developer/references/linked-signal.md +59 -0
  243. package/bundled/upstream/ecc/skills/angular-developer/references/loading-strategies.md +61 -0
  244. package/bundled/upstream/ecc/skills/angular-developer/references/mcp.md +108 -0
  245. package/bundled/upstream/ecc/skills/angular-developer/references/navigate-to-routes.md +69 -0
  246. package/bundled/upstream/ecc/skills/angular-developer/references/outputs.md +86 -0
  247. package/bundled/upstream/ecc/skills/angular-developer/references/reactive-forms.md +122 -0
  248. package/bundled/upstream/ecc/skills/angular-developer/references/rendering-strategies.md +44 -0
  249. package/bundled/upstream/ecc/skills/angular-developer/references/resource.md +77 -0
  250. package/bundled/upstream/ecc/skills/angular-developer/references/route-animations.md +56 -0
  251. package/bundled/upstream/ecc/skills/angular-developer/references/route-guards.md +52 -0
  252. package/bundled/upstream/ecc/skills/angular-developer/references/router-lifecycle.md +45 -0
  253. package/bundled/upstream/ecc/skills/angular-developer/references/router-testing.md +87 -0
  254. package/bundled/upstream/ecc/skills/angular-developer/references/show-routes-with-outlets.md +68 -0
  255. package/bundled/upstream/ecc/skills/angular-developer/references/signal-forms.md +795 -0
  256. package/bundled/upstream/ecc/skills/angular-developer/references/signals-overview.md +94 -0
  257. package/bundled/upstream/ecc/skills/angular-developer/references/tailwind-css.md +69 -0
  258. package/bundled/upstream/ecc/skills/angular-developer/references/template-driven-forms.md +114 -0
  259. package/bundled/upstream/ecc/skills/angular-developer/references/testing-fundamentals.md +65 -0
  260. package/bundled/upstream/ecc/skills/autonomous-agent-harness/SKILL.md +6 -0
  261. package/bundled/upstream/ecc/skills/backend-patterns/SKILL.md +8 -45
  262. package/bundled/upstream/ecc/skills/cisco-ios-patterns/SKILL.md +163 -0
  263. package/bundled/upstream/ecc/skills/configure-ecc/SKILL.md +31 -14
  264. package/bundled/upstream/ecc/skills/continuous-learning/SKILL.md +10 -2
  265. package/bundled/upstream/ecc/skills/continuous-learning-v2/SKILL.md +19 -5
  266. package/bundled/upstream/ecc/skills/continuous-learning-v2/agents/observer-loop.sh +44 -4
  267. package/bundled/upstream/ecc/skills/continuous-learning-v2/agents/observer.md +4 -4
  268. package/bundled/upstream/ecc/skills/continuous-learning-v2/agents/start-observer.sh +5 -1
  269. package/bundled/upstream/ecc/skills/continuous-learning-v2/hooks/observe.sh +21 -5
  270. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +58 -13
  271. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +97 -4
  272. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/lib/homunculus-dir.sh +31 -0
  273. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/migrate-homunculus.sh +62 -0
  274. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/test_parse_instinct.py +34 -0
  275. package/bundled/upstream/ecc/skills/cost-tracking/SKILL.md +147 -0
  276. package/bundled/upstream/ecc/skills/deep-research/SKILL.md +4 -0
  277. package/bundled/upstream/ecc/skills/defi-amm-security/SKILL.md +6 -0
  278. package/bundled/upstream/ecc/skills/django-celery/SKILL.md +457 -0
  279. package/bundled/upstream/ecc/skills/ecc-guide/SKILL.md +189 -0
  280. package/bundled/upstream/ecc/skills/error-handling/SKILL.md +376 -0
  281. package/bundled/upstream/ecc/skills/exa-search/SKILL.md +4 -0
  282. package/bundled/upstream/ecc/skills/fal-ai-media/SKILL.md +4 -0
  283. package/bundled/upstream/ecc/skills/fastapi-patterns/SKILL.md +327 -0
  284. package/bundled/upstream/ecc/skills/flox-environments/SKILL.md +496 -0
  285. package/bundled/upstream/ecc/skills/frontend-design-direction/SKILL.md +92 -0
  286. package/bundled/upstream/ecc/skills/frontend-slides/animation-patterns.md +122 -0
  287. package/bundled/upstream/ecc/skills/frontend-slides/html-template.md +419 -0
  288. package/bundled/upstream/ecc/skills/frontend-slides/scripts/export-pdf.sh +418 -0
  289. package/bundled/upstream/ecc/skills/frontend-slides/scripts/extract-pptx.py +96 -0
  290. package/bundled/upstream/ecc/skills/frontend-slides/viewport-base.css +153 -0
  291. package/bundled/upstream/ecc/skills/fsharp-testing/SKILL.md +280 -0
  292. package/bundled/upstream/ecc/skills/gateguard/SKILL.md +4 -0
  293. package/bundled/upstream/ecc/skills/hermes-imports/SKILL.md +88 -0
  294. package/bundled/upstream/ecc/skills/homelab-network-readiness/SKILL.md +169 -0
  295. package/bundled/upstream/ecc/skills/homelab-network-setup/SKILL.md +129 -0
  296. package/bundled/upstream/ecc/skills/homelab-pihole-dns/SKILL.md +274 -0
  297. package/bundled/upstream/ecc/skills/homelab-vlan-segmentation/SKILL.md +311 -0
  298. package/bundled/upstream/ecc/skills/homelab-wireguard-vpn/SKILL.md +305 -0
  299. package/bundled/upstream/ecc/skills/ios-icon-gen/SKILL.md +157 -0
  300. package/bundled/upstream/ecc/skills/ios-icon-gen/scripts/generate_icons.swift +258 -0
  301. package/bundled/upstream/ecc/skills/ios-icon-gen/scripts/iconify_gen.sh +235 -0
  302. package/bundled/upstream/ecc/skills/java-coding-standards/SKILL.md +241 -5
  303. package/bundled/upstream/ecc/skills/make-interfaces-feel-better/SKILL.md +151 -0
  304. package/bundled/upstream/ecc/skills/mle-workflow/SKILL.md +346 -0
  305. package/bundled/upstream/ecc/skills/motion-advanced/SKILL.md +596 -0
  306. package/bundled/upstream/ecc/skills/motion-foundations/SKILL.md +299 -0
  307. package/bundled/upstream/ecc/skills/motion-patterns/SKILL.md +435 -0
  308. package/bundled/upstream/ecc/skills/motion-ui/SKILL.md +575 -0
  309. package/bundled/upstream/ecc/skills/mysql-patterns/SKILL.md +412 -0
  310. package/bundled/upstream/ecc/skills/netmiko-ssh-automation/SKILL.md +173 -0
  311. package/bundled/upstream/ecc/skills/network-bgp-diagnostics/SKILL.md +167 -0
  312. package/bundled/upstream/ecc/skills/network-config-validation/SKILL.md +210 -0
  313. package/bundled/upstream/ecc/skills/network-interface-health/SKILL.md +152 -0
  314. package/bundled/upstream/ecc/skills/openclaw-persona-forge/SKILL.md +1 -9
  315. package/bundled/upstream/ecc/skills/plan-orchestrate/SKILL.md +262 -0
  316. package/bundled/upstream/ecc/skills/prisma-patterns/SKILL.md +371 -0
  317. package/bundled/upstream/ecc/skills/production-audit/SKILL.md +206 -0
  318. package/bundled/upstream/ecc/skills/prompt-optimizer/SKILL.md +24 -400
  319. package/bundled/upstream/ecc/skills/quarkus-patterns/SKILL.md +722 -0
  320. package/bundled/upstream/ecc/skills/quarkus-security/SKILL.md +467 -0
  321. package/bundled/upstream/ecc/skills/quarkus-tdd/SKILL.md +811 -0
  322. package/bundled/upstream/ecc/skills/quarkus-verification/SKILL.md +479 -0
  323. package/bundled/upstream/ecc/skills/redis-patterns/SKILL.md +403 -0
  324. package/bundled/upstream/ecc/skills/scientific-db-pubmed-database/SKILL.md +175 -0
  325. package/bundled/upstream/ecc/skills/scientific-db-uspto-database/SKILL.md +177 -0
  326. package/bundled/upstream/ecc/skills/scientific-pkg-gget/SKILL.md +166 -0
  327. package/bundled/upstream/ecc/skills/scientific-thinking-literature-review/SKILL.md +192 -0
  328. package/bundled/upstream/ecc/skills/scientific-thinking-scholar-evaluation/SKILL.md +160 -0
  329. package/bundled/upstream/ecc/skills/search-first/SKILL.md +23 -2
  330. package/bundled/upstream/ecc/skills/security-review/SKILL.md +10 -2
  331. package/bundled/upstream/ecc/skills/skill-comply/scripts/runner.py +28 -3
  332. package/bundled/upstream/ecc/skills/skill-comply/tests/test_runner.py +172 -0
  333. package/bundled/upstream/ecc/skills/skill-scout/SKILL.md +140 -0
  334. package/bundled/upstream/ecc/skills/skill-stocktake/SKILL.md +1 -0
  335. package/bundled/upstream/ecc/skills/strategic-compact/SKILL.md +2 -2
  336. package/bundled/upstream/ecc/skills/tinystruct-patterns/SKILL.md +203 -0
  337. package/bundled/upstream/ecc/skills/tinystruct-patterns/references/architecture.md +90 -0
  338. package/bundled/upstream/ecc/skills/tinystruct-patterns/references/data-handling.md +60 -0
  339. package/bundled/upstream/ecc/skills/tinystruct-patterns/references/database.md +99 -0
  340. package/bundled/upstream/ecc/skills/tinystruct-patterns/references/routing.md +64 -0
  341. package/bundled/upstream/ecc/skills/tinystruct-patterns/references/system-usage.md +97 -0
  342. package/bundled/upstream/ecc/skills/tinystruct-patterns/references/testing.md +72 -0
  343. package/bundled/upstream/ecc/skills/ui-to-vue/SKILL.md +134 -0
  344. package/bundled/upstream/ecc/skills/vite-patterns/SKILL.md +449 -0
  345. package/bundled/upstream/ecc/skills/windows-desktop-e2e/SKILL.md +788 -0
  346. package/bundled/upstream/ecc/skills/x-api/SKILL.md +4 -0
  347. package/bundled/upstream/oh-my-claudecode/.omc-source/bundle.json +20 -0
  348. package/bundled/upstream/oh-my-claudecode/agents/analyst.md +2 -1
  349. package/bundled/upstream/oh-my-claudecode/agents/architect.md +2 -1
  350. package/bundled/upstream/oh-my-claudecode/agents/code-reviewer.md +26 -7
  351. package/bundled/upstream/oh-my-claudecode/agents/critic.md +2 -1
  352. package/bundled/upstream/oh-my-claudecode/agents/debugger.md +2 -1
  353. package/bundled/upstream/oh-my-claudecode/agents/designer.md +14 -1
  354. package/bundled/upstream/oh-my-claudecode/agents/document-specialist.md +1 -1
  355. package/bundled/upstream/oh-my-claudecode/agents/executor.md +2 -1
  356. package/bundled/upstream/oh-my-claudecode/agents/explore.md +2 -1
  357. package/bundled/upstream/oh-my-claudecode/agents/git-master.md +2 -1
  358. package/bundled/upstream/oh-my-claudecode/agents/planner.md +2 -1
  359. package/bundled/upstream/oh-my-claudecode/agents/qa-tester.md +2 -1
  360. package/bundled/upstream/oh-my-claudecode/agents/scientist.md +2 -1
  361. package/bundled/upstream/oh-my-claudecode/agents/security-reviewer.md +2 -1
  362. package/bundled/upstream/oh-my-claudecode/agents/test-engineer.md +2 -1
  363. package/bundled/upstream/oh-my-claudecode/agents/tracer.md +2 -1
  364. package/bundled/upstream/oh-my-claudecode/agents/verifier.md +2 -1
  365. package/bundled/upstream/oh-my-claudecode/agents/writer.md +2 -1
  366. package/bundled/upstream/oh-my-claudecode/skills/AGENTS.md +4 -3
  367. package/bundled/upstream/oh-my-claudecode/skills/ai-slop-cleaner/SKILL.md +12 -0
  368. package/bundled/upstream/oh-my-claudecode/skills/deep-dive/SKILL.md +69 -13
  369. package/bundled/upstream/oh-my-claudecode/skills/deep-interview/SKILL.md +176 -63
  370. package/bundled/upstream/oh-my-claudecode/skills/learner/SKILL.md +3 -1
  371. package/bundled/upstream/oh-my-claudecode/skills/omc-doctor/SKILL.md +22 -3
  372. package/bundled/upstream/oh-my-claudecode/skills/omc-reference/SKILL.md +1 -1
  373. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/01-install-claude-md.md +2 -2
  374. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/02-configure.md +45 -2
  375. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/03-integrations.md +46 -5
  376. package/bundled/upstream/oh-my-claudecode/skills/plan/SKILL.md +19 -17
  377. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/config.sh +1 -1
  378. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/parse.sh +1 -1
  379. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/azure-devops.sh +1 -1
  380. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/bitbucket.sh +1 -1
  381. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/gitea.sh +1 -1
  382. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/github.sh +1 -1
  383. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/gitlab.sh +1 -1
  384. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/interface.sh +1 -1
  385. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/jira.sh +1 -1
  386. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/session.sh +1 -1
  387. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/tmux.sh +1 -1
  388. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/worktree.sh +1 -1
  389. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/psm.sh +1 -1
  390. package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/tests/test-psm-prompt-injection.sh +1 -1
  391. package/bundled/upstream/oh-my-claudecode/skills/ralph/SKILL.md +8 -8
  392. package/bundled/upstream/oh-my-claudecode/skills/ralplan/SKILL.md +9 -5
  393. package/bundled/upstream/oh-my-claudecode/skills/skill/SKILL.md +6 -6
  394. package/bundled/upstream/oh-my-claudecode/skills/skillify/SKILL.md +19 -3
  395. package/bundled/upstream/oh-my-claudecode/skills/trace/SKILL.md +3 -1
  396. package/bundled/upstream/oh-my-claudecode/skills/ultrawork/SKILL.md +20 -7
  397. package/bundled/upstream/superpowers/.omc-source/bundle.json +21 -0
  398. package/bundled/upstream/superpowers/hooks/hooks-cursor.json +1 -1
  399. package/bundled/upstream/superpowers/skills/executing-plans/SKILL.md +1 -1
  400. package/bundled/upstream/superpowers/skills/finishing-a-development-branch/SKILL.md +93 -42
  401. package/bundled/upstream/superpowers/skills/requesting-code-review/SKILL.md +7 -9
  402. package/bundled/upstream/superpowers/skills/requesting-code-review/code-reviewer.md +107 -85
  403. package/bundled/upstream/superpowers/skills/subagent-driven-development/SKILL.md +3 -1
  404. package/bundled/upstream/superpowers/skills/subagent-driven-development/code-quality-reviewer-prompt.md +2 -3
  405. package/bundled/upstream/superpowers/skills/systematic-debugging/CREATION-LOG.md +1 -1
  406. package/bundled/upstream/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
  407. package/bundled/upstream/superpowers/skills/using-git-worktrees/SKILL.md +95 -98
  408. package/bundled/upstream/superpowers/skills/using-superpowers/references/codex-tools.md +7 -48
  409. package/bundled/upstream/superpowers/skills/using-superpowers/references/copilot-tools.md +1 -11
  410. package/bundled/upstream/superpowers/skills/using-superpowers/references/gemini-tools.md +21 -3
  411. package/bundled/upstream/superpowers/skills/writing-plans/SKILL.md +1 -1
  412. package/package.json +1 -1
  413. package/bundled/upstream/anthropic-skills/skills/claude-api/python/agent-sdk/README.md +0 -355
  414. package/bundled/upstream/anthropic-skills/skills/claude-api/python/agent-sdk/patterns.md +0 -359
  415. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/agent-sdk/README.md +0 -297
  416. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/agent-sdk/patterns.md +0 -209
  417. package/bundled/upstream/ecc/commands/agent-sort.md +0 -23
  418. package/bundled/upstream/ecc/commands/claw.md +0 -23
  419. package/bundled/upstream/ecc/commands/context-budget.md +0 -23
  420. package/bundled/upstream/ecc/commands/devfleet.md +0 -23
  421. package/bundled/upstream/ecc/commands/docs.md +0 -23
  422. package/bundled/upstream/ecc/commands/e2e.md +0 -268
  423. package/bundled/upstream/ecc/commands/eval.md +0 -23
  424. package/bundled/upstream/ecc/commands/orchestrate.md +0 -135
  425. package/bundled/upstream/ecc/commands/prompt-optimize.md +0 -23
  426. package/bundled/upstream/ecc/commands/rules-distill.md +0 -20
  427. package/bundled/upstream/ecc/commands/tdd.md +0 -231
  428. package/bundled/upstream/ecc/commands/verify.md +0 -23
  429. package/bundled/upstream/ecc/skills/claude-api/SKILL.md +0 -337
  430. package/bundled/upstream/ecc/skills/frontend-design/SKILL.md +0 -145
  431. package/bundled/upstream/superpowers/agents/code-reviewer.md +0 -48
  432. package/bundled/upstream/superpowers/commands/brainstorm.md +0 -5
  433. package/bundled/upstream/superpowers/commands/execute-plan.md +0 -5
  434. package/bundled/upstream/superpowers/commands/write-plan.md +0 -5
@@ -0,0 +1,195 @@
1
+ # Managed Agents — Events & Steering
2
+
3
+ ## Events
4
+
5
+ ### Sending Events
6
+
7
+ Send events to a session via `POST /v1/sessions/{id}/events`.
8
+
9
+ | Event Type | When to Send |
10
+ | ------------------------- | --------------------------------------------------- |
11
+ | `user.message` | Send a user message |
12
+ | `user.interrupt` | Interrupt the agent while it's running |
13
+ | `user.tool_confirmation` | Approve/deny a tool call (when `always_ask` policy) |
14
+ | `user.custom_tool_result` | Provide result for a custom tool call |
15
+ | `user.define_outcome` | Start a rubric-graded iterate loop — see `shared/managed-agents-outcomes.md` |
16
+
17
+ ### Receiving Events
18
+
19
+ Three methods:
20
+
21
+ 1. **Streaming (SSE)**: `GET /v1/sessions/{id}/events/stream` — real-time Server-Sent Events. **Long-lived** — the server sends periodic heartbeats to keep the connection alive.
22
+ 2. **Polling**: `GET /v1/sessions/{id}/events` — paginated event list (query params: `limit` default 1000, `page`). **Returns immediately** — this is a plain paginated GET, not a long-poll.
23
+ 3. **Webhooks**: Anthropic POSTs session state transitions to your HTTPS endpoint — thin payloads (IDs only), HMAC-signed, Console-registered. See `shared/managed-agents-webhooks.md`.
24
+
25
+ All received events carry `id`, `type`, and `processed_at` (ISO 8601; `null` if not yet processed by the agent).
26
+
27
+ > ⚠️ **Robust polling (raw HTTP).** If you bypass the SDK and roll your own poll loop, don't rely on `requests` or `httpx` timeouts as wall-clock caps — they're **per-chunk** read timeouts, reset every time a byte arrives. A trickling response (heartbeats, a wedged chunked-encoding body, a misbehaving proxy) can keep the call blocked indefinitely even with `timeout=(5, 60)` or `httpx.Timeout(120)`. Neither library has a "total wall-clock" timeout built in. For a hard deadline: track `time.monotonic()` at the loop level and break/cancel if a single request exceeds your budget (e.g. via a watchdog thread, or `asyncio.wait_for()` around async httpx). **Prefer the SDK** — `client.beta.sessions.events.stream()` and `client.beta.sessions.events.list()` handle timeout + retry sanely.
28
+ >
29
+ > If `GET /v1/sessions/{id}/events` (paginated) ever hangs after headers, you've likely hit `GET /v1/sessions/{id}/events` by mistake or a server-side stall — report it; don't treat it as a client-config problem.
30
+
31
+ ### Event Types (Received)
32
+
33
+ Event types use dot notation, grouped by namespace:
34
+
35
+ | Event Type | Description |
36
+ | --- | --- |
37
+ | `agent.message` | Agent text output |
38
+ | `agent.thinking` | Extended thinking blocks |
39
+ | `agent.tool_use` | Agent used a built-in tool (`agent_toolset_20260401`) |
40
+ | `agent.tool_result` | Result from a built-in tool |
41
+ | `agent.mcp_tool_use` | Agent used an MCP tool |
42
+ | `agent.mcp_tool_result` | Result from an MCP tool |
43
+ | `agent.custom_tool_use` | Agent invoked a custom tool — session goes idle, you respond with `user.custom_tool_result` |
44
+ | `agent.thread_context_compacted` | Conversation context was compacted |
45
+ | `session.status_idle` | Agent has finished the current task, and is awaiting input. It's either waiting for input to continue working via a `user.message` or blocked awaiting a `user.custom_tool_result` or `user.tool_confirmation`. The `stop_reason` attached contains more information about why the Agent has stopped working. |
46
+ | `session.status_running` | Session has starting running, and the Agent is actively doing work. |
47
+ | `session.status_rescheduled` | Session is (re)scheduling after a retryable error has occurred, ready to be picked up by the orchestration system. |
48
+ | `session.status_terminated` | Session has terminated, entering an irreversible and unusable state. |
49
+ | `session.error` | Error occurred during processing |
50
+ | `span.model_request_start` | Model inference started |
51
+ | `span.model_request_end` | Model inference completed |
52
+ | `span.outcome_evaluation_start` / `_ongoing` / `_end` | Grader progress for outcome-oriented sessions — see `shared/managed-agents-outcomes.md` |
53
+ | `session.thread_created` | Subagent thread spawned (multiagent) — see `shared/managed-agents-multiagent.md` |
54
+ | `session.thread_status_running` / `_idle` / `_rescheduled` / `_terminated` | Subagent thread status transitions (multiagent). `_idle` carries `stop_reason`. |
55
+ | `agent.thread_message_sent` / `_received` | Cross-thread message, carries `to_session_thread_id` / `from_session_thread_id` (multiagent) |
56
+
57
+ The stream also echoes back user-sent events (`user.message`, `user.interrupt`, `user.tool_confirmation`, `user.custom_tool_result`, `user.define_outcome`).
58
+
59
+ ---
60
+
61
+ ## Steering Patterns
62
+
63
+ Practical patterns for driving a session via the events surface.
64
+
65
+ ### Stream-first ordering
66
+
67
+ **Open the stream before sending events.** The stream only delivers events that occur *after* it's opened — it does not replay current state or historical events. If you send a message first and open the stream second, early events (including fast status transitions) arrive buffered in a single batch and you lose the ability to react to them in real time.
68
+
69
+ ```ts
70
+ // ✅ Correct — stream and send concurrently
71
+ const [response] = await Promise.all([
72
+ streamEvents(sessionId), // opens SSE connection
73
+ sendMessage(sessionId, text),
74
+ ]);
75
+
76
+ // ❌ Wrong — events before stream opens arrive as a single buffered batch
77
+ await sendMessage(sessionId, text);
78
+ const response = await streamEvents(sessionId);
79
+ ```
80
+
81
+ **For full history,** use `GET /v1/sessions/{id}/events` (paginated list) — the stream only gives you live events from connection onward.
82
+
83
+ ### Reconnecting after a dropped stream
84
+
85
+ **The SSE stream has no replay.** If your connection drops (httpx read timeout, network blip) and you reconnect, you only get events emitted *after* reconnection. Any events emitted during the gap are lost from the stream.
86
+
87
+ **The consolidation pattern:** on every (re)connect, overlap the stream with a history fetch and dedupe by event ID:
88
+
89
+ ```python
90
+ def connect_with_consolidation(client, session_id):
91
+ # 1. Open the SSE stream first
92
+ stream = client.beta.sessions.events.stream(session_id=session_id)
93
+
94
+ # 2. Fetch history to cover any gap
95
+ history = client.beta.sessions.events.list(
96
+ session_id=session_id,
97
+ )
98
+
99
+ # 3. Yield history first, then stream — dedupe by event.id
100
+ seen = set()
101
+ for ev in history.data:
102
+ seen.add(ev.id)
103
+ yield ev
104
+ for ev in stream:
105
+ if ev.id not in seen:
106
+ seen.add(ev.id)
107
+ yield ev
108
+ ```
109
+
110
+ ### Message queuing
111
+
112
+ **You don't have to wait for a response before sending the next message.** User events are queued server-side and processed in order. This is useful for chat bridges where the user sends rapid follow-ups:
113
+
114
+ ```ts
115
+ // All three go into one session; agent processes them in order
116
+ await sendMessage(sessionId, "Summarize the README");
117
+ await sendMessage(sessionId, "Actually also check the CONTRIBUTING guide");
118
+ await sendMessage(sessionId, "And compare the two");
119
+ // Stream once — agent responds to all three as a coherent turn
120
+ ```
121
+
122
+ Events can be sent up to the Session at any time. There is no need to wait on a specific session status to enqueue new events via `client.beta.sessions.events.send()`
123
+
124
+ ### Interrupt
125
+
126
+ An `interrupt` event **jumps the queue** (ahead of any pending user messages) and forces the session into `idle`. Use this for "stop" / "nevermind" / "cancel" commands:
127
+
128
+ ```ts
129
+ await client.beta.sessions.events.send(sessionId, {
130
+ events: [{ type: 'interrupt' }],
131
+ });
132
+ ```
133
+
134
+ The agent stops mid-task. It does not see the interrupt as a message — it just halts. Send a follow-up `user` event to explain what to do instead. If an outcome is active, the interrupt also marks `span.outcome_evaluation_end.result: "interrupted"` (see `shared/managed-agents-outcomes.md`).
135
+
136
+ > **Note**: Interrupt events may have empty IDs in the current implementation. When troubleshooting, use the `processed_at` timestamp along with surrounding event IDs.
137
+
138
+ ### Event payloads
139
+
140
+ some events carry useful metadata beyond the status change itself:
141
+
142
+ `session.status_idle` — includes a `stop_reason` field which elaborates on why the session stopped and what type of further action is required by the user.
143
+ ```json
144
+ {
145
+ "id": "sevt_456",
146
+ "processed_at": "2026-04-07T04:27:43.197Z",
147
+ "stop_reason": {
148
+ "event_ids": [
149
+ "sevt_123"
150
+ ],
151
+ "type": "requires_action"
152
+ },
153
+ "type": "status_idle"
154
+ }
155
+ ```
156
+
157
+ `span.model_request_end` contains a `model_usage` field for cost tracking and efficiency analysis:
158
+
159
+ ```json
160
+ {
161
+ "type": "span.model_request_end",
162
+ "id": "sevt_456",
163
+ "is_error": false,
164
+ "model_request_start_id": "sevt_123",
165
+ "model_usage": {
166
+ "cache_creation_input_tokens": 0,
167
+ "cache_read_input_tokens": 6656,
168
+ "input_tokens": 3571,
169
+ "output_tokens": 727
170
+ },
171
+ "processed_at": "2026-04-07T04:11:32.189Z"
172
+ }
173
+ ```
174
+
175
+ **`agent.thread_context_compacted`** — emitted when the conversation history was summarized to fit context. Includes `pre_compaction_tokens` so you know how much was squeezed:
176
+
177
+ ```json
178
+ {
179
+ "id": "sevt_abc123",
180
+ "processed_at": "2026-03-24T14:05:15.787Z",
181
+ "type": "agent.thread_context_compacted"
182
+ }
183
+ ```
184
+
185
+ ### Archive
186
+
187
+ When done with a session, archive it to free resources:
188
+
189
+ ```ts
190
+ await client.beta.sessions.archive(sessionId);
191
+ ```
192
+
193
+ > Archiving a **session** is routine cleanup — sessions are per-run and disposable. **Do not generalize this to agents or environments**: those are persistent, reusable resources, and archiving them is permanent (no unarchive; new sessions cannot reference them). See `shared/managed-agents-overview.md` → Common Pitfalls.
194
+
195
+
@@ -0,0 +1,197 @@
1
+ # Managed Agents — Memory Stores
2
+
3
+ > **Public beta.** Memory stores ship under the `managed-agents-2026-04-01` beta header; the SDK sets it automatically on all `client.beta.memory_stores.*` calls. If `client.beta.memory_stores` is missing, upgrade to the latest SDK release.
4
+
5
+ Sessions are ephemeral by default — when one ends, anything the agent learned is gone. A **memory store** is a workspace-scoped collection of small text documents that persists across sessions. When a store is attached to a session (via `resources[]`), it is mounted into the container as a filesystem directory; the agent reads and writes it with the ordinary file tools, and a system-prompt note tells it the mount is there.
6
+
7
+ Every mutation to a memory produces an immutable **memory version** (`memver_...`), giving you an audit trail and point-in-time rollback/redact.
8
+
9
+ ## Object model
10
+
11
+ | Object | ID prefix | Scope | Notes |
12
+ | --- | --- | --- | --- |
13
+ | Memory store | `memstore_...` | Workspace | Attach to sessions via `resources[]` |
14
+ | Memory | `mem_...` | Store | One text file, addressed by `path` (≤ 100KB each — prefer many small files) |
15
+ | Memory version | `memver_...` | Memory | Immutable snapshot per mutation; `operation` ∈ `created` / `modified` / `deleted` |
16
+
17
+ ## Create a store
18
+
19
+ `description` is passed to the agent so it knows what the store contains — write it for the model, not for humans.
20
+
21
+ ```python
22
+ store = client.beta.memory_stores.create(
23
+ name="User Preferences",
24
+ description="Per-user preferences and project context.",
25
+ )
26
+ print(store.id) # memstore_01Hx...
27
+ ```
28
+
29
+ Other SDKs: TypeScript `client.beta.memoryStores.create({...})`; Go `client.Beta.MemoryStores.New(ctx, ...)`. See `shared/managed-agents-api-reference.md` → SDK Method Reference for the full per-language table.
30
+
31
+ Stores support `retrieve` / `update` / `list` (with `include_archived`, `created_at_{gte,lte}` filters) / `delete` / **`archive`**. Archive makes the store read-only — existing session attachments continue, new sessions cannot reference it; no unarchive.
32
+
33
+ ### Seed with content (optional)
34
+
35
+ Pre-load reference material before any session runs. `memories.create` creates a memory at the given `path`; if a memory already exists there the call returns `409` (`memory_path_conflict_error`, with the `conflicting_memory_id`). The store ID is the first positional argument.
36
+
37
+ ```python
38
+ client.beta.memory_stores.memories.create(
39
+ store.id,
40
+ path="/formatting_standards.md",
41
+ content="All reports use GAAP formatting. Dates are ISO-8601...",
42
+ )
43
+ ```
44
+
45
+ ## Attach to a session
46
+
47
+ Memory stores go in the session's `resources[]` array alongside `file` and `github_repository` resources (see `shared/managed-agents-environments.md` → Resources). Memory stores attach at **session create time only** — `sessions.resources.add()` does not accept `memory_store`.
48
+
49
+ ```python
50
+ session = client.beta.sessions.create(
51
+ agent=agent.id,
52
+ environment_id=environment.id,
53
+ resources=[
54
+ {
55
+ "type": "memory_store",
56
+ "memory_store_id": store.id,
57
+ "access": "read_write", # or "read_only"; default is "read_write"
58
+ "instructions": "User preferences and project context. Check before starting any task.",
59
+ }
60
+ ],
61
+ )
62
+ ```
63
+
64
+ | Field | Required | Notes |
65
+ | --- | --- | --- |
66
+ | `type` | ✅ | `"memory_store"` |
67
+ | `memory_store_id` | ✅ | `memstore_...` |
68
+ | `access` | — | `"read_write"` (default) or `"read_only"` — enforced at the filesystem level on the mount |
69
+ | `instructions` | — | Session-specific guidance for this store, in addition to the store's `name`/`description`. ≤ 4,096 chars. |
70
+
71
+ **Max 8 memory stores per session.** Attach multiple when different slices of memory have different owners or lifecycles — e.g. one read-only shared-reference store plus one read-write per-user store, or one store per end-user/team/project sharing a single agent config.
72
+
73
+ ### How the agent sees it (FUSE mount)
74
+
75
+ Each attached store is mounted in the session container at `/mnt/memory/<store-name>/`. The agent interacts with it using the standard file tools (`bash`, `read`, `write`, `edit`, `glob`, `grep`) — there are no dedicated memory tools. `access: "read_only"` makes the mount read-only at the filesystem level; `"read_write"` allows the agent to create, edit, and delete files under it. A short description of each mount (name, path, `instructions`, access) is automatically injected into the system prompt so the agent knows the store exists without you having to mention it.
76
+
77
+ Writes the agent makes under the mount are persisted back to the store and produce memory versions just like host-side `memories.update` calls.
78
+
79
+ ## Manage memories directly (host-side)
80
+
81
+ Use these for review workflows, correcting bad memories, or seeding stores out-of-band.
82
+
83
+ ### List
84
+
85
+ Returns `Memory | MemoryPrefix` entries — a `MemoryPrefix` (`type: "memory_prefix"`, just a `path`) is a directory-like node when listing hierarchically. Use `path_prefix` to scope (include a trailing slash: `"/notes/"` matches `/notes/a.md` but not `/notes_backup/old.md`) and `depth` to bound the tree walk. `order_by` / `order` sort the result. Pass `view="full"` to include `content` in each item; the default `"basic"` returns metadata only.
86
+
87
+ ```python
88
+ for m in client.beta.memory_stores.memories.list(store.id, path_prefix="/"):
89
+ if m.type == "memory":
90
+ print(f"{m.path} ({m.content_size_bytes} bytes, sha={m.content_sha256[:8]})")
91
+ else: # "memory_prefix"
92
+ print(f"{m.path}/")
93
+ ```
94
+
95
+ ### Read
96
+
97
+ ```python
98
+ mem = client.beta.memory_stores.memories.retrieve(memory_id, memory_store_id=store.id)
99
+ print(mem.content)
100
+ ```
101
+
102
+ `retrieve` defaults to `view="full"` (content included); `view` matters mainly on list endpoints.
103
+
104
+ ### Create vs. update
105
+
106
+ | Operation | Addressed by | Semantics |
107
+ | --- | --- | --- |
108
+ | `memories.create(store_id, path=..., content=...)` | **Path** | Create at `path`. `409` (`memory_path_conflict_error`, includes `conflicting_memory_id`) if the path is already occupied. |
109
+ | `memories.update(mem_id, memory_store_id=..., path=..., content=...)` | **`mem_...` ID** | Mutate existing memory. Change `content`, `path` (rename), or both. Renaming onto an occupied path returns the same `409 memory_path_conflict_error`. |
110
+
111
+ ```python
112
+ mem = client.beta.memory_stores.memories.create(
113
+ store.id,
114
+ path="/preferences/formatting.md",
115
+ content="Always use tabs, not spaces.",
116
+ )
117
+
118
+ client.beta.memory_stores.memories.update(
119
+ mem.id,
120
+ memory_store_id=store.id,
121
+ path="/archive/2026_q1_formatting.md", # rename
122
+ )
123
+ ```
124
+
125
+ ### Optimistic concurrency (precondition on `update`)
126
+
127
+ `memories.update` accepts a `precondition` so you can read → modify → write back without clobbering a concurrent writer. The only supported type is `content_sha256`. On mismatch the API returns `409` (`memory_precondition_failed_error`) — re-read and retry against fresh state.
128
+
129
+ ```python
130
+ client.beta.memory_stores.memories.update(
131
+ mem.id,
132
+ memory_store_id=store.id,
133
+ content="CORRECTED: Always use 2-space indentation.",
134
+ precondition={"type": "content_sha256", "content_sha256": mem.content_sha256},
135
+ )
136
+ ```
137
+
138
+ ### Delete
139
+
140
+ ```python
141
+ client.beta.memory_stores.memories.delete(mem.id, memory_store_id=store.id)
142
+ ```
143
+
144
+ Pass `expected_content_sha256` for a conditional delete.
145
+
146
+ ## Audit and rollback — memory versions
147
+
148
+ Every mutation creates an immutable `memver_...` snapshot. Versions accumulate for the lifetime of the parent memory; `memories.retrieve` always returns the current head, the version endpoints give you history.
149
+
150
+ | Operation that triggers it | `operation` field on the version |
151
+ | --- | --- |
152
+ | `memories.create` at a new path | `"created"` |
153
+ | `memories.update` changing `content`, `path`, or both (or an agent-side write to the mount) | `"modified"` |
154
+ | `memories.delete` | `"deleted"` |
155
+
156
+ Each version also records `created_by` — an actor object with `type` ∈ `session_actor` / `api_actor` / `user_actor` — and, after redaction, `redacted_at` + `redacted_by`.
157
+
158
+ ### List versions
159
+
160
+ Newest-first, paginated. Filter by `memory_id`, `operation`, `session_id`, `api_key_id`, or `created_at_gte` / `created_at_lte`. Pass `view="full"` to include `content`; default is metadata-only.
161
+
162
+ ```python
163
+ for v in client.beta.memory_stores.memory_versions.list(store.id, memory_id=mem.id):
164
+ print(f"{v.id}: {v.operation}")
165
+ ```
166
+
167
+ ### Retrieve a version
168
+
169
+ ```python
170
+ version = client.beta.memory_stores.memory_versions.retrieve(
171
+ version_id, memory_store_id=store.id
172
+ )
173
+ print(version.content)
174
+ ```
175
+
176
+ ### Redact a version
177
+
178
+ Scrubs content from a historical version while preserving the audit trail (actor + timestamps). Clears `content`, `content_sha256`, `content_size_bytes`, and `path`; everything else stays. Use for leaked secrets, PII, or user-deletion requests.
179
+
180
+ ```python
181
+ client.beta.memory_stores.memory_versions.redact(version_id, memory_store_id=store.id)
182
+ ```
183
+
184
+ ## Endpoint reference
185
+
186
+ See `shared/managed-agents-api-reference.md` → Memory Stores / Memories / Memory Versions for the full HTTP method/path tables. Raw HTTP base path:
187
+
188
+ ```
189
+ POST /v1/memory_stores
190
+ POST /v1/memory_stores/{memory_store_id}/archive
191
+ GET /v1/memory_stores/{memory_store_id}/memories
192
+ PATCH /v1/memory_stores/{memory_store_id}/memories/{memory_id}
193
+ GET /v1/memory_stores/{memory_store_id}/memory_versions
194
+ POST /v1/memory_stores/{memory_store_id}/memory_versions/{version_id}/redact
195
+ ```
196
+
197
+ For cURL examples and the CLI (`ant beta:memory-stores ...`), WebFetch the Memory URL in `shared/live-sources.md` → Managed Agents.
@@ -0,0 +1,99 @@
1
+ # Managed Agents — Multiagent Sessions
2
+
3
+ A coordinator agent can delegate to other agents within one session. All agents **share the container and filesystem**; each runs in its own **thread** — a context-isolated event stream with its own conversation history, model, system prompt, tools, MCP servers, and skills (from that agent's own config). Threads are persistent: the coordinator can send a follow-up to a subagent it called earlier and that subagent retains its prior turns.
4
+
5
+ The SDK sets the `managed-agents-2026-04-01` beta header automatically on all `client.beta.{agents,sessions}.*` calls; no additional header is required for multiagent.
6
+
7
+ ---
8
+
9
+ ## Declare the roster on the coordinator
10
+
11
+ `multiagent` is a **top-level field** on `agents.create()` / `agents.update()` — **not** a `tools[]` entry. `agents` lists 1–20 roster entries. Nothing changes on `sessions.create()` — the roster is resolved from the coordinator's config.
12
+
13
+ ```python
14
+ orchestrator = client.beta.agents.create(
15
+ name="Engineering Lead",
16
+ model="{{OPUS_ID}}",
17
+ system="You coordinate engineering work. Delegate code review to the reviewer and test writing to the test agent.",
18
+ tools=[{"type": "agent_toolset_20260401"}],
19
+ multiagent={
20
+ "type": "coordinator",
21
+ "agents": [
22
+ reviewer.id, # bare string — latest version
23
+ {"type": "agent", "id": test_writer.id, "version": 4}, # pinned version
24
+ {"type": "self"}, # the coordinator itself
25
+ ],
26
+ },
27
+ )
28
+
29
+ session = client.beta.sessions.create(agent=orchestrator.id, environment_id=env.id)
30
+ ```
31
+
32
+ | Roster entry | Shape | Notes |
33
+ |---|---|---|
34
+ | String shorthand | `"agent_abc123"` | References the latest version of a stored agent. |
35
+ | Agent reference | `{type: "agent", id, version?}` | Omit `version` to pin the latest at coordinator save time. |
36
+ | Self | `{type: "self"}` | The coordinator can spawn copies of itself. |
37
+
38
+ Up to **20 unique agents** in the roster; the coordinator may spawn **multiple copies** of each. **One level of delegation only** — depth > 1 is ignored.
39
+
40
+ ---
41
+
42
+ ## Threads
43
+
44
+ The session-level event stream is the **primary thread** — it shows the coordinator's trace plus a condensed view of subagent activity (thread status transitions and cross-thread messages, not every subagent tool call). Drill into a specific subagent via the per-thread endpoints:
45
+
46
+ | Operation | HTTP | SDK (`client.beta.sessions.threads.*`) |
47
+ |---|---|---|
48
+ | List threads | `GET /v1/sessions/{sid}/threads` | `.list(session_id)` |
49
+ | Retrieve one | `GET /v1/sessions/{sid}/threads/{tid}` | `.retrieve(thread_id, session_id=...)` |
50
+ | Archive | `POST /v1/sessions/{sid}/threads/{tid}/archive` | `.archive(thread_id, session_id=...)` |
51
+ | List thread events | `GET /v1/sessions/{sid}/threads/{tid}/events` | `.events.list(thread_id, session_id=...)` |
52
+ | Stream thread events | `GET /v1/sessions/{sid}/threads/{tid}/stream` | `.events.stream(thread_id, session_id=...)` |
53
+
54
+ Each `SessionThread` carries `id`, `status` (`running` | `idle` | `rescheduling` | `terminated`), `agent` (a resolved snapshot of the agent config — `id`, `name`, `model`, `system`, `tools`, `skills`, `mcp_servers`, `version`), `parent_thread_id` (null for the primary thread, which is included in the list), `archived_at`, and optional `stats`/`usage`. **Session status aggregates thread statuses** — if any thread is `running`, `session.status` is `running`. Max **25 concurrent threads**. When draining a per-thread stream, break on `session.thread_status_idle` (and check its `stop_reason` as you would for the session-level idle).
55
+
56
+ ---
57
+
58
+ ## Multiagent events (on the session stream)
59
+
60
+ | Event | Payload highlights | Meaning |
61
+ |---|---|---|
62
+ | `session.thread_created` | `session_thread_id`, `agent_name` | A new thread was created. |
63
+ | `session.thread_status_running` | `session_thread_id`, `agent_name` | Thread started activity. |
64
+ | `session.thread_status_idle` | `session_thread_id`, `agent_name`, **`stop_reason`** | Thread is awaiting input. Inspect `stop_reason` (same shape as `session.status_idle.stop_reason`). |
65
+ | `session.thread_status_rescheduled` | `session_thread_id`, `agent_name` | Thread is rescheduling after a retryable error. |
66
+ | `session.thread_status_terminated` | `session_thread_id`, `agent_name` | Thread was archived or hit a terminal error. |
67
+ | `agent.thread_message_sent` | `to_session_thread_id`, `to_agent_name`, `content` | Coordinator sent a follow-up to another thread. |
68
+ | `agent.thread_message_received` | `from_session_thread_id`, `from_agent_name`, `content` | An agent delivered its result to the coordinator. |
69
+
70
+ ---
71
+
72
+ ## Tool permissions and custom tools from subagent threads
73
+
74
+ When a subagent needs your client (an `always_ask` confirmation, or a custom tool result), the request is **cross-posted to the primary thread** with `session_thread_id` identifying the originating thread — so you only need to watch the session stream. Reply with `user.tool_confirmation` (carrying `tool_use_id`) or `user.custom_tool_result` (carrying `custom_tool_use_id`), and **echo the `session_thread_id` from the originating event** (the SDK param type and docstring expect it). The server also routes by the tool-use ID, so the echo is belt-and-suspenders rather than load-bearing — but include it.
75
+
76
+ ```python
77
+ for event_id in stop.event_ids:
78
+ pending = events_by_id[event_id]
79
+ confirmation = {
80
+ "type": "user.tool_confirmation",
81
+ "tool_use_id": event_id,
82
+ "result": "allow",
83
+ }
84
+ if pending.session_thread_id is not None:
85
+ confirmation["session_thread_id"] = pending.session_thread_id
86
+ client.beta.sessions.events.send(session.id, events=[confirmation])
87
+ ```
88
+
89
+ The same pattern applies to `user.custom_tool_result`.
90
+
91
+ ---
92
+
93
+ ## Pitfalls
94
+
95
+ - **Don't put the roster on `sessions.create()` or in `tools[]`.** `multiagent` is a top-level agent field; update the coordinator, then start a session that references it.
96
+ - **Don't assume shared context.** Threads share the filesystem but not conversation history or tools. If the coordinator needs a subagent to act on something, it must say so in the delegated message (or write it to disk).
97
+ - **Depth > 1 is ignored.** A subagent's own `multiagent` roster (if any) doesn't cascade — only the session's coordinator delegates.
98
+
99
+ For per-language bindings beyond Python, WebFetch `https://platform.claude.com/docs/en/managed-agents/multi-agent.md` (see `shared/live-sources.md`).
@@ -0,0 +1,114 @@
1
+ # Managed Agents — Onboarding Flow
2
+
3
+ > **Invoked via `/claude-api managed-agents-onboard`?** You're in the right place. Run the interview below — don't summarize it back to the user, ask the questions.
4
+
5
+ Use this when a user wants to set up a Managed Agent from scratch. Three steps: **branch on know-vs-explore → configure the template → set up the session**. End by emitting working code.
6
+
7
+ > Read `shared/managed-agents-core.md` alongside this — it has full detail for each knob. This doc is the interview script, not the reference.
8
+
9
+ ---
10
+
11
+ Claude Managed Agents is a hosted agent: Anthropic runs the agent loop on its orchestration layer and provisions a sandboxed container per session where the agent's tools execute. You supply the agent config and the environment config; the harness — event stream, sandbox orchestration, prompt caching, context compaction, and extended thinking — is handled for you.
12
+
13
+ **What you supply:**
14
+ - **An agent config** — tools, skills, model, system prompt. Reusable and versioned.
15
+ - **An environment config** — the sandbox your agent's tools execute in (networking, packages). Reusable across agents.
16
+
17
+ Each run of the agent is a **session**.
18
+
19
+ ---
20
+
21
+ ## 1. Know or explore?
22
+
23
+ Ask the user:
24
+
25
+ > Do you already know the agent you want to build, or would you like to explore some common patterns first?
26
+
27
+ ### Explore path — show the patterns
28
+
29
+ Four shapes, same runtime code path (`sessions.create()` → `sessions.events.send()` → stream). Only the trigger and sink differ.
30
+
31
+ | Pattern | Trigger | Example |
32
+ |---|---|---|
33
+ | Event-triggered | Webhook | GitHub PR push → CMA (GitHub tool) → Slack | # <------ MC maybe delete?
34
+ | Scheduled | Cron | Daily brief: browser + GitHub + Jira → CMA → Slack | # <------ MC maybe delete?
35
+ | Fire-and-forget PR | Human | Slack slash-command → CMA (GitHub tool) → PR passing CI |
36
+ | Research + dashboard | Human | Topic → CMA (web search + `frontend-design` skill) → HTML dashboard |
37
+
38
+ Ask which shape fits, then continue with the Know path using it as the reference.
39
+
40
+ ### Know path — configure template
41
+
42
+ Three rounds. Batch the questions in each round; don't ask them one at a time.
43
+
44
+ **Round A — Tools.** Start here; it's the most concrete part. Three types; ask which the user wants (any combination):
45
+
46
+ | Type | What it is | How to guide |
47
+ |---|---|---|
48
+ | **Prebuilt Claude Agent tools** (`agent_toolset_20260401`) | Ready-to-use: `bash`, `read`, `write`, `edit`, `glob`, `grep`, `web_fetch`, `web_search`. Enable all at once, or individually via `enabled: true/false`. | Recommend enabling the full toolset. List the 8 tools so the user knows what they're getting. Full detail: `shared/managed-agents-tools.md` → Agent Toolset. |
49
+ | **MCP tools** | Third-party integrations (GitHub, Linear, Asana, etc.) via `mcp_toolset`. Credentials live in a vault, not inline. | Ask which services. For each, walk through MCP server URL + vault credentials. Full detail: `shared/managed-agents-tools.md` → MCP Servers + Vaults. |
50
+ | **Custom tools** | The user's own app handles these tool calls — agent fires `agent.custom_tool_use`, the app sends a result message back. | Ask for each tool: name, description, input schema. The app code that handles the event is *their* code — don't generate it. Full detail: `shared/managed-agents-tools.md` → Custom Tools. |
51
+
52
+ **Round B — Skills, files, and repos.** What the agent has on hand when it starts.
53
+
54
+ *Skills* — two types; both work the same way — Claude auto-uses them when relevant. Max 20 per agent.
55
+ - [ ] **Pre-built Agent Skills**: `xlsx`, `docx`, `pptx`, `pdf`. Reference by name.
56
+ - [ ] **Custom Skills**: skills uploaded to the user's org via the Skills API. Reference by `skill_id` + optional `version`. If the skill doesn't exist yet, walk the user through `POST /v1/skills` + `POST /v1/skills/{id}/versions` (beta header `skills-2025-10-02`). Full detail: `shared/managed-agents-tools.md` → Skills + Skills API.
57
+
58
+ *GitHub repositories* — any repos the agent needs on-disk? For each:
59
+ - [ ] Repo URL (`https://github.com/org/repo`)
60
+ - [ ] `authorization_token` (PAT or GitHub App token scoped to the repo)
61
+ - [ ] Optional `mount_path` (defaults to `/workspace/<repo-name>`) and `checkout` (branch or SHA)
62
+
63
+ Emit as `resources: [{type: "github_repository", url, authorization_token, ...}]`. Full detail: `shared/managed-agents-environments.md` → GitHub Repositories.
64
+
65
+ > ‼️ **PR creation needs the GitHub MCP server too.** `github_repository` gives filesystem access only — to open PRs, also attach the GitHub MCP server in Round A and credential it via a vault. The workflow is: edit files in the mounted repo → push branch via `bash` → create PR via the MCP `create_pull_request` tool.
66
+
67
+ *Files* — any local files to seed the session with? For each:
68
+ - [ ] Upload via the Files API → persist `file_id`
69
+ - [ ] Choose a `mount_path` — absolute, e.g. `/workspace/data.csv` (parents auto-created; files mount read-only)
70
+
71
+ Emit as `resources: [{type: "file", file_id, mount_path}]`. Max 999 file resources. Agent working directory defaults to `/workspace`. Full detail: `shared/managed-agents-environments.md` → Files API.
72
+
73
+ **Round C — Environment + identity:**
74
+ - [ ] Networking: unrestricted internet from the container, or lock egress to specific hosts? (If locked, MCP server domains must be in `allowed_hosts` or tools silently fail.)
75
+ - [ ] Name?
76
+ - [ ] Job (one or two sentences — becomes the system prompt)?
77
+ - [ ] Model? (default `claude-opus-4-7`)
78
+
79
+ ---
80
+
81
+ ## 2. Set up the session
82
+
83
+ Per-run. Points at the agent + environment, attaches credentials, kicks off.
84
+
85
+ **Vault credentials** (if the agent declared MCP servers):
86
+ - [ ] Existing vault, or create one? (`client.beta.vaults.create()` + `vaults.credentials.create()`)
87
+
88
+ Credentials are write-only, matched to MCP servers by URL, auto-refreshed. See `shared/managed-agents-tools.md` → Vaults.
89
+
90
+ **Kickoff:**
91
+ - [ ] First message to the agent?
92
+
93
+ Session creation blocks until all resources mount. Open the event stream before sending the kickoff. Stream is SSE; break on `session.status_terminated`, or on `session.status_idle` with a terminal `stop_reason` — i.e. anything except `requires_action`, which fires transiently while the session waits on a tool confirmation or custom-tool result (see `shared/managed-agents-client-patterns.md` Pattern 5). Usage lands on `span.model_request_end`. Agent-written artifacts end up in `/mnt/session/outputs/` — download via `files.list({scope_id: session.id, betas: ["managed-agents-2026-04-01"]})`.
94
+
95
+ ---
96
+
97
+ ## 3. Emit the code
98
+
99
+ Go straight from the last interview answer to the code — no preamble about the setup-vs-runtime split, no "the critical thing to internalize…", no lecture about `agents.create()` being one-time. The two-block structure below already shows that; don't narrate it. Generate **two clearly-separated blocks** per language detected (Python/TS/cURL — see SKILL.md → Language Detection):
100
+
101
+ **Block 1 — Setup (run once, store the IDs):**
102
+ 1. `environments.create()` → persist `env_id`
103
+ 2. `agents.create()` with everything from §Round A–C → persist `agent_id` and `agent_version`
104
+
105
+ Label: `# ONE-TIME SETUP — run once, save the IDs to config/.env`
106
+
107
+ **Block 2 — Runtime (run on every invocation):**
108
+ 1. Load `env_id` + `agent_id` from config/env
109
+ 2. `sessions.create(agent=AGENT_ID, environment_id=ENV_ID, resources=[...], vault_ids=[...])`
110
+ 3. Open stream, `events.send()` the kickoff, loop until `session.status_terminated` or `session.status_idle && stop_reason.type !== 'requires_action'` (see `shared/managed-agents-client-patterns.md` Pattern 5 for the full gate — do not break on bare `session.status_idle`)
111
+
112
+ > ⚠️ **Never emit `agents.create()` and `sessions.create()` in the same unguarded block.** That teaches the user to create a new agent on every run — the #1 anti-pattern. If they need a single script, wrap agent creation in `if not os.getenv("AGENT_ID"):`.
113
+
114
+ Pull exact syntax from `python/managed-agents/README.md`, `typescript/managed-agents/README.md`, or `curl/managed-agents.md`. Don't invent field names.