@fenixforce/edition-pro 0.1.0
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/dist/api/approval-routes.d.ts +15 -0
- package/dist/api/fleet-routes.d.ts +23 -0
- package/dist/api/integration-routes.d.ts +17 -0
- package/dist/api/middleware.d.ts +37 -0
- package/dist/boot.d.ts +37 -0
- package/dist/business/approval-queue.d.ts +94 -0
- package/dist/business/arena.d.ts +71 -0
- package/dist/business/best-of-n.d.ts +68 -0
- package/dist/business/brainstorm.d.ts +42 -0
- package/dist/business/compile-checker.d.ts +50 -0
- package/dist/business/debate.d.ts +38 -0
- package/dist/business/fleet-budget.d.ts +69 -0
- package/dist/business/fleet-config.d.ts +125 -0
- package/dist/business/fleet.d.ts +85 -0
- package/dist/business/handoff.d.ts +56 -0
- package/dist/business/hat-system.d.ts +57 -0
- package/dist/business/index.d.ts +44 -0
- package/dist/business/integration-registry.d.ts +66 -0
- package/dist/business/node-pipeline.d.ts +62 -0
- package/dist/business/oracle.d.ts +64 -0
- package/dist/business/roles/index.d.ts +7 -0
- package/dist/business/roles/judge.d.ts +24 -0
- package/dist/business/roles/planner.d.ts +30 -0
- package/dist/business/roles/types.d.ts +37 -0
- package/dist/business/roles/worker.d.ts +25 -0
- package/dist/business/router.d.ts +75 -0
- package/dist/business/shared-memory.d.ts +85 -0
- package/dist/business/status-detector.d.ts +52 -0
- package/dist/business/swarm-registry.d.ts +63 -0
- package/dist/business/templates.d.ts +55 -0
- package/dist/business/workspace-manager.d.ts +105 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +638 -0
- package/dist/infrastructure/pty-agent.d.ts +74 -0
- package/dist/migrations/migrate.d.ts +7 -0
- package/dist/migrations/runner.d.ts +49 -0
- package/dist/workspace/worktree.d.ts +69 -0
- package/package.json +37 -0
- package/skills/builtin/academic-researcher/SKILL.md +51 -0
- package/skills/builtin/advanced-recon/SKILL.md +75 -0
- package/skills/builtin/agent-governance/SKILL.md +122 -0
- package/skills/builtin/algorithmic-art/SKILL.md +55 -0
- package/skills/builtin/api-attack-surface-mapper/SKILL.md +88 -0
- package/skills/builtin/api-development/SKILL.md +147 -0
- package/skills/builtin/api-exploit-prover/SKILL.md +74 -0
- package/skills/builtin/api-integration/SKILL.md +73 -0
- package/skills/builtin/api-security-tester/SKILL.md +82 -0
- package/skills/builtin/api-test-executor/SKILL.md +62 -0
- package/skills/builtin/app-store-optimization/SKILL.md +46 -0
- package/skills/builtin/audio-tour-guide/SKILL.md +18 -0
- package/skills/builtin/auth-flow-operator/SKILL.md +70 -0
- package/skills/builtin/autonomous-rag/SKILL.md +21 -0
- package/skills/builtin/backend-development/SKILL.md +265 -0
- package/skills/builtin/binary-analysis-analyst/SKILL.md +61 -0
- package/skills/builtin/binary-analysis-core/SKILL.md +65 -0
- package/skills/builtin/binary-recon/SKILL.md +64 -0
- package/skills/builtin/blackboard-coordination/SKILL.md +56 -0
- package/skills/builtin/blog-to-podcast/SKILL.md +18 -0
- package/skills/builtin/blog-writing/SKILL.md +36 -0
- package/skills/builtin/brainstorming/SKILL.md +69 -0
- package/skills/builtin/brand-design/SKILL.md +42 -0
- package/skills/builtin/ci-cd-pipelines/SKILL.md +210 -0
- package/skills/builtin/cloud-infrastructure/SKILL.md +140 -0
- package/skills/builtin/code-review/SKILL.md +88 -0
- package/skills/builtin/code-review-analyst/SKILL.md +96 -0
- package/skills/builtin/code-review-recon/SKILL.md +64 -0
- package/skills/builtin/code-review-verifier/SKILL.md +55 -0
- package/skills/builtin/coding-agent-team/SKILL.md +13 -0
- package/skills/builtin/competitor-intelligence/SKILL.md +39 -0
- package/skills/builtin/content-engine/SKILL.md +82 -0
- package/skills/builtin/context7-docs/SKILL.md +145 -0
- package/skills/builtin/copywriting/SKILL.md +38 -0
- package/skills/builtin/corrective-rag/SKILL.md +19 -0
- package/skills/builtin/cost-optimization/SKILL.md +131 -0
- package/skills/builtin/crypto-vulnerability-analyst/SKILL.md +64 -0
- package/skills/builtin/customer-support/SKILL.md +48 -0
- package/skills/builtin/customer-voice-support/SKILL.md +43 -0
- package/skills/builtin/data-analysis/SKILL.md +57 -0
- package/skills/builtin/data-visualization/SKILL.md +33 -0
- package/skills/builtin/database-design/SKILL.md +119 -0
- package/skills/builtin/decision-helper/SKILL.md +84 -0
- package/skills/builtin/deep-research/SKILL.md +68 -0
- package/skills/builtin/deepwiki-research/SKILL.md +115 -0
- package/skills/builtin/dependency-audit/SKILL.md +46 -0
- package/skills/builtin/doc-coauthoring/SKILL.md +48 -0
- package/skills/builtin/docker-deployment/SKILL.md +243 -0
- package/skills/builtin/docx-generation/SKILL.md +135 -0
- package/skills/builtin/dry-run-harness/SKILL.md +61 -0
- package/skills/builtin/editor/SKILL.md +44 -0
- package/skills/builtin/email-drafter/SKILL.md +42 -0
- package/skills/builtin/error-handling/SKILL.md +82 -0
- package/skills/builtin/eval-harness/SKILL.md +197 -0
- package/skills/builtin/evaluation-framework/SKILL.md +51 -0
- package/skills/builtin/exploit-writer/SKILL.md +63 -0
- package/skills/builtin/fact-checker/SKILL.md +51 -0
- package/skills/builtin/filesystem-context/SKILL.md +47 -0
- package/skills/builtin/financial-coach/SKILL.md +18 -0
- package/skills/builtin/finding-chain-correlator/SKILL.md +70 -0
- package/skills/builtin/finding-verifier/SKILL.md +65 -0
- package/skills/builtin/frontend-design/SKILL.md +104 -0
- package/skills/builtin/frontend-development/SKILL.md +227 -0
- package/skills/builtin/frontend-slides/SKILL.md +155 -0
- package/skills/builtin/fullstack-project/SKILL.md +286 -0
- package/skills/builtin/game-development/SKILL.md +60 -0
- package/skills/builtin/git-workflow/SKILL.md +44 -0
- package/skills/builtin/i18n-localization/SKILL.md +38 -0
- package/skills/builtin/image-prompt-engineering/SKILL.md +37 -0
- package/skills/builtin/investment-research/SKILL.md +33 -0
- package/skills/builtin/investor-materials/SKILL.md +90 -0
- package/skills/builtin/javascript-surface-analyzer/SKILL.md +66 -0
- package/skills/builtin/markdown-reports/SKILL.md +68 -0
- package/skills/builtin/market-research/SKILL.md +69 -0
- package/skills/builtin/mcp-builder/SKILL.md +86 -0
- package/skills/builtin/meeting-notes/SKILL.md +47 -0
- package/skills/builtin/memory-safety-analyst/SKILL.md +61 -0
- package/skills/builtin/meta-controller/SKILL.md +44 -0
- package/skills/builtin/mixture-of-agents/SKILL.md +53 -0
- package/skills/builtin/monitoring-observability/SKILL.md +169 -0
- package/skills/builtin/negotiation-simulator/SKILL.md +24 -0
- package/skills/builtin/nestjs-development/SKILL.md +56 -0
- package/skills/builtin/nextjs-development/SKILL.md +55 -0
- package/skills/builtin/parallel-dispatch/SKILL.md +83 -0
- package/skills/builtin/pdf-generation/SKILL.md +169 -0
- package/skills/builtin/personal-finance/SKILL.md +17 -0
- package/skills/builtin/pev-workflow/SKILL.md +62 -0
- package/skills/builtin/planning-with-files/SKILL.md +59 -0
- package/skills/builtin/pptx-generation/SKILL.md +117 -0
- package/skills/builtin/prisma-orm/SKILL.md +48 -0
- package/skills/builtin/rag-database-routing/SKILL.md +38 -0
- package/skills/builtin/rapid-prototyping/SKILL.md +152 -0
- package/skills/builtin/react-development/SKILL.md +244 -0
- package/skills/builtin/react-native-mobile/SKILL.md +113 -0
- package/skills/builtin/refactoring/SKILL.md +39 -0
- package/skills/builtin/reflexive-metacognition/SKILL.md +29 -0
- package/skills/builtin/riper-workflow/SKILL.md +214 -0
- package/skills/builtin/security-audit/SKILL.md +113 -0
- package/skills/builtin/security-self-audit/SKILL.md +311 -0
- package/skills/builtin/self-evolving-agent/SKILL.md +28 -0
- package/skills/builtin/self-improvement-loop/SKILL.md +58 -0
- package/skills/builtin/semantic-search/SKILL.md +93 -0
- package/skills/builtin/seo-audit-team/SKILL.md +27 -0
- package/skills/builtin/seo-optimization/SKILL.md +49 -0
- package/skills/builtin/server-management/SKILL.md +190 -0
- package/skills/builtin/social-media-content/SKILL.md +50 -0
- package/skills/builtin/sprint-planner/SKILL.md +49 -0
- package/skills/builtin/strategic-compact/SKILL.md +61 -0
- package/skills/builtin/strategy-advisor/SKILL.md +51 -0
- package/skills/builtin/structured-thinking/SKILL.md +70 -0
- package/skills/builtin/subagent-development/SKILL.md +105 -0
- package/skills/builtin/system-design/SKILL.md +66 -0
- package/skills/builtin/systematic-debugging/SKILL.md +87 -0
- package/skills/builtin/tailwind-css/SKILL.md +55 -0
- package/skills/builtin/taint-flow-tracer/SKILL.md +89 -0
- package/skills/builtin/teaching-agent-team/SKILL.md +32 -0
- package/skills/builtin/tech-debt-manager/SKILL.md +67 -0
- package/skills/builtin/technical-documentation/SKILL.md +47 -0
- package/skills/builtin/test-driven-development/SKILL.md +70 -0
- package/skills/builtin/theme-factory/SKILL.md +244 -0
- package/skills/builtin/threat-model-generator/SKILL.md +105 -0
- package/skills/builtin/trust-layer/SKILL.md +43 -0
- package/skills/builtin/typescript-patterns/SKILL.md +61 -0
- package/skills/builtin/ui-ux-design/SKILL.md +75 -0
- package/skills/builtin/verification-before-completion/SKILL.md +41 -0
- package/skills/builtin/verification-loop/SKILL.md +120 -0
- package/skills/builtin/waf-bypass-agent/SKILL.md +97 -0
- package/skills/builtin/web-artifacts-builder/SKILL.md +117 -0
- package/skills/builtin/web-assessment-executor/SKILL.md +66 -0
- package/skills/builtin/web-exploit-prover/SKILL.md +58 -0
- package/skills/builtin/web-scraping/SKILL.md +63 -0
- package/skills/builtin/webapp-testing/SKILL.md +86 -0
- package/skills/builtin/webhook-development/SKILL.md +62 -0
- package/skills/builtin/writing-skills/SKILL.md +67 -0
- package/skills/builtin/xlsx-generation/SKILL.md +116 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docker-deployment
|
|
3
|
+
description: "Use this skill when the user asks to containerize an application, write a Dockerfile, create Docker Compose services, optimize container images, or deploy using Docker. Triggers: 'Docker', 'Dockerfile', 'docker-compose', 'containerize', 'container', 'image', 'deploy with Docker', 'multi-stage build', or any request involving container-based deployment."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Docker Deployment
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Containerize applications for consistent deployment. Dockerfiles, Docker Compose, multi-stage builds, image optimization, health checks, and production container patterns.
|
|
12
|
+
|
|
13
|
+
## Before You Start
|
|
14
|
+
|
|
15
|
+
1. **Identify the runtime:** Bun, Node.js, Python, Go, etc.
|
|
16
|
+
2. **Identify dependencies:** Database, Redis, message queue, etc.
|
|
17
|
+
3. **Clarify environment:** Local development, staging, or production?
|
|
18
|
+
|
|
19
|
+
## Dockerfile Patterns
|
|
20
|
+
|
|
21
|
+
### Bun Application (Multi-Stage)
|
|
22
|
+
```dockerfile
|
|
23
|
+
FROM oven/bun:1 AS base
|
|
24
|
+
WORKDIR /app
|
|
25
|
+
|
|
26
|
+
# Install dependencies (cached layer)
|
|
27
|
+
FROM base AS deps
|
|
28
|
+
COPY package.json bun.lock* ./
|
|
29
|
+
RUN bun install --frozen-lockfile --production
|
|
30
|
+
|
|
31
|
+
# Build (if needed)
|
|
32
|
+
FROM base AS build
|
|
33
|
+
COPY package.json bun.lock* ./
|
|
34
|
+
RUN bun install --frozen-lockfile
|
|
35
|
+
COPY . .
|
|
36
|
+
RUN bun run build
|
|
37
|
+
|
|
38
|
+
# Production image
|
|
39
|
+
FROM base AS runtime
|
|
40
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
41
|
+
COPY --from=build /app/dist ./dist
|
|
42
|
+
COPY --from=build /app/package.json ./
|
|
43
|
+
|
|
44
|
+
USER bun
|
|
45
|
+
EXPOSE 3000
|
|
46
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \
|
|
47
|
+
CMD curl -f http://localhost:3000/health || exit 1
|
|
48
|
+
|
|
49
|
+
CMD ["bun", "run", "dist/index.js"]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Node.js Application (Multi-Stage)
|
|
53
|
+
```dockerfile
|
|
54
|
+
FROM node:20-alpine AS base
|
|
55
|
+
WORKDIR /app
|
|
56
|
+
|
|
57
|
+
FROM base AS deps
|
|
58
|
+
COPY package.json package-lock.json ./
|
|
59
|
+
RUN npm ci --only=production
|
|
60
|
+
|
|
61
|
+
FROM base AS build
|
|
62
|
+
COPY package.json package-lock.json ./
|
|
63
|
+
RUN npm ci
|
|
64
|
+
COPY . .
|
|
65
|
+
RUN npm run build
|
|
66
|
+
|
|
67
|
+
FROM base AS runtime
|
|
68
|
+
RUN addgroup --system --gid 1001 nodejs && \
|
|
69
|
+
adduser --system --uid 1001 appuser
|
|
70
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
71
|
+
COPY --from=build /app/dist ./dist
|
|
72
|
+
COPY --from=build /app/package.json ./
|
|
73
|
+
|
|
74
|
+
USER appuser
|
|
75
|
+
EXPOSE 3000
|
|
76
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \
|
|
77
|
+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
78
|
+
|
|
79
|
+
CMD ["node", "dist/index.js"]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### .dockerignore
|
|
83
|
+
```
|
|
84
|
+
node_modules
|
|
85
|
+
.git
|
|
86
|
+
.env
|
|
87
|
+
*.md
|
|
88
|
+
tests
|
|
89
|
+
.github
|
|
90
|
+
docker-compose*.yml
|
|
91
|
+
Dockerfile
|
|
92
|
+
.dockerignore
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Docker Compose
|
|
96
|
+
|
|
97
|
+
### Development Environment
|
|
98
|
+
```yaml
|
|
99
|
+
services:
|
|
100
|
+
app:
|
|
101
|
+
build:
|
|
102
|
+
context: .
|
|
103
|
+
target: build
|
|
104
|
+
ports:
|
|
105
|
+
- "3000:3000"
|
|
106
|
+
volumes:
|
|
107
|
+
- .:/app
|
|
108
|
+
- /app/node_modules
|
|
109
|
+
environment:
|
|
110
|
+
- NODE_ENV=development
|
|
111
|
+
- DATABASE_URL=postgresql://appuser:devpass@db:5432/appdb
|
|
112
|
+
depends_on:
|
|
113
|
+
db:
|
|
114
|
+
condition: service_healthy
|
|
115
|
+
|
|
116
|
+
db:
|
|
117
|
+
image: postgres:16-alpine
|
|
118
|
+
environment:
|
|
119
|
+
POSTGRES_DB: appdb
|
|
120
|
+
POSTGRES_USER: appuser
|
|
121
|
+
POSTGRES_PASSWORD: devpass
|
|
122
|
+
ports:
|
|
123
|
+
- "5432:5432"
|
|
124
|
+
volumes:
|
|
125
|
+
- pgdata:/var/lib/postgresql/data
|
|
126
|
+
healthcheck:
|
|
127
|
+
test: ["CMD-SHELL", "pg_isready -U appuser -d appdb"]
|
|
128
|
+
interval: 5s
|
|
129
|
+
timeout: 3s
|
|
130
|
+
retries: 5
|
|
131
|
+
|
|
132
|
+
redis:
|
|
133
|
+
image: redis:7-alpine
|
|
134
|
+
ports:
|
|
135
|
+
- "6379:6379"
|
|
136
|
+
healthcheck:
|
|
137
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
138
|
+
interval: 5s
|
|
139
|
+
timeout: 3s
|
|
140
|
+
|
|
141
|
+
volumes:
|
|
142
|
+
pgdata:
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Production Docker Compose
|
|
146
|
+
```yaml
|
|
147
|
+
services:
|
|
148
|
+
app:
|
|
149
|
+
build:
|
|
150
|
+
context: .
|
|
151
|
+
target: runtime
|
|
152
|
+
restart: unless-stopped
|
|
153
|
+
ports:
|
|
154
|
+
- "3000:3000"
|
|
155
|
+
environment:
|
|
156
|
+
- NODE_ENV=production
|
|
157
|
+
- DATABASE_URL=${DATABASE_URL}
|
|
158
|
+
depends_on:
|
|
159
|
+
db:
|
|
160
|
+
condition: service_healthy
|
|
161
|
+
deploy:
|
|
162
|
+
resources:
|
|
163
|
+
limits:
|
|
164
|
+
memory: 512M
|
|
165
|
+
cpus: "1.0"
|
|
166
|
+
|
|
167
|
+
db:
|
|
168
|
+
image: postgres:16-alpine
|
|
169
|
+
restart: unless-stopped
|
|
170
|
+
environment:
|
|
171
|
+
POSTGRES_DB: ${DB_NAME}
|
|
172
|
+
POSTGRES_USER: ${DB_USER}
|
|
173
|
+
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
174
|
+
volumes:
|
|
175
|
+
- pgdata:/var/lib/postgresql/data
|
|
176
|
+
healthcheck:
|
|
177
|
+
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
|
178
|
+
interval: 10s
|
|
179
|
+
timeout: 5s
|
|
180
|
+
retries: 5
|
|
181
|
+
deploy:
|
|
182
|
+
resources:
|
|
183
|
+
limits:
|
|
184
|
+
memory: 256M
|
|
185
|
+
|
|
186
|
+
volumes:
|
|
187
|
+
pgdata:
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Image Optimization
|
|
191
|
+
|
|
192
|
+
### Size Reduction Checklist
|
|
193
|
+
- Use Alpine base images (`node:20-alpine`, `python:3.12-alpine`)
|
|
194
|
+
- Multi-stage builds: build stage has dev tools, runtime stage has only production deps
|
|
195
|
+
- `.dockerignore` excludes tests, docs, git history
|
|
196
|
+
- Combine RUN commands to reduce layers
|
|
197
|
+
- Clean package manager cache in the same layer as install
|
|
198
|
+
|
|
199
|
+
### Layer Caching
|
|
200
|
+
Order instructions from least to most frequently changing:
|
|
201
|
+
```dockerfile
|
|
202
|
+
FROM node:20-alpine # 1. Base (rarely changes)
|
|
203
|
+
RUN apk add --no-cache curl # 2. System deps (rarely)
|
|
204
|
+
COPY package.json ./ # 3. Package files (on dep update)
|
|
205
|
+
RUN npm ci # 4. Install (on dep update)
|
|
206
|
+
COPY . . # 5. Source (every build)
|
|
207
|
+
RUN npm run build
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Security
|
|
211
|
+
|
|
212
|
+
- Never run as root in production (use `USER` directive)
|
|
213
|
+
- Never copy `.env` files into images
|
|
214
|
+
- Pin base image versions (`node:20.11-alpine` not `node:latest`)
|
|
215
|
+
- Scan images: `docker scout cves <image>`
|
|
216
|
+
- No secrets in build args or environment variables baked into the image
|
|
217
|
+
|
|
218
|
+
## Rules
|
|
219
|
+
|
|
220
|
+
- Every Dockerfile must have a HEALTHCHECK
|
|
221
|
+
- Every production image must run as non-root user
|
|
222
|
+
- Every docker-compose.yml must have health checks on databases
|
|
223
|
+
- Always use multi-stage builds for compiled languages and TypeScript
|
|
224
|
+
- Always include `.dockerignore`
|
|
225
|
+
- Never use `latest` tag for base images in production
|
|
226
|
+
- Environment variables for all configuration (12-factor app)
|
|
227
|
+
- Resource limits set on all production containers
|
|
228
|
+
|
|
229
|
+
## Verification
|
|
230
|
+
|
|
231
|
+
1. `docker build .` succeeds with no errors
|
|
232
|
+
2. `docker compose up` starts all services
|
|
233
|
+
3. Health checks pass within the configured start period
|
|
234
|
+
4. Application responds to requests through the exposed port
|
|
235
|
+
5. `docker images` shows the runtime image is under 200MB
|
|
236
|
+
6. Container runs as non-root user
|
|
237
|
+
|
|
238
|
+
## Integration with Other Skills
|
|
239
|
+
|
|
240
|
+
- **backend-development:** Containerize the server it produces
|
|
241
|
+
- **fullstack-project:** Docker Compose is part of project scaffolding
|
|
242
|
+
- **server-management:** Docker runs on the server this skill configures
|
|
243
|
+
- **ci-cd-pipelines:** Build and push images in CI
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docx-generation
|
|
3
|
+
description: "Use this skill when the user asks to create, edit, or manipulate Word documents (.docx files). Triggers: 'Word doc', 'word document', '.docx', 'report', 'memo', 'letter', 'template', or requests for professional documents with formatting like tables of contents, headings, page numbers, or letterheads."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# DOCX Generation
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Create and edit Word documents using the `docx` npm package (MIT, pure JavaScript, runs on Bun).
|
|
12
|
+
|
|
13
|
+
## Dependencies
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add docx
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Creation
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { Document, Packer, Paragraph, TextRun, HeadingLevel, Table, TableRow, TableCell, WidthType, AlignmentType, Header, Footer, PageNumber, NumberFormat, ImageRun, BorderStyle } from "docx";
|
|
23
|
+
import { writeFile, readFile } from "fs/promises";
|
|
24
|
+
|
|
25
|
+
// Create document
|
|
26
|
+
const doc = new Document({
|
|
27
|
+
sections: [{
|
|
28
|
+
properties: {
|
|
29
|
+
page: {
|
|
30
|
+
margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 }, // 1 inch = 1440 twips
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
headers: {
|
|
34
|
+
default: new Header({
|
|
35
|
+
children: [new Paragraph({ text: "Company Name", alignment: AlignmentType.RIGHT })],
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
footers: {
|
|
39
|
+
default: new Footer({
|
|
40
|
+
children: [new Paragraph({
|
|
41
|
+
children: [
|
|
42
|
+
new TextRun("Page "),
|
|
43
|
+
new TextRun({ children: [PageNumber.CURRENT] }),
|
|
44
|
+
new TextRun(" of "),
|
|
45
|
+
new TextRun({ children: [PageNumber.TOTAL_PAGES] }),
|
|
46
|
+
],
|
|
47
|
+
alignment: AlignmentType.CENTER,
|
|
48
|
+
})],
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
new Paragraph({ text: "Document Title", heading: HeadingLevel.HEADING_1 }),
|
|
53
|
+
new Paragraph({
|
|
54
|
+
children: [
|
|
55
|
+
new TextRun({ text: "Bold text", bold: true }),
|
|
56
|
+
new TextRun(" and normal text."),
|
|
57
|
+
],
|
|
58
|
+
}),
|
|
59
|
+
// Table
|
|
60
|
+
new Table({
|
|
61
|
+
rows: [
|
|
62
|
+
new TableRow({
|
|
63
|
+
children: [
|
|
64
|
+
new TableCell({ children: [new Paragraph("Header 1")], width: { size: 50, type: WidthType.PERCENTAGE } }),
|
|
65
|
+
new TableCell({ children: [new Paragraph("Header 2")], width: { size: 50, type: WidthType.PERCENTAGE } }),
|
|
66
|
+
],
|
|
67
|
+
}),
|
|
68
|
+
new TableRow({
|
|
69
|
+
children: [
|
|
70
|
+
new TableCell({ children: [new Paragraph("Cell 1")] }),
|
|
71
|
+
new TableCell({ children: [new Paragraph("Cell 2")] }),
|
|
72
|
+
],
|
|
73
|
+
}),
|
|
74
|
+
],
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
77
|
+
}],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Write to file
|
|
81
|
+
const buffer = await Packer.toBuffer(doc);
|
|
82
|
+
await writeFile("output.docx", buffer);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Reading .docx Content
|
|
86
|
+
|
|
87
|
+
Use the `mammoth` npm package to extract text from existing .docx files:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import mammoth from "mammoth";
|
|
91
|
+
|
|
92
|
+
const result = await mammoth.extractRawText({ path: "input.docx" });
|
|
93
|
+
const text = result.value; // Plain text content
|
|
94
|
+
|
|
95
|
+
// Or convert to HTML
|
|
96
|
+
const htmlResult = await mammoth.convertToHtml({ path: "input.docx" });
|
|
97
|
+
const html = htmlResult.value;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
bun add mammoth
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Editing Existing Documents
|
|
105
|
+
|
|
106
|
+
The `docx` package creates new documents. To modify existing .docx files, read content with mammoth, then generate a new document with modifications using docx. For find-and-replace operations, read the raw XML from the ZIP using `adm-zip`:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import AdmZip from "adm-zip";
|
|
110
|
+
|
|
111
|
+
const zip = new AdmZip("input.docx");
|
|
112
|
+
let content = zip.readAsText("word/document.xml");
|
|
113
|
+
content = content.replace(/OLD_TEXT/g, "NEW_TEXT");
|
|
114
|
+
zip.updateFile("word/document.xml", Buffer.from(content));
|
|
115
|
+
zip.writeZip("output.docx");
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
bun add adm-zip
|
|
120
|
+
bun add -d @types/adm-zip
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Key Elements
|
|
124
|
+
|
|
125
|
+
Headers, footers, page numbers, tables, bullet lists, numbered lists, images (via ImageRun with base64 data), hyperlinks, page breaks, sections with different orientations, bookmarks.
|
|
126
|
+
|
|
127
|
+
## Rules
|
|
128
|
+
|
|
129
|
+
- Use the `docx` npm package for creation (pure JS, Bun-compatible)
|
|
130
|
+
- Use `mammoth` for reading existing documents
|
|
131
|
+
- Use `adm-zip` for raw XML manipulation of existing .docx
|
|
132
|
+
- Include page numbers for documents over 3 pages
|
|
133
|
+
- Use consistent heading hierarchy (H1, H2, H3, no skipping)
|
|
134
|
+
- Test the output file opens without errors
|
|
135
|
+
- All packages are MIT licensed and run on Bun without Python.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Dry-Run Harness
|
|
2
|
+
|
|
3
|
+
## Pattern: Propose -> Review -> Execute
|
|
4
|
+
|
|
5
|
+
1. **Propose**: agent generates the action plan (what it would do, parameters, expected outcome)
|
|
6
|
+
2. **Review**: plan and logs surfaced to user. Side effects listed explicitly.
|
|
7
|
+
3. **Execute**: only after explicit user approval. If rejected, agent revises plan.
|
|
8
|
+
|
|
9
|
+
## When to Use
|
|
10
|
+
|
|
11
|
+
- Deploying to production
|
|
12
|
+
- Sending emails or messages
|
|
13
|
+
- Modifying databases
|
|
14
|
+
- Deleting files or resources
|
|
15
|
+
- Making API calls with side effects
|
|
16
|
+
- Any action that cannot be undone
|
|
17
|
+
|
|
18
|
+
## Dry-Run Output Format
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
## Proposed Action
|
|
22
|
+
**Action**: [what will happen]
|
|
23
|
+
**Parameters**: [inputs]
|
|
24
|
+
**Expected Outcome**: [what should result]
|
|
25
|
+
**Side Effects**: [what else changes]
|
|
26
|
+
**Reversible**: [yes/no, and how to reverse if yes]
|
|
27
|
+
|
|
28
|
+
## Approve? [waiting for user confirmation]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Incident-to-Eval Synthesis
|
|
32
|
+
|
|
33
|
+
Convert failing agent runs into regression eval cases:
|
|
34
|
+
|
|
35
|
+
### Capture
|
|
36
|
+
When an agent run fails (user rejection, runtime error, incorrect output):
|
|
37
|
+
1. Record the full action sequence (inputs, tool calls, outputs)
|
|
38
|
+
2. Record the failure point and failure reason
|
|
39
|
+
3. Record the user's correction or expected outcome
|
|
40
|
+
|
|
41
|
+
### Synthesize Eval Case
|
|
42
|
+
```markdown
|
|
43
|
+
## Eval: [auto-generated-id]
|
|
44
|
+
**Source**: incident on [date]
|
|
45
|
+
**Input**: [original user request]
|
|
46
|
+
**Expected behavior**: [what should have happened]
|
|
47
|
+
**Failure mode**: [what actually happened]
|
|
48
|
+
**Passing criteria**: [specific conditions for pass]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Integrate
|
|
52
|
+
- Eval cases stored in `__evals__/incidents/`
|
|
53
|
+
- Run as part of the dry-run test suite
|
|
54
|
+
- Each eval case tests that the same failure doesn't recur
|
|
55
|
+
- Review eval cases quarterly; retire those testing fixed bugs
|
|
56
|
+
|
|
57
|
+
## Rules
|
|
58
|
+
|
|
59
|
+
- Never execute side-effect actions without user approval in dry-run mode
|
|
60
|
+
- Always list ALL side effects, not just the primary action
|
|
61
|
+
- If the user rejects, ask what to change rather than re-proposing the same plan
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Editor
|
|
2
|
+
|
|
3
|
+
## Review Layers
|
|
4
|
+
|
|
5
|
+
1. **Correctness**: grammar, spelling, punctuation, factual accuracy
|
|
6
|
+
2. **Clarity**: ambiguous sentences, jargon without definition, logical flow
|
|
7
|
+
3. **Consistency**: tense, voice, terminology, formatting, capitalization
|
|
8
|
+
4. **Tone**: matches intended audience and purpose
|
|
9
|
+
5. **Structure**: logical flow, paragraph transitions, heading hierarchy
|
|
10
|
+
|
|
11
|
+
## Readability Checks
|
|
12
|
+
|
|
13
|
+
- Sentence length: average under 20 words
|
|
14
|
+
- Paragraph length: under 5 sentences
|
|
15
|
+
- Passive voice: under 15% of sentences
|
|
16
|
+
- Jargon: defined on first use or avoided for general audiences
|
|
17
|
+
|
|
18
|
+
## Output Format
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
## Summary
|
|
22
|
+
[Overall assessment: strengths, main issues]
|
|
23
|
+
|
|
24
|
+
## Critical Issues
|
|
25
|
+
- [Issue]: [specific location] → [suggested fix]
|
|
26
|
+
|
|
27
|
+
## Style Improvements
|
|
28
|
+
- [Suggestion]: [why it improves the text]
|
|
29
|
+
|
|
30
|
+
## Consistency Notes
|
|
31
|
+
- [Inconsistency found]: [recommendation]
|
|
32
|
+
|
|
33
|
+
## Readability Score
|
|
34
|
+
- Average sentence length: [N words]
|
|
35
|
+
- Passive voice: [N%]
|
|
36
|
+
- Jargon density: [low/medium/high]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Rules
|
|
40
|
+
|
|
41
|
+
- Preserve the author's voice while fixing issues
|
|
42
|
+
- Suggest, don't rewrite (unless asked to rewrite)
|
|
43
|
+
- Explain WHY a change improves the text
|
|
44
|
+
- Flag factual claims that seem wrong but don't correct without verification
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Email Drafter
|
|
2
|
+
|
|
3
|
+
## Structure
|
|
4
|
+
|
|
5
|
+
1. **Subject**: under 50 chars, specific, creates urgency or curiosity
|
|
6
|
+
2. **Opening**: one sentence establishing context or connection
|
|
7
|
+
3. **Body**: the ask or information, 2-3 short paragraphs max
|
|
8
|
+
4. **CTA**: single clear next step
|
|
9
|
+
5. **Close**: appropriate sign-off for the relationship
|
|
10
|
+
|
|
11
|
+
## Tone Calibration
|
|
12
|
+
|
|
13
|
+
- **Executive**: direct, data-driven, bottom-line-up-front
|
|
14
|
+
- **Colleague**: conversational, collaborative
|
|
15
|
+
- **Client**: professional, value-focused
|
|
16
|
+
- **Cold outreach**: personalized hook, brief, specific ask
|
|
17
|
+
- **Follow-up**: reference previous, add new value, don't just "checking in"
|
|
18
|
+
|
|
19
|
+
## Subject Line Guidelines
|
|
20
|
+
|
|
21
|
+
- Under 50 characters
|
|
22
|
+
- Specific over clever
|
|
23
|
+
- Include deadline or key detail when relevant
|
|
24
|
+
- Avoid all-caps, excessive punctuation, spam triggers
|
|
25
|
+
|
|
26
|
+
## Output Format
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
**Subject**: [subject line]
|
|
30
|
+
|
|
31
|
+
[Email body]
|
|
32
|
+
|
|
33
|
+
**Notes**: [tone rationale, alternatives considered]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Rules
|
|
37
|
+
|
|
38
|
+
- One CTA per email
|
|
39
|
+
- Subject lines: specific over clever
|
|
40
|
+
- Preview text (first ~90 chars) matters as much as subject
|
|
41
|
+
- Never "just checking in" without adding value
|
|
42
|
+
- Read it from the recipient's perspective before sending
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: error-handling
|
|
3
|
+
description: "Use this skill when implementing error handling patterns, designing error hierarchies, or working with Result/Option types. Triggers: 'error handling', 'try catch', 'Result type', 'error boundary', 'exception', 'error hierarchy', or requests to improve how code handles failures."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Error Handling Patterns
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Implement robust error handling. Typed error hierarchies, Result<T,E> patterns, error boundaries, and consistent error reporting.
|
|
12
|
+
|
|
13
|
+
## TypeScript Error Hierarchy
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
class AppError extends Error {
|
|
17
|
+
constructor(
|
|
18
|
+
public code: string,
|
|
19
|
+
message: string,
|
|
20
|
+
public statusCode: number = 500,
|
|
21
|
+
public details?: unknown
|
|
22
|
+
) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = "AppError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class ValidationError extends AppError {
|
|
29
|
+
constructor(message: string, details?: unknown) {
|
|
30
|
+
super("VALIDATION_ERROR", message, 422, details);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class NotFoundError extends AppError {
|
|
35
|
+
constructor(resource: string, id: string) {
|
|
36
|
+
super("NOT_FOUND", `${resource} '${id}' not found`, 404);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class UnauthorizedError extends AppError {
|
|
41
|
+
constructor(message = "Authentication required") {
|
|
42
|
+
super("UNAUTHORIZED", message, 401);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Result Pattern (no exceptions for expected failures)
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
type Result<T, E = Error> =
|
|
51
|
+
| { ok: true; value: T }
|
|
52
|
+
| { ok: false; error: E };
|
|
53
|
+
|
|
54
|
+
function ok<T>(value: T): Result<T, never> {
|
|
55
|
+
return { ok: true, value };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function err<E>(error: E): Result<never, E> {
|
|
59
|
+
return { ok: false, error };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Usage
|
|
63
|
+
function parseEmail(input: string): Result<string, string> {
|
|
64
|
+
if (!input.includes("@")) return err("Invalid email format");
|
|
65
|
+
return ok(input.toLowerCase().trim());
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const result = parseEmail(input);
|
|
69
|
+
if (!result.ok) {
|
|
70
|
+
return Response.json({ error: result.error }, { status: 422 });
|
|
71
|
+
}
|
|
72
|
+
const email = result.value;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Rules
|
|
76
|
+
|
|
77
|
+
- Use exceptions for unexpected failures (bugs, infrastructure)
|
|
78
|
+
- Use Result types for expected failures (validation, business rules)
|
|
79
|
+
- Never catch and swallow errors silently
|
|
80
|
+
- Log errors with full context (stack trace, request data, user ID)
|
|
81
|
+
- Never expose internal error details to users in production
|
|
82
|
+
- Every catch block must either handle the error or re-throw with context
|