alexaiarchitect/agentcore-skills

Amazon Bedrock AgentCore のインフラストラクチャを、計画のみの CI ゲートで保護します。プルリクエストがインフラに変更を加える際に、AgentCore の静的レビュー、Terraform の整形・検証、計画のポリシーチェックを実行する GitHub Actions ワークフローを生成します。

agentcore-skills とは?

このスキルは、Amazon Bedrock AgentCore の Terraform/Terragrunt インフラストラクチャに対して、計画段階での CI ゲートを導入するためのものです。主な機能は、GitHub Actions ワークフローを自動生成し、プルリクエストが AgentCore リソース(メモリ、ゲートウェイ、資格情報プロバイダーなど)に変更を加える際に、計画の静的レビュー(`ACR0xx`)、`terraform fmt -check`、`init`、`validate`、読み取り専用 OIDC ロールを使用した計画の保存、`show -json`、および `CI0xx` ポリシーチェック(リソースの削除・置換の禁止、IAM ポリシーでの `*` 全体許可の禁止、`authorizer_type = NONE` のゲートウェイの禁止など)を実行します。このスキルはクロードコード、Cursor、Codex などの AI エージェントプラットフォームと連携して動作し、`gen_ci.py` スクリプトでワークフローを生成し、`policy_check.py` でローカルでもポリシーチェックを実行できます。生成されたワークフローは実際の適用(apply)を行わず、計画の確認とポリシー違反の検出のみを行うため、「破壊的な変更をブロックしたい」「AgentCore Terraform に CI を追加したい」といった要件に最適です。

対応✓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に質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

計画のみの CI とポリシーゲート

高額な AgentCore のミスは計画(plan)に現れます:置換されるメモリ(すべての会話が失われる)、置換されるゲートウェイ(すべてのクライアントに新しい 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 バンド

ID重大度トリガー
CI001エラー計画がメモリ、ゲートウェイ、資格情報プロバイダー、ワークロード ID、Cognito ユーザープール、または DynamoDB テーブルを削除または置換する
CI002エラー計画された IAM ポリシーが * に対して * を許可する
CI003エラーauthorizer_type = "NONE" で計画されたゲートウェイ
CI004警告supported_versions なしで計画されたゲートウェイ
CI005情報計画に変更がない
CI006情報計画が作成する AgentCore リソース(課金面)
CI010情報リポジトリに SHA 固定アクションがない;フォールバックピンが使用された
CI011情報計画ジョブのロールは読み取り専用である必要がある

決定ルール

  • CI は計画する;人間が適用する。 ワークフローには適用ジョブがなく、計画ロールは書き込みができないようにする必要があります。
  • 許可はアドレスごと。 --allow-replace は1つのリソースを指定します。「すべて許可」はありません。
  • アクションを SHA に固定する。 リポジトリのピンを再利用します。フォールバックは、2026年10月5日に最初のユーザーのリポジトリが持っていたもので、タグでラベル付けされています。
  • ベンダー化され、インストールされない。 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 計画ではない

完了チェックリスト

  • ワークフローは書き込み計画として表示され、書き込み前に確認された。
  • 適用ステップはなく、計画ロールは読み取り専用として説明された。
  • 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...

関連スキル