Community生产力与协作github.com

alexaiarchitect/agentcore-skills

将 Amazon Bedrock AgentCore 基础设施置于仅计划的 CI 门控之后。生成一个 GitHub Actions 工作流,在 pull request 影响基础设施时,运行静态 AgentCore 审查(`ACR0xx`)、`terraform fmt -check`、`init`、`validate`、使用只读 OIDC 角色保存计划(Terraform 或 Terragrunt)、`show -json` 以及计划策略(`CI0xx`),然后上传计划 JSON。不对任何内容进行实际应用。

agentcore-skills 是什么?

该技能为使用 Amazon Bedrock AgentCore 基础设施的项目,自动生成一个仅执行计划(plan-only)的 CI 工作流。工作流在每次 pull request 提交时运行 Terraform 或 Terragrunt 计划,并通过一系列策略规则(`CI0xx`)检查计划中是否存在破坏性变更,例如删除或替换 memory、gateway、凭据提供者、工作负载身份、Cognito 用户池或 DynamoDB 表;检测允许 `*` 对 `*` 的 IAM 策略;禁止 `authorizer_type = "NONE"` 的 gateway;并强制使用 SHA 固定的 GitHub Action 版本。工作流不包含 apply 步骤,计划角色为只读,确保变更仅通过人工审核后应用。技能将检查器库(纯 Python 3.10+)供应商到 `ci/agentcore/` 目录中,无需额外安装。用户还可以在本地运行 `policy_check.py` 对已保存的计划进行策略检查。支持 Terraform 和 Terragrunt,并提供详细的引用文档。

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

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

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

文档

仅计划的 CI 与策略门控

昂贵的 AgentCore 错误在计划中可见:会被替换的 memory(所有对话丢失)、会被替换的 gateway(每个客户端的新 URL)、授予全部权限的角色。Pull request 是阻止它们的最便宜的地方,而计划是应该检查的正确产物——它展示了实际会发生什么。

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

流程

  1. 计划工作流(只读):

    python3 ${CLAUDE_SKILL_DIR}/scripts/gen_ci.py <project> --dry-run
    

    --tf-root 用于要计划的堆栈(默认:能触及 AgentCore 资源的根目录),--role-var 用于保存计划角色的 GitHub 变量(默认 AWS_PLAN_ROLE_ARN),--region,--terraform。

  2. 报告 根目录、Terraform 或 Terragrunt、找到的固定版本(如果使用后备方案则报告 CI010)以及角色说明(CI011)。

  3. 选项: 写入工作流和供应商检查器(免费);先对现有已保存计划运行策略(免费)。使用 AskUserQuestion 确认,然后写入。

  4. 在本地测试门控,对用户生成的计划:

    python3 ${CLAUDE_SKILL_DIR}/scripts/policy_check.py agentcore.plan.json
    

    仅对已经过人工审核的替换使用 --allow-replace <address>。

  5. 验证 供应商的运行器能否从仓库根目录工作:python3 ci/agentcore/run.py review .。

CI0xx 区间

编号严重性触发条件
CI001错误计划删除或替换 memory、gateway、凭据提供者、工作负载身份、Cognito 用户池或 DynamoDB 表
CI002错误计划的 IAM 策略允许 * 对 *
CI003错误gateway 计划使用 authorizer_type = "NONE"
CI004警告gateway 计划中未设置 supported_versions
CI005信息计划没有变更
CI006信息计划创建的 AgentCore 资源(计费范围)
CI010信息仓库中没有 SHA 固定的 Actions;使用后备固定版本
CI011信息计划作业的角色必须为只读

决策规则

  • CI 计划;人类应用。 工作流没有 apply 作业,计划角色不应具有写入权限。
  • 允许按地址进行。 --allow-replace 指定一个资源;没有“全部允许”。
  • 固定 Actions 到 SHA。 重用仓库的固定版本;后备方案是第一个用户的仓库在 2026-10-05 上携带的,并用标签标记。
  • 供应商化,而非安装。 ci/agentcore/ 是纯 Python 3.10+;更新插件意味着重新运行 gen_ci.py --force 并审查差异。

参考资料

问题文件
工作流步骤详解、角色、Terragruntplan-only-ci.md
每个策略规则的原理以及如何允许经过审查的例外policy-gates.md

脚本

命令功能退出码
scripts/gen_ci.py <project> [--tf-root D] [--role-var V] [--dry-run] [--force] [--json]生成工作流及 ci/agentcore/0 已写入/已计划,1 无内容,2 参数错误
scripts/policy_check.py <plan.json> [--allow-replace ADDR ...] [--json]对已保存计划运行 CI0xx 门控0 通过,1 策略错误,2 不是计划

完成检查清单

  • 工作流已以写入计划的形式展示,并在写入前已确认。
  • 工作流没有 apply 步骤,且计划角色被描述为只读。
  • 对真实计划运行了 policy_check.py,或者告知用户如何运行。
  • 从仓库根目录验证了供应商化的运行器可以工作。

Individual skills in this repo

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

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

>- Plan the deployment of Amazon Bedrock AgentCore infrastructure and its rollback, and hand the user the exact commands — never running them. Finds the root module (or Terragrunt stack) that actually reaches the AgentCore resources, orders what comes up (identity and roles, then gateway, runtime and memory, then targets and strategies, then log delivery), flags where a first apply trips (IAM propagation, creation-only semantic search, Transaction Search before TRACES delivery, an old provider lock, no remote backend), checks published quotas (targets per gateway, tools per target), and emits init / validate / plan-to-file / show -json / policy check / apply of that saved plan, the post-apply checks, and the rollback for each kind of change. Findings are the `DPL0xx` band; the cost tier is `aws` because the commands create billable resources. Use when asked to "deploy the gateway", "apply this", "what order do I apply in", "how do I roll back", "will this hit a quota", "give me the terraform commands". Don...

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...

相关技能