Community编程与开发github.com

alexaiarchitect/agentcore-skills

规划 Amazon Bedrock AgentCore 基础设施的部署与回滚,并向用户提供确切的命令——但绝不执行它们。

agentcore-skills 是什么?

该技能为 Amazon Bedrock AgentCore 基础设施的部署与回滚提供精确的命令规划,而不实际执行任何操作。它能够自动发现实际管理 AgentCore 资源的根模块(或 Terragrunt 堆栈),并确定资源部署的顺序:身份与角色优先,然后是网关、运行时与内存,接着是目标与策略,最后是日志交付。此外,它还能识别首次应用可能遇到的典型陷阱(如 IAM 传播延迟、仅创建时生效的语义搜索、在启用 TRACES 交付前需要先启用 Transaction Search、旧的提供商锁版本、缺少远程后端等问题),并检查已知的已发布配额限制(每个网关的目标数量、每个目标的工具数量)。最终,它生成完整的 init、validate、plan-to-file、show -json、policy check、apply(使用已保存的计划文件)等命令,以及部署后的验证步骤和针对每种变更类型的回滚方案。该技能适用于任何需要“部署网关”、“执行应用”、“确定应用顺序”、“如何进行回滚”、“是否会触发配额限制”或“请给出 terraform 命令”等场景。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alexaiarchitect/agentcore-skills/tree/HEAD/skills/agentcore-deploy

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

部署 AgentCore:顺序、配额、命令、回滚

部署是此插件停止行动并开始建议的地方。Terraform 已经按资源的引用关系排序;但它无法告知你应该规划哪个根模块、哪些原因会导致首次应用因图外因素失败、哪些设置后续无法更改、以及如何回滚。此技能不写入任何内容,也不运行任何内容:它打印出命令,由用户执行。

${CLAUDE_SKILL_DIR} 由技能运行时设置为该技能自身的目录。在以下所有命令中直接使用它;同级技能的脚本位于 ${CLAUDE_SKILL_DIR}/../<skill>/scripts/。

流程

  1. 首先审查。 在错误之上进行部署规划,就是规划部署错误:

    python3 ${CLAUDE_SKILL_DIR}/../agentcore-review/scripts/review.py <project>
    
  2. 规划部署。

    python3 ${CLAUDE_SKILL_DIR}/scripts/deploy_plan.py <project>
    

    --root DIR 当发现的根模块不是要部署的根模块时使用(提供商约束、锁、区域和阶段则跟随该根模块);--plan-file NAME;--json。命令将插件命名为 $AGENTCORE_PLUGIN,由打印的 setup 行设置。

  3. 报告 根模块、阶段、DPL 发现结果、命令和回滚方案,按此顺序。声明成本层级:这些命令会在用户账户中创建可计费资源。

  4. 选项: (1,推荐)用户执行 init → validate → plan to a file → show -json → 策略检查,并粘贴策略输出;(2)阅读后,用户应用 该已保存的计划文件。使用 AskUserQuestion 确认每一步;切勿将它们合并为一个步骤。

  5. 验证 用户报告成功应用后,交给 /agentcore:agentcore-verify。

DPL0xx 发现码

ID严重级别触发条件
DPL001警告无远程后端(且无 Terragrunt)
DPL002错误超过已发布的配额(每个网关的目标数、每个目标的工具数)
DPL003信息角色和网关在同一应用:IAM 传播可能在首次尝试时失败
DPL004信息语义搜索是仅创建时生效的
DPL005信息Terragrunt 堆栈:命令使用 terragrunt
DPL006警告hashicorp/aws 版本锁定低于 6.55.0
DPL007信息TRACES 交付需要先启用 Transaction Search
DPL008信息所选的根模块未声明 hashicorp/aws 版本约束

决策规则

  • 应用已保存的计划,绝不使用 -auto-approve。 用户阅读的计划才是要运行的计划。
  • 策略优先于应用。 policy_check.py 在没有显式 --allow-replace 的情况下拒绝删除记忆、网关、凭据提供者和用户池。
  • -target 仅用于回滚,不用于首次部署。 如果首次应用因 IAM 传播失败,重新运行相同的应用。
  • 回滚通过回退(revert)而非销毁(destroy)实现。 有状态资源(用户、对话、密钥)绝不参与回滚。

参考

问题文件
阶段顺序、导致首次应用失败的原因、Terragruntapply-sequencing.md
部署时重要的 AgentCore 配额quotas.md
每种变更类型的回滚;绝不销毁的内容rollback.md

脚本

命令功能退出码
scripts/deploy_plan.py <project> [--root DIR] [--plan-file F] [--json]根模块、阶段、DPL 发现结果、命令、回滚0 无错误,1 有错误,2 无 Terraform

完成检查清单

  • review.py 已首先运行,其错误已被解决或用户已接受。
  • deploy_plan.py 已运行;根模块已与用户确认。
  • 在移交任何命令之前已声明成本层级(aws)。
  • 用户在任何应用之前已运行 plan → show -json → policy check。
  • 仅由用户应用已保存的计划文件;助手未运行任何命令。
  • 在应用前已声明本次变更的回滚方案。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

alexaiarchitect/agentcore-skills

>- Put Amazon Bedrock AgentCore infrastructure behind a plan-only CI gate. Generates a GitHub Actions workflow that, on pull requests touching the infrastructure, runs the static AgentCore review (`ACR0xx`), `terraform fmt -check`, `init`, `validate`, a saved `plan` (Terraform or Terragrunt) with a read-only OIDC role, `show -json`, and the plan policy (`CI0xx`: no delete or replace of memories, gateways, credential providers, workload identities, user pools or tables without an explicit per-address allowance; no `*` on `*`; no gateway with `authorizer_type = NONE`; pinned MCP revisions), then uploads the plan JSON. Nothing in it applies. The plugin's stdlib-only library is vendored into `ci/agentcore/` so the job needs nothing from the plugin, and action pins are reused from the repository's own SHA-pinned workflows. `policy_check.py` also runs locally on any saved plan. Use when asked to "add CI for the AgentCore Terraform", "gate the plan", "block destructive changes", "policy check the plan", "plan on ...

alexaiarchitect/agentcore-skills

>- Estimate what Amazon Bedrock AgentCore will cost per month from a usage profile, line by line with the formula for each line, and put a budget and a usage alarm around it. Prices the published AgentCore rate card (Gateway invocations, search and tool indexing; Identity token requests, free through Runtime or Gateway; Runtime vCPU-hours billed only while active and GB-hours; Memory short-term events — per 1,000 events until 2026-10-05, per GB from 2026-10-06 — and long-term records and retrievals; Evaluations tokens), prices model tokens only at the user's own per-1,000 rates, and lists what it does not price (Lambda, API Gateway, CloudWatch, X-Ray, DynamoDB) so the total is never mistaken for the bill. Generates an AWS Budget filtered to AgentCore with forecast and actual alerts, plus a CloudWatch alarm on gateway invocations, as Terraform after a dry run. Findings are the `CST0xx` band. Use when asked "what will AgentCore cost", "estimate the gateway bill", "is there a free tier", "memory pricing chang...

alexaiarchitect/agentcore-skills

>- Scaffold Amazon Bedrock AgentCore resources as infrastructure as code: a Runtime (ECR repository, service role, `aws_bedrockagentcore_agent_runtime` with a JWT authorizer and lifecycle settings), a Gateway (role, JWT authorizer, pinned MCP revisions, one target), Identity (Cognito M2M client plus an OAuth2 credential provider with write-only secrets) or Memory (memory, strategies, customer-managed key). Terraform modules are the default and the recommendation; a TypeScript CDK stack with the `aws-bedrockagentcore` L1 constructs and the AgentCore CLI (`@aws/agentcore`) commands are offered for teams already on them. Every write is shown as a plan first (`--dry-run`), existing files are never overwritten without `--force`, and nothing is planned or applied. Use when asked to "create an AgentCore runtime", "scaffold a gateway", "add AgentCore memory", "write the Terraform for AgentCore", "start a new AgentCore stack", or "give me the CDK for this". Don't use for a gateway in front of an existing Lambda, HT...

alexaiarchitect/agentcore-skills

>- Inventory a project for Amazon Bedrock AgentCore work and report before advising. Finds existing AgentCore resources and which tool owns them (Terraform `aws_bedrockagentcore_*`/`awscc_*`, CDK constructs, the AgentCore CLI's `agentcore.json`, the deprecated starter toolkit's `.bedrock_agentcore.yaml`, boto3 `bedrock-agentcore` clients, the AgentCore Python SDK and `@requires_access_token`), the agent framework (Strands, LangGraph, LangChain, Claude Agent SDK, CrewAI, OpenAI Agents, ADK, raw), MCP servers and the API Gateway routes and Lambdas behind `/mcp`, Cognito pools, clients and JWT authorizers, the AWS region and per-service availability there, the hashicorp/aws constraint and lock, Terragrunt, and Lambda tracing. Read-only; findings are the `DSC0xx` band. Use when asked "what do I have", "is this on AgentCore", "inventory this repo", "which region are we in", "is AgentCore available in eu-central-1", "what framework is this agent", or before any other AgentCore skill on an unfamiliar project. Don...

相关技能