hf-cloud-aws-context-discovery — скилл для Claude Code
Скилл определяет активный AWS-профиль, регион, аккаунт и ARN перед задачами с AWS. Нужен, чтобы агент не угадывал параметры окружения.
npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a claude-codeЧто делает hf-cloud-aws-context-discovery
Скилл читает локальную конфигурацию AWS перед деплоем, созданием ресурсов, вызовами AWS API и другими задачами, связанными с аккаунтом. Он определяет активный профиль, регион, account ID и ARN вызывающего субъекта, а затем сохраняет эти значения для остальной части сессии.
Для проверки используются aws configure list и aws sts get-caller-identity; при необходимости учитываются AWS_PROFILE, AWS_REGION, AWS_DEFAULT_REGION, ~/.aws/config и ~/.aws/credentials. Регион выбирается из явного запроса пользователя, переменных окружения или профиля. Жёсткий запасной регион не применяется.
Скилл отдельно распознаёт SSO и assumed-role по ARN. При SSO он заранее предупреждает, что создание IAM-роли обычно недоступно, поэтому для SageMaker нужно искать существующую роль. Это повод проверить права до начала деплоя, потому что ошибка иначе появится на шаге iam:CreateRole.
Какие задачи решает
- определить активный AWS-профиль и регион
- проверить учётные данные через AWS STS
- получить account ID и ARN вызывающего субъекта
- распознать SSO или assumed-role до деплоя
- избежать подстановки неверного региона
Примеры запросов агенту
- Перед деплоем в AWS определи профиль, регион и account ID из локальной конфигурации.
- Проверь мой AWS-контекст перед вызовом AWS API и сообщи ARN вызывающего субъекта.
- Перед созданием роли для SageMaker проверь, вошёл ли я через SSO, и предупреди об ограничениях IAM.
Как установить hf-cloud-aws-context-discovery
1Через Skills CLI (Vercel)
npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a claude-code2Вручную: положить файлы
~/.claude/skills/hf-cloud-aws-context-discovery/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/hf-cloud-aws-context-discovery/
1Через Skills CLI (Vercel)
npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a codex2Вручную: положить файлы
.agents/skills/hf-cloud-aws-context-discovery/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a cursor2Вручную: положить файлы
.cursor/skills/hf-cloud-aws-context-discovery/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install huggingface/skills hf-cloud-aws-context-discovery2Вручную: положить файлы
.github/skills/hf-cloud-aws-context-discovery/SKILL.md1Через Skills CLI (Vercel)
npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a gemini-cli2Командой платформы
gemini skills install https://github.com/huggingface/skills --path skills/hf-cloud-aws-context-discoveryВручную: положить файлы
.devin/skills/hf-cloud-aws-context-discovery/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о hf-cloud-aws-context-discovery
Как установить hf-cloud-aws-context-discovery в Claude Code?
Выполните npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a claude-code, затем повторите npx skills add huggingface/skills --skill hf-cloud-aws-context-discovery -a claude-code. Файл скилла находится по пути ~/.claude/skills/hf-cloud-aws-context-discovery/SKILL.md.
Что делает hf-cloud-aws-context-discovery?
Скилл читает AWS-профиль и регион, проверяет учётные данные через STS и возвращает account ID и ARN. Он также распознаёт SSO и предупреждает о возможных ограничениях IAM.
Что произойдёт, если регион не задан?
Скилл ищет регион в явном запросе, AWS_REGION, AWS_DEFAULT_REGION и активном профиле. Если значение не найдено ни на одном из этих шагов, он просит пользователя указать регион и не подставляет us-east-1.
Исходный текст
SKILL.md · Apache-2.0
--- name: hf-cloud-aws-context-discovery description: 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. --- # 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: 1. Region the user explicitly named in this conversation 2. `AWS_REGION` env var 3. `AWS_DEFAULT_REGION` env var 4. `region` field on the active profile in `~/.aws/config` 5. 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 ```bash 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 ```bash # 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-profile` in `eu-west-1`, account `123456789012`. 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.
© huggingface · Apache-2.0 · huggingface/skills