Agent skill
bedrock-ops
Bedrock KB + S3 data pipeline management with safety guardrails. S3 sync (with force-upload for content-only changes), KB ingestion status polling, cost monitoring. Enforces identity verification, dry-run, and confirmation for all write operations.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/bedrock-ops
SKILL.md
Bedrock Ops Skill
Safely manage the RAG data pipeline: S3 uploads, Bedrock KB ingestion, session management.
Setup
First time per project
# 1. Generate aws-project.json (lists available profiles, generates config)
uv run python SKILLS_DIR/scripts/setup_project.py <profile-name> [s3-bucket]
# 2. Create aws-project.local.json with your TOTP secret
echo '{"totp_secret": "YOUR_BASE32_SECRET", "mfa_serial": "YOUR_MFA_ARN"}' > aws-project.local.json
Verify setup
# Check session and identity
uv run --with pyotp,boto3 python SKILLS_DIR/scripts/session.py ensure
Commands
All commands are handled by Claude interpreting the user's intent and routing to the appropriate script.
Identity & Session
| Intent | Implementation |
|---|---|
/bedrock-ops setup |
Run uv run python SKILLS_DIR/scripts/setup_project.py to list profiles, then generate config |
/bedrock-ops verify |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/session.py check |
/bedrock-ops session |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/session.py ensure |
S3 Operations
| Intent | Implementation |
|---|---|
/bedrock-ops s3 ls [path] |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py s3 ls s3://<bucket>/<path> |
/bedrock-ops s3 sync <local> <s3> |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py s3 sync <local> <s3> (dry-run first, add --execute for real) |
/bedrock-ops s3 force-upload <local> <s3> |
Use aws s3 cp --recursive instead of sync — required when only file content changed but byte count is the same (e.g. after adding chunk anchors). Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py s3 cp <local> s3://<bucket>/ --recursive (dry-run first, add --execute for real) |
/bedrock-ops s3 upload <file> [s3path] |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py s3 cp <file> s3://<bucket>/<path> |
/bedrock-ops s3 download <s3path> [local] |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py s3 cp s3://<bucket>/<path> <local> |
Cost & Resources
| Intent | Implementation |
|---|---|
/bedrock-ops cost |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py ce get-cost-and-usage --time-period Start=$(date -v1d +%Y-%m-%d),End=$(date +%Y-%m-%d) --granularity MONTHLY --metrics UnblendedCost --group-by Type=DIMENSION,Key=SERVICE |
/bedrock-ops resources ec2 |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py ec2 describe-instances --query 'Reservations[].Instances[].{Id:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[?Key==\Name`].Value |
/bedrock-ops resources s3 |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py s3 ls |
/bedrock-ops resources lambda |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py lambda list-functions --query 'Functions[].{Name:FunctionName,Runtime:Runtime,Memory:MemorySize}' |
Bedrock Knowledge Bases
| Intent | Implementation |
|---|---|
/bedrock-ops kb list |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py bedrock-agent list-knowledge-bases |
/bedrock-ops kb sync <kb-id> |
Auto-detect data source ID, then run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py bedrock-agent start-ingestion-job --knowledge-base-id <kb-id> --data-source-id <ds-id> --execute |
/bedrock-ops kb status <kb-id> |
Poll ingestion job status. Run aws bedrock-agent list-ingestion-jobs --knowledge-base-id <kb-id> --data-source-id <ds-id> --profile personal-session --region ap-northeast-1 --query 'ingestionJobSummaries[0].{status:status,started:startedAt,updated:updatedAt,stats:statistics}' --output json. Repeat every 15 seconds until status is COMPLETE or FAILED. Print elapsed time. |
Arbitrary Command
| Intent | Implementation |
|---|---|
/bedrock-ops exec <args> |
Run uv run --with pyotp,boto3 python SKILLS_DIR/scripts/aws_safe.py <args> |
Safety Rules (ALWAYS enforced by aws_safe.py)
- Identity check: Before any write operation,
sts get-caller-identitymust matchaccount_idinaws-project.json. Abort on mismatch. - Explicit profile: Every command uses
--profilefrom config. Never rely on env vars or default. - Dry-run first: For s3 sync/cp/mv, always
--dryrunfirst. Show output. User must confirm with--execute. - No silent deletes:
--deleteand destructive operations blocked unless--i-understand-this-deletesis passed. - Service blocklist: Respect
safety.denied_servicesin aws-project.json (default: iam, organizations). - Confirmation banner: Before write ops, display profile, account ID, command, and mode (dry-run/live).
- Session auto-refresh: If session expired, auto-regenerate using TOTP from aws-project.local.json.
Config Files
aws-project.json(project root, committed) — profile, account_id, safety rules, defaultsaws-project.local.json(project root, gitignored) — totp_secret, mfa_serial, personal overrides
Path Variables
SKILLS_DIR=.claude/skills/bedrock-ops
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?