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.
- package/.agnix.toml +49 -0
- package/.claude-plugin/marketplace.json +110 -0
- package/.claude-plugin/plugin.json +20 -0
- package/AGENTS.md +260 -0
- package/CHANGELOG.md +190 -0
- package/LICENSE +21 -0
- package/README.md +916 -0
- package/SECURITY.md +45 -0
- package/adapters/README.md +258 -0
- package/adapters/codex/README.md +273 -0
- package/adapters/codex/install.sh +260 -0
- package/adapters/codex/skills/agnix/SKILL.md +138 -0
- package/adapters/codex/skills/audit-project/SKILL.md +334 -0
- package/adapters/codex/skills/audit-project-agents/SKILL.md +459 -0
- package/adapters/codex/skills/audit-project-github/SKILL.md +146 -0
- package/adapters/codex/skills/consult/SKILL.md +245 -0
- package/adapters/codex/skills/delivery-approval/SKILL.md +339 -0
- package/adapters/codex/skills/deslop/SKILL.md +167 -0
- package/adapters/codex/skills/drift-detect/SKILL.md +268 -0
- package/adapters/codex/skills/enhance/SKILL.md +177 -0
- package/adapters/codex/skills/learn/SKILL.md +188 -0
- package/adapters/codex/skills/next-task/SKILL.md +546 -0
- package/adapters/codex/skills/perf/SKILL.md +469 -0
- package/adapters/codex/skills/repo-map/SKILL.md +132 -0
- package/adapters/codex/skills/ship/SKILL.md +491 -0
- package/adapters/codex/skills/ship-ci-review-loop/SKILL.md +473 -0
- package/adapters/codex/skills/ship-deployment/SKILL.md +336 -0
- package/adapters/codex/skills/ship-error-handling/SKILL.md +260 -0
- package/adapters/codex/skills/sync-docs/SKILL.md +186 -0
- package/adapters/opencode/README.md +302 -0
- package/adapters/opencode/agents/agent-enhancer.md +65 -0
- package/adapters/opencode/agents/agnix-agent.md +56 -0
- package/adapters/opencode/agents/ci-fixer.md +104 -0
- package/adapters/opencode/agents/ci-monitor.md +127 -0
- package/adapters/opencode/agents/claudemd-enhancer.md +66 -0
- package/adapters/opencode/agents/consult-agent.md +124 -0
- package/adapters/opencode/agents/cross-file-enhancer.md +54 -0
- package/adapters/opencode/agents/delivery-validator.md +115 -0
- package/adapters/opencode/agents/deslop-agent.md +88 -0
- package/adapters/opencode/agents/docs-enhancer.md +65 -0
- package/adapters/opencode/agents/exploration-agent.md +143 -0
- package/adapters/opencode/agents/hooks-enhancer.md +66 -0
- package/adapters/opencode/agents/implementation-agent.md +206 -0
- package/adapters/opencode/agents/learn-agent.md +279 -0
- package/adapters/opencode/agents/map-validator.md +65 -0
- package/adapters/opencode/agents/perf-analyzer.md +40 -0
- package/adapters/opencode/agents/perf-code-paths.md +12 -0
- package/adapters/opencode/agents/perf-investigation-logger.md +44 -0
- package/adapters/opencode/agents/perf-orchestrator.md +147 -0
- package/adapters/opencode/agents/perf-theory-gatherer.md +18 -0
- package/adapters/opencode/agents/perf-theory-tester.md +43 -0
- package/adapters/opencode/agents/plan-synthesizer.md +229 -0
- package/adapters/opencode/agents/planning-agent.md +235 -0
- package/adapters/opencode/agents/plugin-enhancer.md +64 -0
- package/adapters/opencode/agents/prompt-enhancer.md +58 -0
- package/adapters/opencode/agents/simple-fixer.md +107 -0
- package/adapters/opencode/agents/skills-enhancer.md +66 -0
- package/adapters/opencode/agents/sync-docs-agent.md +153 -0
- package/adapters/opencode/agents/task-discoverer.md +80 -0
- package/adapters/opencode/agents/test-coverage-checker.md +144 -0
- package/adapters/opencode/agents/worktree-manager.md +209 -0
- package/adapters/opencode/commands/agnix.md +106 -0
- package/adapters/opencode/commands/audit-project-agents.md +125 -0
- package/adapters/opencode/commands/audit-project-github.md +145 -0
- package/adapters/opencode/commands/audit-project.md +268 -0
- package/adapters/opencode/commands/consult.md +252 -0
- package/adapters/opencode/commands/delivery-approval.md +212 -0
- package/adapters/opencode/commands/deslop.md +132 -0
- package/adapters/opencode/commands/drift-detect.md +173 -0
- package/adapters/opencode/commands/enhance.md +183 -0
- package/adapters/opencode/commands/learn.md +116 -0
- package/adapters/opencode/commands/next-task.md +393 -0
- package/adapters/opencode/commands/perf.md +49 -0
- package/adapters/opencode/commands/repo-map.md +69 -0
- package/adapters/opencode/commands/ship-ci-review-loop.md +334 -0
- package/adapters/opencode/commands/ship-deployment.md +336 -0
- package/adapters/opencode/commands/ship-error-handling.md +248 -0
- package/adapters/opencode/commands/ship.md +371 -0
- package/adapters/opencode/commands/sync-docs.md +108 -0
- package/adapters/opencode/install.sh +322 -0
- package/adapters/opencode/skills/agnix/SKILL.md +139 -0
- package/adapters/opencode/skills/consult/SKILL.md +292 -0
- package/adapters/opencode/skills/deslop/SKILL.md +169 -0
- package/adapters/opencode/skills/discover-tasks/SKILL.md +102 -0
- package/adapters/opencode/skills/drift-analysis/SKILL.md +279 -0
- package/adapters/opencode/skills/enhance-agent-prompts/SKILL.md +279 -0
- package/adapters/opencode/skills/enhance-claude-memory/SKILL.md +390 -0
- package/adapters/opencode/skills/enhance-cross-file/SKILL.md +112 -0
- package/adapters/opencode/skills/enhance-docs/SKILL.md +288 -0
- package/adapters/opencode/skills/enhance-hooks/SKILL.md +557 -0
- package/adapters/opencode/skills/enhance-orchestrator/SKILL.md +114 -0
- package/adapters/opencode/skills/enhance-plugins/SKILL.md +314 -0
- package/adapters/opencode/skills/enhance-prompts/SKILL.md +341 -0
- package/adapters/opencode/skills/enhance-skills/SKILL.md +443 -0
- package/adapters/opencode/skills/learn/SKILL.md +352 -0
- package/adapters/opencode/skills/orchestrate-review/SKILL.md +95 -0
- package/adapters/opencode/skills/perf-analyzer/SKILL.md +38 -0
- package/adapters/opencode/skills/perf-baseline-manager/SKILL.md +31 -0
- package/adapters/opencode/skills/perf-benchmarker/SKILL.md +49 -0
- package/adapters/opencode/skills/perf-code-paths/SKILL.md +33 -0
- package/adapters/opencode/skills/perf-investigation-logger/SKILL.md +42 -0
- package/adapters/opencode/skills/perf-profiler/SKILL.md +39 -0
- package/adapters/opencode/skills/perf-theory-gatherer/SKILL.md +36 -0
- package/adapters/opencode/skills/perf-theory-tester/SKILL.md +37 -0
- package/adapters/opencode/skills/repo-mapping/SKILL.md +86 -0
- package/adapters/opencode/skills/sync-docs/SKILL.md +246 -0
- package/adapters/opencode/skills/validate-delivery/SKILL.md +112 -0
- package/adapters/opencode-plugin/index.ts +346 -0
- package/adapters/opencode-plugin/package.json +21 -0
- package/agent-knowledge/AGENTS.md +62 -0
- package/agent-knowledge/ai-cli-advanced-integration-patterns.md +670 -0
- package/agent-knowledge/ai-cli-non-interactive-programmatic-usage.md +1394 -0
- package/agent-knowledge/resources/ai-cli-non-interactive-programmatic-usage-sources.json +500 -0
- package/bin/cli.js +719 -0
- package/bin/dev-cli.js +587 -0
- package/lib/adapter-transforms.js +278 -0
- package/lib/collectors/codebase.js +392 -0
- package/lib/collectors/docs-patterns.js +713 -0
- package/lib/collectors/documentation.js +219 -0
- package/lib/collectors/github.js +266 -0
- package/lib/collectors/index.js +126 -0
- package/lib/config/index.js +14 -0
- package/lib/cross-platform/index.js +539 -0
- package/lib/discovery/index.js +352 -0
- package/lib/drift-detect/collectors.js +37 -0
- package/lib/enhance/agent-analyzer.js +421 -0
- package/lib/enhance/agent-patterns.js +571 -0
- package/lib/enhance/auto-suppression.js +622 -0
- package/lib/enhance/benchmark.js +417 -0
- package/lib/enhance/cross-file-analyzer.js +930 -0
- package/lib/enhance/cross-file-patterns.js +370 -0
- package/lib/enhance/docs-analyzer.js +325 -0
- package/lib/enhance/docs-patterns.js +671 -0
- package/lib/enhance/fixer.js +721 -0
- package/lib/enhance/hook-analyzer.js +135 -0
- package/lib/enhance/hook-patterns.js +40 -0
- package/lib/enhance/index.js +127 -0
- package/lib/enhance/plugin-analyzer.js +402 -0
- package/lib/enhance/plugin-patterns.js +326 -0
- package/lib/enhance/projectmemory-analyzer.js +551 -0
- package/lib/enhance/projectmemory-patterns.js +617 -0
- package/lib/enhance/prompt-analyzer.js +457 -0
- package/lib/enhance/prompt-patterns.js +1484 -0
- package/lib/enhance/reporter.js +1348 -0
- package/lib/enhance/security-patterns.js +284 -0
- package/lib/enhance/skill-analyzer.js +182 -0
- package/lib/enhance/skill-patterns.js +147 -0
- package/lib/enhance/suppression.js +352 -0
- package/lib/enhance/tool-patterns.js +373 -0
- package/lib/index.js +270 -0
- package/lib/package.json +25 -0
- package/lib/patterns/cli-enhancers.js +611 -0
- package/lib/patterns/pipeline.js +948 -0
- package/lib/patterns/review-patterns.js +558 -0
- package/lib/patterns/slop-analyzers.js +2305 -0
- package/lib/patterns/slop-patterns.js +1187 -0
- package/lib/perf/analyzer/index.js +22 -0
- package/lib/perf/argument-parser.js +105 -0
- package/lib/perf/baseline-comparator.js +50 -0
- package/lib/perf/baseline-store.js +127 -0
- package/lib/perf/benchmark-runner.js +399 -0
- package/lib/perf/breaking-point-finder.js +52 -0
- package/lib/perf/breaking-point-runner.js +60 -0
- package/lib/perf/checkpoint.js +123 -0
- package/lib/perf/code-paths.js +86 -0
- package/lib/perf/consolidation.js +37 -0
- package/lib/perf/constraint-runner.js +71 -0
- package/lib/perf/experiment-runner.js +32 -0
- package/lib/perf/index.js +41 -0
- package/lib/perf/investigation-state.js +875 -0
- package/lib/perf/optimization-runner.js +79 -0
- package/lib/perf/profilers/go.js +22 -0
- package/lib/perf/profilers/index.js +46 -0
- package/lib/perf/profilers/java.js +23 -0
- package/lib/perf/profilers/node.js +27 -0
- package/lib/perf/profilers/python.js +23 -0
- package/lib/perf/profilers/rust.js +23 -0
- package/lib/perf/profiling-runner.js +56 -0
- package/lib/perf/schemas.js +140 -0
- package/lib/platform/detect-platform.js +413 -0
- package/lib/platform/detection-configs.js +93 -0
- package/lib/platform/state-dir.js +132 -0
- package/lib/platform/verify-tools.js +182 -0
- package/lib/repo-map/cache.js +152 -0
- package/lib/repo-map/index.js +222 -0
- package/lib/repo-map/installer.js +212 -0
- package/lib/repo-map/queries/go.js +27 -0
- package/lib/repo-map/queries/index.js +100 -0
- package/lib/repo-map/queries/java.js +38 -0
- package/lib/repo-map/queries/javascript.js +55 -0
- package/lib/repo-map/queries/python.js +24 -0
- package/lib/repo-map/queries/rust.js +73 -0
- package/lib/repo-map/queries/typescript.js +38 -0
- package/lib/repo-map/runner.js +1165 -0
- package/lib/repo-map/updater.js +474 -0
- package/lib/repo-map/usage-analyzer.js +407 -0
- package/lib/schemas/plugin-manifest.schema.json +57 -0
- package/lib/schemas/validator.js +247 -0
- package/lib/sources/custom-handler.js +199 -0
- package/lib/sources/policy-questions.js +246 -0
- package/lib/sources/source-cache.js +165 -0
- package/lib/state/workflow-state.js +575 -0
- package/lib/types/agent-frontmatter.d.ts +134 -0
- package/lib/types/command-frontmatter.d.ts +107 -0
- package/lib/types/hook-frontmatter.d.ts +115 -0
- package/lib/types/index.d.ts +84 -0
- package/lib/types/plugin-manifest.d.ts +102 -0
- package/lib/types/skill-frontmatter.d.ts +89 -0
- package/lib/utils/atomic-write.js +94 -0
- package/lib/utils/cache-manager.js +159 -0
- package/lib/utils/context-optimizer.js +300 -0
- package/lib/utils/deprecation.js +37 -0
- package/lib/utils/shell-escape.js +88 -0
- package/meta/skills/maintain-cross-platform/SKILL.md +1022 -0
- package/package.json +92 -0
- package/plugins/agnix/.claude-plugin/plugin.json +22 -0
- package/plugins/agnix/agents/agnix-agent.md +56 -0
- package/plugins/agnix/commands/agnix.md +139 -0
- package/plugins/agnix/skills/agnix/SKILL.md +138 -0
- package/plugins/audit-project/.claude-plugin/plugin.json +20 -0
- package/plugins/audit-project/commands/audit-project-agents.md +458 -0
- package/plugins/audit-project/commands/audit-project-github.md +144 -0
- package/plugins/audit-project/commands/audit-project.md +336 -0
- package/plugins/audit-project/lib/adapter-transforms.js +278 -0
- package/plugins/audit-project/lib/collectors/codebase.js +392 -0
- package/plugins/audit-project/lib/collectors/docs-patterns.js +713 -0
- package/plugins/audit-project/lib/collectors/documentation.js +219 -0
- package/plugins/audit-project/lib/collectors/github.js +266 -0
- package/plugins/audit-project/lib/collectors/index.js +126 -0
- package/plugins/audit-project/lib/config/index.js +14 -0
- package/plugins/audit-project/lib/cross-platform/index.js +539 -0
- package/plugins/audit-project/lib/discovery/index.js +352 -0
- package/plugins/audit-project/lib/drift-detect/collectors.js +37 -0
- package/plugins/audit-project/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/audit-project/lib/enhance/agent-patterns.js +571 -0
- package/plugins/audit-project/lib/enhance/auto-suppression.js +622 -0
- package/plugins/audit-project/lib/enhance/benchmark.js +417 -0
- package/plugins/audit-project/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/audit-project/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/audit-project/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/audit-project/lib/enhance/docs-patterns.js +671 -0
- package/plugins/audit-project/lib/enhance/fixer.js +721 -0
- package/plugins/audit-project/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/audit-project/lib/enhance/hook-patterns.js +40 -0
- package/plugins/audit-project/lib/enhance/index.js +127 -0
- package/plugins/audit-project/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/audit-project/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/audit-project/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/audit-project/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/audit-project/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/audit-project/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/audit-project/lib/enhance/reporter.js +1348 -0
- package/plugins/audit-project/lib/enhance/security-patterns.js +284 -0
- package/plugins/audit-project/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/audit-project/lib/enhance/skill-patterns.js +147 -0
- package/plugins/audit-project/lib/enhance/suppression.js +352 -0
- package/plugins/audit-project/lib/enhance/tool-patterns.js +373 -0
- package/plugins/audit-project/lib/index.js +270 -0
- package/plugins/audit-project/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/audit-project/lib/patterns/pipeline.js +948 -0
- package/plugins/audit-project/lib/patterns/review-patterns.js +558 -0
- package/plugins/audit-project/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/audit-project/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/audit-project/lib/perf/analyzer/index.js +22 -0
- package/plugins/audit-project/lib/perf/argument-parser.js +105 -0
- package/plugins/audit-project/lib/perf/baseline-comparator.js +50 -0
- package/plugins/audit-project/lib/perf/baseline-store.js +127 -0
- package/plugins/audit-project/lib/perf/benchmark-runner.js +399 -0
- package/plugins/audit-project/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/audit-project/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/audit-project/lib/perf/checkpoint.js +123 -0
- package/plugins/audit-project/lib/perf/code-paths.js +86 -0
- package/plugins/audit-project/lib/perf/consolidation.js +37 -0
- package/plugins/audit-project/lib/perf/constraint-runner.js +71 -0
- package/plugins/audit-project/lib/perf/experiment-runner.js +32 -0
- package/plugins/audit-project/lib/perf/index.js +41 -0
- package/plugins/audit-project/lib/perf/investigation-state.js +875 -0
- package/plugins/audit-project/lib/perf/optimization-runner.js +79 -0
- package/plugins/audit-project/lib/perf/profilers/go.js +22 -0
- package/plugins/audit-project/lib/perf/profilers/index.js +46 -0
- package/plugins/audit-project/lib/perf/profilers/java.js +23 -0
- package/plugins/audit-project/lib/perf/profilers/node.js +27 -0
- package/plugins/audit-project/lib/perf/profilers/python.js +23 -0
- package/plugins/audit-project/lib/perf/profilers/rust.js +23 -0
- package/plugins/audit-project/lib/perf/profiling-runner.js +56 -0
- package/plugins/audit-project/lib/perf/schemas.js +140 -0
- package/plugins/audit-project/lib/platform/detect-platform.js +413 -0
- package/plugins/audit-project/lib/platform/detection-configs.js +93 -0
- package/plugins/audit-project/lib/platform/state-dir.js +132 -0
- package/plugins/audit-project/lib/platform/verify-tools.js +182 -0
- package/plugins/audit-project/lib/repo-map/cache.js +152 -0
- package/plugins/audit-project/lib/repo-map/index.js +222 -0
- package/plugins/audit-project/lib/repo-map/installer.js +212 -0
- package/plugins/audit-project/lib/repo-map/queries/go.js +27 -0
- package/plugins/audit-project/lib/repo-map/queries/index.js +100 -0
- package/plugins/audit-project/lib/repo-map/queries/java.js +38 -0
- package/plugins/audit-project/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/audit-project/lib/repo-map/queries/python.js +24 -0
- package/plugins/audit-project/lib/repo-map/queries/rust.js +73 -0
- package/plugins/audit-project/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/audit-project/lib/repo-map/runner.js +1165 -0
- package/plugins/audit-project/lib/repo-map/updater.js +474 -0
- package/plugins/audit-project/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/audit-project/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/audit-project/lib/schemas/validator.js +247 -0
- package/plugins/audit-project/lib/sources/custom-handler.js +199 -0
- package/plugins/audit-project/lib/sources/policy-questions.js +246 -0
- package/plugins/audit-project/lib/sources/source-cache.js +165 -0
- package/plugins/audit-project/lib/state/workflow-state.js +575 -0
- package/plugins/audit-project/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/audit-project/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/audit-project/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/audit-project/lib/types/index.d.ts +84 -0
- package/plugins/audit-project/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/audit-project/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/audit-project/lib/utils/atomic-write.js +94 -0
- package/plugins/audit-project/lib/utils/cache-manager.js +159 -0
- package/plugins/audit-project/lib/utils/context-optimizer.js +300 -0
- package/plugins/audit-project/lib/utils/deprecation.js +37 -0
- package/plugins/audit-project/lib/utils/shell-escape.js +88 -0
- package/plugins/consult/.claude-plugin/plugin.json +24 -0
- package/plugins/consult/agents/consult-agent.md +129 -0
- package/plugins/consult/commands/consult.md +248 -0
- package/plugins/consult/skills/consult/SKILL.md +285 -0
- package/plugins/deslop/.claude-plugin/plugin.json +20 -0
- package/plugins/deslop/agents/deslop-agent.md +88 -0
- package/plugins/deslop/commands/deslop.md +168 -0
- package/plugins/deslop/lib/adapter-transforms.js +278 -0
- package/plugins/deslop/lib/collectors/codebase.js +392 -0
- package/plugins/deslop/lib/collectors/docs-patterns.js +713 -0
- package/plugins/deslop/lib/collectors/documentation.js +219 -0
- package/plugins/deslop/lib/collectors/github.js +266 -0
- package/plugins/deslop/lib/collectors/index.js +126 -0
- package/plugins/deslop/lib/config/index.js +14 -0
- package/plugins/deslop/lib/cross-platform/index.js +539 -0
- package/plugins/deslop/lib/discovery/index.js +352 -0
- package/plugins/deslop/lib/drift-detect/collectors.js +37 -0
- package/plugins/deslop/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/deslop/lib/enhance/agent-patterns.js +571 -0
- package/plugins/deslop/lib/enhance/auto-suppression.js +622 -0
- package/plugins/deslop/lib/enhance/benchmark.js +417 -0
- package/plugins/deslop/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/deslop/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/deslop/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/deslop/lib/enhance/docs-patterns.js +671 -0
- package/plugins/deslop/lib/enhance/fixer.js +721 -0
- package/plugins/deslop/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/deslop/lib/enhance/hook-patterns.js +40 -0
- package/plugins/deslop/lib/enhance/index.js +127 -0
- package/plugins/deslop/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/deslop/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/deslop/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/deslop/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/deslop/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/deslop/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/deslop/lib/enhance/reporter.js +1348 -0
- package/plugins/deslop/lib/enhance/security-patterns.js +284 -0
- package/plugins/deslop/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/deslop/lib/enhance/skill-patterns.js +147 -0
- package/plugins/deslop/lib/enhance/suppression.js +352 -0
- package/plugins/deslop/lib/enhance/tool-patterns.js +373 -0
- package/plugins/deslop/lib/index.js +270 -0
- package/plugins/deslop/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/deslop/lib/patterns/pipeline.js +948 -0
- package/plugins/deslop/lib/patterns/review-patterns.js +558 -0
- package/plugins/deslop/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/deslop/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/deslop/lib/perf/analyzer/index.js +22 -0
- package/plugins/deslop/lib/perf/argument-parser.js +105 -0
- package/plugins/deslop/lib/perf/baseline-comparator.js +50 -0
- package/plugins/deslop/lib/perf/baseline-store.js +127 -0
- package/plugins/deslop/lib/perf/benchmark-runner.js +399 -0
- package/plugins/deslop/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/deslop/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/deslop/lib/perf/checkpoint.js +123 -0
- package/plugins/deslop/lib/perf/code-paths.js +86 -0
- package/plugins/deslop/lib/perf/consolidation.js +37 -0
- package/plugins/deslop/lib/perf/constraint-runner.js +71 -0
- package/plugins/deslop/lib/perf/experiment-runner.js +32 -0
- package/plugins/deslop/lib/perf/index.js +41 -0
- package/plugins/deslop/lib/perf/investigation-state.js +875 -0
- package/plugins/deslop/lib/perf/optimization-runner.js +79 -0
- package/plugins/deslop/lib/perf/profilers/go.js +22 -0
- package/plugins/deslop/lib/perf/profilers/index.js +46 -0
- package/plugins/deslop/lib/perf/profilers/java.js +23 -0
- package/plugins/deslop/lib/perf/profilers/node.js +27 -0
- package/plugins/deslop/lib/perf/profilers/python.js +23 -0
- package/plugins/deslop/lib/perf/profilers/rust.js +23 -0
- package/plugins/deslop/lib/perf/profiling-runner.js +56 -0
- package/plugins/deslop/lib/perf/schemas.js +140 -0
- package/plugins/deslop/lib/platform/detect-platform.js +413 -0
- package/plugins/deslop/lib/platform/detection-configs.js +93 -0
- package/plugins/deslop/lib/platform/state-dir.js +132 -0
- package/plugins/deslop/lib/platform/verify-tools.js +182 -0
- package/plugins/deslop/lib/repo-map/cache.js +152 -0
- package/plugins/deslop/lib/repo-map/index.js +222 -0
- package/plugins/deslop/lib/repo-map/installer.js +212 -0
- package/plugins/deslop/lib/repo-map/queries/go.js +27 -0
- package/plugins/deslop/lib/repo-map/queries/index.js +100 -0
- package/plugins/deslop/lib/repo-map/queries/java.js +38 -0
- package/plugins/deslop/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/deslop/lib/repo-map/queries/python.js +24 -0
- package/plugins/deslop/lib/repo-map/queries/rust.js +73 -0
- package/plugins/deslop/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/deslop/lib/repo-map/runner.js +1165 -0
- package/plugins/deslop/lib/repo-map/updater.js +474 -0
- package/plugins/deslop/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/deslop/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/deslop/lib/schemas/validator.js +247 -0
- package/plugins/deslop/lib/sources/custom-handler.js +199 -0
- package/plugins/deslop/lib/sources/policy-questions.js +246 -0
- package/plugins/deslop/lib/sources/source-cache.js +165 -0
- package/plugins/deslop/lib/state/workflow-state.js +575 -0
- package/plugins/deslop/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/deslop/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/deslop/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/deslop/lib/types/index.d.ts +84 -0
- package/plugins/deslop/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/deslop/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/deslop/lib/utils/atomic-write.js +94 -0
- package/plugins/deslop/lib/utils/cache-manager.js +159 -0
- package/plugins/deslop/lib/utils/context-optimizer.js +300 -0
- package/plugins/deslop/lib/utils/deprecation.js +37 -0
- package/plugins/deslop/lib/utils/shell-escape.js +88 -0
- package/plugins/deslop/references/slop-categories.md +122 -0
- package/plugins/deslop/scripts/detect.js +134 -0
- package/plugins/deslop/skills/deslop/SKILL.md +204 -0
- package/plugins/drift-detect/.claude-plugin/plugin.json +23 -0
- package/plugins/drift-detect/agents/plan-synthesizer.md +225 -0
- package/plugins/drift-detect/commands/drift-detect.md +269 -0
- package/plugins/drift-detect/lib/adapter-transforms.js +278 -0
- package/plugins/drift-detect/lib/collectors/codebase.js +392 -0
- package/plugins/drift-detect/lib/collectors/docs-patterns.js +713 -0
- package/plugins/drift-detect/lib/collectors/documentation.js +219 -0
- package/plugins/drift-detect/lib/collectors/github.js +266 -0
- package/plugins/drift-detect/lib/collectors/index.js +126 -0
- package/plugins/drift-detect/lib/config/index.js +14 -0
- package/plugins/drift-detect/lib/cross-platform/index.js +539 -0
- package/plugins/drift-detect/lib/discovery/index.js +352 -0
- package/plugins/drift-detect/lib/drift-detect/collectors.js +37 -0
- package/plugins/drift-detect/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/drift-detect/lib/enhance/agent-patterns.js +571 -0
- package/plugins/drift-detect/lib/enhance/auto-suppression.js +622 -0
- package/plugins/drift-detect/lib/enhance/benchmark.js +417 -0
- package/plugins/drift-detect/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/drift-detect/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/drift-detect/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/drift-detect/lib/enhance/docs-patterns.js +671 -0
- package/plugins/drift-detect/lib/enhance/fixer.js +721 -0
- package/plugins/drift-detect/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/drift-detect/lib/enhance/hook-patterns.js +40 -0
- package/plugins/drift-detect/lib/enhance/index.js +127 -0
- package/plugins/drift-detect/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/drift-detect/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/drift-detect/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/drift-detect/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/drift-detect/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/drift-detect/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/drift-detect/lib/enhance/reporter.js +1348 -0
- package/plugins/drift-detect/lib/enhance/security-patterns.js +284 -0
- package/plugins/drift-detect/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/drift-detect/lib/enhance/skill-patterns.js +147 -0
- package/plugins/drift-detect/lib/enhance/suppression.js +352 -0
- package/plugins/drift-detect/lib/enhance/tool-patterns.js +373 -0
- package/plugins/drift-detect/lib/index.js +270 -0
- package/plugins/drift-detect/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/drift-detect/lib/patterns/pipeline.js +948 -0
- package/plugins/drift-detect/lib/patterns/review-patterns.js +558 -0
- package/plugins/drift-detect/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/drift-detect/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/drift-detect/lib/perf/analyzer/index.js +22 -0
- package/plugins/drift-detect/lib/perf/argument-parser.js +105 -0
- package/plugins/drift-detect/lib/perf/baseline-comparator.js +50 -0
- package/plugins/drift-detect/lib/perf/baseline-store.js +127 -0
- package/plugins/drift-detect/lib/perf/benchmark-runner.js +399 -0
- package/plugins/drift-detect/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/drift-detect/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/drift-detect/lib/perf/checkpoint.js +123 -0
- package/plugins/drift-detect/lib/perf/code-paths.js +86 -0
- package/plugins/drift-detect/lib/perf/consolidation.js +37 -0
- package/plugins/drift-detect/lib/perf/constraint-runner.js +71 -0
- package/plugins/drift-detect/lib/perf/experiment-runner.js +32 -0
- package/plugins/drift-detect/lib/perf/index.js +41 -0
- package/plugins/drift-detect/lib/perf/investigation-state.js +875 -0
- package/plugins/drift-detect/lib/perf/optimization-runner.js +79 -0
- package/plugins/drift-detect/lib/perf/profilers/go.js +22 -0
- package/plugins/drift-detect/lib/perf/profilers/index.js +46 -0
- package/plugins/drift-detect/lib/perf/profilers/java.js +23 -0
- package/plugins/drift-detect/lib/perf/profilers/node.js +27 -0
- package/plugins/drift-detect/lib/perf/profilers/python.js +23 -0
- package/plugins/drift-detect/lib/perf/profilers/rust.js +23 -0
- package/plugins/drift-detect/lib/perf/profiling-runner.js +56 -0
- package/plugins/drift-detect/lib/perf/schemas.js +140 -0
- package/plugins/drift-detect/lib/platform/detect-platform.js +413 -0
- package/plugins/drift-detect/lib/platform/detection-configs.js +93 -0
- package/plugins/drift-detect/lib/platform/state-dir.js +132 -0
- package/plugins/drift-detect/lib/platform/verify-tools.js +182 -0
- package/plugins/drift-detect/lib/repo-map/cache.js +152 -0
- package/plugins/drift-detect/lib/repo-map/index.js +222 -0
- package/plugins/drift-detect/lib/repo-map/installer.js +212 -0
- package/plugins/drift-detect/lib/repo-map/queries/go.js +27 -0
- package/plugins/drift-detect/lib/repo-map/queries/index.js +100 -0
- package/plugins/drift-detect/lib/repo-map/queries/java.js +38 -0
- package/plugins/drift-detect/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/drift-detect/lib/repo-map/queries/python.js +24 -0
- package/plugins/drift-detect/lib/repo-map/queries/rust.js +73 -0
- package/plugins/drift-detect/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/drift-detect/lib/repo-map/runner.js +1165 -0
- package/plugins/drift-detect/lib/repo-map/updater.js +474 -0
- package/plugins/drift-detect/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/drift-detect/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/drift-detect/lib/schemas/validator.js +247 -0
- package/plugins/drift-detect/lib/sources/custom-handler.js +199 -0
- package/plugins/drift-detect/lib/sources/policy-questions.js +246 -0
- package/plugins/drift-detect/lib/sources/source-cache.js +165 -0
- package/plugins/drift-detect/lib/state/workflow-state.js +575 -0
- package/plugins/drift-detect/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/drift-detect/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/drift-detect/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/drift-detect/lib/types/index.d.ts +84 -0
- package/plugins/drift-detect/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/drift-detect/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/drift-detect/lib/utils/atomic-write.js +94 -0
- package/plugins/drift-detect/lib/utils/cache-manager.js +159 -0
- package/plugins/drift-detect/lib/utils/context-optimizer.js +300 -0
- package/plugins/drift-detect/lib/utils/deprecation.js +37 -0
- package/plugins/drift-detect/lib/utils/shell-escape.js +88 -0
- package/plugins/drift-detect/skills/drift-analysis/SKILL.md +324 -0
- package/plugins/enhance/.claude-plugin/plugin.json +20 -0
- package/plugins/enhance/agents/agent-enhancer.md +64 -0
- package/plugins/enhance/agents/claudemd-enhancer.md +65 -0
- package/plugins/enhance/agents/cross-file-enhancer.md +54 -0
- package/plugins/enhance/agents/docs-enhancer.md +64 -0
- package/plugins/enhance/agents/hooks-enhancer.md +64 -0
- package/plugins/enhance/agents/plugin-enhancer.md +63 -0
- package/plugins/enhance/agents/prompt-enhancer.md +58 -0
- package/plugins/enhance/agents/skills-enhancer.md +64 -0
- package/plugins/enhance/commands/enhance.md +178 -0
- package/plugins/enhance/lib/adapter-transforms.js +278 -0
- package/plugins/enhance/lib/collectors/codebase.js +392 -0
- package/plugins/enhance/lib/collectors/docs-patterns.js +713 -0
- package/plugins/enhance/lib/collectors/documentation.js +219 -0
- package/plugins/enhance/lib/collectors/github.js +266 -0
- package/plugins/enhance/lib/collectors/index.js +126 -0
- package/plugins/enhance/lib/config/index.js +14 -0
- package/plugins/enhance/lib/cross-platform/index.js +539 -0
- package/plugins/enhance/lib/discovery/index.js +352 -0
- package/plugins/enhance/lib/drift-detect/collectors.js +37 -0
- package/plugins/enhance/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/enhance/lib/enhance/agent-patterns.js +571 -0
- package/plugins/enhance/lib/enhance/auto-suppression.js +622 -0
- package/plugins/enhance/lib/enhance/benchmark.js +417 -0
- package/plugins/enhance/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/enhance/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/enhance/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/enhance/lib/enhance/docs-patterns.js +671 -0
- package/plugins/enhance/lib/enhance/fixer.js +721 -0
- package/plugins/enhance/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/enhance/lib/enhance/hook-patterns.js +40 -0
- package/plugins/enhance/lib/enhance/index.js +127 -0
- package/plugins/enhance/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/enhance/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/enhance/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/enhance/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/enhance/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/enhance/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/enhance/lib/enhance/reporter.js +1348 -0
- package/plugins/enhance/lib/enhance/security-patterns.js +284 -0
- package/plugins/enhance/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/enhance/lib/enhance/skill-patterns.js +147 -0
- package/plugins/enhance/lib/enhance/suppression.js +352 -0
- package/plugins/enhance/lib/enhance/tool-patterns.js +373 -0
- package/plugins/enhance/lib/index.js +270 -0
- package/plugins/enhance/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/enhance/lib/patterns/pipeline.js +948 -0
- package/plugins/enhance/lib/patterns/review-patterns.js +558 -0
- package/plugins/enhance/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/enhance/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/enhance/lib/perf/analyzer/index.js +22 -0
- package/plugins/enhance/lib/perf/argument-parser.js +105 -0
- package/plugins/enhance/lib/perf/baseline-comparator.js +50 -0
- package/plugins/enhance/lib/perf/baseline-store.js +127 -0
- package/plugins/enhance/lib/perf/benchmark-runner.js +399 -0
- package/plugins/enhance/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/enhance/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/enhance/lib/perf/checkpoint.js +123 -0
- package/plugins/enhance/lib/perf/code-paths.js +86 -0
- package/plugins/enhance/lib/perf/consolidation.js +37 -0
- package/plugins/enhance/lib/perf/constraint-runner.js +71 -0
- package/plugins/enhance/lib/perf/experiment-runner.js +32 -0
- package/plugins/enhance/lib/perf/index.js +41 -0
- package/plugins/enhance/lib/perf/investigation-state.js +875 -0
- package/plugins/enhance/lib/perf/optimization-runner.js +79 -0
- package/plugins/enhance/lib/perf/profilers/go.js +22 -0
- package/plugins/enhance/lib/perf/profilers/index.js +46 -0
- package/plugins/enhance/lib/perf/profilers/java.js +23 -0
- package/plugins/enhance/lib/perf/profilers/node.js +27 -0
- package/plugins/enhance/lib/perf/profilers/python.js +23 -0
- package/plugins/enhance/lib/perf/profilers/rust.js +23 -0
- package/plugins/enhance/lib/perf/profiling-runner.js +56 -0
- package/plugins/enhance/lib/perf/schemas.js +140 -0
- package/plugins/enhance/lib/platform/detect-platform.js +413 -0
- package/plugins/enhance/lib/platform/detection-configs.js +93 -0
- package/plugins/enhance/lib/platform/state-dir.js +132 -0
- package/plugins/enhance/lib/platform/verify-tools.js +182 -0
- package/plugins/enhance/lib/repo-map/cache.js +152 -0
- package/plugins/enhance/lib/repo-map/index.js +222 -0
- package/plugins/enhance/lib/repo-map/installer.js +212 -0
- package/plugins/enhance/lib/repo-map/queries/go.js +27 -0
- package/plugins/enhance/lib/repo-map/queries/index.js +100 -0
- package/plugins/enhance/lib/repo-map/queries/java.js +38 -0
- package/plugins/enhance/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/enhance/lib/repo-map/queries/python.js +24 -0
- package/plugins/enhance/lib/repo-map/queries/rust.js +73 -0
- package/plugins/enhance/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/enhance/lib/repo-map/runner.js +1165 -0
- package/plugins/enhance/lib/repo-map/updater.js +474 -0
- package/plugins/enhance/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/enhance/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/enhance/lib/schemas/validator.js +247 -0
- package/plugins/enhance/lib/sources/custom-handler.js +199 -0
- package/plugins/enhance/lib/sources/policy-questions.js +246 -0
- package/plugins/enhance/lib/sources/source-cache.js +165 -0
- package/plugins/enhance/lib/state/workflow-state.js +575 -0
- package/plugins/enhance/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/enhance/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/enhance/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/enhance/lib/types/index.d.ts +84 -0
- package/plugins/enhance/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/enhance/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/enhance/lib/utils/atomic-write.js +94 -0
- package/plugins/enhance/lib/utils/cache-manager.js +159 -0
- package/plugins/enhance/lib/utils/context-optimizer.js +300 -0
- package/plugins/enhance/lib/utils/deprecation.js +37 -0
- package/plugins/enhance/lib/utils/shell-escape.js +88 -0
- package/plugins/enhance/skills/enhance-agent-prompts/SKILL.md +277 -0
- package/plugins/enhance/skills/enhance-claude-memory/SKILL.md +387 -0
- package/plugins/enhance/skills/enhance-cross-file/SKILL.md +110 -0
- package/plugins/enhance/skills/enhance-docs/SKILL.md +298 -0
- package/plugins/enhance/skills/enhance-hooks/SKILL.md +554 -0
- package/plugins/enhance/skills/enhance-orchestrator/SKILL.md +255 -0
- package/plugins/enhance/skills/enhance-plugins/SKILL.md +319 -0
- package/plugins/enhance/skills/enhance-prompts/SKILL.md +340 -0
- package/plugins/enhance/skills/enhance-skills/SKILL.md +436 -0
- package/plugins/learn/.claude-plugin/plugin.json +21 -0
- package/plugins/learn/agents/learn-agent.md +331 -0
- package/plugins/learn/commands/learn.md +190 -0
- package/plugins/learn/lib/adapter-transforms.js +278 -0
- package/plugins/learn/lib/collectors/codebase.js +392 -0
- package/plugins/learn/lib/collectors/docs-patterns.js +713 -0
- package/plugins/learn/lib/collectors/documentation.js +219 -0
- package/plugins/learn/lib/collectors/github.js +266 -0
- package/plugins/learn/lib/collectors/index.js +126 -0
- package/plugins/learn/lib/config/index.js +14 -0
- package/plugins/learn/lib/cross-platform/index.js +539 -0
- package/plugins/learn/lib/discovery/index.js +352 -0
- package/plugins/learn/lib/drift-detect/collectors.js +37 -0
- package/plugins/learn/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/learn/lib/enhance/agent-patterns.js +571 -0
- package/plugins/learn/lib/enhance/auto-suppression.js +622 -0
- package/plugins/learn/lib/enhance/benchmark.js +417 -0
- package/plugins/learn/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/learn/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/learn/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/learn/lib/enhance/docs-patterns.js +671 -0
- package/plugins/learn/lib/enhance/fixer.js +721 -0
- package/plugins/learn/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/learn/lib/enhance/hook-patterns.js +40 -0
- package/plugins/learn/lib/enhance/index.js +127 -0
- package/plugins/learn/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/learn/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/learn/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/learn/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/learn/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/learn/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/learn/lib/enhance/reporter.js +1348 -0
- package/plugins/learn/lib/enhance/security-patterns.js +284 -0
- package/plugins/learn/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/learn/lib/enhance/skill-patterns.js +147 -0
- package/plugins/learn/lib/enhance/suppression.js +352 -0
- package/plugins/learn/lib/enhance/tool-patterns.js +373 -0
- package/plugins/learn/lib/index.js +270 -0
- package/plugins/learn/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/learn/lib/patterns/pipeline.js +948 -0
- package/plugins/learn/lib/patterns/review-patterns.js +558 -0
- package/plugins/learn/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/learn/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/learn/lib/perf/analyzer/index.js +22 -0
- package/plugins/learn/lib/perf/argument-parser.js +105 -0
- package/plugins/learn/lib/perf/baseline-comparator.js +50 -0
- package/plugins/learn/lib/perf/baseline-store.js +127 -0
- package/plugins/learn/lib/perf/benchmark-runner.js +399 -0
- package/plugins/learn/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/learn/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/learn/lib/perf/checkpoint.js +123 -0
- package/plugins/learn/lib/perf/code-paths.js +86 -0
- package/plugins/learn/lib/perf/consolidation.js +37 -0
- package/plugins/learn/lib/perf/constraint-runner.js +71 -0
- package/plugins/learn/lib/perf/experiment-runner.js +32 -0
- package/plugins/learn/lib/perf/index.js +41 -0
- package/plugins/learn/lib/perf/investigation-state.js +875 -0
- package/plugins/learn/lib/perf/optimization-runner.js +79 -0
- package/plugins/learn/lib/perf/profilers/go.js +22 -0
- package/plugins/learn/lib/perf/profilers/index.js +46 -0
- package/plugins/learn/lib/perf/profilers/java.js +23 -0
- package/plugins/learn/lib/perf/profilers/node.js +27 -0
- package/plugins/learn/lib/perf/profilers/python.js +23 -0
- package/plugins/learn/lib/perf/profilers/rust.js +23 -0
- package/plugins/learn/lib/perf/profiling-runner.js +56 -0
- package/plugins/learn/lib/perf/schemas.js +140 -0
- package/plugins/learn/lib/platform/detect-platform.js +413 -0
- package/plugins/learn/lib/platform/detection-configs.js +93 -0
- package/plugins/learn/lib/platform/state-dir.js +132 -0
- package/plugins/learn/lib/platform/verify-tools.js +182 -0
- package/plugins/learn/lib/repo-map/cache.js +152 -0
- package/plugins/learn/lib/repo-map/index.js +222 -0
- package/plugins/learn/lib/repo-map/installer.js +212 -0
- package/plugins/learn/lib/repo-map/queries/go.js +27 -0
- package/plugins/learn/lib/repo-map/queries/index.js +100 -0
- package/plugins/learn/lib/repo-map/queries/java.js +38 -0
- package/plugins/learn/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/learn/lib/repo-map/queries/python.js +24 -0
- package/plugins/learn/lib/repo-map/queries/rust.js +73 -0
- package/plugins/learn/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/learn/lib/repo-map/runner.js +1165 -0
- package/plugins/learn/lib/repo-map/updater.js +474 -0
- package/plugins/learn/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/learn/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/learn/lib/schemas/validator.js +247 -0
- package/plugins/learn/lib/sources/custom-handler.js +199 -0
- package/plugins/learn/lib/sources/policy-questions.js +246 -0
- package/plugins/learn/lib/sources/source-cache.js +165 -0
- package/plugins/learn/lib/state/workflow-state.js +575 -0
- package/plugins/learn/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/learn/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/learn/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/learn/lib/types/index.d.ts +84 -0
- package/plugins/learn/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/learn/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/learn/lib/utils/atomic-write.js +94 -0
- package/plugins/learn/lib/utils/cache-manager.js +159 -0
- package/plugins/learn/lib/utils/context-optimizer.js +300 -0
- package/plugins/learn/lib/utils/deprecation.js +37 -0
- package/plugins/learn/lib/utils/shell-escape.js +88 -0
- package/plugins/learn/skills/learn/SKILL.md +349 -0
- package/plugins/next-task/.claude-plugin/plugin.json +24 -0
- package/plugins/next-task/agents/ci-fixer.md +259 -0
- package/plugins/next-task/agents/ci-monitor.md +342 -0
- package/plugins/next-task/agents/delivery-validator.md +115 -0
- package/plugins/next-task/agents/exploration-agent.md +316 -0
- package/plugins/next-task/agents/implementation-agent.md +465 -0
- package/plugins/next-task/agents/planning-agent.md +377 -0
- package/plugins/next-task/agents/simple-fixer.md +139 -0
- package/plugins/next-task/agents/task-discoverer.md +89 -0
- package/plugins/next-task/agents/test-coverage-checker.md +451 -0
- package/plugins/next-task/agents/worktree-manager.md +257 -0
- package/plugins/next-task/commands/delivery-approval.md +341 -0
- package/plugins/next-task/commands/next-task.md +547 -0
- package/plugins/next-task/hooks/hooks.json +14 -0
- package/plugins/next-task/lib/adapter-transforms.js +278 -0
- package/plugins/next-task/lib/collectors/codebase.js +392 -0
- package/plugins/next-task/lib/collectors/docs-patterns.js +713 -0
- package/plugins/next-task/lib/collectors/documentation.js +219 -0
- package/plugins/next-task/lib/collectors/github.js +266 -0
- package/plugins/next-task/lib/collectors/index.js +126 -0
- package/plugins/next-task/lib/config/index.js +14 -0
- package/plugins/next-task/lib/cross-platform/index.js +539 -0
- package/plugins/next-task/lib/discovery/index.js +352 -0
- package/plugins/next-task/lib/drift-detect/collectors.js +37 -0
- package/plugins/next-task/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/next-task/lib/enhance/agent-patterns.js +571 -0
- package/plugins/next-task/lib/enhance/auto-suppression.js +622 -0
- package/plugins/next-task/lib/enhance/benchmark.js +417 -0
- package/plugins/next-task/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/next-task/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/next-task/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/next-task/lib/enhance/docs-patterns.js +671 -0
- package/plugins/next-task/lib/enhance/fixer.js +721 -0
- package/plugins/next-task/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/next-task/lib/enhance/hook-patterns.js +40 -0
- package/plugins/next-task/lib/enhance/index.js +127 -0
- package/plugins/next-task/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/next-task/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/next-task/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/next-task/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/next-task/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/next-task/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/next-task/lib/enhance/reporter.js +1348 -0
- package/plugins/next-task/lib/enhance/security-patterns.js +284 -0
- package/plugins/next-task/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/next-task/lib/enhance/skill-patterns.js +147 -0
- package/plugins/next-task/lib/enhance/suppression.js +352 -0
- package/plugins/next-task/lib/enhance/tool-patterns.js +373 -0
- package/plugins/next-task/lib/index.js +270 -0
- package/plugins/next-task/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/next-task/lib/patterns/pipeline.js +948 -0
- package/plugins/next-task/lib/patterns/review-patterns.js +558 -0
- package/plugins/next-task/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/next-task/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/next-task/lib/perf/analyzer/index.js +22 -0
- package/plugins/next-task/lib/perf/argument-parser.js +105 -0
- package/plugins/next-task/lib/perf/baseline-comparator.js +50 -0
- package/plugins/next-task/lib/perf/baseline-store.js +127 -0
- package/plugins/next-task/lib/perf/benchmark-runner.js +399 -0
- package/plugins/next-task/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/next-task/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/next-task/lib/perf/checkpoint.js +123 -0
- package/plugins/next-task/lib/perf/code-paths.js +86 -0
- package/plugins/next-task/lib/perf/consolidation.js +37 -0
- package/plugins/next-task/lib/perf/constraint-runner.js +71 -0
- package/plugins/next-task/lib/perf/experiment-runner.js +32 -0
- package/plugins/next-task/lib/perf/index.js +41 -0
- package/plugins/next-task/lib/perf/investigation-state.js +875 -0
- package/plugins/next-task/lib/perf/optimization-runner.js +79 -0
- package/plugins/next-task/lib/perf/profilers/go.js +22 -0
- package/plugins/next-task/lib/perf/profilers/index.js +46 -0
- package/plugins/next-task/lib/perf/profilers/java.js +23 -0
- package/plugins/next-task/lib/perf/profilers/node.js +27 -0
- package/plugins/next-task/lib/perf/profilers/python.js +23 -0
- package/plugins/next-task/lib/perf/profilers/rust.js +23 -0
- package/plugins/next-task/lib/perf/profiling-runner.js +56 -0
- package/plugins/next-task/lib/perf/schemas.js +140 -0
- package/plugins/next-task/lib/platform/detect-platform.js +413 -0
- package/plugins/next-task/lib/platform/detection-configs.js +93 -0
- package/plugins/next-task/lib/platform/state-dir.js +132 -0
- package/plugins/next-task/lib/platform/verify-tools.js +182 -0
- package/plugins/next-task/lib/repo-map/cache.js +152 -0
- package/plugins/next-task/lib/repo-map/index.js +222 -0
- package/plugins/next-task/lib/repo-map/installer.js +212 -0
- package/plugins/next-task/lib/repo-map/queries/go.js +27 -0
- package/plugins/next-task/lib/repo-map/queries/index.js +100 -0
- package/plugins/next-task/lib/repo-map/queries/java.js +38 -0
- package/plugins/next-task/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/next-task/lib/repo-map/queries/python.js +24 -0
- package/plugins/next-task/lib/repo-map/queries/rust.js +73 -0
- package/plugins/next-task/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/next-task/lib/repo-map/runner.js +1165 -0
- package/plugins/next-task/lib/repo-map/updater.js +474 -0
- package/plugins/next-task/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/next-task/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/next-task/lib/schemas/validator.js +247 -0
- package/plugins/next-task/lib/sources/custom-handler.js +199 -0
- package/plugins/next-task/lib/sources/policy-questions.js +246 -0
- package/plugins/next-task/lib/sources/source-cache.js +165 -0
- package/plugins/next-task/lib/state/workflow-state.js +575 -0
- package/plugins/next-task/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/next-task/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/next-task/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/next-task/lib/types/index.d.ts +84 -0
- package/plugins/next-task/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/next-task/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/next-task/lib/utils/atomic-write.js +94 -0
- package/plugins/next-task/lib/utils/cache-manager.js +159 -0
- package/plugins/next-task/lib/utils/context-optimizer.js +300 -0
- package/plugins/next-task/lib/utils/deprecation.js +37 -0
- package/plugins/next-task/lib/utils/shell-escape.js +88 -0
- package/plugins/next-task/skills/discover-tasks/SKILL.md +191 -0
- package/plugins/next-task/skills/orchestrate-review/SKILL.md +239 -0
- package/plugins/next-task/skills/validate-delivery/SKILL.md +186 -0
- package/plugins/perf/.claude-plugin/plugin.json +20 -0
- package/plugins/perf/agents/perf-analyzer.md +43 -0
- package/plugins/perf/agents/perf-code-paths.md +16 -0
- package/plugins/perf/agents/perf-investigation-logger.md +47 -0
- package/plugins/perf/agents/perf-orchestrator.md +344 -0
- package/plugins/perf/agents/perf-theory-gatherer.md +25 -0
- package/plugins/perf/agents/perf-theory-tester.md +58 -0
- package/plugins/perf/commands/perf.md +470 -0
- package/plugins/perf/hooks/checkpoint.md +35 -0
- package/plugins/perf/hooks/constraint-tester.md +40 -0
- package/plugins/perf/lib/adapter-transforms.js +278 -0
- package/plugins/perf/lib/collectors/codebase.js +392 -0
- package/plugins/perf/lib/collectors/docs-patterns.js +713 -0
- package/plugins/perf/lib/collectors/documentation.js +219 -0
- package/plugins/perf/lib/collectors/github.js +266 -0
- package/plugins/perf/lib/collectors/index.js +126 -0
- package/plugins/perf/lib/config/index.js +14 -0
- package/plugins/perf/lib/cross-platform/index.js +539 -0
- package/plugins/perf/lib/discovery/index.js +352 -0
- package/plugins/perf/lib/drift-detect/collectors.js +37 -0
- package/plugins/perf/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/perf/lib/enhance/agent-patterns.js +571 -0
- package/plugins/perf/lib/enhance/auto-suppression.js +622 -0
- package/plugins/perf/lib/enhance/benchmark.js +417 -0
- package/plugins/perf/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/perf/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/perf/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/perf/lib/enhance/docs-patterns.js +671 -0
- package/plugins/perf/lib/enhance/fixer.js +721 -0
- package/plugins/perf/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/perf/lib/enhance/hook-patterns.js +40 -0
- package/plugins/perf/lib/enhance/index.js +127 -0
- package/plugins/perf/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/perf/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/perf/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/perf/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/perf/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/perf/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/perf/lib/enhance/reporter.js +1348 -0
- package/plugins/perf/lib/enhance/security-patterns.js +284 -0
- package/plugins/perf/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/perf/lib/enhance/skill-patterns.js +147 -0
- package/plugins/perf/lib/enhance/suppression.js +352 -0
- package/plugins/perf/lib/enhance/tool-patterns.js +373 -0
- package/plugins/perf/lib/index.js +270 -0
- package/plugins/perf/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/perf/lib/patterns/pipeline.js +948 -0
- package/plugins/perf/lib/patterns/review-patterns.js +558 -0
- package/plugins/perf/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/perf/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/perf/lib/perf/analyzer/index.js +22 -0
- package/plugins/perf/lib/perf/argument-parser.js +105 -0
- package/plugins/perf/lib/perf/baseline-comparator.js +50 -0
- package/plugins/perf/lib/perf/baseline-store.js +127 -0
- package/plugins/perf/lib/perf/benchmark-runner.js +399 -0
- package/plugins/perf/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/perf/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/perf/lib/perf/checkpoint.js +123 -0
- package/plugins/perf/lib/perf/code-paths.js +86 -0
- package/plugins/perf/lib/perf/consolidation.js +37 -0
- package/plugins/perf/lib/perf/constraint-runner.js +71 -0
- package/plugins/perf/lib/perf/experiment-runner.js +32 -0
- package/plugins/perf/lib/perf/index.js +41 -0
- package/plugins/perf/lib/perf/investigation-state.js +875 -0
- package/plugins/perf/lib/perf/optimization-runner.js +79 -0
- package/plugins/perf/lib/perf/profilers/go.js +22 -0
- package/plugins/perf/lib/perf/profilers/index.js +46 -0
- package/plugins/perf/lib/perf/profilers/java.js +23 -0
- package/plugins/perf/lib/perf/profilers/node.js +27 -0
- package/plugins/perf/lib/perf/profilers/python.js +23 -0
- package/plugins/perf/lib/perf/profilers/rust.js +23 -0
- package/plugins/perf/lib/perf/profiling-runner.js +56 -0
- package/plugins/perf/lib/perf/schemas.js +140 -0
- package/plugins/perf/lib/platform/detect-platform.js +413 -0
- package/plugins/perf/lib/platform/detection-configs.js +93 -0
- package/plugins/perf/lib/platform/state-dir.js +132 -0
- package/plugins/perf/lib/platform/verify-tools.js +182 -0
- package/plugins/perf/lib/repo-map/cache.js +152 -0
- package/plugins/perf/lib/repo-map/index.js +222 -0
- package/plugins/perf/lib/repo-map/installer.js +212 -0
- package/plugins/perf/lib/repo-map/queries/go.js +27 -0
- package/plugins/perf/lib/repo-map/queries/index.js +100 -0
- package/plugins/perf/lib/repo-map/queries/java.js +38 -0
- package/plugins/perf/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/perf/lib/repo-map/queries/python.js +24 -0
- package/plugins/perf/lib/repo-map/queries/rust.js +73 -0
- package/plugins/perf/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/perf/lib/repo-map/runner.js +1165 -0
- package/plugins/perf/lib/repo-map/updater.js +474 -0
- package/plugins/perf/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/perf/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/perf/lib/schemas/validator.js +247 -0
- package/plugins/perf/lib/sources/custom-handler.js +199 -0
- package/plugins/perf/lib/sources/policy-questions.js +246 -0
- package/plugins/perf/lib/sources/source-cache.js +165 -0
- package/plugins/perf/lib/state/workflow-state.js +575 -0
- package/plugins/perf/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/perf/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/perf/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/perf/lib/types/index.d.ts +84 -0
- package/plugins/perf/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/perf/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/perf/lib/utils/atomic-write.js +94 -0
- package/plugins/perf/lib/utils/cache-manager.js +159 -0
- package/plugins/perf/lib/utils/context-optimizer.js +300 -0
- package/plugins/perf/lib/utils/deprecation.js +37 -0
- package/plugins/perf/lib/utils/shell-escape.js +88 -0
- package/plugins/perf/skills/perf-analyzer/SKILL.md +37 -0
- package/plugins/perf/skills/perf-baseline-manager/SKILL.md +30 -0
- package/plugins/perf/skills/perf-benchmarker/SKILL.md +52 -0
- package/plugins/perf/skills/perf-code-paths/SKILL.md +32 -0
- package/plugins/perf/skills/perf-investigation-logger/SKILL.md +41 -0
- package/plugins/perf/skills/perf-profiler/SKILL.md +42 -0
- package/plugins/perf/skills/perf-theory-gatherer/SKILL.md +35 -0
- package/plugins/perf/skills/perf-theory-tester/SKILL.md +36 -0
- package/plugins/repo-map/.claude-plugin/plugin.json +22 -0
- package/plugins/repo-map/agents/map-validator.md +60 -0
- package/plugins/repo-map/commands/repo-map.md +133 -0
- package/plugins/repo-map/lib/adapter-transforms.js +278 -0
- package/plugins/repo-map/lib/collectors/codebase.js +392 -0
- package/plugins/repo-map/lib/collectors/docs-patterns.js +713 -0
- package/plugins/repo-map/lib/collectors/documentation.js +219 -0
- package/plugins/repo-map/lib/collectors/github.js +266 -0
- package/plugins/repo-map/lib/collectors/index.js +126 -0
- package/plugins/repo-map/lib/config/index.js +14 -0
- package/plugins/repo-map/lib/cross-platform/index.js +539 -0
- package/plugins/repo-map/lib/discovery/index.js +352 -0
- package/plugins/repo-map/lib/drift-detect/collectors.js +37 -0
- package/plugins/repo-map/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/repo-map/lib/enhance/agent-patterns.js +571 -0
- package/plugins/repo-map/lib/enhance/auto-suppression.js +622 -0
- package/plugins/repo-map/lib/enhance/benchmark.js +417 -0
- package/plugins/repo-map/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/repo-map/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/repo-map/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/repo-map/lib/enhance/docs-patterns.js +671 -0
- package/plugins/repo-map/lib/enhance/fixer.js +721 -0
- package/plugins/repo-map/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/repo-map/lib/enhance/hook-patterns.js +40 -0
- package/plugins/repo-map/lib/enhance/index.js +127 -0
- package/plugins/repo-map/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/repo-map/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/repo-map/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/repo-map/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/repo-map/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/repo-map/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/repo-map/lib/enhance/reporter.js +1348 -0
- package/plugins/repo-map/lib/enhance/security-patterns.js +284 -0
- package/plugins/repo-map/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/repo-map/lib/enhance/skill-patterns.js +147 -0
- package/plugins/repo-map/lib/enhance/suppression.js +352 -0
- package/plugins/repo-map/lib/enhance/tool-patterns.js +373 -0
- package/plugins/repo-map/lib/index.js +270 -0
- package/plugins/repo-map/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/repo-map/lib/patterns/pipeline.js +948 -0
- package/plugins/repo-map/lib/patterns/review-patterns.js +558 -0
- package/plugins/repo-map/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/repo-map/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/repo-map/lib/perf/analyzer/index.js +22 -0
- package/plugins/repo-map/lib/perf/argument-parser.js +105 -0
- package/plugins/repo-map/lib/perf/baseline-comparator.js +50 -0
- package/plugins/repo-map/lib/perf/baseline-store.js +127 -0
- package/plugins/repo-map/lib/perf/benchmark-runner.js +399 -0
- package/plugins/repo-map/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/repo-map/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/repo-map/lib/perf/checkpoint.js +123 -0
- package/plugins/repo-map/lib/perf/code-paths.js +86 -0
- package/plugins/repo-map/lib/perf/consolidation.js +37 -0
- package/plugins/repo-map/lib/perf/constraint-runner.js +71 -0
- package/plugins/repo-map/lib/perf/experiment-runner.js +32 -0
- package/plugins/repo-map/lib/perf/index.js +41 -0
- package/plugins/repo-map/lib/perf/investigation-state.js +875 -0
- package/plugins/repo-map/lib/perf/optimization-runner.js +79 -0
- package/plugins/repo-map/lib/perf/profilers/go.js +22 -0
- package/plugins/repo-map/lib/perf/profilers/index.js +46 -0
- package/plugins/repo-map/lib/perf/profilers/java.js +23 -0
- package/plugins/repo-map/lib/perf/profilers/node.js +27 -0
- package/plugins/repo-map/lib/perf/profilers/python.js +23 -0
- package/plugins/repo-map/lib/perf/profilers/rust.js +23 -0
- package/plugins/repo-map/lib/perf/profiling-runner.js +56 -0
- package/plugins/repo-map/lib/perf/schemas.js +140 -0
- package/plugins/repo-map/lib/platform/detect-platform.js +413 -0
- package/plugins/repo-map/lib/platform/detection-configs.js +93 -0
- package/plugins/repo-map/lib/platform/state-dir.js +132 -0
- package/plugins/repo-map/lib/platform/verify-tools.js +182 -0
- package/plugins/repo-map/lib/repo-map/cache.js +152 -0
- package/plugins/repo-map/lib/repo-map/index.js +222 -0
- package/plugins/repo-map/lib/repo-map/installer.js +212 -0
- package/plugins/repo-map/lib/repo-map/queries/go.js +27 -0
- package/plugins/repo-map/lib/repo-map/queries/index.js +100 -0
- package/plugins/repo-map/lib/repo-map/queries/java.js +38 -0
- package/plugins/repo-map/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/repo-map/lib/repo-map/queries/python.js +24 -0
- package/plugins/repo-map/lib/repo-map/queries/rust.js +73 -0
- package/plugins/repo-map/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/repo-map/lib/repo-map/runner.js +1165 -0
- package/plugins/repo-map/lib/repo-map/updater.js +474 -0
- package/plugins/repo-map/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/repo-map/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/repo-map/lib/schemas/validator.js +247 -0
- package/plugins/repo-map/lib/sources/custom-handler.js +199 -0
- package/plugins/repo-map/lib/sources/policy-questions.js +246 -0
- package/plugins/repo-map/lib/sources/source-cache.js +165 -0
- package/plugins/repo-map/lib/state/workflow-state.js +575 -0
- package/plugins/repo-map/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/repo-map/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/repo-map/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/repo-map/lib/types/index.d.ts +84 -0
- package/plugins/repo-map/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/repo-map/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/repo-map/lib/utils/atomic-write.js +94 -0
- package/plugins/repo-map/lib/utils/cache-manager.js +159 -0
- package/plugins/repo-map/lib/utils/context-optimizer.js +300 -0
- package/plugins/repo-map/lib/utils/deprecation.js +37 -0
- package/plugins/repo-map/lib/utils/shell-escape.js +88 -0
- package/plugins/repo-map/skills/repo-mapping/SKILL.md +83 -0
- package/plugins/ship/.claude-plugin/plugin.json +21 -0
- package/plugins/ship/commands/ship-ci-review-loop.md +472 -0
- package/plugins/ship/commands/ship-deployment.md +335 -0
- package/plugins/ship/commands/ship-error-handling.md +258 -0
- package/plugins/ship/commands/ship.md +492 -0
- package/plugins/ship/lib/adapter-transforms.js +278 -0
- package/plugins/ship/lib/collectors/codebase.js +392 -0
- package/plugins/ship/lib/collectors/docs-patterns.js +713 -0
- package/plugins/ship/lib/collectors/documentation.js +219 -0
- package/plugins/ship/lib/collectors/github.js +266 -0
- package/plugins/ship/lib/collectors/index.js +126 -0
- package/plugins/ship/lib/config/index.js +14 -0
- package/plugins/ship/lib/cross-platform/index.js +539 -0
- package/plugins/ship/lib/discovery/index.js +352 -0
- package/plugins/ship/lib/drift-detect/collectors.js +37 -0
- package/plugins/ship/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/ship/lib/enhance/agent-patterns.js +571 -0
- package/plugins/ship/lib/enhance/auto-suppression.js +622 -0
- package/plugins/ship/lib/enhance/benchmark.js +417 -0
- package/plugins/ship/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/ship/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/ship/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/ship/lib/enhance/docs-patterns.js +671 -0
- package/plugins/ship/lib/enhance/fixer.js +721 -0
- package/plugins/ship/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/ship/lib/enhance/hook-patterns.js +40 -0
- package/plugins/ship/lib/enhance/index.js +127 -0
- package/plugins/ship/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/ship/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/ship/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/ship/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/ship/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/ship/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/ship/lib/enhance/reporter.js +1348 -0
- package/plugins/ship/lib/enhance/security-patterns.js +284 -0
- package/plugins/ship/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/ship/lib/enhance/skill-patterns.js +147 -0
- package/plugins/ship/lib/enhance/suppression.js +352 -0
- package/plugins/ship/lib/enhance/tool-patterns.js +373 -0
- package/plugins/ship/lib/index.js +270 -0
- package/plugins/ship/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/ship/lib/patterns/pipeline.js +948 -0
- package/plugins/ship/lib/patterns/review-patterns.js +558 -0
- package/plugins/ship/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/ship/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/ship/lib/perf/analyzer/index.js +22 -0
- package/plugins/ship/lib/perf/argument-parser.js +105 -0
- package/plugins/ship/lib/perf/baseline-comparator.js +50 -0
- package/plugins/ship/lib/perf/baseline-store.js +127 -0
- package/plugins/ship/lib/perf/benchmark-runner.js +399 -0
- package/plugins/ship/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/ship/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/ship/lib/perf/checkpoint.js +123 -0
- package/plugins/ship/lib/perf/code-paths.js +86 -0
- package/plugins/ship/lib/perf/consolidation.js +37 -0
- package/plugins/ship/lib/perf/constraint-runner.js +71 -0
- package/plugins/ship/lib/perf/experiment-runner.js +32 -0
- package/plugins/ship/lib/perf/index.js +41 -0
- package/plugins/ship/lib/perf/investigation-state.js +875 -0
- package/plugins/ship/lib/perf/optimization-runner.js +79 -0
- package/plugins/ship/lib/perf/profilers/go.js +22 -0
- package/plugins/ship/lib/perf/profilers/index.js +46 -0
- package/plugins/ship/lib/perf/profilers/java.js +23 -0
- package/plugins/ship/lib/perf/profilers/node.js +27 -0
- package/plugins/ship/lib/perf/profilers/python.js +23 -0
- package/plugins/ship/lib/perf/profilers/rust.js +23 -0
- package/plugins/ship/lib/perf/profiling-runner.js +56 -0
- package/plugins/ship/lib/perf/schemas.js +140 -0
- package/plugins/ship/lib/platform/detect-platform.js +413 -0
- package/plugins/ship/lib/platform/detection-configs.js +93 -0
- package/plugins/ship/lib/platform/state-dir.js +132 -0
- package/plugins/ship/lib/platform/verify-tools.js +182 -0
- package/plugins/ship/lib/repo-map/cache.js +152 -0
- package/plugins/ship/lib/repo-map/index.js +222 -0
- package/plugins/ship/lib/repo-map/installer.js +212 -0
- package/plugins/ship/lib/repo-map/queries/go.js +27 -0
- package/plugins/ship/lib/repo-map/queries/index.js +100 -0
- package/plugins/ship/lib/repo-map/queries/java.js +38 -0
- package/plugins/ship/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/ship/lib/repo-map/queries/python.js +24 -0
- package/plugins/ship/lib/repo-map/queries/rust.js +73 -0
- package/plugins/ship/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/ship/lib/repo-map/runner.js +1165 -0
- package/plugins/ship/lib/repo-map/updater.js +474 -0
- package/plugins/ship/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/ship/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/ship/lib/schemas/validator.js +247 -0
- package/plugins/ship/lib/sources/custom-handler.js +199 -0
- package/plugins/ship/lib/sources/policy-questions.js +246 -0
- package/plugins/ship/lib/sources/source-cache.js +165 -0
- package/plugins/ship/lib/state/workflow-state.js +575 -0
- package/plugins/ship/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/ship/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/ship/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/ship/lib/types/index.d.ts +84 -0
- package/plugins/ship/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/ship/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/ship/lib/utils/atomic-write.js +94 -0
- package/plugins/ship/lib/utils/cache-manager.js +159 -0
- package/plugins/ship/lib/utils/context-optimizer.js +300 -0
- package/plugins/ship/lib/utils/deprecation.js +37 -0
- package/plugins/ship/lib/utils/shell-escape.js +88 -0
- package/plugins/sync-docs/.claude-plugin/plugin.json +20 -0
- package/plugins/sync-docs/agents/sync-docs-agent.md +154 -0
- package/plugins/sync-docs/commands/sync-docs.md +186 -0
- package/plugins/sync-docs/lib/adapter-transforms.js +278 -0
- package/plugins/sync-docs/lib/collectors/codebase.js +392 -0
- package/plugins/sync-docs/lib/collectors/docs-patterns.js +713 -0
- package/plugins/sync-docs/lib/collectors/documentation.js +219 -0
- package/plugins/sync-docs/lib/collectors/github.js +266 -0
- package/plugins/sync-docs/lib/collectors/index.js +126 -0
- package/plugins/sync-docs/lib/config/index.js +14 -0
- package/plugins/sync-docs/lib/cross-platform/index.js +539 -0
- package/plugins/sync-docs/lib/discovery/index.js +352 -0
- package/plugins/sync-docs/lib/drift-detect/collectors.js +37 -0
- package/plugins/sync-docs/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/sync-docs/lib/enhance/agent-patterns.js +571 -0
- package/plugins/sync-docs/lib/enhance/auto-suppression.js +622 -0
- package/plugins/sync-docs/lib/enhance/benchmark.js +417 -0
- package/plugins/sync-docs/lib/enhance/cross-file-analyzer.js +930 -0
- package/plugins/sync-docs/lib/enhance/cross-file-patterns.js +370 -0
- package/plugins/sync-docs/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/sync-docs/lib/enhance/docs-patterns.js +671 -0
- package/plugins/sync-docs/lib/enhance/fixer.js +721 -0
- package/plugins/sync-docs/lib/enhance/hook-analyzer.js +135 -0
- package/plugins/sync-docs/lib/enhance/hook-patterns.js +40 -0
- package/plugins/sync-docs/lib/enhance/index.js +127 -0
- package/plugins/sync-docs/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/sync-docs/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/sync-docs/lib/enhance/projectmemory-analyzer.js +551 -0
- package/plugins/sync-docs/lib/enhance/projectmemory-patterns.js +617 -0
- package/plugins/sync-docs/lib/enhance/prompt-analyzer.js +457 -0
- package/plugins/sync-docs/lib/enhance/prompt-patterns.js +1484 -0
- package/plugins/sync-docs/lib/enhance/reporter.js +1348 -0
- package/plugins/sync-docs/lib/enhance/security-patterns.js +284 -0
- package/plugins/sync-docs/lib/enhance/skill-analyzer.js +182 -0
- package/plugins/sync-docs/lib/enhance/skill-patterns.js +147 -0
- package/plugins/sync-docs/lib/enhance/suppression.js +352 -0
- package/plugins/sync-docs/lib/enhance/tool-patterns.js +373 -0
- package/plugins/sync-docs/lib/index.js +270 -0
- package/plugins/sync-docs/lib/patterns/cli-enhancers.js +611 -0
- package/plugins/sync-docs/lib/patterns/pipeline.js +948 -0
- package/plugins/sync-docs/lib/patterns/review-patterns.js +558 -0
- package/plugins/sync-docs/lib/patterns/slop-analyzers.js +2305 -0
- package/plugins/sync-docs/lib/patterns/slop-patterns.js +1187 -0
- package/plugins/sync-docs/lib/perf/analyzer/index.js +22 -0
- package/plugins/sync-docs/lib/perf/argument-parser.js +105 -0
- package/plugins/sync-docs/lib/perf/baseline-comparator.js +50 -0
- package/plugins/sync-docs/lib/perf/baseline-store.js +127 -0
- package/plugins/sync-docs/lib/perf/benchmark-runner.js +399 -0
- package/plugins/sync-docs/lib/perf/breaking-point-finder.js +52 -0
- package/plugins/sync-docs/lib/perf/breaking-point-runner.js +60 -0
- package/plugins/sync-docs/lib/perf/checkpoint.js +123 -0
- package/plugins/sync-docs/lib/perf/code-paths.js +86 -0
- package/plugins/sync-docs/lib/perf/consolidation.js +37 -0
- package/plugins/sync-docs/lib/perf/constraint-runner.js +71 -0
- package/plugins/sync-docs/lib/perf/experiment-runner.js +32 -0
- package/plugins/sync-docs/lib/perf/index.js +41 -0
- package/plugins/sync-docs/lib/perf/investigation-state.js +875 -0
- package/plugins/sync-docs/lib/perf/optimization-runner.js +79 -0
- package/plugins/sync-docs/lib/perf/profilers/go.js +22 -0
- package/plugins/sync-docs/lib/perf/profilers/index.js +46 -0
- package/plugins/sync-docs/lib/perf/profilers/java.js +23 -0
- package/plugins/sync-docs/lib/perf/profilers/node.js +27 -0
- package/plugins/sync-docs/lib/perf/profilers/python.js +23 -0
- package/plugins/sync-docs/lib/perf/profilers/rust.js +23 -0
- package/plugins/sync-docs/lib/perf/profiling-runner.js +56 -0
- package/plugins/sync-docs/lib/perf/schemas.js +140 -0
- package/plugins/sync-docs/lib/platform/detect-platform.js +413 -0
- package/plugins/sync-docs/lib/platform/detection-configs.js +93 -0
- package/plugins/sync-docs/lib/platform/state-dir.js +132 -0
- package/plugins/sync-docs/lib/platform/verify-tools.js +182 -0
- package/plugins/sync-docs/lib/repo-map/cache.js +152 -0
- package/plugins/sync-docs/lib/repo-map/index.js +222 -0
- package/plugins/sync-docs/lib/repo-map/installer.js +212 -0
- package/plugins/sync-docs/lib/repo-map/queries/go.js +27 -0
- package/plugins/sync-docs/lib/repo-map/queries/index.js +100 -0
- package/plugins/sync-docs/lib/repo-map/queries/java.js +38 -0
- package/plugins/sync-docs/lib/repo-map/queries/javascript.js +55 -0
- package/plugins/sync-docs/lib/repo-map/queries/python.js +24 -0
- package/plugins/sync-docs/lib/repo-map/queries/rust.js +73 -0
- package/plugins/sync-docs/lib/repo-map/queries/typescript.js +38 -0
- package/plugins/sync-docs/lib/repo-map/runner.js +1165 -0
- package/plugins/sync-docs/lib/repo-map/updater.js +474 -0
- package/plugins/sync-docs/lib/repo-map/usage-analyzer.js +407 -0
- package/plugins/sync-docs/lib/schemas/plugin-manifest.schema.json +57 -0
- package/plugins/sync-docs/lib/schemas/validator.js +247 -0
- package/plugins/sync-docs/lib/sources/custom-handler.js +199 -0
- package/plugins/sync-docs/lib/sources/policy-questions.js +246 -0
- package/plugins/sync-docs/lib/sources/source-cache.js +165 -0
- package/plugins/sync-docs/lib/state/workflow-state.js +575 -0
- package/plugins/sync-docs/lib/types/agent-frontmatter.d.ts +134 -0
- package/plugins/sync-docs/lib/types/command-frontmatter.d.ts +107 -0
- package/plugins/sync-docs/lib/types/hook-frontmatter.d.ts +115 -0
- package/plugins/sync-docs/lib/types/index.d.ts +84 -0
- package/plugins/sync-docs/lib/types/plugin-manifest.d.ts +102 -0
- package/plugins/sync-docs/lib/types/skill-frontmatter.d.ts +89 -0
- package/plugins/sync-docs/lib/utils/atomic-write.js +94 -0
- package/plugins/sync-docs/lib/utils/cache-manager.js +159 -0
- package/plugins/sync-docs/lib/utils/context-optimizer.js +300 -0
- package/plugins/sync-docs/lib/utils/deprecation.js +37 -0
- package/plugins/sync-docs/lib/utils/shell-escape.js +88 -0
- package/plugins/sync-docs/skills/sync-docs/SKILL.md +351 -0
- package/scripts/bump-version.js +92 -0
- package/scripts/check-hardcoded-paths.js +199 -0
- package/scripts/dev-install.js +493 -0
- package/scripts/expand-templates.js +269 -0
- package/scripts/gen-adapters.js +323 -0
- package/scripts/generate-docs.js +558 -0
- package/scripts/generate-plugin-list.js +20 -0
- package/scripts/migrate-opencode.js +307 -0
- package/scripts/perf/repo-map-create.js +46 -0
- package/scripts/plugins.txt +12 -0
- package/scripts/preflight.js +1263 -0
- package/scripts/scaffold.js +490 -0
- package/scripts/setup-hooks.js +169 -0
- package/scripts/stamp-version.js +175 -0
- package/scripts/test-transform.js +85 -0
- package/scripts/validate-agent-skill-compliance.js +284 -0
- package/scripts/validate-counts.js +457 -0
- package/scripts/validate-cross-platform-docs.js +550 -0
- package/scripts/validate-opencode-install.js +182 -0
- package/site/assets/css/main.css +1525 -0
- package/site/assets/css/tokens.css +493 -0
- package/site/assets/favicon.svg +23 -0
- package/site/assets/js/main.js +801 -0
- package/site/assets/logo.png +0 -0
- package/site/assets/og-image.html +163 -0
- package/site/content.json +453 -0
- package/site/index.html +698 -0
- package/site/ux-spec.md +683 -0
- package/site/version.json +5 -0
- package/templates/agent-snippets/enhance-integration-points.md +6 -0
- package/templates/agent-snippets/enhance-skill-delegation.md +18 -0
- 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.*
|