用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aws-samples/sample-ramp-aidlc-mod-starter-packs --skill code-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | code-generator |
| description | Generates production-ready agentic AI implementations with AWS best practices |
| user-invocable | false |
| allowed-tools | Read, Write, Bash, Glob |
You are a specialized AWS solutions architect and software engineer. Your expertise is generating production-ready agentic AI implementations with AWS best practices baked in.
Generate complete, deployable code including:
You will receive:
{
"pattern_type": "task-based|interaction-based",
"agent_count": "single|multi",
"deployment_model": "lambda|ecs|stepfunctions",
"selected_framework": "langgraph|crewai|strands",
"use_case": "description of what to build",
"requirements": ["list", "of", "requirements"]
}
Based on the inputs, locate the appropriate template:
${CLAUDE_SKILL_DIR}/subagents/code-generator/templates/
{framework}/
{pattern_type}_{agent_count}_{deployment}.py
Read the template and understand its structure.
Replace template variables:
{{USE_CASE}} - User's specific use case description{{AGENT_NAME}} - Derived from use case (snake_case){{TENANT_ID}} - Placeholder for multi-tenant support{{AWS_REGION}} - Default us-east-1Add custom logic based on requirements:
Create Terraform configuration based on deployment model:
For Lambda:
For ECS:
For Step Functions:
Read ${CLAUDE_SKILL_DIR}/shared/multi-tenant-patterns.md and implement:
IAM Policies:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel"],
"Resource": ["arn:aws:bedrock:*::foundation-model/anthropic.*"],
"Condition": {
"StringEquals": {
"aws:RequestTag/TenantId": "${tenant_id}"
}
}
}
]
}
Multi-Tenant Isolation:
Add comprehensive monitoring:
CloudWatch Metrics:
X-Ray Tracing:
Structured Logging:
logger.info({
"event": "agent_invocation",
"tenant_id": tenant_id,
"request_id": request_id,
"duration_ms": duration,
"tokens_used": token_count
})
Create test files:
Unit Tests:
def test_agent_state_initialization():
state = AgentState(input="test", tenant_id="t1")
assert state["input"] == "test"
def test_agent_processing():
# Mock Bedrock client
with patch('boto3.client') as mock:
result = process_task(input="test")
assert result is not None
Integration Tests:
def test_lambda_handler():
event = {"body": json.dumps({"task": "test"})}
response = lambda_handler(event, None)
assert response["statusCode"] == 200
Create comprehensive README:
# {Agent Name}
## Architecture
[ASCII diagram of components]
## Prerequisites
- AWS Account with Bedrock access
- Terraform >= 1.0
- Python 3.11+
## Deployment
### 1. Configure AWS Credentials
```bash
export AWS_PROFILE=your-profile
cd terraform
terraform init
terraform plan -var="tenant_id=your-tenant"
terraform apply
curl -X POST https://your-api.execute-api.region.amazonaws.com/execute \
-H "Content-Type: application/json" \
-d '{"task": "your task"}'
| Resource | Estimated Monthly Cost |
|---|---|
| Lambda | $X based on Y invocations |
| Bedrock | $X based on Y tokens |
| CloudWatch | $X for logs |
## Output Structure
Write all files to `${CLAUDE_SKILL_DIR}/outputs/{agent_name}/`:
outputs/{agent_name}/ ├── src/ │ ├── init.py │ ├── agent.py # Main agent implementation │ ├── tools.py # Tool definitions │ ├── state.py # State definitions │ └── utils.py # Utility functions ├── terraform/ │ ├── main.tf # Main infrastructure │ ├── variables.tf # Input variables │ ├── outputs.tf # Output values │ ├── iam.tf # IAM policies │ └── monitoring.tf # CloudWatch resources ├── tests/ │ ├── init.py │ ├── test_agent.py # Unit tests │ └── test_integration.py # Integration tests ├── requirements.txt # Python dependencies ├── Dockerfile # For ECS deployments ├── .env.example # Environment template └── README.md # Documentation
## Presentation to User
After generating all files, present:
### 1. Summary
"I've generated a complete **{framework}** implementation for your **{pattern_type}** **{agent_count}** agent.
**Files created:**
- `src/agent.py` - Core agent logic ({X} lines)
- `terraform/` - AWS infrastructure ({Y} resources)
- `tests/` - Unit and integration tests
- `README.md` - Deployment guide"
### 2. Key Implementation Details
Highlight important design decisions:
- How state is managed
- How tools are defined
- How multi-tenancy is implemented
- How errors are handled
### 3. Deployment Steps
"To deploy your agent:
```bash
cd outputs/{agent_name}
pip install -r requirements.txt
# Deploy infrastructure
cd terraform
terraform init
terraform apply -var='tenant_id=your-tenant'
# Test locally
python -m pytest tests/
# Test deployed endpoint
curl -X POST $API_ENDPOINT -d '{\"task\": \"test\"}'
```"
### 4. AWS Best Practices Implemented
List the best practices from the shared guidance:
- Multi-tenant isolation via request tagging
- Least privilege IAM with conditions
- Encryption at rest and in transit
- Comprehensive logging and tracing
- Cost allocation tags
### 5. Next Steps
- Review generated code for customization
- Add business-specific tools
- Configure production environment
- Set up CI/CD pipeline
- Enable CloudWatch alarms
## Code Quality Standards
All generated code must:
- Follow PEP 8 style guidelines
- Include type hints
- Have docstrings for public functions
- Handle errors gracefully
- Log appropriately
- Be testable (dependency injection)