hf-cloud-aws-context-discovery
Skill này làm gì
Skill này kiểm tra AWS account, profile và region mà AI nên dùng trước khi làm bất kỳ việc gì trên cloud. Skill dành cho người thiết lập triển khai machine learning trên Amazon Web Services.
Khi nào nên dùng
- ✓Khi bạn bắt đầu bất kỳ việc gì trên AWS, chẳng hạn triển khai lên SageMaker hoặc gọi API AWS.
- ✓Khi bạn chưa nói rõ dùng AWS profile hoặc region nào.
- ✓Khi bạn nói điều gì đó như dùng tài khoản AWS của tôi, và agent cần thông tin tài khoản đúng.
Liên kết skill
https://github.com/huggingface/skills/blob/main/skills/hf-cloud-aws-context-discovery/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Dùng tài khoản AWS của tôi để thiết lập triển khai SageMaker, và cho tôi biết bạn đã tìm thấy profile và region nào.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI đọc cài đặt AWS cục bộ của bạn, như profile đang dùng và region, rồi chạy một kiểm tra danh tính đơn giản. AI không đoán region, và chỉ hỏi bạn khi cài đặt không cung cấp được.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
Câu hỏi thường gặp
Skill có dùng một region mặc định không?
Không. Skill dùng cài đặt của bạn hoặc region bạn đã nêu, và không giả định một mặc định cố định trong mã.
Điều gì xảy ra nếu profile của tôi không tồn tại?
Skill báo rõ điều đó để bạn sửa profile trước khi bất kỳ công việc nào bắt đầu.
Skill có kiểm tra tôi đã đăng nhập chưa?
Có. Kiểm tra danh tính xác nhận thông tin xác thực của bạn còn hợp lệ trước khi công việc tiếp tục.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 11k
- Vị trí xếp hạng
- #11766
- Giấy phép
- Apache-2.0
- Cập nhật
- 30/10/2026
Bình luận
- …
Thêm skill từ kho mã này
hf-cli
11kGiúp agent của bạn dùng công cụ dòng lệnh Hugging Face để tải xuống, tải lên và quản lý model, dataset, Spaces, repo và bộ nhớ đệm cục bộ.
hf-cloud-python-env-setup
11kGiúp agent của bạn thiết lập môi trường Python sạch với phiên bản Python phù hợp và thư viện mới nhất trước khi chạy SageMaker hoặc tự động hóa AWS.
hf-cloud-sagemaker-deployment-planner
11kGiúp agent của bạn lên kế hoạch triển khai model lên Amazon SageMaker, chọn lưu trữ thời gian thực, serverless, async hoặc batch với mặc định hợp lý.
hf-cloud-sagemaker-iam-preflight
11kGiúp agent của bạn xác nhận có một SageMaker execution role dùng được trước khi triển khai, thay vì tạo quyền mới trong tài khoản AWS mà không kiểm tra.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.