graph-agents-cli 0.3.1__py3-none-any.whl

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 (291) hide show
  1. graph_agents_cli/__init__.py +26 -0
  2. graph_agents_cli/_api_policy.py +2145 -0
  3. graph_agents_cli/_approvals.py +400 -0
  4. graph_agents_cli/_build.py +186 -0
  5. graph_agents_cli/_build_info.json +7 -0
  6. graph_agents_cli/_chat_client.py +462 -0
  7. graph_agents_cli/_click.py +157 -0
  8. graph_agents_cli/_defaults.py +139 -0
  9. graph_agents_cli/_experiments.py +64 -0
  10. graph_agents_cli/_http.py +192 -0
  11. graph_agents_cli/_output.py +83 -0
  12. graph_agents_cli/_project.py +462 -0
  13. graph_agents_cli/_remote.py +220 -0
  14. graph_agents_cli/_response_schema.py +264 -0
  15. graph_agents_cli/_runner.py +319 -0
  16. graph_agents_cli/_skills_check.py +274 -0
  17. graph_agents_cli/_tools.py +189 -0
  18. graph_agents_cli/_trust.py +66 -0
  19. graph_agents_cli/api/__init__.py +15 -0
  20. graph_agents_cli/api/_changes.py +506 -0
  21. graph_agents_cli/api/_files.py +658 -0
  22. graph_agents_cli/api/cmd_api.py +2480 -0
  23. graph_agents_cli/deploy/__init__.py +15 -0
  24. graph_agents_cli/deploy/_config.py +171 -0
  25. graph_agents_cli/deploy/_image.py +128 -0
  26. graph_agents_cli/deploy/_kube.py +286 -0
  27. graph_agents_cli/deploy/_modes.py +234 -0
  28. graph_agents_cli/deploy/_preflight.py +370 -0
  29. graph_agents_cli/deploy/_values.py +168 -0
  30. graph_agents_cli/deploy/cmd_deploy.py +1866 -0
  31. graph_agents_cli/deploy/gitops.py +562 -0
  32. graph_agents_cli/deploy/local_load.py +273 -0
  33. graph_agents_cli/dev/__init__.py +13 -0
  34. graph_agents_cli/dev/cmd_build.py +131 -0
  35. graph_agents_cli/dev/cmd_install.py +78 -0
  36. graph_agents_cli/dev/cmd_lint.py +119 -0
  37. graph_agents_cli/dev/cmd_playground.py +297 -0
  38. graph_agents_cli/dev/policy_check.py +1287 -0
  39. graph_agents_cli/eval/__init__.py +22 -0
  40. graph_agents_cli/eval/_client.py +670 -0
  41. graph_agents_cli/eval/_common.py +177 -0
  42. graph_agents_cli/eval/_judge.py +168 -0
  43. graph_agents_cli/eval/_judge_runner.py +238 -0
  44. graph_agents_cli/eval/_paths.py +212 -0
  45. graph_agents_cli/eval/checks.py +581 -0
  46. graph_agents_cli/eval/cmd_analyze.py +278 -0
  47. graph_agents_cli/eval/cmd_compare.py +284 -0
  48. graph_agents_cli/eval/cmd_eval_group.py +80 -0
  49. graph_agents_cli/eval/cmd_generate.py +558 -0
  50. graph_agents_cli/eval/cmd_grade.py +466 -0
  51. graph_agents_cli/eval/cmd_metric.py +156 -0
  52. graph_agents_cli/eval/cmd_run.py +370 -0
  53. graph_agents_cli/eval/cmd_submit.py +400 -0
  54. graph_agents_cli/eval/config.py +435 -0
  55. graph_agents_cli/eval/dataset.py +350 -0
  56. graph_agents_cli/eval/gate.py +420 -0
  57. graph_agents_cli/eval/transcript.py +192 -0
  58. graph_agents_cli/extension/__init__.py +13 -0
  59. graph_agents_cli/extension/_compat.py +86 -0
  60. graph_agents_cli/extension/_loader.py +293 -0
  61. graph_agents_cli/extension/_manifest.py +135 -0
  62. graph_agents_cli/extension/_overrides.py +195 -0
  63. graph_agents_cli/extension/_paths.py +91 -0
  64. graph_agents_cli/extension/_refs.py +193 -0
  65. graph_agents_cli/extension/_resolver.py +453 -0
  66. graph_agents_cli/extension/_schema.py +106 -0
  67. graph_agents_cli/extension/_spec.py +253 -0
  68. graph_agents_cli/extension/_sync.py +102 -0
  69. graph_agents_cli/extension/_trust.py +58 -0
  70. graph_agents_cli/extension/cmd_extension_add.py +259 -0
  71. graph_agents_cli/extension/cmd_extension_group.py +57 -0
  72. graph_agents_cli/extension/cmd_extension_list.py +56 -0
  73. graph_agents_cli/extension/cmd_extension_remove.py +61 -0
  74. graph_agents_cli/extension/cmd_extension_update.py +195 -0
  75. graph_agents_cli/info/__init__.py +13 -0
  76. graph_agents_cli/info/cmd_info.py +222 -0
  77. graph_agents_cli/infra/__init__.py +15 -0
  78. graph_agents_cli/infra/checks.py +1169 -0
  79. graph_agents_cli/infra/cmd_infra.py +103 -0
  80. graph_agents_cli/main.py +591 -0
  81. graph_agents_cli/peer/__init__.py +15 -0
  82. graph_agents_cli/peer/_generate.py +254 -0
  83. graph_agents_cli/peer/cmd_peer.py +1151 -0
  84. graph_agents_cli/run/__init__.py +13 -0
  85. graph_agents_cli/run/_local_server.py +1157 -0
  86. graph_agents_cli/run/_signals.py +141 -0
  87. graph_agents_cli/run/cmd_approvals.py +530 -0
  88. graph_agents_cli/run/cmd_run.py +1421 -0
  89. graph_agents_cli/scaffold/__init__.py +19 -0
  90. graph_agents_cli/scaffold/agents/README.md +24 -0
  91. graph_agents_cli/scaffold/agents/empty_py/.template/templateconfig.yaml +22 -0
  92. graph_agents_cli/scaffold/agents/langgraph/.env.example +292 -0
  93. graph_agents_cli/scaffold/agents/langgraph/.template/templateconfig.yaml +28 -0
  94. graph_agents_cli/scaffold/agents/langgraph/Dockerfile +59 -0
  95. graph_agents_cli/scaffold/agents/langgraph/Dockerfile.langgraph-server +59 -0
  96. graph_agents_cli/scaffold/agents/langgraph/README.md +571 -0
  97. graph_agents_cli/scaffold/agents/langgraph/api-policy.yaml +60 -0
  98. graph_agents_cli/scaffold/agents/langgraph/app/__init__.py +20 -0
  99. graph_agents_cli/scaffold/agents/langgraph/app/agent.py +174 -0
  100. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/__init__.py +15 -0
  101. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a.py +2162 -0
  102. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a_client.py +1167 -0
  103. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/api_client.py +4220 -0
  104. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/approvals.py +1349 -0
  105. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/auth.py +1986 -0
  106. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/chat.py +2962 -0
  107. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/checkpointer.py +432 -0
  108. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/content.py +569 -0
  109. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/db.py +580 -0
  110. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/limits.py +203 -0
  111. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/metrics.py +231 -0
  112. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/middleware.py +361 -0
  113. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/model.py +611 -0
  114. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/playground.py +230 -0
  115. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/run_locks.py +459 -0
  116. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/structured.py +755 -0
  117. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/telemetry.py +681 -0
  118. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/threads.py +493 -0
  119. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/token_exchange.py +959 -0
  120. graph_agents_cli/scaffold/agents/langgraph/app/fast_api_app.py +770 -0
  121. graph_agents_cli/scaffold/agents/langgraph/app/policies/__init__.py +55 -0
  122. graph_agents_cli/scaffold/agents/langgraph/app/policies/custom.py +97 -0
  123. graph_agents_cli/scaffold/agents/langgraph/app/tools/__init__.py +46 -0
  124. graph_agents_cli/scaffold/agents/langgraph/app/tools/example_api.py +92 -0
  125. graph_agents_cli/scaffold/agents/langgraph/app/tools/weather.py +33 -0
  126. graph_agents_cli/scaffold/agents/langgraph/langgraph.json +14 -0
  127. graph_agents_cli/scaffold/agents/langgraph/pyproject.toml +78 -0
  128. graph_agents_cli/scaffold/agents/langgraph/tests/conftest.py +376 -0
  129. graph_agents_cli/scaffold/agents/langgraph/tests/eval/datasets/basic-dataset.json +53 -0
  130. graph_agents_cli/scaffold/agents/langgraph/tests/eval/eval_config.yaml +32 -0
  131. graph_agents_cli/scaffold/agents/langgraph/tests/integration/approval_graph.py +137 -0
  132. graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_issuer.py +216 -0
  133. graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_openai.py +357 -0
  134. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_outcomes.py +569 -0
  135. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_relay.py +479 -0
  136. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_api_surface.py +812 -0
  137. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals.py +1367 -0
  138. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals_server.py +794 -0
  139. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor.py +497 -0
  140. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor_server.py +247 -0
  141. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_history_repair.py +278 -0
  142. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_model_apis.py +242 -0
  143. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_postgres.py +637 -0
  144. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_resilience_postgres.py +770 -0
  145. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_runtime_guardrails.py +854 -0
  146. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_e2e.py +340 -0
  147. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_runtime.py +989 -0
  148. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_answers.py +584 -0
  149. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_server.py +222 -0
  150. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_token_exchange_issuer.py +650 -0
  151. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/.results/.placeholder +0 -0
  152. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/README.md +22 -0
  153. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/conftest.py +21 -0
  154. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/load_test.py +81 -0
  155. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_client.py +824 -0
  156. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_scoping.py +724 -0
  157. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client.py +1214 -0
  158. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client_hardening.py +716 -0
  159. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_policy_rpc.py +767 -0
  160. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_approval_ledger.py +1536 -0
  161. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_fake_model.py +115 -0
  162. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_jwt_policy.py +991 -0
  163. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_limits.py +310 -0
  164. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging.py +148 -0
  165. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging_hardening.py +271 -0
  166. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_policy.py +378 -0
  167. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_resilience.py +610 -0
  168. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_server_auth.py +702 -0
  169. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_structured.py +673 -0
  170. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_telemetry.py +404 -0
  171. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_thread_listing.py +255 -0
  172. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_threads.py +268 -0
  173. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_token_exchange.py +1320 -0
  174. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_untrusted_content.py +393 -0
  175. graph_agents_cli/scaffold/agents/langgraph/uv-fastapi.lock +2084 -0
  176. graph_agents_cli/scaffold/agents/langgraph/uv-langgraph-server.lock +2106 -0
  177. graph_agents_cli/scaffold/agents/langgraph/{{cookiecutter.agent_guidance_filename}} +129 -0
  178. graph_agents_cli/scaffold/base_templates/_shared/graph-agents-cli-manifest.yaml +36 -0
  179. graph_agents_cli/scaffold/base_templates/python/.dockerignore +32 -0
  180. graph_agents_cli/scaffold/base_templates/python/.github/CODEOWNERS +30 -0
  181. graph_agents_cli/scaffold/base_templates/python/.github/agent.env +7 -0
  182. graph_agents_cli/scaffold/base_templates/python/.github/workflows/pr_checks.yaml +214 -0
  183. graph_agents_cli/scaffold/base_templates/python/.gitignore +209 -0
  184. graph_agents_cli/scaffold/base_templates/python/tests/unit/test_dummy.py +23 -0
  185. graph_agents_cli/scaffold/base_templates/python/{{cookiecutter.agent_guidance_filename}} +35 -0
  186. graph_agents_cli/scaffold/cmd_scaffold_group.py +49 -0
  187. graph_agents_cli/scaffold/commands/__init__.py +13 -0
  188. graph_agents_cli/scaffold/commands/create.py +1424 -0
  189. graph_agents_cli/scaffold/commands/enhance.py +1652 -0
  190. graph_agents_cli/scaffold/commands/upgrade.py +570 -0
  191. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/agent.env +12 -0
  192. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/promote-to-prod.yaml +371 -0
  193. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/staging.yaml +450 -0
  194. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-dev.yaml +43 -0
  195. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-prod.yaml +41 -0
  196. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-staging.yaml +43 -0
  197. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/.helmignore +14 -0
  198. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/Chart.yaml +21 -0
  199. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/examples/networkpolicy.yaml +103 -0
  200. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/NOTES.txt +48 -0
  201. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/_helpers.tpl +189 -0
  202. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/certificate.yaml +15 -0
  203. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/configmap.yaml +10 -0
  204. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/deployment.yaml +199 -0
  205. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/hpa.yaml +22 -0
  206. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/httproute.yaml +30 -0
  207. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/ingress.yaml +39 -0
  208. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/networkpolicy.yaml +48 -0
  209. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/pdb.yaml +13 -0
  210. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/postgresql-secret.yaml +37 -0
  211. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/service.yaml +15 -0
  212. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/serviceaccount.yaml +13 -0
  213. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/servicemonitor.yaml +42 -0
  214. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-dev.yaml +22 -0
  215. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-prod.yaml +45 -0
  216. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-staging.yaml +29 -0
  217. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values.yaml +396 -0
  218. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/tests/integration/test_chart.py +269 -0
  219. graph_agents_cli/scaffold/deployment_targets/none/README.md +5 -0
  220. graph_agents_cli/scaffold/deployment_targets/none/python/README.md +6 -0
  221. graph_agents_cli/scaffold/utils/__init__.py +13 -0
  222. graph_agents_cli/scaffold/utils/backup.py +212 -0
  223. graph_agents_cli/scaffold/utils/build_record.py +257 -0
  224. graph_agents_cli/scaffold/utils/cli_options.py +184 -0
  225. graph_agents_cli/scaffold/utils/fs.py +83 -0
  226. graph_agents_cli/scaffold/utils/generate_locks.py +214 -0
  227. graph_agents_cli/scaffold/utils/generation_metadata.py +88 -0
  228. graph_agents_cli/scaffold/utils/keyedit.py +768 -0
  229. graph_agents_cli/scaffold/utils/keymerge.py +537 -0
  230. graph_agents_cli/scaffold/utils/language.py +138 -0
  231. graph_agents_cli/scaffold/utils/lock_utils.py +94 -0
  232. graph_agents_cli/scaffold/utils/logging.py +77 -0
  233. graph_agents_cli/scaffold/utils/manifest.py +292 -0
  234. graph_agents_cli/scaffold/utils/merge.py +970 -0
  235. graph_agents_cli/scaffold/utils/merge3.py +216 -0
  236. graph_agents_cli/scaffold/utils/openapi_seed.py +199 -0
  237. graph_agents_cli/scaffold/utils/remote_template.py +376 -0
  238. graph_agents_cli/scaffold/utils/template.py +1352 -0
  239. graph_agents_cli/scaffold/utils/upgrade.py +894 -0
  240. graph_agents_cli/scaffold/utils/version.py +438 -0
  241. graph_agents_cli/secrets/__init__.py +15 -0
  242. graph_agents_cli/secrets/_apply.py +954 -0
  243. graph_agents_cli/secrets/_required.py +188 -0
  244. graph_agents_cli/secrets/cmd_secrets.py +211 -0
  245. graph_agents_cli/setup/__init__.py +13 -0
  246. graph_agents_cli/setup/_antigravity.py +221 -0
  247. graph_agents_cli/setup/cmd_auth.py +1030 -0
  248. graph_agents_cli/setup/cmd_dev_token.py +513 -0
  249. graph_agents_cli/setup/cmd_setup.py +428 -0
  250. graph_agents_cli/setup/cmd_update.py +140 -0
  251. graph_agents_cli/skills/__init__.py +13 -0
  252. graph_agents_cli/skills/_bundle.py +65 -0
  253. graph_agents_cli/skills/data/README.md +19 -0
  254. graph_agents_cli/skills/data/graph-agents-cli-deploy/SKILL.md +357 -0
  255. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/github-settings.md +113 -0
  256. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/gitops.md +137 -0
  257. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/kubernetes.md +315 -0
  258. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/secrets.md +160 -0
  259. graph_agents_cli/skills/data/graph-agents-cli-eval/SKILL.md +303 -0
  260. graph_agents_cli/skills/data/graph-agents-cli-eval/references/dataset_schema.md +282 -0
  261. graph_agents_cli/skills/data/graph-agents-cli-eval/references/metrics-guide.md +143 -0
  262. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/SKILL.md +659 -0
  263. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langchain-models.md +124 -0
  264. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langgraph.md +235 -0
  265. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/template-contract.md +477 -0
  266. graph_agents_cli/skills/data/graph-agents-cli-observability/SKILL.md +231 -0
  267. graph_agents_cli/skills/data/graph-agents-cli-observability/references/langsmith.md +46 -0
  268. graph_agents_cli/skills/data/graph-agents-cli-observability/references/otel.md +59 -0
  269. graph_agents_cli/skills/data/graph-agents-cli-scaffold/SKILL.md +414 -0
  270. graph_agents_cli/skills/data/graph-agents-cli-scaffold/references/flags.md +134 -0
  271. graph_agents_cli/skills/data/graph-agents-cli-workflow/SKILL.md +478 -0
  272. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/brainstorming.md +118 -0
  273. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/commands.md +419 -0
  274. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/extension.md +156 -0
  275. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/internals.md +67 -0
  276. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/spec-template.md +56 -0
  277. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/terminology.md +119 -0
  278. graph_agents_cli/system/__init__.py +15 -0
  279. graph_agents_cli/system/_apply.py +519 -0
  280. graph_agents_cli/system/_checks.py +1023 -0
  281. graph_agents_cli/system/_deploy.py +215 -0
  282. graph_agents_cli/system/_model.py +363 -0
  283. graph_agents_cli/system/_system.py +664 -0
  284. graph_agents_cli/system/_views.py +208 -0
  285. graph_agents_cli/system/cmd_system.py +423 -0
  286. graph_agents_cli-0.3.1.dist-info/METADATA +162 -0
  287. graph_agents_cli-0.3.1.dist-info/RECORD +291 -0
  288. graph_agents_cli-0.3.1.dist-info/WHEEL +4 -0
  289. graph_agents_cli-0.3.1.dist-info/entry_points.txt +2 -0
  290. graph_agents_cli-0.3.1.dist-info/licenses/LICENSE +201 -0
  291. graph_agents_cli-0.3.1.dist-info/licenses/NOTICE +19 -0
@@ -0,0 +1,478 @@
1
+ ---
2
+ name: graph-agents-cli-workflow
3
+ description: >
4
+ This skill should be used when the user wants to "develop an agent",
5
+ "build an agent with LangGraph", "build a LangGraph agent", "run the agent
6
+ locally", "debug agent code", "test an agent", "evaluate an agent",
7
+ "deploy an agent to Kubernetes", "monitor an agent", or needs the
8
+ graph-agents-cli development lifecycle and coding guidelines.
9
+ Entrypoint for building LangGraph agents with graph-agents-cli.
10
+ Always active: provides the full workflow (understand, scaffold, build,
11
+ evaluate, deploy, observe), process deference to a project's declared
12
+ process, the spec-before-code gate, code preservation rules, the
13
+ never-change-the-model rule, human approval before deploy, and the
14
+ 3-strikes loop breaker.
15
+ metadata:
16
+ author: graph-agents-cli contributors
17
+ license: Apache-2.0
18
+ version: "0.3.1"
19
+ requires:
20
+ bins:
21
+ - graph-agents-cli
22
+ install: "uv tool install git+https://github.com/ss7172/graph-agents-cli@v0.3.1"
23
+ ---
24
+
25
+ # Agent Development Workflow and Guidelines
26
+
27
+ **graph-agents-cli** is a CLI and skills toolkit for building, evaluating, and deploying
28
+ [LangGraph](https://langchain-ai.github.io/langgraph/) agents on self-hosted Kubernetes. It works
29
+ with any coding agent (Claude Code, Codex, Gemini CLI, Cursor, Antigravity, others). The agent's
30
+ model is a scaffold-time and runtime choice among OpenAI, Anthropic, Gemini (AI Studio API key),
31
+ and any OpenAI-compatible endpoint (Ollama, vLLM, TGI, OpenRouter). It is generic: projects pick an
32
+ auth policy and declare their outbound APIs, nothing is tied to one consumer. Install with
33
+ `uv tool install graph-agents-cli` (PyPI) and `graph-agents-cli setup`.
34
+
35
+ > **Before writing agent code, make sure a scaffolded project exists (see Phase 1).** Skipping the
36
+ > scaffold loses the chat API, the auth policy adapter, the eval gate, the Helm chart, and the
37
+ > CI workflows the template wires up.
38
+
39
+ > Requires: graph-agents-cli ~= 0.3.1. Check with `graph-agents-cli --version` or
40
+ > `graph-agents-cli info`. [Install uv](https://docs.astral.sh/uv/getting-started/installation/index.md)
41
+ > first if needed.
42
+
43
+ ## Session continuity and skill cross-references
44
+
45
+ Re-read the relevant skill **before** each phase, not after you have started and hit a problem.
46
+ Context compaction may have dropped earlier skill content. If skills are missing, run
47
+ `graph-agents-cli setup` to install them.
48
+
49
+ | Phase | Skill | When to load |
50
+ |-------|-------|--------------|
51
+ | 0 - Understand | this skill, `references/brainstorming.md` | Read the project's process document if one is declared (see *Process deference*), else `.graph-agents-cli-spec.md` if present, else clarify goals with the user |
52
+ | 1 - Scaffold | `/graph-agents-cli-scaffold` | Before creating, enhancing, or upgrading a project |
53
+ | 2 - Build | `/graph-agents-cli-langgraph-code` | Before writing agent code: graph, tools, checkpointer, streaming, interrupts, auth policy, API client |
54
+ | 3 - Evaluate | `/graph-agents-cli-eval` | Before running any eval: dataset schema, expect checks, judge metrics, the gate rule and exit codes |
55
+ | 4 - Deploy | `/graph-agents-cli-deploy` | Before deploying: modes, environments, secrets, GitOps PR flow, GitHub settings, `infra check` |
56
+ | 5 - Observe | `/graph-agents-cli-observability` | After deploying: tracing opt-in, capture policy, LangSmith or OTLP, run records |
57
+
58
+ ---
59
+
60
+ ## Setup
61
+
62
+ If `graph-agents-cli` is not installed:
63
+
64
+ ```bash
65
+ uv tool install graph-agents-cli # from PyPI; or the release tag: git+https://github.com/ss7172/graph-agents-cli@v0.3.1
66
+ graph-agents-cli setup # installs the six skills into detected coding agents
67
+ ```
68
+
69
+ `uv` missing: follow the [official installation guide](https://docs.astral.sh/uv/getting-started/installation/index.md).
70
+
71
+ Users name things inconsistently ("Agent Server", "GitOps", "air-gapped", "Studio"). Map user terms
72
+ to CLI values with `references/terminology.md`.
73
+
74
+ ---
75
+
76
+ ## Process deference (read this before Phase 0)
77
+
78
+ A consuming project may govern agent work through its **own process** (for example a document
79
+ chain such as BRD -> PRD -> TRD/ADRs -> epics/stories -> acceptance cases). graph-agents-cli
80
+ records that in two places:
81
+
82
+ - the project manifest `graph-agents-cli-manifest.yaml`, key `process:` (a path to the governing
83
+ process document, or `null`); this is what `info` and `scaffold upgrade` read;
84
+ - the project guidance file (`AGENTS.md` by default, or `CLAUDE.md` / `GEMINI.md`), which renders the same
85
+ value; this is what you, the coding agent, read.
86
+
87
+ **Rule.** If the guidance file or the manifest declares `process:`:
88
+
89
+ 1. Read the named process document first and follow **its** gates, roles, and approval sequence
90
+ for everything in this skill (design, scaffolding, coding, evaluation, deployment).
91
+ 2. Treat this skill's generic spec-before-code gate (`.graph-agents-cli-spec.md`) as **satisfied
92
+ only by that process's own approvals**. Do not write a `.graph-agents-cli-spec.md` as a
93
+ substitute for the process's documents, and never treat an approved spec as permission the
94
+ process has not given.
95
+ 3. Where the process is silent, the rules below still apply (code preservation, never change the
96
+ model, human approval before deploy, the eval gate, the 3-strikes breaker).
97
+ 4. Choices that the process owns stay with the process: the outbound API policy
98
+ (`api-policy.yaml`), which credentials and roles the auth policy validates, data-egress and
99
+ trace-capture decisions, and whether the project may be deployed at all.
100
+
101
+ If no process is declared, the generic gate in Phase 0 applies.
102
+
103
+ ---
104
+
105
+ ## Phase 0: Understand
106
+
107
+ **What Phase 0 covers.** Phase 0 and its spec gate are for a new agent: no graph-agents-cli
108
+ project exists yet (`graph-agents-cli info` finds none), or the request changes what an existing
109
+ agent is for (its purpose or its users). A concrete change to an existing project (add a retry
110
+ to a tool, bump a dependency, fix a crash) is not a new agent: make the change, following
111
+ Phases 2 and 3. A missing or unapproved `.graph-agents-cli-spec.md` does not block it, and it
112
+ needs no new spec. Decisions the change raises that the user owns still go to the user: new API
113
+ operations or wider access (Phase 2, step 6), approval gates, and the model or provider. If the
114
+ project declares a process, *Process deference* governs every change, this kind included.
115
+
116
+ Before scaffolding or writing anything, understand what you are building through a **design
117
+ dialogue**, not a checklist. Load `references/brainstorming.md` and follow it: ask **one question
118
+ at a time**, propose 2-3 architecture approaches for non-trivial agents, and validate the design
119
+ before any scaffolding.
120
+
121
+ If `.graph-agents-cli-spec.md` exists in the project directory (and no process is declared), read
122
+ it; it is your primary source of truth. Otherwise:
123
+
124
+ **For a new agent, do NOT proceed to scaffolding or coding until the user approves the spec** (or,
125
+ under a declared process, until that process's approvals exist). Do not assume, research, or fill
126
+ in the blanks on your own; the user's intent drives everything.
127
+
128
+ **What counts as approval.** Only the user explicitly approving the spec, in the conversation.
129
+ None of these is approval:
130
+
131
+ - a request to build the agent, however direct;
132
+ - a spec file whose status says draft, or that still lists open questions;
133
+ - defaults you chose yourself, even safe ones, even if you recorded them in the spec as
134
+ assumptions;
135
+ - an instruction to proceed on your own, to decide for yourself or to do what is safe while
136
+ nobody can answer your questions: in that session the safe choice is to stop at the spec.
137
+
138
+ When a new agent's spec is not approved and nobody can approve it, the safe action is to stop
139
+ before `create`, `scaffold enhance`, or any agent code. Do these instead:
140
+
141
+ 1. Write or update a draft `.graph-agents-cli-spec.md` and leave it marked unapproved.
142
+ 2. End your answer with each open decision written as a direct question sentence that ends in `?`
143
+ (for example "Should the agent only read, or also write?"), in the answer itself, not only in
144
+ the spec file. A heading called "Open questions", a recommended default, or a "please confirm
145
+ X" list is not a question. Give the options and your recommendation. Typical open decisions:
146
+ which API operations and what access, which credential, who calls the agent and how they
147
+ authenticate, the model provider (data egress), and the runtime, CD mode and registry.
148
+ 3. Ask the user to approve the spec as a question ("Do you approve this spec, or what should change?"),
149
+ not as an instruction such as "say approved" or "once approved I will...".
150
+
151
+ **Scale the ceremony to complexity:** a trivial agent (single tool, fixed persona) needs a couple
152
+ of questions, a 2-3 sentence spec, and one approval; a complex agent (multi-step graph, external API
153
+ access, per-user identity and roles, safety-critical) gets the full treatment in `references/brainstorming.md`.
154
+
155
+ **Topics to cover** (one question at a time):
156
+
157
+ 1. **What problem will the agent solve?** Core purpose, capabilities, who calls it.
158
+ 2. **External APIs or data sources?** Which API operations the agent may call, with which
159
+ methods, and with what credential (none, a service token, or the caller's own). Access is the
160
+ user's explicit choice per API (read-only, read-write, or a custom list of methods, then the
161
+ allowed and denied operations): never assume one. Every outbound API is declared in
162
+ `api-policy.yaml` with `graph-agents-cli api add` (see `/graph-agents-cli-langgraph-code`);
163
+ the agent never gets a generic "call any endpoint" tool.
164
+ 3. **Safety constraints?** What the agent must NOT do; which API calls need a human's approval
165
+ before they are sent, and whose (the user confirming their own call, or a second person
166
+ holding a role: an `approval` block, `graph-agents-cli api approval`); what may leave the
167
+ network (model egress, traces).
168
+ 4. **Model provider?** `openai`, `anthropic`, `gemini`, or `openai-compatible` (on-network servers
169
+ such as vLLM, Ollama, TGI). Selecting a hosted provider sends prompts, tool results, and assembled
170
+ context to that provider; the user must decide that explicitly.
171
+ 5. **Deployment preference?** Prototype first (recommended, `--prototype`, no deployment files) or
172
+ Kubernetes from the start. If Kubernetes: runtime `fastapi` (default) or `langgraph-server`;
173
+ CD mode `skip`, `helm-push`, or `argocd`; registry; auth policy `shared-bearer`, `jwt` or
174
+ `custom`.
175
+
176
+ **Ask based on context:**
177
+
178
+ - Persistent conversations across restarts or replicas: `--checkpointer postgres` (the default
179
+ for Kubernetes); local development uses `CHECKPOINTER=memory` from `.env` and needs no database.
180
+ - Callers are individual users with an OIDC identity provider: `--auth-policy jwt` (per-user
181
+ principals from verified tokens). Callers already carry another credential (for example an
182
+ existing application's session cookie): `--auth-policy custom`; the template ships the
183
+ interface and a stub that fails closed until the project implements it.
184
+ - Disconnected or air-gapped cluster: the **disconnected profile** (`openai-compatible` model and
185
+ judge on-network, runtime `fastapi`, tracing off or OTLP in-cluster, `cd: skip` unless an
186
+ on-network GitHub Enterprise Server exists). See `/graph-agents-cli-deploy`.
187
+ - **Agents calling agents?** Does this agent ask other agents, or do other agents call it for
188
+ their users? Being called needs no scaffold choice (A2A is built into every scaffolded app),
189
+ but under `jwt` it refuses a calling agent until `AUTH_ALLOWED_ACTORS` lists it. Which agents
190
+ it asks, the credential (`jwt`: a token exchanged for the user's) and whether it relays the
191
+ person's approvals to them are the user's decisions (Phase 2, step 7).
192
+ - **Who reads the answer?** When a program, another agent or an eval does, declare its JSON
193
+ shape: `create --response-schema FILE` (see `/graph-agents-cli-langgraph-code`).
194
+ - CI/CD wanted: does a GitHub repository exist? Creating one (public or private) needs the user's
195
+ say-so.
196
+
197
+ Once the design is agreed, write `.graph-agents-cli-spec.md` from `references/spec-template.md`,
198
+ self-review it, then get the user's approval. `/graph-agents-cli-scaffold` maps the choices to flags.
199
+
200
+ ## Phase 1: Scaffold
201
+
202
+ Check whether a project already exists: run `graph-agents-cli info` from the project root. If it
203
+ was created or enhanced by graph-agents-cli, skip this phase.
204
+
205
+ Otherwise scaffold **before writing any code**:
206
+
207
+ - **No project yet:** `graph-agents-cli create <name> ...` (alias of `scaffold create`)
208
+ - **Existing code to import:** `graph-agents-cli scaffold enhance .`
209
+ - **Older scaffold:** `graph-agents-cli scaffold upgrade`
210
+
211
+ Use `/graph-agents-cli-scaffold` for every flag, the valid runtime x checkpointer x target
212
+ combinations, prototype semantics, and what `upgrade` never touches.
213
+
214
+ ## Phase 2: Build and implement
215
+
216
+ 1. Read the project's guidance file for the agent directory (default `app/`).
217
+ 2. Edit only agent code: `app/agent.py` (exports `graph`, an unbound compiled `StateGraph`),
218
+ `app/tools/**`, `app/policies/**`, and the reserved `app/prompts/**` and `app/graph/**`
219
+ directories you may create. `upgrade` never modifies these.
220
+ 3. **Smoke test:** `graph-agents-cli run "your prompt"` starts the local server for the project's
221
+ runtime, sends one chat message over the same `/chat` SSE API your client application will call, and prints
222
+ the reply. Use `--start-server` when iterating on several prompts, and `--thread-id` to continue
223
+ a thread (the footer prints the thread id and the resume command, also after an error).
224
+ `-v` adds one line per SSE event (tool calls, results, usage). Under the `jwt` policy the
225
+ server needs a token: `graph-agents-cli auth dev-token --sub <user> [--roles r1,r2]` writes a
226
+ dev key to `.env` (`APP_ENV=dev` only) and prints a token; put it in
227
+ `GRAPH_AGENTS_CLI_API_KEY` (`export GRAPH_AGENTS_CLI_API_KEY="$(graph-agents-cli auth dev-token
228
+ --sub alice)"`), which `run` and `eval` send as the bearer. Never pass a token with `--header`:
229
+ argv is visible to other users and lands in shell history.
230
+ 4. Interactive testing: `graph-agents-cli playground` (the selected application with reload and
231
+ the `/playground` dev page). `playground --graph` opens LangGraph Studio through `langgraph dev`;
232
+ it bypasses the auth policy and the chat API, so use it for graph debugging only.
233
+ 5. `graph-agents-cli lint` runs ruff and the API-policy check: every `*.py` under `app/tools/`
234
+ (subpackages included) declares one literal `API_CALLS` (and `TOOLS`), which the CLI reads
235
+ statically with `ast` and checks against `api-policy.yaml` (and the API's OpenAPI spec when it
236
+ names one). A refused call comes with the `graph-agents-cli api` command that would allow it:
237
+ propose that change to the user (it widens access, so it needs their approval and a reviewed
238
+ pull request); never run it on your own.
239
+ 6. **Adding functionality to a working agent** follows the same loop: agree the new operations
240
+ and their access with the user, change the policy with `graph-agents-cli api` (`allow`,
241
+ `access`; `--dry-run` first, show the diff), write the tool with its `API_CALLS`, `api check`
242
+ (or `lint`), decide with the user whether the new writes wait for a human (`api approval`;
243
+ eval cases then say how each gate is decided), add eval cases and run `eval run`, then a pull
244
+ request (CODEOWNERS approves `api-policy.yaml`), build and deploy dev, staging, prod. The policy is baked into the image,
245
+ so what passed staging is what reaches production. On an API without `allowed_operations`
246
+ (every operation within its methods), `allow` the operations the agent already calls
247
+ before the new one: the first `allow` creates the list and refuses every call not on it,
248
+ and `access` alone would open a new method to every operation of the API.
249
+ 7. **Agents calling agents.** Declare each agent this one asks with `graph-agents-cli peer add
250
+ <name>` (`--dry-run` first): it writes the `protocol: a2a` API, the gate on relayed
251
+ approvals and `tools/a2a_peers.py`. For several projects, list them in
252
+ `graph-agents-system.yaml` and run `graph-agents-cli system apply`. Never hand-write A2A
253
+ client code or edit `tools/a2a_peers.py`. Pass on what the command prints is left (the
254
+ issuer, the peer's `AUTH_ALLOWED_ACTORS`, and the peer owners' `api approval ...
255
+ --decide-with relayed` line, a loosening they review), then run `graph-agents-cli lint`,
256
+ `graph-agents-cli peer show <name> --check` or `graph-agents-cli system check`. Evaluate at
257
+ the entry agent: `eval run --url` with the agents it asks running.
258
+
259
+ Load `/graph-agents-cli-langgraph-code` for `create_agent` versus explicit `StateGraph`, tools and
260
+ their `API_CALLS` declaration, checkpointers and `thread_id`, streaming events, interrupts
261
+ (a LangGraph pattern; resume over `/chat` is not implemented in this milestone), subgraphs,
262
+ `init_chat_model` provider switching, the deterministic `fake` provider for tests, the auth policy
263
+ adapter, the API client, and telemetry.
264
+
265
+ > **Smoke-test only here; do not write behavioural unit tests.** Model output is
266
+ > non-deterministic; behavioural checks belong in eval (Phase 3), not in `pytest`. Unit tests may
267
+ > cover tools, the API client, and policy code with the `fake` provider.
268
+
269
+ ## Phase 3: Evaluate
270
+
271
+ **This is the most important phase.** Evaluation validates agent behaviour end to end, and the
272
+ gate is enforceable: `eval run` exits non-zero when the gate is not met, and `pr_checks` treats
273
+ that as a failed check.
274
+
275
+ **MANDATORY:** load `/graph-agents-cli-eval` before running evaluation. It has the dataset schema,
276
+ the expect checks, the judge metrics, the gate rule, and the exit codes.
277
+
278
+ **Unit tests versus `graph-agents-cli eval`:**
279
+
280
+ - **Unit tests** (`uv run pytest`) test code correctness: imports, tool functions, policy
281
+ enforcement, the API client, with the `fake` model provider. They never test whether the
282
+ agent behaves well.
283
+ - **`graph-agents-cli eval run`** tests agent behaviour: response content, tool trajectories,
284
+ latency, tokens, and subjective quality through a model judge.
285
+ - **`graph-agents-cli run "prompt"`** is a one-off smoke test during development.
286
+
287
+ **NEVER write unit tests that assert on model response content.** Put those checks in an eval case
288
+ (`expect.contains`, `expect.tool_calls`, a judge metric) instead.
289
+
290
+ 1. Start small: 1-2 cases in `tests/eval/datasets/`. Under `jwt`, export the dev token first
291
+ (Phase 2, step 3): `eval run` sends `GRAPH_AGENTS_CLI_API_KEY` like `run` does.
292
+ 2. `graph-agents-cli eval run` (chains `generate` and `grade`). For debugging use `eval generate`
293
+ then `eval grade` on the traces file.
294
+ 3. Discuss results with the user; paste the per-status counts and the exit code.
295
+ 4. Fix issues; iterate on the core cases first, then add edge cases. When an eval that passed
296
+ before breaks, fix the agent, not the eval: do not edit `tests/eval/` (datasets,
297
+ expectations, `min_pass_rate` thresholds) to reach exit 0, unless the user asked for the
298
+ change the eval checks (for example, a renamed tool or argument). Map each failed check to
299
+ code:
300
+ - `tool_calls` with no actual calls: the tool is not registered. `app/tools/__init__.py`
301
+ collects the `TOOLS` list of every module under `app/tools/`; a module without `TOOLS` (or
302
+ with it renamed) contributes no tools, and nothing warns about it.
303
+ - `contains` fails while the tool is called: look at the tool's return text or the prompt.
304
+ 5. Repeat until `eval run` exits 0. The exit code is the gate; a passing run has no `failed`,
305
+ `error`, or `missing` case and every quality metric meets its `min_pass_rate`.
306
+ 6. To prove a fix or change broke nothing, report all three results: `graph-agents-cli lint`
307
+ (exit code), `eval run` (the per-status counts and the exit code), and a `graph-agents-cli run`
308
+ smoke test whose output shows the expected tool call.
309
+ 7. Under `MODEL_PROVIDER=fake` (or a `fake` judge) the CLI warns that exit 0 is a plumbing check
310
+ only. Say so in your report; never present it as evidence of agent quality.
311
+
312
+ Expect several iterations here.
313
+
314
+ ## Phase 4: Deploy
315
+
316
+ Once the user agrees the eval gate is met:
317
+
318
+ 1. `graph-agents-cli info` shows the deployment target, runtime, CD mode, registry, and auth policy.
319
+ 2. Prototype (`deployment_target: none`)? Add deployment first:
320
+ `graph-agents-cli scaffold enhance . --deployment-target kubernetes [--cd ...]`.
321
+ 3. `graph-agents-cli infra check --env <env>` reports the cluster and repository prerequisites for
322
+ the project's mode (read-only, never creates anything).
323
+ 4. Secrets: `graph-agents-cli secrets apply --env <env>` reads `.env.<env>` (only `dev` falls
324
+ back to `.env`); in `helm-push` and `argocd` modes the named owner provisions them from a
325
+ workstation, never CI. `secrets status --env <env>` exits 0 when every required key is there.
326
+ 5. `graph-agents-cli deploy --env <env>`; what that does depends on the CD mode (direct helm,
327
+ helm from a CI runner, or a pull request that Argo CD reconciles). Outside `dev` the kube
328
+ context must be recorded in the manifest or passed with `--context`; never pass `--yes` to
329
+ accept the current context without showing it to the user. `--dry-run` prints every command
330
+ and the rendered manifests without running them. Agents that call each other:
331
+ `graph-agents-cli system deploy --env <env>` deploys the agents called first.
332
+
333
+ **IMPORTANT: never deploy without explicit human approval.** In `argocd` mode a production change
334
+ is a PR that a code owner merges; the merge is the single gate and you never merge it yourself.
335
+ `/graph-agents-cli-deploy` has the mode table, environments, rotation, and the required GitHub
336
+ settings.
337
+
338
+ ## Phase 5: Observe
339
+
340
+ Tracing is **off** unless `TRACING_ENABLED=true`; `TRACE_CAPTURE` defaults to `metadata` (no
341
+ prompt or tool text). See `/graph-agents-cli-observability` for LangSmith versus OTLP, the capture
342
+ policy, hashed principal ids, and run records.
343
+
344
+ ---
345
+
346
+ # Operational guidelines for coding agents
347
+
348
+ ## Common shortcuts to resist
349
+
350
+ | Shortcut | Why it fails |
351
+ |----------|-------------|
352
+ | "The request is clear enough, no need to clarify" | You are guessing at requirements. Phase 0 (or the project's process) exists to confirm intent before scaffolding. |
353
+ | "The project has a process document, but a quick spec is faster" | The process owns the gates. A generic spec cannot stand in for the approvals it requires. |
354
+ | "It answered correctly in `run`, so eval is unnecessary" | One prompt is not a test suite. The eval gate catches regressions, tool trajectory errors, and edge cases. |
355
+ | "I'll switch to a newer/better model" | The provider and model were chosen deliberately and written to `.env` and the manifest. Changing them without being asked violates code preservation and is an egress decision the user owns. |
356
+ | "I'll add a generic HTTP tool so the agent can call whatever it needs" | `app_utils.api_client` is the only path to external APIs and it enforces `api-policy.yaml`. A generic tool bypasses the policy the team reviewed. |
357
+ | "The tool needs POST, I'll widen the API's access" | Widening access is the user's decision and a reviewed change. Propose the `graph-agents-cli api` command `lint` prints; run it only when asked. |
358
+ | "The approval prompt is in the way, I'll approve it / remove the gate" | Deciding a gated call is the approver's act, and loosening a gate is a reviewed change like widening access. Show the user the call and the `approvals` commands; never decide for them. |
359
+ | "I'll `helm upgrade` / `kubectl apply` directly, it's quicker" | In `argocd` mode the cluster follows `main`; direct changes are drift that self-heal reverts, and they skip the production gate. |
360
+ | "I can skip the scaffold and set up manually" | Manual setup misses the chat API, auth adapter, eval gate, chart, and workflows. Use `create` even for experiments (`--prototype`). |
361
+
362
+ ## Principle 1: code preservation and isolation
363
+
364
+ Change only the lines the user's request targets; preserve everything else (code, configuration
365
+ values such as `MODEL_PROVIDER`, `MODEL_NAME`, `CHECKPOINTER`, comments, formatting).
366
+
367
+ **Before finalizing any edit, verify:**
368
+
369
+ 1. **Target identification:** the exact lines to change, from the user's explicit instruction only.
370
+ 2. **Preservation check:** everything outside the target is identical.
371
+
372
+ Example. User: "Change the system prompt to a recipe suggester."
373
+
374
+ ```python
375
+ # VIOLATION: the model was not requested to change
376
+ graph = create_agent(
377
+ model=init_chat_model("openai:gpt-5"), # replaced get_model() -- NOT asked
378
+ tools=TOOLS,
379
+ system_prompt="You are a recipe suggester.",
380
+ )
381
+
382
+ # COMPLIANT
383
+ graph = create_agent(
384
+ model=get_model(), # PRESERVED: reads MODEL_PROVIDER / MODEL_NAME
385
+ tools=TOOLS, # PRESERVED
386
+ system_prompt="You are a recipe suggester.", # the direct target
387
+ )
388
+ ```
389
+
390
+ ## Principle 2: execution best practices
391
+
392
+ - **Model selection (CRITICAL):**
393
+ - **NEVER change the model or provider unless explicitly asked.** The model is configured by
394
+ `MODEL_PROVIDER` and `MODEL_NAME` in `.env` and the chart, never in code.
395
+ - New projects get the provider default that `create` records. Do not hard-code model names from
396
+ memory; your training data is likely out of date. If the user wants a different model, change
397
+ `MODEL_NAME` in `.env` (and the manifest through `scaffold enhance` when relevant), not `agent.py`.
398
+ - **Running Python:** always through `uv` (`uv run python ...`, `uv run pytest`). Run
399
+ `graph-agents-cli install` (which is `uv sync`) after dependency changes.
400
+ - **3-strikes loop breaker:**
401
+ - **Stop immediately** if you see the same error three times in a row.
402
+ - Red flags: retrying the same `deploy`, incrementing image tags v5 -> v6 -> v7, "I'll try one
403
+ more time" repeatedly, re-running `eval` hoping the judge scores differently.
404
+ - When stuck: run the underlying command directly (`references/internals.md` says which:
405
+ uvicorn, `langgraph dev`, `docker build`, `helm template`, `kubectl`, `gh`), read its output,
406
+ and report to the user instead of retrying.
407
+ - **Troubleshooting:**
408
+ - `/graph-agents-cli-langgraph-code` first; it covers the template contract and the patterns.
409
+ - `graph-agents-cli <command> --help` ends with a `Source:` line pointing at the file that
410
+ implements the command. Read it. `graph-agents-cli info` prints the CLI install path.
411
+ - For LangGraph and LangChain API questions, fetch the upstream docs rather than guessing.
412
+
413
+ ### Systematic debugging
414
+
415
+ 1. **Reproduce:** run the exact command that failed; save the full output.
416
+ 2. **Localize:** agent code, a tool, the policy, configuration, or the environment? Use
417
+ `graph-agents-cli run "prompt" -v` to see every SSE event; use `playground --graph` for graph
418
+ state; use `deploy --dry-run` for rendered manifests.
419
+ 3. **Fix one thing** at a time.
420
+ 4. **Verify** by re-running the reproduction.
421
+ 5. **Guard** with an eval case (behaviour) or a unit test (code).
422
+
423
+ **Stop-the-line rule:** if a change breaks something that worked, fix the regression before
424
+ continuing feature work.
425
+
426
+ If a test fails in code your change did not touch, show that it is unrelated before you move on.
427
+ Grep the failing test for the identifiers you changed, then rerun that test alone. Report it as
428
+ pre-existing, with that evidence and the failure output. Do not edit unrelated code or tests to
429
+ make the failure go away.
430
+
431
+ - **Environment variables:** `.env`, `.env.<env>`, and the manifest are essential configuration;
432
+ never remove or rewrite entries unless the user asks. Never commit `.env` files. Secrets reach
433
+ the cluster only through `secrets apply` from the allow-listed keys in the manifest
434
+ (`secrets.keys`), never through values files or CI.
435
+
436
+ ---
437
+
438
+ ## Using a temporary scaffold as reference
439
+
440
+ When you need specific files (Dockerfile, chart, workflows) without touching the current project,
441
+ create a reference project in a temporary directory with `/graph-agents-cli-scaffold` and copy what
442
+ you need.
443
+
444
+ ---
445
+
446
+ ## Not covered by this skill
447
+
448
+ - LangGraph and LangChain API details: `/graph-agents-cli-langgraph-code`.
449
+ - Scaffold flags and the combination table: `/graph-agents-cli-scaffold`.
450
+ - Dataset schema, judge configuration, gate exit codes: `/graph-agents-cli-eval`.
451
+ - Deployment modes, secrets, GitOps, GitHub settings, `infra check`: `/graph-agents-cli-deploy`.
452
+ - Tracing destinations and capture policy: `/graph-agents-cli-observability`.
453
+ - Any cloud-managed agent runtime, registry, or publishing catalog: graph-agents-cli has none.
454
+
455
+ ## Migration note
456
+
457
+ graph-agents-cli is a fork of google-agents-cli (ADK on Google Cloud). ADK became LangGraph;
458
+ Agent Runtime, Cloud Run, and GKE became any Kubernetes cluster via Helm; Cloud Trace and BigQuery
459
+ analytics became LangSmith or OpenTelemetry behind an opt-in; the Gemini Enterprise `publish`
460
+ command was removed; gcloud authentication became provider keys plus a kubeconfig. If a user asks
461
+ for one of the old names, `references/terminology.md` maps it.
462
+
463
+ ## Reference files
464
+
465
+ | File | Contents |
466
+ |------|----------|
467
+ | `references/commands.md` | Every command with its flags |
468
+ | `references/internals.md` | What each command runs under the hood (uvicorn, `langgraph dev`, docker, helm, kubectl, gh) |
469
+ | `references/terminology.md` | User terms to CLI values; migration mapping of old names |
470
+ | `references/extension.md` | Author an ad-hoc extension or adopt an existing one (override or add commands) |
471
+ | `references/spec-template.md` | `.graph-agents-cli-spec.md` template |
472
+ | `references/brainstorming.md` | Phase 0 design-dialogue playbook |
473
+
474
+ ## Skills version
475
+
476
+ If skills seem outdated or incomplete, reinstall with `graph-agents-cli setup` (or
477
+ `graph-agents-cli update`). Set `GRAPH_AGENTS_CLI_NO_UPDATE_CHECK=1` on disconnected installs to
478
+ silence the update and skills-version checks.
@@ -0,0 +1,118 @@
1
+ # Phase 0 brainstorming playbook
2
+
3
+ Turn the user's idea into an agreed design through a collaborative dialogue, *before* any
4
+ scaffolding or code. Adapt the depth to the agent's complexity.
5
+
6
+ ## Process deference first
7
+
8
+ Before anything else, check the project guidance file (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`) and
9
+ `graph-agents-cli-manifest.yaml` for `process:`. If a process is declared, this playbook serves
10
+ that process's design stage; its documents and approvals replace the spec and the user-review gate
11
+ below. Do not run both.
12
+
13
+ ## HARD GATE
14
+
15
+ Do NOT scaffold, run `graph-agents-cli create`, or write any code until the user has approved the
16
+ spec (or the declared process has granted its approvals). Reading `/graph-agents-cli-langgraph-code`
17
+ to name a matching pattern is exempt; it is design input, not implementation. This applies even to
18
+ "obvious" agents; unexamined assumptions cause the most wasted work.
19
+
20
+ ## Scale to complexity
21
+
22
+ - **Trivial agent:** single tool or none, fixed persona, no external API, no per-user identity.
23
+ A couple of adaptive questions, a 2-3 sentence spec, one approval.
24
+ - **Complex agent:** multi-step graph or subgraphs, external API access with a policy, per-user
25
+ identity and roles, human-in-the-loop, safety-critical.
26
+ Full treatment: adaptive Q&A across all topics, 2-3 approaches, sectioned design with approval
27
+ per section, self-review, user-review gate.
28
+
29
+ When unsure, start light and escalate as complexity surfaces.
30
+
31
+ ## One question at a time
32
+
33
+ - Ask a single question per message; let the answer shape the next. Two questions in one message
34
+ is a batch. Ask the one that most shapes the design first (usually problem and scope before
35
+ integrations).
36
+ - Ask at least one clarifying question before proposing approaches, and never present a full spec
37
+ in your first reply. (Exceptions: a trivial agent, or a genuinely non-interactive run.)
38
+ - Prefer multiple-choice questions.
39
+ - Cover: problem, tools and the API operations they need plus credential, safety, model provider
40
+ and egress, runtime and persistence, auth policy, deployment shape. Follow the user's lead
41
+ rather than a script.
42
+ - YAGNI: prune features that do not serve the stated purpose.
43
+
44
+ ## When you cannot ask
45
+
46
+ When you genuinely cannot get an answer (non-interactive run, a one-liner "just build it", or the
47
+ user defers a choice), make a concrete choice and **list it in the spec under `## Assumptions`**,
48
+ one line each, so the user can correct it. Always surface the axes users leave implicit: **data
49
+ sources, auth method, which model and what may leave the network, whether threads persist.**
50
+
51
+ Non-interactive does not mean skip the thinking. For non-trivial agents still record the
52
+ approaches you weighed and the one you chose, flag oversized scope, and route each capability to
53
+ the pattern in `/graph-agents-cli-langgraph-code` that implements it.
54
+
55
+ ## Propose 2-3 approaches (non-trivial agents)
56
+
57
+ Present 2-3 architecture options with trade-offs and **end with one explicit recommendation**.
58
+ Typical axes:
59
+
60
+ - **`create_agent` (ReAct loop) versus an explicit `StateGraph`** with named nodes, conditional
61
+ edges, and subgraphs. Start with `create_agent`; move to an explicit graph when the flow has
62
+ fixed stages, branching, or a human approval step.
63
+ - **Tool and integration choices:** which API operations, with which methods and credential
64
+ (none, a service token, or the caller's own); everything goes through the API client and must be
65
+ allowed by `api-policy.yaml`. Ask which access each API gets (read-only, read-write, or a custom
66
+ set of methods, then which operations are allowed or denied, and any per-run or per-minute
67
+ limits); never assume a default. There is no generic HTTP tool.
68
+ - **Human-in-the-loop:** which tool calls pause for approval (`interrupt`), and how the calling
69
+ application resumes the thread.
70
+ - **Persistence:** `memory` locally; `postgres` when deployed; `thread_id` is the continuity key.
71
+ - **Model and egress:** hosted provider versus on-network OpenAI-compatible server; tool-capable
72
+ model required for the ReAct pattern.
73
+ - **Auth:** `shared-bearer` (one shared key) versus `jwt` (per-user OIDC tokens, conversation
74
+ ownership) versus `custom` (the project's own policy, for example an existing session cookie).
75
+ - **Deployment shape:** prototype-first (recommended) versus Kubernetes with a CD mode.
76
+
77
+ ## Present the design in sections
78
+
79
+ For complex agents, present the design in sections and get approval after each:
80
+
81
+ - **Graph:** nodes, edges, subgraphs, interrupts; `create_agent` or explicit.
82
+ - **Tools:** each tool's purpose, API operation, credential, and `API_CALLS` declaration.
83
+ - **Data flow and state:** inputs, state schema, what is checkpointed, what is stored in run
84
+ records.
85
+ - **Safety and policy:** denied operations, refusal behaviour, capture policy, egress.
86
+ - **Success criteria:** expect checks and judge metrics per use case.
87
+
88
+ ## Right-size the scope first
89
+
90
+ If the request spans multiple sub-systems (3+ specialist subgraphs, several integrations, distinct
91
+ domains), stop and flag it before designing. Recommend the smallest end-to-end slice that proves
92
+ the architecture and defer the rest under `## Future Phases` in the spec. This holds
93
+ non-interactively too.
94
+
95
+ ## Write the spec
96
+
97
+ Write `.graph-agents-cli-spec.md` from `references/spec-template.md` in the **project's working
98
+ directory** (Phase 0 resumes by reading `./.graph-agents-cli-spec.md`). Name the path in your
99
+ approval message.
100
+
101
+ **Self-review before showing the user:**
102
+
103
+ 1. **Placeholders:** any "TBD" or vague requirement? Fill it in.
104
+ 2. **Consistency:** do sections contradict? Does the graph match the tools and use cases?
105
+ 3. **Scope:** 3+ subgraphs or integrations? Did you carve out a first slice?
106
+ 4. **Measurable success criteria:** each criterion is an `expect` check, a judge threshold, or a
107
+ pass/fail eval, not "works well".
108
+ 5. **Policy:** every API operation a tool needs is in the policy allow-list, and nothing the
109
+ policy denies is assumed.
110
+ 6. **Ambiguity:** could a requirement be read two ways? Pick one and make it explicit.
111
+
112
+ ## User-review gate
113
+
114
+ > "Spec written to `.graph-agents-cli-spec.md`. Please review it and tell me if you want changes
115
+ > before we scaffold."
116
+
117
+ If they request changes, make them and re-run the self-review. Only once they approve do you
118
+ proceed to **Phase 1 (scaffold)**.