ateschh-kit 1.0.0 → 1.2.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/.claude/settings.local.json +4 -1
- package/CHANGELOG.md +15 -0
- package/CLAUDE.md +16 -16
- package/package.json +1 -2
- package/skills/build/SKILL.md +642 -0
- package/skills/cloudflare-workers-expert/SKILL.md +89 -0
- package/skills/docker-expert/SKILL.md +413 -0
- package/skills/electron-development/SKILL.md +856 -0
- package/skills/expo-api-routes/SKILL.md +368 -0
- package/skills/expo-deployment/SKILL.md +73 -0
- package/skills/fastapi-pro/SKILL.md +190 -0
- package/skills/flutter-expert/SKILL.md +197 -0
- package/skills/llm-app-patterns/SKILL.md +763 -0
- package/skills/nextjs-app-router-patterns/SKILL.md +36 -0
- package/skills/nextjs-best-practices/SKILL.md +208 -0
- package/skills/nodejs-backend-patterns/SKILL.md +38 -0
- package/skills/postgres-best-practices/SKILL.md +59 -0
- package/skills/prisma-expert/SKILL.md +361 -0
- package/skills/prompt-engineering/SKILL.md +177 -0
- package/skills/rag-implementation/SKILL.md +196 -0
- package/skills/react-best-practices/SKILL.md +127 -0
- package/skills/react-native-architecture/SKILL.md +36 -0
- package/skills/shadcn/SKILL.md +250 -0
- package/skills/supabase-automation/SKILL.md +240 -0
- package/skills/tailwind-design-system/SKILL.md +36 -0
- package/skills/typescript-expert/SKILL.md +426 -0
- package/skills/vercel-deployment/SKILL.md +80 -0
- /package/{workflows → .claude/commands}/_TEMPLATE.md +0 -0
- /package/{workflows → .claude/commands}/brainstorm.md +0 -0
- /package/{workflows → .claude/commands}/build.md +0 -0
- /package/{workflows → .claude/commands}/deploy.md +0 -0
- /package/{workflows → .claude/commands}/design.md +0 -0
- /package/{workflows → .claude/commands}/finish.md +0 -0
- /package/{workflows → .claude/commands}/map-codebase.md +0 -0
- /package/{workflows → .claude/commands}/new-project.md +0 -0
- /package/{workflows → .claude/commands}/next.md +0 -0
- /package/{workflows → .claude/commands}/quick.md +0 -0
- /package/{workflows → .claude/commands}/requirements.md +0 -0
- /package/{workflows → .claude/commands}/resume.md +0 -0
- /package/{workflows → .claude/commands}/save.md +0 -0
- /package/{workflows → .claude/commands}/settings.md +0 -0
- /package/{workflows → .claude/commands}/status.md +0 -0
- /package/{workflows → .claude/commands}/test.md +0 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: expo-api-routes
|
|
3
|
+
description: Guidelines for creating API routes in Expo Router with EAS Hosting
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
license: MIT
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## When to Use API Routes
|
|
9
|
+
|
|
10
|
+
Use API routes when you need:
|
|
11
|
+
|
|
12
|
+
- **Server-side secrets** — API keys, database credentials, or tokens that must never reach the client
|
|
13
|
+
- **Database operations** — Direct database queries that shouldn't be exposed
|
|
14
|
+
- **Third-party API proxies** — Hide API keys when calling external services (OpenAI, Stripe, etc.)
|
|
15
|
+
- **Server-side validation** — Validate data before database writes
|
|
16
|
+
- **Webhook endpoints** — Receive callbacks from services like Stripe or GitHub
|
|
17
|
+
- **Rate limiting** — Control access at the server level
|
|
18
|
+
- **Heavy computation** — Offload processing that would be slow on mobile
|
|
19
|
+
|
|
20
|
+
## When NOT to Use API Routes
|
|
21
|
+
|
|
22
|
+
Avoid API routes when:
|
|
23
|
+
|
|
24
|
+
- **Data is already public** — Use direct fetch to public APIs instead
|
|
25
|
+
- **No secrets required** — Static data or client-safe operations
|
|
26
|
+
- **Real-time updates needed** — Use WebSockets or services like Supabase Realtime
|
|
27
|
+
- **Simple CRUD** — Consider Firebase, Supabase, or Convex for managed backends
|
|
28
|
+
- **File uploads** — Use direct-to-storage uploads (S3 presigned URLs, Cloudflare R2)
|
|
29
|
+
- **Authentication only** — Use Clerk, Auth0, or Firebase Auth instead
|
|
30
|
+
|
|
31
|
+
## File Structure
|
|
32
|
+
|
|
33
|
+
API routes live in the `app` directory with `+api.ts` suffix:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
app/
|
|
37
|
+
api/
|
|
38
|
+
hello+api.ts → GET /api/hello
|
|
39
|
+
users+api.ts → /api/users
|
|
40
|
+
users/[id]+api.ts → /api/users/:id
|
|
41
|
+
(tabs)/
|
|
42
|
+
index.tsx
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Basic API Route
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
// app/api/hello+api.ts
|
|
49
|
+
export function GET(request: Request) {
|
|
50
|
+
return Response.json({ message: "Hello from Expo!" });
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## HTTP Methods
|
|
55
|
+
|
|
56
|
+
Export named functions for each HTTP method:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
// app/api/items+api.ts
|
|
60
|
+
export function GET(request: Request) {
|
|
61
|
+
return Response.json({ items: [] });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function POST(request: Request) {
|
|
65
|
+
const body = await request.json();
|
|
66
|
+
return Response.json({ created: body }, { status: 201 });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function PUT(request: Request) {
|
|
70
|
+
const body = await request.json();
|
|
71
|
+
return Response.json({ updated: body });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function DELETE(request: Request) {
|
|
75
|
+
return new Response(null, { status: 204 });
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Dynamic Routes
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
// app/api/users/[id]+api.ts
|
|
83
|
+
export function GET(request: Request, { id }: { id: string }) {
|
|
84
|
+
return Response.json({ userId: id });
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Request Handling
|
|
89
|
+
|
|
90
|
+
### Query Parameters
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
export function GET(request: Request) {
|
|
94
|
+
const url = new URL(request.url);
|
|
95
|
+
const page = url.searchParams.get("page") ?? "1";
|
|
96
|
+
const limit = url.searchParams.get("limit") ?? "10";
|
|
97
|
+
|
|
98
|
+
return Response.json({ page, limit });
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Headers
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
export function GET(request: Request) {
|
|
106
|
+
const auth = request.headers.get("Authorization");
|
|
107
|
+
|
|
108
|
+
if (!auth) {
|
|
109
|
+
return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return Response.json({ authenticated: true });
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### JSON Body
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
export async function POST(request: Request) {
|
|
120
|
+
const { email, password } = await request.json();
|
|
121
|
+
|
|
122
|
+
if (!email || !password) {
|
|
123
|
+
return Response.json({ error: "Missing fields" }, { status: 400 });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return Response.json({ success: true });
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Environment Variables
|
|
131
|
+
|
|
132
|
+
Use `process.env` for server-side secrets:
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
// app/api/ai+api.ts
|
|
136
|
+
export async function POST(request: Request) {
|
|
137
|
+
const { prompt } = await request.json();
|
|
138
|
+
|
|
139
|
+
const response = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
140
|
+
method: "POST",
|
|
141
|
+
headers: {
|
|
142
|
+
"Content-Type": "application/json",
|
|
143
|
+
Authorization: `Bearer ${process.env.OPENAI_API_KEY}`,
|
|
144
|
+
},
|
|
145
|
+
body: JSON.stringify({
|
|
146
|
+
model: "gpt-4",
|
|
147
|
+
messages: [{ role: "user", content: prompt }],
|
|
148
|
+
}),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const data = await response.json();
|
|
152
|
+
return Response.json(data);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Set environment variables:
|
|
157
|
+
|
|
158
|
+
- **Local**: Create `.env` file (never commit)
|
|
159
|
+
- **EAS Hosting**: Use `eas env:create` or Expo dashboard
|
|
160
|
+
|
|
161
|
+
## CORS Headers
|
|
162
|
+
|
|
163
|
+
Add CORS for web clients:
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
const corsHeaders = {
|
|
167
|
+
"Access-Control-Allow-Origin": "*",
|
|
168
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
|
169
|
+
"Access-Control-Allow-Headers": "Content-Type, Authorization",
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export function OPTIONS() {
|
|
173
|
+
return new Response(null, { headers: corsHeaders });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function GET() {
|
|
177
|
+
return Response.json({ data: "value" }, { headers: corsHeaders });
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Error Handling
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
export async function POST(request: Request) {
|
|
185
|
+
try {
|
|
186
|
+
const body = await request.json();
|
|
187
|
+
// Process...
|
|
188
|
+
return Response.json({ success: true });
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.error("API error:", error);
|
|
191
|
+
return Response.json({ error: "Internal server error" }, { status: 500 });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Testing Locally
|
|
197
|
+
|
|
198
|
+
Start the development server with API routes:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npx expo serve
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
This starts a local server at `http://localhost:8081` with full API route support.
|
|
205
|
+
|
|
206
|
+
Test with curl:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
curl http://localhost:8081/api/hello
|
|
210
|
+
curl -X POST http://localhost:8081/api/users -H "Content-Type: application/json" -d '{"name":"Test"}'
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Deployment to EAS Hosting
|
|
214
|
+
|
|
215
|
+
### Prerequisites
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npm install -g eas-cli
|
|
219
|
+
eas login
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Deploy
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
eas deploy
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
This builds and deploys your API routes to EAS Hosting (Cloudflare Workers).
|
|
229
|
+
|
|
230
|
+
### Environment Variables for Production
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Create a secret
|
|
234
|
+
eas env:create --name OPENAI_API_KEY --value sk-xxx --environment production
|
|
235
|
+
|
|
236
|
+
# Or use the Expo dashboard
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Custom Domain
|
|
240
|
+
|
|
241
|
+
Configure in `eas.json` or Expo dashboard.
|
|
242
|
+
|
|
243
|
+
## EAS Hosting Runtime (Cloudflare Workers)
|
|
244
|
+
|
|
245
|
+
API routes run on Cloudflare Workers. Key limitations:
|
|
246
|
+
|
|
247
|
+
### Missing/Limited APIs
|
|
248
|
+
|
|
249
|
+
- **No Node.js filesystem** — `fs` module unavailable
|
|
250
|
+
- **No native Node modules** — Use Web APIs or polyfills
|
|
251
|
+
- **Limited execution time** — 30 second timeout for CPU-intensive tasks
|
|
252
|
+
- **No persistent connections** — WebSockets require Durable Objects
|
|
253
|
+
- **fetch is available** — Use standard fetch for HTTP requests
|
|
254
|
+
|
|
255
|
+
### Use Web APIs Instead
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
// Use Web Crypto instead of Node crypto
|
|
259
|
+
const hash = await crypto.subtle.digest(
|
|
260
|
+
"SHA-256",
|
|
261
|
+
new TextEncoder().encode("data")
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
// Use fetch instead of node-fetch
|
|
265
|
+
const response = await fetch("https://api.example.com");
|
|
266
|
+
|
|
267
|
+
// Use Response/Request (already available)
|
|
268
|
+
return new Response(JSON.stringify(data), {
|
|
269
|
+
headers: { "Content-Type": "application/json" },
|
|
270
|
+
});
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Database Options
|
|
274
|
+
|
|
275
|
+
Since filesystem is unavailable, use cloud databases:
|
|
276
|
+
|
|
277
|
+
- **Cloudflare D1** — SQLite at the edge
|
|
278
|
+
- **Turso** — Distributed SQLite
|
|
279
|
+
- **PlanetScale** — Serverless MySQL
|
|
280
|
+
- **Supabase** — Postgres with REST API
|
|
281
|
+
- **Neon** — Serverless Postgres
|
|
282
|
+
|
|
283
|
+
Example with Turso:
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
// app/api/users+api.ts
|
|
287
|
+
import { createClient } from "@libsql/client/web";
|
|
288
|
+
|
|
289
|
+
const db = createClient({
|
|
290
|
+
url: process.env.TURSO_URL!,
|
|
291
|
+
authToken: process.env.TURSO_AUTH_TOKEN!,
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
export async function GET() {
|
|
295
|
+
const result = await db.execute("SELECT * FROM users");
|
|
296
|
+
return Response.json(result.rows);
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Calling API Routes from Client
|
|
301
|
+
|
|
302
|
+
```ts
|
|
303
|
+
// From React Native components
|
|
304
|
+
const response = await fetch("/api/hello");
|
|
305
|
+
const data = await response.json();
|
|
306
|
+
|
|
307
|
+
// With body
|
|
308
|
+
const response = await fetch("/api/users", {
|
|
309
|
+
method: "POST",
|
|
310
|
+
headers: { "Content-Type": "application/json" },
|
|
311
|
+
body: JSON.stringify({ name: "John" }),
|
|
312
|
+
});
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Common Patterns
|
|
316
|
+
|
|
317
|
+
### Authentication Middleware
|
|
318
|
+
|
|
319
|
+
```ts
|
|
320
|
+
// utils/auth.ts
|
|
321
|
+
export async function requireAuth(request: Request) {
|
|
322
|
+
const token = request.headers.get("Authorization")?.replace("Bearer ", "");
|
|
323
|
+
|
|
324
|
+
if (!token) {
|
|
325
|
+
throw new Response(JSON.stringify({ error: "Unauthorized" }), {
|
|
326
|
+
status: 401,
|
|
327
|
+
headers: { "Content-Type": "application/json" },
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Verify token...
|
|
332
|
+
return { userId: "123" };
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// app/api/protected+api.ts
|
|
336
|
+
import { requireAuth } from "../../utils/auth";
|
|
337
|
+
|
|
338
|
+
export async function GET(request: Request) {
|
|
339
|
+
const { userId } = await requireAuth(request);
|
|
340
|
+
return Response.json({ userId });
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Proxy External API
|
|
345
|
+
|
|
346
|
+
```ts
|
|
347
|
+
// app/api/weather+api.ts
|
|
348
|
+
export async function GET(request: Request) {
|
|
349
|
+
const url = new URL(request.url);
|
|
350
|
+
const city = url.searchParams.get("city");
|
|
351
|
+
|
|
352
|
+
const response = await fetch(
|
|
353
|
+
`https://api.weather.com/v1/current?city=${city}&key=${process.env.WEATHER_API_KEY}`
|
|
354
|
+
);
|
|
355
|
+
|
|
356
|
+
return Response.json(await response.json());
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## Rules
|
|
361
|
+
|
|
362
|
+
- NEVER expose API keys or secrets in client code
|
|
363
|
+
- ALWAYS validate and sanitize user input
|
|
364
|
+
- Use proper HTTP status codes (200, 201, 400, 401, 404, 500)
|
|
365
|
+
- Handle errors gracefully with try/catch
|
|
366
|
+
- Keep API routes focused — one responsibility per endpoint
|
|
367
|
+
- Use TypeScript for type safety
|
|
368
|
+
- Log errors server-side for debugging
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: expo-deployment
|
|
3
|
+
description: "Deploy Expo apps to production"
|
|
4
|
+
risk: safe
|
|
5
|
+
source: "https://github.com/expo/skills/tree/main/plugins/expo-deployment"
|
|
6
|
+
date_added: "2026-02-27"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Expo Deployment
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Deploy Expo applications to production environments, including app stores and over-the-air updates.
|
|
14
|
+
|
|
15
|
+
## When to Use This Skill
|
|
16
|
+
|
|
17
|
+
Use this skill when you need to deploy Expo apps to production.
|
|
18
|
+
|
|
19
|
+
Use this skill when:
|
|
20
|
+
- Deploying Expo apps to production
|
|
21
|
+
- Publishing to app stores (iOS App Store, Google Play)
|
|
22
|
+
- Setting up over-the-air (OTA) updates
|
|
23
|
+
- Configuring production build settings
|
|
24
|
+
- Managing release channels and versions
|
|
25
|
+
|
|
26
|
+
## Instructions
|
|
27
|
+
|
|
28
|
+
This skill provides guidance for deploying Expo apps:
|
|
29
|
+
|
|
30
|
+
1. **Build Configuration**: Set up production build settings
|
|
31
|
+
2. **App Store Submission**: Prepare and submit to app stores
|
|
32
|
+
3. **OTA Updates**: Configure over-the-air update channels
|
|
33
|
+
4. **Release Management**: Manage versions and release channels
|
|
34
|
+
5. **Production Optimization**: Optimize apps for production
|
|
35
|
+
|
|
36
|
+
## Deployment Workflow
|
|
37
|
+
|
|
38
|
+
### Pre-Deployment
|
|
39
|
+
|
|
40
|
+
1. Ensure all tests pass
|
|
41
|
+
2. Update version numbers
|
|
42
|
+
3. Configure production environment variables
|
|
43
|
+
4. Review and optimize app bundle size
|
|
44
|
+
5. Test production builds locally
|
|
45
|
+
|
|
46
|
+
### App Store Deployment
|
|
47
|
+
|
|
48
|
+
1. Build production binaries (iOS/Android)
|
|
49
|
+
2. Configure app store metadata
|
|
50
|
+
3. Submit to App Store Connect / Google Play Console
|
|
51
|
+
4. Manage app store listings and screenshots
|
|
52
|
+
5. Handle app review process
|
|
53
|
+
|
|
54
|
+
### OTA Updates
|
|
55
|
+
|
|
56
|
+
1. Configure update channels (production, staging, etc.)
|
|
57
|
+
2. Build and publish updates
|
|
58
|
+
3. Manage rollout strategies
|
|
59
|
+
4. Monitor update adoption
|
|
60
|
+
5. Handle rollbacks if needed
|
|
61
|
+
|
|
62
|
+
## Best Practices
|
|
63
|
+
|
|
64
|
+
- Use EAS Build for reliable production builds
|
|
65
|
+
- Test production builds before submission
|
|
66
|
+
- Implement proper error tracking and analytics
|
|
67
|
+
- Use release channels for staged rollouts
|
|
68
|
+
- Keep app store metadata up to date
|
|
69
|
+
- Monitor app performance in production
|
|
70
|
+
|
|
71
|
+
## Resources
|
|
72
|
+
|
|
73
|
+
For more information, see the [source repository](https://github.com/expo/skills/tree/main/plugins/expo-deployment).
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fastapi-pro
|
|
3
|
+
description: Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns.
|
|
4
|
+
risk: unknown
|
|
5
|
+
source: community
|
|
6
|
+
date_added: '2026-02-27'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Use this skill when
|
|
10
|
+
|
|
11
|
+
- Working on fastapi pro tasks or workflows
|
|
12
|
+
- Needing guidance, best practices, or checklists for fastapi pro
|
|
13
|
+
|
|
14
|
+
## Do not use this skill when
|
|
15
|
+
|
|
16
|
+
- The task is unrelated to fastapi pro
|
|
17
|
+
- You need a different domain or tool outside this scope
|
|
18
|
+
|
|
19
|
+
## Instructions
|
|
20
|
+
|
|
21
|
+
- Clarify goals, constraints, and required inputs.
|
|
22
|
+
- Apply relevant best practices and validate outcomes.
|
|
23
|
+
- Provide actionable steps and verification.
|
|
24
|
+
- If detailed examples are required, open `resources/implementation-playbook.md`.
|
|
25
|
+
|
|
26
|
+
You are a FastAPI expert specializing in high-performance, async-first API development with modern Python patterns.
|
|
27
|
+
|
|
28
|
+
## Purpose
|
|
29
|
+
|
|
30
|
+
Expert FastAPI developer specializing in high-performance, async-first API development. Masters modern Python web development with FastAPI, focusing on production-ready microservices, scalable architectures, and cutting-edge async patterns.
|
|
31
|
+
|
|
32
|
+
## Capabilities
|
|
33
|
+
|
|
34
|
+
### Core FastAPI Expertise
|
|
35
|
+
|
|
36
|
+
- FastAPI 0.100+ features including Annotated types and modern dependency injection
|
|
37
|
+
- Async/await patterns for high-concurrency applications
|
|
38
|
+
- Pydantic V2 for data validation and serialization
|
|
39
|
+
- Automatic OpenAPI/Swagger documentation generation
|
|
40
|
+
- WebSocket support for real-time communication
|
|
41
|
+
- Background tasks with BackgroundTasks and task queues
|
|
42
|
+
- File uploads and streaming responses
|
|
43
|
+
- Custom middleware and request/response interceptors
|
|
44
|
+
|
|
45
|
+
### Data Management & ORM
|
|
46
|
+
|
|
47
|
+
- SQLAlchemy 2.0+ with async support (asyncpg, aiomysql)
|
|
48
|
+
- Alembic for database migrations
|
|
49
|
+
- Repository pattern and unit of work implementations
|
|
50
|
+
- Database connection pooling and session management
|
|
51
|
+
- MongoDB integration with Motor and Beanie
|
|
52
|
+
- Redis for caching and session storage
|
|
53
|
+
- Query optimization and N+1 query prevention
|
|
54
|
+
- Transaction management and rollback strategies
|
|
55
|
+
|
|
56
|
+
### API Design & Architecture
|
|
57
|
+
|
|
58
|
+
- RESTful API design principles
|
|
59
|
+
- GraphQL integration with Strawberry or Graphene
|
|
60
|
+
- Microservices architecture patterns
|
|
61
|
+
- API versioning strategies
|
|
62
|
+
- Rate limiting and throttling
|
|
63
|
+
- Circuit breaker pattern implementation
|
|
64
|
+
- Event-driven architecture with message queues
|
|
65
|
+
- CQRS and Event Sourcing patterns
|
|
66
|
+
|
|
67
|
+
### Authentication & Security
|
|
68
|
+
|
|
69
|
+
- OAuth2 with JWT tokens (python-jose, pyjwt)
|
|
70
|
+
- Social authentication (Google, GitHub, etc.)
|
|
71
|
+
- API key authentication
|
|
72
|
+
- Role-based access control (RBAC)
|
|
73
|
+
- Permission-based authorization
|
|
74
|
+
- CORS configuration and security headers
|
|
75
|
+
- Input sanitization and SQL injection prevention
|
|
76
|
+
- Rate limiting per user/IP
|
|
77
|
+
|
|
78
|
+
### Testing & Quality Assurance
|
|
79
|
+
|
|
80
|
+
- pytest with pytest-asyncio for async tests
|
|
81
|
+
- TestClient for integration testing
|
|
82
|
+
- Factory pattern with factory_boy or Faker
|
|
83
|
+
- Mock external services with pytest-mock
|
|
84
|
+
- Coverage analysis with pytest-cov
|
|
85
|
+
- Performance testing with Locust
|
|
86
|
+
- Contract testing for microservices
|
|
87
|
+
- Snapshot testing for API responses
|
|
88
|
+
|
|
89
|
+
### Performance Optimization
|
|
90
|
+
|
|
91
|
+
- Async programming best practices
|
|
92
|
+
- Connection pooling (database, HTTP clients)
|
|
93
|
+
- Response caching with Redis or Memcached
|
|
94
|
+
- Query optimization and eager loading
|
|
95
|
+
- Pagination and cursor-based pagination
|
|
96
|
+
- Response compression (gzip, brotli)
|
|
97
|
+
- CDN integration for static assets
|
|
98
|
+
- Load balancing strategies
|
|
99
|
+
|
|
100
|
+
### Observability & Monitoring
|
|
101
|
+
|
|
102
|
+
- Structured logging with loguru or structlog
|
|
103
|
+
- OpenTelemetry integration for tracing
|
|
104
|
+
- Prometheus metrics export
|
|
105
|
+
- Health check endpoints
|
|
106
|
+
- APM integration (DataDog, New Relic, Sentry)
|
|
107
|
+
- Request ID tracking and correlation
|
|
108
|
+
- Performance profiling with py-spy
|
|
109
|
+
- Error tracking and alerting
|
|
110
|
+
|
|
111
|
+
### Deployment & DevOps
|
|
112
|
+
|
|
113
|
+
- Docker containerization with multi-stage builds
|
|
114
|
+
- Kubernetes deployment with Helm charts
|
|
115
|
+
- CI/CD pipelines (GitHub Actions, GitLab CI)
|
|
116
|
+
- Environment configuration with Pydantic Settings
|
|
117
|
+
- Uvicorn/Gunicorn configuration for production
|
|
118
|
+
- ASGI servers optimization (Hypercorn, Daphne)
|
|
119
|
+
- Blue-green and canary deployments
|
|
120
|
+
- Auto-scaling based on metrics
|
|
121
|
+
|
|
122
|
+
### Integration Patterns
|
|
123
|
+
|
|
124
|
+
- Message queues (RabbitMQ, Kafka, Redis Pub/Sub)
|
|
125
|
+
- Task queues with Celery or Dramatiq
|
|
126
|
+
- gRPC service integration
|
|
127
|
+
- External API integration with httpx
|
|
128
|
+
- Webhook implementation and processing
|
|
129
|
+
- Server-Sent Events (SSE)
|
|
130
|
+
- GraphQL subscriptions
|
|
131
|
+
- File storage (S3, MinIO, local)
|
|
132
|
+
|
|
133
|
+
### Advanced Features
|
|
134
|
+
|
|
135
|
+
- Dependency injection with advanced patterns
|
|
136
|
+
- Custom response classes
|
|
137
|
+
- Request validation with complex schemas
|
|
138
|
+
- Content negotiation
|
|
139
|
+
- API documentation customization
|
|
140
|
+
- Lifespan events for startup/shutdown
|
|
141
|
+
- Custom exception handlers
|
|
142
|
+
- Request context and state management
|
|
143
|
+
|
|
144
|
+
## Behavioral Traits
|
|
145
|
+
|
|
146
|
+
- Writes async-first code by default
|
|
147
|
+
- Emphasizes type safety with Pydantic and type hints
|
|
148
|
+
- Follows API design best practices
|
|
149
|
+
- Implements comprehensive error handling
|
|
150
|
+
- Uses dependency injection for clean architecture
|
|
151
|
+
- Writes testable and maintainable code
|
|
152
|
+
- Documents APIs thoroughly with OpenAPI
|
|
153
|
+
- Considers performance implications
|
|
154
|
+
- Implements proper logging and monitoring
|
|
155
|
+
- Follows 12-factor app principles
|
|
156
|
+
|
|
157
|
+
## Knowledge Base
|
|
158
|
+
|
|
159
|
+
- FastAPI official documentation
|
|
160
|
+
- Pydantic V2 migration guide
|
|
161
|
+
- SQLAlchemy 2.0 async patterns
|
|
162
|
+
- Python async/await best practices
|
|
163
|
+
- Microservices design patterns
|
|
164
|
+
- REST API design guidelines
|
|
165
|
+
- OAuth2 and JWT standards
|
|
166
|
+
- OpenAPI 3.1 specification
|
|
167
|
+
- Container orchestration with Kubernetes
|
|
168
|
+
- Modern Python packaging and tooling
|
|
169
|
+
|
|
170
|
+
## Response Approach
|
|
171
|
+
|
|
172
|
+
1. **Analyze requirements** for async opportunities
|
|
173
|
+
2. **Design API contracts** with Pydantic models first
|
|
174
|
+
3. **Implement endpoints** with proper error handling
|
|
175
|
+
4. **Add comprehensive validation** using Pydantic
|
|
176
|
+
5. **Write async tests** covering edge cases
|
|
177
|
+
6. **Optimize for performance** with caching and pooling
|
|
178
|
+
7. **Document with OpenAPI** annotations
|
|
179
|
+
8. **Consider deployment** and scaling strategies
|
|
180
|
+
|
|
181
|
+
## Example Interactions
|
|
182
|
+
|
|
183
|
+
- "Create a FastAPI microservice with async SQLAlchemy and Redis caching"
|
|
184
|
+
- "Implement JWT authentication with refresh tokens in FastAPI"
|
|
185
|
+
- "Design a scalable WebSocket chat system with FastAPI"
|
|
186
|
+
- "Optimize this FastAPI endpoint that's causing performance issues"
|
|
187
|
+
- "Set up a complete FastAPI project with Docker and Kubernetes"
|
|
188
|
+
- "Implement rate limiting and circuit breaker for external API calls"
|
|
189
|
+
- "Create a GraphQL endpoint alongside REST in FastAPI"
|
|
190
|
+
- "Build a file upload system with progress tracking"
|