hf-cloud-aws-context-discovery

Descubra o contexto AWS local do usuário (perfil ativo, região, ID da conta, identidade do chamador) no início de qualquer tarefa AWS. Use esta habilidade antes de qualquer outra tarefa AWS…

npx skills add https://github.com/huggingface/skills --skill hf-cloud-aws-context-discovery

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

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 patternTypeIAM write capability
arn:aws:iam::<acct>:user/<name>IAM userDepends on attached policies
arn:aws:sts::<acct>:assumed-role/AWSReservedSSO_<...>/<email>SSO assumed-roleTypically none — can't create/modify IAM roles
arn:aws:sts::<acct>:assumed-role/<role>/<session>Regular assumed-roleDepends 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-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.

Mais skills de huggingface

cpu-kernels
huggingface
Fornece orientação para escrever, otimizar e fazer benchmarking de kernels de CPU em C++ com intrínsecos SIMD (AVX2/AVX512) para o ecossistema de kernels do Hugging Face. Inclui…
official
generate-openenv-env
huggingface
Gere ambientes OpenEnv a partir de um caso de uso concreto (por exemplo, "gere um env para a biblioteca textarena"). Use quando for solicitado a projetar ou implementar um novo…
official
hf-mcp
huggingface
Use o Hugging Face Hub por meio das ferramentas do servidor MCP. Pesquise modelos, datasets, Spaces, papers. Obtenha detalhes de repositórios, busque documentação, execute jobs de computação e use Gradio…
official
trl-training
huggingface
Treine e ajuste modelos de linguagem transformer usando TRL (Transformers Reinforcement Learning). Suporta treinamento de SFT, DPO, GRPO, KTO, RLOO e Modelo de Recompensa…
official
deploy-hf
huggingface
Implante um ambiente OpenEnv no Hugging Face Spaces. Use quando for solicitado a implantar, enviar para o Hugging Face ou atualizar um espaço.
official
hf-space-recovery
huggingface
Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv`…
official
pre-submit-pr
huggingface
Validar alterações antes de enviar um pull request. Executar verificações abrangentes incluindo lint, testes, revisão de alinhamento e análise de RFC. Usar antes de criar um…
official
example-skill
huggingface
Skill de fixture de exemplo para testes de ação smoke
official