skills/codex/bedrock-agents/SKILL.md
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: bedrock-agents description: Amazon Bedrock Agents patterns for building autonomous AI agents with Claude on AWS. Use when designing agent action groups, knowledge bases, guardrails, multi-agent orchestration, or deploying production agents on Bedrock. --- > **Platform Note:** This skill was designed for multi-agent execution. In Codex, treat sub-agent instructions as sequential steps to complete thoroughly within a single agent
npx skillsauth add frank-luongt/faos-skills-marketplace skills/codex/bedrock-agentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Platform Note: This skill was designed for multi-agent execution. In Codex, treat sub-agent instructions as sequential steps to complete thoroughly within a single agent context.
Build production-grade autonomous AI agents on Amazon Bedrock with Claude as the foundation model.
User Query
--> Bedrock Agent (Claude)
--> ReAct Loop:
1. Reason about intent
2. Select action group or knowledge base
3. Execute (Lambda / KB retrieval)
4. Observe result
5. Repeat or respond
Action groups define tools the agent can invoke via OpenAPI schemas backed by Lambda functions.
# Lambda handler for Bedrock Agent action group
import json
def lambda_handler(event, context):
action_group = event.get("actionGroup")
api_path = event.get("apiPath")
http_method = event.get("httpMethod")
parameters = event.get("parameters", [])
request_body = event.get("requestBody", {})
# Route to handler based on API path
if api_path == "/customers/{customerId}":
customer_id = next(p["value"] for p in parameters if p["name"] == "customerId")
result = get_customer(customer_id)
elif api_path == "/orders":
result = create_order(request_body)
else:
result = {"error": f"Unknown path: {api_path}"}
return {
"messageVersion": "1.0",
"response": {
"actionGroup": action_group,
"apiPath": api_path,
"httpMethod": http_method,
"httpStatusCode": 200,
"responseBody": {
"application/json": {"body": json.dumps(result)}
}
}
}
OpenAPI Schema for Action Group:
openapi: 3.0.0
info:
title: Customer Service API
version: 1.0.0
paths:
/customers/{customerId}:
get:
summary: Get customer details
operationId: getCustomer
parameters:
- name: customerId
in: path
required: true
schema:
type: string
description: The unique customer identifier
responses:
"200":
description: Customer details
content:
application/json:
schema:
type: object
properties:
name:
type: string
email:
type: string
accountStatus:
type: string
import boto3
bedrock_agent = boto3.client("bedrock-agent-runtime")
# Retrieve from knowledge base
response = bedrock_agent.retrieve(
knowledgeBaseId="KB_ID",
retrievalQuery={"text": "What is the refund policy?"},
retrievalConfiguration={
"vectorSearchConfiguration": {
"numberOfResults": 5,
"overrideSearchType": "HYBRID" # SEMANTIC or HYBRID
}
}
)
# Retrieve and generate (RAG in one call)
response = bedrock_agent.retrieve_and_generate(
input={"text": "What is the refund policy?"},
retrieveAndGenerateConfiguration={
"type": "KNOWLEDGE_BASE",
"knowledgeBaseConfiguration": {
"knowledgeBaseId": "KB_ID",
"modelArn": "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
"retrievalConfiguration": {
"vectorSearchConfiguration": {
"numberOfResults": 5
}
}
}
}
)
Supported Data Sources:
Supported Vector Stores:
import boto3
bedrock_agent = boto3.client("bedrock-agent-runtime")
# Invoke supervisor agent that orchestrates sub-agents
response = bedrock_agent.invoke_agent(
agentId="SUPERVISOR_AGENT_ID",
agentAliasId="ALIAS_ID",
sessionId="session-123",
inputText="Process the insurance claim for policy #12345",
enableTrace=True # For debugging agent reasoning
)
# Stream response
for event in response["completion"]:
if "chunk" in event:
print(event["chunk"]["bytes"].decode())
if "trace" in event:
# Inspect agent reasoning steps
trace = event["trace"]["trace"]
if "orchestrationTrace" in trace:
print(f"Agent thinking: {trace['orchestrationTrace']}")
# Apply guardrails to agent responses
guardrail_config = {
"guardrailIdentifier": "GUARDRAIL_ID",
"guardrailVersion": "1",
"trace": "enabled"
}
# Guardrail capabilities:
# - Content filters (hate, violence, sexual, misconduct)
# - Denied topics (custom topic blocks)
# - Word filters (profanity, custom words)
# - PII filters (detect/redact SSN, email, phone, etc.)
# - Contextual grounding (check response is grounded in source docs)
# - Automated reasoning (formal verification of claims)
# Agent returns control to application for confirmation
response = bedrock_agent.invoke_agent(
agentId="AGENT_ID",
agentAliasId="ALIAS_ID",
sessionId="session-123",
inputText="Transfer $10,000 to account ending in 4567"
)
for event in response["completion"]:
if "returnControl" in event:
# Agent wants confirmation before executing
invocation = event["returnControl"]["invocationInputs"][0]
action = invocation["apiInvocationInput"]
print(f"Agent wants to call: {action['apiPath']}")
print(f"With parameters: {action['parameters']}")
# Show to user for approval, then continue session
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: grpo-rl-training description: GRPO reinforcement learning training with TRL. Use when applying Group Relative Policy Optimization for reasoning and task-specific model training. --- # GRPO/RL Training with TRL Expert-level guidance for implementing Group Relative Policy Optimization (GRPO) using the Transformer Reinforcement Learning (TRL) library. This skill provides battle-tested patterns, critical insights, and production-r
tools
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: graphql-architect description: Master modern GraphQL with federation, performance optimization, --- ## Use this skill when - Working on graphql architect tasks or workflows - Needing guidance, best practices, or checklists for graphql architect ## Do not use this skill when - The task is unrelated to graphql architect - You need a different domain or tool outside this scope ## Instructions - Clarify goals, constraints, and
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: grafana-dashboards description: Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces. --- # Grafana Dashboards Create and manage production-ready Grafana dashboards for comprehensive system observability. ## Do not use this skill when - The task is unrelated
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: gptq description: GPTQ post-training quantization for generative models. Use when quantizing large models to 4-bit with calibration-based weight compression. --- # GPTQ (Generative Pre-trained Transformer Quantization) Post-training quantization method that compresses LLMs to 4-bit with minimal accuracy loss using group-wise quantization. ## When to use GPTQ **Use GPTQ when:** - Need to fit large models (70B+) on limited GPU