ai-devx 1.0.0 → 1.0.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.
Files changed (206) hide show
  1. package/package.json +1 -1
  2. package/templates/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
  3. package/templates/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
  4. package/templates/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
  5. package/templates/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
  6. package/templates/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
  7. package/templates/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
  8. package/templates/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  9. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  10. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  11. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  12. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  13. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  14. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  15. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  16. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  17. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  18. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  19. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  20. package/templates/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  21. package/templates/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
  22. package/templates/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
  23. package/templates/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  24. package/templates/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  25. package/templates/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  26. package/templates/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  27. package/templates/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  28. package/templates/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
  29. package/templates/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
  30. package/templates/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
  31. package/templates/.agent/ARCHITECTURE.md +288 -0
  32. package/templates/.agent/agents/backend-specialist.md +251 -135
  33. package/templates/.agent/agents/code-archaeologist.md +106 -0
  34. package/templates/.agent/agents/database-architect.md +222 -160
  35. package/templates/.agent/agents/debugger.md +205 -108
  36. package/templates/.agent/agents/devops-engineer.md +226 -169
  37. package/templates/.agent/agents/documentation-writer.md +104 -0
  38. package/templates/.agent/agents/explorer-agent.md +73 -0
  39. package/templates/.agent/agents/frontend-specialist.md +587 -116
  40. package/templates/.agent/agents/game-developer.md +162 -0
  41. package/templates/.agent/agents/mobile-developer.md +377 -0
  42. package/templates/.agent/agents/orchestrator.md +412 -133
  43. package/templates/.agent/agents/penetration-tester.md +188 -0
  44. package/templates/.agent/agents/performance-optimizer.md +187 -0
  45. package/templates/.agent/agents/product-manager.md +112 -0
  46. package/templates/.agent/agents/product-owner.md +95 -0
  47. package/templates/.agent/agents/project-planner.md +390 -111
  48. package/templates/.agent/agents/qa-automation-engineer.md +103 -0
  49. package/templates/.agent/agents/security-auditor.md +158 -110
  50. package/templates/.agent/agents/seo-specialist.md +111 -0
  51. package/templates/.agent/agents/test-engineer.md +136 -154
  52. package/templates/.agent/mcp_config.json +24 -0
  53. package/templates/.agent/rules/GEMINI.md +273 -0
  54. package/templates/.agent/scripts/auto_preview.py +148 -0
  55. package/templates/.agent/scripts/checklist.py +217 -0
  56. package/templates/.agent/scripts/session_manager.py +120 -0
  57. package/templates/.agent/scripts/verify_all.py +327 -0
  58. package/templates/.agent/skills/api-patterns/SKILL.md +77 -232
  59. package/templates/.agent/skills/api-patterns/api-style.md +42 -0
  60. package/templates/.agent/skills/api-patterns/auth.md +24 -0
  61. package/templates/.agent/skills/api-patterns/documentation.md +26 -0
  62. package/templates/.agent/skills/api-patterns/graphql.md +41 -0
  63. package/templates/.agent/skills/api-patterns/rate-limiting.md +31 -0
  64. package/templates/.agent/skills/api-patterns/response.md +37 -0
  65. package/templates/.agent/skills/api-patterns/rest.md +40 -0
  66. package/templates/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  67. package/templates/.agent/skills/api-patterns/security-testing.md +122 -0
  68. package/templates/.agent/skills/api-patterns/trpc.md +41 -0
  69. package/templates/.agent/skills/api-patterns/versioning.md +22 -0
  70. package/templates/.agent/skills/app-builder/SKILL.md +75 -0
  71. package/templates/.agent/skills/app-builder/agent-coordination.md +71 -0
  72. package/templates/.agent/skills/app-builder/feature-building.md +53 -0
  73. package/templates/.agent/skills/app-builder/project-detection.md +34 -0
  74. package/templates/.agent/skills/app-builder/scaffolding.md +118 -0
  75. package/templates/.agent/skills/app-builder/tech-stack.md +40 -0
  76. package/templates/.agent/skills/app-builder/templates/SKILL.md +39 -0
  77. package/templates/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  78. package/templates/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  79. package/templates/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  80. package/templates/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  81. package/templates/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  82. package/templates/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  83. package/templates/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  84. package/templates/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  85. package/templates/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  86. package/templates/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  87. package/templates/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  88. package/templates/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  89. package/templates/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  90. package/templates/.agent/skills/architecture/SKILL.md +55 -0
  91. package/templates/.agent/skills/architecture/context-discovery.md +43 -0
  92. package/templates/.agent/skills/architecture/examples.md +94 -0
  93. package/templates/.agent/skills/architecture/pattern-selection.md +68 -0
  94. package/templates/.agent/skills/architecture/patterns-reference.md +50 -0
  95. package/templates/.agent/skills/architecture/trade-off-analysis.md +77 -0
  96. package/templates/.agent/skills/bash-linux/SKILL.md +199 -0
  97. package/templates/.agent/skills/behavioral-modes/SKILL.md +242 -0
  98. package/templates/.agent/skills/brainstorming/SKILL.md +163 -0
  99. package/templates/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  100. package/templates/.agent/skills/clean-code/SKILL.md +201 -0
  101. package/templates/.agent/skills/code-review-checklist/SKILL.md +109 -0
  102. package/templates/.agent/skills/database-design/SKILL.md +34 -285
  103. package/templates/.agent/skills/database-design/database-selection.md +43 -0
  104. package/templates/.agent/skills/database-design/indexing.md +39 -0
  105. package/templates/.agent/skills/database-design/migrations.md +48 -0
  106. package/templates/.agent/skills/database-design/optimization.md +36 -0
  107. package/templates/.agent/skills/database-design/orm-selection.md +30 -0
  108. package/templates/.agent/skills/database-design/schema-design.md +56 -0
  109. package/templates/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  110. package/templates/.agent/skills/deployment-procedures/SKILL.md +241 -0
  111. package/templates/.agent/skills/doc.md +177 -0
  112. package/templates/.agent/skills/documentation-templates/SKILL.md +194 -0
  113. package/templates/.agent/skills/frontend-design/SKILL.md +418 -0
  114. package/templates/.agent/skills/frontend-design/animation-guide.md +331 -0
  115. package/templates/.agent/skills/frontend-design/color-system.md +311 -0
  116. package/templates/.agent/skills/frontend-design/decision-trees.md +418 -0
  117. package/templates/.agent/skills/frontend-design/motion-graphics.md +306 -0
  118. package/templates/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  119. package/templates/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  120. package/templates/.agent/skills/frontend-design/typography-system.md +345 -0
  121. package/templates/.agent/skills/frontend-design/ux-psychology.md +1116 -0
  122. package/templates/.agent/skills/frontend-design/visual-effects.md +383 -0
  123. package/templates/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  124. package/templates/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  125. package/templates/.agent/skills/game-development/SKILL.md +167 -0
  126. package/templates/.agent/skills/game-development/game-art/SKILL.md +185 -0
  127. package/templates/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  128. package/templates/.agent/skills/game-development/game-design/SKILL.md +129 -0
  129. package/templates/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  130. package/templates/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  131. package/templates/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  132. package/templates/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  133. package/templates/.agent/skills/game-development/web-games/SKILL.md +150 -0
  134. package/templates/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  135. package/templates/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  136. package/templates/.agent/skills/i18n-localization/SKILL.md +154 -0
  137. package/templates/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  138. package/templates/.agent/skills/intelligent-routing/SKILL.md +335 -0
  139. package/templates/.agent/skills/lint-and-validate/SKILL.md +45 -0
  140. package/templates/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  141. package/templates/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  142. package/templates/.agent/skills/mcp-builder/SKILL.md +176 -0
  143. package/templates/.agent/skills/mobile-design/SKILL.md +394 -0
  144. package/templates/.agent/skills/mobile-design/decision-trees.md +516 -0
  145. package/templates/.agent/skills/mobile-design/mobile-backend.md +491 -0
  146. package/templates/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  147. package/templates/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  148. package/templates/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  149. package/templates/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  150. package/templates/.agent/skills/mobile-design/mobile-performance.md +767 -0
  151. package/templates/.agent/skills/mobile-design/mobile-testing.md +356 -0
  152. package/templates/.agent/skills/mobile-design/mobile-typography.md +433 -0
  153. package/templates/.agent/skills/mobile-design/platform-android.md +666 -0
  154. package/templates/.agent/skills/mobile-design/platform-ios.md +561 -0
  155. package/templates/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  156. package/templates/.agent/skills/mobile-design/touch-psychology.md +537 -0
  157. package/templates/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
  158. package/templates/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  159. package/templates/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  160. package/templates/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  161. package/templates/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  162. package/templates/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  163. package/templates/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  164. package/templates/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  165. package/templates/.agent/skills/nextjs-react-expert/SKILL.md +286 -0
  166. package/templates/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  167. package/templates/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  168. package/templates/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  169. package/templates/.agent/skills/parallel-agents/SKILL.md +175 -0
  170. package/templates/.agent/skills/performance-profiling/SKILL.md +143 -0
  171. package/templates/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  172. package/templates/.agent/skills/plan-writing/SKILL.md +152 -0
  173. package/templates/.agent/skills/powershell-windows/SKILL.md +167 -0
  174. package/templates/.agent/skills/python-patterns/SKILL.md +441 -0
  175. package/templates/.agent/skills/red-team-tactics/SKILL.md +199 -0
  176. package/templates/.agent/skills/rust-pro/SKILL.md +176 -0
  177. package/templates/.agent/skills/seo-fundamentals/SKILL.md +129 -0
  178. package/templates/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  179. package/templates/.agent/skills/server-management/SKILL.md +161 -0
  180. package/templates/.agent/skills/systematic-debugging/SKILL.md +109 -0
  181. package/templates/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  182. package/templates/.agent/skills/tdd-workflow/SKILL.md +149 -0
  183. package/templates/.agent/skills/testing-patterns/SKILL.md +156 -240
  184. package/templates/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  185. package/templates/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  186. package/templates/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  187. package/templates/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  188. package/templates/.agent/skills/web-design-guidelines/SKILL.md +57 -0
  189. package/templates/.agent/skills/webapp-testing/SKILL.md +187 -0
  190. package/templates/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  191. package/templates/.agent/workflows/brainstorm.md +113 -0
  192. package/templates/.agent/workflows/create.md +40 -112
  193. package/templates/.agent/workflows/debug.md +82 -117
  194. package/templates/.agent/workflows/deploy.md +142 -129
  195. package/templates/.agent/workflows/enhance.md +63 -0
  196. package/templates/.agent/workflows/orchestrate.md +237 -0
  197. package/templates/.agent/workflows/plan.md +74 -138
  198. package/templates/.agent/workflows/preview.md +81 -0
  199. package/templates/.agent/workflows/status.md +86 -0
  200. package/templates/.agent/workflows/test.md +109 -130
  201. package/templates/.agent/workflows/ui-ux-pro-max.md +296 -0
  202. package/templates/.agent/scripts/checklist.js +0 -260
  203. package/templates/.agent/scripts/security_scan.js +0 -251
  204. package/templates/.agent/skills/docker-expert/SKILL.md +0 -286
  205. package/templates/.agent/skills/react-best-practices/SKILL.md +0 -246
  206. package/templates/.agent/workflows/security.md +0 -181
@@ -1,236 +1,81 @@
1
1
  ---
2
2
  name: api-patterns
3
- description: REST API design patterns, authentication, and best practices
4
- version: "1.0.0"
5
- requires: []
6
- related:
7
- - backend-specialist
8
- - security-best-practices
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
9
5
  ---
10
6
 
11
- # API Patterns Skill
12
-
13
- ## REST API Design
14
-
15
- ### Resource Naming
16
- - Use nouns, not verbs
17
- - Use plural forms
18
- - Use kebab-case for multi-word resources
19
-
20
- ```
21
- ✅ GET /users
22
- GET /users/:id
23
- ✅ POST /users
24
- PUT /users/:id
25
- ✅ DELETE /users/:id
26
- GET /user-profiles
27
-
28
- GET /getUsers
29
- GET /getUserById
30
- POST /createUser
31
- ```
32
-
33
- ### HTTP Methods
34
- | Method | Action | Idempotent |
35
- |--------|--------|------------|
36
- | GET | Read | Yes |
37
- | POST | Create | No |
38
- | PUT | Update (full) | Yes |
39
- | PATCH | Update (partial) | No |
40
- | DELETE | Remove | Yes |
41
-
42
- ### Status Codes
43
- - **200** - OK (GET, PUT, PATCH, DELETE)
44
- - **201** - Created (POST)
45
- - **204** - No Content (DELETE)
46
- - **400** - Bad Request
47
- - **401** - Unauthorized
48
- - **403** - Forbidden
49
- - **404** - Not Found
50
- - **409** - Conflict
51
- - **422** - Unprocessable Entity
52
- - **500** - Internal Server Error
53
-
54
- ### Response Format
55
- ```json
56
- {
57
- "success": true,
58
- "data": {
59
- "id": "123",
60
- "name": "John Doe"
61
- },
62
- "meta": {
63
- "page": 1,
64
- "limit": 10,
65
- "total": 100
66
- }
67
- }
68
- ```
69
-
70
- ### Error Response
71
- ```json
72
- {
73
- "success": false,
74
- "error": {
75
- "code": "VALIDATION_ERROR",
76
- "message": "Invalid input data",
77
- "details": [
78
- {
79
- "field": "email",
80
- "message": "Invalid email format"
81
- }
82
- ]
83
- }
84
- }
85
- ```
86
-
87
- ## Authentication Patterns
88
-
89
- ### JWT Authentication
90
- ```typescript
91
- // Login endpoint
92
- POST /auth/login
93
- {
94
- "email": "user@example.com",
95
- "password": "password123"
96
- }
97
-
98
- // Response
99
- {
100
- "success": true,
101
- "data": {
102
- "accessToken": "eyJhbGciOiJIUzI1NiIs...",
103
- "refreshToken": "eyJhbGciOiJIUzI1NiIs...",
104
- "expiresIn": 3600
105
- }
106
- }
107
-
108
- // Protected endpoint
109
- GET /users
110
- Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
111
- ```
112
-
113
- ### API Key Authentication
114
- ```
115
- GET /api/resources
116
- X-API-Key: your-api-key-here
117
- ```
118
-
119
- ## Pagination Patterns
120
-
121
- ### Offset Pagination
122
- ```
123
- GET /users?page=1&limit=20
124
-
125
- Response:
126
- {
127
- "data": [...],
128
- "meta": {
129
- "page": 1,
130
- "limit": 20,
131
- "total": 100,
132
- "totalPages": 5
133
- }
134
- }
135
- ```
136
-
137
- ### Cursor Pagination
138
- ```
139
- GET /users?cursor=xyz&limit=20
140
-
141
- Response:
142
- {
143
- "data": [...],
144
- "meta": {
145
- "nextCursor": "abc",
146
- "hasMore": true
147
- }
148
- }
149
- ```
150
-
151
- ## Filtering & Sorting
152
-
153
- ```
154
- GET /users?role=admin&status=active&sort=-created_at,name
155
-
156
- // Multiple filters (OR)
157
- GET /users?role=admin,moderator
158
-
159
- // Range filters
160
- GET /orders?created_at[gte]=2024-01-01&created_at[lte]=2024-12-31
161
-
162
- // Full-text search
163
- GET /products?q=laptop&category=electronics
164
- ```
165
-
166
- ## Validation Patterns
167
-
168
- ### Input Validation
169
- ```typescript
170
- // Using Zod
171
- const createUserSchema = z.object({
172
- email: z.string().email(),
173
- password: z.string().min(8),
174
- name: z.string().min(1).max(100),
175
- age: z.number().int().min(0).optional()
176
- });
177
-
178
- // Middleware
179
- app.post('/users', validate(createUserSchema), createUserHandler);
180
- ```
181
-
182
- ## Rate Limiting
183
- ```
184
- Headers:
185
- X-RateLimit-Limit: 100
186
- X-RateLimit-Remaining: 95
187
- X-RateLimit-Reset: 1640995200
188
- ```
189
-
190
- ## API Versioning
191
-
192
- ### URL Versioning
193
- ```
194
- /api/v1/users
195
- /api/v2/users
196
- ```
197
-
198
- ### Header Versioning
199
- ```
200
- Accept: application/vnd.api+json;version=1
201
- ```
202
-
203
- ## Best Practices
204
-
205
- ### 1. Idempotency
206
- ```
207
- Idempotency-Key: unique-key-for-request
208
- ```
209
-
210
- ### 2. Caching Headers
211
- ```
212
- Cache-Control: max-age=3600
213
- ETag: "abc123"
214
- Last-Modified: Wed, 21 Oct 2024 07:28:00 GMT
215
- ```
216
-
217
- ### 3. Request IDs
218
- ```
219
- X-Request-ID: uuid-for-tracing
220
- ```
221
-
222
- ### 4. Documentation
223
- - Use OpenAPI/Swagger
224
- - Include examples
225
- - Document error cases
226
-
227
- ## Security Checklist
228
- - [ ] HTTPS only
229
- - [ ] Input validation
230
- - [ ] Authentication on protected routes
231
- - [ ] Authorization checks
232
- - [ ] Rate limiting
233
- - [ ] CORS configuration
234
- - [ ] Security headers
235
- - [ ] SQL injection prevention
236
- - [ ] XSS protection
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
+ ```
@@ -0,0 +1,41 @@
1
+ # GraphQL Principles
2
+
3
+ > Flexible queries for complex, interconnected data.
4
+
5
+ ## When to Use
6
+
7
+ ```
8
+ ✅ Good fit:
9
+ ├── Complex, interconnected data
10
+ ├── Multiple frontend platforms
11
+ ├── Clients need flexible queries
12
+ ├── Evolving data requirements
13
+ └── Reducing over-fetching matters
14
+
15
+ ❌ Poor fit:
16
+ ├── Simple CRUD operations
17
+ ├── File upload heavy
18
+ ├── HTTP caching important
19
+ └── Team unfamiliar with GraphQL
20
+ ```
21
+
22
+ ## Schema Design Principles
23
+
24
+ ```
25
+ Principles:
26
+ ├── Think in graphs, not endpoints
27
+ ├── Design for evolvability (no versions)
28
+ ├── Use connections for pagination
29
+ ├── Be specific with types (not generic "data")
30
+ └── Handle nullability thoughtfully
31
+ ```
32
+
33
+ ## Security Considerations
34
+
35
+ ```
36
+ Protect against:
37
+ ├── Query depth attacks → Set max depth
38
+ ├── Query complexity → Calculate cost
39
+ ├── Batching abuse → Limit batch size
40
+ ├── Introspection → Disable in production
41
+ ```
@@ -0,0 +1,31 @@
1
+ # Rate Limiting Principles
2
+
3
+ > Protect your API from abuse and overload.
4
+
5
+ ## Why Rate Limit
6
+
7
+ ```
8
+ Protect against:
9
+ ├── Brute force attacks
10
+ ├── Resource exhaustion
11
+ ├── Cost overruns (if pay-per-use)
12
+ └── Unfair usage
13
+ ```
14
+
15
+ ## Strategy Selection
16
+
17
+ | Type | How | When |
18
+ |------|-----|------|
19
+ | **Token bucket** | Burst allowed, refills over time | Most APIs |
20
+ | **Sliding window** | Smooth distribution | Strict limits |
21
+ | **Fixed window** | Simple counters per window | Basic needs |
22
+
23
+ ## Response Headers
24
+
25
+ ```
26
+ Include in headers:
27
+ ├── X-RateLimit-Limit (max requests)
28
+ ├── X-RateLimit-Remaining (requests left)
29
+ ├── X-RateLimit-Reset (when limit resets)
30
+ └── Return 429 when exceeded
31
+ ```
@@ -0,0 +1,37 @@
1
+ # Response Format Principles
2
+
3
+ > Consistency is key - choose a format and stick to it.
4
+
5
+ ## Common Patterns
6
+
7
+ ```
8
+ Choose one:
9
+ ├── Envelope pattern ({ success, data, error })
10
+ ├── Direct data (just return the resource)
11
+ └── HAL/JSON:API (hypermedia)
12
+ ```
13
+
14
+ ## Error Response
15
+
16
+ ```
17
+ Include:
18
+ ├── Error code (for programmatic handling)
19
+ ├── User message (for display)
20
+ ├── Details (for debugging, field-level errors)
21
+ ├── Request ID (for support)
22
+ └── NOT internal details (security!)
23
+ ```
24
+
25
+ ## Pagination Types
26
+
27
+ | Type | Best For | Trade-offs |
28
+ |------|----------|------------|
29
+ | **Offset** | Simple, jumpable | Performance on large datasets |
30
+ | **Cursor** | Large datasets | Can't jump to page |
31
+ | **Keyset** | Performance critical | Requires sortable key |
32
+
33
+ ### Selection Questions
34
+
35
+ 1. How large is the dataset?
36
+ 2. Do users need to jump to specific pages?
37
+ 3. Is data frequently changing?
@@ -0,0 +1,40 @@
1
+ # REST Principles
2
+
3
+ > Resource-based API design - nouns not verbs.
4
+
5
+ ## Resource Naming Rules
6
+
7
+ ```
8
+ Principles:
9
+ ├── Use NOUNS, not verbs (resources, not actions)
10
+ ├── Use PLURAL forms (/users not /user)
11
+ ├── Use lowercase with hyphens (/user-profiles)
12
+ ├── Nest for relationships (/users/123/posts)
13
+ └── Keep shallow (max 3 levels deep)
14
+ ```
15
+
16
+ ## HTTP Method Selection
17
+
18
+ | Method | Purpose | Idempotent? | Body? |
19
+ |--------|---------|-------------|-------|
20
+ | **GET** | Read resource(s) | Yes | No |
21
+ | **POST** | Create new resource | No | Yes |
22
+ | **PUT** | Replace entire resource | Yes | Yes |
23
+ | **PATCH** | Partial update | No | Yes |
24
+ | **DELETE** | Remove resource | Yes | No |
25
+
26
+ ## Status Code Selection
27
+
28
+ | Situation | Code | Why |
29
+ |-----------|------|-----|
30
+ | Success (read) | 200 | Standard success |
31
+ | Created | 201 | New resource created |
32
+ | No content | 204 | Success, nothing to return |
33
+ | Bad request | 400 | Malformed request |
34
+ | Unauthorized | 401 | Missing/invalid auth |
35
+ | Forbidden | 403 | Valid auth, no permission |
36
+ | Not found | 404 | Resource doesn't exist |
37
+ | Conflict | 409 | State conflict (duplicate) |
38
+ | Validation error | 422 | Valid syntax, invalid data |
39
+ | Rate limited | 429 | Too many requests |
40
+ | Server error | 500 | Our fault |