@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,265 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-development
|
|
3
|
+
description: "Use this skill when the user asks to build server-side logic, APIs, backend services, authentication, database integration, middleware, or any server-side application. Triggers: 'build an API', 'create a server', 'backend', 'endpoint', 'REST API', 'GraphQL', 'authentication', 'middleware', 'server-side', 'Node.js server', 'Express', 'Hono', 'Fastify', or any request involving server logic, data processing, or API design."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Backend Development
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Build production-quality server-side applications. APIs, authentication, middleware, database integration, background jobs, error handling. Framework-agnostic patterns with specific guidance for the Bun/TypeScript ecosystem.
|
|
12
|
+
|
|
13
|
+
## Before You Start
|
|
14
|
+
|
|
15
|
+
1. **Fetch current docs** via Context7 for whichever framework the user wants (Hono, Express, Fastify, etc.)
|
|
16
|
+
2. **Ask the user** about their runtime (Bun, Node.js, Deno), database, and auth requirements if not specified
|
|
17
|
+
3. Default to **Bun + Hono + TypeScript** for new projects (Fenix's native stack)
|
|
18
|
+
|
|
19
|
+
## Project Structure
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
project/
|
|
23
|
+
├── src/
|
|
24
|
+
│ ├── index.ts # Entry point, server setup
|
|
25
|
+
│ ├── routes/
|
|
26
|
+
│ │ ├── auth.ts # Auth routes
|
|
27
|
+
│ │ ├── users.ts # User CRUD
|
|
28
|
+
│ │ └── health.ts # Health check
|
|
29
|
+
│ ├── middleware/
|
|
30
|
+
│ │ ├── auth.ts # JWT/session validation
|
|
31
|
+
│ │ ├── cors.ts # CORS config
|
|
32
|
+
│ │ ├── rateLimit.ts # Rate limiting
|
|
33
|
+
│ │ └── errorHandler.ts # Global error handler
|
|
34
|
+
│ ├── services/ # Business logic (no HTTP awareness)
|
|
35
|
+
│ ├── db/
|
|
36
|
+
│ │ ├── client.ts # Database connection
|
|
37
|
+
│ │ ├── schema.ts # Schema definitions
|
|
38
|
+
│ │ └── migrations/ # SQL migrations
|
|
39
|
+
│ ├── types/ # Shared TypeScript types
|
|
40
|
+
│ └── utils/ # Helpers, validators
|
|
41
|
+
├── tests/
|
|
42
|
+
├── .env.example
|
|
43
|
+
├── package.json
|
|
44
|
+
├── tsconfig.json
|
|
45
|
+
└── README.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API Design
|
|
49
|
+
|
|
50
|
+
### RESTful Conventions
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
GET /api/v1/resources # List (with pagination)
|
|
54
|
+
GET /api/v1/resources/:id # Get one
|
|
55
|
+
POST /api/v1/resources # Create
|
|
56
|
+
PUT /api/v1/resources/:id # Full update
|
|
57
|
+
PATCH /api/v1/resources/:id # Partial update
|
|
58
|
+
DELETE /api/v1/resources/:id # Delete
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Response Format
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// Success
|
|
65
|
+
{ "data": {...}, "meta": { "page": 1, "total": 42 } }
|
|
66
|
+
|
|
67
|
+
// Error
|
|
68
|
+
{ "error": { "code": "VALIDATION_ERROR", "message": "Email is required", "details": [...] } }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Status Codes
|
|
72
|
+
- 200 OK, 201 Created, 204 No Content
|
|
73
|
+
- 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 422 Unprocessable Entity, 429 Too Many Requests
|
|
74
|
+
- 500 Internal Server Error
|
|
75
|
+
|
|
76
|
+
## Core Patterns
|
|
77
|
+
|
|
78
|
+
### Request Validation
|
|
79
|
+
|
|
80
|
+
Validate all input at the boundary. Never trust client data.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { z } from "zod";
|
|
84
|
+
|
|
85
|
+
const CreateUserSchema = z.object({
|
|
86
|
+
email: z.string().email(),
|
|
87
|
+
name: z.string().min(1).max(100),
|
|
88
|
+
role: z.enum(["user", "admin"]).default("user"),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// In route handler
|
|
92
|
+
const body = CreateUserSchema.safeParse(await req.json());
|
|
93
|
+
if (!body.success) {
|
|
94
|
+
return Response.json(
|
|
95
|
+
{ error: { code: "VALIDATION_ERROR", message: body.error.issues } },
|
|
96
|
+
{ status: 422 }
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Error Handling
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
class AppError extends Error {
|
|
105
|
+
constructor(
|
|
106
|
+
public statusCode: number,
|
|
107
|
+
public code: string,
|
|
108
|
+
message: string,
|
|
109
|
+
public details?: unknown
|
|
110
|
+
) {
|
|
111
|
+
super(message);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Global error handler middleware
|
|
116
|
+
function errorHandler(err: Error): Response {
|
|
117
|
+
if (err instanceof AppError) {
|
|
118
|
+
return Response.json(
|
|
119
|
+
{ error: { code: err.code, message: err.message, details: err.details } },
|
|
120
|
+
{ status: err.statusCode }
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
console.error("Unhandled error:", err);
|
|
124
|
+
return Response.json(
|
|
125
|
+
{ error: { code: "INTERNAL_ERROR", message: "Something went wrong" } },
|
|
126
|
+
{ status: 500 }
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Authentication (JWT)
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { sign, verify } from "jsonwebtoken";
|
|
135
|
+
|
|
136
|
+
function generateToken(userId: string): string {
|
|
137
|
+
return sign({ sub: userId }, process.env.JWT_SECRET!, { expiresIn: "24h" });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function authMiddleware(req: Request): { userId: string } {
|
|
141
|
+
const header = req.headers.get("authorization");
|
|
142
|
+
if (!header?.startsWith("Bearer ")) {
|
|
143
|
+
throw new AppError(401, "UNAUTHORIZED", "Missing bearer token");
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const payload = verify(header.slice(7), process.env.JWT_SECRET!);
|
|
147
|
+
return { userId: (payload as any).sub };
|
|
148
|
+
} catch {
|
|
149
|
+
throw new AppError(401, "UNAUTHORIZED", "Invalid or expired token");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Database Access
|
|
155
|
+
|
|
156
|
+
Separate database queries from route handlers. Services contain business logic. Routes handle HTTP.
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
// services/users.ts
|
|
160
|
+
export async function getUserById(db: DB, id: string) {
|
|
161
|
+
const user = await db.query("SELECT * FROM users WHERE id = $1", [id]);
|
|
162
|
+
if (!user.rows[0]) throw new AppError(404, "NOT_FOUND", "User not found");
|
|
163
|
+
return user.rows[0];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// routes/users.ts
|
|
167
|
+
app.get("/api/v1/users/:id", async (req) => {
|
|
168
|
+
const user = await getUserById(db, req.params.id);
|
|
169
|
+
return Response.json({ data: user });
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Rate Limiting
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
const rateLimits = new Map<string, { count: number; resetAt: number }>();
|
|
177
|
+
|
|
178
|
+
function rateLimit(limit: number, windowMs: number) {
|
|
179
|
+
return (req: Request): void => {
|
|
180
|
+
const key = req.headers.get("x-forwarded-for") || "unknown";
|
|
181
|
+
const now = Date.now();
|
|
182
|
+
const entry = rateLimits.get(key);
|
|
183
|
+
|
|
184
|
+
if (!entry || now > entry.resetAt) {
|
|
185
|
+
rateLimits.set(key, { count: 1, resetAt: now + windowMs });
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (entry.count >= limit) {
|
|
189
|
+
throw new AppError(429, "RATE_LIMITED", "Too many requests");
|
|
190
|
+
}
|
|
191
|
+
entry.count++;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Environment Variables
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
// Always validate env vars at startup
|
|
200
|
+
const requiredEnvVars = ["DATABASE_URL", "JWT_SECRET", "PORT"] as const;
|
|
201
|
+
|
|
202
|
+
for (const key of requiredEnvVars) {
|
|
203
|
+
if (!process.env[key]) {
|
|
204
|
+
console.error(`Missing required env var: ${key}`);
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Security Checklist
|
|
211
|
+
|
|
212
|
+
- All user input validated and sanitized
|
|
213
|
+
- SQL queries use parameterized statements (never string concatenation)
|
|
214
|
+
- Passwords hashed with bcrypt or argon2 (never stored plaintext)
|
|
215
|
+
- CORS configured with explicit allowed origins (never `*` in production)
|
|
216
|
+
- Rate limiting on all public endpoints
|
|
217
|
+
- Helmet-style security headers set
|
|
218
|
+
- Secrets loaded from environment variables, never committed to code
|
|
219
|
+
- HTTPS enforced in production
|
|
220
|
+
- Request body size limits configured
|
|
221
|
+
- No stack traces or internal details in production error responses
|
|
222
|
+
|
|
223
|
+
## Verification
|
|
224
|
+
|
|
225
|
+
Before marking complete:
|
|
226
|
+
1. Start the server and confirm it listens on the expected port
|
|
227
|
+
2. Test each endpoint with curl or a request tool
|
|
228
|
+
3. Test error cases (invalid input, missing auth, rate limits)
|
|
229
|
+
4. Confirm database queries use parameterized statements
|
|
230
|
+
5. Check that `.env.example` documents all required variables
|
|
231
|
+
6. Verify no secrets are hardcoded
|
|
232
|
+
|
|
233
|
+
## Integration with Other Skills
|
|
234
|
+
|
|
235
|
+
- **context7-docs:** ALWAYS fetch framework docs before generating route code
|
|
236
|
+
- **database-design:** Use that skill for schema design and migration strategy
|
|
237
|
+
- **api-development:** Use that skill for API design patterns and documentation
|
|
238
|
+
- **docker-deployment:** Use that skill to containerize the server
|
|
239
|
+
- **security-audit:** Run that skill before deploying to production
|
|
240
|
+
|
|
241
|
+
## Shell Lifecycle (Devin AI pattern)
|
|
242
|
+
|
|
243
|
+
Shell sessions: create -> use -> close. Never leave processes running. Clean up background processes, temp files, open connections when done.
|
|
244
|
+
|
|
245
|
+
Two modes:
|
|
246
|
+
- **Planning mode**: read files, search code, understand structure. No changes.
|
|
247
|
+
- **Standard mode**: write code, run tests, commit.
|
|
248
|
+
|
|
249
|
+
Announce mode switches explicitly.
|
|
250
|
+
|
|
251
|
+
## LSP-First Editing
|
|
252
|
+
|
|
253
|
+
Before modifying existing code:
|
|
254
|
+
1. Read the full file
|
|
255
|
+
2. Understand types and interfaces via go-to-definition
|
|
256
|
+
3. Check what depends on your changes via find-references
|
|
257
|
+
4. Make minimal targeted changes following existing patterns
|
|
258
|
+
|
|
259
|
+
Never rewrite working code just because you'd write it differently.
|
|
260
|
+
|
|
261
|
+
## Minimal Output (Claude Code 2.0 pattern)
|
|
262
|
+
|
|
263
|
+
Show the code, not descriptions of the code. Never explain changes unless asked.
|
|
264
|
+
|
|
265
|
+
Banned: "Here is the content...", "Based on the information...", "I'll now create...", "Let me explain..."
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Binary Analysis Analyst
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Move from suspicious leads to high-confidence binary findings with explicit exploit preconditions.
|
|
5
|
+
|
|
6
|
+
## Inputs
|
|
7
|
+
- `binary_path`
|
|
8
|
+
- `priority_targets`
|
|
9
|
+
- `runtime_context`
|
|
10
|
+
- `environment_constraints`
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
### Phase 1: Lead Refinement
|
|
14
|
+
1. Re-rank leads by attacker reachability.
|
|
15
|
+
2. Identify state and input prerequisites.
|
|
16
|
+
3. Remove dead or non-reachable leads.
|
|
17
|
+
|
|
18
|
+
### Phase 2: Deep Trace
|
|
19
|
+
1. Trace target function call chains.
|
|
20
|
+
2. Track tainted data into memory-sensitive operations.
|
|
21
|
+
3. Identify missing checks and bypassable guards.
|
|
22
|
+
|
|
23
|
+
### Phase 3: Primitive Confirmation
|
|
24
|
+
1. Build minimal trigger inputs.
|
|
25
|
+
2. Validate memory/register side effects.
|
|
26
|
+
3. Confirm repeatability across runs.
|
|
27
|
+
|
|
28
|
+
### Phase 4: Exploitability Modeling
|
|
29
|
+
1. Determine necessary control granularity.
|
|
30
|
+
2. Determine mitigation bypass requirements.
|
|
31
|
+
3. Determine privilege and environmental dependencies.
|
|
32
|
+
|
|
33
|
+
### Phase 5: Finding Finalization
|
|
34
|
+
1. Produce concise technical narrative.
|
|
35
|
+
2. State confidence and unresolved unknowns.
|
|
36
|
+
3. Recommend next exploit or remediation steps.
|
|
37
|
+
|
|
38
|
+
## Analyst Decision Rubric
|
|
39
|
+
- `high`: primitive validated and impact path plausible.
|
|
40
|
+
- `medium`: primitive likely but incomplete control proof.
|
|
41
|
+
- `low`: suspicious behavior with major unknowns.
|
|
42
|
+
|
|
43
|
+
## Output Contract
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"validated_findings": [],
|
|
47
|
+
"trace_summaries": [],
|
|
48
|
+
"exploitability_assessment": [],
|
|
49
|
+
"confidence": [],
|
|
50
|
+
"unknowns": []
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Constraints
|
|
55
|
+
- No impact claims without validated primitive.
|
|
56
|
+
- Unknowns must be explicit and bounded.
|
|
57
|
+
|
|
58
|
+
## Quality Checklist
|
|
59
|
+
- [ ] Reachability is demonstrated.
|
|
60
|
+
- [ ] Primitive is technically classified.
|
|
61
|
+
- [ ] Preconditions are concrete.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Binary Analysis Core
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Provide a disciplined baseline workflow for vulnerability-oriented binary analysis.
|
|
5
|
+
|
|
6
|
+
## Inputs
|
|
7
|
+
- `binary_path`
|
|
8
|
+
- `architecture`
|
|
9
|
+
- `runtime_environment`
|
|
10
|
+
- `recon_targets` (optional)
|
|
11
|
+
|
|
12
|
+
## Analysis Workflow
|
|
13
|
+
### Phase 1: Structural Analysis
|
|
14
|
+
1. Build call graph and function role map.
|
|
15
|
+
2. Identify parser paths and data transformations.
|
|
16
|
+
3. Locate boundary checks and memory operations.
|
|
17
|
+
|
|
18
|
+
### Phase 2: Primitive Hunting
|
|
19
|
+
1. Stack/heap overflow opportunities.
|
|
20
|
+
2. UAF/double-free and allocator misuse.
|
|
21
|
+
3. Integer arithmetic leading to memory mis-sizing.
|
|
22
|
+
4. Format string and command construction flaws.
|
|
23
|
+
|
|
24
|
+
### Phase 3: Control and Data Influence
|
|
25
|
+
1. Determine attacker control over size, offset, and content.
|
|
26
|
+
2. Determine repeatability and trigger reliability.
|
|
27
|
+
3. Determine crashability vs control-flow influence.
|
|
28
|
+
|
|
29
|
+
### Phase 4: Dynamic Validation
|
|
30
|
+
1. Instrument breakpoints around candidate primitives.
|
|
31
|
+
2. Validate assumptions under realistic input.
|
|
32
|
+
3. Capture traces that prove or refute exploit conditions.
|
|
33
|
+
|
|
34
|
+
### Phase 5: Prioritized Findings
|
|
35
|
+
1. Rank by exploitability and preconditions.
|
|
36
|
+
2. Note required bypasses for mitigations.
|
|
37
|
+
3. Prepare handoff for exploit development.
|
|
38
|
+
|
|
39
|
+
## Primitive Classification
|
|
40
|
+
| Class | Required Proof |
|
|
41
|
+
|---|---|
|
|
42
|
+
| overflow | controlled overwrite target and bounds failure |
|
|
43
|
+
| UAF | stale reference reuse with attacker influence |
|
|
44
|
+
| integer | arithmetic error drives dangerous memory behavior |
|
|
45
|
+
| format string | attacker-controlled format reaches formatter |
|
|
46
|
+
|
|
47
|
+
## Output Contract
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"analysis_scope": {},
|
|
51
|
+
"candidate_primitives": [],
|
|
52
|
+
"validated_primitives": [],
|
|
53
|
+
"mitigation_interactions": [],
|
|
54
|
+
"exploitability_ranking": []
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Constraints
|
|
59
|
+
- Distinguish speculation from validated behavior.
|
|
60
|
+
- Keep architecture assumptions explicit.
|
|
61
|
+
|
|
62
|
+
## Quality Checklist
|
|
63
|
+
- [ ] Candidate primitives include proof strategy.
|
|
64
|
+
- [ ] Dynamic checks support conclusions.
|
|
65
|
+
- [ ] Ranking reflects real attacker constraints.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Binary Recon
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Create a reliable initial profile that drives deeper vulnerability analysis.
|
|
5
|
+
|
|
6
|
+
## Inputs
|
|
7
|
+
- `binary_path`
|
|
8
|
+
- `target_platform`
|
|
9
|
+
- `runtime_assumptions` (optional)
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
### Phase 1: Metadata and Build Context
|
|
13
|
+
1. Determine architecture, endianness, and binary format.
|
|
14
|
+
2. Identify static vs dynamic linking and dependency footprint.
|
|
15
|
+
3. Record compiler and build artifacts when detectable.
|
|
16
|
+
|
|
17
|
+
### Phase 2: Hardening Profile
|
|
18
|
+
1. Check PIE, NX, RELRO, stack canary, Fortify.
|
|
19
|
+
2. Check symbol stripping and debug artifact presence.
|
|
20
|
+
3. Check obvious sandboxing or seccomp hints.
|
|
21
|
+
|
|
22
|
+
### Phase 3: Interface Discovery
|
|
23
|
+
1. Enumerate exported/imported functions.
|
|
24
|
+
2. Extract protocol and command strings.
|
|
25
|
+
3. Identify input channels: argv, env, file parsers, network listeners.
|
|
26
|
+
|
|
27
|
+
### Phase 4: Hotspot Prioritization
|
|
28
|
+
1. Parser-heavy code and format handlers.
|
|
29
|
+
2. Memory-manipulation and boundary logic.
|
|
30
|
+
3. Auth and crypto decision paths.
|
|
31
|
+
4. Dangerous call clusters.
|
|
32
|
+
|
|
33
|
+
### Phase 5: Recon Handoff
|
|
34
|
+
1. Build prioritized function list.
|
|
35
|
+
2. Add rationale for each priority target.
|
|
36
|
+
3. Define proof requirements for deep analysis.
|
|
37
|
+
|
|
38
|
+
## Recon Artifacts
|
|
39
|
+
| Artifact | Why It Matters |
|
|
40
|
+
|---|---|
|
|
41
|
+
| hardening matrix | exploitability baseline |
|
|
42
|
+
| symbol/function map | navigation and targeting |
|
|
43
|
+
| string corpus | protocol and feature hints |
|
|
44
|
+
| risky function clusters | likely vulnerability density |
|
|
45
|
+
|
|
46
|
+
## Output Contract
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"binary_profile": {},
|
|
50
|
+
"hardening_matrix": {},
|
|
51
|
+
"interface_map": [],
|
|
52
|
+
"priority_targets": [],
|
|
53
|
+
"deep_analysis_requirements": []
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Constraints
|
|
58
|
+
- Keep recon low-cost and repeatable.
|
|
59
|
+
- Do not produce exploit claims in recon.
|
|
60
|
+
|
|
61
|
+
## Quality Checklist
|
|
62
|
+
- [ ] Hardening profile is complete.
|
|
63
|
+
- [ ] Input channels are mapped.
|
|
64
|
+
- [ ] Priority targets are justified.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Blackboard Coordination
|
|
2
|
+
|
|
3
|
+
## Pattern
|
|
4
|
+
|
|
5
|
+
Multiple specialist agents collaborate via a shared state object (the blackboard):
|
|
6
|
+
1. Problem posted to blackboard with initial state
|
|
7
|
+
2. Controller examines blackboard, selects most relevant specialist
|
|
8
|
+
3. Specialist reads blackboard, contributes its analysis, writes results back
|
|
9
|
+
4. Controller re-examines, selects next specialist based on updated state
|
|
10
|
+
5. Repeat until solution complete or no specialist can contribute further
|
|
11
|
+
|
|
12
|
+
## Roles
|
|
13
|
+
|
|
14
|
+
- **Controller**: stateful planner that tracks what's been done and decides who goes next
|
|
15
|
+
- **Specialists**: domain experts that read state, contribute, and write back. Each has explicit domain boundaries.
|
|
16
|
+
|
|
17
|
+
## Blackboard State
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
interface Blackboard {
|
|
21
|
+
problem: string;
|
|
22
|
+
currentState: Record<string, unknown>;
|
|
23
|
+
contributions: Array<{
|
|
24
|
+
specialist: string;
|
|
25
|
+
timestamp: Date;
|
|
26
|
+
input: string;
|
|
27
|
+
output: string;
|
|
28
|
+
}>;
|
|
29
|
+
status: "in_progress" | "complete" | "stuck";
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Flow
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## Round 1
|
|
37
|
+
**Specialist**: [name]
|
|
38
|
+
**Read**: [what it read from blackboard]
|
|
39
|
+
**Contribution**: [what it added]
|
|
40
|
+
**State change**: [what changed]
|
|
41
|
+
|
|
42
|
+
## Round 2
|
|
43
|
+
**Specialist**: [name]
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
## Final State
|
|
47
|
+
**Status**: complete / stuck
|
|
48
|
+
**Solution**: [synthesized output]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Specialists only contribute within their domain
|
|
54
|
+
- Controller must be aware of all prior contributions before selecting next specialist
|
|
55
|
+
- Maximum 10 specialist rounds per problem (prevent infinite loops)
|
|
56
|
+
- If no specialist can contribute, status becomes "stuck" and escalate to user
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Blog to Podcast
|
|
2
|
+
## Pipeline
|
|
3
|
+
1. **Extract**: pull article content (from URL via web scraping or from provided text)
|
|
4
|
+
2. **Restructure**: rewrite for audio consumption (remove visual references, add spoken transitions, convert lists to natural language)
|
|
5
|
+
3. **Generate**: produce audio via TTS
|
|
6
|
+
|
|
7
|
+
## Restructuring Rules
|
|
8
|
+
- Replace "as shown below" with descriptions of what would be shown
|
|
9
|
+
- Convert bullet lists to flowing sentences
|
|
10
|
+
- Add verbal signposts: "First...", "Moving on to...", "The key takeaway here..."
|
|
11
|
+
- Remove parenthetical citations (mention sources naturally: "According to researchers at MIT...")
|
|
12
|
+
- Target length: 1 minute per 150 words
|
|
13
|
+
- Add intro hook and closing summary
|
|
14
|
+
|
|
15
|
+
## Rules
|
|
16
|
+
- Test the restructured text by reading it aloud (does it sound natural?)
|
|
17
|
+
- Maintain the original author's key points and conclusions
|
|
18
|
+
- Add context that visual readers would get from images/charts but listeners miss.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blog-writing
|
|
3
|
+
description: "Use this skill when the user asks to write blog posts, articles, SEO content, or editorial pieces. Triggers: 'blog post', 'article', 'write about', 'content for', 'editorial', 'thought leadership', or requests for published written content."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Blog Writing
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Write engaging, well-structured blog posts and articles. SEO awareness, clear structure, compelling hooks, scannable formatting.
|
|
12
|
+
|
|
13
|
+
## Structure
|
|
14
|
+
|
|
15
|
+
1. **Hook** (first 2 sentences): Start with a problem, question, surprising fact, or bold claim
|
|
16
|
+
2. **Context**: Why this matters to the reader
|
|
17
|
+
3. **Body**: 3-5 main sections with subheadings. Each section: claim → evidence → implication
|
|
18
|
+
4. **Conclusion**: Summary + call to action
|
|
19
|
+
|
|
20
|
+
## SEO Basics
|
|
21
|
+
|
|
22
|
+
- Primary keyword in title, first paragraph, and 2-3 subheadings
|
|
23
|
+
- Meta description: 150-160 characters, includes keyword, compels click
|
|
24
|
+
- Internal and external links where relevant
|
|
25
|
+
- Alt text for any images
|
|
26
|
+
- URL slug: short, hyphenated, includes keyword
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
- Write for humans first, search engines second
|
|
31
|
+
- Short paragraphs (2-4 sentences)
|
|
32
|
+
- Subheadings every 200-300 words for scannability
|
|
33
|
+
- Active voice over passive
|
|
34
|
+
- Specific examples over abstract claims
|
|
35
|
+
- End with clear next step for the reader
|
|
36
|
+
- Word count target: 800-1500 words unless specified otherwise.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: "Use this skill before any creative work: designing features, building components, choosing approaches, or solving open-ended problems. Triggers: 'brainstorm', 'ideas', 'what if', 'creative', 'design', 'how should we', 'what's the best way to', or any open-ended problem requiring exploration before commitment."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Brainstorming
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Explore options before committing to an approach. Diverge (generate many ideas), explore (evaluate top candidates), converge (select and plan), execute.
|
|
12
|
+
|
|
13
|
+
## The 4 Phases
|
|
14
|
+
|
|
15
|
+
### 1. DIVERGE (generate 7+ ideas)
|
|
16
|
+
No filtering. Quantity over quality. Wild ideas welcome. Write every idea down.
|
|
17
|
+
|
|
18
|
+
### 2. EXPLORE (evaluate top 3-5)
|
|
19
|
+
For each candidate: pros, cons, effort estimate, risk, alignment with constraints.
|
|
20
|
+
|
|
21
|
+
### 3. CONVERGE (score and select)
|
|
22
|
+
Score each candidate on: feasibility (1-5), impact (1-5), effort (1-5 inverse), risk (1-5 inverse). Pick the highest total.
|
|
23
|
+
|
|
24
|
+
### 4. EXECUTE (plan the selected approach)
|
|
25
|
+
Write the implementation plan using planning-with-files skill.
|
|
26
|
+
|
|
27
|
+
## Output Format
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
# Brainstorm: [Topic]
|
|
31
|
+
|
|
32
|
+
## Ideas (Diverge)
|
|
33
|
+
1. [idea]
|
|
34
|
+
2. [idea]
|
|
35
|
+
...7+
|
|
36
|
+
|
|
37
|
+
## Evaluation (Explore)
|
|
38
|
+
### Idea 3: [name]
|
|
39
|
+
- Pros: ...
|
|
40
|
+
- Cons: ...
|
|
41
|
+
- Effort: [S/M/L]
|
|
42
|
+
- Risk: [low/medium/high]
|
|
43
|
+
|
|
44
|
+
### Idea 5: [name]
|
|
45
|
+
...
|
|
46
|
+
|
|
47
|
+
## Decision (Converge)
|
|
48
|
+
Selected: Idea 3 because [rationale]
|
|
49
|
+
|
|
50
|
+
## Plan (Execute)
|
|
51
|
+
[hand off to planning-with-files]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Rules
|
|
55
|
+
|
|
56
|
+
- Never skip the diverge phase. 7 ideas minimum.
|
|
57
|
+
- Never commit to the first idea. Explore at least 3.
|
|
58
|
+
- Document WHY you selected the winning approach
|
|
59
|
+
- Save the brainstorm file (other ideas may become relevant later)
|
|
60
|
+
|
|
61
|
+
## Self-Improvement Loop (Generate -> Critique -> Revise)
|
|
62
|
+
|
|
63
|
+
After generating initial ideas or a draft:
|
|
64
|
+
1. **Generate**: produce the first version (Junior role)
|
|
65
|
+
2. **Critique**: evaluate against rubric with specific, actionable feedback (Senior role). Score each dimension 1-5 with reasoning BEFORE the score.
|
|
66
|
+
3. **Revise**: incorporate feedback into improved version
|
|
67
|
+
4. **Loop**: repeat until quality threshold met (score 4+ on all dimensions) or 3 iterations max
|
|
68
|
+
|
|
69
|
+
Store high-quality final outputs as examples for future brainstorming sessions.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brand-design
|
|
3
|
+
description: "Use this skill when the user asks about brand guidelines, color palettes, logo usage, brand voice, or brand consistency. Triggers: 'brand', 'branding', 'brand guidelines', 'color palette', 'brand voice', 'logo usage', 'brand identity', 'style guide', or requests for brand-related design decisions."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Brand Design
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Define and enforce brand identity. Color palettes, typography, voice guidelines, logo usage rules, and consistency standards.
|
|
12
|
+
|
|
13
|
+
## Brand Guidelines Template
|
|
14
|
+
|
|
15
|
+
### Colors
|
|
16
|
+
- Primary: Main brand color (used for CTAs, key elements)
|
|
17
|
+
- Secondary: Supporting color (used for accents, secondary actions)
|
|
18
|
+
- Neutral: Background, text, borders (2-3 shades)
|
|
19
|
+
- Semantic: Success (green), warning (amber), error (red), info (blue)
|
|
20
|
+
- Define each as: hex, RGB, HSL, with WCAG contrast ratios documented
|
|
21
|
+
|
|
22
|
+
### Typography
|
|
23
|
+
- Display font: headlines, hero text
|
|
24
|
+
- Body font: paragraphs, UI text
|
|
25
|
+
- Mono font: code, data
|
|
26
|
+
- Scale: define sizes for H1-H6, body, small, caption
|
|
27
|
+
|
|
28
|
+
### Voice
|
|
29
|
+
- 3-5 adjectives defining the brand personality
|
|
30
|
+
- "We say... / We don't say..." examples
|
|
31
|
+
- Tone shifts by context (marketing: energetic, support: empathetic, docs: precise)
|
|
32
|
+
|
|
33
|
+
### Logo Usage
|
|
34
|
+
- Minimum size, clear space, approved color variations
|
|
35
|
+
- Do's and don'ts with visual examples
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- Every brand decision must have a documented rationale
|
|
40
|
+
- Brand guidelines are living documents, updated quarterly
|
|
41
|
+
- Consistency beats creativity (a mediocre consistent brand beats a great inconsistent one)
|
|
42
|
+
- Test all color combinations for accessibility (WCAG AA minimum)
|