Community寫作與編輯github.com

alexaiarchitect/agentcore-skills

將 Amazon Bedrock AgentCore 資源以基礎設施即程式碼方式搭建:Runtime(ECR 儲存庫、服務角色、帶 JWT 授權器與生命週期設定的 `aws_bedrockagentcore_agent_runtime`)、Gateway(角色、JWT 授權器、固定的 MCP 修訂版、一個目標)、Identity(Cognito M2M 客戶端加上僅寫入的 OAuth2 憑證提供者)或 Memory(記憶體、策略、客戶自管金鑰)。預設與建議使用 Terraform 模組;為已在使用 `aws-bedrockagentcore` L1 建構與 AgentCore CLI(`@aws/agentcore`)指令的團隊,也提供 TypeScript CDK 堆疊。每次寫入都會先以 `--dry-run` 顯示計畫,絕不覆蓋既有檔案(除非使用 `--force`),且不會直接套用或執行任何變更。

agentcore-skills 是什麼?

此技能專為自動化建立 Amazon Bedrock AgentCore 資源而生,以基礎設施即程式碼(IaC)形式產出。它支援四類資源:Runtime(含 ECR 儲存庫、服務角色及具 JWT 授權器的運作環境)、Gateway(含角色、JWT 授權器、固定 MCP 修訂版與一個目標)、Identity(Cognito M2M 用戶端及僅寫入的 OAuth2 憑證提供者)以及 Memory(記憶體、策略與客戶自管金鑰)。技能預設採用 Terraform 模組,並為已熟悉 AWS CDK 或 AgentCore CLI 的團隊提供替代方案。其工作流程包含先透過發現腳本了解專案現狀、以 `--dry-run` 預覽寫入內容、經使用者確認後才實際寫入,最後執行審查腳本確保品質。核心設計原則包括:Terraform 優先、模組只產生不套用、僅寫入密碼需 Terraform 1.11+、絕不建立無授權器的 Gateway,且廢棄的入門工具組不再提供。此技能適用於 Claude Code、Cursor 等支援技能目錄的 AI 代理平台。

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

Installed? Explore more 寫作與編輯 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

以 IaC 建立 AgentCore 資源

一個新的 AgentCore 資源應該以經過審查的模組形式,與團隊部署的其他資源放在同一目錄結構中,而不是透過無人能重現的主控台點擊。此技能會撰寫小而扁平的 Terraform 模組——每個模組包含 main.tf、variables.tf、outputs.tf、versions.tf——讓使用者從自己的根模組進行連接。這些模組刻意保持簡單:每個引數都有註解說明、機密僅供寫入、且 Gateway 絕不會在沒有授權器的情況下建立。

${CLAUDE_SKILL_DIR} 由技能執行環境設定為此技能本身的目錄。請在下方每個指令中直接使用該變數;同級技能的腳本位於 ${CLAUDE_SKILL_DIR}/../<skill>/scripts/。

流程

  1. 先進行探索,以便模組能放置在既有模組旁,並確認區域:

    python3 ${CLAUDE_SKILL_DIR}/../agentcore-discover/scripts/discover.py <project> --focus agentcore,region,terraform
    

    如果 AgentCore CLI 或 CDK 已經擁有 AgentCore 資源(DSC004 領地),則提供相對應的 --iac 而非 Terraform。

  2. 規劃寫入。

    python3 ${CLAUDE_SKILL_DIR}/scripts/scaffold.py <project> --component runtime --dry-run
    

    --component gateway|identity|memory、--iac terraform|cdk|cli、 --name、--out-dir、--protocol HTTP|MCP|A2A|AGUI(僅 runtime)。

  3. 選項。 Terraform 模組(推薦,免費)、CDK 堆疊(免費)、或 AgentCore CLI 指令(免費顯示;agentcore deploy 本身由 aws 負責)。

  4. 確認 透過 AskUserQuestion,然後執行相同指令但不加 --dry-run。只有當使用者看到計畫後要求取代檔案時,才加上 --force。

  5. 驗證。 對結果執行審查並顯示:

    python3 ${CLAUDE_SKILL_DIR}/../agentcore-review/scripts/review.py <project>
    

決策規則

  • Terraform 優先。 這是第一個使用者的預設選項,也是此插件的審查、部署計畫與 CI 政策皆適用的唯一選項。hashicorp/aws 提供者涵蓋所有核心資源;如需 awscc 或 CLI 的支援項目,請參閱 provider-coverage.md。
  • 模組只連接,不套用。 腳本會印出需加入的 module 區塊,但不會編輯根模組。
  • 僅寫入機密需要 Terraform 1.11+。 產生的 versions.tf 會明確標示;較舊的 Terraform 必須使用敏感變數,並接受機密會存在狀態檔中(ACR031)。
  • 入門工具組不再提供。 其 CLI 已不再支援;AgentCore CLI 是 CLI 替代方案。

參考資料

問題檔案
每個產生模組的內容與原因terraform-modules.md
CDK 與 AgentCore CLI 路徑及使用時機cdk-and-cli-alternatives.md
hashicorp/aws 涵蓋的資源;awscc 與 CLI 備援方式provider-coverage.md

腳本

指令功能結束碼
scripts/scaffold.py <project> --component C [--iac terraform|cdk|cli] [--dry-run] [--force] [--json]規劃並撰寫模組、CDK 堆疊或顯示 CLI 指令0 已寫入/已規劃,1 無需寫入,2 錯誤引數

完成檢查清單

  • 已執行探索,且所選 IaC 與擁有 AgentCore 資源的對象一致。
  • 寫入計畫已透過 --dry-run 顯示,並在寫入前獲得確認。
  • module 連接區塊已提供給使用者,而非直接寫入他們的根模組。
  • 已對結果執行 review.py 並顯示其發現。

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

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

相關技能