hf-cloud-aws-context-discovery
できること
このスキルは、クラウドの作業を行う前に、AIがどのAWSアカウント、プロファイル、リージョンを使うべきかを確認します。Amazon Web Services上で機械学習のデプロイを設定している人向けです。
使う場面
- ✓SageMakerへのデプロイやAWS APIの呼び出しなど、AWSの作業を始めるとき。
- ✓使うAWSのプロファイルやリージョンを、まだ指定していないとき。
- ✓「私のAWSアカウントを使って」と言い、エージェントが正しいアカウントの詳細を必要とするとき。
スキルのリンク
https://github.com/huggingface/skills/blob/main/skills/hf-cloud-aws-context-discovery/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のAWSアカウントを使って、SageMakerのデプロイを設定してください。見つけたプロファイルとリージョンも教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、アクティブなプロファイルやリージョンなど、ローカルのAWSの設定を読み、簡単なID確認を実行します。リージョンを推測することはなく、設定がリージョンを提供しない場合にのみ質問します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
AWS Context Discovery
Before doing any AWS work, read the user's local AWS config. Don't guess the region, and don't ask the user for things their config already answers.
What to discover
Run these at the start of the AWS work and remember the results for the rest of the session.
1. Active profile
AWS_PROFILE env var, else default. If the user mentioned a profile in their prompt, that overrides. If the named profile doesn't exist in ~/.aws/config, surface that clearly.
2. Region
Resolution order — stop at the first one that produces a value:
- Region the user explicitly named in this conversation
AWS_REGIONenv varAWS_DEFAULT_REGIONenv varregionfield on the active profile in~/.aws/config- Ask the user — but only after the first four have failed
Do not fall back to us-east-1 or any other hardcoded default.
3. Credentials, account ID, caller ARN
aws sts get-caller-identity --profile <profile> --region <region>
Three purposes in one call: confirms credentials are valid (stop if not), returns the Account ID (needed for ARN construction), returns the Arn of the caller.
4. Identify SSO / assumed-role principals
The Arn field tells you what kind of principal this is. The pattern matters because it determines what IAM operations the caller can do.
| ARN pattern | Type | IAM write capability |
|---|---|---|
arn:aws:iam::<acct>:user/<name> |
IAM user | Depends on attached policies |
arn:aws:sts::<acct>:assumed-role/AWSReservedSSO_<...>/<email> |
SSO assumed-role | Typically none — can't create/modify IAM roles |
arn:aws:sts::<acct>:assumed-role/<role>/<session> |
Regular assumed-role | Depends on the role |
If the caller is SSO, surface this immediately before later skills hit iam:CreateRole and fail:
Heads up: you're authenticated via SSO (
AWSReservedSSO_<PermissionSet>_...). SSO principals usually can't create IAM roles directly. If we need a SageMaker execution role, I'll look for an existing one first — if none exists, you'll need to ask whoever manages your AWS access to create one.
This is the highest-leverage thing this skill does. Surfacing it now turns a confusing mid-deployment error into a five-second conversation.
Commands to run
# Effective profile and region (faster than parsing config files)
aws configure list
# Validate credentials and get identity
aws sts get-caller-identity
aws sts get-caller-identity --profile <profile-name> # if a profile was named
aws configure list handles env-var overrides and shows the resolved effective values. Prefer it over parsing ~/.aws/config yourself. If you need to read raw config (e.g. to list profiles), ~/.aws/config and ~/.aws/credentials are plain INI files — read-only.
What to report back
One or two lines, not a wall of text:
Working with profile
my-profileineu-west-1, account123456789012. You're authenticated via SSO, so we'll need to use an existing IAM role rather than create one.
Don't ask the user to confirm the region you just read from their config — they configured it; that is the confirmation.
If something is wrong (credentials expired, profile doesn't exist, no region anywhere), stop and surface the specific error before continuing.
よくある質問
初期設定のリージョンにフォールバックしますか?
いいえ。あなたの設定、または指定したリージョンを使い、決め打ちの初期値は想定しません。
プロファイルが存在しない場合は?
スキルはそれを明確に報告するので、作業を始める前にプロファイルを直せます。
サインインしているかも確認しますか?
はい。ID確認により、作業を続ける前に認証情報が有効であることを確かめます。
詳細
作者による元の説明
Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use this skill before any other AWS work — deploying to SageMaker, creating resources, calling AWS APIs, or anything that touches an AWS account. Use it especially when the user has not specified a region or profile explicitly, when they say things like "use my AWS account", "deploy to AWS", "use my profile", or when about to make any AWS CLI or SDK call. Never guess the region or account ID — always use this skill to read it from the local configuration first.
repo: huggingface/skills
人気
- GitHubのスター
- 11k
- ランキング
- #11766
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/30
コメント
- …
このリポジトリの他のスキル
hf-cli
11kエージェントが、Hugging Faceのコマンドラインツールhfでモデル、データセット、Spaces、リポジトリ、ローカルのキャッシュをダウンロード、アップロード、管理できるよう支援します。
hf-cloud-python-env-setup
11kエージェントが、SageMakerやAWSの自動化を実行する前に、適切なPythonのバージョンと最新のライブラリで、クリーンなPython環境を設定できるよう支援します。
hf-cloud-sagemaker-deployment-planner
11kエージェントが、モデルをAmazon SageMakerにデプロイする方法を計画し、リアルタイム、サーバーレス、非同期、バッチのホスティングから、適切な既定値とともに選べるよう支援します。
hf-cloud-sagemaker-iam-preflight
11kエージェントが、デプロイ前に使えるSageMakerの実行ロールがあるかを確認し、確認せずにAWSアカウントに新しい権限を作ることを避けられるよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。