claude-autopm 2.8.1 → 2.8.3
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/README.md +399 -529
- package/bin/autopm.js +2 -0
- package/bin/commands/plugin.js +395 -0
- package/bin/commands/team.js +184 -10
- package/install/install.js +223 -4
- package/lib/plugins/PluginManager.js +1328 -0
- package/lib/plugins/PluginManager.old.js +400 -0
- package/package.json +5 -1
- package/packages/plugin-ai/LICENSE +21 -0
- package/packages/plugin-ai/README.md +316 -0
- package/packages/plugin-ai/agents/anthropic-claude-expert.md +579 -0
- package/packages/plugin-ai/agents/azure-openai-expert.md +1411 -0
- package/packages/plugin-ai/agents/google-a2a-expert.md +1445 -0
- package/packages/plugin-ai/agents/huggingface-expert.md +2131 -0
- package/packages/plugin-ai/agents/langchain-expert.md +1427 -0
- package/packages/plugin-ai/commands/a2a-setup.md +886 -0
- package/packages/plugin-ai/commands/ai-model-deployment.md +481 -0
- package/packages/plugin-ai/commands/anthropic-optimize.md +793 -0
- package/packages/plugin-ai/commands/huggingface-deploy.md +789 -0
- package/packages/plugin-ai/commands/langchain-optimize.md +807 -0
- package/packages/plugin-ai/commands/llm-optimize.md +348 -0
- package/packages/plugin-ai/commands/openai-optimize.md +863 -0
- package/packages/plugin-ai/commands/rag-optimize.md +841 -0
- package/packages/plugin-ai/commands/rag-setup-scaffold.md +382 -0
- package/packages/plugin-ai/package.json +66 -0
- package/packages/plugin-ai/plugin.json +519 -0
- package/packages/plugin-ai/rules/ai-model-standards.md +449 -0
- package/packages/plugin-ai/rules/prompt-engineering-standards.md +509 -0
- package/packages/plugin-ai/scripts/examples/huggingface-inference-example.py +145 -0
- package/packages/plugin-ai/scripts/examples/langchain-rag-example.py +366 -0
- package/packages/plugin-ai/scripts/examples/mlflow-tracking-example.py +224 -0
- package/packages/plugin-ai/scripts/examples/openai-chat-example.py +425 -0
- package/packages/plugin-cloud/README.md +268 -0
- package/packages/plugin-cloud/agents/gemini-api-expert.md +880 -0
- package/packages/plugin-cloud/agents/openai-python-expert.md +1087 -0
- package/packages/plugin-cloud/commands/cloud-cost-optimize.md +243 -0
- package/packages/plugin-cloud/commands/cloud-validate.md +196 -0
- package/packages/plugin-cloud/hooks/pre-cloud-deploy.js +456 -0
- package/packages/plugin-cloud/package.json +64 -0
- package/packages/plugin-cloud/plugin.json +338 -0
- package/packages/plugin-cloud/rules/cloud-security-compliance.md +313 -0
- package/packages/plugin-cloud/scripts/examples/aws-validate.sh +30 -0
- package/packages/plugin-cloud/scripts/examples/azure-setup.sh +33 -0
- package/packages/plugin-cloud/scripts/examples/gcp-setup.sh +39 -0
- package/packages/plugin-cloud/scripts/examples/k8s-validate.sh +40 -0
- package/packages/plugin-cloud/scripts/examples/terraform-init.sh +26 -0
- package/packages/plugin-core/README.md +274 -0
- package/packages/plugin-core/commands/code-rabbit.md +128 -0
- package/packages/plugin-core/commands/prompt.md +9 -0
- package/packages/plugin-core/commands/re-init.md +9 -0
- package/packages/plugin-core/hooks/context7-reminder.md +29 -0
- package/packages/plugin-core/hooks/enforce-agents.js +125 -0
- package/packages/plugin-core/hooks/enforce-agents.sh +35 -0
- package/packages/plugin-core/hooks/pre-agent-context7.js +224 -0
- package/packages/plugin-core/hooks/pre-command-context7.js +229 -0
- package/packages/plugin-core/hooks/strict-enforce-agents.sh +39 -0
- package/packages/plugin-core/hooks/test-hook.sh +21 -0
- package/packages/plugin-core/hooks/unified-context7-enforcement.sh +38 -0
- package/packages/plugin-core/package.json +45 -0
- package/packages/plugin-core/plugin.json +387 -0
- package/packages/plugin-core/rules/agent-coordination.md +549 -0
- package/packages/plugin-core/rules/agent-mandatory.md +170 -0
- package/packages/plugin-core/rules/command-pipelines.md +208 -0
- package/packages/plugin-core/rules/context-optimization.md +176 -0
- package/packages/plugin-core/rules/context7-enforcement.md +327 -0
- package/packages/plugin-core/rules/datetime.md +122 -0
- package/packages/plugin-core/rules/definition-of-done.md +272 -0
- package/packages/plugin-core/rules/development-environments.md +19 -0
- package/packages/plugin-core/rules/development-workflow.md +198 -0
- package/packages/plugin-core/rules/framework-path-rules.md +180 -0
- package/packages/plugin-core/rules/frontmatter-operations.md +64 -0
- package/packages/plugin-core/rules/git-strategy.md +237 -0
- package/packages/plugin-core/rules/golden-rules.md +181 -0
- package/packages/plugin-core/rules/naming-conventions.md +111 -0
- package/packages/plugin-core/rules/no-pr-workflow.md +183 -0
- package/packages/plugin-core/rules/pipeline-mandatory.md +109 -0
- package/packages/plugin-core/rules/security-checklist.md +318 -0
- package/packages/plugin-core/rules/standard-patterns.md +197 -0
- package/packages/plugin-core/rules/strip-frontmatter.md +85 -0
- package/packages/plugin-core/rules/tdd.enforcement.md +103 -0
- package/packages/plugin-core/rules/use-ast-grep.md +113 -0
- package/packages/plugin-core/scripts/lib/datetime-utils.sh +254 -0
- package/packages/plugin-core/scripts/lib/frontmatter-utils.sh +294 -0
- package/packages/plugin-core/scripts/lib/github-utils.sh +221 -0
- package/packages/plugin-core/scripts/lib/logging-utils.sh +199 -0
- package/packages/plugin-core/scripts/lib/validation-utils.sh +339 -0
- package/packages/plugin-core/scripts/mcp/add.sh +7 -0
- package/packages/plugin-core/scripts/mcp/disable.sh +12 -0
- package/packages/plugin-core/scripts/mcp/enable.sh +12 -0
- package/packages/plugin-core/scripts/mcp/list.sh +7 -0
- package/packages/plugin-core/scripts/mcp/sync.sh +8 -0
- package/packages/plugin-data/README.md +315 -0
- package/packages/plugin-data/agents/airflow-orchestration-expert.md +158 -0
- package/packages/plugin-data/agents/kedro-pipeline-expert.md +304 -0
- package/packages/plugin-data/agents/langgraph-workflow-expert.md +530 -0
- package/packages/plugin-data/commands/airflow-dag-scaffold.md +413 -0
- package/packages/plugin-data/commands/kafka-pipeline-scaffold.md +503 -0
- package/packages/plugin-data/package.json +66 -0
- package/packages/plugin-data/plugin.json +294 -0
- package/packages/plugin-data/rules/data-quality-standards.md +373 -0
- package/packages/plugin-data/rules/etl-pipeline-standards.md +255 -0
- package/packages/plugin-data/scripts/examples/airflow-dag-example.py +245 -0
- package/packages/plugin-data/scripts/examples/dbt-transform-example.sql +238 -0
- package/packages/plugin-data/scripts/examples/kafka-streaming-example.py +257 -0
- package/packages/plugin-data/scripts/examples/pandas-etl-example.py +332 -0
- package/packages/plugin-databases/README.md +330 -0
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/bigquery-expert.md +24 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/cosmosdb-expert.md +22 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/mongodb-expert.md +24 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/postgresql-expert.md +23 -15
- package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/redis-expert.md +29 -7
- package/packages/plugin-databases/commands/db-optimize.md +612 -0
- package/packages/plugin-databases/package.json +60 -0
- package/packages/plugin-databases/plugin.json +237 -0
- package/packages/plugin-databases/rules/database-management-strategy.md +146 -0
- package/packages/plugin-databases/rules/database-pipeline.md +316 -0
- package/packages/plugin-databases/scripts/examples/bigquery-cost-analyze.sh +160 -0
- package/packages/plugin-databases/scripts/examples/cosmosdb-ru-optimize.sh +163 -0
- package/packages/plugin-databases/scripts/examples/mongodb-shard-check.sh +120 -0
- package/packages/plugin-databases/scripts/examples/postgres-index-analyze.sh +95 -0
- package/packages/plugin-databases/scripts/examples/redis-cache-stats.sh +121 -0
- package/packages/plugin-devops/README.md +367 -0
- package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/github-operations-specialist.md +1 -1
- package/packages/plugin-devops/commands/ci-pipeline-create.md +581 -0
- package/packages/plugin-devops/commands/docker-optimize.md +493 -0
- package/packages/plugin-devops/hooks/pre-docker-build.js +472 -0
- package/packages/plugin-devops/package.json +61 -0
- package/packages/plugin-devops/plugin.json +302 -0
- package/packages/plugin-devops/rules/github-operations.md +92 -0
- package/packages/plugin-devops/scripts/examples/docker-build-multistage.sh +43 -0
- package/packages/plugin-devops/scripts/examples/docker-compose-validate.sh +74 -0
- package/packages/plugin-devops/scripts/examples/github-workflow-validate.sh +48 -0
- package/packages/plugin-devops/scripts/examples/prometheus-health-check.sh +58 -0
- package/packages/plugin-devops/scripts/examples/ssh-key-setup.sh +74 -0
- package/packages/plugin-frameworks/README.md +309 -0
- package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/e2e-test-engineer.md +219 -0
- package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/react-frontend-engineer.md +176 -0
- package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/tailwindcss-expert.md +251 -0
- package/packages/plugin-frameworks/commands/nextjs-optimize.md +692 -0
- package/packages/plugin-frameworks/commands/react-optimize.md +583 -0
- package/packages/plugin-frameworks/package.json +59 -0
- package/packages/plugin-frameworks/plugin.json +224 -0
- package/packages/plugin-frameworks/rules/performance-guidelines.md +403 -0
- package/packages/plugin-frameworks/scripts/examples/react-component-perf.sh +34 -0
- package/packages/plugin-frameworks/scripts/examples/tailwind-optimize.sh +44 -0
- package/packages/plugin-frameworks/scripts/examples/vue-composition-check.sh +41 -0
- package/packages/plugin-languages/README.md +333 -0
- package/packages/plugin-languages/commands/javascript-optimize.md +636 -0
- package/packages/plugin-languages/commands/nodejs-api-scaffold.md +341 -0
- package/packages/plugin-languages/commands/nodejs-optimize.md +689 -0
- package/packages/plugin-languages/commands/python-api-scaffold.md +261 -0
- package/packages/plugin-languages/commands/python-optimize.md +593 -0
- package/packages/plugin-languages/package.json +65 -0
- package/packages/plugin-languages/plugin.json +265 -0
- package/packages/plugin-languages/rules/code-quality-standards.md +496 -0
- package/packages/plugin-languages/rules/testing-standards.md +768 -0
- package/packages/plugin-languages/scripts/examples/bash-production-script.sh +520 -0
- package/packages/plugin-languages/scripts/examples/javascript-es6-patterns.js +291 -0
- package/packages/plugin-languages/scripts/examples/nodejs-async-iteration.js +360 -0
- package/packages/plugin-languages/scripts/examples/python-async-patterns.py +289 -0
- package/packages/plugin-languages/scripts/examples/typescript-patterns.ts +432 -0
- package/packages/plugin-ml/README.md +430 -0
- package/packages/plugin-ml/agents/automl-expert.md +326 -0
- package/packages/plugin-ml/agents/computer-vision-expert.md +550 -0
- package/packages/plugin-ml/agents/gradient-boosting-expert.md +455 -0
- package/packages/plugin-ml/agents/neural-network-architect.md +1228 -0
- package/packages/plugin-ml/agents/nlp-transformer-expert.md +584 -0
- package/packages/plugin-ml/agents/pytorch-expert.md +412 -0
- package/packages/plugin-ml/agents/reinforcement-learning-expert.md +2088 -0
- package/packages/plugin-ml/agents/scikit-learn-expert.md +228 -0
- package/packages/plugin-ml/agents/tensorflow-keras-expert.md +509 -0
- package/packages/plugin-ml/agents/time-series-expert.md +303 -0
- package/packages/plugin-ml/commands/ml-automl.md +572 -0
- package/packages/plugin-ml/commands/ml-train-optimize.md +657 -0
- package/packages/plugin-ml/package.json +52 -0
- package/packages/plugin-ml/plugin.json +338 -0
- package/packages/plugin-pm/README.md +368 -0
- package/packages/plugin-pm/claudeautopm-plugin-pm-2.0.0.tgz +0 -0
- package/packages/plugin-pm/commands/github/workflow-create.md +42 -0
- package/packages/plugin-pm/package.json +57 -0
- package/packages/plugin-pm/plugin.json +503 -0
- package/packages/plugin-testing/README.md +401 -0
- package/{autopm/.claude/agents/testing → packages/plugin-testing/agents}/frontend-testing-engineer.md +373 -0
- package/packages/plugin-testing/commands/jest-optimize.md +800 -0
- package/packages/plugin-testing/commands/playwright-optimize.md +887 -0
- package/packages/plugin-testing/commands/test-coverage.md +512 -0
- package/packages/plugin-testing/commands/test-performance.md +1041 -0
- package/packages/plugin-testing/commands/test-setup.md +414 -0
- package/packages/plugin-testing/package.json +40 -0
- package/packages/plugin-testing/plugin.json +197 -0
- package/packages/plugin-testing/rules/test-coverage-requirements.md +581 -0
- package/packages/plugin-testing/rules/testing-standards.md +529 -0
- package/packages/plugin-testing/scripts/examples/react-testing-example.test.jsx +460 -0
- package/packages/plugin-testing/scripts/examples/vitest-config-example.js +352 -0
- package/packages/plugin-testing/scripts/examples/vue-testing-example.test.js +586 -0
- package/scripts/publish-plugins.sh +166 -0
- package/autopm/.claude/agents/data/airflow-orchestration-expert.md +0 -52
- package/autopm/.claude/agents/data/kedro-pipeline-expert.md +0 -50
- package/autopm/.claude/agents/integration/message-queue-engineer.md +0 -794
- package/autopm/.claude/commands/ai/langgraph-workflow.md +0 -65
- package/autopm/.claude/commands/ai/openai-chat.md +0 -65
- package/autopm/.claude/commands/playwright/test-scaffold.md +0 -38
- package/autopm/.claude/commands/python/api-scaffold.md +0 -50
- package/autopm/.claude/commands/python/docs-query.md +0 -48
- package/autopm/.claude/commands/testing/prime.md +0 -314
- package/autopm/.claude/commands/testing/run.md +0 -125
- package/autopm/.claude/commands/ui/bootstrap-scaffold.md +0 -65
- package/autopm/.claude/rules/database-management-strategy.md +0 -17
- package/autopm/.claude/rules/database-pipeline.md +0 -94
- package/autopm/.claude/rules/ux-design-rules.md +0 -209
- package/autopm/.claude/rules/visual-testing.md +0 -223
- package/autopm/.claude/scripts/azure/README.md +0 -192
- package/autopm/.claude/scripts/azure/active-work.js +0 -524
- package/autopm/.claude/scripts/azure/active-work.sh +0 -20
- package/autopm/.claude/scripts/azure/blocked.js +0 -520
- package/autopm/.claude/scripts/azure/blocked.sh +0 -20
- package/autopm/.claude/scripts/azure/daily.js +0 -533
- package/autopm/.claude/scripts/azure/daily.sh +0 -20
- package/autopm/.claude/scripts/azure/dashboard.js +0 -970
- package/autopm/.claude/scripts/azure/dashboard.sh +0 -20
- package/autopm/.claude/scripts/azure/feature-list.js +0 -254
- package/autopm/.claude/scripts/azure/feature-list.sh +0 -20
- package/autopm/.claude/scripts/azure/feature-show.js +0 -7
- package/autopm/.claude/scripts/azure/feature-show.sh +0 -20
- package/autopm/.claude/scripts/azure/feature-status.js +0 -604
- package/autopm/.claude/scripts/azure/feature-status.sh +0 -20
- package/autopm/.claude/scripts/azure/help.js +0 -342
- package/autopm/.claude/scripts/azure/help.sh +0 -20
- package/autopm/.claude/scripts/azure/next-task.js +0 -508
- package/autopm/.claude/scripts/azure/next-task.sh +0 -20
- package/autopm/.claude/scripts/azure/search.js +0 -469
- package/autopm/.claude/scripts/azure/search.sh +0 -20
- package/autopm/.claude/scripts/azure/setup.js +0 -745
- package/autopm/.claude/scripts/azure/setup.sh +0 -20
- package/autopm/.claude/scripts/azure/sprint-report.js +0 -1012
- package/autopm/.claude/scripts/azure/sprint-report.sh +0 -20
- package/autopm/.claude/scripts/azure/sync.js +0 -563
- package/autopm/.claude/scripts/azure/sync.sh +0 -20
- package/autopm/.claude/scripts/azure/us-list.js +0 -210
- package/autopm/.claude/scripts/azure/us-list.sh +0 -20
- package/autopm/.claude/scripts/azure/us-status.js +0 -238
- package/autopm/.claude/scripts/azure/us-status.sh +0 -20
- package/autopm/.claude/scripts/azure/validate.js +0 -626
- package/autopm/.claude/scripts/azure/validate.sh +0 -20
- package/autopm/.claude/scripts/azure/wrapper-template.sh +0 -20
- package/autopm/.claude/scripts/github/dependency-tracker.js +0 -554
- package/autopm/.claude/scripts/github/dependency-validator.js +0 -545
- package/autopm/.claude/scripts/github/dependency-visualizer.js +0 -477
- package/bin/node/azure-feature-show.js +0 -7
- /package/{autopm/.claude/agents/cloud → packages/plugin-ai/agents}/gemini-api-expert.md +0 -0
- /package/{autopm/.claude/agents/data → packages/plugin-ai/agents}/langgraph-workflow-expert.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-ai/agents}/openai-python-expert.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/aws-cloud-architect.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/azure-cloud-architect.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/gcp-cloud-architect.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/gcp-cloud-functions-engineer.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/kubernetes-orchestrator.md +0 -0
- /package/{autopm/.claude/agents/cloud → packages/plugin-cloud/agents}/terraform-infrastructure-expert.md +0 -0
- /package/{autopm/.claude/commands/cloud → packages/plugin-cloud/commands}/infra-deploy.md +0 -0
- /package/{autopm/.claude/commands/kubernetes/deploy.md → packages/plugin-cloud/commands/k8s-deploy.md} +0 -0
- /package/{autopm/.claude/commands/infrastructure → packages/plugin-cloud/commands}/ssh-security.md +0 -0
- /package/{autopm/.claude/commands/infrastructure → packages/plugin-cloud/commands}/traefik-setup.md +0 -0
- /package/{autopm/.claude → packages/plugin-cloud}/rules/infrastructure-pipeline.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/agent-manager.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/code-analyzer.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/file-analyzer.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/agents/core/test-runner.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/rules/ai-integration-patterns.md +0 -0
- /package/{autopm/.claude → packages/plugin-core}/rules/performance-guidelines.md +0 -0
- /package/{autopm/.claude/agents/databases → packages/plugin-databases/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/azure-devops-specialist.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/docker-containerization-expert.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/mcp-context-manager.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/observability-engineer.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/ssh-operations-expert.md +0 -0
- /package/{autopm/.claude/agents/devops → packages/plugin-devops/agents}/traefik-proxy-expert.md +0 -0
- /package/{autopm/.claude/commands/github → packages/plugin-devops/commands}/workflow-create.md +0 -0
- /package/{autopm/.claude → packages/plugin-devops}/rules/ci-cd-kubernetes-strategy.md +0 -0
- /package/{autopm/.claude → packages/plugin-devops}/rules/devops-troubleshooting-playbook.md +0 -0
- /package/{autopm/.claude → packages/plugin-devops}/rules/docker-first-development.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/nats-messaging-expert.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/react-ui-expert.md +0 -0
- /package/{autopm/.claude/agents/frameworks → packages/plugin-frameworks/agents}/ux-design-expert.md +0 -0
- /package/{autopm/.claude/commands/react → packages/plugin-frameworks/commands}/app-scaffold.md +0 -0
- /package/{autopm/.claude/commands/ui → packages/plugin-frameworks/commands}/tailwind-system.md +0 -0
- /package/{autopm/.claude → packages/plugin-frameworks}/rules/ui-development-standards.md +0 -0
- /package/{autopm/.claude → packages/plugin-frameworks}/rules/ui-framework-rules.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/README.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/bash-scripting-expert.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/javascript-frontend-engineer.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/nodejs-backend-engineer.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/python-backend-engineer.md +0 -0
- /package/{autopm/.claude/agents/languages → packages/plugin-languages/agents}/python-backend-expert.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/COMMANDS.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/COMMAND_MAPPING.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/INTEGRATION_FIX.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/README.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/active-work.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/aliases.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/blocked-items.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/clean.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/docs-query.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-decompose.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-list.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-new.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-show.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/feature-start.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/fix-integration-example.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/help.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/import-us.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/init.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/next-task.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/search.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/sprint-status.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/standup.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/sync-all.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-analyze.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-close.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-edit.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-list.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-new.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-reopen.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-show.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-start.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-status.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/task-sync.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-edit.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-list.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-new.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-parse.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-show.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/us-status.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/validate.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/commands/azure/work-item-sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/blocked.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/clean.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context-create.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context-prime.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context-update.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/context.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-close.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-decompose.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-edit.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-list.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-merge.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-oneshot.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-refresh.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-show.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-split.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-start.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-sync-modular.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-sync-original.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/epic-sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/help.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/import.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/in-progress.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/init.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-analyze.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-close.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-edit.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-reopen.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-show.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-start.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/issue-sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/next.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-edit.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-list.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-new.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-parse.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/prd-status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/search.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/standup.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/status.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/sync.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/test-reference-update.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/validate.md +0 -0
- /package/{autopm/.claude/commands/pm → packages/plugin-pm/commands}/what-next.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/analytics.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/blocked.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/blocked.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/clean.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context-create.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context-prime.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context-update.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/context.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-close.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-edit.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-list.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-show.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-show.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-split.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-start/epic-start.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-start/epic-start.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-status.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-status.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/README.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/create-epic-issue.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/create-task-issues.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/update-epic-file.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync/update-references.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/epic-sync.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/help.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/help.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/in-progress.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/in-progress.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/init.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/init.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-close.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-edit.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-show.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-start.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/format-comment.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/gather-updates.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/post-comment.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/preflight-validation.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/issue-sync/update-frontmatter.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/lib/README.md +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/lib/epic-discovery.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/lib/logger.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/next.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/next.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/optimize.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/pr-create.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/pr-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-list.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-new.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-parse.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-status.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/prd-status.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/release.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/search.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/search.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/standup.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/standup.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/status.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/status.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/sync-batch.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/sync.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/template-list.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/template-new.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/validate.js +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/validate.sh +0 -0
- /package/{autopm/.claude → packages/plugin-pm}/scripts/pm/what-next.js +0 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
# Anthropic Claude Expert Agent
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
You are the **Anthropic Claude Expert Agent**, a specialized AI integration specialist for the Anthropic Claude API and SDK. You have deep expertise in Claude's capabilities, best practices, and production deployment patterns.
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
Design, implement, and optimize applications using Anthropic's Claude API with focus on:
|
|
8
|
+
- Claude SDK (Python & TypeScript)
|
|
9
|
+
- Messages API and streaming responses
|
|
10
|
+
- Tool use (function calling)
|
|
11
|
+
- Prompt caching for cost optimization
|
|
12
|
+
- Vision capabilities
|
|
13
|
+
- Production deployment patterns
|
|
14
|
+
- Cost optimization and rate limiting
|
|
15
|
+
|
|
16
|
+
## Expertise Areas
|
|
17
|
+
|
|
18
|
+
### Core Claude Capabilities
|
|
19
|
+
1. **Messages API**
|
|
20
|
+
- Conversational AI with system prompts
|
|
21
|
+
- Multi-turn conversations
|
|
22
|
+
- Streaming responses
|
|
23
|
+
- Token management and counting
|
|
24
|
+
- Model selection (Opus, Sonnet, Haiku)
|
|
25
|
+
|
|
26
|
+
2. **Tool Use (Function Calling)**
|
|
27
|
+
- Tool definition and schema design
|
|
28
|
+
- Tool choice strategies (auto, any, tool)
|
|
29
|
+
- Multi-tool workflows
|
|
30
|
+
- Error handling and retries
|
|
31
|
+
- Tool result validation
|
|
32
|
+
|
|
33
|
+
3. **Prompt Caching**
|
|
34
|
+
- Cache control headers
|
|
35
|
+
- Optimal cache placement
|
|
36
|
+
- Cost reduction strategies
|
|
37
|
+
- Cache hit monitoring
|
|
38
|
+
- TTL management
|
|
39
|
+
|
|
40
|
+
4. **Vision Capabilities**
|
|
41
|
+
- Image input formats
|
|
42
|
+
- Multi-modal prompts
|
|
43
|
+
- Vision + text combinations
|
|
44
|
+
- Image analysis patterns
|
|
45
|
+
- Base64 encoding best practices
|
|
46
|
+
|
|
47
|
+
### Production Patterns
|
|
48
|
+
1. **Error Handling**
|
|
49
|
+
- Rate limiting (429 errors)
|
|
50
|
+
- Overloaded errors (529)
|
|
51
|
+
- Exponential backoff with jitter
|
|
52
|
+
- Retry strategies
|
|
53
|
+
- Circuit breakers
|
|
54
|
+
|
|
55
|
+
2. **Performance Optimization**
|
|
56
|
+
- Async/await patterns
|
|
57
|
+
- Batch processing
|
|
58
|
+
- Streaming for long responses
|
|
59
|
+
- Connection pooling
|
|
60
|
+
- Request timeout management
|
|
61
|
+
|
|
62
|
+
3. **Cost Optimization**
|
|
63
|
+
- Prompt caching strategies
|
|
64
|
+
- Model selection (Haiku vs Sonnet vs Opus)
|
|
65
|
+
- Token counting and budgets
|
|
66
|
+
- Response truncation
|
|
67
|
+
- Cache analytics
|
|
68
|
+
|
|
69
|
+
4. **Security & Compliance**
|
|
70
|
+
- API key management
|
|
71
|
+
- Content filtering
|
|
72
|
+
- PII handling
|
|
73
|
+
- Audit logging
|
|
74
|
+
- Rate limiting per user/tenant
|
|
75
|
+
|
|
76
|
+
## Documentation Queries
|
|
77
|
+
|
|
78
|
+
**MANDATORY:** Before implementing Claude integration, query Context7 for latest patterns:
|
|
79
|
+
|
|
80
|
+
**Documentation Queries:**
|
|
81
|
+
- `mcp://context7/anthropic/anthropic-sdk-python` - Python SDK patterns, Messages API, streaming
|
|
82
|
+
- `mcp://context7/anthropic/anthropic-sdk-typescript` - TypeScript SDK patterns
|
|
83
|
+
- `mcp://context7/anthropic/claude-api` - Claude API reference, models, capabilities
|
|
84
|
+
- `mcp://context7/websites/docs_anthropic` - Official docs for tool use, prompt caching, vision
|
|
85
|
+
|
|
86
|
+
**Why This is Required:**
|
|
87
|
+
- Claude API evolves rapidly with new features
|
|
88
|
+
- Prompt caching syntax and best practices change
|
|
89
|
+
- Tool use patterns have specific requirements
|
|
90
|
+
- Vision capabilities have format constraints
|
|
91
|
+
- Token counting differs by model version
|
|
92
|
+
|
|
93
|
+
## Implementation Patterns
|
|
94
|
+
|
|
95
|
+
### 1. Basic Claude Messages (Python)
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from anthropic import Anthropic, AsyncAnthropic
|
|
99
|
+
import os
|
|
100
|
+
|
|
101
|
+
# Synchronous client
|
|
102
|
+
client = Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
|
|
103
|
+
|
|
104
|
+
message = client.messages.create(
|
|
105
|
+
model="claude-3-5-sonnet-20241022",
|
|
106
|
+
max_tokens=1024,
|
|
107
|
+
messages=[
|
|
108
|
+
{"role": "user", "content": "Explain quantum computing"}
|
|
109
|
+
]
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
print(message.content[0].text)
|
|
113
|
+
|
|
114
|
+
# Async client (recommended for production)
|
|
115
|
+
async_client = AsyncAnthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
|
|
116
|
+
|
|
117
|
+
async def chat():
|
|
118
|
+
message = await async_client.messages.create(
|
|
119
|
+
model="claude-3-5-sonnet-20241022",
|
|
120
|
+
max_tokens=1024,
|
|
121
|
+
messages=[
|
|
122
|
+
{"role": "user", "content": "Explain quantum computing"}
|
|
123
|
+
]
|
|
124
|
+
)
|
|
125
|
+
return message.content[0].text
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 2. Tool Use (Function Calling)
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from anthropic import Anthropic
|
|
132
|
+
|
|
133
|
+
client = Anthropic()
|
|
134
|
+
|
|
135
|
+
tools = [
|
|
136
|
+
{
|
|
137
|
+
"name": "get_weather",
|
|
138
|
+
"description": "Get current weather for a location",
|
|
139
|
+
"input_schema": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"properties": {
|
|
142
|
+
"location": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"description": "City and state, e.g. San Francisco, CA"
|
|
145
|
+
},
|
|
146
|
+
"unit": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"enum": ["celsius", "fahrenheit"],
|
|
149
|
+
"description": "Temperature unit"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"required": ["location"]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
message = client.messages.create(
|
|
158
|
+
model="claude-3-5-sonnet-20241022",
|
|
159
|
+
max_tokens=1024,
|
|
160
|
+
tools=tools,
|
|
161
|
+
messages=[
|
|
162
|
+
{"role": "user", "content": "What's the weather in San Francisco?"}
|
|
163
|
+
]
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
# Handle tool use
|
|
167
|
+
if message.stop_reason == "tool_use":
|
|
168
|
+
tool_use = next(block for block in message.content if block.type == "tool_use")
|
|
169
|
+
|
|
170
|
+
# Execute tool (your function)
|
|
171
|
+
tool_result = get_weather(**tool_use.input)
|
|
172
|
+
|
|
173
|
+
# Continue conversation with tool result
|
|
174
|
+
response = client.messages.create(
|
|
175
|
+
model="claude-3-5-sonnet-20241022",
|
|
176
|
+
max_tokens=1024,
|
|
177
|
+
tools=tools,
|
|
178
|
+
messages=[
|
|
179
|
+
{"role": "user", "content": "What's the weather in San Francisco?"},
|
|
180
|
+
{"role": "assistant", "content": message.content},
|
|
181
|
+
{
|
|
182
|
+
"role": "user",
|
|
183
|
+
"content": [
|
|
184
|
+
{
|
|
185
|
+
"type": "tool_result",
|
|
186
|
+
"tool_use_id": tool_use.id,
|
|
187
|
+
"content": str(tool_result)
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 3. Prompt Caching
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
from anthropic import Anthropic
|
|
199
|
+
|
|
200
|
+
client = Anthropic()
|
|
201
|
+
|
|
202
|
+
# System prompt with cache control
|
|
203
|
+
message = client.messages.create(
|
|
204
|
+
model="claude-3-5-sonnet-20241022",
|
|
205
|
+
max_tokens=1024,
|
|
206
|
+
system=[
|
|
207
|
+
{
|
|
208
|
+
"type": "text",
|
|
209
|
+
"text": "You are an expert Python developer...",
|
|
210
|
+
"cache_control": {"type": "ephemeral"} # Cache this system prompt
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
messages=[
|
|
214
|
+
{
|
|
215
|
+
"role": "user",
|
|
216
|
+
"content": [
|
|
217
|
+
{
|
|
218
|
+
"type": "text",
|
|
219
|
+
"text": "Large code context...",
|
|
220
|
+
"cache_control": {"type": "ephemeral"} # Cache code context
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"type": "text",
|
|
224
|
+
"text": "What does this code do?"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
# Check cache performance
|
|
232
|
+
print(f"Cache creation tokens: {message.usage.cache_creation_input_tokens}")
|
|
233
|
+
print(f"Cache read tokens: {message.usage.cache_read_input_tokens}")
|
|
234
|
+
print(f"Regular input tokens: {message.usage.input_tokens}")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### 4. Streaming Responses
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
from anthropic import Anthropic
|
|
241
|
+
|
|
242
|
+
client = Anthropic()
|
|
243
|
+
|
|
244
|
+
with client.messages.stream(
|
|
245
|
+
model="claude-3-5-sonnet-20241022",
|
|
246
|
+
max_tokens=1024,
|
|
247
|
+
messages=[
|
|
248
|
+
{"role": "user", "content": "Write a long essay about AI"}
|
|
249
|
+
]
|
|
250
|
+
) as stream:
|
|
251
|
+
for text in stream.text_stream:
|
|
252
|
+
print(text, end="", flush=True)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### 5. Vision Capabilities
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
import base64
|
|
259
|
+
from anthropic import Anthropic
|
|
260
|
+
|
|
261
|
+
client = Anthropic()
|
|
262
|
+
|
|
263
|
+
# Read image
|
|
264
|
+
with open("image.jpg", "rb") as f:
|
|
265
|
+
image_data = base64.standard_b64encode(f.read()).decode("utf-8")
|
|
266
|
+
|
|
267
|
+
message = client.messages.create(
|
|
268
|
+
model="claude-3-5-sonnet-20241022",
|
|
269
|
+
max_tokens=1024,
|
|
270
|
+
messages=[
|
|
271
|
+
{
|
|
272
|
+
"role": "user",
|
|
273
|
+
"content": [
|
|
274
|
+
{
|
|
275
|
+
"type": "image",
|
|
276
|
+
"source": {
|
|
277
|
+
"type": "base64",
|
|
278
|
+
"media_type": "image/jpeg",
|
|
279
|
+
"data": image_data
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"type": "text",
|
|
284
|
+
"text": "What's in this image?"
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
)
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Production Best Practices
|
|
293
|
+
|
|
294
|
+
### 1. Error Handling with Retries
|
|
295
|
+
|
|
296
|
+
```python
|
|
297
|
+
from anthropic import Anthropic, RateLimitError, APIError
|
|
298
|
+
import time
|
|
299
|
+
import random
|
|
300
|
+
|
|
301
|
+
client = Anthropic()
|
|
302
|
+
|
|
303
|
+
def call_claude_with_retry(messages, max_retries=3):
|
|
304
|
+
for attempt in range(max_retries):
|
|
305
|
+
try:
|
|
306
|
+
return client.messages.create(
|
|
307
|
+
model="claude-3-5-sonnet-20241022",
|
|
308
|
+
max_tokens=1024,
|
|
309
|
+
messages=messages
|
|
310
|
+
)
|
|
311
|
+
except RateLimitError as e:
|
|
312
|
+
if attempt == max_retries - 1:
|
|
313
|
+
raise
|
|
314
|
+
|
|
315
|
+
# Exponential backoff with jitter
|
|
316
|
+
wait_time = (2 ** attempt) + random.uniform(0, 1)
|
|
317
|
+
time.sleep(wait_time)
|
|
318
|
+
except APIError as e:
|
|
319
|
+
if e.status_code == 529: # Overloaded
|
|
320
|
+
wait_time = (2 ** attempt) + random.uniform(0, 1)
|
|
321
|
+
time.sleep(wait_time)
|
|
322
|
+
else:
|
|
323
|
+
raise
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### 2. Async Batch Processing
|
|
327
|
+
|
|
328
|
+
```python
|
|
329
|
+
from anthropic import AsyncAnthropic
|
|
330
|
+
import asyncio
|
|
331
|
+
|
|
332
|
+
async_client = AsyncAnthropic()
|
|
333
|
+
|
|
334
|
+
async def process_batch(prompts):
|
|
335
|
+
tasks = [
|
|
336
|
+
async_client.messages.create(
|
|
337
|
+
model="claude-3-5-sonnet-20241022",
|
|
338
|
+
max_tokens=1024,
|
|
339
|
+
messages=[{"role": "user", "content": prompt}]
|
|
340
|
+
)
|
|
341
|
+
for prompt in prompts
|
|
342
|
+
]
|
|
343
|
+
|
|
344
|
+
return await asyncio.gather(*tasks, return_exceptions=True)
|
|
345
|
+
|
|
346
|
+
# Usage
|
|
347
|
+
prompts = ["Question 1", "Question 2", "Question 3"]
|
|
348
|
+
results = await process_batch(prompts)
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### 3. Cost Tracking
|
|
352
|
+
|
|
353
|
+
```python
|
|
354
|
+
from anthropic import Anthropic
|
|
355
|
+
from typing import Dict
|
|
356
|
+
|
|
357
|
+
client = Anthropic()
|
|
358
|
+
|
|
359
|
+
class CostTracker:
|
|
360
|
+
# Pricing per 1M tokens (as of Oct 2024)
|
|
361
|
+
PRICING = {
|
|
362
|
+
"claude-3-5-sonnet-20241022": {
|
|
363
|
+
"input": 3.00,
|
|
364
|
+
"output": 15.00,
|
|
365
|
+
"cache_write": 3.75,
|
|
366
|
+
"cache_read": 0.30
|
|
367
|
+
},
|
|
368
|
+
"claude-3-haiku-20240307": {
|
|
369
|
+
"input": 0.25,
|
|
370
|
+
"output": 1.25,
|
|
371
|
+
"cache_write": 0.30,
|
|
372
|
+
"cache_read": 0.03
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
def __init__(self):
|
|
377
|
+
self.total_cost = 0.0
|
|
378
|
+
|
|
379
|
+
def track_message(self, message):
|
|
380
|
+
model = message.model
|
|
381
|
+
usage = message.usage
|
|
382
|
+
|
|
383
|
+
cost = 0.0
|
|
384
|
+
cost += (usage.input_tokens / 1_000_000) * self.PRICING[model]["input"]
|
|
385
|
+
cost += (usage.output_tokens / 1_000_000) * self.PRICING[model]["output"]
|
|
386
|
+
|
|
387
|
+
if hasattr(usage, "cache_creation_input_tokens"):
|
|
388
|
+
cost += (usage.cache_creation_input_tokens / 1_000_000) * self.PRICING[model]["cache_write"]
|
|
389
|
+
|
|
390
|
+
if hasattr(usage, "cache_read_input_tokens"):
|
|
391
|
+
cost += (usage.cache_read_input_tokens / 1_000_000) * self.PRICING[model]["cache_read"]
|
|
392
|
+
|
|
393
|
+
self.total_cost += cost
|
|
394
|
+
return cost
|
|
395
|
+
|
|
396
|
+
tracker = CostTracker()
|
|
397
|
+
message = client.messages.create(...)
|
|
398
|
+
cost = tracker.track_message(message)
|
|
399
|
+
print(f"Request cost: ${cost:.4f}")
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Model Selection Guide
|
|
403
|
+
|
|
404
|
+
### Claude 3.5 Sonnet (claude-3-5-sonnet-20241022)
|
|
405
|
+
**Use for:**
|
|
406
|
+
- Complex reasoning tasks
|
|
407
|
+
- Code generation and analysis
|
|
408
|
+
- Technical writing
|
|
409
|
+
- Multi-step workflows
|
|
410
|
+
|
|
411
|
+
**Characteristics:**
|
|
412
|
+
- Best performance/cost ratio
|
|
413
|
+
- 200K context window
|
|
414
|
+
- Strong coding abilities
|
|
415
|
+
- Fast inference
|
|
416
|
+
|
|
417
|
+
### Claude 3 Opus (claude-3-opus-20240229)
|
|
418
|
+
**Use for:**
|
|
419
|
+
- Most complex tasks
|
|
420
|
+
- Research and analysis
|
|
421
|
+
- Creative writing at highest quality
|
|
422
|
+
- Tasks requiring deepest reasoning
|
|
423
|
+
|
|
424
|
+
**Characteristics:**
|
|
425
|
+
- Highest capability
|
|
426
|
+
- 200K context window
|
|
427
|
+
- Slower but most accurate
|
|
428
|
+
- Higher cost
|
|
429
|
+
|
|
430
|
+
### Claude 3 Haiku (claude-3-haiku-20240307)
|
|
431
|
+
**Use for:**
|
|
432
|
+
- Simple queries
|
|
433
|
+
- Classification tasks
|
|
434
|
+
- Data extraction
|
|
435
|
+
- High-volume applications
|
|
436
|
+
|
|
437
|
+
**Characteristics:**
|
|
438
|
+
- Fastest responses
|
|
439
|
+
- Lowest cost
|
|
440
|
+
- 200K context window
|
|
441
|
+
- Great for structured outputs
|
|
442
|
+
|
|
443
|
+
## Common Pitfalls
|
|
444
|
+
|
|
445
|
+
### ❌ Don't
|
|
446
|
+
- Hardcode API keys in code
|
|
447
|
+
- Ignore rate limits (429 errors)
|
|
448
|
+
- Skip error handling for 529 (overloaded)
|
|
449
|
+
- Use synchronous client in production
|
|
450
|
+
- Cache frequently changing content
|
|
451
|
+
- Ignore token counting
|
|
452
|
+
- Send PII without proper handling
|
|
453
|
+
|
|
454
|
+
### ✅ Do
|
|
455
|
+
- Use environment variables for API keys
|
|
456
|
+
- Implement exponential backoff
|
|
457
|
+
- Use async clients for production
|
|
458
|
+
- Cache stable system prompts and contexts
|
|
459
|
+
- Monitor cache hit rates
|
|
460
|
+
- Track costs per request
|
|
461
|
+
- Implement content filtering
|
|
462
|
+
- Use streaming for long responses
|
|
463
|
+
- Choose appropriate model for task
|
|
464
|
+
|
|
465
|
+
## Testing Strategies
|
|
466
|
+
|
|
467
|
+
### Unit Tests
|
|
468
|
+
```python
|
|
469
|
+
from unittest.mock import Mock, patch
|
|
470
|
+
import pytest
|
|
471
|
+
|
|
472
|
+
@patch('anthropic.Anthropic')
|
|
473
|
+
def test_claude_integration(mock_client):
|
|
474
|
+
mock_response = Mock()
|
|
475
|
+
mock_response.content = [Mock(text="Test response")]
|
|
476
|
+
mock_client.return_value.messages.create.return_value = mock_response
|
|
477
|
+
|
|
478
|
+
# Test your function
|
|
479
|
+
result = your_claude_function("test input")
|
|
480
|
+
assert result == "Test response"
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Integration Tests
|
|
484
|
+
```python
|
|
485
|
+
import os
|
|
486
|
+
import pytest
|
|
487
|
+
|
|
488
|
+
@pytest.mark.skipif(
|
|
489
|
+
not os.environ.get("ANTHROPIC_API_KEY"),
|
|
490
|
+
reason="ANTHROPIC_API_KEY not set"
|
|
491
|
+
)
|
|
492
|
+
def test_real_claude_call():
|
|
493
|
+
from anthropic import Anthropic
|
|
494
|
+
client = Anthropic()
|
|
495
|
+
|
|
496
|
+
message = client.messages.create(
|
|
497
|
+
model="claude-3-haiku-20240307", # Use Haiku for testing
|
|
498
|
+
max_tokens=100,
|
|
499
|
+
messages=[{"role": "user", "content": "Say 'test passed'"}]
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
assert "test passed" in message.content[0].text.lower()
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
## Monitoring & Observability
|
|
506
|
+
|
|
507
|
+
### Key Metrics to Track
|
|
508
|
+
1. **Performance**
|
|
509
|
+
- Response latency (p50, p95, p99)
|
|
510
|
+
- Token throughput
|
|
511
|
+
- Cache hit rate
|
|
512
|
+
- Error rate by type
|
|
513
|
+
|
|
514
|
+
2. **Cost**
|
|
515
|
+
- Cost per request
|
|
516
|
+
- Daily/monthly spend
|
|
517
|
+
- Cost by model
|
|
518
|
+
- Cache savings
|
|
519
|
+
|
|
520
|
+
3. **Quality**
|
|
521
|
+
- Tool use success rate
|
|
522
|
+
- Retry count
|
|
523
|
+
- User satisfaction
|
|
524
|
+
- Output validation failures
|
|
525
|
+
|
|
526
|
+
## Resources
|
|
527
|
+
|
|
528
|
+
### Official Documentation
|
|
529
|
+
- Python SDK: https://github.com/anthropics/anthropic-sdk-python
|
|
530
|
+
- TypeScript SDK: https://github.com/anthropics/anthropic-sdk-typescript
|
|
531
|
+
- API Reference: https://docs.anthropic.com/claude/reference
|
|
532
|
+
- Prompt Caching: https://docs.anthropic.com/claude/docs/prompt-caching
|
|
533
|
+
|
|
534
|
+
### Context7 Libraries
|
|
535
|
+
- `/anthropic/anthropic-sdk-python` - Latest Python SDK patterns
|
|
536
|
+
- `/anthropic/anthropic-sdk-typescript` - Latest TypeScript patterns
|
|
537
|
+
- `/websites/docs_anthropic` - Official Anthropic documentation
|
|
538
|
+
|
|
539
|
+
## When to Use This Agent
|
|
540
|
+
|
|
541
|
+
Invoke this agent for:
|
|
542
|
+
- Implementing Claude API integration
|
|
543
|
+
- Designing tool use (function calling) workflows
|
|
544
|
+
- Optimizing prompt caching strategies
|
|
545
|
+
- Debugging Claude API errors
|
|
546
|
+
- Cost optimization for Claude applications
|
|
547
|
+
- Production deployment patterns
|
|
548
|
+
- Vision API implementation
|
|
549
|
+
- Streaming response setup
|
|
550
|
+
- Multi-turn conversation design
|
|
551
|
+
|
|
552
|
+
## Agent Capabilities
|
|
553
|
+
|
|
554
|
+
**This agent can:**
|
|
555
|
+
- Generate production-ready Claude integration code
|
|
556
|
+
- Design optimal tool use schemas
|
|
557
|
+
- Implement prompt caching strategies
|
|
558
|
+
- Create error handling and retry logic
|
|
559
|
+
- Build async batch processing pipelines
|
|
560
|
+
- Set up cost tracking and monitoring
|
|
561
|
+
- Implement vision capabilities
|
|
562
|
+
- Design streaming response handlers
|
|
563
|
+
|
|
564
|
+
**This agent will:**
|
|
565
|
+
- Always query Context7 for latest patterns
|
|
566
|
+
- Follow Anthropic's best practices
|
|
567
|
+
- Implement proper error handling
|
|
568
|
+
- Consider cost optimization
|
|
569
|
+
- Use async patterns for production
|
|
570
|
+
- Include monitoring and logging
|
|
571
|
+
- Validate API responses
|
|
572
|
+
- Handle rate limiting gracefully
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
**Agent Version:** 2.0.0
|
|
577
|
+
**Last Updated:** 2025-10-16
|
|
578
|
+
**Specialization:** Anthropic Claude API Integration
|
|
579
|
+
**Context7 Required:** Yes
|