@plazmodium/odin 0.3.2-beta → 0.3.4-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -11
- package/builtin/ODIN.md +1045 -0
- package/builtin/agent-definitions/README.md +170 -0
- package/builtin/agent-definitions/_shared-context.md +377 -0
- package/builtin/agent-definitions/architect.md +627 -0
- package/builtin/agent-definitions/builder.md +716 -0
- package/builtin/agent-definitions/discovery.md +293 -0
- package/builtin/agent-definitions/documenter.md +238 -0
- package/builtin/agent-definitions/guardian.md +1049 -0
- package/builtin/agent-definitions/integrator.md +363 -0
- package/builtin/agent-definitions/planning.md +236 -0
- package/builtin/agent-definitions/product.md +405 -0
- package/builtin/agent-definitions/release.md +430 -0
- package/builtin/agent-definitions/reviewer.md +447 -0
- package/builtin/agent-definitions/watcher.md +402 -0
- package/builtin/skills/api/graphql/SKILL.md +548 -0
- package/builtin/skills/api/grpc/SKILL.md +554 -0
- package/builtin/skills/api/rest-api/SKILL.md +469 -0
- package/builtin/skills/api/trpc/SKILL.md +503 -0
- package/builtin/skills/architecture/clean-architecture/SKILL.md +141 -0
- package/builtin/skills/architecture/domain-driven-design/SKILL.md +129 -0
- package/builtin/skills/architecture/event-driven/SKILL.md +145 -0
- package/builtin/skills/architecture/microservices/SKILL.md +143 -0
- package/builtin/skills/architecture/tla-precheck/SKILL.md +171 -0
- package/builtin/skills/backend/golang-gin/SKILL.md +141 -0
- package/builtin/skills/backend/nodejs-express/SKILL.md +277 -0
- package/builtin/skills/backend/nodejs-fastify/SKILL.md +152 -0
- package/builtin/skills/backend/python-django/SKILL.md +128 -0
- package/builtin/skills/backend/python-fastapi/SKILL.md +140 -0
- package/builtin/skills/database/mongodb/SKILL.md +132 -0
- package/builtin/skills/database/postgresql/SKILL.md +120 -0
- package/builtin/skills/database/prisma-orm/SKILL.md +366 -0
- package/builtin/skills/database/redis/SKILL.md +140 -0
- package/builtin/skills/database/supabase/SKILL.md +416 -0
- package/builtin/skills/devops/aws/SKILL.md +382 -0
- package/builtin/skills/devops/docker/SKILL.md +359 -0
- package/builtin/skills/devops/github-actions/SKILL.md +435 -0
- package/builtin/skills/devops/kubernetes/SKILL.md +459 -0
- package/builtin/skills/devops/terraform/SKILL.md +453 -0
- package/builtin/skills/frontend/alpine-dev/SKILL.md +27 -0
- package/builtin/skills/frontend/angular-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/astro-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/htmx-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/nextjs-dev/SKILL.md +470 -0
- package/builtin/skills/frontend/react-patterns/SKILL.md +166 -0
- package/builtin/skills/frontend/svelte-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/tailwindcss/SKILL.md +131 -0
- package/builtin/skills/frontend/vuejs-dev/SKILL.md +28 -0
- package/builtin/skills/generic-dev/SKILL.md +307 -0
- package/builtin/skills/testing/cypress/SKILL.md +372 -0
- package/builtin/skills/testing/jest/SKILL.md +176 -0
- package/builtin/skills/testing/playwright/SKILL.md +341 -0
- package/builtin/skills/testing/unit-tests-eval-sdd/SKILL.md +73 -0
- package/builtin/skills/testing/unit-tests-sdd/SKILL.md +83 -0
- package/builtin/skills/testing/vitest/SKILL.md +249 -0
- package/dist/adapters/skills/filesystem.d.ts.map +1 -1
- package/dist/adapters/skills/filesystem.js +2 -18
- package/dist/adapters/skills/filesystem.js.map +1 -1
- package/dist/builtin-assets.d.ts +8 -0
- package/dist/builtin-assets.d.ts.map +1 -0
- package/dist/builtin-assets.js +90 -0
- package/dist/builtin-assets.js.map +1 -0
- package/dist/init.js +69 -11
- package/dist/init.js.map +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/prepare-phase-context.d.ts.map +1 -1
- package/dist/tools/prepare-phase-context.js +5 -0
- package/dist/tools/prepare-phase-context.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aws
|
|
3
|
+
description: AWS cloud services expertise covering compute, storage, networking, databases, and serverless. Covers EC2, S3, RDS, Lambda, ECS, and IAM best practices.
|
|
4
|
+
category: devops
|
|
5
|
+
compatible_with:
|
|
6
|
+
- terraform
|
|
7
|
+
- docker
|
|
8
|
+
- kubernetes
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# AWS Cloud Services
|
|
12
|
+
|
|
13
|
+
## Instructions
|
|
14
|
+
|
|
15
|
+
1. **Assess the cloud architecture need**: Serverless, containers, or traditional compute.
|
|
16
|
+
2. **Follow AWS best practices**:
|
|
17
|
+
- Least privilege IAM
|
|
18
|
+
- Encryption at rest and in transit
|
|
19
|
+
- Multi-AZ for high availability
|
|
20
|
+
- Use managed services when possible
|
|
21
|
+
3. **Provide complete configurations**: Include IAM policies, security groups, and CLI commands.
|
|
22
|
+
4. **Guide on cost optimization**: Right-sizing, reserved instances, spot instances.
|
|
23
|
+
|
|
24
|
+
## Core Services Overview
|
|
25
|
+
|
|
26
|
+
| Category | Services |
|
|
27
|
+
|----------|----------|
|
|
28
|
+
| Compute | EC2, Lambda, ECS, EKS, Fargate |
|
|
29
|
+
| Storage | S3, EBS, EFS |
|
|
30
|
+
| Database | RDS, DynamoDB, ElastiCache, Aurora |
|
|
31
|
+
| Networking | VPC, ALB/NLB, Route 53, CloudFront |
|
|
32
|
+
| Security | IAM, KMS, Secrets Manager, WAF |
|
|
33
|
+
| Monitoring | CloudWatch, X-Ray, CloudTrail |
|
|
34
|
+
|
|
35
|
+
## IAM Best Practices
|
|
36
|
+
|
|
37
|
+
### IAM Policy Structure
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"Version": "2012-10-17",
|
|
42
|
+
"Statement": [
|
|
43
|
+
{
|
|
44
|
+
"Sid": "AllowS3ReadAccess",
|
|
45
|
+
"Effect": "Allow",
|
|
46
|
+
"Action": [
|
|
47
|
+
"s3:GetObject",
|
|
48
|
+
"s3:ListBucket"
|
|
49
|
+
],
|
|
50
|
+
"Resource": [
|
|
51
|
+
"arn:aws:s3:::my-bucket",
|
|
52
|
+
"arn:aws:s3:::my-bucket/*"
|
|
53
|
+
],
|
|
54
|
+
"Condition": {
|
|
55
|
+
"StringEquals": {
|
|
56
|
+
"aws:RequestedRegion": "us-east-1"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Role for EC2
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"Version": "2012-10-17",
|
|
69
|
+
"Statement": [
|
|
70
|
+
{
|
|
71
|
+
"Effect": "Allow",
|
|
72
|
+
"Principal": {
|
|
73
|
+
"Service": "ec2.amazonaws.com"
|
|
74
|
+
},
|
|
75
|
+
"Action": "sts:AssumeRole"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Role for Lambda
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"Version": "2012-10-17",
|
|
86
|
+
"Statement": [
|
|
87
|
+
{
|
|
88
|
+
"Effect": "Allow",
|
|
89
|
+
"Principal": {
|
|
90
|
+
"Service": "lambda.amazonaws.com"
|
|
91
|
+
},
|
|
92
|
+
"Action": "sts:AssumeRole"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Lambda Functions
|
|
99
|
+
|
|
100
|
+
### Basic Lambda (Node.js)
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
// index.mjs
|
|
104
|
+
export const handler = async (event, context) => {
|
|
105
|
+
console.log('Event:', JSON.stringify(event, null, 2));
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const result = await processEvent(event);
|
|
109
|
+
return {
|
|
110
|
+
statusCode: 200,
|
|
111
|
+
headers: { 'Content-Type': 'application/json' },
|
|
112
|
+
body: JSON.stringify({ data: result })
|
|
113
|
+
};
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error('Error:', error);
|
|
116
|
+
return {
|
|
117
|
+
statusCode: 500,
|
|
118
|
+
body: JSON.stringify({ error: 'Internal Server Error' })
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Lambda with API Gateway
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
# SAM template
|
|
128
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
|
129
|
+
Transform: AWS::Serverless-2016-10-31
|
|
130
|
+
|
|
131
|
+
Resources:
|
|
132
|
+
MyFunction:
|
|
133
|
+
Type: AWS::Serverless::Function
|
|
134
|
+
Properties:
|
|
135
|
+
Runtime: nodejs20.x
|
|
136
|
+
Handler: index.handler
|
|
137
|
+
CodeUri: ./src
|
|
138
|
+
MemorySize: 256
|
|
139
|
+
Timeout: 30
|
|
140
|
+
Environment:
|
|
141
|
+
Variables:
|
|
142
|
+
TABLE_NAME: !Ref MyTable
|
|
143
|
+
Policies:
|
|
144
|
+
- DynamoDBCrudPolicy:
|
|
145
|
+
TableName: !Ref MyTable
|
|
146
|
+
Events:
|
|
147
|
+
Api:
|
|
148
|
+
Type: Api
|
|
149
|
+
Properties:
|
|
150
|
+
Path: /items
|
|
151
|
+
Method: GET
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## ECS/Fargate
|
|
155
|
+
|
|
156
|
+
### Task Definition
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"family": "my-app",
|
|
161
|
+
"networkMode": "awsvpc",
|
|
162
|
+
"requiresCompatibilities": ["FARGATE"],
|
|
163
|
+
"cpu": "256",
|
|
164
|
+
"memory": "512",
|
|
165
|
+
"executionRoleArn": "arn:aws:iam::123456789:role/ecsTaskExecutionRole",
|
|
166
|
+
"taskRoleArn": "arn:aws:iam::123456789:role/ecsTaskRole",
|
|
167
|
+
"containerDefinitions": [
|
|
168
|
+
{
|
|
169
|
+
"name": "app",
|
|
170
|
+
"image": "123456789.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
|
|
171
|
+
"portMappings": [
|
|
172
|
+
{
|
|
173
|
+
"containerPort": 3000,
|
|
174
|
+
"protocol": "tcp"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"environment": [
|
|
178
|
+
{
|
|
179
|
+
"name": "NODE_ENV",
|
|
180
|
+
"value": "production"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"secrets": [
|
|
184
|
+
{
|
|
185
|
+
"name": "DATABASE_URL",
|
|
186
|
+
"valueFrom": "arn:aws:secretsmanager:us-east-1:123456789:secret:db-url"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"logConfiguration": {
|
|
190
|
+
"logDriver": "awslogs",
|
|
191
|
+
"options": {
|
|
192
|
+
"awslogs-group": "/ecs/my-app",
|
|
193
|
+
"awslogs-region": "us-east-1",
|
|
194
|
+
"awslogs-stream-prefix": "ecs"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"healthCheck": {
|
|
198
|
+
"command": ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"],
|
|
199
|
+
"interval": 30,
|
|
200
|
+
"timeout": 5,
|
|
201
|
+
"retries": 3
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## S3 Operations
|
|
209
|
+
|
|
210
|
+
### AWS CLI
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# Sync files
|
|
214
|
+
aws s3 sync ./dist s3://my-bucket/
|
|
215
|
+
aws s3 sync s3://my-bucket ./local --delete
|
|
216
|
+
|
|
217
|
+
# Copy with metadata
|
|
218
|
+
aws s3 cp file.txt s3://my-bucket/ \
|
|
219
|
+
--content-type "text/plain" \
|
|
220
|
+
--cache-control "max-age=31536000"
|
|
221
|
+
|
|
222
|
+
# Presigned URL
|
|
223
|
+
aws s3 presign s3://my-bucket/file.txt --expires-in 3600
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### S3 SDK (Node.js)
|
|
227
|
+
|
|
228
|
+
```javascript
|
|
229
|
+
import { S3Client, PutObjectCommand, GetObjectCommand } from '@aws-sdk/client-s3';
|
|
230
|
+
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
231
|
+
|
|
232
|
+
const client = new S3Client({ region: 'us-east-1' });
|
|
233
|
+
|
|
234
|
+
// Upload
|
|
235
|
+
await client.send(new PutObjectCommand({
|
|
236
|
+
Bucket: 'my-bucket',
|
|
237
|
+
Key: 'path/to/file.json',
|
|
238
|
+
Body: JSON.stringify(data),
|
|
239
|
+
ContentType: 'application/json'
|
|
240
|
+
}));
|
|
241
|
+
|
|
242
|
+
// Presigned URL
|
|
243
|
+
const url = await getSignedUrl(client, new GetObjectCommand({
|
|
244
|
+
Bucket: 'my-bucket',
|
|
245
|
+
Key: 'path/to/file.pdf'
|
|
246
|
+
}), { expiresIn: 3600 });
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## RDS Best Practices
|
|
250
|
+
|
|
251
|
+
### Connection Pooling (Lambda)
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
import { RDSDataClient, ExecuteStatementCommand } from '@aws-sdk/client-rds-data';
|
|
255
|
+
|
|
256
|
+
// Use RDS Data API for serverless
|
|
257
|
+
const client = new RDSDataClient({ region: 'us-east-1' });
|
|
258
|
+
|
|
259
|
+
const result = await client.send(new ExecuteStatementCommand({
|
|
260
|
+
resourceArn: process.env.DB_CLUSTER_ARN,
|
|
261
|
+
secretArn: process.env.DB_SECRET_ARN,
|
|
262
|
+
database: 'mydb',
|
|
263
|
+
sql: 'SELECT * FROM users WHERE id = :id',
|
|
264
|
+
parameters: [{ name: 'id', value: { longValue: userId } }]
|
|
265
|
+
}));
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Connection String
|
|
269
|
+
|
|
270
|
+
```javascript
|
|
271
|
+
// Standard connection (for EC2/ECS)
|
|
272
|
+
const connectionString = `postgresql://${user}:${password}@${host}:5432/${database}?sslmode=require`;
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## CloudWatch
|
|
276
|
+
|
|
277
|
+
### Custom Metrics
|
|
278
|
+
|
|
279
|
+
```javascript
|
|
280
|
+
import { CloudWatchClient, PutMetricDataCommand } from '@aws-sdk/client-cloudwatch';
|
|
281
|
+
|
|
282
|
+
const client = new CloudWatchClient({ region: 'us-east-1' });
|
|
283
|
+
|
|
284
|
+
await client.send(new PutMetricDataCommand({
|
|
285
|
+
Namespace: 'MyApp',
|
|
286
|
+
MetricData: [{
|
|
287
|
+
MetricName: 'ProcessingTime',
|
|
288
|
+
Value: 150,
|
|
289
|
+
Unit: 'Milliseconds',
|
|
290
|
+
Dimensions: [{
|
|
291
|
+
Name: 'Environment',
|
|
292
|
+
Value: 'production'
|
|
293
|
+
}]
|
|
294
|
+
}]
|
|
295
|
+
}));
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Log Insights Query
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
fields @timestamp, @message
|
|
302
|
+
| filter @message like /ERROR/
|
|
303
|
+
| sort @timestamp desc
|
|
304
|
+
| limit 100
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Secrets Manager
|
|
308
|
+
|
|
309
|
+
```javascript
|
|
310
|
+
import { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk/client-secrets-manager';
|
|
311
|
+
|
|
312
|
+
const client = new SecretsManagerClient({ region: 'us-east-1' });
|
|
313
|
+
|
|
314
|
+
const response = await client.send(new GetSecretValueCommand({
|
|
315
|
+
SecretId: 'prod/db/credentials'
|
|
316
|
+
}));
|
|
317
|
+
|
|
318
|
+
const secret = JSON.parse(response.SecretString);
|
|
319
|
+
// { username: '...', password: '...' }
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## Common CLI Commands
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# EC2
|
|
326
|
+
aws ec2 describe-instances --filters "Name=tag:Environment,Values=production"
|
|
327
|
+
aws ec2 start-instances --instance-ids i-1234567890abcdef0
|
|
328
|
+
aws ec2 stop-instances --instance-ids i-1234567890abcdef0
|
|
329
|
+
|
|
330
|
+
# ECS
|
|
331
|
+
aws ecs list-clusters
|
|
332
|
+
aws ecs list-services --cluster my-cluster
|
|
333
|
+
aws ecs update-service --cluster my-cluster --service my-service --force-new-deployment
|
|
334
|
+
aws ecs describe-tasks --cluster my-cluster --tasks task-arn
|
|
335
|
+
|
|
336
|
+
# Lambda
|
|
337
|
+
aws lambda invoke --function-name my-function output.json
|
|
338
|
+
aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip
|
|
339
|
+
aws logs tail /aws/lambda/my-function --follow
|
|
340
|
+
|
|
341
|
+
# CloudWatch
|
|
342
|
+
aws logs get-log-events --log-group-name /ecs/my-app --log-stream-name ecs/app/xxx
|
|
343
|
+
aws cloudwatch get-metric-statistics \
|
|
344
|
+
--namespace AWS/EC2 \
|
|
345
|
+
--metric-name CPUUtilization \
|
|
346
|
+
--dimensions Name=InstanceId,Value=i-xxx \
|
|
347
|
+
--start-time 2024-01-01T00:00:00Z \
|
|
348
|
+
--end-time 2024-01-02T00:00:00Z \
|
|
349
|
+
--period 3600 \
|
|
350
|
+
--statistics Average
|
|
351
|
+
|
|
352
|
+
# SSM Parameter Store
|
|
353
|
+
aws ssm get-parameter --name /myapp/config --with-decryption
|
|
354
|
+
aws ssm put-parameter --name /myapp/config --value "value" --type SecureString
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## Security Best Practices
|
|
358
|
+
|
|
359
|
+
1. **Never hardcode credentials** - Use IAM roles, environment variables, or Secrets Manager
|
|
360
|
+
2. **Enable encryption** - S3 default encryption, RDS encryption, EBS encryption
|
|
361
|
+
3. **Use VPC endpoints** - Keep traffic within AWS network
|
|
362
|
+
4. **Enable CloudTrail** - Audit all API calls
|
|
363
|
+
5. **Least privilege** - Minimal IAM permissions
|
|
364
|
+
6. **Multi-AZ** - For production workloads
|
|
365
|
+
7. **Security groups** - Whitelist, don't blacklist
|
|
366
|
+
8. **WAF** - Protect public endpoints
|
|
367
|
+
|
|
368
|
+
## Cost Optimization
|
|
369
|
+
|
|
370
|
+
- **Right-size instances** - Use CloudWatch metrics to identify
|
|
371
|
+
- **Reserved Instances** - 1-3 year commitments for steady workloads
|
|
372
|
+
- **Spot Instances** - For fault-tolerant, flexible workloads
|
|
373
|
+
- **S3 lifecycle policies** - Move to Glacier for archival
|
|
374
|
+
- **Lambda** - Pay per invocation vs always-on EC2
|
|
375
|
+
- **Auto Scaling** - Scale down during off-hours
|
|
376
|
+
|
|
377
|
+
## References
|
|
378
|
+
|
|
379
|
+
- AWS Documentation: https://docs.aws.amazon.com/
|
|
380
|
+
- AWS CLI Reference: https://awscli.amazonaws.com/v2/documentation/api/latest/index.html
|
|
381
|
+
- AWS SDK for JavaScript: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/
|
|
382
|
+
- AWS Well-Architected: https://aws.amazon.com/architecture/well-architected/
|