agentsys 5.0.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 (1310) hide show
  1. package/.agnix.toml +49 -0
  2. package/.claude-plugin/marketplace.json +110 -0
  3. package/.claude-plugin/plugin.json +20 -0
  4. package/AGENTS.md +260 -0
  5. package/CHANGELOG.md +190 -0
  6. package/LICENSE +21 -0
  7. package/README.md +916 -0
  8. package/SECURITY.md +45 -0
  9. package/adapters/README.md +258 -0
  10. package/adapters/codex/README.md +273 -0
  11. package/adapters/codex/install.sh +260 -0
  12. package/adapters/codex/skills/agnix/SKILL.md +138 -0
  13. package/adapters/codex/skills/audit-project/SKILL.md +334 -0
  14. package/adapters/codex/skills/audit-project-agents/SKILL.md +459 -0
  15. package/adapters/codex/skills/audit-project-github/SKILL.md +146 -0
  16. package/adapters/codex/skills/consult/SKILL.md +245 -0
  17. package/adapters/codex/skills/delivery-approval/SKILL.md +339 -0
  18. package/adapters/codex/skills/deslop/SKILL.md +167 -0
  19. package/adapters/codex/skills/drift-detect/SKILL.md +268 -0
  20. package/adapters/codex/skills/enhance/SKILL.md +177 -0
  21. package/adapters/codex/skills/learn/SKILL.md +188 -0
  22. package/adapters/codex/skills/next-task/SKILL.md +546 -0
  23. package/adapters/codex/skills/perf/SKILL.md +469 -0
  24. package/adapters/codex/skills/repo-map/SKILL.md +132 -0
  25. package/adapters/codex/skills/ship/SKILL.md +491 -0
  26. package/adapters/codex/skills/ship-ci-review-loop/SKILL.md +473 -0
  27. package/adapters/codex/skills/ship-deployment/SKILL.md +336 -0
  28. package/adapters/codex/skills/ship-error-handling/SKILL.md +260 -0
  29. package/adapters/codex/skills/sync-docs/SKILL.md +186 -0
  30. package/adapters/opencode/README.md +302 -0
  31. package/adapters/opencode/agents/agent-enhancer.md +65 -0
  32. package/adapters/opencode/agents/agnix-agent.md +56 -0
  33. package/adapters/opencode/agents/ci-fixer.md +104 -0
  34. package/adapters/opencode/agents/ci-monitor.md +127 -0
  35. package/adapters/opencode/agents/claudemd-enhancer.md +66 -0
  36. package/adapters/opencode/agents/consult-agent.md +124 -0
  37. package/adapters/opencode/agents/cross-file-enhancer.md +54 -0
  38. package/adapters/opencode/agents/delivery-validator.md +115 -0
  39. package/adapters/opencode/agents/deslop-agent.md +88 -0
  40. package/adapters/opencode/agents/docs-enhancer.md +65 -0
  41. package/adapters/opencode/agents/exploration-agent.md +143 -0
  42. package/adapters/opencode/agents/hooks-enhancer.md +66 -0
  43. package/adapters/opencode/agents/implementation-agent.md +206 -0
  44. package/adapters/opencode/agents/learn-agent.md +279 -0
  45. package/adapters/opencode/agents/map-validator.md +65 -0
  46. package/adapters/opencode/agents/perf-analyzer.md +40 -0
  47. package/adapters/opencode/agents/perf-code-paths.md +12 -0
  48. package/adapters/opencode/agents/perf-investigation-logger.md +44 -0
  49. package/adapters/opencode/agents/perf-orchestrator.md +147 -0
  50. package/adapters/opencode/agents/perf-theory-gatherer.md +18 -0
  51. package/adapters/opencode/agents/perf-theory-tester.md +43 -0
  52. package/adapters/opencode/agents/plan-synthesizer.md +229 -0
  53. package/adapters/opencode/agents/planning-agent.md +235 -0
  54. package/adapters/opencode/agents/plugin-enhancer.md +64 -0
  55. package/adapters/opencode/agents/prompt-enhancer.md +58 -0
  56. package/adapters/opencode/agents/simple-fixer.md +107 -0
  57. package/adapters/opencode/agents/skills-enhancer.md +66 -0
  58. package/adapters/opencode/agents/sync-docs-agent.md +153 -0
  59. package/adapters/opencode/agents/task-discoverer.md +80 -0
  60. package/adapters/opencode/agents/test-coverage-checker.md +144 -0
  61. package/adapters/opencode/agents/worktree-manager.md +209 -0
  62. package/adapters/opencode/commands/agnix.md +106 -0
  63. package/adapters/opencode/commands/audit-project-agents.md +125 -0
  64. package/adapters/opencode/commands/audit-project-github.md +145 -0
  65. package/adapters/opencode/commands/audit-project.md +268 -0
  66. package/adapters/opencode/commands/consult.md +252 -0
  67. package/adapters/opencode/commands/delivery-approval.md +212 -0
  68. package/adapters/opencode/commands/deslop.md +132 -0
  69. package/adapters/opencode/commands/drift-detect.md +173 -0
  70. package/adapters/opencode/commands/enhance.md +183 -0
  71. package/adapters/opencode/commands/learn.md +116 -0
  72. package/adapters/opencode/commands/next-task.md +393 -0
  73. package/adapters/opencode/commands/perf.md +49 -0
  74. package/adapters/opencode/commands/repo-map.md +69 -0
  75. package/adapters/opencode/commands/ship-ci-review-loop.md +334 -0
  76. package/adapters/opencode/commands/ship-deployment.md +336 -0
  77. package/adapters/opencode/commands/ship-error-handling.md +248 -0
  78. package/adapters/opencode/commands/ship.md +371 -0
  79. package/adapters/opencode/commands/sync-docs.md +108 -0
  80. package/adapters/opencode/install.sh +322 -0
  81. package/adapters/opencode/skills/agnix/SKILL.md +139 -0
  82. package/adapters/opencode/skills/consult/SKILL.md +292 -0
  83. package/adapters/opencode/skills/deslop/SKILL.md +169 -0
  84. package/adapters/opencode/skills/discover-tasks/SKILL.md +102 -0
  85. package/adapters/opencode/skills/drift-analysis/SKILL.md +279 -0
  86. package/adapters/opencode/skills/enhance-agent-prompts/SKILL.md +279 -0
  87. package/adapters/opencode/skills/enhance-claude-memory/SKILL.md +390 -0
  88. package/adapters/opencode/skills/enhance-cross-file/SKILL.md +112 -0
  89. package/adapters/opencode/skills/enhance-docs/SKILL.md +288 -0
  90. package/adapters/opencode/skills/enhance-hooks/SKILL.md +557 -0
  91. package/adapters/opencode/skills/enhance-orchestrator/SKILL.md +114 -0
  92. package/adapters/opencode/skills/enhance-plugins/SKILL.md +314 -0
  93. package/adapters/opencode/skills/enhance-prompts/SKILL.md +341 -0
  94. package/adapters/opencode/skills/enhance-skills/SKILL.md +443 -0
  95. package/adapters/opencode/skills/learn/SKILL.md +352 -0
  96. package/adapters/opencode/skills/orchestrate-review/SKILL.md +95 -0
  97. package/adapters/opencode/skills/perf-analyzer/SKILL.md +38 -0
  98. package/adapters/opencode/skills/perf-baseline-manager/SKILL.md +31 -0
  99. package/adapters/opencode/skills/perf-benchmarker/SKILL.md +49 -0
  100. package/adapters/opencode/skills/perf-code-paths/SKILL.md +33 -0
  101. package/adapters/opencode/skills/perf-investigation-logger/SKILL.md +42 -0
  102. package/adapters/opencode/skills/perf-profiler/SKILL.md +39 -0
  103. package/adapters/opencode/skills/perf-theory-gatherer/SKILL.md +36 -0
  104. package/adapters/opencode/skills/perf-theory-tester/SKILL.md +37 -0
  105. package/adapters/opencode/skills/repo-mapping/SKILL.md +86 -0
  106. package/adapters/opencode/skills/sync-docs/SKILL.md +246 -0
  107. package/adapters/opencode/skills/validate-delivery/SKILL.md +112 -0
  108. package/adapters/opencode-plugin/index.ts +346 -0
  109. package/adapters/opencode-plugin/package.json +21 -0
  110. package/agent-knowledge/AGENTS.md +62 -0
  111. package/agent-knowledge/ai-cli-advanced-integration-patterns.md +670 -0
  112. package/agent-knowledge/ai-cli-non-interactive-programmatic-usage.md +1394 -0
  113. package/agent-knowledge/resources/ai-cli-non-interactive-programmatic-usage-sources.json +500 -0
  114. package/bin/cli.js +719 -0
  115. package/bin/dev-cli.js +587 -0
  116. package/lib/adapter-transforms.js +278 -0
  117. package/lib/collectors/codebase.js +392 -0
  118. package/lib/collectors/docs-patterns.js +713 -0
  119. package/lib/collectors/documentation.js +219 -0
  120. package/lib/collectors/github.js +266 -0
  121. package/lib/collectors/index.js +126 -0
  122. package/lib/config/index.js +14 -0
  123. package/lib/cross-platform/index.js +539 -0
  124. package/lib/discovery/index.js +352 -0
  125. package/lib/drift-detect/collectors.js +37 -0
  126. package/lib/enhance/agent-analyzer.js +421 -0
  127. package/lib/enhance/agent-patterns.js +571 -0
  128. package/lib/enhance/auto-suppression.js +622 -0
  129. package/lib/enhance/benchmark.js +417 -0
  130. package/lib/enhance/cross-file-analyzer.js +930 -0
  131. package/lib/enhance/cross-file-patterns.js +370 -0
  132. package/lib/enhance/docs-analyzer.js +325 -0
  133. package/lib/enhance/docs-patterns.js +671 -0
  134. package/lib/enhance/fixer.js +721 -0
  135. package/lib/enhance/hook-analyzer.js +135 -0
  136. package/lib/enhance/hook-patterns.js +40 -0
  137. package/lib/enhance/index.js +127 -0
  138. package/lib/enhance/plugin-analyzer.js +402 -0
  139. package/lib/enhance/plugin-patterns.js +326 -0
  140. package/lib/enhance/projectmemory-analyzer.js +551 -0
  141. package/lib/enhance/projectmemory-patterns.js +617 -0
  142. package/lib/enhance/prompt-analyzer.js +457 -0
  143. package/lib/enhance/prompt-patterns.js +1484 -0
  144. package/lib/enhance/reporter.js +1348 -0
  145. package/lib/enhance/security-patterns.js +284 -0
  146. package/lib/enhance/skill-analyzer.js +182 -0
  147. package/lib/enhance/skill-patterns.js +147 -0
  148. package/lib/enhance/suppression.js +352 -0
  149. package/lib/enhance/tool-patterns.js +373 -0
  150. package/lib/index.js +270 -0
  151. package/lib/package.json +25 -0
  152. package/lib/patterns/cli-enhancers.js +611 -0
  153. package/lib/patterns/pipeline.js +948 -0
  154. package/lib/patterns/review-patterns.js +558 -0
  155. package/lib/patterns/slop-analyzers.js +2305 -0
  156. package/lib/patterns/slop-patterns.js +1187 -0
  157. package/lib/perf/analyzer/index.js +22 -0
  158. package/lib/perf/argument-parser.js +105 -0
  159. package/lib/perf/baseline-comparator.js +50 -0
  160. package/lib/perf/baseline-store.js +127 -0
  161. package/lib/perf/benchmark-runner.js +399 -0
  162. package/lib/perf/breaking-point-finder.js +52 -0
  163. package/lib/perf/breaking-point-runner.js +60 -0
  164. package/lib/perf/checkpoint.js +123 -0
  165. package/lib/perf/code-paths.js +86 -0
  166. package/lib/perf/consolidation.js +37 -0
  167. package/lib/perf/constraint-runner.js +71 -0
  168. package/lib/perf/experiment-runner.js +32 -0
  169. package/lib/perf/index.js +41 -0
  170. package/lib/perf/investigation-state.js +875 -0
  171. package/lib/perf/optimization-runner.js +79 -0
  172. package/lib/perf/profilers/go.js +22 -0
  173. package/lib/perf/profilers/index.js +46 -0
  174. package/lib/perf/profilers/java.js +23 -0
  175. package/lib/perf/profilers/node.js +27 -0
  176. package/lib/perf/profilers/python.js +23 -0
  177. package/lib/perf/profilers/rust.js +23 -0
  178. package/lib/perf/profiling-runner.js +56 -0
  179. package/lib/perf/schemas.js +140 -0
  180. package/lib/platform/detect-platform.js +413 -0
  181. package/lib/platform/detection-configs.js +93 -0
  182. package/lib/platform/state-dir.js +132 -0
  183. package/lib/platform/verify-tools.js +182 -0
  184. package/lib/repo-map/cache.js +152 -0
  185. package/lib/repo-map/index.js +222 -0
  186. package/lib/repo-map/installer.js +212 -0
  187. package/lib/repo-map/queries/go.js +27 -0
  188. package/lib/repo-map/queries/index.js +100 -0
  189. package/lib/repo-map/queries/java.js +38 -0
  190. package/lib/repo-map/queries/javascript.js +55 -0
  191. package/lib/repo-map/queries/python.js +24 -0
  192. package/lib/repo-map/queries/rust.js +73 -0
  193. package/lib/repo-map/queries/typescript.js +38 -0
  194. package/lib/repo-map/runner.js +1165 -0
  195. package/lib/repo-map/updater.js +474 -0
  196. package/lib/repo-map/usage-analyzer.js +407 -0
  197. package/lib/schemas/plugin-manifest.schema.json +57 -0
  198. package/lib/schemas/validator.js +247 -0
  199. package/lib/sources/custom-handler.js +199 -0
  200. package/lib/sources/policy-questions.js +246 -0
  201. package/lib/sources/source-cache.js +165 -0
  202. package/lib/state/workflow-state.js +575 -0
  203. package/lib/types/agent-frontmatter.d.ts +134 -0
  204. package/lib/types/command-frontmatter.d.ts +107 -0
  205. package/lib/types/hook-frontmatter.d.ts +115 -0
  206. package/lib/types/index.d.ts +84 -0
  207. package/lib/types/plugin-manifest.d.ts +102 -0
  208. package/lib/types/skill-frontmatter.d.ts +89 -0
  209. package/lib/utils/atomic-write.js +94 -0
  210. package/lib/utils/cache-manager.js +159 -0
  211. package/lib/utils/context-optimizer.js +300 -0
  212. package/lib/utils/deprecation.js +37 -0
  213. package/lib/utils/shell-escape.js +88 -0
  214. package/meta/skills/maintain-cross-platform/SKILL.md +1022 -0
  215. package/package.json +92 -0
  216. package/plugins/agnix/.claude-plugin/plugin.json +22 -0
  217. package/plugins/agnix/agents/agnix-agent.md +56 -0
  218. package/plugins/agnix/commands/agnix.md +139 -0
  219. package/plugins/agnix/skills/agnix/SKILL.md +138 -0
  220. package/plugins/audit-project/.claude-plugin/plugin.json +20 -0
  221. package/plugins/audit-project/commands/audit-project-agents.md +458 -0
  222. package/plugins/audit-project/commands/audit-project-github.md +144 -0
  223. package/plugins/audit-project/commands/audit-project.md +336 -0
  224. package/plugins/audit-project/lib/adapter-transforms.js +278 -0
  225. package/plugins/audit-project/lib/collectors/codebase.js +392 -0
  226. package/plugins/audit-project/lib/collectors/docs-patterns.js +713 -0
  227. package/plugins/audit-project/lib/collectors/documentation.js +219 -0
  228. package/plugins/audit-project/lib/collectors/github.js +266 -0
  229. package/plugins/audit-project/lib/collectors/index.js +126 -0
  230. package/plugins/audit-project/lib/config/index.js +14 -0
  231. package/plugins/audit-project/lib/cross-platform/index.js +539 -0
  232. package/plugins/audit-project/lib/discovery/index.js +352 -0
  233. package/plugins/audit-project/lib/drift-detect/collectors.js +37 -0
  234. package/plugins/audit-project/lib/enhance/agent-analyzer.js +421 -0
  235. package/plugins/audit-project/lib/enhance/agent-patterns.js +571 -0
  236. package/plugins/audit-project/lib/enhance/auto-suppression.js +622 -0
  237. package/plugins/audit-project/lib/enhance/benchmark.js +417 -0
  238. package/plugins/audit-project/lib/enhance/cross-file-analyzer.js +930 -0
  239. package/plugins/audit-project/lib/enhance/cross-file-patterns.js +370 -0
  240. package/plugins/audit-project/lib/enhance/docs-analyzer.js +325 -0
  241. package/plugins/audit-project/lib/enhance/docs-patterns.js +671 -0
  242. package/plugins/audit-project/lib/enhance/fixer.js +721 -0
  243. package/plugins/audit-project/lib/enhance/hook-analyzer.js +135 -0
  244. package/plugins/audit-project/lib/enhance/hook-patterns.js +40 -0
  245. package/plugins/audit-project/lib/enhance/index.js +127 -0
  246. package/plugins/audit-project/lib/enhance/plugin-analyzer.js +402 -0
  247. package/plugins/audit-project/lib/enhance/plugin-patterns.js +326 -0
  248. package/plugins/audit-project/lib/enhance/projectmemory-analyzer.js +551 -0
  249. package/plugins/audit-project/lib/enhance/projectmemory-patterns.js +617 -0
  250. package/plugins/audit-project/lib/enhance/prompt-analyzer.js +457 -0
  251. package/plugins/audit-project/lib/enhance/prompt-patterns.js +1484 -0
  252. package/plugins/audit-project/lib/enhance/reporter.js +1348 -0
  253. package/plugins/audit-project/lib/enhance/security-patterns.js +284 -0
  254. package/plugins/audit-project/lib/enhance/skill-analyzer.js +182 -0
  255. package/plugins/audit-project/lib/enhance/skill-patterns.js +147 -0
  256. package/plugins/audit-project/lib/enhance/suppression.js +352 -0
  257. package/plugins/audit-project/lib/enhance/tool-patterns.js +373 -0
  258. package/plugins/audit-project/lib/index.js +270 -0
  259. package/plugins/audit-project/lib/patterns/cli-enhancers.js +611 -0
  260. package/plugins/audit-project/lib/patterns/pipeline.js +948 -0
  261. package/plugins/audit-project/lib/patterns/review-patterns.js +558 -0
  262. package/plugins/audit-project/lib/patterns/slop-analyzers.js +2305 -0
  263. package/plugins/audit-project/lib/patterns/slop-patterns.js +1187 -0
  264. package/plugins/audit-project/lib/perf/analyzer/index.js +22 -0
  265. package/plugins/audit-project/lib/perf/argument-parser.js +105 -0
  266. package/plugins/audit-project/lib/perf/baseline-comparator.js +50 -0
  267. package/plugins/audit-project/lib/perf/baseline-store.js +127 -0
  268. package/plugins/audit-project/lib/perf/benchmark-runner.js +399 -0
  269. package/plugins/audit-project/lib/perf/breaking-point-finder.js +52 -0
  270. package/plugins/audit-project/lib/perf/breaking-point-runner.js +60 -0
  271. package/plugins/audit-project/lib/perf/checkpoint.js +123 -0
  272. package/plugins/audit-project/lib/perf/code-paths.js +86 -0
  273. package/plugins/audit-project/lib/perf/consolidation.js +37 -0
  274. package/plugins/audit-project/lib/perf/constraint-runner.js +71 -0
  275. package/plugins/audit-project/lib/perf/experiment-runner.js +32 -0
  276. package/plugins/audit-project/lib/perf/index.js +41 -0
  277. package/plugins/audit-project/lib/perf/investigation-state.js +875 -0
  278. package/plugins/audit-project/lib/perf/optimization-runner.js +79 -0
  279. package/plugins/audit-project/lib/perf/profilers/go.js +22 -0
  280. package/plugins/audit-project/lib/perf/profilers/index.js +46 -0
  281. package/plugins/audit-project/lib/perf/profilers/java.js +23 -0
  282. package/plugins/audit-project/lib/perf/profilers/node.js +27 -0
  283. package/plugins/audit-project/lib/perf/profilers/python.js +23 -0
  284. package/plugins/audit-project/lib/perf/profilers/rust.js +23 -0
  285. package/plugins/audit-project/lib/perf/profiling-runner.js +56 -0
  286. package/plugins/audit-project/lib/perf/schemas.js +140 -0
  287. package/plugins/audit-project/lib/platform/detect-platform.js +413 -0
  288. package/plugins/audit-project/lib/platform/detection-configs.js +93 -0
  289. package/plugins/audit-project/lib/platform/state-dir.js +132 -0
  290. package/plugins/audit-project/lib/platform/verify-tools.js +182 -0
  291. package/plugins/audit-project/lib/repo-map/cache.js +152 -0
  292. package/plugins/audit-project/lib/repo-map/index.js +222 -0
  293. package/plugins/audit-project/lib/repo-map/installer.js +212 -0
  294. package/plugins/audit-project/lib/repo-map/queries/go.js +27 -0
  295. package/plugins/audit-project/lib/repo-map/queries/index.js +100 -0
  296. package/plugins/audit-project/lib/repo-map/queries/java.js +38 -0
  297. package/plugins/audit-project/lib/repo-map/queries/javascript.js +55 -0
  298. package/plugins/audit-project/lib/repo-map/queries/python.js +24 -0
  299. package/plugins/audit-project/lib/repo-map/queries/rust.js +73 -0
  300. package/plugins/audit-project/lib/repo-map/queries/typescript.js +38 -0
  301. package/plugins/audit-project/lib/repo-map/runner.js +1165 -0
  302. package/plugins/audit-project/lib/repo-map/updater.js +474 -0
  303. package/plugins/audit-project/lib/repo-map/usage-analyzer.js +407 -0
  304. package/plugins/audit-project/lib/schemas/plugin-manifest.schema.json +57 -0
  305. package/plugins/audit-project/lib/schemas/validator.js +247 -0
  306. package/plugins/audit-project/lib/sources/custom-handler.js +199 -0
  307. package/plugins/audit-project/lib/sources/policy-questions.js +246 -0
  308. package/plugins/audit-project/lib/sources/source-cache.js +165 -0
  309. package/plugins/audit-project/lib/state/workflow-state.js +575 -0
  310. package/plugins/audit-project/lib/types/agent-frontmatter.d.ts +134 -0
  311. package/plugins/audit-project/lib/types/command-frontmatter.d.ts +107 -0
  312. package/plugins/audit-project/lib/types/hook-frontmatter.d.ts +115 -0
  313. package/plugins/audit-project/lib/types/index.d.ts +84 -0
  314. package/plugins/audit-project/lib/types/plugin-manifest.d.ts +102 -0
  315. package/plugins/audit-project/lib/types/skill-frontmatter.d.ts +89 -0
  316. package/plugins/audit-project/lib/utils/atomic-write.js +94 -0
  317. package/plugins/audit-project/lib/utils/cache-manager.js +159 -0
  318. package/plugins/audit-project/lib/utils/context-optimizer.js +300 -0
  319. package/plugins/audit-project/lib/utils/deprecation.js +37 -0
  320. package/plugins/audit-project/lib/utils/shell-escape.js +88 -0
  321. package/plugins/consult/.claude-plugin/plugin.json +24 -0
  322. package/plugins/consult/agents/consult-agent.md +129 -0
  323. package/plugins/consult/commands/consult.md +248 -0
  324. package/plugins/consult/skills/consult/SKILL.md +285 -0
  325. package/plugins/deslop/.claude-plugin/plugin.json +20 -0
  326. package/plugins/deslop/agents/deslop-agent.md +88 -0
  327. package/plugins/deslop/commands/deslop.md +168 -0
  328. package/plugins/deslop/lib/adapter-transforms.js +278 -0
  329. package/plugins/deslop/lib/collectors/codebase.js +392 -0
  330. package/plugins/deslop/lib/collectors/docs-patterns.js +713 -0
  331. package/plugins/deslop/lib/collectors/documentation.js +219 -0
  332. package/plugins/deslop/lib/collectors/github.js +266 -0
  333. package/plugins/deslop/lib/collectors/index.js +126 -0
  334. package/plugins/deslop/lib/config/index.js +14 -0
  335. package/plugins/deslop/lib/cross-platform/index.js +539 -0
  336. package/plugins/deslop/lib/discovery/index.js +352 -0
  337. package/plugins/deslop/lib/drift-detect/collectors.js +37 -0
  338. package/plugins/deslop/lib/enhance/agent-analyzer.js +421 -0
  339. package/plugins/deslop/lib/enhance/agent-patterns.js +571 -0
  340. package/plugins/deslop/lib/enhance/auto-suppression.js +622 -0
  341. package/plugins/deslop/lib/enhance/benchmark.js +417 -0
  342. package/plugins/deslop/lib/enhance/cross-file-analyzer.js +930 -0
  343. package/plugins/deslop/lib/enhance/cross-file-patterns.js +370 -0
  344. package/plugins/deslop/lib/enhance/docs-analyzer.js +325 -0
  345. package/plugins/deslop/lib/enhance/docs-patterns.js +671 -0
  346. package/plugins/deslop/lib/enhance/fixer.js +721 -0
  347. package/plugins/deslop/lib/enhance/hook-analyzer.js +135 -0
  348. package/plugins/deslop/lib/enhance/hook-patterns.js +40 -0
  349. package/plugins/deslop/lib/enhance/index.js +127 -0
  350. package/plugins/deslop/lib/enhance/plugin-analyzer.js +402 -0
  351. package/plugins/deslop/lib/enhance/plugin-patterns.js +326 -0
  352. package/plugins/deslop/lib/enhance/projectmemory-analyzer.js +551 -0
  353. package/plugins/deslop/lib/enhance/projectmemory-patterns.js +617 -0
  354. package/plugins/deslop/lib/enhance/prompt-analyzer.js +457 -0
  355. package/plugins/deslop/lib/enhance/prompt-patterns.js +1484 -0
  356. package/plugins/deslop/lib/enhance/reporter.js +1348 -0
  357. package/plugins/deslop/lib/enhance/security-patterns.js +284 -0
  358. package/plugins/deslop/lib/enhance/skill-analyzer.js +182 -0
  359. package/plugins/deslop/lib/enhance/skill-patterns.js +147 -0
  360. package/plugins/deslop/lib/enhance/suppression.js +352 -0
  361. package/plugins/deslop/lib/enhance/tool-patterns.js +373 -0
  362. package/plugins/deslop/lib/index.js +270 -0
  363. package/plugins/deslop/lib/patterns/cli-enhancers.js +611 -0
  364. package/plugins/deslop/lib/patterns/pipeline.js +948 -0
  365. package/plugins/deslop/lib/patterns/review-patterns.js +558 -0
  366. package/plugins/deslop/lib/patterns/slop-analyzers.js +2305 -0
  367. package/plugins/deslop/lib/patterns/slop-patterns.js +1187 -0
  368. package/plugins/deslop/lib/perf/analyzer/index.js +22 -0
  369. package/plugins/deslop/lib/perf/argument-parser.js +105 -0
  370. package/plugins/deslop/lib/perf/baseline-comparator.js +50 -0
  371. package/plugins/deslop/lib/perf/baseline-store.js +127 -0
  372. package/plugins/deslop/lib/perf/benchmark-runner.js +399 -0
  373. package/plugins/deslop/lib/perf/breaking-point-finder.js +52 -0
  374. package/plugins/deslop/lib/perf/breaking-point-runner.js +60 -0
  375. package/plugins/deslop/lib/perf/checkpoint.js +123 -0
  376. package/plugins/deslop/lib/perf/code-paths.js +86 -0
  377. package/plugins/deslop/lib/perf/consolidation.js +37 -0
  378. package/plugins/deslop/lib/perf/constraint-runner.js +71 -0
  379. package/plugins/deslop/lib/perf/experiment-runner.js +32 -0
  380. package/plugins/deslop/lib/perf/index.js +41 -0
  381. package/plugins/deslop/lib/perf/investigation-state.js +875 -0
  382. package/plugins/deslop/lib/perf/optimization-runner.js +79 -0
  383. package/plugins/deslop/lib/perf/profilers/go.js +22 -0
  384. package/plugins/deslop/lib/perf/profilers/index.js +46 -0
  385. package/plugins/deslop/lib/perf/profilers/java.js +23 -0
  386. package/plugins/deslop/lib/perf/profilers/node.js +27 -0
  387. package/plugins/deslop/lib/perf/profilers/python.js +23 -0
  388. package/plugins/deslop/lib/perf/profilers/rust.js +23 -0
  389. package/plugins/deslop/lib/perf/profiling-runner.js +56 -0
  390. package/plugins/deslop/lib/perf/schemas.js +140 -0
  391. package/plugins/deslop/lib/platform/detect-platform.js +413 -0
  392. package/plugins/deslop/lib/platform/detection-configs.js +93 -0
  393. package/plugins/deslop/lib/platform/state-dir.js +132 -0
  394. package/plugins/deslop/lib/platform/verify-tools.js +182 -0
  395. package/plugins/deslop/lib/repo-map/cache.js +152 -0
  396. package/plugins/deslop/lib/repo-map/index.js +222 -0
  397. package/plugins/deslop/lib/repo-map/installer.js +212 -0
  398. package/plugins/deslop/lib/repo-map/queries/go.js +27 -0
  399. package/plugins/deslop/lib/repo-map/queries/index.js +100 -0
  400. package/plugins/deslop/lib/repo-map/queries/java.js +38 -0
  401. package/plugins/deslop/lib/repo-map/queries/javascript.js +55 -0
  402. package/plugins/deslop/lib/repo-map/queries/python.js +24 -0
  403. package/plugins/deslop/lib/repo-map/queries/rust.js +73 -0
  404. package/plugins/deslop/lib/repo-map/queries/typescript.js +38 -0
  405. package/plugins/deslop/lib/repo-map/runner.js +1165 -0
  406. package/plugins/deslop/lib/repo-map/updater.js +474 -0
  407. package/plugins/deslop/lib/repo-map/usage-analyzer.js +407 -0
  408. package/plugins/deslop/lib/schemas/plugin-manifest.schema.json +57 -0
  409. package/plugins/deslop/lib/schemas/validator.js +247 -0
  410. package/plugins/deslop/lib/sources/custom-handler.js +199 -0
  411. package/plugins/deslop/lib/sources/policy-questions.js +246 -0
  412. package/plugins/deslop/lib/sources/source-cache.js +165 -0
  413. package/plugins/deslop/lib/state/workflow-state.js +575 -0
  414. package/plugins/deslop/lib/types/agent-frontmatter.d.ts +134 -0
  415. package/plugins/deslop/lib/types/command-frontmatter.d.ts +107 -0
  416. package/plugins/deslop/lib/types/hook-frontmatter.d.ts +115 -0
  417. package/plugins/deslop/lib/types/index.d.ts +84 -0
  418. package/plugins/deslop/lib/types/plugin-manifest.d.ts +102 -0
  419. package/plugins/deslop/lib/types/skill-frontmatter.d.ts +89 -0
  420. package/plugins/deslop/lib/utils/atomic-write.js +94 -0
  421. package/plugins/deslop/lib/utils/cache-manager.js +159 -0
  422. package/plugins/deslop/lib/utils/context-optimizer.js +300 -0
  423. package/plugins/deslop/lib/utils/deprecation.js +37 -0
  424. package/plugins/deslop/lib/utils/shell-escape.js +88 -0
  425. package/plugins/deslop/references/slop-categories.md +122 -0
  426. package/plugins/deslop/scripts/detect.js +134 -0
  427. package/plugins/deslop/skills/deslop/SKILL.md +204 -0
  428. package/plugins/drift-detect/.claude-plugin/plugin.json +23 -0
  429. package/plugins/drift-detect/agents/plan-synthesizer.md +225 -0
  430. package/plugins/drift-detect/commands/drift-detect.md +269 -0
  431. package/plugins/drift-detect/lib/adapter-transforms.js +278 -0
  432. package/plugins/drift-detect/lib/collectors/codebase.js +392 -0
  433. package/plugins/drift-detect/lib/collectors/docs-patterns.js +713 -0
  434. package/plugins/drift-detect/lib/collectors/documentation.js +219 -0
  435. package/plugins/drift-detect/lib/collectors/github.js +266 -0
  436. package/plugins/drift-detect/lib/collectors/index.js +126 -0
  437. package/plugins/drift-detect/lib/config/index.js +14 -0
  438. package/plugins/drift-detect/lib/cross-platform/index.js +539 -0
  439. package/plugins/drift-detect/lib/discovery/index.js +352 -0
  440. package/plugins/drift-detect/lib/drift-detect/collectors.js +37 -0
  441. package/plugins/drift-detect/lib/enhance/agent-analyzer.js +421 -0
  442. package/plugins/drift-detect/lib/enhance/agent-patterns.js +571 -0
  443. package/plugins/drift-detect/lib/enhance/auto-suppression.js +622 -0
  444. package/plugins/drift-detect/lib/enhance/benchmark.js +417 -0
  445. package/plugins/drift-detect/lib/enhance/cross-file-analyzer.js +930 -0
  446. package/plugins/drift-detect/lib/enhance/cross-file-patterns.js +370 -0
  447. package/plugins/drift-detect/lib/enhance/docs-analyzer.js +325 -0
  448. package/plugins/drift-detect/lib/enhance/docs-patterns.js +671 -0
  449. package/plugins/drift-detect/lib/enhance/fixer.js +721 -0
  450. package/plugins/drift-detect/lib/enhance/hook-analyzer.js +135 -0
  451. package/plugins/drift-detect/lib/enhance/hook-patterns.js +40 -0
  452. package/plugins/drift-detect/lib/enhance/index.js +127 -0
  453. package/plugins/drift-detect/lib/enhance/plugin-analyzer.js +402 -0
  454. package/plugins/drift-detect/lib/enhance/plugin-patterns.js +326 -0
  455. package/plugins/drift-detect/lib/enhance/projectmemory-analyzer.js +551 -0
  456. package/plugins/drift-detect/lib/enhance/projectmemory-patterns.js +617 -0
  457. package/plugins/drift-detect/lib/enhance/prompt-analyzer.js +457 -0
  458. package/plugins/drift-detect/lib/enhance/prompt-patterns.js +1484 -0
  459. package/plugins/drift-detect/lib/enhance/reporter.js +1348 -0
  460. package/plugins/drift-detect/lib/enhance/security-patterns.js +284 -0
  461. package/plugins/drift-detect/lib/enhance/skill-analyzer.js +182 -0
  462. package/plugins/drift-detect/lib/enhance/skill-patterns.js +147 -0
  463. package/plugins/drift-detect/lib/enhance/suppression.js +352 -0
  464. package/plugins/drift-detect/lib/enhance/tool-patterns.js +373 -0
  465. package/plugins/drift-detect/lib/index.js +270 -0
  466. package/plugins/drift-detect/lib/patterns/cli-enhancers.js +611 -0
  467. package/plugins/drift-detect/lib/patterns/pipeline.js +948 -0
  468. package/plugins/drift-detect/lib/patterns/review-patterns.js +558 -0
  469. package/plugins/drift-detect/lib/patterns/slop-analyzers.js +2305 -0
  470. package/plugins/drift-detect/lib/patterns/slop-patterns.js +1187 -0
  471. package/plugins/drift-detect/lib/perf/analyzer/index.js +22 -0
  472. package/plugins/drift-detect/lib/perf/argument-parser.js +105 -0
  473. package/plugins/drift-detect/lib/perf/baseline-comparator.js +50 -0
  474. package/plugins/drift-detect/lib/perf/baseline-store.js +127 -0
  475. package/plugins/drift-detect/lib/perf/benchmark-runner.js +399 -0
  476. package/plugins/drift-detect/lib/perf/breaking-point-finder.js +52 -0
  477. package/plugins/drift-detect/lib/perf/breaking-point-runner.js +60 -0
  478. package/plugins/drift-detect/lib/perf/checkpoint.js +123 -0
  479. package/plugins/drift-detect/lib/perf/code-paths.js +86 -0
  480. package/plugins/drift-detect/lib/perf/consolidation.js +37 -0
  481. package/plugins/drift-detect/lib/perf/constraint-runner.js +71 -0
  482. package/plugins/drift-detect/lib/perf/experiment-runner.js +32 -0
  483. package/plugins/drift-detect/lib/perf/index.js +41 -0
  484. package/plugins/drift-detect/lib/perf/investigation-state.js +875 -0
  485. package/plugins/drift-detect/lib/perf/optimization-runner.js +79 -0
  486. package/plugins/drift-detect/lib/perf/profilers/go.js +22 -0
  487. package/plugins/drift-detect/lib/perf/profilers/index.js +46 -0
  488. package/plugins/drift-detect/lib/perf/profilers/java.js +23 -0
  489. package/plugins/drift-detect/lib/perf/profilers/node.js +27 -0
  490. package/plugins/drift-detect/lib/perf/profilers/python.js +23 -0
  491. package/plugins/drift-detect/lib/perf/profilers/rust.js +23 -0
  492. package/plugins/drift-detect/lib/perf/profiling-runner.js +56 -0
  493. package/plugins/drift-detect/lib/perf/schemas.js +140 -0
  494. package/plugins/drift-detect/lib/platform/detect-platform.js +413 -0
  495. package/plugins/drift-detect/lib/platform/detection-configs.js +93 -0
  496. package/plugins/drift-detect/lib/platform/state-dir.js +132 -0
  497. package/plugins/drift-detect/lib/platform/verify-tools.js +182 -0
  498. package/plugins/drift-detect/lib/repo-map/cache.js +152 -0
  499. package/plugins/drift-detect/lib/repo-map/index.js +222 -0
  500. package/plugins/drift-detect/lib/repo-map/installer.js +212 -0
  501. package/plugins/drift-detect/lib/repo-map/queries/go.js +27 -0
  502. package/plugins/drift-detect/lib/repo-map/queries/index.js +100 -0
  503. package/plugins/drift-detect/lib/repo-map/queries/java.js +38 -0
  504. package/plugins/drift-detect/lib/repo-map/queries/javascript.js +55 -0
  505. package/plugins/drift-detect/lib/repo-map/queries/python.js +24 -0
  506. package/plugins/drift-detect/lib/repo-map/queries/rust.js +73 -0
  507. package/plugins/drift-detect/lib/repo-map/queries/typescript.js +38 -0
  508. package/plugins/drift-detect/lib/repo-map/runner.js +1165 -0
  509. package/plugins/drift-detect/lib/repo-map/updater.js +474 -0
  510. package/plugins/drift-detect/lib/repo-map/usage-analyzer.js +407 -0
  511. package/plugins/drift-detect/lib/schemas/plugin-manifest.schema.json +57 -0
  512. package/plugins/drift-detect/lib/schemas/validator.js +247 -0
  513. package/plugins/drift-detect/lib/sources/custom-handler.js +199 -0
  514. package/plugins/drift-detect/lib/sources/policy-questions.js +246 -0
  515. package/plugins/drift-detect/lib/sources/source-cache.js +165 -0
  516. package/plugins/drift-detect/lib/state/workflow-state.js +575 -0
  517. package/plugins/drift-detect/lib/types/agent-frontmatter.d.ts +134 -0
  518. package/plugins/drift-detect/lib/types/command-frontmatter.d.ts +107 -0
  519. package/plugins/drift-detect/lib/types/hook-frontmatter.d.ts +115 -0
  520. package/plugins/drift-detect/lib/types/index.d.ts +84 -0
  521. package/plugins/drift-detect/lib/types/plugin-manifest.d.ts +102 -0
  522. package/plugins/drift-detect/lib/types/skill-frontmatter.d.ts +89 -0
  523. package/plugins/drift-detect/lib/utils/atomic-write.js +94 -0
  524. package/plugins/drift-detect/lib/utils/cache-manager.js +159 -0
  525. package/plugins/drift-detect/lib/utils/context-optimizer.js +300 -0
  526. package/plugins/drift-detect/lib/utils/deprecation.js +37 -0
  527. package/plugins/drift-detect/lib/utils/shell-escape.js +88 -0
  528. package/plugins/drift-detect/skills/drift-analysis/SKILL.md +324 -0
  529. package/plugins/enhance/.claude-plugin/plugin.json +20 -0
  530. package/plugins/enhance/agents/agent-enhancer.md +64 -0
  531. package/plugins/enhance/agents/claudemd-enhancer.md +65 -0
  532. package/plugins/enhance/agents/cross-file-enhancer.md +54 -0
  533. package/plugins/enhance/agents/docs-enhancer.md +64 -0
  534. package/plugins/enhance/agents/hooks-enhancer.md +64 -0
  535. package/plugins/enhance/agents/plugin-enhancer.md +63 -0
  536. package/plugins/enhance/agents/prompt-enhancer.md +58 -0
  537. package/plugins/enhance/agents/skills-enhancer.md +64 -0
  538. package/plugins/enhance/commands/enhance.md +178 -0
  539. package/plugins/enhance/lib/adapter-transforms.js +278 -0
  540. package/plugins/enhance/lib/collectors/codebase.js +392 -0
  541. package/plugins/enhance/lib/collectors/docs-patterns.js +713 -0
  542. package/plugins/enhance/lib/collectors/documentation.js +219 -0
  543. package/plugins/enhance/lib/collectors/github.js +266 -0
  544. package/plugins/enhance/lib/collectors/index.js +126 -0
  545. package/plugins/enhance/lib/config/index.js +14 -0
  546. package/plugins/enhance/lib/cross-platform/index.js +539 -0
  547. package/plugins/enhance/lib/discovery/index.js +352 -0
  548. package/plugins/enhance/lib/drift-detect/collectors.js +37 -0
  549. package/plugins/enhance/lib/enhance/agent-analyzer.js +421 -0
  550. package/plugins/enhance/lib/enhance/agent-patterns.js +571 -0
  551. package/plugins/enhance/lib/enhance/auto-suppression.js +622 -0
  552. package/plugins/enhance/lib/enhance/benchmark.js +417 -0
  553. package/plugins/enhance/lib/enhance/cross-file-analyzer.js +930 -0
  554. package/plugins/enhance/lib/enhance/cross-file-patterns.js +370 -0
  555. package/plugins/enhance/lib/enhance/docs-analyzer.js +325 -0
  556. package/plugins/enhance/lib/enhance/docs-patterns.js +671 -0
  557. package/plugins/enhance/lib/enhance/fixer.js +721 -0
  558. package/plugins/enhance/lib/enhance/hook-analyzer.js +135 -0
  559. package/plugins/enhance/lib/enhance/hook-patterns.js +40 -0
  560. package/plugins/enhance/lib/enhance/index.js +127 -0
  561. package/plugins/enhance/lib/enhance/plugin-analyzer.js +402 -0
  562. package/plugins/enhance/lib/enhance/plugin-patterns.js +326 -0
  563. package/plugins/enhance/lib/enhance/projectmemory-analyzer.js +551 -0
  564. package/plugins/enhance/lib/enhance/projectmemory-patterns.js +617 -0
  565. package/plugins/enhance/lib/enhance/prompt-analyzer.js +457 -0
  566. package/plugins/enhance/lib/enhance/prompt-patterns.js +1484 -0
  567. package/plugins/enhance/lib/enhance/reporter.js +1348 -0
  568. package/plugins/enhance/lib/enhance/security-patterns.js +284 -0
  569. package/plugins/enhance/lib/enhance/skill-analyzer.js +182 -0
  570. package/plugins/enhance/lib/enhance/skill-patterns.js +147 -0
  571. package/plugins/enhance/lib/enhance/suppression.js +352 -0
  572. package/plugins/enhance/lib/enhance/tool-patterns.js +373 -0
  573. package/plugins/enhance/lib/index.js +270 -0
  574. package/plugins/enhance/lib/patterns/cli-enhancers.js +611 -0
  575. package/plugins/enhance/lib/patterns/pipeline.js +948 -0
  576. package/plugins/enhance/lib/patterns/review-patterns.js +558 -0
  577. package/plugins/enhance/lib/patterns/slop-analyzers.js +2305 -0
  578. package/plugins/enhance/lib/patterns/slop-patterns.js +1187 -0
  579. package/plugins/enhance/lib/perf/analyzer/index.js +22 -0
  580. package/plugins/enhance/lib/perf/argument-parser.js +105 -0
  581. package/plugins/enhance/lib/perf/baseline-comparator.js +50 -0
  582. package/plugins/enhance/lib/perf/baseline-store.js +127 -0
  583. package/plugins/enhance/lib/perf/benchmark-runner.js +399 -0
  584. package/plugins/enhance/lib/perf/breaking-point-finder.js +52 -0
  585. package/plugins/enhance/lib/perf/breaking-point-runner.js +60 -0
  586. package/plugins/enhance/lib/perf/checkpoint.js +123 -0
  587. package/plugins/enhance/lib/perf/code-paths.js +86 -0
  588. package/plugins/enhance/lib/perf/consolidation.js +37 -0
  589. package/plugins/enhance/lib/perf/constraint-runner.js +71 -0
  590. package/plugins/enhance/lib/perf/experiment-runner.js +32 -0
  591. package/plugins/enhance/lib/perf/index.js +41 -0
  592. package/plugins/enhance/lib/perf/investigation-state.js +875 -0
  593. package/plugins/enhance/lib/perf/optimization-runner.js +79 -0
  594. package/plugins/enhance/lib/perf/profilers/go.js +22 -0
  595. package/plugins/enhance/lib/perf/profilers/index.js +46 -0
  596. package/plugins/enhance/lib/perf/profilers/java.js +23 -0
  597. package/plugins/enhance/lib/perf/profilers/node.js +27 -0
  598. package/plugins/enhance/lib/perf/profilers/python.js +23 -0
  599. package/plugins/enhance/lib/perf/profilers/rust.js +23 -0
  600. package/plugins/enhance/lib/perf/profiling-runner.js +56 -0
  601. package/plugins/enhance/lib/perf/schemas.js +140 -0
  602. package/plugins/enhance/lib/platform/detect-platform.js +413 -0
  603. package/plugins/enhance/lib/platform/detection-configs.js +93 -0
  604. package/plugins/enhance/lib/platform/state-dir.js +132 -0
  605. package/plugins/enhance/lib/platform/verify-tools.js +182 -0
  606. package/plugins/enhance/lib/repo-map/cache.js +152 -0
  607. package/plugins/enhance/lib/repo-map/index.js +222 -0
  608. package/plugins/enhance/lib/repo-map/installer.js +212 -0
  609. package/plugins/enhance/lib/repo-map/queries/go.js +27 -0
  610. package/plugins/enhance/lib/repo-map/queries/index.js +100 -0
  611. package/plugins/enhance/lib/repo-map/queries/java.js +38 -0
  612. package/plugins/enhance/lib/repo-map/queries/javascript.js +55 -0
  613. package/plugins/enhance/lib/repo-map/queries/python.js +24 -0
  614. package/plugins/enhance/lib/repo-map/queries/rust.js +73 -0
  615. package/plugins/enhance/lib/repo-map/queries/typescript.js +38 -0
  616. package/plugins/enhance/lib/repo-map/runner.js +1165 -0
  617. package/plugins/enhance/lib/repo-map/updater.js +474 -0
  618. package/plugins/enhance/lib/repo-map/usage-analyzer.js +407 -0
  619. package/plugins/enhance/lib/schemas/plugin-manifest.schema.json +57 -0
  620. package/plugins/enhance/lib/schemas/validator.js +247 -0
  621. package/plugins/enhance/lib/sources/custom-handler.js +199 -0
  622. package/plugins/enhance/lib/sources/policy-questions.js +246 -0
  623. package/plugins/enhance/lib/sources/source-cache.js +165 -0
  624. package/plugins/enhance/lib/state/workflow-state.js +575 -0
  625. package/plugins/enhance/lib/types/agent-frontmatter.d.ts +134 -0
  626. package/plugins/enhance/lib/types/command-frontmatter.d.ts +107 -0
  627. package/plugins/enhance/lib/types/hook-frontmatter.d.ts +115 -0
  628. package/plugins/enhance/lib/types/index.d.ts +84 -0
  629. package/plugins/enhance/lib/types/plugin-manifest.d.ts +102 -0
  630. package/plugins/enhance/lib/types/skill-frontmatter.d.ts +89 -0
  631. package/plugins/enhance/lib/utils/atomic-write.js +94 -0
  632. package/plugins/enhance/lib/utils/cache-manager.js +159 -0
  633. package/plugins/enhance/lib/utils/context-optimizer.js +300 -0
  634. package/plugins/enhance/lib/utils/deprecation.js +37 -0
  635. package/plugins/enhance/lib/utils/shell-escape.js +88 -0
  636. package/plugins/enhance/skills/enhance-agent-prompts/SKILL.md +277 -0
  637. package/plugins/enhance/skills/enhance-claude-memory/SKILL.md +387 -0
  638. package/plugins/enhance/skills/enhance-cross-file/SKILL.md +110 -0
  639. package/plugins/enhance/skills/enhance-docs/SKILL.md +298 -0
  640. package/plugins/enhance/skills/enhance-hooks/SKILL.md +554 -0
  641. package/plugins/enhance/skills/enhance-orchestrator/SKILL.md +255 -0
  642. package/plugins/enhance/skills/enhance-plugins/SKILL.md +319 -0
  643. package/plugins/enhance/skills/enhance-prompts/SKILL.md +340 -0
  644. package/plugins/enhance/skills/enhance-skills/SKILL.md +436 -0
  645. package/plugins/learn/.claude-plugin/plugin.json +21 -0
  646. package/plugins/learn/agents/learn-agent.md +331 -0
  647. package/plugins/learn/commands/learn.md +190 -0
  648. package/plugins/learn/lib/adapter-transforms.js +278 -0
  649. package/plugins/learn/lib/collectors/codebase.js +392 -0
  650. package/plugins/learn/lib/collectors/docs-patterns.js +713 -0
  651. package/plugins/learn/lib/collectors/documentation.js +219 -0
  652. package/plugins/learn/lib/collectors/github.js +266 -0
  653. package/plugins/learn/lib/collectors/index.js +126 -0
  654. package/plugins/learn/lib/config/index.js +14 -0
  655. package/plugins/learn/lib/cross-platform/index.js +539 -0
  656. package/plugins/learn/lib/discovery/index.js +352 -0
  657. package/plugins/learn/lib/drift-detect/collectors.js +37 -0
  658. package/plugins/learn/lib/enhance/agent-analyzer.js +421 -0
  659. package/plugins/learn/lib/enhance/agent-patterns.js +571 -0
  660. package/plugins/learn/lib/enhance/auto-suppression.js +622 -0
  661. package/plugins/learn/lib/enhance/benchmark.js +417 -0
  662. package/plugins/learn/lib/enhance/cross-file-analyzer.js +930 -0
  663. package/plugins/learn/lib/enhance/cross-file-patterns.js +370 -0
  664. package/plugins/learn/lib/enhance/docs-analyzer.js +325 -0
  665. package/plugins/learn/lib/enhance/docs-patterns.js +671 -0
  666. package/plugins/learn/lib/enhance/fixer.js +721 -0
  667. package/plugins/learn/lib/enhance/hook-analyzer.js +135 -0
  668. package/plugins/learn/lib/enhance/hook-patterns.js +40 -0
  669. package/plugins/learn/lib/enhance/index.js +127 -0
  670. package/plugins/learn/lib/enhance/plugin-analyzer.js +402 -0
  671. package/plugins/learn/lib/enhance/plugin-patterns.js +326 -0
  672. package/plugins/learn/lib/enhance/projectmemory-analyzer.js +551 -0
  673. package/plugins/learn/lib/enhance/projectmemory-patterns.js +617 -0
  674. package/plugins/learn/lib/enhance/prompt-analyzer.js +457 -0
  675. package/plugins/learn/lib/enhance/prompt-patterns.js +1484 -0
  676. package/plugins/learn/lib/enhance/reporter.js +1348 -0
  677. package/plugins/learn/lib/enhance/security-patterns.js +284 -0
  678. package/plugins/learn/lib/enhance/skill-analyzer.js +182 -0
  679. package/plugins/learn/lib/enhance/skill-patterns.js +147 -0
  680. package/plugins/learn/lib/enhance/suppression.js +352 -0
  681. package/plugins/learn/lib/enhance/tool-patterns.js +373 -0
  682. package/plugins/learn/lib/index.js +270 -0
  683. package/plugins/learn/lib/patterns/cli-enhancers.js +611 -0
  684. package/plugins/learn/lib/patterns/pipeline.js +948 -0
  685. package/plugins/learn/lib/patterns/review-patterns.js +558 -0
  686. package/plugins/learn/lib/patterns/slop-analyzers.js +2305 -0
  687. package/plugins/learn/lib/patterns/slop-patterns.js +1187 -0
  688. package/plugins/learn/lib/perf/analyzer/index.js +22 -0
  689. package/plugins/learn/lib/perf/argument-parser.js +105 -0
  690. package/plugins/learn/lib/perf/baseline-comparator.js +50 -0
  691. package/plugins/learn/lib/perf/baseline-store.js +127 -0
  692. package/plugins/learn/lib/perf/benchmark-runner.js +399 -0
  693. package/plugins/learn/lib/perf/breaking-point-finder.js +52 -0
  694. package/plugins/learn/lib/perf/breaking-point-runner.js +60 -0
  695. package/plugins/learn/lib/perf/checkpoint.js +123 -0
  696. package/plugins/learn/lib/perf/code-paths.js +86 -0
  697. package/plugins/learn/lib/perf/consolidation.js +37 -0
  698. package/plugins/learn/lib/perf/constraint-runner.js +71 -0
  699. package/plugins/learn/lib/perf/experiment-runner.js +32 -0
  700. package/plugins/learn/lib/perf/index.js +41 -0
  701. package/plugins/learn/lib/perf/investigation-state.js +875 -0
  702. package/plugins/learn/lib/perf/optimization-runner.js +79 -0
  703. package/plugins/learn/lib/perf/profilers/go.js +22 -0
  704. package/plugins/learn/lib/perf/profilers/index.js +46 -0
  705. package/plugins/learn/lib/perf/profilers/java.js +23 -0
  706. package/plugins/learn/lib/perf/profilers/node.js +27 -0
  707. package/plugins/learn/lib/perf/profilers/python.js +23 -0
  708. package/plugins/learn/lib/perf/profilers/rust.js +23 -0
  709. package/plugins/learn/lib/perf/profiling-runner.js +56 -0
  710. package/plugins/learn/lib/perf/schemas.js +140 -0
  711. package/plugins/learn/lib/platform/detect-platform.js +413 -0
  712. package/plugins/learn/lib/platform/detection-configs.js +93 -0
  713. package/plugins/learn/lib/platform/state-dir.js +132 -0
  714. package/plugins/learn/lib/platform/verify-tools.js +182 -0
  715. package/plugins/learn/lib/repo-map/cache.js +152 -0
  716. package/plugins/learn/lib/repo-map/index.js +222 -0
  717. package/plugins/learn/lib/repo-map/installer.js +212 -0
  718. package/plugins/learn/lib/repo-map/queries/go.js +27 -0
  719. package/plugins/learn/lib/repo-map/queries/index.js +100 -0
  720. package/plugins/learn/lib/repo-map/queries/java.js +38 -0
  721. package/plugins/learn/lib/repo-map/queries/javascript.js +55 -0
  722. package/plugins/learn/lib/repo-map/queries/python.js +24 -0
  723. package/plugins/learn/lib/repo-map/queries/rust.js +73 -0
  724. package/plugins/learn/lib/repo-map/queries/typescript.js +38 -0
  725. package/plugins/learn/lib/repo-map/runner.js +1165 -0
  726. package/plugins/learn/lib/repo-map/updater.js +474 -0
  727. package/plugins/learn/lib/repo-map/usage-analyzer.js +407 -0
  728. package/plugins/learn/lib/schemas/plugin-manifest.schema.json +57 -0
  729. package/plugins/learn/lib/schemas/validator.js +247 -0
  730. package/plugins/learn/lib/sources/custom-handler.js +199 -0
  731. package/plugins/learn/lib/sources/policy-questions.js +246 -0
  732. package/plugins/learn/lib/sources/source-cache.js +165 -0
  733. package/plugins/learn/lib/state/workflow-state.js +575 -0
  734. package/plugins/learn/lib/types/agent-frontmatter.d.ts +134 -0
  735. package/plugins/learn/lib/types/command-frontmatter.d.ts +107 -0
  736. package/plugins/learn/lib/types/hook-frontmatter.d.ts +115 -0
  737. package/plugins/learn/lib/types/index.d.ts +84 -0
  738. package/plugins/learn/lib/types/plugin-manifest.d.ts +102 -0
  739. package/plugins/learn/lib/types/skill-frontmatter.d.ts +89 -0
  740. package/plugins/learn/lib/utils/atomic-write.js +94 -0
  741. package/plugins/learn/lib/utils/cache-manager.js +159 -0
  742. package/plugins/learn/lib/utils/context-optimizer.js +300 -0
  743. package/plugins/learn/lib/utils/deprecation.js +37 -0
  744. package/plugins/learn/lib/utils/shell-escape.js +88 -0
  745. package/plugins/learn/skills/learn/SKILL.md +349 -0
  746. package/plugins/next-task/.claude-plugin/plugin.json +24 -0
  747. package/plugins/next-task/agents/ci-fixer.md +259 -0
  748. package/plugins/next-task/agents/ci-monitor.md +342 -0
  749. package/plugins/next-task/agents/delivery-validator.md +115 -0
  750. package/plugins/next-task/agents/exploration-agent.md +316 -0
  751. package/plugins/next-task/agents/implementation-agent.md +465 -0
  752. package/plugins/next-task/agents/planning-agent.md +377 -0
  753. package/plugins/next-task/agents/simple-fixer.md +139 -0
  754. package/plugins/next-task/agents/task-discoverer.md +89 -0
  755. package/plugins/next-task/agents/test-coverage-checker.md +451 -0
  756. package/plugins/next-task/agents/worktree-manager.md +257 -0
  757. package/plugins/next-task/commands/delivery-approval.md +341 -0
  758. package/plugins/next-task/commands/next-task.md +547 -0
  759. package/plugins/next-task/hooks/hooks.json +14 -0
  760. package/plugins/next-task/lib/adapter-transforms.js +278 -0
  761. package/plugins/next-task/lib/collectors/codebase.js +392 -0
  762. package/plugins/next-task/lib/collectors/docs-patterns.js +713 -0
  763. package/plugins/next-task/lib/collectors/documentation.js +219 -0
  764. package/plugins/next-task/lib/collectors/github.js +266 -0
  765. package/plugins/next-task/lib/collectors/index.js +126 -0
  766. package/plugins/next-task/lib/config/index.js +14 -0
  767. package/plugins/next-task/lib/cross-platform/index.js +539 -0
  768. package/plugins/next-task/lib/discovery/index.js +352 -0
  769. package/plugins/next-task/lib/drift-detect/collectors.js +37 -0
  770. package/plugins/next-task/lib/enhance/agent-analyzer.js +421 -0
  771. package/plugins/next-task/lib/enhance/agent-patterns.js +571 -0
  772. package/plugins/next-task/lib/enhance/auto-suppression.js +622 -0
  773. package/plugins/next-task/lib/enhance/benchmark.js +417 -0
  774. package/plugins/next-task/lib/enhance/cross-file-analyzer.js +930 -0
  775. package/plugins/next-task/lib/enhance/cross-file-patterns.js +370 -0
  776. package/plugins/next-task/lib/enhance/docs-analyzer.js +325 -0
  777. package/plugins/next-task/lib/enhance/docs-patterns.js +671 -0
  778. package/plugins/next-task/lib/enhance/fixer.js +721 -0
  779. package/plugins/next-task/lib/enhance/hook-analyzer.js +135 -0
  780. package/plugins/next-task/lib/enhance/hook-patterns.js +40 -0
  781. package/plugins/next-task/lib/enhance/index.js +127 -0
  782. package/plugins/next-task/lib/enhance/plugin-analyzer.js +402 -0
  783. package/plugins/next-task/lib/enhance/plugin-patterns.js +326 -0
  784. package/plugins/next-task/lib/enhance/projectmemory-analyzer.js +551 -0
  785. package/plugins/next-task/lib/enhance/projectmemory-patterns.js +617 -0
  786. package/plugins/next-task/lib/enhance/prompt-analyzer.js +457 -0
  787. package/plugins/next-task/lib/enhance/prompt-patterns.js +1484 -0
  788. package/plugins/next-task/lib/enhance/reporter.js +1348 -0
  789. package/plugins/next-task/lib/enhance/security-patterns.js +284 -0
  790. package/plugins/next-task/lib/enhance/skill-analyzer.js +182 -0
  791. package/plugins/next-task/lib/enhance/skill-patterns.js +147 -0
  792. package/plugins/next-task/lib/enhance/suppression.js +352 -0
  793. package/plugins/next-task/lib/enhance/tool-patterns.js +373 -0
  794. package/plugins/next-task/lib/index.js +270 -0
  795. package/plugins/next-task/lib/patterns/cli-enhancers.js +611 -0
  796. package/plugins/next-task/lib/patterns/pipeline.js +948 -0
  797. package/plugins/next-task/lib/patterns/review-patterns.js +558 -0
  798. package/plugins/next-task/lib/patterns/slop-analyzers.js +2305 -0
  799. package/plugins/next-task/lib/patterns/slop-patterns.js +1187 -0
  800. package/plugins/next-task/lib/perf/analyzer/index.js +22 -0
  801. package/plugins/next-task/lib/perf/argument-parser.js +105 -0
  802. package/plugins/next-task/lib/perf/baseline-comparator.js +50 -0
  803. package/plugins/next-task/lib/perf/baseline-store.js +127 -0
  804. package/plugins/next-task/lib/perf/benchmark-runner.js +399 -0
  805. package/plugins/next-task/lib/perf/breaking-point-finder.js +52 -0
  806. package/plugins/next-task/lib/perf/breaking-point-runner.js +60 -0
  807. package/plugins/next-task/lib/perf/checkpoint.js +123 -0
  808. package/plugins/next-task/lib/perf/code-paths.js +86 -0
  809. package/plugins/next-task/lib/perf/consolidation.js +37 -0
  810. package/plugins/next-task/lib/perf/constraint-runner.js +71 -0
  811. package/plugins/next-task/lib/perf/experiment-runner.js +32 -0
  812. package/plugins/next-task/lib/perf/index.js +41 -0
  813. package/plugins/next-task/lib/perf/investigation-state.js +875 -0
  814. package/plugins/next-task/lib/perf/optimization-runner.js +79 -0
  815. package/plugins/next-task/lib/perf/profilers/go.js +22 -0
  816. package/plugins/next-task/lib/perf/profilers/index.js +46 -0
  817. package/plugins/next-task/lib/perf/profilers/java.js +23 -0
  818. package/plugins/next-task/lib/perf/profilers/node.js +27 -0
  819. package/plugins/next-task/lib/perf/profilers/python.js +23 -0
  820. package/plugins/next-task/lib/perf/profilers/rust.js +23 -0
  821. package/plugins/next-task/lib/perf/profiling-runner.js +56 -0
  822. package/plugins/next-task/lib/perf/schemas.js +140 -0
  823. package/plugins/next-task/lib/platform/detect-platform.js +413 -0
  824. package/plugins/next-task/lib/platform/detection-configs.js +93 -0
  825. package/plugins/next-task/lib/platform/state-dir.js +132 -0
  826. package/plugins/next-task/lib/platform/verify-tools.js +182 -0
  827. package/plugins/next-task/lib/repo-map/cache.js +152 -0
  828. package/plugins/next-task/lib/repo-map/index.js +222 -0
  829. package/plugins/next-task/lib/repo-map/installer.js +212 -0
  830. package/plugins/next-task/lib/repo-map/queries/go.js +27 -0
  831. package/plugins/next-task/lib/repo-map/queries/index.js +100 -0
  832. package/plugins/next-task/lib/repo-map/queries/java.js +38 -0
  833. package/plugins/next-task/lib/repo-map/queries/javascript.js +55 -0
  834. package/plugins/next-task/lib/repo-map/queries/python.js +24 -0
  835. package/plugins/next-task/lib/repo-map/queries/rust.js +73 -0
  836. package/plugins/next-task/lib/repo-map/queries/typescript.js +38 -0
  837. package/plugins/next-task/lib/repo-map/runner.js +1165 -0
  838. package/plugins/next-task/lib/repo-map/updater.js +474 -0
  839. package/plugins/next-task/lib/repo-map/usage-analyzer.js +407 -0
  840. package/plugins/next-task/lib/schemas/plugin-manifest.schema.json +57 -0
  841. package/plugins/next-task/lib/schemas/validator.js +247 -0
  842. package/plugins/next-task/lib/sources/custom-handler.js +199 -0
  843. package/plugins/next-task/lib/sources/policy-questions.js +246 -0
  844. package/plugins/next-task/lib/sources/source-cache.js +165 -0
  845. package/plugins/next-task/lib/state/workflow-state.js +575 -0
  846. package/plugins/next-task/lib/types/agent-frontmatter.d.ts +134 -0
  847. package/plugins/next-task/lib/types/command-frontmatter.d.ts +107 -0
  848. package/plugins/next-task/lib/types/hook-frontmatter.d.ts +115 -0
  849. package/plugins/next-task/lib/types/index.d.ts +84 -0
  850. package/plugins/next-task/lib/types/plugin-manifest.d.ts +102 -0
  851. package/plugins/next-task/lib/types/skill-frontmatter.d.ts +89 -0
  852. package/plugins/next-task/lib/utils/atomic-write.js +94 -0
  853. package/plugins/next-task/lib/utils/cache-manager.js +159 -0
  854. package/plugins/next-task/lib/utils/context-optimizer.js +300 -0
  855. package/plugins/next-task/lib/utils/deprecation.js +37 -0
  856. package/plugins/next-task/lib/utils/shell-escape.js +88 -0
  857. package/plugins/next-task/skills/discover-tasks/SKILL.md +191 -0
  858. package/plugins/next-task/skills/orchestrate-review/SKILL.md +239 -0
  859. package/plugins/next-task/skills/validate-delivery/SKILL.md +186 -0
  860. package/plugins/perf/.claude-plugin/plugin.json +20 -0
  861. package/plugins/perf/agents/perf-analyzer.md +43 -0
  862. package/plugins/perf/agents/perf-code-paths.md +16 -0
  863. package/plugins/perf/agents/perf-investigation-logger.md +47 -0
  864. package/plugins/perf/agents/perf-orchestrator.md +344 -0
  865. package/plugins/perf/agents/perf-theory-gatherer.md +25 -0
  866. package/plugins/perf/agents/perf-theory-tester.md +58 -0
  867. package/plugins/perf/commands/perf.md +470 -0
  868. package/plugins/perf/hooks/checkpoint.md +35 -0
  869. package/plugins/perf/hooks/constraint-tester.md +40 -0
  870. package/plugins/perf/lib/adapter-transforms.js +278 -0
  871. package/plugins/perf/lib/collectors/codebase.js +392 -0
  872. package/plugins/perf/lib/collectors/docs-patterns.js +713 -0
  873. package/plugins/perf/lib/collectors/documentation.js +219 -0
  874. package/plugins/perf/lib/collectors/github.js +266 -0
  875. package/plugins/perf/lib/collectors/index.js +126 -0
  876. package/plugins/perf/lib/config/index.js +14 -0
  877. package/plugins/perf/lib/cross-platform/index.js +539 -0
  878. package/plugins/perf/lib/discovery/index.js +352 -0
  879. package/plugins/perf/lib/drift-detect/collectors.js +37 -0
  880. package/plugins/perf/lib/enhance/agent-analyzer.js +421 -0
  881. package/plugins/perf/lib/enhance/agent-patterns.js +571 -0
  882. package/plugins/perf/lib/enhance/auto-suppression.js +622 -0
  883. package/plugins/perf/lib/enhance/benchmark.js +417 -0
  884. package/plugins/perf/lib/enhance/cross-file-analyzer.js +930 -0
  885. package/plugins/perf/lib/enhance/cross-file-patterns.js +370 -0
  886. package/plugins/perf/lib/enhance/docs-analyzer.js +325 -0
  887. package/plugins/perf/lib/enhance/docs-patterns.js +671 -0
  888. package/plugins/perf/lib/enhance/fixer.js +721 -0
  889. package/plugins/perf/lib/enhance/hook-analyzer.js +135 -0
  890. package/plugins/perf/lib/enhance/hook-patterns.js +40 -0
  891. package/plugins/perf/lib/enhance/index.js +127 -0
  892. package/plugins/perf/lib/enhance/plugin-analyzer.js +402 -0
  893. package/plugins/perf/lib/enhance/plugin-patterns.js +326 -0
  894. package/plugins/perf/lib/enhance/projectmemory-analyzer.js +551 -0
  895. package/plugins/perf/lib/enhance/projectmemory-patterns.js +617 -0
  896. package/plugins/perf/lib/enhance/prompt-analyzer.js +457 -0
  897. package/plugins/perf/lib/enhance/prompt-patterns.js +1484 -0
  898. package/plugins/perf/lib/enhance/reporter.js +1348 -0
  899. package/plugins/perf/lib/enhance/security-patterns.js +284 -0
  900. package/plugins/perf/lib/enhance/skill-analyzer.js +182 -0
  901. package/plugins/perf/lib/enhance/skill-patterns.js +147 -0
  902. package/plugins/perf/lib/enhance/suppression.js +352 -0
  903. package/plugins/perf/lib/enhance/tool-patterns.js +373 -0
  904. package/plugins/perf/lib/index.js +270 -0
  905. package/plugins/perf/lib/patterns/cli-enhancers.js +611 -0
  906. package/plugins/perf/lib/patterns/pipeline.js +948 -0
  907. package/plugins/perf/lib/patterns/review-patterns.js +558 -0
  908. package/plugins/perf/lib/patterns/slop-analyzers.js +2305 -0
  909. package/plugins/perf/lib/patterns/slop-patterns.js +1187 -0
  910. package/plugins/perf/lib/perf/analyzer/index.js +22 -0
  911. package/plugins/perf/lib/perf/argument-parser.js +105 -0
  912. package/plugins/perf/lib/perf/baseline-comparator.js +50 -0
  913. package/plugins/perf/lib/perf/baseline-store.js +127 -0
  914. package/plugins/perf/lib/perf/benchmark-runner.js +399 -0
  915. package/plugins/perf/lib/perf/breaking-point-finder.js +52 -0
  916. package/plugins/perf/lib/perf/breaking-point-runner.js +60 -0
  917. package/plugins/perf/lib/perf/checkpoint.js +123 -0
  918. package/plugins/perf/lib/perf/code-paths.js +86 -0
  919. package/plugins/perf/lib/perf/consolidation.js +37 -0
  920. package/plugins/perf/lib/perf/constraint-runner.js +71 -0
  921. package/plugins/perf/lib/perf/experiment-runner.js +32 -0
  922. package/plugins/perf/lib/perf/index.js +41 -0
  923. package/plugins/perf/lib/perf/investigation-state.js +875 -0
  924. package/plugins/perf/lib/perf/optimization-runner.js +79 -0
  925. package/plugins/perf/lib/perf/profilers/go.js +22 -0
  926. package/plugins/perf/lib/perf/profilers/index.js +46 -0
  927. package/plugins/perf/lib/perf/profilers/java.js +23 -0
  928. package/plugins/perf/lib/perf/profilers/node.js +27 -0
  929. package/plugins/perf/lib/perf/profilers/python.js +23 -0
  930. package/plugins/perf/lib/perf/profilers/rust.js +23 -0
  931. package/plugins/perf/lib/perf/profiling-runner.js +56 -0
  932. package/plugins/perf/lib/perf/schemas.js +140 -0
  933. package/plugins/perf/lib/platform/detect-platform.js +413 -0
  934. package/plugins/perf/lib/platform/detection-configs.js +93 -0
  935. package/plugins/perf/lib/platform/state-dir.js +132 -0
  936. package/plugins/perf/lib/platform/verify-tools.js +182 -0
  937. package/plugins/perf/lib/repo-map/cache.js +152 -0
  938. package/plugins/perf/lib/repo-map/index.js +222 -0
  939. package/plugins/perf/lib/repo-map/installer.js +212 -0
  940. package/plugins/perf/lib/repo-map/queries/go.js +27 -0
  941. package/plugins/perf/lib/repo-map/queries/index.js +100 -0
  942. package/plugins/perf/lib/repo-map/queries/java.js +38 -0
  943. package/plugins/perf/lib/repo-map/queries/javascript.js +55 -0
  944. package/plugins/perf/lib/repo-map/queries/python.js +24 -0
  945. package/plugins/perf/lib/repo-map/queries/rust.js +73 -0
  946. package/plugins/perf/lib/repo-map/queries/typescript.js +38 -0
  947. package/plugins/perf/lib/repo-map/runner.js +1165 -0
  948. package/plugins/perf/lib/repo-map/updater.js +474 -0
  949. package/plugins/perf/lib/repo-map/usage-analyzer.js +407 -0
  950. package/plugins/perf/lib/schemas/plugin-manifest.schema.json +57 -0
  951. package/plugins/perf/lib/schemas/validator.js +247 -0
  952. package/plugins/perf/lib/sources/custom-handler.js +199 -0
  953. package/plugins/perf/lib/sources/policy-questions.js +246 -0
  954. package/plugins/perf/lib/sources/source-cache.js +165 -0
  955. package/plugins/perf/lib/state/workflow-state.js +575 -0
  956. package/plugins/perf/lib/types/agent-frontmatter.d.ts +134 -0
  957. package/plugins/perf/lib/types/command-frontmatter.d.ts +107 -0
  958. package/plugins/perf/lib/types/hook-frontmatter.d.ts +115 -0
  959. package/plugins/perf/lib/types/index.d.ts +84 -0
  960. package/plugins/perf/lib/types/plugin-manifest.d.ts +102 -0
  961. package/plugins/perf/lib/types/skill-frontmatter.d.ts +89 -0
  962. package/plugins/perf/lib/utils/atomic-write.js +94 -0
  963. package/plugins/perf/lib/utils/cache-manager.js +159 -0
  964. package/plugins/perf/lib/utils/context-optimizer.js +300 -0
  965. package/plugins/perf/lib/utils/deprecation.js +37 -0
  966. package/plugins/perf/lib/utils/shell-escape.js +88 -0
  967. package/plugins/perf/skills/perf-analyzer/SKILL.md +37 -0
  968. package/plugins/perf/skills/perf-baseline-manager/SKILL.md +30 -0
  969. package/plugins/perf/skills/perf-benchmarker/SKILL.md +52 -0
  970. package/plugins/perf/skills/perf-code-paths/SKILL.md +32 -0
  971. package/plugins/perf/skills/perf-investigation-logger/SKILL.md +41 -0
  972. package/plugins/perf/skills/perf-profiler/SKILL.md +42 -0
  973. package/plugins/perf/skills/perf-theory-gatherer/SKILL.md +35 -0
  974. package/plugins/perf/skills/perf-theory-tester/SKILL.md +36 -0
  975. package/plugins/repo-map/.claude-plugin/plugin.json +22 -0
  976. package/plugins/repo-map/agents/map-validator.md +60 -0
  977. package/plugins/repo-map/commands/repo-map.md +133 -0
  978. package/plugins/repo-map/lib/adapter-transforms.js +278 -0
  979. package/plugins/repo-map/lib/collectors/codebase.js +392 -0
  980. package/plugins/repo-map/lib/collectors/docs-patterns.js +713 -0
  981. package/plugins/repo-map/lib/collectors/documentation.js +219 -0
  982. package/plugins/repo-map/lib/collectors/github.js +266 -0
  983. package/plugins/repo-map/lib/collectors/index.js +126 -0
  984. package/plugins/repo-map/lib/config/index.js +14 -0
  985. package/plugins/repo-map/lib/cross-platform/index.js +539 -0
  986. package/plugins/repo-map/lib/discovery/index.js +352 -0
  987. package/plugins/repo-map/lib/drift-detect/collectors.js +37 -0
  988. package/plugins/repo-map/lib/enhance/agent-analyzer.js +421 -0
  989. package/plugins/repo-map/lib/enhance/agent-patterns.js +571 -0
  990. package/plugins/repo-map/lib/enhance/auto-suppression.js +622 -0
  991. package/plugins/repo-map/lib/enhance/benchmark.js +417 -0
  992. package/plugins/repo-map/lib/enhance/cross-file-analyzer.js +930 -0
  993. package/plugins/repo-map/lib/enhance/cross-file-patterns.js +370 -0
  994. package/plugins/repo-map/lib/enhance/docs-analyzer.js +325 -0
  995. package/plugins/repo-map/lib/enhance/docs-patterns.js +671 -0
  996. package/plugins/repo-map/lib/enhance/fixer.js +721 -0
  997. package/plugins/repo-map/lib/enhance/hook-analyzer.js +135 -0
  998. package/plugins/repo-map/lib/enhance/hook-patterns.js +40 -0
  999. package/plugins/repo-map/lib/enhance/index.js +127 -0
  1000. package/plugins/repo-map/lib/enhance/plugin-analyzer.js +402 -0
  1001. package/plugins/repo-map/lib/enhance/plugin-patterns.js +326 -0
  1002. package/plugins/repo-map/lib/enhance/projectmemory-analyzer.js +551 -0
  1003. package/plugins/repo-map/lib/enhance/projectmemory-patterns.js +617 -0
  1004. package/plugins/repo-map/lib/enhance/prompt-analyzer.js +457 -0
  1005. package/plugins/repo-map/lib/enhance/prompt-patterns.js +1484 -0
  1006. package/plugins/repo-map/lib/enhance/reporter.js +1348 -0
  1007. package/plugins/repo-map/lib/enhance/security-patterns.js +284 -0
  1008. package/plugins/repo-map/lib/enhance/skill-analyzer.js +182 -0
  1009. package/plugins/repo-map/lib/enhance/skill-patterns.js +147 -0
  1010. package/plugins/repo-map/lib/enhance/suppression.js +352 -0
  1011. package/plugins/repo-map/lib/enhance/tool-patterns.js +373 -0
  1012. package/plugins/repo-map/lib/index.js +270 -0
  1013. package/plugins/repo-map/lib/patterns/cli-enhancers.js +611 -0
  1014. package/plugins/repo-map/lib/patterns/pipeline.js +948 -0
  1015. package/plugins/repo-map/lib/patterns/review-patterns.js +558 -0
  1016. package/plugins/repo-map/lib/patterns/slop-analyzers.js +2305 -0
  1017. package/plugins/repo-map/lib/patterns/slop-patterns.js +1187 -0
  1018. package/plugins/repo-map/lib/perf/analyzer/index.js +22 -0
  1019. package/plugins/repo-map/lib/perf/argument-parser.js +105 -0
  1020. package/plugins/repo-map/lib/perf/baseline-comparator.js +50 -0
  1021. package/plugins/repo-map/lib/perf/baseline-store.js +127 -0
  1022. package/plugins/repo-map/lib/perf/benchmark-runner.js +399 -0
  1023. package/plugins/repo-map/lib/perf/breaking-point-finder.js +52 -0
  1024. package/plugins/repo-map/lib/perf/breaking-point-runner.js +60 -0
  1025. package/plugins/repo-map/lib/perf/checkpoint.js +123 -0
  1026. package/plugins/repo-map/lib/perf/code-paths.js +86 -0
  1027. package/plugins/repo-map/lib/perf/consolidation.js +37 -0
  1028. package/plugins/repo-map/lib/perf/constraint-runner.js +71 -0
  1029. package/plugins/repo-map/lib/perf/experiment-runner.js +32 -0
  1030. package/plugins/repo-map/lib/perf/index.js +41 -0
  1031. package/plugins/repo-map/lib/perf/investigation-state.js +875 -0
  1032. package/plugins/repo-map/lib/perf/optimization-runner.js +79 -0
  1033. package/plugins/repo-map/lib/perf/profilers/go.js +22 -0
  1034. package/plugins/repo-map/lib/perf/profilers/index.js +46 -0
  1035. package/plugins/repo-map/lib/perf/profilers/java.js +23 -0
  1036. package/plugins/repo-map/lib/perf/profilers/node.js +27 -0
  1037. package/plugins/repo-map/lib/perf/profilers/python.js +23 -0
  1038. package/plugins/repo-map/lib/perf/profilers/rust.js +23 -0
  1039. package/plugins/repo-map/lib/perf/profiling-runner.js +56 -0
  1040. package/plugins/repo-map/lib/perf/schemas.js +140 -0
  1041. package/plugins/repo-map/lib/platform/detect-platform.js +413 -0
  1042. package/plugins/repo-map/lib/platform/detection-configs.js +93 -0
  1043. package/plugins/repo-map/lib/platform/state-dir.js +132 -0
  1044. package/plugins/repo-map/lib/platform/verify-tools.js +182 -0
  1045. package/plugins/repo-map/lib/repo-map/cache.js +152 -0
  1046. package/plugins/repo-map/lib/repo-map/index.js +222 -0
  1047. package/plugins/repo-map/lib/repo-map/installer.js +212 -0
  1048. package/plugins/repo-map/lib/repo-map/queries/go.js +27 -0
  1049. package/plugins/repo-map/lib/repo-map/queries/index.js +100 -0
  1050. package/plugins/repo-map/lib/repo-map/queries/java.js +38 -0
  1051. package/plugins/repo-map/lib/repo-map/queries/javascript.js +55 -0
  1052. package/plugins/repo-map/lib/repo-map/queries/python.js +24 -0
  1053. package/plugins/repo-map/lib/repo-map/queries/rust.js +73 -0
  1054. package/plugins/repo-map/lib/repo-map/queries/typescript.js +38 -0
  1055. package/plugins/repo-map/lib/repo-map/runner.js +1165 -0
  1056. package/plugins/repo-map/lib/repo-map/updater.js +474 -0
  1057. package/plugins/repo-map/lib/repo-map/usage-analyzer.js +407 -0
  1058. package/plugins/repo-map/lib/schemas/plugin-manifest.schema.json +57 -0
  1059. package/plugins/repo-map/lib/schemas/validator.js +247 -0
  1060. package/plugins/repo-map/lib/sources/custom-handler.js +199 -0
  1061. package/plugins/repo-map/lib/sources/policy-questions.js +246 -0
  1062. package/plugins/repo-map/lib/sources/source-cache.js +165 -0
  1063. package/plugins/repo-map/lib/state/workflow-state.js +575 -0
  1064. package/plugins/repo-map/lib/types/agent-frontmatter.d.ts +134 -0
  1065. package/plugins/repo-map/lib/types/command-frontmatter.d.ts +107 -0
  1066. package/plugins/repo-map/lib/types/hook-frontmatter.d.ts +115 -0
  1067. package/plugins/repo-map/lib/types/index.d.ts +84 -0
  1068. package/plugins/repo-map/lib/types/plugin-manifest.d.ts +102 -0
  1069. package/plugins/repo-map/lib/types/skill-frontmatter.d.ts +89 -0
  1070. package/plugins/repo-map/lib/utils/atomic-write.js +94 -0
  1071. package/plugins/repo-map/lib/utils/cache-manager.js +159 -0
  1072. package/plugins/repo-map/lib/utils/context-optimizer.js +300 -0
  1073. package/plugins/repo-map/lib/utils/deprecation.js +37 -0
  1074. package/plugins/repo-map/lib/utils/shell-escape.js +88 -0
  1075. package/plugins/repo-map/skills/repo-mapping/SKILL.md +83 -0
  1076. package/plugins/ship/.claude-plugin/plugin.json +21 -0
  1077. package/plugins/ship/commands/ship-ci-review-loop.md +472 -0
  1078. package/plugins/ship/commands/ship-deployment.md +335 -0
  1079. package/plugins/ship/commands/ship-error-handling.md +258 -0
  1080. package/plugins/ship/commands/ship.md +492 -0
  1081. package/plugins/ship/lib/adapter-transforms.js +278 -0
  1082. package/plugins/ship/lib/collectors/codebase.js +392 -0
  1083. package/plugins/ship/lib/collectors/docs-patterns.js +713 -0
  1084. package/plugins/ship/lib/collectors/documentation.js +219 -0
  1085. package/plugins/ship/lib/collectors/github.js +266 -0
  1086. package/plugins/ship/lib/collectors/index.js +126 -0
  1087. package/plugins/ship/lib/config/index.js +14 -0
  1088. package/plugins/ship/lib/cross-platform/index.js +539 -0
  1089. package/plugins/ship/lib/discovery/index.js +352 -0
  1090. package/plugins/ship/lib/drift-detect/collectors.js +37 -0
  1091. package/plugins/ship/lib/enhance/agent-analyzer.js +421 -0
  1092. package/plugins/ship/lib/enhance/agent-patterns.js +571 -0
  1093. package/plugins/ship/lib/enhance/auto-suppression.js +622 -0
  1094. package/plugins/ship/lib/enhance/benchmark.js +417 -0
  1095. package/plugins/ship/lib/enhance/cross-file-analyzer.js +930 -0
  1096. package/plugins/ship/lib/enhance/cross-file-patterns.js +370 -0
  1097. package/plugins/ship/lib/enhance/docs-analyzer.js +325 -0
  1098. package/plugins/ship/lib/enhance/docs-patterns.js +671 -0
  1099. package/plugins/ship/lib/enhance/fixer.js +721 -0
  1100. package/plugins/ship/lib/enhance/hook-analyzer.js +135 -0
  1101. package/plugins/ship/lib/enhance/hook-patterns.js +40 -0
  1102. package/plugins/ship/lib/enhance/index.js +127 -0
  1103. package/plugins/ship/lib/enhance/plugin-analyzer.js +402 -0
  1104. package/plugins/ship/lib/enhance/plugin-patterns.js +326 -0
  1105. package/plugins/ship/lib/enhance/projectmemory-analyzer.js +551 -0
  1106. package/plugins/ship/lib/enhance/projectmemory-patterns.js +617 -0
  1107. package/plugins/ship/lib/enhance/prompt-analyzer.js +457 -0
  1108. package/plugins/ship/lib/enhance/prompt-patterns.js +1484 -0
  1109. package/plugins/ship/lib/enhance/reporter.js +1348 -0
  1110. package/plugins/ship/lib/enhance/security-patterns.js +284 -0
  1111. package/plugins/ship/lib/enhance/skill-analyzer.js +182 -0
  1112. package/plugins/ship/lib/enhance/skill-patterns.js +147 -0
  1113. package/plugins/ship/lib/enhance/suppression.js +352 -0
  1114. package/plugins/ship/lib/enhance/tool-patterns.js +373 -0
  1115. package/plugins/ship/lib/index.js +270 -0
  1116. package/plugins/ship/lib/patterns/cli-enhancers.js +611 -0
  1117. package/plugins/ship/lib/patterns/pipeline.js +948 -0
  1118. package/plugins/ship/lib/patterns/review-patterns.js +558 -0
  1119. package/plugins/ship/lib/patterns/slop-analyzers.js +2305 -0
  1120. package/plugins/ship/lib/patterns/slop-patterns.js +1187 -0
  1121. package/plugins/ship/lib/perf/analyzer/index.js +22 -0
  1122. package/plugins/ship/lib/perf/argument-parser.js +105 -0
  1123. package/plugins/ship/lib/perf/baseline-comparator.js +50 -0
  1124. package/plugins/ship/lib/perf/baseline-store.js +127 -0
  1125. package/plugins/ship/lib/perf/benchmark-runner.js +399 -0
  1126. package/plugins/ship/lib/perf/breaking-point-finder.js +52 -0
  1127. package/plugins/ship/lib/perf/breaking-point-runner.js +60 -0
  1128. package/plugins/ship/lib/perf/checkpoint.js +123 -0
  1129. package/plugins/ship/lib/perf/code-paths.js +86 -0
  1130. package/plugins/ship/lib/perf/consolidation.js +37 -0
  1131. package/plugins/ship/lib/perf/constraint-runner.js +71 -0
  1132. package/plugins/ship/lib/perf/experiment-runner.js +32 -0
  1133. package/plugins/ship/lib/perf/index.js +41 -0
  1134. package/plugins/ship/lib/perf/investigation-state.js +875 -0
  1135. package/plugins/ship/lib/perf/optimization-runner.js +79 -0
  1136. package/plugins/ship/lib/perf/profilers/go.js +22 -0
  1137. package/plugins/ship/lib/perf/profilers/index.js +46 -0
  1138. package/plugins/ship/lib/perf/profilers/java.js +23 -0
  1139. package/plugins/ship/lib/perf/profilers/node.js +27 -0
  1140. package/plugins/ship/lib/perf/profilers/python.js +23 -0
  1141. package/plugins/ship/lib/perf/profilers/rust.js +23 -0
  1142. package/plugins/ship/lib/perf/profiling-runner.js +56 -0
  1143. package/plugins/ship/lib/perf/schemas.js +140 -0
  1144. package/plugins/ship/lib/platform/detect-platform.js +413 -0
  1145. package/plugins/ship/lib/platform/detection-configs.js +93 -0
  1146. package/plugins/ship/lib/platform/state-dir.js +132 -0
  1147. package/plugins/ship/lib/platform/verify-tools.js +182 -0
  1148. package/plugins/ship/lib/repo-map/cache.js +152 -0
  1149. package/plugins/ship/lib/repo-map/index.js +222 -0
  1150. package/plugins/ship/lib/repo-map/installer.js +212 -0
  1151. package/plugins/ship/lib/repo-map/queries/go.js +27 -0
  1152. package/plugins/ship/lib/repo-map/queries/index.js +100 -0
  1153. package/plugins/ship/lib/repo-map/queries/java.js +38 -0
  1154. package/plugins/ship/lib/repo-map/queries/javascript.js +55 -0
  1155. package/plugins/ship/lib/repo-map/queries/python.js +24 -0
  1156. package/plugins/ship/lib/repo-map/queries/rust.js +73 -0
  1157. package/plugins/ship/lib/repo-map/queries/typescript.js +38 -0
  1158. package/plugins/ship/lib/repo-map/runner.js +1165 -0
  1159. package/plugins/ship/lib/repo-map/updater.js +474 -0
  1160. package/plugins/ship/lib/repo-map/usage-analyzer.js +407 -0
  1161. package/plugins/ship/lib/schemas/plugin-manifest.schema.json +57 -0
  1162. package/plugins/ship/lib/schemas/validator.js +247 -0
  1163. package/plugins/ship/lib/sources/custom-handler.js +199 -0
  1164. package/plugins/ship/lib/sources/policy-questions.js +246 -0
  1165. package/plugins/ship/lib/sources/source-cache.js +165 -0
  1166. package/plugins/ship/lib/state/workflow-state.js +575 -0
  1167. package/plugins/ship/lib/types/agent-frontmatter.d.ts +134 -0
  1168. package/plugins/ship/lib/types/command-frontmatter.d.ts +107 -0
  1169. package/plugins/ship/lib/types/hook-frontmatter.d.ts +115 -0
  1170. package/plugins/ship/lib/types/index.d.ts +84 -0
  1171. package/plugins/ship/lib/types/plugin-manifest.d.ts +102 -0
  1172. package/plugins/ship/lib/types/skill-frontmatter.d.ts +89 -0
  1173. package/plugins/ship/lib/utils/atomic-write.js +94 -0
  1174. package/plugins/ship/lib/utils/cache-manager.js +159 -0
  1175. package/plugins/ship/lib/utils/context-optimizer.js +300 -0
  1176. package/plugins/ship/lib/utils/deprecation.js +37 -0
  1177. package/plugins/ship/lib/utils/shell-escape.js +88 -0
  1178. package/plugins/sync-docs/.claude-plugin/plugin.json +20 -0
  1179. package/plugins/sync-docs/agents/sync-docs-agent.md +154 -0
  1180. package/plugins/sync-docs/commands/sync-docs.md +186 -0
  1181. package/plugins/sync-docs/lib/adapter-transforms.js +278 -0
  1182. package/plugins/sync-docs/lib/collectors/codebase.js +392 -0
  1183. package/plugins/sync-docs/lib/collectors/docs-patterns.js +713 -0
  1184. package/plugins/sync-docs/lib/collectors/documentation.js +219 -0
  1185. package/plugins/sync-docs/lib/collectors/github.js +266 -0
  1186. package/plugins/sync-docs/lib/collectors/index.js +126 -0
  1187. package/plugins/sync-docs/lib/config/index.js +14 -0
  1188. package/plugins/sync-docs/lib/cross-platform/index.js +539 -0
  1189. package/plugins/sync-docs/lib/discovery/index.js +352 -0
  1190. package/plugins/sync-docs/lib/drift-detect/collectors.js +37 -0
  1191. package/plugins/sync-docs/lib/enhance/agent-analyzer.js +421 -0
  1192. package/plugins/sync-docs/lib/enhance/agent-patterns.js +571 -0
  1193. package/plugins/sync-docs/lib/enhance/auto-suppression.js +622 -0
  1194. package/plugins/sync-docs/lib/enhance/benchmark.js +417 -0
  1195. package/plugins/sync-docs/lib/enhance/cross-file-analyzer.js +930 -0
  1196. package/plugins/sync-docs/lib/enhance/cross-file-patterns.js +370 -0
  1197. package/plugins/sync-docs/lib/enhance/docs-analyzer.js +325 -0
  1198. package/plugins/sync-docs/lib/enhance/docs-patterns.js +671 -0
  1199. package/plugins/sync-docs/lib/enhance/fixer.js +721 -0
  1200. package/plugins/sync-docs/lib/enhance/hook-analyzer.js +135 -0
  1201. package/plugins/sync-docs/lib/enhance/hook-patterns.js +40 -0
  1202. package/plugins/sync-docs/lib/enhance/index.js +127 -0
  1203. package/plugins/sync-docs/lib/enhance/plugin-analyzer.js +402 -0
  1204. package/plugins/sync-docs/lib/enhance/plugin-patterns.js +326 -0
  1205. package/plugins/sync-docs/lib/enhance/projectmemory-analyzer.js +551 -0
  1206. package/plugins/sync-docs/lib/enhance/projectmemory-patterns.js +617 -0
  1207. package/plugins/sync-docs/lib/enhance/prompt-analyzer.js +457 -0
  1208. package/plugins/sync-docs/lib/enhance/prompt-patterns.js +1484 -0
  1209. package/plugins/sync-docs/lib/enhance/reporter.js +1348 -0
  1210. package/plugins/sync-docs/lib/enhance/security-patterns.js +284 -0
  1211. package/plugins/sync-docs/lib/enhance/skill-analyzer.js +182 -0
  1212. package/plugins/sync-docs/lib/enhance/skill-patterns.js +147 -0
  1213. package/plugins/sync-docs/lib/enhance/suppression.js +352 -0
  1214. package/plugins/sync-docs/lib/enhance/tool-patterns.js +373 -0
  1215. package/plugins/sync-docs/lib/index.js +270 -0
  1216. package/plugins/sync-docs/lib/patterns/cli-enhancers.js +611 -0
  1217. package/plugins/sync-docs/lib/patterns/pipeline.js +948 -0
  1218. package/plugins/sync-docs/lib/patterns/review-patterns.js +558 -0
  1219. package/plugins/sync-docs/lib/patterns/slop-analyzers.js +2305 -0
  1220. package/plugins/sync-docs/lib/patterns/slop-patterns.js +1187 -0
  1221. package/plugins/sync-docs/lib/perf/analyzer/index.js +22 -0
  1222. package/plugins/sync-docs/lib/perf/argument-parser.js +105 -0
  1223. package/plugins/sync-docs/lib/perf/baseline-comparator.js +50 -0
  1224. package/plugins/sync-docs/lib/perf/baseline-store.js +127 -0
  1225. package/plugins/sync-docs/lib/perf/benchmark-runner.js +399 -0
  1226. package/plugins/sync-docs/lib/perf/breaking-point-finder.js +52 -0
  1227. package/plugins/sync-docs/lib/perf/breaking-point-runner.js +60 -0
  1228. package/plugins/sync-docs/lib/perf/checkpoint.js +123 -0
  1229. package/plugins/sync-docs/lib/perf/code-paths.js +86 -0
  1230. package/plugins/sync-docs/lib/perf/consolidation.js +37 -0
  1231. package/plugins/sync-docs/lib/perf/constraint-runner.js +71 -0
  1232. package/plugins/sync-docs/lib/perf/experiment-runner.js +32 -0
  1233. package/plugins/sync-docs/lib/perf/index.js +41 -0
  1234. package/plugins/sync-docs/lib/perf/investigation-state.js +875 -0
  1235. package/plugins/sync-docs/lib/perf/optimization-runner.js +79 -0
  1236. package/plugins/sync-docs/lib/perf/profilers/go.js +22 -0
  1237. package/plugins/sync-docs/lib/perf/profilers/index.js +46 -0
  1238. package/plugins/sync-docs/lib/perf/profilers/java.js +23 -0
  1239. package/plugins/sync-docs/lib/perf/profilers/node.js +27 -0
  1240. package/plugins/sync-docs/lib/perf/profilers/python.js +23 -0
  1241. package/plugins/sync-docs/lib/perf/profilers/rust.js +23 -0
  1242. package/plugins/sync-docs/lib/perf/profiling-runner.js +56 -0
  1243. package/plugins/sync-docs/lib/perf/schemas.js +140 -0
  1244. package/plugins/sync-docs/lib/platform/detect-platform.js +413 -0
  1245. package/plugins/sync-docs/lib/platform/detection-configs.js +93 -0
  1246. package/plugins/sync-docs/lib/platform/state-dir.js +132 -0
  1247. package/plugins/sync-docs/lib/platform/verify-tools.js +182 -0
  1248. package/plugins/sync-docs/lib/repo-map/cache.js +152 -0
  1249. package/plugins/sync-docs/lib/repo-map/index.js +222 -0
  1250. package/plugins/sync-docs/lib/repo-map/installer.js +212 -0
  1251. package/plugins/sync-docs/lib/repo-map/queries/go.js +27 -0
  1252. package/plugins/sync-docs/lib/repo-map/queries/index.js +100 -0
  1253. package/plugins/sync-docs/lib/repo-map/queries/java.js +38 -0
  1254. package/plugins/sync-docs/lib/repo-map/queries/javascript.js +55 -0
  1255. package/plugins/sync-docs/lib/repo-map/queries/python.js +24 -0
  1256. package/plugins/sync-docs/lib/repo-map/queries/rust.js +73 -0
  1257. package/plugins/sync-docs/lib/repo-map/queries/typescript.js +38 -0
  1258. package/plugins/sync-docs/lib/repo-map/runner.js +1165 -0
  1259. package/plugins/sync-docs/lib/repo-map/updater.js +474 -0
  1260. package/plugins/sync-docs/lib/repo-map/usage-analyzer.js +407 -0
  1261. package/plugins/sync-docs/lib/schemas/plugin-manifest.schema.json +57 -0
  1262. package/plugins/sync-docs/lib/schemas/validator.js +247 -0
  1263. package/plugins/sync-docs/lib/sources/custom-handler.js +199 -0
  1264. package/plugins/sync-docs/lib/sources/policy-questions.js +246 -0
  1265. package/plugins/sync-docs/lib/sources/source-cache.js +165 -0
  1266. package/plugins/sync-docs/lib/state/workflow-state.js +575 -0
  1267. package/plugins/sync-docs/lib/types/agent-frontmatter.d.ts +134 -0
  1268. package/plugins/sync-docs/lib/types/command-frontmatter.d.ts +107 -0
  1269. package/plugins/sync-docs/lib/types/hook-frontmatter.d.ts +115 -0
  1270. package/plugins/sync-docs/lib/types/index.d.ts +84 -0
  1271. package/plugins/sync-docs/lib/types/plugin-manifest.d.ts +102 -0
  1272. package/plugins/sync-docs/lib/types/skill-frontmatter.d.ts +89 -0
  1273. package/plugins/sync-docs/lib/utils/atomic-write.js +94 -0
  1274. package/plugins/sync-docs/lib/utils/cache-manager.js +159 -0
  1275. package/plugins/sync-docs/lib/utils/context-optimizer.js +300 -0
  1276. package/plugins/sync-docs/lib/utils/deprecation.js +37 -0
  1277. package/plugins/sync-docs/lib/utils/shell-escape.js +88 -0
  1278. package/plugins/sync-docs/skills/sync-docs/SKILL.md +351 -0
  1279. package/scripts/bump-version.js +92 -0
  1280. package/scripts/check-hardcoded-paths.js +199 -0
  1281. package/scripts/dev-install.js +493 -0
  1282. package/scripts/expand-templates.js +269 -0
  1283. package/scripts/gen-adapters.js +323 -0
  1284. package/scripts/generate-docs.js +558 -0
  1285. package/scripts/generate-plugin-list.js +20 -0
  1286. package/scripts/migrate-opencode.js +307 -0
  1287. package/scripts/perf/repo-map-create.js +46 -0
  1288. package/scripts/plugins.txt +12 -0
  1289. package/scripts/preflight.js +1263 -0
  1290. package/scripts/scaffold.js +490 -0
  1291. package/scripts/setup-hooks.js +169 -0
  1292. package/scripts/stamp-version.js +175 -0
  1293. package/scripts/test-transform.js +85 -0
  1294. package/scripts/validate-agent-skill-compliance.js +284 -0
  1295. package/scripts/validate-counts.js +457 -0
  1296. package/scripts/validate-cross-platform-docs.js +550 -0
  1297. package/scripts/validate-opencode-install.js +182 -0
  1298. package/site/assets/css/main.css +1525 -0
  1299. package/site/assets/css/tokens.css +493 -0
  1300. package/site/assets/favicon.svg +23 -0
  1301. package/site/assets/js/main.js +801 -0
  1302. package/site/assets/logo.png +0 -0
  1303. package/site/assets/og-image.html +163 -0
  1304. package/site/content.json +453 -0
  1305. package/site/index.html +698 -0
  1306. package/site/ux-spec.md +683 -0
  1307. package/site/version.json +5 -0
  1308. package/templates/agent-snippets/enhance-integration-points.md +6 -0
  1309. package/templates/agent-snippets/enhance-skill-delegation.md +18 -0
  1310. package/templates/agent-snippets/model-choice.md +6 -0
@@ -0,0 +1,1394 @@
1
+ # Learning Guide: Programmatic & Non-Interactive Usage of AI CLI Tools
2
+
3
+ **Generated**: 2026-02-10
4
+ **Sources**: 52 resources analyzed
5
+ **Depth**: deep
6
+
7
+ ## Prerequisites
8
+
9
+ - Familiarity with shell scripting (bash, zsh)
10
+ - Basic understanding of JSON and piping in Unix
11
+ - Node.js 18+ or Python 3.10+ (for SDK usage)
12
+ - API keys for the respective services (Anthropic, OpenAI, Google)
13
+ - Understanding of stdin/stdout/stderr patterns
14
+
15
+ ## TL;DR
16
+
17
+ - **Claude Code** (`claude -p`) is the most feature-rich for programmatic use, with a full Agent SDK (Python/TypeScript), session continuity via `--session-id`/`--resume`, structured output via `--output-format json` and `--json-schema`, and MCP integration.
18
+ - **Gemini CLI** (`gemini -p`) offers excellent headless support with `--output-format json/stream-json`, session resumption via `--resume`, and `--yolo` for auto-approving actions.
19
+ - **Codex CLI** (`codex -q`) uses `-q`/`--quiet` for non-interactive mode, `--json` for structured output, and `--approval-mode full-auto` for unattended execution.
20
+ - **OpenCode** (`opencode -p`) provides a simple non-interactive mode with `-p`, JSON output via `-f json`, and auto-approval of all permissions in non-interactive mode. (Note: OpenCode was archived Sept 2025; its successor is "Crush" by the Charm team.)
21
+ - All four tools support **piping via stdin**, **JSON output for parsing**, and some form of **session management**. Claude Code is the only one with a dedicated programmatic SDK.
22
+
23
+ ---
24
+
25
+ ## Core Concepts
26
+
27
+ ### 1. Non-Interactive (Headless) Invocation
28
+
29
+ All four AI CLI tools support a "headless" or "print" mode where you pass a prompt, the tool processes it, and exits with the result on stdout. This is the foundation of all programmatic usage.
30
+
31
+ | Tool | Non-Interactive Flag | Example |
32
+ |------|---------------------|---------|
33
+ | Claude Code | `-p` / `--print` | `claude -p "explain this code"` |
34
+ | Gemini CLI | `-p` / `--prompt` | `gemini -p "explain this code"` |
35
+ | Codex CLI | `-q` / `--quiet` | `codex -q "explain this code"` |
36
+ | OpenCode | `-p` / `--prompt` | `opencode -p "explain this code"` |
37
+
38
+ **Key insight**: The `-p` flag is nearly universal across these tools (Claude, Gemini, OpenCode all use it). Codex uses `-q` instead.
39
+
40
+ ### 2. Output Formats
41
+
42
+ Structured output is critical for programmatic consumption. All four tools support at least text and JSON output.
43
+
44
+ | Tool | Text | JSON | Stream JSON | JSON Schema |
45
+ |------|------|------|-------------|-------------|
46
+ | Claude Code | `--output-format text` | `--output-format json` | `--output-format stream-json` | `--json-schema '{...}'` |
47
+ | Gemini CLI | `--output-format text` | `--output-format json` | `--output-format stream-json` | Not supported |
48
+ | Codex CLI | (default) | `--json` | Not documented | Not supported |
49
+ | OpenCode | `-f text` | `-f json` | Not supported | Not supported |
50
+
51
+ **Claude Code JSON response** includes: `result` (text), `session_id`, usage metadata, and optionally `structured_output` when `--json-schema` is used.
52
+
53
+ **Gemini CLI JSON response** includes: `response` (text), `stats.models` (per-model API/token usage), `stats.tools` (tool execution stats), `stats.files` (line changes), and `error` (if present).
54
+
55
+ **Stream JSON** (Claude Code and Gemini CLI) emits newline-delimited JSON events in real-time, useful for monitoring long-running tasks.
56
+
57
+ ### 3. Permission / Approval Modes
58
+
59
+ When running non-interactively, you need to control what the AI can do without human approval.
60
+
61
+ | Tool | Flag | Auto-Approve All | Auto-Approve Edits | Read-Only |
62
+ |------|------|------------------|--------------------|-----------|
63
+ | Claude Code | `--permission-mode` | `bypassPermissions` | `acceptEdits` | `plan` |
64
+ | Gemini CLI | `--approval-mode` | `yolo` | `auto_edit` | `default` |
65
+ | Codex CLI | `--approval-mode` / `-a` | `full-auto` | `auto-edit` | `suggest` |
66
+ | OpenCode | (auto in `-p` mode) | All permissions auto-approved | N/A | N/A |
67
+
68
+ **Claude Code** additionally supports `--allowedTools` for fine-grained control:
69
+ ```bash
70
+ claude -p "fix tests" --allowedTools "Bash(npm test *),Read,Edit"
71
+ ```
72
+
73
+ **Gemini CLI** supports `--allowed-tools` to pre-approve specific tools.
74
+
75
+ ### 4. Session Management & Conversation Continuity
76
+
77
+ A key differentiator is the ability to maintain conversation state across multiple invocations -- essential for the "consultant" pattern.
78
+
79
+ #### Claude Code Sessions
80
+
81
+ Claude Code has the most sophisticated session management:
82
+
83
+ ```bash
84
+ # Start a conversation, capture session ID
85
+ session_id=$(claude -p "Review the auth module" --output-format json | jq -r '.session_id')
86
+ echo "Session: $session_id"
87
+
88
+ # Continue the same conversation
89
+ claude -p "Now focus on the database queries" --resume "$session_id"
90
+
91
+ # Or continue the most recent conversation in current directory
92
+ claude -p "What else did you find?" --continue
93
+
94
+ # Fork a session to explore alternatives
95
+ claude -p "Try a different approach" --resume "$session_id" --fork-session
96
+
97
+ # Resume by name
98
+ claude --resume "auth-refactor"
99
+ ```
100
+
101
+ **Via the Agent SDK (Python):**
102
+
103
+ ```python
104
+ from claude_agent_sdk import query, ClaudeAgentOptions
105
+
106
+ session_id = None
107
+
108
+ # First query: capture session ID
109
+ async for message in query(
110
+ prompt="Read the authentication module",
111
+ options=ClaudeAgentOptions(allowed_tools=["Read", "Glob"])
112
+ ):
113
+ if hasattr(message, 'subtype') and message.subtype == 'init':
114
+ session_id = message.session_id
115
+
116
+ # Resume with full context
117
+ async for message in query(
118
+ prompt="Now find all places that call it",
119
+ options=ClaudeAgentOptions(resume=session_id)
120
+ ):
121
+ if hasattr(message, "result"):
122
+ print(message.result)
123
+ ```
124
+
125
+ **Via the Agent SDK (TypeScript):**
126
+
127
+ ```typescript
128
+ import { query } from "@anthropic-ai/claude-agent-sdk";
129
+
130
+ let sessionId: string | undefined;
131
+
132
+ for await (const message of query({
133
+ prompt: "Read the authentication module",
134
+ options: { allowedTools: ["Read", "Glob"] }
135
+ })) {
136
+ if (message.type === "system" && message.subtype === "init") {
137
+ sessionId = message.session_id;
138
+ }
139
+ }
140
+
141
+ for await (const message of query({
142
+ prompt: "Now find all places that call it",
143
+ options: { resume: sessionId }
144
+ })) {
145
+ if ("result" in message) console.log(message.result);
146
+ }
147
+ ```
148
+
149
+ #### Session Forking (Claude Code)
150
+
151
+ Fork a session to explore alternatives without modifying the original:
152
+
153
+ ```bash
154
+ # Fork from existing session to try a different approach
155
+ claude -p "Try a GraphQL approach instead" --resume "$SESSION_ID" --fork-session
156
+
157
+ # The original session is preserved; you can continue it separately
158
+ claude -p "Continue with REST" --resume "$SESSION_ID"
159
+ ```
160
+
161
+ **Via the Agent SDK (TypeScript):**
162
+
163
+ ```typescript
164
+ // Fork to explore an alternative approach
165
+ for await (const message of query({
166
+ prompt: "Redesign this as a GraphQL API instead",
167
+ options: {
168
+ resume: originalSessionId,
169
+ forkSession: true // New session ID, original preserved
170
+ }
171
+ })) {
172
+ if (message.type === "system" && message.subtype === "init") {
173
+ console.log(`Forked session: ${message.session_id}`);
174
+ }
175
+ }
176
+ ```
177
+
178
+ #### Gemini CLI Sessions
179
+
180
+ ```bash
181
+ # Resume the latest session
182
+ gemini --resume
183
+
184
+ # Resume by index
185
+ gemini --resume 1
186
+
187
+ # Resume by UUID
188
+ gemini --resume a1b2c3d4-e5f6-7890-abcd-ef1234567890
189
+
190
+ # List available sessions
191
+ gemini --list-sessions
192
+ ```
193
+
194
+ Sessions are stored in `~/.gemini/tmp/<project_hash>/chats/` and are project-specific.
195
+
196
+ #### Codex CLI Sessions
197
+
198
+ Codex maintains conversation history configurable via `~/.codex/config.json` with `maxSize`, `saveHistory`, and `sensitivePatterns` settings. Session resumption across non-interactive invocations is not as well-documented as Claude Code or Gemini CLI.
199
+
200
+ #### OpenCode Sessions
201
+
202
+ Sessions persist in a SQLite database. In the interactive TUI, you can switch sessions via `Ctrl+A`. Non-interactive mode (`-p`) creates ephemeral sessions.
203
+
204
+ ### 5. Piping & stdin Integration
205
+
206
+ All tools support piping content via stdin, making them composable Unix utilities.
207
+
208
+ ```bash
209
+ # Claude Code
210
+ cat error.log | claude -p "explain this error"
211
+ git diff main | claude -p "review these changes for security issues"
212
+
213
+ # Gemini CLI
214
+ cat README.md | gemini -p "Summarize this documentation"
215
+ git diff --cached | gemini -p "Write a commit message" --output-format json | jq -r '.response'
216
+
217
+ # Codex CLI
218
+ cat build-error.txt | codex -q "explain this build error"
219
+
220
+ # OpenCode
221
+ cat code.py | opencode -p "find bugs in this code" -f json -q
222
+ ```
223
+
224
+ ### 6. The Claude Agent SDK
225
+
226
+ Claude Code uniquely offers a full programmatic SDK in both Python and TypeScript, going far beyond CLI invocation.
227
+
228
+ **Installation:**
229
+ ```bash
230
+ # TypeScript
231
+ npm install @anthropic-ai/claude-agent-sdk
232
+
233
+ # Python
234
+ pip install claude-agent-sdk
235
+ ```
236
+
237
+ **Key capabilities beyond CLI `-p`:**
238
+ - Async iterator streaming of messages
239
+ - Type-safe structured outputs (Zod/Pydantic)
240
+ - Programmatic hooks (PreToolUse, PostToolUse, Stop)
241
+ - Custom subagent definitions
242
+ - MCP server integration
243
+ - Session management (resume, fork)
244
+ - Tool approval callbacks
245
+ - Native message objects with full metadata
246
+
247
+ **Structured output with schema validation (TypeScript):**
248
+
249
+ ```typescript
250
+ import { query } from "@anthropic-ai/claude-agent-sdk";
251
+ import { z } from "zod";
252
+
253
+ const BugReport = z.object({
254
+ bugs: z.array(z.object({
255
+ file: z.string(),
256
+ line: z.number(),
257
+ severity: z.enum(["low", "medium", "high"]),
258
+ description: z.string()
259
+ })),
260
+ total_count: z.number()
261
+ });
262
+
263
+ for await (const message of query({
264
+ prompt: "Find all bugs in the auth module",
265
+ options: {
266
+ outputFormat: {
267
+ type: "json_schema",
268
+ schema: z.toJSONSchema(BugReport)
269
+ }
270
+ }
271
+ })) {
272
+ if (message.type === "result" && message.structured_output) {
273
+ const report = BugReport.parse(message.structured_output);
274
+ console.log(`Found ${report.total_count} bugs`);
275
+ }
276
+ }
277
+ ```
278
+
279
+ ### 7. Type-Safe Structured Outputs (Agent SDK)
280
+
281
+ Beyond `--json-schema` on the CLI, the Agent SDK provides first-class support for Zod (TypeScript) and Pydantic (Python) schemas with full type inference.
282
+
283
+ **TypeScript with Zod:**
284
+
285
+ ```typescript
286
+ import { z } from "zod";
287
+ import { query } from "@anthropic-ai/claude-agent-sdk";
288
+
289
+ const SecurityAudit = z.object({
290
+ vulnerabilities: z.array(z.object({
291
+ file: z.string(),
292
+ line: z.number(),
293
+ severity: z.enum(["critical", "high", "medium", "low"]),
294
+ description: z.string(),
295
+ fix: z.string()
296
+ })),
297
+ safe: z.boolean()
298
+ });
299
+
300
+ type SecurityAudit = z.infer<typeof SecurityAudit>;
301
+
302
+ for await (const message of query({
303
+ prompt: "Audit src/auth/ for security vulnerabilities",
304
+ options: {
305
+ allowedTools: ["Read", "Glob", "Grep"],
306
+ permissionMode: "bypassPermissions",
307
+ outputFormat: {
308
+ type: "json_schema",
309
+ schema: z.toJSONSchema(SecurityAudit)
310
+ }
311
+ }
312
+ })) {
313
+ if (message.type === "result" && message.structured_output) {
314
+ const audit = SecurityAudit.parse(message.structured_output);
315
+ if (!audit.safe) {
316
+ audit.vulnerabilities.forEach(v => {
317
+ console.error(`[${v.severity}] ${v.file}:${v.line} - ${v.description}`);
318
+ });
319
+ process.exit(1);
320
+ }
321
+ }
322
+ }
323
+ ```
324
+
325
+ **Python with Pydantic:**
326
+
327
+ ```python
328
+ from pydantic import BaseModel
329
+ from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage
330
+
331
+ class Vulnerability(BaseModel):
332
+ file: str
333
+ line: int
334
+ severity: str
335
+ description: str
336
+ fix: str
337
+
338
+ class SecurityAudit(BaseModel):
339
+ vulnerabilities: list[Vulnerability]
340
+ safe: bool
341
+
342
+ async for message in query(
343
+ prompt="Audit src/auth/ for security vulnerabilities",
344
+ options=ClaudeAgentOptions(
345
+ allowed_tools=["Read", "Glob", "Grep"],
346
+ permission_mode="bypassPermissions",
347
+ output_format={
348
+ "type": "json_schema",
349
+ "schema": SecurityAudit.model_json_schema()
350
+ }
351
+ )
352
+ ):
353
+ if isinstance(message, ResultMessage) and message.structured_output:
354
+ audit = SecurityAudit.model_validate(message.structured_output)
355
+ if not audit.safe:
356
+ for v in audit.vulnerabilities:
357
+ print(f"[{v.severity}] {v.file}:{v.line} - {v.description}")
358
+ ```
359
+
360
+ ### 8. Custom Subagents via CLI
361
+
362
+ Claude Code supports defining subagents inline via the `--agents` flag, which is powerful for cross-session consultation:
363
+
364
+ ```bash
365
+ # Define a specialized reviewer agent and use it
366
+ claude -p "Use the security-auditor agent to review this project" \
367
+ --output-format json \
368
+ --agents '{
369
+ "security-auditor": {
370
+ "description": "Security specialist for vulnerability detection",
371
+ "prompt": "You are a senior security engineer. Focus only on real vulnerabilities.",
372
+ "tools": ["Read", "Grep", "Glob"],
373
+ "model": "sonnet"
374
+ }
375
+ }' | jq -r '.result'
376
+ ```
377
+
378
+ This is particularly useful when calling from another AI session -- you can define purpose-specific agents:
379
+
380
+ ```bash
381
+ # From a Gemini or Codex session, call Claude with a specialized agent
382
+ claude -p "Use the perf-analyzer to find bottlenecks" \
383
+ --output-format json \
384
+ --agents '{
385
+ "perf-analyzer": {
386
+ "description": "Performance analysis specialist",
387
+ "prompt": "Identify performance bottlenecks. Focus on O(n^2) loops, N+1 queries, and memory leaks.",
388
+ "tools": ["Read", "Grep", "Glob", "Bash"],
389
+ "model": "opus"
390
+ }
391
+ }' | jq -r '.result'
392
+ ```
393
+
394
+ ---
395
+
396
+ ## Code Examples
397
+
398
+ ### Basic: Non-Interactive Query (All 4 Tools)
399
+
400
+ ```bash
401
+ #!/bin/bash
402
+ # Ask each tool the same question and compare responses
403
+
404
+ # Claude Code
405
+ claude -p "What is the time complexity of quicksort?" --output-format json | jq -r '.result'
406
+
407
+ # Gemini CLI
408
+ gemini -p "What is the time complexity of quicksort?" --output-format json | jq -r '.response'
409
+
410
+ # Codex CLI
411
+ codex -q --json "What is the time complexity of quicksort?"
412
+
413
+ # OpenCode
414
+ opencode -p "What is the time complexity of quicksort?" -f json -q
415
+ ```
416
+
417
+ ### Intermediate: Batch Code Review Script
418
+
419
+ ```bash
420
+ #!/bin/bash
421
+ # Review all changed files using Claude Code
422
+
423
+ REPORT_DIR="./review-reports"
424
+ mkdir -p "$REPORT_DIR"
425
+
426
+ for file in $(git diff main --name-only); do
427
+ echo "Reviewing: $file"
428
+ cat "$file" | claude -p \
429
+ "Review this code for bugs, security issues, and best practices. Be concise." \
430
+ --output-format json \
431
+ --max-turns 3 \
432
+ --allowedTools "Read" \
433
+ | jq -r '.result' > "$REPORT_DIR/$(basename "$file").review"
434
+ done
435
+
436
+ echo "Reviews saved to $REPORT_DIR/"
437
+ ```
438
+
439
+ ### Intermediate: Session Continuity Pattern (Claude Code)
440
+
441
+ ```bash
442
+ #!/bin/bash
443
+ # Multi-step analysis with conversation continuity
444
+
445
+ # Step 1: Initial analysis
446
+ SESSION=$(claude -p "Analyze the architecture of this project. Focus on the data flow." \
447
+ --output-format json | jq -r '.session_id')
448
+ echo "Session: $SESSION"
449
+
450
+ # Step 2: Follow-up (has context from step 1)
451
+ claude -p "Based on your analysis, what are the main bottlenecks?" \
452
+ --resume "$SESSION" --output-format json | jq -r '.result'
453
+
454
+ # Step 3: Get actionable recommendations with structured output
455
+ claude -p "Give me a prioritized list of improvements as JSON" \
456
+ --resume "$SESSION" \
457
+ --output-format json \
458
+ --json-schema '{"type":"object","properties":{"improvements":{"type":"array","items":{"type":"object","properties":{"priority":{"type":"number"},"description":{"type":"string"},"effort":{"type":"string"}},"required":["priority","description","effort"]}}},"required":["improvements"]}' \
459
+ | jq '.structured_output'
460
+ ```
461
+
462
+ ### Advanced: "Consultant" Pattern (Node.js)
463
+
464
+ This pattern lets your automation call out to an AI CLI for advice, then act on the structured response.
465
+
466
+ ```javascript
467
+ // consultant.mjs - Ask AI for advice from within automation
468
+ import { execFileSync } from "node:child_process";
469
+
470
+ function askClaude(prompt, options = {}) {
471
+ const args = [
472
+ "-p", prompt,
473
+ "--output-format", "json",
474
+ "--max-turns", String(options.maxTurns || 3),
475
+ ];
476
+
477
+ if (options.allowedTools) {
478
+ args.push("--allowedTools", options.allowedTools.join(","));
479
+ }
480
+
481
+ if (options.sessionId) {
482
+ args.push("--resume", options.sessionId);
483
+ }
484
+
485
+ if (options.jsonSchema) {
486
+ args.push("--json-schema", JSON.stringify(options.jsonSchema));
487
+ }
488
+
489
+ const result = execFileSync("claude", args, {
490
+ encoding: "utf-8",
491
+ timeout: options.timeout || 120_000,
492
+ cwd: options.cwd || process.cwd(),
493
+ });
494
+
495
+ return JSON.parse(result);
496
+ }
497
+
498
+ // Usage: get commit message suggestion
499
+ const diff = execFileSync("git", ["diff", "--cached"], { encoding: "utf-8" });
500
+ const response = askClaude(
501
+ `Write a conventional commit message for this diff:\n${diff}`,
502
+ {
503
+ maxTurns: 1,
504
+ jsonSchema: {
505
+ type: "object",
506
+ properties: {
507
+ type: { type: "string", enum: ["feat", "fix", "chore", "refactor", "docs", "test"] },
508
+ scope: { type: "string" },
509
+ description: { type: "string" },
510
+ body: { type: "string" }
511
+ },
512
+ required: ["type", "description"]
513
+ }
514
+ }
515
+ );
516
+
517
+ console.log(response.structured_output);
518
+ // { type: "feat", scope: "auth", description: "add OAuth2 support", body: "..." }
519
+ ```
520
+
521
+ ### Advanced: "Consultant" Pattern (Python with Agent SDK)
522
+
523
+ ```python
524
+ import asyncio
525
+ from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage
526
+
527
+ async def ask_claude(prompt, tools=None, schema=None, session_id=None):
528
+ """Call Claude Code as a consultant and get structured advice."""
529
+ options = ClaudeAgentOptions(
530
+ allowed_tools=tools or ["Read", "Glob", "Grep"],
531
+ permission_mode="bypassPermissions"
532
+ )
533
+
534
+ if schema:
535
+ options.output_format = {"type": "json_schema", "schema": schema}
536
+
537
+ if session_id:
538
+ options.resume = session_id
539
+
540
+ result = None
541
+ new_session_id = None
542
+
543
+ async for message in query(prompt=prompt, options=options):
544
+ if hasattr(message, 'subtype') and message.subtype == 'init':
545
+ new_session_id = message.session_id
546
+ if isinstance(message, ResultMessage):
547
+ result = message
548
+
549
+ return {
550
+ "text": result.result if result else None,
551
+ "structured": getattr(result, 'structured_output', None),
552
+ "session_id": new_session_id
553
+ }
554
+
555
+ # Usage in a CI/CD pipeline
556
+ async def ci_review():
557
+ review = await ask_claude(
558
+ "Review all changed files for security vulnerabilities",
559
+ tools=["Read", "Glob", "Grep", "Bash"],
560
+ schema={
561
+ "type": "object",
562
+ "properties": {
563
+ "vulnerabilities": {
564
+ "type": "array",
565
+ "items": {
566
+ "type": "object",
567
+ "properties": {
568
+ "file": {"type": "string"},
569
+ "line": {"type": "number"},
570
+ "severity": {"type": "string"},
571
+ "description": {"type": "string"},
572
+ "fix": {"type": "string"}
573
+ },
574
+ "required": ["file", "severity", "description"]
575
+ }
576
+ },
577
+ "safe": {"type": "boolean"}
578
+ },
579
+ "required": ["vulnerabilities", "safe"]
580
+ }
581
+ )
582
+
583
+ if not review["structured"]["safe"]:
584
+ print("SECURITY ISSUES FOUND:")
585
+ for vuln in review["structured"]["vulnerabilities"]:
586
+ print(f" [{vuln['severity']}] {vuln['file']}: {vuln['description']}")
587
+ exit(1)
588
+
589
+ asyncio.run(ci_review())
590
+ ```
591
+
592
+ ### Advanced: Gemini CLI in CI/CD
593
+
594
+ ```bash
595
+ #!/bin/bash
596
+ # Gemini CLI in a GitHub Actions workflow
597
+
598
+ # Auto-review PR
599
+ review=$(git diff origin/main...HEAD | gemini -p \
600
+ "Review this PR for bugs, security issues, and code quality. Rate 1-10." \
601
+ --output-format json \
602
+ --approval-mode default)
603
+
604
+ score=$(echo "$review" | jq -r '.response' | grep -oP 'Rating: \K[0-9]+')
605
+
606
+ if [ "$score" -lt 6 ]; then
607
+ echo "::warning::Code review score is $score/10"
608
+ fi
609
+
610
+ # Generate release notes
611
+ gemini -p "Generate release notes from the last 20 commits" \
612
+ --output-format json \
613
+ --yolo \
614
+ | jq -r '.response' > RELEASE_NOTES.md
615
+ ```
616
+
617
+ ### Advanced: Multi-Tool Orchestration (Bash)
618
+
619
+ ```bash
620
+ #!/bin/bash
621
+ # Use different AI CLIs for different strengths
622
+
623
+ # Step 1: Use Claude Code for deep code analysis (best at code understanding)
624
+ ANALYSIS=$(claude -p "Analyze the architecture and identify all API endpoints" \
625
+ --output-format json \
626
+ --allowedTools "Read,Glob,Grep" \
627
+ --max-turns 10)
628
+
629
+ ENDPOINTS=$(echo "$ANALYSIS" | jq -r '.result')
630
+
631
+ # Step 2: Use Gemini for generating documentation (fast, good at writing)
632
+ echo "$ENDPOINTS" | gemini -p \
633
+ "Generate OpenAPI documentation for these endpoints" \
634
+ --output-format json \
635
+ -m gemini-2.5-flash \
636
+ | jq -r '.response' > api-docs.yaml
637
+
638
+ echo "API documentation generated at api-docs.yaml"
639
+ ```
640
+
641
+ ---
642
+
643
+ ## Common Pitfalls
644
+
645
+ | Pitfall | Why It Happens | How to Avoid |
646
+ |---------|---------------|--------------|
647
+ | Tool hangs waiting for permission | Non-interactive mode still prompts for dangerous operations | Use `--permission-mode bypassPermissions` (Claude), `--yolo` (Gemini), `-a full-auto` (Codex), or constrain with `--allowedTools` |
648
+ | JSON output includes non-JSON text | Some tools emit status/progress text to stdout | Use `--output-format json` (not text) and pipe through `jq` for safety |
649
+ | Session ID not captured | Forgetting to parse JSON output for session_id | Always use `--output-format json` and extract with `jq -r '.session_id'` |
650
+ | Timeout on complex tasks | Default subprocess timeouts are too short for multi-turn agents | Set explicit `--max-turns` limits and subprocess timeouts (120s+) |
651
+ | Context overflow in long sessions | Resumed sessions accumulate context that exceeds model window | Use `--max-turns` to limit agent loops; for Claude, auto-compaction handles this |
652
+ | Cost runaway in automation | No budget limits on automated runs | Use Claude's `--max-budget-usd` flag; set `--max-turns` on all tools |
653
+ | Shell escaping issues on Windows | `$` in JSON schemas gets interpreted by PowerShell | Escape `$` as backtick-$ in PowerShell; use double quotes with escaped inner quotes |
654
+ | OpenCode archived | Project archived Sept 2025, successor is "Crush" | Migrate to Crush or use one of the other three actively maintained tools |
655
+ | Codex network disabled in full-auto | `full-auto` mode sandboxes with no network access | Use `auto-edit` if network access is needed, or explicitly allow commands |
656
+ | Stdin and --prompt conflict | Some tools treat piped stdin and -p flag differently | Test your specific combination; Claude Code appends stdin to the prompt |
657
+
658
+ ---
659
+
660
+ ## Best Practices
661
+
662
+ Synthesized from 52 sources:
663
+
664
+ 1. **Always use `--output-format json` for programmatic consumption** -- plain text output is fragile to parse and may include unexpected formatting.
665
+
666
+ 2. **Set `--max-turns` to prevent runaway costs** -- without a limit, the AI can loop through many tool calls. Start with 3-5 for simple tasks, 10-20 for complex ones.
667
+
668
+ 3. **Use `--max-budget-usd` (Claude Code) for cost control** -- hard limit on spending per invocation prevents surprises in automation.
669
+
670
+ 4. **Capture session IDs for conversation continuity** -- extract from JSON output and pass via `--resume` for multi-step workflows.
671
+
672
+ 5. **Use the Agent SDK (Python/TypeScript) for production automation** -- the CLI is great for scripts, but the SDK gives you proper error handling, streaming, type safety, and programmatic control.
673
+
674
+ 6. **Define JSON schemas for structured output** -- Claude Code's `--json-schema` flag ensures the AI returns data in the exact shape you need. Gemini and Codex require you to parse free-form JSON.
675
+
676
+ 7. **Constrain tools to minimum necessary** -- use `--allowedTools` (Claude) or `--allowed-tools` (Gemini) to limit what the AI can do. Principle of least privilege.
677
+
678
+ 8. **Use `--append-system-prompt` over `--system-prompt`** -- appending preserves the tool's built-in capabilities while adding your instructions. Full replacement removes important defaults.
679
+
680
+ 9. **Handle errors and timeouts explicitly** -- set subprocess timeouts, check exit codes, and handle empty/malformed JSON responses gracefully.
681
+
682
+ 10. **Use `--no-session-persistence` for ephemeral tasks** -- in CI/CD where you do not need to resume, skip saving sessions to disk for cleaner operation.
683
+
684
+ 11. **Pipe context in, do not embed it in the prompt** -- `cat file.txt | claude -p "review this"` is cleaner and avoids shell escaping issues compared to embedding file contents in the argument string.
685
+
686
+ 12. **Use environment variables for API keys** -- never hardcode keys in scripts. Use `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `OPENAI_API_KEY` as appropriate.
687
+
688
+ 13. **Use `--agents` for cross-session specialized consultation** -- when calling Claude from another AI session, define purpose-specific subagents inline via the `--agents` JSON flag for focused, constrained analysis.
689
+
690
+ 14. **Fork sessions for A/B exploration** -- use `--fork-session` with `--resume` to explore alternative approaches without losing the original conversation state.
691
+
692
+ 15. **Use Zod/Pydantic for type-safe outputs in production** -- rather than raw JSON Schema strings, use Zod (TypeScript) or Pydantic (Python) with the Agent SDK for compile-time type safety and runtime validation.
693
+
694
+ 16. **Use `claude-code-action@v1` for GitHub CI/CD** -- the official GitHub Action handles authentication, permissions, and workflow integration out of the box.
695
+
696
+ ---
697
+
698
+ ## Detailed Tool Reference
699
+
700
+ ### Claude Code (`claude`)
701
+
702
+ **Non-interactive invocation:**
703
+ ```bash
704
+ claude -p "your prompt"
705
+ cat input.txt | claude -p "process this"
706
+ ```
707
+
708
+ **Key flags for programmatic use:**
709
+
710
+ | Flag | Purpose |
711
+ |------|---------|
712
+ | `-p` / `--print` | Non-interactive mode |
713
+ | `--output-format text\|json\|stream-json` | Output format |
714
+ | `--json-schema '{...}'` | Validated structured output |
715
+ | `--session-id UUID` | Use specific session ID |
716
+ | `--resume ID_OR_NAME` | Resume a session |
717
+ | `--continue` / `-c` | Continue most recent session |
718
+ | `--fork-session` | Fork when resuming |
719
+ | `--max-turns N` | Limit agentic turns |
720
+ | `--max-budget-usd N` | Dollar spend limit |
721
+ | `--allowedTools "Tool1,Tool2"` | Auto-approve specific tools |
722
+ | `--disallowedTools "Tool1"` | Block specific tools |
723
+ | `--permission-mode MODE` | Permission mode (plan, acceptEdits, bypassPermissions) |
724
+ | `--dangerously-skip-permissions` | Skip all permission prompts |
725
+ | `--model MODEL` | Model selection (sonnet, opus, haiku) |
726
+ | `--system-prompt TEXT` | Replace system prompt |
727
+ | `--append-system-prompt TEXT` | Append to system prompt |
728
+ | `--system-prompt-file PATH` | Load system prompt from file |
729
+ | `--append-system-prompt-file PATH` | Append from file |
730
+ | `--mcp-config PATH` | Load MCP servers |
731
+ | `--agents JSON` | Define custom subagents |
732
+ | `--verbose` | Verbose output |
733
+ | `--no-session-persistence` | Do not save session to disk |
734
+ | `--fallback-model MODEL` | Fallback when overloaded |
735
+ | `--include-partial-messages` | Include streaming events |
736
+ | `--input-format text\|stream-json` | Input format |
737
+ | `--tools "Tool1,Tool2"` | Restrict available tools |
738
+ | `--add-dir PATH` | Add working directories |
739
+
740
+ **Agent SDK (Python):**
741
+ ```bash
742
+ pip install claude-agent-sdk
743
+ ```
744
+ ```python
745
+ from claude_agent_sdk import query, ClaudeAgentOptions
746
+ async for message in query(prompt="...", options=ClaudeAgentOptions(...)):
747
+ ...
748
+ ```
749
+
750
+ **Agent SDK (TypeScript):**
751
+ ```bash
752
+ npm install @anthropic-ai/claude-agent-sdk
753
+ ```
754
+ ```typescript
755
+ import { query } from "@anthropic-ai/claude-agent-sdk";
756
+ for await (const message of query({ prompt: "...", options: { ... } })) { ... }
757
+ ```
758
+
759
+ **Authentication:**
760
+ - `ANTHROPIC_API_KEY` for direct API
761
+ - `CLAUDE_CODE_USE_BEDROCK=1` + AWS credentials for Bedrock
762
+ - `CLAUDE_CODE_USE_VERTEX=1` + GCP credentials for Vertex AI
763
+ - `CLAUDE_CODE_USE_FOUNDRY=1` + Azure credentials for Azure
764
+
765
+ ### Gemini CLI (`gemini`)
766
+
767
+ **Non-interactive invocation:**
768
+ ```bash
769
+ gemini -p "your prompt"
770
+ echo "input" | gemini -p "process this"
771
+ gemini -p "query" --output-format json | jq '.response'
772
+ ```
773
+
774
+ **Key flags for programmatic use:**
775
+
776
+ | Flag | Purpose |
777
+ |------|---------|
778
+ | `-p` / `--prompt` | Non-interactive prompt |
779
+ | `-i` / `--prompt-interactive` | Execute prompt then continue interactively |
780
+ | `--output-format text\|json\|stream-json` | Output format |
781
+ | `-m` / `--model MODEL` | Model selection (pro, flash, flash-lite) |
782
+ | `--approval-mode default\|auto_edit\|yolo` | Approval mode |
783
+ | `-y` / `--yolo` | Auto-approve all (deprecated, use --approval-mode=yolo) |
784
+ | `-r` / `--resume [ID]` | Resume session (latest, index, or UUID) |
785
+ | `--list-sessions` | List available sessions |
786
+ | `--delete-session N` | Delete session by index |
787
+ | `-d` / `--debug` | Enable debug mode |
788
+ | `-s` / `--sandbox` | Run in sandboxed environment |
789
+ | `--include-directories DIRS` | Add directories to context |
790
+ | `--allowed-tools TOOLS` | Pre-approve specific tools |
791
+ | `-e` / `--extensions EXTS` | Specify extensions |
792
+
793
+ **Authentication:**
794
+ - `GEMINI_API_KEY` for direct API
795
+ - `GOOGLE_CLOUD_PROJECT` + `GOOGLE_GENAI_USE_VERTEXAI` for Vertex AI
796
+
797
+ **Session storage:** `~/.gemini/tmp/<project_hash>/chats/`
798
+
799
+ **Streaming JSON event types:** `init`, `message`, `tool_use`, `tool_result`, `error`, `result`
800
+
801
+ ### Codex CLI (`codex`)
802
+
803
+ **Non-interactive invocation:**
804
+ ```bash
805
+ codex -q "your prompt"
806
+ codex -q --json "your prompt"
807
+ ```
808
+
809
+ **Key flags for programmatic use:**
810
+
811
+ | Flag | Purpose |
812
+ |------|---------|
813
+ | `-q` / `--quiet` | Non-interactive (headless) mode |
814
+ | `--json` | Structured JSON output |
815
+ | `-a` / `--approval-mode` | Approval mode (suggest, auto-edit, full-auto) |
816
+ | `-m` / `--model MODEL` | Model selection |
817
+ | `--provider PROVIDER` | AI provider (openai, azure, gemini, etc.) |
818
+ | `--no-project-doc` | Skip AGENTS.md loading |
819
+ | `--notify` | Desktop notifications |
820
+
821
+ **Environment variables:**
822
+ - `OPENAI_API_KEY` for OpenAI
823
+ - `CODEX_QUIET_MODE=1` to suppress interactive elements
824
+ - `CODEX_DISABLE_PROJECT_DOC=1` to disable AGENTS.md
825
+ - `DEBUG=true` for verbose API logging
826
+
827
+ **Approval modes:**
828
+
829
+ | Mode | File Reads | File Writes | Shell Commands |
830
+ |------|-----------|-------------|----------------|
831
+ | `suggest` (default) | Auto | Prompt | Prompt |
832
+ | `auto-edit` | Auto | Auto (patches) | Prompt |
833
+ | `full-auto` | Auto | Auto | Auto (no network, confined) |
834
+
835
+ **Configuration:** `~/.codex/config.json`
836
+
837
+ ### OpenCode (`opencode`)
838
+
839
+ **Status:** Archived September 2025. Successor: "Crush" by Charm team.
840
+
841
+ **Non-interactive invocation:**
842
+ ```bash
843
+ opencode -p "your prompt"
844
+ opencode -p "your prompt" -f json -q
845
+ ```
846
+
847
+ **Key flags for programmatic use:**
848
+
849
+ | Flag | Purpose |
850
+ |------|---------|
851
+ | `-p` / `--prompt` | Non-interactive mode |
852
+ | `-f` / `--output-format` | Output format (text, json) |
853
+ | `-q` / `--quiet` | Suppress spinner animation |
854
+ | `-d` / `--debug` | Enable debug logging |
855
+ | `-c` / `--cwd` | Set working directory |
856
+
857
+ **Key characteristic:** All permissions are auto-approved in non-interactive mode.
858
+
859
+ **Configuration paths (priority order):**
860
+ 1. `$HOME/.opencode.json`
861
+ 2. `$XDG_CONFIG_HOME/opencode/.opencode.json`
862
+ 3. `./.opencode.json` (local)
863
+
864
+ **Supported providers:** OpenAI, Anthropic, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, OpenRouter, GitHub Copilot, VertexAI
865
+
866
+ ---
867
+
868
+ ## MCP (Model Context Protocol) Integration
869
+
870
+ MCP enables AI tools to connect to external data sources and tools. All four CLI tools support MCP to varying degrees.
871
+
872
+ ### Claude Code MCP
873
+
874
+ Claude Code has the deepest MCP integration:
875
+
876
+ ```bash
877
+ # Load MCP config from file
878
+ claude -p "query" --mcp-config ./mcp.json
879
+
880
+ # Strict mode: only use specified MCP servers
881
+ claude -p "query" --strict-mcp-config --mcp-config ./mcp.json
882
+ ```
883
+
884
+ **Via Agent SDK:**
885
+ ```python
886
+ async for message in query(
887
+ prompt="Open example.com and describe what you see",
888
+ options=ClaudeAgentOptions(
889
+ mcp_servers={
890
+ "playwright": {"command": "npx", "args": ["@playwright/mcp@latest"]}
891
+ }
892
+ )
893
+ ):
894
+ ...
895
+ ```
896
+
897
+ ### Gemini CLI MCP
898
+
899
+ Gemini CLI supports MCP extensions via the `--extensions` flag and configuration in `settings.json`.
900
+
901
+ ### OpenCode MCP
902
+
903
+ OpenCode supports MCP server integration configured in `.opencode.json`.
904
+
905
+ ---
906
+
907
+ ## Subprocess Invocation Patterns
908
+
909
+ ### From Node.js
910
+
911
+ ```javascript
912
+ import { execFileSync, spawn } from "node:child_process";
913
+
914
+ // Synchronous (simple queries)
915
+ function claudeSync(prompt, options = {}) {
916
+ const args = ["-p", prompt, "--output-format", "json"];
917
+ if (options.maxTurns) args.push("--max-turns", String(options.maxTurns));
918
+ if (options.sessionId) args.push("--resume", options.sessionId);
919
+
920
+ const result = execFileSync("claude", args, {
921
+ encoding: "utf-8",
922
+ timeout: options.timeout || 120_000,
923
+ maxBuffer: 10 * 1024 * 1024, // 10MB for large responses
924
+ });
925
+ return JSON.parse(result);
926
+ }
927
+
928
+ // Async with streaming (long-running tasks)
929
+ function claudeStream(prompt) {
930
+ return new Promise((resolve, reject) => {
931
+ const proc = spawn("claude", [
932
+ "-p", prompt, "--output-format", "stream-json"
933
+ ]);
934
+ const events = [];
935
+
936
+ proc.stdout.on("data", (chunk) => {
937
+ chunk.toString().split("\n").filter(Boolean).forEach(line => {
938
+ try { events.push(JSON.parse(line)); } catch { /* skip */ }
939
+ });
940
+ });
941
+
942
+ proc.on("close", (code) => {
943
+ code === 0 ? resolve(events) : reject(new Error(`Exit code ${code}`));
944
+ });
945
+ });
946
+ }
947
+ ```
948
+
949
+ ### From Python
950
+
951
+ ```python
952
+ import subprocess
953
+ import json
954
+
955
+ def claude_query(prompt, max_turns=5, session_id=None, timeout=120):
956
+ """Call Claude Code CLI and return parsed JSON."""
957
+ cmd = [
958
+ "claude", "-p", prompt,
959
+ "--output-format", "json",
960
+ "--max-turns", str(max_turns)
961
+ ]
962
+
963
+ if session_id:
964
+ cmd.extend(["--resume", session_id])
965
+
966
+ result = subprocess.run(
967
+ cmd,
968
+ capture_output=True,
969
+ text=True,
970
+ timeout=timeout,
971
+ cwd="."
972
+ )
973
+
974
+ if result.returncode != 0:
975
+ raise RuntimeError(f"Claude failed: {result.stderr}")
976
+
977
+ return json.loads(result.stdout)
978
+
979
+ # Usage
980
+ response = claude_query("What files are in this project?", max_turns=3)
981
+ print(response["result"])
982
+ print(f"Session: {response['session_id']}")
983
+ ```
984
+
985
+ ### From Bash
986
+
987
+ ```bash
988
+ #!/bin/bash
989
+ set -euo pipefail
990
+
991
+ ask_claude() {
992
+ local prompt="$1"
993
+ local max_turns="${2:-5}"
994
+
995
+ local response
996
+ response=$(claude -p "$prompt" \
997
+ --output-format json \
998
+ --max-turns "$max_turns" \
999
+ --allowedTools "Read,Glob,Grep" \
1000
+ 2>/dev/null)
1001
+
1002
+ echo "$response"
1003
+ }
1004
+
1005
+ # Usage with error handling
1006
+ if result=$(ask_claude "List all TODO comments" 3); then
1007
+ echo "$result" | jq -r '.result'
1008
+ SESSION=$(echo "$result" | jq -r '.session_id')
1009
+ else
1010
+ echo "Claude query failed" >&2
1011
+ exit 1
1012
+ fi
1013
+ ```
1014
+
1015
+ ---
1016
+
1017
+ ## Error Handling and Timeouts
1018
+
1019
+ ### Exit Codes
1020
+
1021
+ | Tool | Success | Error | Notes |
1022
+ |------|---------|-------|-------|
1023
+ | Claude Code | 0 | Non-zero | `--max-turns` exceeded returns error |
1024
+ | Gemini CLI | 0 | Non-zero | Stream JSON emits `error` events |
1025
+ | Codex CLI | 0 | Non-zero | Quiet mode failures reflected in exit code |
1026
+ | OpenCode | 0 | Non-zero | |
1027
+
1028
+ ### Timeout Strategy
1029
+
1030
+ ```bash
1031
+ # Bash: use timeout command
1032
+ timeout 120 claude -p "complex analysis" --output-format json --max-turns 10
1033
+ ```
1034
+
1035
+ ### Retry Pattern
1036
+
1037
+ ```python
1038
+ import time
1039
+ import subprocess
1040
+
1041
+ def claude_with_retry(prompt, retries=3, backoff=5):
1042
+ for attempt in range(retries):
1043
+ try:
1044
+ return claude_query(prompt, timeout=120)
1045
+ except (subprocess.TimeoutExpired, RuntimeError) as e:
1046
+ if attempt == retries - 1:
1047
+ raise
1048
+ time.sleep(backoff * (attempt + 1))
1049
+ ```
1050
+
1051
+ ---
1052
+
1053
+ ## Cost & Token Management
1054
+
1055
+ | Tool | Cost Control Flag | Token Tracking |
1056
+ |------|-------------------|----------------|
1057
+ | Claude Code | `--max-budget-usd 5.00` | JSON output includes usage metadata |
1058
+ | Gemini CLI | No direct flag | JSON `stats.models` includes token counts |
1059
+ | Codex CLI | No direct flag | `DEBUG=true` logs API requests |
1060
+ | OpenCode | No direct flag | Debug mode shows token usage |
1061
+
1062
+ **Best practice for automation:**
1063
+ ```bash
1064
+ # Claude: hard budget limit
1065
+ claude -p "complex analysis" --max-budget-usd 2.00 --max-turns 10
1066
+ ```
1067
+
1068
+ ---
1069
+
1070
+ ## Comparison Matrix
1071
+
1072
+ | Feature | Claude Code | Gemini CLI | Codex CLI | OpenCode |
1073
+ |---------|------------|------------|-----------|----------|
1074
+ | **Non-interactive flag** | `-p` | `-p` | `-q` | `-p` |
1075
+ | **JSON output** | Yes | Yes | Yes | Yes |
1076
+ | **Stream JSON** | Yes | Yes | No | No |
1077
+ | **JSON Schema validation** | Yes (`--json-schema`) | No | No | No |
1078
+ | **Programmatic SDK** | Python + TypeScript | No | No | No |
1079
+ | **Session resume** | `--resume`, `--continue` | `--resume` | Limited | SQLite-based |
1080
+ | **Session fork** | `--fork-session` | No | No | No |
1081
+ | **Cost control** | `--max-budget-usd` | No | No | No |
1082
+ | **Turn limit** | `--max-turns` | Settings only | No | No |
1083
+ | **Tool restriction** | `--allowedTools` | `--allowed-tools` | N/A | N/A |
1084
+ | **Custom system prompt** | `--system-prompt` | Via config | N/A | N/A |
1085
+ | **MCP integration** | Deep (`--mcp-config`) | Extensions | N/A | Config |
1086
+ | **CI/CD action** | GitHub Actions (official) | GitHub Action | N/A | N/A |
1087
+ | **Sub-agents** | `--agents` JSON | No | No | No |
1088
+ | **Multi-provider** | Anthropic, Bedrock, Vertex, Azure | Google, Vertex | OpenAI, Azure, Gemini, Ollama, etc. | All major providers |
1089
+ | **Active development** | Yes | Yes | Yes | Archived (Sept 2025) |
1090
+
1091
+ ---
1092
+
1093
+ ## Cross-Session Consultation: Calling One AI CLI From Another
1094
+
1095
+ The most powerful pattern is calling a different AI CLI from within an active session. For example, from inside a Claude Code session, you can use the Bash tool to invoke Codex, Gemini, or another Claude instance for a second opinion, specialized analysis, or alternative approach.
1096
+
1097
+ ### Why Cross-Consult?
1098
+
1099
+ - **Second opinion**: Different models have different strengths and blind spots
1100
+ - **Specialized strengths**: Gemini excels at certain reasoning tasks, Codex at OpenAI-ecosystem code
1101
+ - **Cost optimization**: Route expensive analysis to cheaper models for triage
1102
+ - **Validation**: Cross-check AI suggestions with a different provider
1103
+ - **Parallel exploration**: Get multiple approaches to the same problem
1104
+
1105
+ ### Pattern 1: From Claude Code Session, Call Codex
1106
+
1107
+ Inside a Claude Code session, use the Bash tool:
1108
+
1109
+ ```bash
1110
+ # Ask Codex for a second opinion on a function
1111
+ codex -q -a auto-edit "Review the error handling in src/auth.ts and suggest improvements" 2>&1
1112
+
1113
+ # Get Codex to generate an alternative implementation
1114
+ codex -q --json "Write an alternative implementation of the retry logic in lib/http.js" | jq -r '.message'
1115
+ ```
1116
+
1117
+ ### Pattern 2: From Claude Code Session, Call Gemini CLI
1118
+
1119
+ ```bash
1120
+ # Ask Gemini for architecture review
1121
+ gemini -p "Review the architecture in this project and identify scaling bottlenecks" \
1122
+ --output-format json | jq -r '.response'
1123
+
1124
+ # Use Gemini for documentation generation (it's fast with flash)
1125
+ gemini -p "Generate API documentation for all exported functions in src/api/" \
1126
+ -m gemini-2.5-flash \
1127
+ --output-format json | jq -r '.response'
1128
+ ```
1129
+
1130
+ ### Pattern 3: From Claude Code Session, Call Another Claude Instance
1131
+
1132
+ ```bash
1133
+ # Spawn a separate Claude session with different constraints
1134
+ claude -p "As a security auditor, review src/auth/ for vulnerabilities" \
1135
+ --output-format json \
1136
+ --allowedTools "Read,Glob,Grep" \
1137
+ --max-turns 5 \
1138
+ --append-system-prompt "You are a security specialist. Only report real vulnerabilities." \
1139
+ | jq -r '.result'
1140
+
1141
+ # Use a different model for a different perspective
1142
+ claude -p "Review this test file for missing edge cases" \
1143
+ --model haiku \
1144
+ --output-format json \
1145
+ --max-turns 3 \
1146
+ | jq -r '.result'
1147
+ ```
1148
+
1149
+ ### Pattern 4: Multi-Consult with Conversation Continuity
1150
+
1151
+ The key insight: capture the session ID from the first call to continue the conversation later.
1152
+
1153
+ ```bash
1154
+ # Step 1: Ask Claude for initial analysis (from another AI session's Bash tool)
1155
+ CLAUDE_RESPONSE=$(claude -p "Analyze the data flow in this project" \
1156
+ --output-format json --max-turns 10 --allowedTools "Read,Glob,Grep")
1157
+
1158
+ CLAUDE_SESSION=$(echo "$CLAUDE_RESPONSE" | jq -r '.session_id')
1159
+ CLAUDE_ANALYSIS=$(echo "$CLAUDE_RESPONSE" | jq -r '.result')
1160
+
1161
+ # Step 2: Feed Claude's analysis to Gemini for a second take
1162
+ echo "$CLAUDE_ANALYSIS" | gemini -p \
1163
+ "Here is an analysis of a codebase's data flow. What did the analyst miss? What additional concerns do you see?" \
1164
+ --output-format json | jq -r '.response'
1165
+
1166
+ # Step 3: Continue the Claude conversation with Gemini's feedback
1167
+ claude -p "A second reviewer noted these additional concerns: [paste gemini output]. Do you agree?" \
1168
+ --resume "$CLAUDE_SESSION" \
1169
+ --output-format json | jq -r '.result'
1170
+ ```
1171
+
1172
+ ### Pattern 5: From Codex or Gemini Session, Call Claude Code
1173
+
1174
+ From within a Codex or Gemini session (using their shell/Bash tool):
1175
+
1176
+ ```bash
1177
+ # From Codex: call Claude for deep code analysis
1178
+ claude -p "Find all security vulnerabilities in this codebase" \
1179
+ --output-format json \
1180
+ --allowedTools "Read,Glob,Grep,Bash" \
1181
+ --max-turns 15 \
1182
+ --max-budget-usd 2.00 \
1183
+ | jq -r '.result'
1184
+
1185
+ # From Gemini: call Claude with specific subagents
1186
+ claude -p "Use the code-reviewer agent to review recent changes" \
1187
+ --output-format json \
1188
+ --agents '{"code-reviewer":{"description":"Reviews code","prompt":"Review for bugs and security","tools":["Read","Grep","Glob"],"model":"sonnet"}}' \
1189
+ | jq -r '.result'
1190
+ ```
1191
+
1192
+ ### Pattern 6: Wrapper Script for Cross-Tool Consultation
1193
+
1194
+ Create a reusable script that any AI session can call:
1195
+
1196
+ ```bash
1197
+ #!/bin/bash
1198
+ # consult.sh - Cross-tool AI consultation
1199
+ # Usage: ./consult.sh <tool> <prompt> [--continue <session_id>]
1200
+
1201
+ TOOL="$1"
1202
+ PROMPT="$2"
1203
+ SESSION_FLAG=""
1204
+
1205
+ if [[ "$3" == "--continue" && -n "$4" ]]; then
1206
+ SESSION_FLAG="--resume $4"
1207
+ fi
1208
+
1209
+ case "$TOOL" in
1210
+ claude)
1211
+ claude -p "$PROMPT" --output-format json --max-turns 5 \
1212
+ --allowedTools "Read,Glob,Grep" $SESSION_FLAG 2>/dev/null
1213
+ ;;
1214
+ gemini)
1215
+ gemini -p "$PROMPT" --output-format json $SESSION_FLAG 2>/dev/null
1216
+ ;;
1217
+ codex)
1218
+ codex -q --json "$PROMPT" 2>/dev/null
1219
+ ;;
1220
+ *)
1221
+ echo '{"error":"Unknown tool: '"$TOOL"'"}' >&2
1222
+ exit 1
1223
+ ;;
1224
+ esac
1225
+ ```
1226
+
1227
+ Then from any AI session:
1228
+
1229
+ ```bash
1230
+ # Get Claude's opinion
1231
+ ./consult.sh claude "What's wrong with the error handling in src/api.ts?"
1232
+
1233
+ # Get Gemini's opinion on the same thing
1234
+ ./consult.sh gemini "What's wrong with the error handling in src/api.ts?"
1235
+
1236
+ # Continue a Claude conversation
1237
+ ./consult.sh claude "What about the retry logic?" --continue "$SESSION_ID"
1238
+ ```
1239
+
1240
+ ### Important Caveats for Cross-Session Calls
1241
+
1242
+ | Caveat | Details |
1243
+ |--------|---------|
1244
+ | **Working directory** | The called tool runs in the same cwd as the calling session's Bash tool |
1245
+ | **Timeouts** | Set generous timeouts; AI calls can take 30-120+ seconds |
1246
+ | **Nested permissions** | The called tool needs its own permission handling (`--permission-mode bypassPermissions` for non-interactive) |
1247
+ | **API keys** | Each tool needs its own API key set in the environment |
1248
+ | **Cost stacking** | You pay for both the calling session AND the consulted tool |
1249
+ | **Context isolation** | The called tool has no knowledge of the calling session's conversation |
1250
+ | **Output parsing** | Always use `--output-format json` and parse with `jq` for reliability |
1251
+ | **Background vs foreground** | Calls block the calling session until complete; use `&` for parallel |
1252
+
1253
+ ### Cost-Efficient Cross-Consultation Strategy
1254
+
1255
+ ```bash
1256
+ # Triage with cheap model first, escalate if needed
1257
+ TRIAGE=$(claude -p "Quick assessment: is this code safe?" \
1258
+ --model haiku --max-turns 1 --output-format json | jq -r '.result')
1259
+
1260
+ if echo "$TRIAGE" | grep -qi "concern\|issue\|vulnerability"; then
1261
+ # Escalate to thorough review with multiple tools
1262
+ claude -p "Deep security review of this code" \
1263
+ --model opus --max-turns 10 --output-format json | jq -r '.result'
1264
+ gemini -p "Security audit this codebase" \
1265
+ --output-format json | jq -r '.response'
1266
+ fi
1267
+ ```
1268
+
1269
+ ---
1270
+
1271
+ ## Production Deployment Patterns
1272
+
1273
+ ### Pattern 1: Ephemeral (One-Shot)
1274
+
1275
+ Best for CI/CD pipelines, code review, linting.
1276
+
1277
+ ```bash
1278
+ # GitHub Actions example
1279
+ - name: AI Code Review
1280
+ run: |
1281
+ claude -p "Review this PR for security issues" \
1282
+ --output-format json \
1283
+ --max-turns 5 \
1284
+ --max-budget-usd 1.00 \
1285
+ --allowedTools "Read,Glob,Grep" \
1286
+ --no-session-persistence \
1287
+ | jq -r '.result' > review.md
1288
+ ```
1289
+
1290
+ ### Pattern 2: Long-Running Session
1291
+
1292
+ Best for multi-step workflows, research tasks.
1293
+
1294
+ ```python
1295
+ # Python: session-based workflow
1296
+ session = None
1297
+ for step in workflow_steps:
1298
+ response = await ask_claude(step.prompt, session_id=session)
1299
+ session = response["session_id"]
1300
+ step.handle_result(response)
1301
+ ```
1302
+
1303
+ ### Pattern 3: GitHub Actions (Claude Code Action)
1304
+
1305
+ Best for automated PR review, issue triage, and CI-triggered code changes.
1306
+
1307
+ ```yaml
1308
+ # .github/workflows/claude.yml
1309
+ name: Claude Code
1310
+ on:
1311
+ issue_comment:
1312
+ types: [created]
1313
+ pull_request_review_comment:
1314
+ types: [created]
1315
+ jobs:
1316
+ claude:
1317
+ runs-on: ubuntu-latest
1318
+ steps:
1319
+ - uses: anthropics/claude-code-action@v1
1320
+ with:
1321
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
1322
+ # Responds to @claude mentions in comments
1323
+ ```
1324
+
1325
+ **Automated code review on PR open:**
1326
+
1327
+ ```yaml
1328
+ name: Code Review
1329
+ on:
1330
+ pull_request:
1331
+ types: [opened, synchronize]
1332
+ jobs:
1333
+ review:
1334
+ runs-on: ubuntu-latest
1335
+ steps:
1336
+ - uses: anthropics/claude-code-action@v1
1337
+ with:
1338
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
1339
+ prompt: "/review"
1340
+ claude_args: "--max-turns 5 --model claude-sonnet-4-5-20250929"
1341
+ ```
1342
+
1343
+ **Custom automation (e.g., daily report):**
1344
+
1345
+ ```yaml
1346
+ name: Daily Report
1347
+ on:
1348
+ schedule:
1349
+ - cron: "0 9 * * *"
1350
+ jobs:
1351
+ report:
1352
+ runs-on: ubuntu-latest
1353
+ steps:
1354
+ - uses: anthropics/claude-code-action@v1
1355
+ with:
1356
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
1357
+ prompt: "Generate a summary of yesterday's commits and open issues"
1358
+ claude_args: "--model opus"
1359
+ ```
1360
+
1361
+ ### Pattern 4: Containerized Agent (Agent SDK)
1362
+
1363
+ Best for production automation. See the Agent SDK hosting documentation for Docker, Cloud, and sandbox provider options (Modal, Cloudflare, E2B, Fly.io, Vercel).
1364
+
1365
+ Resource requirements per SDK instance: 1GiB RAM, 5GiB disk, 1 CPU minimum.
1366
+
1367
+ ---
1368
+
1369
+ ## Further Reading
1370
+
1371
+ | Resource | Type | Why Recommended |
1372
+ |----------|------|-----------------|
1373
+ | [Claude Code CLI Reference](https://code.claude.com/docs/en/cli-reference) | Official Docs | Complete flag reference for Claude Code |
1374
+ | [Claude Agent SDK Overview](https://platform.claude.com/docs/en/agent-sdk/overview) | Official Docs | Programmatic Python/TypeScript SDK |
1375
+ | [Agent SDK Structured Outputs](https://platform.claude.com/docs/en/agent-sdk/structured-outputs) | Official Docs | JSON Schema validation for typed responses |
1376
+ | [Agent SDK Sessions](https://platform.claude.com/docs/en/agent-sdk/sessions) | Official Docs | Session management and forking |
1377
+ | [Agent SDK Streaming](https://platform.claude.com/docs/en/agent-sdk/streaming-output) | Official Docs | Real-time streaming patterns |
1378
+ | [Agent SDK Hosting](https://platform.claude.com/docs/en/agent-sdk/hosting) | Official Docs | Production deployment patterns |
1379
+ | [Claude Code Headless Mode](https://code.claude.com/docs/en/headless) | Official Docs | Non-interactive usage guide |
1380
+ | [Claude Code Sub-agents](https://code.claude.com/docs/en/sub-agents) | Official Docs | Custom subagents and the --agents flag |
1381
+ | [Claude Code GitHub Actions](https://code.claude.com/docs/en/github-actions) | Official Docs | CI/CD integration with claude-code-action |
1382
+ | [Claude Code Common Workflows](https://code.claude.com/docs/en/common-workflows) | Official Docs | Practical workflow patterns |
1383
+ | [Gemini CLI Headless Mode](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/headless.md) | Official Docs | Non-interactive Gemini usage |
1384
+ | [Gemini CLI Reference](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/cli-reference.md) | Official Docs | Complete Gemini CLI flags |
1385
+ | [Gemini CLI Sessions](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/session-management.md) | Official Docs | Session persistence and resumption |
1386
+ | [Gemini CLI Settings](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/settings.md) | Official Docs | Configuration for automation |
1387
+ | [Codex CLI README](https://github.com/openai/codex/blob/main/codex-cli/README.md) | Official Docs | Codex CLI usage and flags |
1388
+ | [Codex CLI Repository](https://github.com/openai/codex) | Repository | Source code and documentation |
1389
+ | [OpenCode Repository](https://github.com/opencode-ai/opencode) | Repository | Archived reference (successor: Crush) |
1390
+
1391
+ ---
1392
+
1393
+ *Generated by /learn from 52 sources (2 research rounds).*
1394
+ *See `resources/ai-cli-non-interactive-programmatic-usage-sources.json` for full source metadata.*