Community程式設計與開發github.com

alexaiarchitect/agentcore-skills

根據使用情況估算 Amazon Bedrock AgentCore 每月成本,逐項列出公式,並為其設定預算和使用量警報。

agentcore-skills 是什麼?

此技能用於估算 Amazon Bedrock AgentCore 的每月成本,提供逐項明細與計算公式,並能自動生成 AWS 預算和 CloudWatch 使用量警報。它基於 AgentCore 官方定價卡(包含 Gateway 調用、搜尋與工具索引、身分權杖請求、Runtime vCPU 小時與 GB 小時、記憶體短期事件與長期記錄檢索,以及評估代幣)進行計算,而模型代幣則由使用者自行提供每千次費率。技能明確列出不計入的服務(如 Lambda、API Gateway、CloudWatch、X-Ray、DynamoDB),避免將總額誤認為完整帳單。它支援在 Claude Code 等具備技能執行環境的平台上運作,並在生成 Terraform 預算與警報前先進行乾執行(dry run)。所有發現會以 `CST0xx` 編碼呈現。

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

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

AgentCore 要花多少錢?

AgentCore 對每一項服務的計費維度都不相同,而 Gateway 前綴的 Lambda 最常使用的服務(Lambda、API Gateway、CloudWatch、X-Ray)根本就不是 AgentCore。因此,一份誠實的估算只針對 AgentCore 定價卡涵蓋的項目計價,顯示其計算過程,並列出被排除的部分。

${CLAUDE_SKILL_DIR} 由技能執行環境設定為此技能自己的目錄。請在以下每個命令中直接使用它;兄弟技能的腳本位於 ${CLAUDE_SKILL_DIR}/../<skill>/scripts/。

流程

  1. 建立使用輪廓:與使用者一同建立。從範例開始,詢問驅動成本的數字:每日請求數、每次請求的工具呼叫次數、Runtime 工作階段及其長度、記憶體事件與記錄。欄位說明請見:usage-profile.md

    cp ${CLAUDE_SKILL_DIR}/assets/profile.example.json ./agentcore-profile.json
    

    寫入輪廓檔案屬於檔案寫入操作:請先確認後再執行。

  2. 進行估算

    python3 ${CLAUDE_SKILL_DIR}/scripts/cost_estimate.py agentcore-profile.json
    

    使用 --as-of 2026-10-06 套用新的記憶體定價卡;使用 --json 輸出逐行明細。

  3. 回報結果:總額標示為「僅 AgentCore 項目」,並提供各服務拆分、最大筆項目及其公式,以及未計價清單。引用定價來源及其查核日期;所有數字均為列表價格估算。

  4. 選項:預算與警報模組(免費生成);針對最大筆項目提出更便宜的設計(例如:不使用語意搜尋、減少記憶體策略);或什麼都不做。透過 AskUserQuestion 確認,然後執行:

    python3 ${CLAUDE_SKILL_DIR}/scripts/gen_budget.py <專案名稱> --monthly-usd 20 --email [email protected] --profile agentcore-profile.json --dry-run
    
  5. 驗證:寫入專案後,使用 review.py 進行驗證。

CST0xx 編碼區段

編號嚴重程度觸發條件
CST001警告輪廓中的地區未提供 Gateway
CST002資訊未計價的項目(總是列出)
CST003資訊記憶體按 2026-10-05 到期的事件定價卡計費
CST004警告定價卡比 --as-of 日期超過 90 天
CST005資訊該頁面僅發布一套定價卡,非按地區定價
CST010資訊該專案已有預算

決策規則

  • 絕不能將總額稱為「帳單」。 它只是 AgentCore 項目按列表價格計算的金額。
  • 模型代幣由使用者提供數字。 Bedrock 模型價格因模型和地區而異;輪廓中應提供這些數字,否則就將其排除。
  • 透過 Runtime 或 Gateway 的身分權杖請求免費;除此之外,每 1,000 次請求收費 $0.010。
  • 對於失控成本,警報優於預算。 預算延遲數小時;調用警報在一小時內觸發。

參考資料

問題檔案
每個計費維度,附帶費率及其生效日期pricing-dimensions.md
輪廓格式,逐欄說明usage-profile.md
預算與警報模組budget-alarms.md

腳本

命令功能退出碼
scripts/cost_estimate.py <輪廓.json> [--as-of 日期] [--json]逐行估算0 估算完成,2 輪廓格式錯誤
scripts/gen_budget.py <專案名稱> --monthly-usd N [--email E] [--profile P] [--dry-run] [--force] [--json]預算 + 調用警報模組0 已規劃/已寫入,1 無操作,2 參數錯誤

完成檢查清單

  • 輪廓中的數字來自使用者,且在確認後才寫入檔案。
  • 估算結果僅回報 AgentCore 項目,並附上未計價清單。
  • 已引用定價來源與查核日期;記憶體的定價卡日期已套用。
  • 任何預算模組都先以寫入計畫呈現,並在確認後才寫入。

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

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

相關技能