Community程式設計與開發github.com

alexaiarchitect/agentcore-skills

規劃 Amazon Bedrock AgentCore 基礎設施的部署與回滾,並提供精確指令供使用者執行(絕不自動執行)。

agentcore-skills 是什麼?

此技能專門用於規劃 Amazon Bedrock AgentCore 的 Terraform 或 Terragrunt 部署流程。它會自動找出實際管理 AgentCore 資源的根模組,並根據依賴關係排序部署階段(例如身份與角色、閘道、執行階段、記憶體、目標、策略、日誌傳遞)。技能會預警首次部署可能失敗的原因,如 IAM 傳播延遲、僅可建立的語義檢索、Transaction Search 需早於 TRACES 日誌啟用、舊的 hashicorp/aws provider 鎖定、以及缺少遠端後端。同時會檢查已發布的配額限制(每個閘道的目標數、每個目標的工具數),確保部署不超限。最終輸出完整的 Terraform 指令序列(init、validate、plan-to-file、show -json、policy check、apply)以及每種變更的對應回滾指令。此技能支援 Claude Code、Cursor 等 AI 代理平台,能夠大幅降低部署 AgentCore 時因人為錯誤或未知限制導致的失敗風險。

相容平台✓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 本身會依據資源間的參照排序,但它無法告訴你:該從哪個根模組開始規劃、哪些原因(非依賴圖層面)會導致首次 apply 失敗、哪些設定後續無法變更、以及如何復原。此技能不寫入任何內容,也不執行任何指令:它只印出指令,由使用者自行執行。

${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 用於當發現的根模組並非實際要部署的根模組(provider 限制、鎖定、區域與階段則屬於該根模組);--plan-file NAME;--json。指令中會將插件命名為 $AGENTCORE_PLUGIN,由印出的 setup 行設定。

  3. 回報 根模組、階段、DPL 發現結果、指令及回滾,按此順序。說明成本等級:這些指令會在使用者的帳戶中建立計費資源。

  4. 選項: (1,建議) 使用者執行 init → validate → plan 輸出至檔案 → show -json → 策略檢查,然後貼上策略輸出;(2) 閱讀後,使用者 apply 該已儲存的 plan 檔案。每個步驟都使用 AskUserQuestion 確認;切勿合併成一步。

  5. 驗證 在使用者回報成功 apply 後,轉交給 /agentcore:agentcore-verify。

DPL0xx 代碼系列

代碼嚴重程度觸發條件
DPL001警告無遠端後端(且無 Terragrunt)
DPL002錯誤超過已發布配額(每個閘道的目標數、每個目標的工具數)
DPL003資訊角色與閘道在同一次 apply:IAM 傳播可能導致首次嘗試失敗
DPL004資訊語義檢索僅可建立
DPL005資訊使用 Terragrunt 堆疊:指令使用 terragrunt
DPL006警告hashicorp/aws 鎖定低於 6.55.0
DPL007資訊TRACES 日誌傳遞需先啟用 Transaction Search
DPL008資訊所選根模組未宣告 hashicorp/aws 版本限制

決策規則

  • Apply 已儲存的 plan,絕不使用 -auto-approve。 使用者讀過的 plan 才是實際執行的 plan。
  • 先做策略檢查再 apply。 policy_check.py 拒絕刪除記憶體、閘道、憑證提供者和使用者集區,除非加上明確的 --allow-replace。
  • -target 僅用於回滾,不可用於首次部署。 若首次 apply 因 IAM 傳播失敗,重新執行同一個 apply。
  • 回滾採用還原方式,而非銷毀。 有狀態資源(使用者、對話、機密)絕不納入回滾。

參考資料

問題檔案
階段順序、首次 apply 失敗原因、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)。
  • 使用者已在使用者執行 apply 前完成 plan → show -json → 策略檢查。
  • 僅由使用者 apply 已儲存的 plan 檔案;助理未執行任何指令。
  • 在 apply 前已說明此次變更的回滾方式。

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

相關技能