@musashishao/agent-kit 1.2.2
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/.agent/agents/backend-specialist.md +263 -0
- package/.agent/agents/database-architect.md +226 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/frontend-specialist.md +556 -0
- package/.agent/agents/game-developer.md +162 -0
- package/.agent/agents/mobile-developer.md +377 -0
- package/.agent/agents/orchestrator.md +416 -0
- package/.agent/agents/penetration-tester.md +188 -0
- package/.agent/agents/performance-optimizer.md +187 -0
- package/.agent/agents/project-planner.md +403 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/mcp/README.md +69 -0
- package/.agent/mcp/config/mcp-config.json +62 -0
- package/.agent/mcp/config/registry.json +54 -0
- package/.agent/mcp/servers/agent-kit-core/package.json +28 -0
- package/.agent/mcp/servers/agent-kit-core/src/index.ts +455 -0
- package/.agent/mcp/servers/agent-kit-core/tsconfig.json +16 -0
- package/.agent/mcp/servers/agent-kit-fs/package.json +25 -0
- package/.agent/mcp/servers/agent-kit-fs/src/index.ts +399 -0
- package/.agent/mcp/servers/agent-kit-fs/tsconfig.json +16 -0
- package/.agent/mcp/servers/agent-kit-git/package.json +24 -0
- package/.agent/mcp/servers/agent-kit-git/src/index.ts +283 -0
- package/.agent/mcp/servers/agent-kit-git/tsconfig.json +16 -0
- package/.agent/mcp/templates/README.md +49 -0
- package/.agent/mcp/templates/api/README.md.template +45 -0
- package/.agent/mcp/templates/api/src/index.ts.template +185 -0
- package/.agent/mcp/templates/base-package.json.template +27 -0
- package/.agent/mcp/templates/base-tsconfig.json +21 -0
- package/.agent/mcp/templates/custom/src/index.ts.template +133 -0
- package/.agent/mcp/templates/database/src/index.ts.template +273 -0
- package/.agent/mcp/templates/web-scraper/src/index.ts.template +239 -0
- package/.agent/rules/CODEX.md +250 -0
- package/.agent/rules/GEMINI.md +251 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +40 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/bash-linux/SKILL.md +199 -0
- package/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/.agent/skills/brainstorming/SKILL.md +163 -0
- package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/.agent/skills/context-engineering/SKILL.md +74 -0
- package/.agent/skills/context-engineering/examples/advanced_code_request.md +73 -0
- package/.agent/skills/context-engineering/scripts/quality_validator.py +294 -0
- package/.agent/skills/context-engineering/scripts/repo_mapper.py +27 -0
- package/.agent/skills/context-engineering/scripts/skill_checker.py +194 -0
- package/.agent/skills/context-engineering/scripts/token_counter.py +65 -0
- package/.agent/skills/context-engineering/strategies/context-caching.md +50 -0
- package/.agent/skills/context-engineering/strategies/few-shot-examples.md +56 -0
- package/.agent/skills/context-engineering/strategies/skeleton-code.md +59 -0
- package/.agent/skills/context-engineering/strategies/xml-framing.md +57 -0
- package/.agent/skills/database-design/SKILL.md +52 -0
- package/.agent/skills/database-design/database-selection.md +43 -0
- package/.agent/skills/database-design/indexing.md +39 -0
- package/.agent/skills/database-design/migrations.md +48 -0
- package/.agent/skills/database-design/optimization.md +36 -0
- package/.agent/skills/database-design/orm-selection.md +30 -0
- package/.agent/skills/database-design/schema-design.md +56 -0
- package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/docker-expert/SKILL.md +409 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/frontend-design/SKILL.md +396 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +541 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.agent/skills/mcp-builder/SKILL.md +662 -0
- package/.agent/skills/mcp-builder/python-template.md +522 -0
- package/.agent/skills/mcp-builder/tool-patterns.md +642 -0
- package/.agent/skills/mcp-builder/typescript-template.md +361 -0
- package/.agent/skills/mobile-design/SKILL.md +394 -0
- package/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/.agent/skills/mobile-design/platform-android.md +666 -0
- package/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/.agent/skills/nestjs-expert/SKILL.md +552 -0
- package/.agent/skills/nextjs-best-practices/SKILL.md +203 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.agent/skills/plan-writing/SKILL.md +152 -0
- package/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/.agent/skills/prisma-expert/SKILL.md +355 -0
- package/.agent/skills/problem-solving/SKILL.md +556 -0
- package/.agent/skills/problem-solving/collision-zone-thinking.md +285 -0
- package/.agent/skills/problem-solving/inversion-exercise.md +205 -0
- package/.agent/skills/problem-solving/meta-pattern-recognition.md +313 -0
- package/.agent/skills/problem-solving/scale-game.md +300 -0
- package/.agent/skills/problem-solving/simplification-cascades.md +321 -0
- package/.agent/skills/problem-solving/when-stuck.md +146 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/react-patterns/SKILL.md +198 -0
- package/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/.agent/skills/server-management/SKILL.md +161 -0
- package/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.agent/skills/typescript-expert/SKILL.md +429 -0
- package/.agent/skills/typescript-expert/references/tsconfig-strict.json +92 -0
- package/.agent/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/.agent/skills/typescript-expert/references/utility-types.ts +335 -0
- package/.agent/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +351 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +257 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +487 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +76 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.agent/templates/AGENTS.backend.md +230 -0
- package/.agent/templates/AGENTS.md +121 -0
- package/.agent/templates/AGENTS.mobile.md +183 -0
- package/.agent/templates/AGENTS.web.md +192 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/context.md +47 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +80 -0
- package/.agent/workflows/quality.md +89 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +250 -0
- package/LICENSE +21 -0
- package/README.md +317 -0
- package/bin/cli.js +1267 -0
- package/index.js +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
platform: codex-cli
|
|
4
|
+
priority: P0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CODEX.md - Codex CLI Optimization Rules
|
|
8
|
+
|
|
9
|
+
> **Agent Kit** - Codex CLI specific rules for maximum output quality.
|
|
10
|
+
> This file extends the universal rules with Codex-specific optimizations.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🎯 CODEX CLI OPTIMIZATION PROTOCOL
|
|
15
|
+
|
|
16
|
+
### 1. Context Window Management
|
|
17
|
+
|
|
18
|
+
Codex CLI has specific context handling. Optimize by:
|
|
19
|
+
|
|
20
|
+
| Strategy | Implementation |
|
|
21
|
+
|----------|----------------|
|
|
22
|
+
| **Selective Loading** | Only read skills referenced in user request |
|
|
23
|
+
| **Skill Caching** | Once a skill is read, don't re-read in same session |
|
|
24
|
+
| **Minimal Agents** | Load max 3 agents per task |
|
|
25
|
+
| **Token Budget** | Reserve 40% for reasoning, 30% for code output |
|
|
26
|
+
|
|
27
|
+
### 2. Skill Loading Order
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
STEP 1: Check AGENTS.md → Understand kit structure
|
|
31
|
+
STEP 2: Identify task type → Map to skills/agents
|
|
32
|
+
STEP 3: Read skill SKILL.md → Get instructions
|
|
33
|
+
STEP 4: Read only sections needed → Not entire folder
|
|
34
|
+
STEP 5: Execute → Apply skill principles
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Output Quality Standards
|
|
38
|
+
|
|
39
|
+
| Aspect | Requirement |
|
|
40
|
+
|--------|-------------|
|
|
41
|
+
| **Code** | Production-ready, no TODOs, no placeholders |
|
|
42
|
+
| **Comments** | Minimal, only for non-obvious logic |
|
|
43
|
+
| **Types** | Full TypeScript strict types |
|
|
44
|
+
| **Error Handling** | Comprehensive try-catch, proper error messages |
|
|
45
|
+
| **Security** | No hardcoded secrets, proper input validation |
|
|
46
|
+
| **Performance** | Optimized queries, no N+1, lazy loading |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🧠 TASK CLASSIFICATION
|
|
51
|
+
|
|
52
|
+
Before action, classify the request:
|
|
53
|
+
|
|
54
|
+
| Type | Keywords | Action |
|
|
55
|
+
|------|----------|--------|
|
|
56
|
+
| **QUESTION** | "what is", "how does", "explain" | Text response only |
|
|
57
|
+
| **SIMPLE FIX** | "fix", "update", "change" (single file) | Direct edit |
|
|
58
|
+
| **FEATURE** | "add", "implement", "create" | Use `/create` or `/enhance` workflow |
|
|
59
|
+
| **DEBUG** | "why", "not working", "error" | Use `/debug` workflow |
|
|
60
|
+
| **REVIEW** | "review", "audit", "check" | Use appropriate agent |
|
|
61
|
+
| **DESIGN** | "design", "UI", "page" | Use `/ui-ux-pro-max` workflow |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 🔴 CRITICAL RULES
|
|
66
|
+
|
|
67
|
+
### Rule 1: Read Before Write
|
|
68
|
+
```
|
|
69
|
+
❌ WRONG: Immediately start coding
|
|
70
|
+
✅ CORRECT: Read → Understand → Plan → Code
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Rule 2: Skill-Based Coding
|
|
74
|
+
```
|
|
75
|
+
For each domain, apply corresponding skill:
|
|
76
|
+
- Frontend → Read react-patterns, nextjs-best-practices
|
|
77
|
+
- Backend → Read api-patterns, nodejs-best-practices
|
|
78
|
+
- Database → Read database-design, prisma-expert
|
|
79
|
+
- Security → Read vulnerability-scanner
|
|
80
|
+
- UI/UX → Read ui-ux-pro-max, frontend-design
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Rule 3: Quality Over Speed
|
|
84
|
+
```
|
|
85
|
+
- No placeholder code (e.g., "// TODO: implement")
|
|
86
|
+
- No generic variable names (e.g., "data", "temp")
|
|
87
|
+
- No console.log in production code
|
|
88
|
+
- Always handle edge cases
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Rule 4: Socratic Gate
|
|
92
|
+
For complex/unclear requests, ASK before implementing:
|
|
93
|
+
```
|
|
94
|
+
Before I implement, let me clarify:
|
|
95
|
+
1. [Specific question about scope]
|
|
96
|
+
2. [Specific question about requirements]
|
|
97
|
+
3. [Specific question about constraints]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 📂 SKILL QUICK REFERENCE
|
|
103
|
+
|
|
104
|
+
### Frontend Development
|
|
105
|
+
```
|
|
106
|
+
/read .agent/skills/react-patterns/SKILL.md
|
|
107
|
+
/read .agent/skills/nextjs-best-practices/SKILL.md
|
|
108
|
+
/read .agent/skills/tailwind-patterns/SKILL.md
|
|
109
|
+
/read .agent/skills/frontend-design/SKILL.md
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Backend Development
|
|
113
|
+
```
|
|
114
|
+
/read .agent/skills/api-patterns/SKILL.md
|
|
115
|
+
/read .agent/skills/nodejs-best-practices/SKILL.md
|
|
116
|
+
/read .agent/skills/database-design/SKILL.md
|
|
117
|
+
/read .agent/skills/prisma-expert/SKILL.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Security
|
|
121
|
+
```
|
|
122
|
+
/read .agent/skills/vulnerability-scanner/SKILL.md
|
|
123
|
+
/read .agent/skills/red-team-tactics/SKILL.md
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### UI/UX Design
|
|
127
|
+
```
|
|
128
|
+
/read .agent/skills/ui-ux-pro-max/SKILL.md
|
|
129
|
+
/read .agent/skills/mobile-design/SKILL.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Debugging
|
|
133
|
+
```
|
|
134
|
+
/read .agent/skills/systematic-debugging/SKILL.md
|
|
135
|
+
/read .agent/skills/problem-solving/SKILL.md
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 🛠️ WORKFLOW TRIGGERS
|
|
141
|
+
|
|
142
|
+
| User Says | Trigger Workflow |
|
|
143
|
+
|-----------|-----------------|
|
|
144
|
+
| "create", "build", "make new" | `/create` |
|
|
145
|
+
| "fix", "debug", "not working" | `/debug` |
|
|
146
|
+
| "plan", "break down", "roadmap" | `/plan` |
|
|
147
|
+
| "design", "UI", "beautiful" | `/ui-ux-pro-max` |
|
|
148
|
+
| "test", "coverage", "unit test" | `/test` |
|
|
149
|
+
| "deploy", "production", "ship" | `/deploy` |
|
|
150
|
+
| "review", "audit", "check" | Use agent directly |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 🎨 OUTPUT FORMATTING
|
|
155
|
+
|
|
156
|
+
### For Code
|
|
157
|
+
```typescript
|
|
158
|
+
// Use proper structure
|
|
159
|
+
interface Example {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
createdAt: Date;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function exampleFunction(param: Example): Result {
|
|
166
|
+
// Implementation with proper error handling
|
|
167
|
+
try {
|
|
168
|
+
// Logic here
|
|
169
|
+
} catch (error) {
|
|
170
|
+
throw new CustomError('Descriptive message', { cause: error });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### For Explanations
|
|
176
|
+
1. **Be concise** - No unnecessary verbosity
|
|
177
|
+
2. **Use tables** - For comparisons and options
|
|
178
|
+
3. **Use code blocks** - For any code reference
|
|
179
|
+
4. **Use headers** - For organization
|
|
180
|
+
|
|
181
|
+
### For Plans
|
|
182
|
+
```markdown
|
|
183
|
+
## Task: [Name]
|
|
184
|
+
|
|
185
|
+
### Phase 1: [Name]
|
|
186
|
+
- [ ] Task 1.1: Description
|
|
187
|
+
- [ ] Task 1.2: Description
|
|
188
|
+
|
|
189
|
+
### Phase 2: [Name]
|
|
190
|
+
...
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 📊 QUALITY CHECKLIST
|
|
196
|
+
|
|
197
|
+
Before completing any task:
|
|
198
|
+
|
|
199
|
+
| Check | Criteria |
|
|
200
|
+
|-------|----------|
|
|
201
|
+
| ✅ Code compiles | No TypeScript errors |
|
|
202
|
+
| ✅ Clean code | Following skill guidelines |
|
|
203
|
+
| ✅ Security | No vulnerabilities |
|
|
204
|
+
| ✅ Performance | No obvious bottlenecks |
|
|
205
|
+
| ✅ Documentation | Inline comments where needed |
|
|
206
|
+
| ✅ Tests | Unit tests for logic (if applicable) |
|
|
207
|
+
| ✅ Edge cases | Handled null, undefined, errors |
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 🔗 INTEGRATION WITH AGENTS
|
|
212
|
+
|
|
213
|
+
When user mentions an agent (e.g., `@security-auditor`):
|
|
214
|
+
|
|
215
|
+
1. **Read** `.agent/agents/{agent-name}.md`
|
|
216
|
+
2. **Apply** the agent's personality and rules
|
|
217
|
+
3. **Use** the agent's skills (listed in frontmatter)
|
|
218
|
+
4. **Output** in the agent's expected format
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 📝 EXAMPLE USAGE
|
|
223
|
+
|
|
224
|
+
### User Request
|
|
225
|
+
```
|
|
226
|
+
Create a login page with email/password authentication
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Codex Response (Following CODEX.md)
|
|
230
|
+
```
|
|
231
|
+
I'll create a production-ready login page.
|
|
232
|
+
|
|
233
|
+
**Skills Applied:**
|
|
234
|
+
- react-patterns → Component structure
|
|
235
|
+
- nextjs-best-practices → App Router patterns
|
|
236
|
+
- tailwind-patterns → Styling
|
|
237
|
+
- vulnerability-scanner → Auth security
|
|
238
|
+
|
|
239
|
+
**Implementation:**
|
|
240
|
+
[Full code with proper types, error handling, security]
|
|
241
|
+
|
|
242
|
+
**Next Steps:**
|
|
243
|
+
- [ ] Add forgot password flow
|
|
244
|
+
- [ ] Configure email provider
|
|
245
|
+
- [ ] Add rate limiting
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
*Agent Kit - CODEX.md rules for highest quality AI output*
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# GEMINI.md - Maestro Configuration
|
|
6
|
+
|
|
7
|
+
> Maestro AI Development Orchestrator
|
|
8
|
+
> This file defines how the AI behaves in this workspace.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
|
13
|
+
|
|
14
|
+
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
|
15
|
+
|
|
16
|
+
### 1. Modular Skill Loading Protocol
|
|
17
|
+
```
|
|
18
|
+
Agent activated → Check frontmatter "skills:" field
|
|
19
|
+
│
|
|
20
|
+
└── For EACH skill:
|
|
21
|
+
├── Read SKILL.md (INDEX only)
|
|
22
|
+
├── Find relevant sections from content map
|
|
23
|
+
└── Read ONLY those section files
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
|
|
27
|
+
- **Rule Priority:** P0 (GEMINI.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding.
|
|
28
|
+
|
|
29
|
+
### 2. Enforcement Protocol
|
|
30
|
+
1. **When agent is activated:**
|
|
31
|
+
- ✅ READ all rules inside the agent file.
|
|
32
|
+
- ✅ CHECK frontmatter `skills:` list.
|
|
33
|
+
- ✅ LOAD each skill's `SKILL.md`.
|
|
34
|
+
- ✅ APPLY all rules from agent AND skills.
|
|
35
|
+
2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## �📥 REQUEST CLASSIFIER (STEP 2)
|
|
40
|
+
|
|
41
|
+
**Before ANY action, classify the request:**
|
|
42
|
+
|
|
43
|
+
| Request Type | Trigger Keywords | Active Tiers | Result |
|
|
44
|
+
|--------------|------------------|--------------|--------|
|
|
45
|
+
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
|
46
|
+
| **SURVEY/INTEL**| "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
|
47
|
+
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
|
48
|
+
| **COMPLEX CODE**| "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
|
49
|
+
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
|
50
|
+
| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## TIER 0: UNIVERSAL RULES (Always Active)
|
|
55
|
+
|
|
56
|
+
### 🌐 Language Handling
|
|
57
|
+
|
|
58
|
+
When user's prompt is NOT in English:
|
|
59
|
+
1. **Internally translate** for better comprehension
|
|
60
|
+
2. **Respond in user's language** - match their communication
|
|
61
|
+
3. **Code comments/variables** remain in English
|
|
62
|
+
|
|
63
|
+
### 🧹 Clean Code (Global Mandatory)
|
|
64
|
+
|
|
65
|
+
**ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
|
|
66
|
+
|
|
67
|
+
- Concise, direct, solution-focused
|
|
68
|
+
- No verbose explanations
|
|
69
|
+
- No over-commenting
|
|
70
|
+
- No over-engineering
|
|
71
|
+
- **Self-Documentation:** Every agent is responsible for documenting their own changes in relevant `.md` files.
|
|
72
|
+
- **Global Testing Mandate:** Every agent is responsible for writing and running tests for their changes. Follow the "Testing Pyramid" (Unit > Integration > E2E) and the "AAA Pattern" (Arrange, Act, Assert).
|
|
73
|
+
- **Global Performance Mandate:** "Measure first, optimize second." Every agent must ensure their changes adhere to 2025 performance standards (Core Web Vitals for Web, query optimization for DB, bundle limits for FS).
|
|
74
|
+
- **Infrastructure & Safety Mandate:** Every agent is responsible for the deployability and operational safety of their changes. Follow the "5-Phase Deployment Process" (Prepare, Backup, Deploy, Verify, Confirm/Rollback). Always verify environment variables and secrets security.
|
|
75
|
+
|
|
76
|
+
### 📁 File Dependency Awareness
|
|
77
|
+
|
|
78
|
+
**Before modifying ANY file:**
|
|
79
|
+
1. Check `CODEBASE.md` → File Dependencies
|
|
80
|
+
2. Identify dependent files
|
|
81
|
+
3. Update ALL affected files together
|
|
82
|
+
|
|
83
|
+
### 🗺️ System Map Read
|
|
84
|
+
|
|
85
|
+
> 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.
|
|
86
|
+
|
|
87
|
+
**Path Awareness:**
|
|
88
|
+
- Agents: `.agent/` (Project)
|
|
89
|
+
- Skills: `.agent/skills/` (Project)
|
|
90
|
+
- Runtime Scripts: `.agent/skills/<skill>/scripts/`
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### 🧠 Read → Understand → Apply
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
❌ WRONG: Read agent file → Start coding
|
|
97
|
+
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Before coding, answer:**
|
|
101
|
+
1. What is the GOAL of this agent/skill?
|
|
102
|
+
2. What PRINCIPLES must I apply?
|
|
103
|
+
3. How does this DIFFER from generic output?
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## TIER 1: CODE RULES (When Writing Code)
|
|
108
|
+
|
|
109
|
+
### 📱 Project Type Routing
|
|
110
|
+
|
|
111
|
+
| Project Type | Primary Agent | Skills |
|
|
112
|
+
|--------------|---------------|--------|
|
|
113
|
+
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
|
114
|
+
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
|
115
|
+
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
|
116
|
+
|
|
117
|
+
> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
|
118
|
+
|
|
119
|
+
### 🛑 Socratic Gate
|
|
120
|
+
|
|
121
|
+
**For complex requests, STOP and ASK first:**
|
|
122
|
+
|
|
123
|
+
### 🛑 GLOBAL SOCRATIC GATE (TIER 0)
|
|
124
|
+
|
|
125
|
+
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
|
126
|
+
|
|
127
|
+
| Request Type | Strategy | Required Action |
|
|
128
|
+
|--------------|----------|-----------------|
|
|
129
|
+
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
130
|
+
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
131
|
+
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
132
|
+
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
133
|
+
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
134
|
+
|
|
135
|
+
**Protocol:**
|
|
136
|
+
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
137
|
+
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
|
|
138
|
+
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
139
|
+
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
|
140
|
+
|
|
141
|
+
### 🏁 Final Checklist Protocol
|
|
142
|
+
|
|
143
|
+
**Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases.
|
|
144
|
+
|
|
145
|
+
| Task Stage | Command | Purpose |
|
|
146
|
+
|------------|---------|---------|
|
|
147
|
+
| **Manual Audit** | `python scripts/checklist.py .` | Priority-based project audit |
|
|
148
|
+
| **Pre-Deploy** | `python scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
|
149
|
+
|
|
150
|
+
**Priority Execution Order:**
|
|
151
|
+
1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
|
|
152
|
+
|
|
153
|
+
**Rules:**
|
|
154
|
+
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
|
155
|
+
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
**Available Scripts (12 total):**
|
|
159
|
+
| Script | Skill | When to Use |
|
|
160
|
+
|--------|-------|-------------|
|
|
161
|
+
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
|
162
|
+
| `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
|
|
163
|
+
| `lint_runner.py` | lint-and-validate | Every code change |
|
|
164
|
+
| `test_runner.py` | testing-patterns | After logic change |
|
|
165
|
+
| `schema_validator.py` | database-design | After DB change |
|
|
166
|
+
| `ux_audit.py` | frontend-design | After UI change |
|
|
167
|
+
| `accessibility_checker.py` | frontend-design | After UI change |
|
|
168
|
+
| `seo_checker.py` | seo-fundamentals | After page change |
|
|
169
|
+
| `bundle_analyzer.py` | performance-profiling | Before deploy |
|
|
170
|
+
| `mobile_audit.py` | mobile-design | After mobile change |
|
|
171
|
+
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
|
172
|
+
| `playwright_runner.py` | webapp-testing | Before deploy |
|
|
173
|
+
|
|
174
|
+
> 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
|
|
175
|
+
|
|
176
|
+
### 🎭 Gemini Mode Mapping
|
|
177
|
+
|
|
178
|
+
| Mode | Agent | Behavior |
|
|
179
|
+
|------|-------|----------|
|
|
180
|
+
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
|
181
|
+
| **ask** | - | Focus on understanding. Ask questions. |
|
|
182
|
+
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
|
183
|
+
|
|
184
|
+
**Plan Mode (4-Phase):**
|
|
185
|
+
1. ANALYSIS → Research, questions
|
|
186
|
+
2. PLANNING → `{task-slug}.md`, task breakdown
|
|
187
|
+
3. SOLUTIONING → Architecture, design (NO CODE!)
|
|
188
|
+
4. IMPLEMENTATION → Code + tests
|
|
189
|
+
|
|
190
|
+
> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## TIER 2: DESIGN RULES (Reference)
|
|
195
|
+
|
|
196
|
+
> **Design rules are in the specialist agents, NOT here.**
|
|
197
|
+
|
|
198
|
+
| Task | Read |
|
|
199
|
+
|------|------|
|
|
200
|
+
| Web UI/UX | `.agent/frontend-specialist.md` |
|
|
201
|
+
| Mobile UI/UX | `.agent/mobile-developer.md` |
|
|
202
|
+
|
|
203
|
+
**These agents contain:**
|
|
204
|
+
- Purple Ban (no violet/purple colors)
|
|
205
|
+
- Template Ban (no standard layouts)
|
|
206
|
+
- Anti-cliché rules
|
|
207
|
+
- Deep Design Thinking protocol
|
|
208
|
+
|
|
209
|
+
> 🔴 **For design work:** Open and READ the agent file. Rules are there.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 📁 QUICK REFERENCE
|
|
214
|
+
|
|
215
|
+
### Available Master Agents (8)
|
|
216
|
+
|
|
217
|
+
| Agent | Domain & Focus |
|
|
218
|
+
|-------|----------------|
|
|
219
|
+
| `orchestrator` | Multi-agent coordination and synthesis |
|
|
220
|
+
| `project-planner` | Discovery, Architecture, and Task Planning |
|
|
221
|
+
| `security-auditor` | Master Cybersecurity (Audit + Pentest + Infra Hardening) |
|
|
222
|
+
| `backend-specialist` | Backend Architect (API + Database + Server/Docker Deploy) |
|
|
223
|
+
| `frontend-specialist` | Frontend & Growth (UI/UX + SEO + Edge/Static Deploy) |
|
|
224
|
+
| `mobile-developer` | Mobile Specialist (Cross-platform + Mobile Performance)|
|
|
225
|
+
| `debugger` | Systematic Root Cause Analysis & Bug Fixing |
|
|
226
|
+
| `game-developer` | Specialized Game Logic & Assets & Performance |
|
|
227
|
+
|
|
228
|
+
### Key Skills
|
|
229
|
+
|
|
230
|
+
| Skill | Purpose |
|
|
231
|
+
|-------|---------|
|
|
232
|
+
| `clean-code` | Coding standards (GLOBAL) |
|
|
233
|
+
| `brainstorming` | Socratic questioning |
|
|
234
|
+
| `app-builder` | Full-stack orchestration |
|
|
235
|
+
| `frontend-design` | Web UI patterns |
|
|
236
|
+
| `mobile-design` | Mobile UI patterns |
|
|
237
|
+
| `plan-writing` | {task-slug}.md format |
|
|
238
|
+
| `behavioral-modes` | Mode switching |
|
|
239
|
+
|
|
240
|
+
### Script Locations
|
|
241
|
+
|
|
242
|
+
| Script | Path |
|
|
243
|
+
|--------|------|
|
|
244
|
+
| Full verify | `scripts/verify_all.py` |
|
|
245
|
+
| Security scan | `.agent/skills/vulnerability-scanner/scripts/security_scan.py` |
|
|
246
|
+
| UX audit | `.agent/skills/frontend-design/scripts/ux_audit.py` |
|
|
247
|
+
| Mobile audit | `.agent/skills/mobile-design/scripts/mobile_audit.py` |
|
|
248
|
+
| Lighthouse | `.agent/skills/performance-profiling/scripts/lighthouse_audit.py` |
|
|
249
|
+
| Playwright | `.agent/skills/webapp-testing/scripts/playwright_runner.py` |
|
|
250
|
+
|
|
251
|
+
---
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-patterns
|
|
3
|
+
description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# API Patterns
|
|
8
|
+
|
|
9
|
+
> API design principles and decision-making for 2025.
|
|
10
|
+
> **Learn to THINK, not copy fixed patterns.**
|
|
11
|
+
|
|
12
|
+
## 🎯 Selective Reading Rule
|
|
13
|
+
|
|
14
|
+
**Read ONLY files relevant to the request!** Check the content map, find what you need.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📑 Content Map
|
|
19
|
+
|
|
20
|
+
| File | Description | When to Read |
|
|
21
|
+
|------|-------------|--------------|
|
|
22
|
+
| `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |
|
|
23
|
+
| `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |
|
|
24
|
+
| `response.md` | Envelope pattern, error format, pagination | Response structure |
|
|
25
|
+
| `graphql.md` | Schema design, when to use, security | Considering GraphQL |
|
|
26
|
+
| `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |
|
|
27
|
+
| `versioning.md` | URI/Header/Query versioning | API evolution planning |
|
|
28
|
+
| `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
|
|
29
|
+
| `rate-limiting.md` | Token bucket, sliding window | API protection |
|
|
30
|
+
| `documentation.md` | OpenAPI/Swagger best practices | Documentation |
|
|
31
|
+
| `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🔗 Related Skills
|
|
36
|
+
|
|
37
|
+
| Need | Skill |
|
|
38
|
+
|------|-------|
|
|
39
|
+
| API implementation | `@[skills/backend-development]` |
|
|
40
|
+
| Data structure | `@[skills/database-design]` |
|
|
41
|
+
| Security details | `@[skills/security-hardening]` |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## ✅ Decision Checklist
|
|
46
|
+
|
|
47
|
+
Before designing an API:
|
|
48
|
+
|
|
49
|
+
- [ ] **Asked user about API consumers?**
|
|
50
|
+
- [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)
|
|
51
|
+
- [ ] **Defined consistent response format?**
|
|
52
|
+
- [ ] **Planned versioning strategy?**
|
|
53
|
+
- [ ] **Considered authentication needs?**
|
|
54
|
+
- [ ] **Planned rate limiting?**
|
|
55
|
+
- [ ] **Documentation approach defined?**
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## ❌ Anti-Patterns
|
|
60
|
+
|
|
61
|
+
**DON'T:**
|
|
62
|
+
- Default to REST for everything
|
|
63
|
+
- Use verbs in REST endpoints (/getUsers)
|
|
64
|
+
- Return inconsistent response formats
|
|
65
|
+
- Expose internal errors to clients
|
|
66
|
+
- Skip rate limiting
|
|
67
|
+
|
|
68
|
+
**DO:**
|
|
69
|
+
- Choose API style based on context
|
|
70
|
+
- Ask about client requirements
|
|
71
|
+
- Document thoroughly
|
|
72
|
+
- Use appropriate status codes
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Script
|
|
77
|
+
|
|
78
|
+
| Script | Purpose | Command |
|
|
79
|
+
|--------|---------|---------|
|
|
80
|
+
| `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |
|
|
81
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# API Style Selection (2025)
|
|
2
|
+
|
|
3
|
+
> REST vs GraphQL vs tRPC - Hangi durumda hangisi?
|
|
4
|
+
|
|
5
|
+
## Decision Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Who are the API consumers?
|
|
9
|
+
│
|
|
10
|
+
├── Public API / Multiple platforms
|
|
11
|
+
│ └── REST + OpenAPI (widest compatibility)
|
|
12
|
+
│
|
|
13
|
+
├── Complex data needs / Multiple frontends
|
|
14
|
+
│ └── GraphQL (flexible queries)
|
|
15
|
+
│
|
|
16
|
+
├── TypeScript frontend + backend (monorepo)
|
|
17
|
+
│ └── tRPC (end-to-end type safety)
|
|
18
|
+
│
|
|
19
|
+
├── Real-time / Event-driven
|
|
20
|
+
│ └── WebSocket + AsyncAPI
|
|
21
|
+
│
|
|
22
|
+
└── Internal microservices
|
|
23
|
+
└── gRPC (performance) or REST (simplicity)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Comparison
|
|
27
|
+
|
|
28
|
+
| Factor | REST | GraphQL | tRPC |
|
|
29
|
+
|--------|------|---------|------|
|
|
30
|
+
| **Best for** | Public APIs | Complex apps | TS monorepos |
|
|
31
|
+
| **Learning curve** | Low | Medium | Low (if TS) |
|
|
32
|
+
| **Over/under fetching** | Common | Solved | Solved |
|
|
33
|
+
| **Type safety** | Manual (OpenAPI) | Schema-based | Automatic |
|
|
34
|
+
| **Caching** | HTTP native | Complex | Client-based |
|
|
35
|
+
|
|
36
|
+
## Selection Questions
|
|
37
|
+
|
|
38
|
+
1. Who are the API consumers?
|
|
39
|
+
2. Is the frontend TypeScript?
|
|
40
|
+
3. How complex are the data relationships?
|
|
41
|
+
4. Is caching critical?
|
|
42
|
+
5. Public or internal API?
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Authentication Patterns
|
|
2
|
+
|
|
3
|
+
> Choose auth pattern based on use case.
|
|
4
|
+
|
|
5
|
+
## Selection Guide
|
|
6
|
+
|
|
7
|
+
| Pattern | Best For |
|
|
8
|
+
|---------|----------|
|
|
9
|
+
| **JWT** | Stateless, microservices |
|
|
10
|
+
| **Session** | Traditional web, simple |
|
|
11
|
+
| **OAuth 2.0** | Third-party integration |
|
|
12
|
+
| **API Keys** | Server-to-server, public APIs |
|
|
13
|
+
| **Passkey** | Modern passwordless (2025+) |
|
|
14
|
+
|
|
15
|
+
## JWT Principles
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Important:
|
|
19
|
+
├── Always verify signature
|
|
20
|
+
├── Check expiration
|
|
21
|
+
├── Include minimal claims
|
|
22
|
+
├── Use short expiry + refresh tokens
|
|
23
|
+
└── Never store sensitive data in JWT
|
|
24
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# API Documentation Principles
|
|
2
|
+
|
|
3
|
+
> Good docs = happy developers = API adoption.
|
|
4
|
+
|
|
5
|
+
## OpenAPI/Swagger Essentials
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Include:
|
|
9
|
+
├── All endpoints with examples
|
|
10
|
+
├── Request/response schemas
|
|
11
|
+
├── Authentication requirements
|
|
12
|
+
├── Error response formats
|
|
13
|
+
└── Rate limiting info
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Good Documentation Has
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Essentials:
|
|
20
|
+
├── Quick start / Getting started
|
|
21
|
+
├── Authentication guide
|
|
22
|
+
├── Complete API reference
|
|
23
|
+
├── Error handling guide
|
|
24
|
+
├── Code examples (multiple languages)
|
|
25
|
+
└── Changelog
|
|
26
|
+
```
|