@plazmodium/odin 0.3.3-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 +16 -10
- 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,435 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-actions
|
|
3
|
+
description: GitHub Actions CI/CD expertise for automating workflows, testing, building, and deploying applications. Covers workflow syntax, reusable workflows, matrix builds, and deployment patterns.
|
|
4
|
+
category: devops
|
|
5
|
+
compatible_with:
|
|
6
|
+
- docker
|
|
7
|
+
- aws
|
|
8
|
+
- jest
|
|
9
|
+
- playwright
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# GitHub Actions CI/CD
|
|
13
|
+
|
|
14
|
+
## Instructions
|
|
15
|
+
|
|
16
|
+
1. **Assess the workflow need**: CI (test/lint), CD (deploy), or automation.
|
|
17
|
+
2. **Follow GitHub Actions best practices**:
|
|
18
|
+
- Use specific action versions
|
|
19
|
+
- Cache dependencies
|
|
20
|
+
- Use secrets for sensitive data
|
|
21
|
+
- Minimize workflow run time
|
|
22
|
+
3. **Provide complete workflows**: Include all necessary steps and configuration.
|
|
23
|
+
4. **Guide on security**: Secrets management, OIDC, least privilege.
|
|
24
|
+
|
|
25
|
+
## Workflow Structure
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
# .github/workflows/ci.yml
|
|
29
|
+
name: CI
|
|
30
|
+
|
|
31
|
+
on:
|
|
32
|
+
push:
|
|
33
|
+
branches: [main, develop]
|
|
34
|
+
pull_request:
|
|
35
|
+
branches: [main]
|
|
36
|
+
|
|
37
|
+
env:
|
|
38
|
+
NODE_VERSION: '20'
|
|
39
|
+
|
|
40
|
+
jobs:
|
|
41
|
+
test:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Setup Node.js
|
|
47
|
+
uses: actions/setup-node@v4
|
|
48
|
+
with:
|
|
49
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
50
|
+
cache: 'npm'
|
|
51
|
+
|
|
52
|
+
- name: Install dependencies
|
|
53
|
+
run: npm ci
|
|
54
|
+
|
|
55
|
+
- name: Run tests
|
|
56
|
+
run: npm test
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Common Triggers
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
on:
|
|
63
|
+
# Push to branches
|
|
64
|
+
push:
|
|
65
|
+
branches: [main, develop]
|
|
66
|
+
paths:
|
|
67
|
+
- 'src/**'
|
|
68
|
+
- 'package.json'
|
|
69
|
+
paths-ignore:
|
|
70
|
+
- '**.md'
|
|
71
|
+
- 'docs/**'
|
|
72
|
+
|
|
73
|
+
# Pull requests
|
|
74
|
+
pull_request:
|
|
75
|
+
branches: [main]
|
|
76
|
+
types: [opened, synchronize, reopened]
|
|
77
|
+
|
|
78
|
+
# Manual trigger
|
|
79
|
+
workflow_dispatch:
|
|
80
|
+
inputs:
|
|
81
|
+
environment:
|
|
82
|
+
description: 'Deployment environment'
|
|
83
|
+
required: true
|
|
84
|
+
default: 'staging'
|
|
85
|
+
type: choice
|
|
86
|
+
options:
|
|
87
|
+
- staging
|
|
88
|
+
- production
|
|
89
|
+
|
|
90
|
+
# Scheduled
|
|
91
|
+
schedule:
|
|
92
|
+
- cron: '0 2 * * *' # 2 AM UTC daily
|
|
93
|
+
|
|
94
|
+
# On release
|
|
95
|
+
release:
|
|
96
|
+
types: [published]
|
|
97
|
+
|
|
98
|
+
# Called by other workflows
|
|
99
|
+
workflow_call:
|
|
100
|
+
inputs:
|
|
101
|
+
environment:
|
|
102
|
+
required: true
|
|
103
|
+
type: string
|
|
104
|
+
secrets:
|
|
105
|
+
deploy_key:
|
|
106
|
+
required: true
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Caching
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
# Node.js with npm
|
|
113
|
+
- uses: actions/setup-node@v4
|
|
114
|
+
with:
|
|
115
|
+
node-version: '20'
|
|
116
|
+
cache: 'npm'
|
|
117
|
+
|
|
118
|
+
# Custom cache
|
|
119
|
+
- uses: actions/cache@v4
|
|
120
|
+
with:
|
|
121
|
+
path: |
|
|
122
|
+
~/.npm
|
|
123
|
+
node_modules
|
|
124
|
+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
125
|
+
restore-keys: |
|
|
126
|
+
${{ runner.os }}-node-
|
|
127
|
+
|
|
128
|
+
# Rust
|
|
129
|
+
- uses: Swatinem/rust-cache@v2
|
|
130
|
+
|
|
131
|
+
# Go
|
|
132
|
+
- uses: actions/cache@v4
|
|
133
|
+
with:
|
|
134
|
+
path: |
|
|
135
|
+
~/go/pkg/mod
|
|
136
|
+
~/.cache/go-build
|
|
137
|
+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Matrix Builds
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
jobs:
|
|
144
|
+
test:
|
|
145
|
+
runs-on: ${{ matrix.os }}
|
|
146
|
+
strategy:
|
|
147
|
+
fail-fast: false
|
|
148
|
+
matrix:
|
|
149
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
150
|
+
node: [18, 20, 22]
|
|
151
|
+
exclude:
|
|
152
|
+
- os: windows-latest
|
|
153
|
+
node: 18
|
|
154
|
+
include:
|
|
155
|
+
- os: ubuntu-latest
|
|
156
|
+
node: 20
|
|
157
|
+
coverage: true
|
|
158
|
+
steps:
|
|
159
|
+
- uses: actions/checkout@v4
|
|
160
|
+
- uses: actions/setup-node@v4
|
|
161
|
+
with:
|
|
162
|
+
node-version: ${{ matrix.node }}
|
|
163
|
+
- run: npm ci
|
|
164
|
+
- run: npm test
|
|
165
|
+
- if: matrix.coverage
|
|
166
|
+
run: npm run coverage
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Secrets and Environment Variables
|
|
170
|
+
|
|
171
|
+
```yaml
|
|
172
|
+
jobs:
|
|
173
|
+
deploy:
|
|
174
|
+
runs-on: ubuntu-latest
|
|
175
|
+
environment: production # GitHub environment with secrets
|
|
176
|
+
env:
|
|
177
|
+
CI: true
|
|
178
|
+
steps:
|
|
179
|
+
- name: Deploy
|
|
180
|
+
env:
|
|
181
|
+
API_KEY: ${{ secrets.API_KEY }}
|
|
182
|
+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
183
|
+
run: |
|
|
184
|
+
echo "Deploying to production"
|
|
185
|
+
./deploy.sh
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Artifacts
|
|
189
|
+
|
|
190
|
+
```yaml
|
|
191
|
+
# Upload artifacts
|
|
192
|
+
- uses: actions/upload-artifact@v4
|
|
193
|
+
with:
|
|
194
|
+
name: build-output
|
|
195
|
+
path: dist/
|
|
196
|
+
retention-days: 5
|
|
197
|
+
|
|
198
|
+
# Download artifacts
|
|
199
|
+
- uses: actions/download-artifact@v4
|
|
200
|
+
with:
|
|
201
|
+
name: build-output
|
|
202
|
+
path: dist/
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Job Dependencies
|
|
206
|
+
|
|
207
|
+
```yaml
|
|
208
|
+
jobs:
|
|
209
|
+
build:
|
|
210
|
+
runs-on: ubuntu-latest
|
|
211
|
+
outputs:
|
|
212
|
+
version: ${{ steps.version.outputs.version }}
|
|
213
|
+
steps:
|
|
214
|
+
- id: version
|
|
215
|
+
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
|
|
216
|
+
|
|
217
|
+
test:
|
|
218
|
+
needs: build
|
|
219
|
+
runs-on: ubuntu-latest
|
|
220
|
+
steps:
|
|
221
|
+
- run: echo "Testing version ${{ needs.build.outputs.version }}"
|
|
222
|
+
|
|
223
|
+
deploy:
|
|
224
|
+
needs: [build, test]
|
|
225
|
+
if: github.ref == 'refs/heads/main'
|
|
226
|
+
runs-on: ubuntu-latest
|
|
227
|
+
steps:
|
|
228
|
+
- run: echo "Deploying"
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Reusable Workflows
|
|
232
|
+
|
|
233
|
+
```yaml
|
|
234
|
+
# .github/workflows/reusable-deploy.yml
|
|
235
|
+
name: Reusable Deploy
|
|
236
|
+
|
|
237
|
+
on:
|
|
238
|
+
workflow_call:
|
|
239
|
+
inputs:
|
|
240
|
+
environment:
|
|
241
|
+
required: true
|
|
242
|
+
type: string
|
|
243
|
+
image_tag:
|
|
244
|
+
required: true
|
|
245
|
+
type: string
|
|
246
|
+
secrets:
|
|
247
|
+
DEPLOY_KEY:
|
|
248
|
+
required: true
|
|
249
|
+
|
|
250
|
+
jobs:
|
|
251
|
+
deploy:
|
|
252
|
+
runs-on: ubuntu-latest
|
|
253
|
+
environment: ${{ inputs.environment }}
|
|
254
|
+
steps:
|
|
255
|
+
- name: Deploy
|
|
256
|
+
run: |
|
|
257
|
+
echo "Deploying ${{ inputs.image_tag }} to ${{ inputs.environment }}"
|
|
258
|
+
|
|
259
|
+
# Calling workflow
|
|
260
|
+
jobs:
|
|
261
|
+
call-deploy:
|
|
262
|
+
uses: ./.github/workflows/reusable-deploy.yml
|
|
263
|
+
with:
|
|
264
|
+
environment: staging
|
|
265
|
+
image_tag: v1.0.0
|
|
266
|
+
secrets:
|
|
267
|
+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Complete CI/CD Pipeline
|
|
271
|
+
|
|
272
|
+
```yaml
|
|
273
|
+
name: CI/CD
|
|
274
|
+
|
|
275
|
+
on:
|
|
276
|
+
push:
|
|
277
|
+
branches: [main]
|
|
278
|
+
pull_request:
|
|
279
|
+
branches: [main]
|
|
280
|
+
|
|
281
|
+
jobs:
|
|
282
|
+
lint:
|
|
283
|
+
runs-on: ubuntu-latest
|
|
284
|
+
steps:
|
|
285
|
+
- uses: actions/checkout@v4
|
|
286
|
+
- uses: actions/setup-node@v4
|
|
287
|
+
with:
|
|
288
|
+
node-version: '20'
|
|
289
|
+
cache: 'npm'
|
|
290
|
+
- run: npm ci
|
|
291
|
+
- run: npm run lint
|
|
292
|
+
|
|
293
|
+
test:
|
|
294
|
+
runs-on: ubuntu-latest
|
|
295
|
+
services:
|
|
296
|
+
postgres:
|
|
297
|
+
image: postgres:16
|
|
298
|
+
env:
|
|
299
|
+
POSTGRES_PASSWORD: postgres
|
|
300
|
+
options: >-
|
|
301
|
+
--health-cmd pg_isready
|
|
302
|
+
--health-interval 10s
|
|
303
|
+
--health-timeout 5s
|
|
304
|
+
--health-retries 5
|
|
305
|
+
ports:
|
|
306
|
+
- 5432:5432
|
|
307
|
+
steps:
|
|
308
|
+
- uses: actions/checkout@v4
|
|
309
|
+
- uses: actions/setup-node@v4
|
|
310
|
+
with:
|
|
311
|
+
node-version: '20'
|
|
312
|
+
cache: 'npm'
|
|
313
|
+
- run: npm ci
|
|
314
|
+
- run: npm test
|
|
315
|
+
env:
|
|
316
|
+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
|
|
317
|
+
|
|
318
|
+
build:
|
|
319
|
+
needs: [lint, test]
|
|
320
|
+
runs-on: ubuntu-latest
|
|
321
|
+
steps:
|
|
322
|
+
- uses: actions/checkout@v4
|
|
323
|
+
- uses: actions/setup-node@v4
|
|
324
|
+
with:
|
|
325
|
+
node-version: '20'
|
|
326
|
+
cache: 'npm'
|
|
327
|
+
- run: npm ci
|
|
328
|
+
- run: npm run build
|
|
329
|
+
- uses: actions/upload-artifact@v4
|
|
330
|
+
with:
|
|
331
|
+
name: build
|
|
332
|
+
path: dist/
|
|
333
|
+
|
|
334
|
+
deploy-staging:
|
|
335
|
+
needs: build
|
|
336
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
337
|
+
runs-on: ubuntu-latest
|
|
338
|
+
environment: staging
|
|
339
|
+
steps:
|
|
340
|
+
- uses: actions/download-artifact@v4
|
|
341
|
+
with:
|
|
342
|
+
name: build
|
|
343
|
+
path: dist/
|
|
344
|
+
- name: Deploy to staging
|
|
345
|
+
run: echo "Deploying to staging"
|
|
346
|
+
|
|
347
|
+
deploy-production:
|
|
348
|
+
needs: deploy-staging
|
|
349
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
350
|
+
runs-on: ubuntu-latest
|
|
351
|
+
environment: production
|
|
352
|
+
steps:
|
|
353
|
+
- uses: actions/download-artifact@v4
|
|
354
|
+
with:
|
|
355
|
+
name: build
|
|
356
|
+
path: dist/
|
|
357
|
+
- name: Deploy to production
|
|
358
|
+
run: echo "Deploying to production"
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Docker Build and Push
|
|
362
|
+
|
|
363
|
+
```yaml
|
|
364
|
+
jobs:
|
|
365
|
+
docker:
|
|
366
|
+
runs-on: ubuntu-latest
|
|
367
|
+
steps:
|
|
368
|
+
- uses: actions/checkout@v4
|
|
369
|
+
|
|
370
|
+
- name: Set up Docker Buildx
|
|
371
|
+
uses: docker/setup-buildx-action@v3
|
|
372
|
+
|
|
373
|
+
- name: Login to Registry
|
|
374
|
+
uses: docker/login-action@v3
|
|
375
|
+
with:
|
|
376
|
+
registry: ghcr.io
|
|
377
|
+
username: ${{ github.actor }}
|
|
378
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
379
|
+
|
|
380
|
+
- name: Build and push
|
|
381
|
+
uses: docker/build-push-action@v5
|
|
382
|
+
with:
|
|
383
|
+
context: .
|
|
384
|
+
push: true
|
|
385
|
+
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
|
|
386
|
+
cache-from: type=gha
|
|
387
|
+
cache-to: type=gha,mode=max
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## Conditional Execution
|
|
391
|
+
|
|
392
|
+
```yaml
|
|
393
|
+
steps:
|
|
394
|
+
- name: Only on main
|
|
395
|
+
if: github.ref == 'refs/heads/main'
|
|
396
|
+
run: echo "Main branch"
|
|
397
|
+
|
|
398
|
+
- name: Only on PR
|
|
399
|
+
if: github.event_name == 'pull_request'
|
|
400
|
+
run: echo "Pull request"
|
|
401
|
+
|
|
402
|
+
- name: Continue on error
|
|
403
|
+
continue-on-error: true
|
|
404
|
+
run: might-fail.sh
|
|
405
|
+
|
|
406
|
+
- name: Run if previous failed
|
|
407
|
+
if: failure()
|
|
408
|
+
run: echo "Previous step failed"
|
|
409
|
+
|
|
410
|
+
- name: Always run
|
|
411
|
+
if: always()
|
|
412
|
+
run: cleanup.sh
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Best Practices
|
|
416
|
+
|
|
417
|
+
- **Pin action versions** - Use `@v4` or commit SHA, not `@main`
|
|
418
|
+
- **Use caching** - Dramatically speeds up builds
|
|
419
|
+
- **Fail fast** - Use `fail-fast: false` only when needed
|
|
420
|
+
- **Use environments** - For deployment protection rules
|
|
421
|
+
- **Minimize secrets scope** - Only pass secrets where needed
|
|
422
|
+
- **Use OIDC** - For cloud provider authentication (AWS, GCP, Azure)
|
|
423
|
+
- **Concurrency control** - Cancel in-progress runs for same branch
|
|
424
|
+
|
|
425
|
+
```yaml
|
|
426
|
+
concurrency:
|
|
427
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
428
|
+
cancel-in-progress: true
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## References
|
|
432
|
+
|
|
433
|
+
- GitHub Actions Documentation: https://docs.github.com/en/actions
|
|
434
|
+
- Workflow Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
|
435
|
+
- Actions Marketplace: https://github.com/marketplace?type=actions
|