hf-cloud-aws-context-discovery
Discover the active AWS profile, region, account, and caller identity before SageMaker or AWS work. Use when local AWS context is needed or unspecified; do not use for cloud-agnostic model planning.
git clone --depth 1 https://github.com/waybarrios/opencode-power-pack /tmp/hf-cloud-aws-context-discovery && cp -r /tmp/hf-cloud-aws-context-discovery/skills/hf-cloud-aws-context-discovery ~/.claude/skills/hf-cloud-aws-context-discoverySKILL.md
# 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.
Audit and improve project-rules files (AGENTS.md, CLAUDE.md, .agents/instructions, local overrides) so the agent keeps accurate project context. Use when the user asks to check, audit, review, update, improve, or fix their AGENTS.md or CLAUDE.md, mentions "project rules maintenance" or "agent context optimization", or when the codebase has changed enough that the rules file may be stale. Scans the repository for every rules file, grades each against a quality rubric, outputs a quality report, and applies targeted edits only after user approval.
Capture learnings from the current session into the project-rules file (AGENTS.md, CLAUDE.md, or local override) so future sessions benefit. Use when the user says "revise the rules", "update AGENTS.md / CLAUDE.md with what we just learned", "save this to project memory", "remember this for next time", or at the end of a productive session when valuable context has emerged that is not yet documented. This complements agents-md-improver — improver audits, while this one captures.
Design a feature architecture by analyzing existing codebase patterns and conventions, then provide a comprehensive implementation blueprint with specific files to create or modify, component designs, data flows, and a build sequence. Use this skill when the user asks for an architecture design, an implementation plan for a non-trivial feature, or when dispatched as a sub-task during feature-dev architecture phase.
Deeply analyze an existing codebase feature by tracing execution paths, mapping architecture layers, understanding patterns and abstractions, and documenting dependencies. Use this skill when you need to understand how a feature works before modifying or extending it, when dispatched as a sub-task during feature-dev exploration, or when the user asks "how does X work in this codebase".
Review a pull request or a set of code changes for bugs, logic errors, and project-convention violations using a confidence-filtered, multi-agent process. Use this skill when the user asks to review a PR, audit pending changes, or inspect a diff for problems before merging.
Review code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions, using confidence-based filtering to report only high-priority issues that truly matter. Use this skill when reviewing a small set of changes locally (such as unstaged diff), when dispatched as a sub-task during feature-dev quality review, or when the user wants a critique of a specific file or function.
Guide a feature implementation through a structured seven-phase workflow with deep codebase understanding, clarifying questions, parallel architecture design, and quality review. Use this skill when the user asks to build a new feature, add functionality, or wants a methodical approach to implementation rather than diving straight to code.
Create distinctive, production-grade frontend interfaces with high design quality and accessible markup. Use this skill when the user asks to build or beautify web components, pages, applications, landing pages, dashboards, artifacts, or React/HTML/CSS UI. Generates creative, polished code that avoids generic AI aesthetics, then self-checks it against an objective accessibility and quality rubric.