claude-autopm 2.8.2 → 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.
Files changed (390) hide show
  1. package/README.md +399 -637
  2. package/package.json +2 -1
  3. package/packages/plugin-ai/LICENSE +21 -0
  4. package/packages/plugin-ai/README.md +316 -0
  5. package/packages/plugin-ai/agents/anthropic-claude-expert.md +579 -0
  6. package/packages/plugin-ai/agents/azure-openai-expert.md +1411 -0
  7. package/packages/plugin-ai/agents/gemini-api-expert.md +880 -0
  8. package/packages/plugin-ai/agents/google-a2a-expert.md +1445 -0
  9. package/packages/plugin-ai/agents/huggingface-expert.md +2131 -0
  10. package/packages/plugin-ai/agents/langchain-expert.md +1427 -0
  11. package/packages/plugin-ai/agents/langgraph-workflow-expert.md +520 -0
  12. package/packages/plugin-ai/agents/openai-python-expert.md +1087 -0
  13. package/packages/plugin-ai/commands/a2a-setup.md +886 -0
  14. package/packages/plugin-ai/commands/ai-model-deployment.md +481 -0
  15. package/packages/plugin-ai/commands/anthropic-optimize.md +793 -0
  16. package/packages/plugin-ai/commands/huggingface-deploy.md +789 -0
  17. package/packages/plugin-ai/commands/langchain-optimize.md +807 -0
  18. package/packages/plugin-ai/commands/llm-optimize.md +348 -0
  19. package/packages/plugin-ai/commands/openai-optimize.md +863 -0
  20. package/packages/plugin-ai/commands/rag-optimize.md +841 -0
  21. package/packages/plugin-ai/commands/rag-setup-scaffold.md +382 -0
  22. package/packages/plugin-ai/package.json +66 -0
  23. package/packages/plugin-ai/plugin.json +519 -0
  24. package/packages/plugin-ai/rules/ai-model-standards.md +449 -0
  25. package/packages/plugin-ai/rules/prompt-engineering-standards.md +509 -0
  26. package/packages/plugin-ai/scripts/examples/huggingface-inference-example.py +145 -0
  27. package/packages/plugin-ai/scripts/examples/langchain-rag-example.py +366 -0
  28. package/packages/plugin-ai/scripts/examples/mlflow-tracking-example.py +224 -0
  29. package/packages/plugin-ai/scripts/examples/openai-chat-example.py +425 -0
  30. package/packages/plugin-cloud/README.md +268 -0
  31. package/packages/plugin-cloud/agents/README.md +55 -0
  32. package/packages/plugin-cloud/agents/aws-cloud-architect.md +521 -0
  33. package/packages/plugin-cloud/agents/azure-cloud-architect.md +436 -0
  34. package/packages/plugin-cloud/agents/gcp-cloud-architect.md +385 -0
  35. package/packages/plugin-cloud/agents/gcp-cloud-functions-engineer.md +306 -0
  36. package/packages/plugin-cloud/agents/gemini-api-expert.md +880 -0
  37. package/packages/plugin-cloud/agents/kubernetes-orchestrator.md +566 -0
  38. package/packages/plugin-cloud/agents/openai-python-expert.md +1087 -0
  39. package/packages/plugin-cloud/agents/terraform-infrastructure-expert.md +454 -0
  40. package/packages/plugin-cloud/commands/cloud-cost-optimize.md +243 -0
  41. package/packages/plugin-cloud/commands/cloud-validate.md +196 -0
  42. package/packages/plugin-cloud/commands/infra-deploy.md +38 -0
  43. package/packages/plugin-cloud/commands/k8s-deploy.md +37 -0
  44. package/packages/plugin-cloud/commands/ssh-security.md +65 -0
  45. package/packages/plugin-cloud/commands/traefik-setup.md +65 -0
  46. package/packages/plugin-cloud/hooks/pre-cloud-deploy.js +456 -0
  47. package/packages/plugin-cloud/package.json +64 -0
  48. package/packages/plugin-cloud/plugin.json +338 -0
  49. package/packages/plugin-cloud/rules/cloud-security-compliance.md +313 -0
  50. package/packages/plugin-cloud/rules/infrastructure-pipeline.md +128 -0
  51. package/packages/plugin-cloud/scripts/examples/aws-validate.sh +30 -0
  52. package/packages/plugin-cloud/scripts/examples/azure-setup.sh +33 -0
  53. package/packages/plugin-cloud/scripts/examples/gcp-setup.sh +39 -0
  54. package/packages/plugin-cloud/scripts/examples/k8s-validate.sh +40 -0
  55. package/packages/plugin-cloud/scripts/examples/terraform-init.sh +26 -0
  56. package/packages/plugin-core/README.md +274 -0
  57. package/packages/plugin-core/agents/core/agent-manager.md +296 -0
  58. package/packages/plugin-core/agents/core/code-analyzer.md +131 -0
  59. package/packages/plugin-core/agents/core/file-analyzer.md +162 -0
  60. package/packages/plugin-core/agents/core/test-runner.md +200 -0
  61. package/packages/plugin-core/commands/code-rabbit.md +128 -0
  62. package/packages/plugin-core/commands/prompt.md +9 -0
  63. package/packages/plugin-core/commands/re-init.md +9 -0
  64. package/packages/plugin-core/hooks/context7-reminder.md +29 -0
  65. package/packages/plugin-core/hooks/enforce-agents.js +125 -0
  66. package/packages/plugin-core/hooks/enforce-agents.sh +35 -0
  67. package/packages/plugin-core/hooks/pre-agent-context7.js +224 -0
  68. package/packages/plugin-core/hooks/pre-command-context7.js +229 -0
  69. package/packages/plugin-core/hooks/strict-enforce-agents.sh +39 -0
  70. package/packages/plugin-core/hooks/test-hook.sh +21 -0
  71. package/packages/plugin-core/hooks/unified-context7-enforcement.sh +38 -0
  72. package/packages/plugin-core/package.json +45 -0
  73. package/packages/plugin-core/plugin.json +387 -0
  74. package/packages/plugin-core/rules/agent-coordination.md +549 -0
  75. package/packages/plugin-core/rules/agent-mandatory.md +170 -0
  76. package/packages/plugin-core/rules/ai-integration-patterns.md +219 -0
  77. package/packages/plugin-core/rules/command-pipelines.md +208 -0
  78. package/packages/plugin-core/rules/context-optimization.md +176 -0
  79. package/packages/plugin-core/rules/context7-enforcement.md +327 -0
  80. package/packages/plugin-core/rules/datetime.md +122 -0
  81. package/packages/plugin-core/rules/definition-of-done.md +272 -0
  82. package/packages/plugin-core/rules/development-environments.md +19 -0
  83. package/packages/plugin-core/rules/development-workflow.md +198 -0
  84. package/packages/plugin-core/rules/framework-path-rules.md +180 -0
  85. package/packages/plugin-core/rules/frontmatter-operations.md +64 -0
  86. package/packages/plugin-core/rules/git-strategy.md +237 -0
  87. package/packages/plugin-core/rules/golden-rules.md +181 -0
  88. package/packages/plugin-core/rules/naming-conventions.md +111 -0
  89. package/packages/plugin-core/rules/no-pr-workflow.md +183 -0
  90. package/packages/plugin-core/rules/performance-guidelines.md +403 -0
  91. package/packages/plugin-core/rules/pipeline-mandatory.md +109 -0
  92. package/packages/plugin-core/rules/security-checklist.md +318 -0
  93. package/packages/plugin-core/rules/standard-patterns.md +197 -0
  94. package/packages/plugin-core/rules/strip-frontmatter.md +85 -0
  95. package/packages/plugin-core/rules/tdd.enforcement.md +103 -0
  96. package/packages/plugin-core/rules/use-ast-grep.md +113 -0
  97. package/packages/plugin-core/scripts/lib/datetime-utils.sh +254 -0
  98. package/packages/plugin-core/scripts/lib/frontmatter-utils.sh +294 -0
  99. package/packages/plugin-core/scripts/lib/github-utils.sh +221 -0
  100. package/packages/plugin-core/scripts/lib/logging-utils.sh +199 -0
  101. package/packages/plugin-core/scripts/lib/validation-utils.sh +339 -0
  102. package/packages/plugin-core/scripts/mcp/add.sh +7 -0
  103. package/packages/plugin-core/scripts/mcp/disable.sh +12 -0
  104. package/packages/plugin-core/scripts/mcp/enable.sh +12 -0
  105. package/packages/plugin-core/scripts/mcp/list.sh +7 -0
  106. package/packages/plugin-core/scripts/mcp/sync.sh +8 -0
  107. package/packages/plugin-data/README.md +315 -0
  108. package/packages/plugin-data/agents/airflow-orchestration-expert.md +158 -0
  109. package/packages/plugin-data/agents/kedro-pipeline-expert.md +304 -0
  110. package/packages/plugin-data/agents/langgraph-workflow-expert.md +530 -0
  111. package/packages/plugin-data/commands/airflow-dag-scaffold.md +413 -0
  112. package/packages/plugin-data/commands/kafka-pipeline-scaffold.md +503 -0
  113. package/packages/plugin-data/package.json +66 -0
  114. package/packages/plugin-data/plugin.json +294 -0
  115. package/packages/plugin-data/rules/data-quality-standards.md +373 -0
  116. package/packages/plugin-data/rules/etl-pipeline-standards.md +255 -0
  117. package/packages/plugin-data/scripts/examples/airflow-dag-example.py +245 -0
  118. package/packages/plugin-data/scripts/examples/dbt-transform-example.sql +238 -0
  119. package/packages/plugin-data/scripts/examples/kafka-streaming-example.py +257 -0
  120. package/packages/plugin-data/scripts/examples/pandas-etl-example.py +332 -0
  121. package/packages/plugin-databases/README.md +330 -0
  122. package/packages/plugin-databases/agents/README.md +50 -0
  123. package/packages/plugin-databases/agents/bigquery-expert.md +401 -0
  124. package/packages/plugin-databases/agents/cosmosdb-expert.md +375 -0
  125. package/packages/plugin-databases/agents/mongodb-expert.md +407 -0
  126. package/packages/plugin-databases/agents/postgresql-expert.md +329 -0
  127. package/packages/plugin-databases/agents/redis-expert.md +74 -0
  128. package/packages/plugin-databases/commands/db-optimize.md +612 -0
  129. package/packages/plugin-databases/package.json +60 -0
  130. package/packages/plugin-databases/plugin.json +237 -0
  131. package/packages/plugin-databases/rules/database-management-strategy.md +146 -0
  132. package/packages/plugin-databases/rules/database-pipeline.md +316 -0
  133. package/packages/plugin-databases/scripts/examples/bigquery-cost-analyze.sh +160 -0
  134. package/packages/plugin-databases/scripts/examples/cosmosdb-ru-optimize.sh +163 -0
  135. package/packages/plugin-databases/scripts/examples/mongodb-shard-check.sh +120 -0
  136. package/packages/plugin-databases/scripts/examples/postgres-index-analyze.sh +95 -0
  137. package/packages/plugin-databases/scripts/examples/redis-cache-stats.sh +121 -0
  138. package/packages/plugin-devops/README.md +367 -0
  139. package/packages/plugin-devops/agents/README.md +52 -0
  140. package/packages/plugin-devops/agents/azure-devops-specialist.md +308 -0
  141. package/packages/plugin-devops/agents/docker-containerization-expert.md +298 -0
  142. package/packages/plugin-devops/agents/github-operations-specialist.md +335 -0
  143. package/packages/plugin-devops/agents/mcp-context-manager.md +319 -0
  144. package/packages/plugin-devops/agents/observability-engineer.md +574 -0
  145. package/packages/plugin-devops/agents/ssh-operations-expert.md +1093 -0
  146. package/packages/plugin-devops/agents/traefik-proxy-expert.md +444 -0
  147. package/packages/plugin-devops/commands/ci-pipeline-create.md +581 -0
  148. package/packages/plugin-devops/commands/docker-optimize.md +493 -0
  149. package/packages/plugin-devops/commands/workflow-create.md +42 -0
  150. package/packages/plugin-devops/hooks/pre-docker-build.js +472 -0
  151. package/packages/plugin-devops/package.json +61 -0
  152. package/packages/plugin-devops/plugin.json +302 -0
  153. package/packages/plugin-devops/rules/ci-cd-kubernetes-strategy.md +25 -0
  154. package/packages/plugin-devops/rules/devops-troubleshooting-playbook.md +450 -0
  155. package/packages/plugin-devops/rules/docker-first-development.md +404 -0
  156. package/packages/plugin-devops/rules/github-operations.md +92 -0
  157. package/packages/plugin-devops/scripts/examples/docker-build-multistage.sh +43 -0
  158. package/packages/plugin-devops/scripts/examples/docker-compose-validate.sh +74 -0
  159. package/packages/plugin-devops/scripts/examples/github-workflow-validate.sh +48 -0
  160. package/packages/plugin-devops/scripts/examples/prometheus-health-check.sh +58 -0
  161. package/packages/plugin-devops/scripts/examples/ssh-key-setup.sh +74 -0
  162. package/packages/plugin-frameworks/README.md +309 -0
  163. package/packages/plugin-frameworks/agents/README.md +64 -0
  164. package/packages/plugin-frameworks/agents/e2e-test-engineer.md +579 -0
  165. package/packages/plugin-frameworks/agents/nats-messaging-expert.md +254 -0
  166. package/packages/plugin-frameworks/agents/react-frontend-engineer.md +393 -0
  167. package/packages/plugin-frameworks/agents/react-ui-expert.md +226 -0
  168. package/packages/plugin-frameworks/agents/tailwindcss-expert.md +1021 -0
  169. package/packages/plugin-frameworks/agents/ux-design-expert.md +244 -0
  170. package/packages/plugin-frameworks/commands/app-scaffold.md +50 -0
  171. package/packages/plugin-frameworks/commands/nextjs-optimize.md +692 -0
  172. package/packages/plugin-frameworks/commands/react-optimize.md +583 -0
  173. package/packages/plugin-frameworks/commands/tailwind-system.md +64 -0
  174. package/packages/plugin-frameworks/package.json +59 -0
  175. package/packages/plugin-frameworks/plugin.json +224 -0
  176. package/packages/plugin-frameworks/rules/performance-guidelines.md +403 -0
  177. package/packages/plugin-frameworks/rules/ui-development-standards.md +281 -0
  178. package/packages/plugin-frameworks/rules/ui-framework-rules.md +151 -0
  179. package/packages/plugin-frameworks/scripts/examples/react-component-perf.sh +34 -0
  180. package/packages/plugin-frameworks/scripts/examples/tailwind-optimize.sh +44 -0
  181. package/packages/plugin-frameworks/scripts/examples/vue-composition-check.sh +41 -0
  182. package/packages/plugin-languages/README.md +333 -0
  183. package/packages/plugin-languages/agents/README.md +50 -0
  184. package/packages/plugin-languages/agents/bash-scripting-expert.md +541 -0
  185. package/packages/plugin-languages/agents/javascript-frontend-engineer.md +197 -0
  186. package/packages/plugin-languages/agents/nodejs-backend-engineer.md +226 -0
  187. package/packages/plugin-languages/agents/python-backend-engineer.md +214 -0
  188. package/packages/plugin-languages/agents/python-backend-expert.md +289 -0
  189. package/packages/plugin-languages/commands/javascript-optimize.md +636 -0
  190. package/packages/plugin-languages/commands/nodejs-api-scaffold.md +341 -0
  191. package/packages/plugin-languages/commands/nodejs-optimize.md +689 -0
  192. package/packages/plugin-languages/commands/python-api-scaffold.md +261 -0
  193. package/packages/plugin-languages/commands/python-optimize.md +593 -0
  194. package/packages/plugin-languages/package.json +65 -0
  195. package/packages/plugin-languages/plugin.json +265 -0
  196. package/packages/plugin-languages/rules/code-quality-standards.md +496 -0
  197. package/packages/plugin-languages/rules/testing-standards.md +768 -0
  198. package/packages/plugin-languages/scripts/examples/bash-production-script.sh +520 -0
  199. package/packages/plugin-languages/scripts/examples/javascript-es6-patterns.js +291 -0
  200. package/packages/plugin-languages/scripts/examples/nodejs-async-iteration.js +360 -0
  201. package/packages/plugin-languages/scripts/examples/python-async-patterns.py +289 -0
  202. package/packages/plugin-languages/scripts/examples/typescript-patterns.ts +432 -0
  203. package/packages/plugin-ml/README.md +430 -0
  204. package/packages/plugin-ml/agents/automl-expert.md +326 -0
  205. package/packages/plugin-ml/agents/computer-vision-expert.md +550 -0
  206. package/packages/plugin-ml/agents/gradient-boosting-expert.md +455 -0
  207. package/packages/plugin-ml/agents/neural-network-architect.md +1228 -0
  208. package/packages/plugin-ml/agents/nlp-transformer-expert.md +584 -0
  209. package/packages/plugin-ml/agents/pytorch-expert.md +412 -0
  210. package/packages/plugin-ml/agents/reinforcement-learning-expert.md +2088 -0
  211. package/packages/plugin-ml/agents/scikit-learn-expert.md +228 -0
  212. package/packages/plugin-ml/agents/tensorflow-keras-expert.md +509 -0
  213. package/packages/plugin-ml/agents/time-series-expert.md +303 -0
  214. package/packages/plugin-ml/commands/ml-automl.md +572 -0
  215. package/packages/plugin-ml/commands/ml-train-optimize.md +657 -0
  216. package/packages/plugin-ml/package.json +52 -0
  217. package/packages/plugin-ml/plugin.json +338 -0
  218. package/packages/plugin-pm/README.md +368 -0
  219. package/packages/plugin-pm/claudeautopm-plugin-pm-2.0.0.tgz +0 -0
  220. package/packages/plugin-pm/commands/azure/COMMANDS.md +107 -0
  221. package/packages/plugin-pm/commands/azure/COMMAND_MAPPING.md +252 -0
  222. package/packages/plugin-pm/commands/azure/INTEGRATION_FIX.md +103 -0
  223. package/packages/plugin-pm/commands/azure/README.md +246 -0
  224. package/packages/plugin-pm/commands/azure/active-work.md +198 -0
  225. package/packages/plugin-pm/commands/azure/aliases.md +143 -0
  226. package/packages/plugin-pm/commands/azure/blocked-items.md +287 -0
  227. package/packages/plugin-pm/commands/azure/clean.md +93 -0
  228. package/packages/plugin-pm/commands/azure/docs-query.md +48 -0
  229. package/packages/plugin-pm/commands/azure/feature-decompose.md +380 -0
  230. package/packages/plugin-pm/commands/azure/feature-list.md +61 -0
  231. package/packages/plugin-pm/commands/azure/feature-new.md +115 -0
  232. package/packages/plugin-pm/commands/azure/feature-show.md +205 -0
  233. package/packages/plugin-pm/commands/azure/feature-start.md +130 -0
  234. package/packages/plugin-pm/commands/azure/fix-integration-example.md +93 -0
  235. package/packages/plugin-pm/commands/azure/help.md +150 -0
  236. package/packages/plugin-pm/commands/azure/import-us.md +269 -0
  237. package/packages/plugin-pm/commands/azure/init.md +211 -0
  238. package/packages/plugin-pm/commands/azure/next-task.md +262 -0
  239. package/packages/plugin-pm/commands/azure/search.md +160 -0
  240. package/packages/plugin-pm/commands/azure/sprint-status.md +235 -0
  241. package/packages/plugin-pm/commands/azure/standup.md +260 -0
  242. package/packages/plugin-pm/commands/azure/sync-all.md +99 -0
  243. package/packages/plugin-pm/commands/azure/task-analyze.md +186 -0
  244. package/packages/plugin-pm/commands/azure/task-close.md +329 -0
  245. package/packages/plugin-pm/commands/azure/task-edit.md +145 -0
  246. package/packages/plugin-pm/commands/azure/task-list.md +263 -0
  247. package/packages/plugin-pm/commands/azure/task-new.md +84 -0
  248. package/packages/plugin-pm/commands/azure/task-reopen.md +79 -0
  249. package/packages/plugin-pm/commands/azure/task-show.md +126 -0
  250. package/packages/plugin-pm/commands/azure/task-start.md +301 -0
  251. package/packages/plugin-pm/commands/azure/task-status.md +65 -0
  252. package/packages/plugin-pm/commands/azure/task-sync.md +67 -0
  253. package/packages/plugin-pm/commands/azure/us-edit.md +164 -0
  254. package/packages/plugin-pm/commands/azure/us-list.md +202 -0
  255. package/packages/plugin-pm/commands/azure/us-new.md +265 -0
  256. package/packages/plugin-pm/commands/azure/us-parse.md +253 -0
  257. package/packages/plugin-pm/commands/azure/us-show.md +188 -0
  258. package/packages/plugin-pm/commands/azure/us-status.md +320 -0
  259. package/packages/plugin-pm/commands/azure/validate.md +86 -0
  260. package/packages/plugin-pm/commands/azure/work-item-sync.md +47 -0
  261. package/packages/plugin-pm/commands/blocked.md +28 -0
  262. package/packages/plugin-pm/commands/clean.md +119 -0
  263. package/packages/plugin-pm/commands/context-create.md +136 -0
  264. package/packages/plugin-pm/commands/context-prime.md +170 -0
  265. package/packages/plugin-pm/commands/context-update.md +292 -0
  266. package/packages/plugin-pm/commands/context.md +28 -0
  267. package/packages/plugin-pm/commands/epic-close.md +86 -0
  268. package/packages/plugin-pm/commands/epic-decompose.md +370 -0
  269. package/packages/plugin-pm/commands/epic-edit.md +83 -0
  270. package/packages/plugin-pm/commands/epic-list.md +30 -0
  271. package/packages/plugin-pm/commands/epic-merge.md +222 -0
  272. package/packages/plugin-pm/commands/epic-oneshot.md +119 -0
  273. package/packages/plugin-pm/commands/epic-refresh.md +119 -0
  274. package/packages/plugin-pm/commands/epic-show.md +28 -0
  275. package/packages/plugin-pm/commands/epic-split.md +120 -0
  276. package/packages/plugin-pm/commands/epic-start.md +195 -0
  277. package/packages/plugin-pm/commands/epic-status.md +28 -0
  278. package/packages/plugin-pm/commands/epic-sync-modular.md +338 -0
  279. package/packages/plugin-pm/commands/epic-sync-original.md +473 -0
  280. package/packages/plugin-pm/commands/epic-sync.md +486 -0
  281. package/packages/plugin-pm/commands/github/workflow-create.md +42 -0
  282. package/packages/plugin-pm/commands/help.md +28 -0
  283. package/packages/plugin-pm/commands/import.md +115 -0
  284. package/packages/plugin-pm/commands/in-progress.md +28 -0
  285. package/packages/plugin-pm/commands/init.md +28 -0
  286. package/packages/plugin-pm/commands/issue-analyze.md +202 -0
  287. package/packages/plugin-pm/commands/issue-close.md +119 -0
  288. package/packages/plugin-pm/commands/issue-edit.md +93 -0
  289. package/packages/plugin-pm/commands/issue-reopen.md +87 -0
  290. package/packages/plugin-pm/commands/issue-show.md +41 -0
  291. package/packages/plugin-pm/commands/issue-start.md +234 -0
  292. package/packages/plugin-pm/commands/issue-status.md +95 -0
  293. package/packages/plugin-pm/commands/issue-sync.md +411 -0
  294. package/packages/plugin-pm/commands/next.md +28 -0
  295. package/packages/plugin-pm/commands/prd-edit.md +82 -0
  296. package/packages/plugin-pm/commands/prd-list.md +28 -0
  297. package/packages/plugin-pm/commands/prd-new.md +55 -0
  298. package/packages/plugin-pm/commands/prd-parse.md +42 -0
  299. package/packages/plugin-pm/commands/prd-status.md +28 -0
  300. package/packages/plugin-pm/commands/search.md +28 -0
  301. package/packages/plugin-pm/commands/standup.md +28 -0
  302. package/packages/plugin-pm/commands/status.md +28 -0
  303. package/packages/plugin-pm/commands/sync.md +99 -0
  304. package/packages/plugin-pm/commands/test-reference-update.md +151 -0
  305. package/packages/plugin-pm/commands/validate.md +28 -0
  306. package/packages/plugin-pm/commands/what-next.md +28 -0
  307. package/packages/plugin-pm/package.json +57 -0
  308. package/packages/plugin-pm/plugin.json +503 -0
  309. package/packages/plugin-pm/scripts/pm/analytics.js +425 -0
  310. package/packages/plugin-pm/scripts/pm/blocked.js +164 -0
  311. package/packages/plugin-pm/scripts/pm/blocked.sh +78 -0
  312. package/packages/plugin-pm/scripts/pm/clean.js +464 -0
  313. package/packages/plugin-pm/scripts/pm/context-create.js +216 -0
  314. package/packages/plugin-pm/scripts/pm/context-prime.js +335 -0
  315. package/packages/plugin-pm/scripts/pm/context-update.js +344 -0
  316. package/packages/plugin-pm/scripts/pm/context.js +338 -0
  317. package/packages/plugin-pm/scripts/pm/epic-close.js +347 -0
  318. package/packages/plugin-pm/scripts/pm/epic-edit.js +382 -0
  319. package/packages/plugin-pm/scripts/pm/epic-list.js +273 -0
  320. package/packages/plugin-pm/scripts/pm/epic-list.sh +109 -0
  321. package/packages/plugin-pm/scripts/pm/epic-show.js +291 -0
  322. package/packages/plugin-pm/scripts/pm/epic-show.sh +105 -0
  323. package/packages/plugin-pm/scripts/pm/epic-split.js +522 -0
  324. package/packages/plugin-pm/scripts/pm/epic-start/epic-start.js +183 -0
  325. package/packages/plugin-pm/scripts/pm/epic-start/epic-start.sh +94 -0
  326. package/packages/plugin-pm/scripts/pm/epic-status.js +291 -0
  327. package/packages/plugin-pm/scripts/pm/epic-status.sh +104 -0
  328. package/packages/plugin-pm/scripts/pm/epic-sync/README.md +208 -0
  329. package/packages/plugin-pm/scripts/pm/epic-sync/create-epic-issue.sh +77 -0
  330. package/packages/plugin-pm/scripts/pm/epic-sync/create-task-issues.sh +86 -0
  331. package/packages/plugin-pm/scripts/pm/epic-sync/update-epic-file.sh +79 -0
  332. package/packages/plugin-pm/scripts/pm/epic-sync/update-references.sh +89 -0
  333. package/packages/plugin-pm/scripts/pm/epic-sync.sh +137 -0
  334. package/packages/plugin-pm/scripts/pm/help.js +92 -0
  335. package/packages/plugin-pm/scripts/pm/help.sh +90 -0
  336. package/packages/plugin-pm/scripts/pm/in-progress.js +178 -0
  337. package/packages/plugin-pm/scripts/pm/in-progress.sh +93 -0
  338. package/packages/plugin-pm/scripts/pm/init.js +321 -0
  339. package/packages/plugin-pm/scripts/pm/init.sh +178 -0
  340. package/packages/plugin-pm/scripts/pm/issue-close.js +232 -0
  341. package/packages/plugin-pm/scripts/pm/issue-edit.js +310 -0
  342. package/packages/plugin-pm/scripts/pm/issue-show.js +272 -0
  343. package/packages/plugin-pm/scripts/pm/issue-start.js +181 -0
  344. package/packages/plugin-pm/scripts/pm/issue-sync/format-comment.sh +468 -0
  345. package/packages/plugin-pm/scripts/pm/issue-sync/gather-updates.sh +460 -0
  346. package/packages/plugin-pm/scripts/pm/issue-sync/post-comment.sh +330 -0
  347. package/packages/plugin-pm/scripts/pm/issue-sync/preflight-validation.sh +348 -0
  348. package/packages/plugin-pm/scripts/pm/issue-sync/update-frontmatter.sh +387 -0
  349. package/packages/plugin-pm/scripts/pm/lib/README.md +85 -0
  350. package/packages/plugin-pm/scripts/pm/lib/epic-discovery.js +119 -0
  351. package/packages/plugin-pm/scripts/pm/lib/logger.js +78 -0
  352. package/packages/plugin-pm/scripts/pm/next.js +189 -0
  353. package/packages/plugin-pm/scripts/pm/next.sh +72 -0
  354. package/packages/plugin-pm/scripts/pm/optimize.js +407 -0
  355. package/packages/plugin-pm/scripts/pm/pr-create.js +337 -0
  356. package/packages/plugin-pm/scripts/pm/pr-list.js +257 -0
  357. package/packages/plugin-pm/scripts/pm/prd-list.js +242 -0
  358. package/packages/plugin-pm/scripts/pm/prd-list.sh +103 -0
  359. package/packages/plugin-pm/scripts/pm/prd-new.js +684 -0
  360. package/packages/plugin-pm/scripts/pm/prd-parse.js +547 -0
  361. package/packages/plugin-pm/scripts/pm/prd-status.js +152 -0
  362. package/packages/plugin-pm/scripts/pm/prd-status.sh +63 -0
  363. package/packages/plugin-pm/scripts/pm/release.js +460 -0
  364. package/packages/plugin-pm/scripts/pm/search.js +192 -0
  365. package/packages/plugin-pm/scripts/pm/search.sh +89 -0
  366. package/packages/plugin-pm/scripts/pm/standup.js +362 -0
  367. package/packages/plugin-pm/scripts/pm/standup.sh +95 -0
  368. package/packages/plugin-pm/scripts/pm/status.js +148 -0
  369. package/packages/plugin-pm/scripts/pm/status.sh +59 -0
  370. package/packages/plugin-pm/scripts/pm/sync-batch.js +337 -0
  371. package/packages/plugin-pm/scripts/pm/sync.js +343 -0
  372. package/packages/plugin-pm/scripts/pm/template-list.js +141 -0
  373. package/packages/plugin-pm/scripts/pm/template-new.js +366 -0
  374. package/packages/plugin-pm/scripts/pm/validate.js +274 -0
  375. package/packages/plugin-pm/scripts/pm/validate.sh +106 -0
  376. package/packages/plugin-pm/scripts/pm/what-next.js +660 -0
  377. package/packages/plugin-testing/README.md +401 -0
  378. package/packages/plugin-testing/agents/frontend-testing-engineer.md +768 -0
  379. package/packages/plugin-testing/commands/jest-optimize.md +800 -0
  380. package/packages/plugin-testing/commands/playwright-optimize.md +887 -0
  381. package/packages/plugin-testing/commands/test-coverage.md +512 -0
  382. package/packages/plugin-testing/commands/test-performance.md +1041 -0
  383. package/packages/plugin-testing/commands/test-setup.md +414 -0
  384. package/packages/plugin-testing/package.json +40 -0
  385. package/packages/plugin-testing/plugin.json +197 -0
  386. package/packages/plugin-testing/rules/test-coverage-requirements.md +581 -0
  387. package/packages/plugin-testing/rules/testing-standards.md +529 -0
  388. package/packages/plugin-testing/scripts/examples/react-testing-example.test.jsx +460 -0
  389. package/packages/plugin-testing/scripts/examples/vitest-config-example.js +352 -0
  390. package/packages/plugin-testing/scripts/examples/vue-testing-example.test.js +586 -0
@@ -0,0 +1,886 @@
1
+ ---
2
+ allowed-tools: Bash, Read, Write, LS
3
+ ---
4
+
5
+ # a2a:setup
6
+
7
+ Setup Google A2A (Agent-to-Agent) protocol with Context7-verified Vertex AI Agent Builder configuration and multi-agent orchestration.
8
+
9
+ ## Description
10
+
11
+ Comprehensive A2A protocol implementation following Google Cloud best practices:
12
+ - Vertex AI Agent Builder configuration
13
+ - A2A protocol implementation (gRPC/REST)
14
+ - Multi-agent orchestration patterns
15
+ - Agent discovery and registration
16
+ - Message passing and state management
17
+ - Tool sharing between agents
18
+ - Observability and monitoring
19
+
20
+ ## Required Documentation Access
21
+
22
+ **MANDATORY:** Before setup, query Context7 for Google A2A best practices:
23
+
24
+ **Documentation Queries:**
25
+ - `mcp://context7/googleapis/google-cloud-python/vertexai` - Vertex AI Agent Builder
26
+ - `mcp://context7/google-cloud/agent-builder` - Agent creation and management
27
+ - `mcp://context7/google-cloud/a2a-protocol` - A2A protocol specification
28
+ - `mcp://context7/google-cloud/multi-agent` - Multi-agent orchestration
29
+ - `mcp://context7/google-cloud/grpc-patterns` - gRPC communication patterns
30
+ - `mcp://context7/langchain/google-vertex` - LangChain Vertex AI integration
31
+
32
+ **Why This is Required:**
33
+ - Ensures setup follows official Google Cloud documentation
34
+ - Applies proven A2A protocol patterns
35
+ - Validates agent orchestration strategies
36
+ - Prevents integration issues
37
+ - Implements proper security and auth
38
+ - Optimizes multi-agent performance
39
+
40
+ ## Usage
41
+
42
+ ```bash
43
+ /a2a:setup [options]
44
+ ```
45
+
46
+ ## Options
47
+
48
+ - `--protocol <grpc|rest>` - Communication protocol (default: grpc)
49
+ - `--region <us-central1|europe-west1>` - GCP region (default: us-central1)
50
+ - `--project-id <id>` - GCP project ID
51
+ - `--output <file>` - Write setup report
52
+
53
+ ## Examples
54
+
55
+ ### Full A2A Setup
56
+ ```bash
57
+ /a2a:setup --project-id my-project --region us-central1
58
+ ```
59
+
60
+ ### REST Protocol Setup
61
+ ```bash
62
+ /a2a:setup --protocol rest --project-id my-project
63
+ ```
64
+
65
+ ### Generate Configuration
66
+ ```bash
67
+ /a2a:setup --output a2a-config.yaml
68
+ ```
69
+
70
+ ## Setup Categories
71
+
72
+ ### 1. Vertex AI Agent Builder Configuration (Context7-Verified)
73
+
74
+ **Pattern from Context7 (/googleapis/google-cloud-python/vertexai):**
75
+
76
+ #### Create Agent with Vertex AI
77
+ ```python
78
+ from google.cloud import aiplatform
79
+ from vertexai.preview.agents import Agent
80
+
81
+ # Initialize Vertex AI
82
+ aiplatform.init(
83
+ project="my-project-id",
84
+ location="us-central1"
85
+ )
86
+
87
+ # Create agent
88
+ agent = Agent.create(
89
+ display_name="research-agent",
90
+ description="Agent for research and information gathering",
91
+ instructions="""
92
+ You are a research assistant that helps users find and summarize information.
93
+ You have access to web search and document retrieval tools.
94
+ Always cite your sources.
95
+ """,
96
+ model="gemini-2.0-flash-exp",
97
+ tools=[
98
+ {"google_search": {}},
99
+ {"code_interpreter": {}},
100
+ {"function_declarations": [
101
+ {
102
+ "name": "search_documents",
103
+ "description": "Search internal document database",
104
+ "parameters": {
105
+ "type": "object",
106
+ "properties": {
107
+ "query": {"type": "string"},
108
+ "limit": {"type": "integer", "default": 10}
109
+ }
110
+ }
111
+ }
112
+ ]}
113
+ ]
114
+ )
115
+
116
+ print(f"Agent created: {agent.resource_name}")
117
+ print(f"Agent ID: {agent.name}")
118
+ ```
119
+
120
+ **Agent Configuration:**
121
+ - Models: gemini-2.0-flash-exp, gemini-1.5-pro, gemini-1.5-flash
122
+ - Built-in tools: Google Search, Code Interpreter
123
+ - Custom tools: Function declarations, HTTP endpoints
124
+ - Instructions: System prompt for agent behavior
125
+
126
+ #### List and Manage Agents
127
+ ```python
128
+ # List all agents
129
+ agents = Agent.list()
130
+
131
+ for agent in agents:
132
+ print(f"Agent: {agent.display_name}")
133
+ print(f" ID: {agent.name}")
134
+ print(f" Model: {agent.model}")
135
+
136
+ # Get specific agent
137
+ agent = Agent.get("projects/123/locations/us-central1/agents/456")
138
+
139
+ # Update agent
140
+ agent.instructions = "Updated instructions..."
141
+ agent.update()
142
+
143
+ # Delete agent
144
+ agent.delete()
145
+ ```
146
+
147
+ ### 2. A2A Protocol Implementation (Context7-Verified)
148
+
149
+ **Pattern from Context7 (/google-cloud/a2a-protocol):**
150
+
151
+ #### A2A Message Format (Protocol Buffers)
152
+ ```protobuf
153
+ // a2a.proto
154
+ syntax = "proto3";
155
+
156
+ package a2a;
157
+
158
+ // Agent-to-Agent message
159
+ message A2AMessage {
160
+ string sender_id = 1; // Sending agent ID
161
+ string receiver_id = 2; // Target agent ID
162
+ string conversation_id = 3; // Conversation context
163
+ MessageType type = 4;
164
+ oneof content {
165
+ Request request = 5;
166
+ Response response = 6;
167
+ Event event = 7;
168
+ }
169
+ map<string, string> metadata = 8;
170
+ int64 timestamp = 9;
171
+ }
172
+
173
+ enum MessageType {
174
+ REQUEST = 0;
175
+ RESPONSE = 1;
176
+ EVENT = 2;
177
+ ERROR = 3;
178
+ }
179
+
180
+ message Request {
181
+ string action = 1; // Action to perform
182
+ map<string, string> params = 2;
183
+ }
184
+
185
+ message Response {
186
+ bool success = 1;
187
+ string result = 2;
188
+ string error = 3;
189
+ }
190
+
191
+ message Event {
192
+ string event_type = 1;
193
+ string data = 2;
194
+ }
195
+ ```
196
+
197
+ #### gRPC A2A Service
198
+ ```python
199
+ import grpc
200
+ from concurrent import futures
201
+ import a2a_pb2
202
+ import a2a_pb2_grpc
203
+
204
+ class A2AService(a2a_pb2_grpc.A2AServiceServicer):
205
+ """Agent-to-Agent communication service."""
206
+
207
+ def __init__(self, agent_registry):
208
+ self.agent_registry = agent_registry
209
+
210
+ def SendMessage(self, request, context):
211
+ """Send message from one agent to another."""
212
+ sender_id = request.sender_id
213
+ receiver_id = request.receiver_id
214
+
215
+ # Validate agents exist
216
+ if not self.agent_registry.exists(sender_id):
217
+ context.abort(grpc.StatusCode.NOT_FOUND, f"Sender {sender_id} not found")
218
+
219
+ if not self.agent_registry.exists(receiver_id):
220
+ context.abort(grpc.StatusCode.NOT_FOUND, f"Receiver {receiver_id} not found")
221
+
222
+ # Route message to receiver
223
+ receiver_agent = self.agent_registry.get(receiver_id)
224
+ response = receiver_agent.handle_message(request)
225
+
226
+ return response
227
+
228
+ def StreamMessages(self, request_iterator, context):
229
+ """Bidirectional streaming for real-time communication."""
230
+ for message in request_iterator:
231
+ # Process message
232
+ receiver = self.agent_registry.get(message.receiver_id)
233
+ response = receiver.handle_message(message)
234
+ yield response
235
+
236
+ # Start gRPC server
237
+ def serve():
238
+ server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
239
+
240
+ agent_registry = AgentRegistry()
241
+ a2a_service = A2AService(agent_registry)
242
+
243
+ a2a_pb2_grpc.add_A2AServiceServicer_to_server(a2a_service, server)
244
+
245
+ server.add_insecure_port('[::]:50051')
246
+ server.start()
247
+ print("A2A gRPC server listening on port 50051")
248
+ server.wait_for_termination()
249
+
250
+ if __name__ == '__main__':
251
+ serve()
252
+ ```
253
+
254
+ #### A2A Client (Agent Communication)
255
+ ```python
256
+ import grpc
257
+ import a2a_pb2
258
+ import a2a_pb2_grpc
259
+
260
+ class A2AClient:
261
+ """Client for agent-to-agent communication."""
262
+
263
+ def __init__(self, server_address='localhost:50051'):
264
+ self.channel = grpc.insecure_channel(server_address)
265
+ self.stub = a2a_pb2_grpc.A2AServiceStub(self.channel)
266
+
267
+ def send_message(self, sender_id, receiver_id, action, params):
268
+ """Send message to another agent."""
269
+ message = a2a_pb2.A2AMessage(
270
+ sender_id=sender_id,
271
+ receiver_id=receiver_id,
272
+ conversation_id="conv-123",
273
+ type=a2a_pb2.REQUEST,
274
+ request=a2a_pb2.Request(
275
+ action=action,
276
+ params=params
277
+ )
278
+ )
279
+
280
+ response = self.stub.SendMessage(message)
281
+ return response
282
+
283
+ def stream_conversation(self, messages):
284
+ """Stream bidirectional messages."""
285
+ def message_generator():
286
+ for msg in messages:
287
+ yield msg
288
+
289
+ responses = self.stub.StreamMessages(message_generator())
290
+
291
+ for response in responses:
292
+ yield response
293
+
294
+ # Usage
295
+ client = A2AClient()
296
+
297
+ # Research agent asks data-analyst agent for analysis
298
+ response = client.send_message(
299
+ sender_id="research-agent",
300
+ receiver_id="data-analyst-agent",
301
+ action="analyze_data",
302
+ params={"dataset": "sales_2024.csv", "metrics": ["revenue", "growth"]}
303
+ )
304
+
305
+ print(f"Analysis result: {response.response.result}")
306
+ ```
307
+
308
+ **Benefits:**
309
+ - Type-safe communication with Protocol Buffers
310
+ - Bidirectional streaming for real-time collaboration
311
+ - Built-in error handling and retries
312
+ - Production-ready scalability
313
+
314
+ ### 3. Multi-Agent Orchestration (Context7-Verified)
315
+
316
+ **Pattern from Context7 (/google-cloud/multi-agent):**
317
+
318
+ #### Agent Registry
319
+ ```python
320
+ from dataclasses import dataclass
321
+ from typing import Dict, List, Optional
322
+
323
+ @dataclass
324
+ class AgentCapability:
325
+ """Agent capability definition."""
326
+ name: str
327
+ description: str
328
+ parameters: Dict
329
+
330
+ @dataclass
331
+ class AgentInfo:
332
+ """Agent registration information."""
333
+ agent_id: str
334
+ name: str
335
+ description: str
336
+ capabilities: List[AgentCapability]
337
+ endpoint: str
338
+ status: str # active, inactive, error
339
+
340
+ class AgentRegistry:
341
+ """Central registry for agent discovery."""
342
+
343
+ def __init__(self):
344
+ self.agents: Dict[str, AgentInfo] = {}
345
+
346
+ def register(self, agent_info: AgentInfo):
347
+ """Register new agent."""
348
+ self.agents[agent_info.agent_id] = agent_info
349
+ print(f"Registered agent: {agent_info.name} ({agent_info.agent_id})")
350
+
351
+ def unregister(self, agent_id: str):
352
+ """Unregister agent."""
353
+ if agent_id in self.agents:
354
+ del self.agents[agent_id]
355
+ print(f"Unregistered agent: {agent_id}")
356
+
357
+ def discover(self, capability: str) -> List[AgentInfo]:
358
+ """Find agents with specific capability."""
359
+ matching = []
360
+
361
+ for agent in self.agents.values():
362
+ for cap in agent.capabilities:
363
+ if cap.name == capability:
364
+ matching.append(agent)
365
+ break
366
+
367
+ return matching
368
+
369
+ def get(self, agent_id: str) -> Optional[AgentInfo]:
370
+ """Get agent by ID."""
371
+ return self.agents.get(agent_id)
372
+
373
+ def exists(self, agent_id: str) -> bool:
374
+ """Check if agent exists."""
375
+ return agent_id in self.agents
376
+
377
+ # Usage
378
+ registry = AgentRegistry()
379
+
380
+ # Register research agent
381
+ registry.register(AgentInfo(
382
+ agent_id="research-agent-1",
383
+ name="Research Assistant",
384
+ description="Searches and summarizes information",
385
+ capabilities=[
386
+ AgentCapability("web_search", "Search the web", {}),
387
+ AgentCapability("document_retrieval", "Retrieve documents", {})
388
+ ],
389
+ endpoint="localhost:50051",
390
+ status="active"
391
+ ))
392
+
393
+ # Register data analyst agent
394
+ registry.register(AgentInfo(
395
+ agent_id="data-analyst-1",
396
+ name="Data Analyst",
397
+ description="Analyzes datasets and generates insights",
398
+ capabilities=[
399
+ AgentCapability("data_analysis", "Analyze data", {}),
400
+ AgentCapability("visualization", "Create charts", {})
401
+ ],
402
+ endpoint="localhost:50052",
403
+ status="active"
404
+ ))
405
+
406
+ # Discover agents with web_search capability
407
+ agents = registry.discover("web_search")
408
+ print(f"Found {len(agents)} agents with web_search capability")
409
+ ```
410
+
411
+ #### Orchestrator (Supervisor Agent)
412
+ ```python
413
+ class Orchestrator:
414
+ """Orchestrates multi-agent workflows."""
415
+
416
+ def __init__(self, registry: AgentRegistry, a2a_client: A2AClient):
417
+ self.registry = registry
418
+ self.a2a = a2a_client
419
+
420
+ async def execute_workflow(self, task: str) -> str:
421
+ """
422
+ Execute multi-agent workflow.
423
+
424
+ Example: "Research AI trends and create a report with visualizations"
425
+
426
+ Steps:
427
+ 1. Research agent: Gather information
428
+ 2. Data analyst agent: Analyze trends
429
+ 3. Report agent: Generate report
430
+ """
431
+ # Step 1: Research
432
+ research_agents = self.registry.discover("web_search")
433
+ if not research_agents:
434
+ raise ValueError("No research agents available")
435
+
436
+ research_result = self.a2a.send_message(
437
+ sender_id="orchestrator",
438
+ receiver_id=research_agents[0].agent_id,
439
+ action="research",
440
+ params={"topic": "AI trends 2025"}
441
+ )
442
+
443
+ # Step 2: Analysis
444
+ analyst_agents = self.registry.discover("data_analysis")
445
+ if not analyst_agents:
446
+ raise ValueError("No analyst agents available")
447
+
448
+ analysis_result = self.a2a.send_message(
449
+ sender_id="orchestrator",
450
+ receiver_id=analyst_agents[0].agent_id,
451
+ action="analyze",
452
+ params={"data": research_result.response.result}
453
+ )
454
+
455
+ # Step 3: Report generation
456
+ report_agents = self.registry.discover("report_generation")
457
+ if not report_agents:
458
+ # Fallback: Generate report ourselves
459
+ return self._generate_simple_report(analysis_result.response.result)
460
+
461
+ report_result = self.a2a.send_message(
462
+ sender_id="orchestrator",
463
+ receiver_id=report_agents[0].agent_id,
464
+ action="generate_report",
465
+ params={"analysis": analysis_result.response.result}
466
+ )
467
+
468
+ return report_result.response.result
469
+
470
+ def _generate_simple_report(self, analysis: str) -> str:
471
+ """Fallback report generation."""
472
+ return f"# AI Trends Report\n\n{analysis}"
473
+
474
+ # Usage
475
+ orchestrator = Orchestrator(registry, a2a_client)
476
+
477
+ result = await orchestrator.execute_workflow(
478
+ "Research AI trends and create analysis report"
479
+ )
480
+
481
+ print(result)
482
+ ```
483
+
484
+ **Benefits:**
485
+ - Dynamic agent discovery
486
+ - Fault tolerance (fallback agents)
487
+ - Parallel execution where possible
488
+ - Centralized orchestration
489
+
490
+ ### 4. State Management (Context7-Verified)
491
+
492
+ **Pattern from Context7:**
493
+
494
+ #### Conversation State
495
+ ```python
496
+ from dataclasses import dataclass, field
497
+ from typing import List, Dict
498
+ import json
499
+
500
+ @dataclass
501
+ class Message:
502
+ """Single message in conversation."""
503
+ sender_id: str
504
+ content: str
505
+ timestamp: float
506
+ metadata: Dict = field(default_factory=dict)
507
+
508
+ @dataclass
509
+ class ConversationState:
510
+ """Conversation state between agents."""
511
+ conversation_id: str
512
+ participants: List[str]
513
+ messages: List[Message] = field(default_factory=list)
514
+ shared_context: Dict = field(default_factory=dict)
515
+ status: str = "active" # active, paused, completed, error
516
+
517
+ def add_message(self, message: Message):
518
+ """Add message to conversation."""
519
+ self.messages.append(message)
520
+
521
+ def get_context(self) -> Dict:
522
+ """Get shared context."""
523
+ return self.shared_context
524
+
525
+ def update_context(self, key: str, value):
526
+ """Update shared context."""
527
+ self.shared_context[key] = value
528
+
529
+ def to_json(self) -> str:
530
+ """Serialize to JSON."""
531
+ return json.dumps({
532
+ "conversation_id": self.conversation_id,
533
+ "participants": self.participants,
534
+ "messages": [
535
+ {
536
+ "sender_id": m.sender_id,
537
+ "content": m.content,
538
+ "timestamp": m.timestamp,
539
+ "metadata": m.metadata
540
+ }
541
+ for m in self.messages
542
+ ],
543
+ "shared_context": self.shared_context,
544
+ "status": self.status
545
+ }, indent=2)
546
+
547
+ class StateManager:
548
+ """Manage conversation states."""
549
+
550
+ def __init__(self):
551
+ self.states: Dict[str, ConversationState] = {}
552
+
553
+ def create_conversation(self, conversation_id: str, participants: List[str]) -> ConversationState:
554
+ """Create new conversation."""
555
+ state = ConversationState(
556
+ conversation_id=conversation_id,
557
+ participants=participants
558
+ )
559
+ self.states[conversation_id] = state
560
+ return state
561
+
562
+ def get_conversation(self, conversation_id: str) -> Optional[ConversationState]:
563
+ """Get conversation state."""
564
+ return self.states.get(conversation_id)
565
+
566
+ def save_state(self, conversation_id: str, storage_path: str):
567
+ """Persist conversation state."""
568
+ state = self.states.get(conversation_id)
569
+ if state:
570
+ with open(f"{storage_path}/{conversation_id}.json", "w") as f:
571
+ f.write(state.to_json())
572
+
573
+ # Usage
574
+ state_manager = StateManager()
575
+
576
+ # Create conversation between research and analyst agents
577
+ conv = state_manager.create_conversation(
578
+ "conv-123",
579
+ ["research-agent-1", "data-analyst-1"]
580
+ )
581
+
582
+ # Add messages
583
+ conv.add_message(Message(
584
+ sender_id="research-agent-1",
585
+ content="I found 5 articles about AI trends",
586
+ timestamp=1234567890.0
587
+ ))
588
+
589
+ # Update shared context
590
+ conv.update_context("research_complete", True)
591
+ conv.update_context("articles_count", 5)
592
+
593
+ # Persist state
594
+ state_manager.save_state("conv-123", "/tmp/conversations")
595
+ ```
596
+
597
+ ### 5. Tool Sharing (Context7-Verified)
598
+
599
+ **Pattern from Context7:**
600
+
601
+ #### Shared Tool Registry
602
+ ```python
603
+ from typing import Callable, Dict, Any
604
+
605
+ class Tool:
606
+ """Shared tool definition."""
607
+
608
+ def __init__(self, name: str, description: str, function: Callable, parameters: Dict):
609
+ self.name = name
610
+ self.description = description
611
+ self.function = function
612
+ self.parameters = parameters
613
+
614
+ def execute(self, **kwargs) -> Any:
615
+ """Execute tool."""
616
+ return self.function(**kwargs)
617
+
618
+ class ToolRegistry:
619
+ """Registry for shared tools."""
620
+
621
+ def __init__(self):
622
+ self.tools: Dict[str, Tool] = {}
623
+
624
+ def register(self, tool: Tool):
625
+ """Register tool."""
626
+ self.tools[tool.name] = tool
627
+
628
+ def get(self, name: str) -> Optional[Tool]:
629
+ """Get tool by name."""
630
+ return self.tools.get(name)
631
+
632
+ def list_tools(self) -> List[str]:
633
+ """List all tool names."""
634
+ return list(self.tools.keys())
635
+
636
+ # Define shared tools
637
+ def search_web(query: str) -> str:
638
+ """Search the web."""
639
+ # Implementation
640
+ return f"Search results for: {query}"
641
+
642
+ def analyze_data(data: str) -> Dict:
643
+ """Analyze dataset."""
644
+ # Implementation
645
+ return {"summary": "Analysis complete", "insights": []}
646
+
647
+ # Register tools
648
+ tool_registry = ToolRegistry()
649
+
650
+ tool_registry.register(Tool(
651
+ name="web_search",
652
+ description="Search the web for information",
653
+ function=search_web,
654
+ parameters={"query": "string"}
655
+ ))
656
+
657
+ tool_registry.register(Tool(
658
+ name="data_analysis",
659
+ description="Analyze datasets",
660
+ function=analyze_data,
661
+ parameters={"data": "string"}
662
+ ))
663
+
664
+ # Agents can discover and use shared tools
665
+ class AgentWithTools:
666
+ def __init__(self, agent_id: str, tool_registry: ToolRegistry):
667
+ self.agent_id = agent_id
668
+ self.tools = tool_registry
669
+
670
+ def use_tool(self, tool_name: str, **kwargs):
671
+ """Use a shared tool."""
672
+ tool = self.tools.get(tool_name)
673
+ if not tool:
674
+ raise ValueError(f"Tool {tool_name} not found")
675
+
676
+ return tool.execute(**kwargs)
677
+
678
+ # Usage
679
+ agent = AgentWithTools("research-agent-1", tool_registry)
680
+ result = agent.use_tool("web_search", query="AI trends 2025")
681
+ ```
682
+
683
+ ### 6. Observability (Context7-Verified)
684
+
685
+ **Pattern from Context7:**
686
+
687
+ #### Tracing and Monitoring
688
+ ```python
689
+ from opentelemetry import trace
690
+ from opentelemetry.sdk.trace import TracerProvider
691
+ from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
692
+ import time
693
+
694
+ # Setup tracing
695
+ trace.set_tracer_provider(TracerProvider())
696
+ tracer = trace.get_tracer(__name__)
697
+
698
+ # Add console exporter (use OTLP for production)
699
+ trace.get_tracer_provider().add_span_processor(
700
+ SimpleSpanProcessor(ConsoleSpanExporter())
701
+ )
702
+
703
+ class TracedAgent:
704
+ """Agent with distributed tracing."""
705
+
706
+ def __init__(self, agent_id: str):
707
+ self.agent_id = agent_id
708
+
709
+ def process_request(self, request: str) -> str:
710
+ """Process request with tracing."""
711
+ with tracer.start_as_current_span("process_request") as span:
712
+ span.set_attribute("agent.id", self.agent_id)
713
+ span.set_attribute("request.content", request)
714
+
715
+ # Simulate processing
716
+ time.sleep(0.5)
717
+
718
+ result = f"Processed: {request}"
719
+
720
+ span.set_attribute("response.content", result)
721
+ span.add_event("processing_complete")
722
+
723
+ return result
724
+
725
+ # Trace A2A communication
726
+ def send_traced_message(sender_id: str, receiver_id: str, message: str):
727
+ """Send message with distributed tracing."""
728
+ with tracer.start_as_current_span("a2a_communication") as span:
729
+ span.set_attribute("sender.id", sender_id)
730
+ span.set_attribute("receiver.id", receiver_id)
731
+ span.set_attribute("message.content", message)
732
+
733
+ # Send message
734
+ client = A2AClient()
735
+ response = client.send_message(sender_id, receiver_id, "process", {"data": message})
736
+
737
+ span.set_attribute("response.status", "success" if response.response.success else "error")
738
+
739
+ return response
740
+ ```
741
+
742
+ **Benefits:**
743
+ - Distributed tracing across agents
744
+ - Performance monitoring
745
+ - Error tracking
746
+ - Request flow visualization
747
+
748
+ ## Setup Output
749
+
750
+ ```
751
+ 🔗 Google A2A Protocol Setup
752
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
753
+
754
+ Project: my-project-id
755
+ Region: us-central1
756
+ Protocol: gRPC
757
+
758
+ 📊 Configuration
759
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
760
+
761
+ Vertex AI Agent Builder:
762
+ - Enabled ✓
763
+ - Model: gemini-2.0-flash-exp
764
+ - Tools: Google Search, Code Interpreter
765
+ - Custom functions: Configured
766
+
767
+ A2A Protocol:
768
+ - Protocol: gRPC (port 50051)
769
+ - Message format: Protocol Buffers
770
+ - Bidirectional streaming: Enabled
771
+ - Error handling: Configured
772
+
773
+ Agent Registry:
774
+ - Service: Running on port 8080
775
+ - Discovery: Enabled
776
+ - Health checks: Configured
777
+
778
+ Orchestration:
779
+ - Supervisor agent: Configured
780
+ - Workflow engine: Enabled
781
+ - State management: Redis-backed
782
+
783
+ 🎯 Agents Registered
784
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
785
+
786
+ 1. Research Agent (research-agent-1)
787
+ - Capabilities: web_search, document_retrieval
788
+ - Status: Active
789
+ - Endpoint: localhost:50051
790
+
791
+ 2. Data Analyst (data-analyst-1)
792
+ - Capabilities: data_analysis, visualization
793
+ - Status: Active
794
+ - Endpoint: localhost:50052
795
+
796
+ 3. Report Generator (report-agent-1)
797
+ - Capabilities: report_generation, summarization
798
+ - Status: Active
799
+ - Endpoint: localhost:50053
800
+
801
+ ✅ Setup Complete
802
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
803
+
804
+ Next Steps:
805
+ 1. Test agent communication: python test_a2a.py
806
+ 2. Deploy to production: gcloud deploy
807
+ 3. Monitor agents: open http://localhost:8080/metrics
808
+
809
+ Configuration saved to: a2a-config.yaml
810
+ ```
811
+
812
+ ## Implementation
813
+
814
+ This command uses the **@google-a2a-expert** agent with orchestration expertise:
815
+
816
+ 1. Query Context7 for Google A2A patterns
817
+ 2. Setup Vertex AI Agent Builder
818
+ 3. Configure A2A protocol (gRPC/REST)
819
+ 4. Implement agent registry
820
+ 5. Setup orchestrator
821
+ 6. Configure state management
822
+ 7. Enable observability
823
+
824
+ ## Best Practices Applied
825
+
826
+ Based on Context7 documentation from `/googleapis/google-cloud-python/vertexai`:
827
+
828
+ 1. **Vertex AI Agent Builder** - Managed agent infrastructure
829
+ 2. **gRPC Protocol** - High-performance communication
830
+ 3. **Agent Registry** - Dynamic discovery
831
+ 4. **State Management** - Persistent conversation state
832
+ 5. **Tool Sharing** - Reusable capabilities
833
+ 6. **Distributed Tracing** - Observability across agents
834
+ 7. **Fault Tolerance** - Fallback and retry logic
835
+
836
+ ## Related Commands
837
+
838
+ - `/ai:model-deployment` - Model deployment
839
+ - `/rag:setup-scaffold` - RAG system setup
840
+ - `/openai:optimize` - OpenAI optimization
841
+
842
+ ## Troubleshooting
843
+
844
+ ### Agent Communication Fails
845
+ - Check gRPC server is running (port 50051)
846
+ - Verify agent is registered in registry
847
+ - Check network connectivity
848
+ - Review firewall rules
849
+
850
+ ### High Latency
851
+ - Use gRPC instead of REST (3x faster)
852
+ - Enable bidirectional streaming
853
+ - Optimize message size
854
+ - Add caching layer
855
+
856
+ ### State Loss
857
+ - Enable Redis for state persistence
858
+ - Implement checkpoint/restore
859
+ - Use conversation logging
860
+ - Add retry logic
861
+
862
+ ## Installation
863
+
864
+ ```bash
865
+ # Install Google Cloud SDK
866
+ pip install google-cloud-aiplatform
867
+
868
+ # Install gRPC
869
+ pip install grpcio grpcio-tools
870
+
871
+ # Install observability
872
+ pip install opentelemetry-api opentelemetry-sdk
873
+
874
+ # Generate Protocol Buffer code
875
+ python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. a2a.proto
876
+ ```
877
+
878
+ ## Version History
879
+
880
+ - v2.0.0 - Initial Schema v2.0 release with Context7 integration
881
+ - Vertex AI Agent Builder integration
882
+ - gRPC A2A protocol implementation
883
+ - Multi-agent orchestration patterns
884
+ - Agent registry and discovery
885
+ - State management with Redis
886
+ - Distributed tracing support