Community生產力與協作github.com

alexaiarchitect/agentcore-skills

將 Amazon Bedrock AgentCore 基礎設施放在僅計劃的 CI 閘門後。產生一個 GitHub Actions 工作流程,在涉及基礎設施的拉取請求上執行靜態 AgentCore 審查、Terraform 格式檢查、初始化、驗證、儲存的計劃、計劃政策檢查,並上傳計劃 JSON。

agentcore-skills 是什麼?

此技能為 Amazon Bedrock AgentCore 基礎設施建立一個僅計劃的 CI 閘門。它會產生一個 GitHub Actions 工作流程,在觸及基礎設施的拉取請求上執行一系列檢查:靜態 AgentCore 審查(`ACR0xx`)、`terraform fmt -check`、`init`、`validate`、使用唯讀 OIDC 角色儲存的計劃(Terraform 或 Terragrunt)、`show -json` 以及計劃政策(`CI0xx`)。政策規則會封鎖破壞性變更,例如刪除或取代記憶體、閘道、憑證提供者、工作負載身分、使用者池或資料表;不允許 IAM 政策中的 `*` on `*`;不允許 `authorizer_type = NONE` 的閘道;並固定 MCP 修訂。此工作流程完全沒有 apply 步驟,因此計劃僅用於審查。該技能的標準函式庫被封裝在 `ci/agentcore/` 目錄中,因此工作不需要外部相依性。使用者可以要求「為 AgentCore Terraform 新增 CI」、「閘門計劃」、「封鎖破壞性變更」、「政策檢查計劃」或「在 PR 上計劃」。

相容平台✓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 錯誤在計劃中是可見的:會被取代的記憶體(所有對話紀錄消失)、會被取代的閘道(每個用戶端的新 URL)、授予所有權限的角色。拉取請求是阻止這些錯誤最便宜的地方,而計劃是檢查的正確產物——它是實際會發生的事情。

${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錯誤計劃刪除或取代記憶體、閘道、憑證提供者、工作負載身分、Cognito 使用者池或 DynamoDB 資料表
CI002錯誤計劃的 IAM 政策允許 * on *
CI003錯誤計劃的閘道使用 authorizer_type = "NONE"
CI004警告計劃的閘道未設定 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...

相關技能