@neyugn/agent-kits 0.5.0 → 0.5.3
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/README.md +66 -81
- package/README.vi.md +79 -52
- package/README.zh.md +69 -88
- package/common/skills/filter-agent/SKILL.md +33 -45
- package/common/skills/filter-skill/SKILL.md +51 -73
- package/common/skills/scan-techstack/SKILL.md +30 -36
- package/dist/cli.js +85 -0
- package/kits/coder/agents/ai-engineer.md +27 -39
- package/kits/coder/agents/backend-specialist.md +31 -45
- package/kits/coder/agents/cloud-architect.md +31 -45
- package/kits/coder/agents/code-reviewer.md +45 -67
- package/kits/coder/agents/data-engineer.md +22 -32
- package/kits/coder/agents/database-specialist.md +30 -44
- package/kits/coder/agents/debugger.md +28 -42
- package/kits/coder/agents/devops-engineer.md +35 -53
- package/kits/coder/agents/documentation-writer.md +48 -68
- package/kits/coder/agents/frontend-specialist.md +30 -46
- package/kits/coder/agents/i18n-specialist.md +37 -51
- package/kits/coder/agents/integration-specialist.md +38 -54
- package/kits/coder/agents/mobile-developer.md +37 -53
- package/kits/coder/agents/multi-tenant-architect.md +25 -37
- package/kits/coder/agents/orchestrator.md +20 -32
- package/kits/coder/agents/performance-analyst.md +43 -65
- package/kits/coder/agents/project-planner.md +25 -39
- package/kits/coder/agents/queue-specialist.md +26 -38
- package/kits/coder/agents/realtime-specialist.md +44 -64
- package/kits/coder/agents/security-auditor.md +44 -64
- package/kits/coder/agents/test-engineer.md +30 -44
- package/kits/coder/agents/ux-researcher.md +26 -38
- package/kits/coder/rules/sections/classifier.md +11 -7
- package/kits/coder/rules/sections/code.md +5 -4
- package/kits/coder/skills/accessibility-patterns/SKILL.md +67 -81
- package/kits/coder/skills/ai-rag-patterns/SKILL.md +27 -23
- package/kits/coder/skills/api-patterns/SKILL.md +40 -43
- package/kits/coder/skills/auth-patterns/SKILL.md +47 -51
- package/kits/coder/skills/aws-patterns/SKILL.md +52 -57
- package/kits/coder/skills/brainstorming/SKILL.md +26 -23
- package/kits/coder/skills/clean-code/SKILL.md +74 -90
- package/kits/coder/skills/database-design/SKILL.md +32 -31
- package/kits/coder/skills/docker-patterns/SKILL.md +46 -49
- package/kits/coder/skills/documentation-templates/SKILL.md +21 -13
- package/kits/coder/skills/e2e-testing/SKILL.md +52 -58
- package/kits/coder/skills/flutter-patterns/SKILL.md +44 -46
- package/kits/coder/skills/frontend-design/SKILL.md +28 -24
- package/kits/coder/skills/github-actions/SKILL.md +43 -45
- package/kits/coder/skills/gitlab-ci-patterns/SKILL.md +35 -33
- package/kits/coder/skills/graphql-patterns/SKILL.md +35 -33
- package/kits/coder/skills/i18n-localization/SKILL.md +37 -35
- package/kits/coder/skills/kubernetes-patterns/SKILL.md +35 -33
- package/kits/coder/skills/mermaid-diagrams/SKILL.md +54 -60
- package/kits/coder/skills/mobile-design/SKILL.md +51 -61
- package/kits/coder/skills/monitoring-observability/SKILL.md +32 -30
- package/kits/coder/skills/multi-tenancy/SKILL.md +16 -8
- package/kits/coder/skills/nodejs-best-practices/SKILL.md +19 -14
- package/kits/coder/skills/performance-profiling/SKILL.md +31 -29
- package/kits/coder/skills/plan-writing/SKILL.md +52 -59
- package/kits/coder/skills/postgres-patterns/SKILL.md +39 -39
- package/kits/coder/skills/prompt-engineering/SKILL.md +40 -42
- package/kits/coder/skills/queue-patterns/SKILL.md +22 -16
- package/kits/coder/skills/react-native-patterns/SKILL.md +35 -33
- package/kits/coder/skills/react-patterns/SKILL.md +46 -52
- package/kits/coder/skills/realtime-patterns/SKILL.md +44 -46
- package/kits/coder/skills/redis-patterns/SKILL.md +35 -33
- package/kits/coder/skills/security-fundamentals/SKILL.md +45 -46
- package/kits/coder/skills/seo-patterns/SKILL.md +56 -62
- package/kits/coder/skills/systematic-debugging/SKILL.md +38 -39
- package/kits/coder/skills/tailwind-patterns/SKILL.md +21 -13
- package/kits/coder/skills/terraform-patterns/SKILL.md +53 -57
- package/kits/coder/skills/testing-patterns/SKILL.md +42 -47
- package/kits/coder/skills/typescript-patterns/SKILL.md +54 -68
- package/kits/coder/skills/ui-ux-pro-max/SKILL.md +362 -364
- package/package.json +1 -1
|
@@ -6,7 +6,16 @@ allowed-tools: Read, Write, Edit
|
|
|
6
6
|
|
|
7
7
|
# Plan Writing - Structured Task Decomposition
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## ⚡ Quick Reference
|
|
10
|
+
|
|
11
|
+
- **4 phases**: Analysis (no code) → Planning (task file) → [User Approval] → Implementation
|
|
12
|
+
- **Plan format**: task slug `.md` · Each task: Agent · Skills · Priority · Dependencies · INPUT/OUTPUT/VERIFY
|
|
13
|
+
- **Never code during planning**: Plan = thinking only · Implement only after approval
|
|
14
|
+
- **Task assignment**: 1 task = 1 agent · 1 owner · explicit dependency chain
|
|
15
|
+
- **File naming**: `{kebab-case-feature}.md` · e.g., `dark-mode.md`, `auth-system.md`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
10
19
|
|
|
11
20
|
---
|
|
12
21
|
|
|
@@ -73,13 +82,11 @@ Level 4: Subtasks (If task is still too large)
|
|
|
73
82
|
|
|
74
83
|
### Good Task Characteristics
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| **Sized correctly** | 15 min to 4 hours |
|
|
82
|
-
| **Named clearly** | Action verb + object (e.g., "Create user schema") |
|
|
85
|
+
- **Observable**: Has visible output when complete
|
|
86
|
+
- **Verifiable**: Clear criteria to confirm done
|
|
87
|
+
- **Independent**: Minimal dependencies blocking start
|
|
88
|
+
- **Sized correctly**: 15 min to 4 hours
|
|
89
|
+
- **Named clearly**: Action verb + object (e.g., "Create user schema")
|
|
83
90
|
|
|
84
91
|
---
|
|
85
92
|
|
|
@@ -192,12 +199,10 @@ Before estimating, consider:
|
|
|
192
199
|
|
|
193
200
|
### Common Estimation Mistakes
|
|
194
201
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
| "I know this codebase" | Context switching overhead |
|
|
200
|
-
| "Simple fix" | Regression testing |
|
|
202
|
+
- "Just wire things together": Integration complexity
|
|
203
|
+
- "Tests are quick": Edge cases and debugging tests
|
|
204
|
+
- "I know this codebase": Context switching overhead
|
|
205
|
+
- "Simple fix": Regression testing
|
|
201
206
|
|
|
202
207
|
---
|
|
203
208
|
|
|
@@ -249,12 +254,10 @@ A task is DONE when:
|
|
|
249
254
|
|
|
250
255
|
### Writing Good Verification Criteria
|
|
251
256
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
| "Integrated" | "API called successfully from frontend" |
|
|
257
|
-
| "Complete" | "All checklist items verified" |
|
|
257
|
+
- "Works correctly": "Returns 200 for valid input, 400 for invalid"
|
|
258
|
+
- "Tested": "Unit tests cover happy path + 3 error cases"
|
|
259
|
+
- "Integrated": "API called successfully from frontend"
|
|
260
|
+
- "Complete": "All checklist items verified"
|
|
258
261
|
|
|
259
262
|
---
|
|
260
263
|
|
|
@@ -262,36 +265,30 @@ A task is DONE when:
|
|
|
262
265
|
|
|
263
266
|
### When to Update Plan
|
|
264
267
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
| New information | Update risks/decisions log |
|
|
271
|
-
| End of work session | Mark current progress |
|
|
268
|
+
- Task completed: Check off, add to progress log
|
|
269
|
+
- Blocker discovered: Add to dependencies, update status
|
|
270
|
+
- Scope change: Revise tasks, re-estimate
|
|
271
|
+
- New information: Update risks/decisions log
|
|
272
|
+
- End of work session: Mark current progress
|
|
272
273
|
|
|
273
274
|
### Plan Review Frequency
|
|
274
275
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
| 1-3 days | Daily |
|
|
279
|
-
| > 3 days | Daily + weekly deep review |
|
|
276
|
+
- < 1 day: Start and end
|
|
277
|
+
- 1-3 days: Daily
|
|
278
|
+
- > 3 days: Daily + weekly deep review
|
|
280
279
|
|
|
281
280
|
---
|
|
282
281
|
|
|
283
282
|
## 🚨 Anti-Patterns
|
|
284
283
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
| Plan replaces communication | Plan supplements communication |
|
|
294
|
-
| Over-plan simple work | Use judgment on when plans add value |
|
|
284
|
+
- Giant monolithic tasks: Break into 15min-4hr chunks
|
|
285
|
+
- "It depends on everything": Map only true blocking dependencies
|
|
286
|
+
- Estimate without buffers: Apply confidence multiplier
|
|
287
|
+
- Skip verification criteria: Define "done" for every task
|
|
288
|
+
- Never update the plan: Update as you learn
|
|
289
|
+
- Plan at wrong granularity: Match plan detail to project size
|
|
290
|
+
- Plan replaces communication: Plan supplements communication
|
|
291
|
+
- Over-plan simple work: Use judgment on when plans add value
|
|
295
292
|
|
|
296
293
|
---
|
|
297
294
|
|
|
@@ -299,17 +296,15 @@ A task is DONE when:
|
|
|
299
296
|
|
|
300
297
|
### Good Task Names
|
|
301
298
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
| `Test [component]` | Test payment processing edge cases |
|
|
312
|
-
| `Document [topic]` | Document API authentication flow |
|
|
299
|
+
- `Create [thing]`: Create user authentication schema
|
|
300
|
+
- `Implement [feature]`: Implement password reset flow
|
|
301
|
+
- `Update [existing]`: Update API error handling
|
|
302
|
+
- `Add [capability]`: Add email validation to signup
|
|
303
|
+
- `Remove [deprecated]`: Remove legacy auth endpoints
|
|
304
|
+
- `Fix [issue]`: Fix timezone conversion bug
|
|
305
|
+
- `Migrate [from → to]`: Migrate users table to new schema
|
|
306
|
+
- `Test [component]`: Test payment processing edge cases
|
|
307
|
+
- `Document [topic]`: Document API authentication flow
|
|
313
308
|
|
|
314
309
|
---
|
|
315
310
|
|
|
@@ -348,12 +343,10 @@ Before starting implementation:
|
|
|
348
343
|
|
|
349
344
|
## 🔗 Related Skills
|
|
350
345
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
| Clean implementation | `clean-code` |
|
|
356
|
-
| API task breakdown | `api-patterns` |
|
|
346
|
+
- Discovery before planning: `brainstorming`
|
|
347
|
+
- Debugging with structure: `systematic-debugging`
|
|
348
|
+
- Clean implementation: `clean-code`
|
|
349
|
+
- API task breakdown: `api-patterns`
|
|
357
350
|
|
|
358
351
|
---
|
|
359
352
|
|
|
@@ -7,20 +7,28 @@ version: 2.0
|
|
|
7
7
|
|
|
8
8
|
# PostgreSQL Patterns - Advanced Optimization
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## ⚡ Quick Reference
|
|
11
|
+
|
|
12
|
+
- **EXPLAIN**: `EXPLAIN ANALYZE` for slow queries · Seq Scan on large tables = add index · `Index Scan` = optimal
|
|
13
|
+
- **Indexes**: B-tree (default) · GIN (JSON/full-text) · BRIN (time-series) · Composite: leftmost column rule
|
|
14
|
+
- **RLS**: `ALTER TABLE t ENABLE ROW LEVEL SECURITY` · Policy per tenant via `current_setting('app.tenant_id')`
|
|
15
|
+
- **Transactions**: Use explicit `BEGIN/COMMIT` for multi-statement · `FOR UPDATE` for pessimistic locking
|
|
16
|
+
- **JSON**: `jsonb` not `json` · Index with GIN · `->` for key · `->>` for text value
|
|
17
|
+
- **Performance**: Connection pooling (PgBouncer) · `VACUUM ANALYZE` periodically · Partial indexes for filtered queries
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
11
21
|
|
|
12
22
|
---
|
|
13
23
|
|
|
14
24
|
## When to Use This Skill
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| PostgreSQL-specific data types | Basic normalization concepts |
|
|
23
|
-
| JSONB, arrays, range types | N+1 query patterns (use ORM) |
|
|
26
|
+
- PostgreSQL schema design: Database-agnostic design
|
|
27
|
+
- Query optimization with EXPLAIN: Choosing between databases
|
|
28
|
+
- Row-Level Security (RLS): ORM selection
|
|
29
|
+
- Partitioning strategies: Non-PostgreSQL databases
|
|
30
|
+
- PostgreSQL-specific data types: Basic normalization concepts
|
|
31
|
+
- JSONB, arrays, range types: N+1 query patterns (use ORM)
|
|
24
32
|
|
|
25
33
|
➡️ For general database concepts, see `database-design` skill.
|
|
26
34
|
|
|
@@ -157,14 +165,12 @@ SELECT * FROM orders WHERE user_id = 123;
|
|
|
157
165
|
|
|
158
166
|
### Common Optimizations
|
|
159
167
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
| LIKE '%pattern%' | pg_trgm extension + GIN index |
|
|
167
|
-
| Cross-table queries | Covering index with INCLUDE |
|
|
168
|
+
- Seq Scan on filtered col: Add index on WHERE columns
|
|
169
|
+
- Slow ORDER BY: Index matches ORDER BY columns
|
|
170
|
+
- Low selectivity: Partial index on common filter
|
|
171
|
+
- JSONB field queries: Extract to generated column + B-tree
|
|
172
|
+
- LIKE '%pattern%': pg_trgm extension + GIN index
|
|
173
|
+
- Cross-table queries: Covering index with INCLUDE
|
|
168
174
|
|
|
169
175
|
### Join Optimization
|
|
170
176
|
|
|
@@ -206,12 +212,10 @@ ALTER TABLE documents FORCE ROW LEVEL SECURITY;
|
|
|
206
212
|
|
|
207
213
|
### When to Partition
|
|
208
214
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
| Data lifecycle | Retention policy |
|
|
214
|
-
| Maintenance | Bulk deletes |
|
|
215
|
+
- Table size: > 100M rows
|
|
216
|
+
- Query filter: Always on date
|
|
217
|
+
- Data lifecycle: Retention policy
|
|
218
|
+
- Maintenance: Bulk deletes
|
|
215
219
|
|
|
216
220
|
### Partition Types
|
|
217
221
|
|
|
@@ -334,27 +338,23 @@ Before production:
|
|
|
334
338
|
|
|
335
339
|
## Anti-Patterns
|
|
336
340
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
| Store arrays for relations | Use junction tables |
|
|
346
|
-
| Mixed-case identifiers | snake_case (unquoted) |
|
|
341
|
+
- Use TIMESTAMP without TZ: Use TIMESTAMPTZ
|
|
342
|
+
- VARCHAR(n) for variable text: TEXT with CHECK constraints
|
|
343
|
+
- SERIAL for IDs: BIGINT GENERATED ALWAYS AS IDENTITY
|
|
344
|
+
- JSON type: JSONB (indexable, smaller)
|
|
345
|
+
- Index every column: Index query patterns
|
|
346
|
+
- Ignore EXPLAIN output: Analyze before optimizing
|
|
347
|
+
- Store arrays for relations: Use junction tables
|
|
348
|
+
- Mixed-case identifiers: snake_case (unquoted)
|
|
347
349
|
|
|
348
350
|
---
|
|
349
351
|
|
|
350
352
|
## Related Skills
|
|
351
353
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
| Query performance | `performance-profiling` |
|
|
357
|
-
| Security patterns | `security-fundamentals` |
|
|
354
|
+
- General DB design: `database-design`
|
|
355
|
+
- API integration: `api-patterns`
|
|
356
|
+
- Query performance: `performance-profiling`
|
|
357
|
+
- Security patterns: `security-fundamentals`
|
|
358
358
|
|
|
359
359
|
---
|
|
360
360
|
|
|
@@ -8,19 +8,27 @@ priority: CRITICAL
|
|
|
8
8
|
|
|
9
9
|
# Prompt Engineering - AI Communication Excellence
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## ⚡ Quick Reference
|
|
12
|
+
|
|
13
|
+
- **Structure**: Role → Task → Format → Constraints → Examples → Output format
|
|
14
|
+
- **Be specific**: Vague prompt = vague output · specify length, format, tone, audience
|
|
15
|
+
- **Chain of Thought**: "Think step by step" for complex reasoning · "First, list..." for structured output
|
|
16
|
+
- **Few-shot**: 2-5 examples beats 1000-word description · Show don't tell
|
|
17
|
+
- **Iteration**: Start simple → add constraints → refine · Save effective prompts as templates
|
|
18
|
+
- **System prompt**: Set persona + rules + format once · User message = task only
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
12
22
|
|
|
13
23
|
---
|
|
14
24
|
|
|
15
25
|
## Core Principles
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| **Iterative** | Start simple, add complexity only when needed |
|
|
23
|
-
| **Versioned** | Treat prompts as code with proper version control |
|
|
27
|
+
- **Specific**: Ambiguity causes inconsistent outputs
|
|
28
|
+
- **Structured**: Clear sections: Context → Task → Format → Examples
|
|
29
|
+
- **Testable**: Evaluate on diverse inputs, measure consistency
|
|
30
|
+
- **Iterative**: Start simple, add complexity only when needed
|
|
31
|
+
- **Versioned**: Treat prompts as code with proper version control
|
|
24
32
|
|
|
25
33
|
---
|
|
26
34
|
|
|
@@ -65,12 +73,10 @@ You are a senior backend engineer specializing in API design.
|
|
|
65
73
|
|
|
66
74
|
### 1. Few-Shot Learning
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
| Edge case handling | Include edge cases |
|
|
73
|
-
| Simple tasks | 0-1 examples |
|
|
76
|
+
- Consistent formatting: 2-3 examples
|
|
77
|
+
- Complex reasoning patterns: 3-5 examples
|
|
78
|
+
- Edge case handling: Include edge cases
|
|
79
|
+
- Simple tasks: 0-1 examples
|
|
74
80
|
|
|
75
81
|
```markdown
|
|
76
82
|
Extract key information:
|
|
@@ -182,11 +188,9 @@ If uncertain:
|
|
|
182
188
|
|
|
183
189
|
### Token Efficiency
|
|
184
190
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
| Repeating context in every message | System prompt for stable context |
|
|
189
|
-
| 10 examples when 3 suffice | Minimal effective examples |
|
|
191
|
+
- Long verbose instructions: Concise, direct commands
|
|
192
|
+
- Repeating context in every message: System prompt for stable context
|
|
193
|
+
- 10 examples when 3 suffice: Minimal effective examples
|
|
190
194
|
|
|
191
195
|
---
|
|
192
196
|
|
|
@@ -215,15 +219,13 @@ Task complexity?
|
|
|
215
219
|
|
|
216
220
|
## Anti-Patterns (DON'T)
|
|
217
221
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
| Same prompt for all tasks | Task-specific optimized prompts |
|
|
226
|
-
| No version control | Git-track prompts like code |
|
|
222
|
+
- Vague instructions: Specific, measurable requirements
|
|
223
|
+
- Complex prompt from start: Start simple, iterate
|
|
224
|
+
- Examples that don't match task: Representative, diverse examples
|
|
225
|
+
- No output format specified: Clear format expectations
|
|
226
|
+
- Ignoring edge cases: Test on boundary inputs
|
|
227
|
+
- Same prompt for all tasks: Task-specific optimized prompts
|
|
228
|
+
- No version control: Git-track prompts like code
|
|
227
229
|
|
|
228
230
|
---
|
|
229
231
|
|
|
@@ -252,25 +254,21 @@ Task complexity?
|
|
|
252
254
|
|
|
253
255
|
## 🔴 Self-Check Before Completing
|
|
254
256
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
| ✅ **Optimized?** | Minimal tokens, maximum clarity? |
|
|
262
|
-
| ✅ **Error handling?** | Handles uncertain/edge cases? |
|
|
257
|
+
- ✅ **Specific?**: No ambiguous instructions?
|
|
258
|
+
- ✅ **Structured?**: Role → Task → Format → Examples?
|
|
259
|
+
- ✅ **Tested?**: Evaluated on diverse inputs?
|
|
260
|
+
- ✅ **Versioned?**: Prompt tracked in version control?
|
|
261
|
+
- ✅ **Optimized?**: Minimal tokens, maximum clarity?
|
|
262
|
+
- ✅ **Error handling?**: Handles uncertain/edge cases?
|
|
263
263
|
|
|
264
264
|
---
|
|
265
265
|
|
|
266
266
|
## Related Skills
|
|
267
267
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
| AI application patterns | `ai-patterns` (future) |
|
|
273
|
-
| User communication | `brainstorming` |
|
|
268
|
+
- Agent design: `agent-creator` (future)
|
|
269
|
+
- Skill creation: `skill-creator` (future)
|
|
270
|
+
- AI application patterns: `ai-patterns` (future)
|
|
271
|
+
- User communication: `brainstorming`
|
|
274
272
|
|
|
275
273
|
---
|
|
276
274
|
|
|
@@ -7,7 +7,17 @@ tags: [architecture, queue, jobs, async, reliability]
|
|
|
7
7
|
|
|
8
8
|
# Queue Patterns - Background Job Processing Skill
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## ⚡ Quick Reference
|
|
11
|
+
|
|
12
|
+
- **System selection**: Node.js → BullMQ · Python → Celery · Serverless → SQS · Multi-lang → RabbitMQ · Streaming → Kafka
|
|
13
|
+
- **Job design**: Small payload (IDs only) · Idempotency key · Include tenant_id/correlation_id · Set timeout
|
|
14
|
+
- **Retry**: Exponential backoff · Max 3-5 attempts · Dead Letter Queue after max retries · DLQ monitored
|
|
15
|
+
- **Idempotency**: Running same job 2x = same result · Check before write · Deduplication key
|
|
16
|
+
- **Concurrency**: Bounded limits · Rate limit external API calls · Separate queues by priority (fast/normal/bulk)
|
|
17
|
+
- **Monitoring**: Queue depth · Processing time · DLQ count · Stalled jobs alerts
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
11
21
|
|
|
12
22
|
---
|
|
13
23
|
|
|
@@ -27,13 +37,11 @@ tags: [architecture, queue, jobs, async, reliability]
|
|
|
27
37
|
|
|
28
38
|
> **"A queue is a promise: jobs go in, results come out, nothing is lost."**
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| **Observability Mandatory** | Every job traceable from start to end |
|
|
36
|
-
| **Fail Closed** | Unknown errors → retry, not ignore |
|
|
40
|
+
- **Jobs Are Sacred**: Every job must complete, fail explicitly, or move to DLQ
|
|
41
|
+
- **Idempotency by Design**: Same job running twice = same outcome
|
|
42
|
+
- **Reliability Over Speed**: Slow and correct beats fast and lossy
|
|
43
|
+
- **Observability Mandatory**: Every job traceable from start to end
|
|
44
|
+
- **Fail Closed**: Unknown errors → retry, not ignore
|
|
37
45
|
|
|
38
46
|
---
|
|
39
47
|
|
|
@@ -169,14 +177,12 @@ WAITING → ACTIVE → COMPLETED
|
|
|
169
177
|
|
|
170
178
|
### Queue Architecture Decisions
|
|
171
179
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| Large batch processing | Parent-child jobs (chunking) |
|
|
179
|
-
| Multi-tenant isolation | Queue per tenant OR tenant prefix |
|
|
180
|
+
- Fast priority jobs: Separate priority queue
|
|
181
|
+
- Delayed execution: Scheduled jobs with `delay`
|
|
182
|
+
- Rate limiting external API: Limiter group in BullMQ
|
|
183
|
+
- Strict ordering: FIFO with job grouping
|
|
184
|
+
- Large batch processing: Parent-child jobs (chunking)
|
|
185
|
+
- Multi-tenant isolation: Queue per tenant OR tenant prefix
|
|
180
186
|
|
|
181
187
|
### Concurrency Patterns
|
|
182
188
|
|
|
@@ -8,19 +8,27 @@ priority: MEDIUM
|
|
|
8
8
|
|
|
9
9
|
# React Native Patterns - Mobile Excellence with Expo
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## ⚡ Quick Reference
|
|
12
|
+
|
|
13
|
+
- **Framework**: Expo managed → EAS Build → Bare (native modules only)
|
|
14
|
+
- **Lists**: `FlatList`/`FlashList` not `ScrollView` for long lists · `keyExtractor` required
|
|
15
|
+
- **State**: Local → useState · Global → Zustand/Jotai · Server → React Query
|
|
16
|
+
- **Navigation**: expo-router (file-based) or @react-navigation · Always wrap in `NavigationContainer`
|
|
17
|
+
- **Performance**: Reanimated for 60fps animations · `memo` + `useCallback` · `InteractionManager` for heavy ops
|
|
18
|
+
- **Native**: MMKV for fast storage · expo-secure-store for secrets · Test on physical device always
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
12
22
|
|
|
13
23
|
---
|
|
14
24
|
|
|
15
25
|
## 🎯 Core Principles
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| **Performance** | FlashList, memoization, native thread animations |
|
|
23
|
-
| **Type Safe** | TypeScript is mandatory |
|
|
27
|
+
- **Expo First**: Start with Expo, eject only when absolutely necessary
|
|
28
|
+
- **Platform Aware**: One codebase, platform-specific polish
|
|
29
|
+
- **Offline Ready**: Assume network is unreliable
|
|
30
|
+
- **Performance**: FlashList, memoization, native thread animations
|
|
31
|
+
- **Type Safe**: TypeScript is mandatory
|
|
24
32
|
|
|
25
33
|
```
|
|
26
34
|
❌ WRONG: Bare React Native for simple apps
|
|
@@ -352,41 +360,35 @@ eas update --branch production --message "Bug fixes"
|
|
|
352
360
|
|
|
353
361
|
## 🚨 Anti-Patterns
|
|
354
362
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
| Animate on JS thread | Use Reanimated for native animations |
|
|
364
|
-
| Forget offline handling | Implement offline-first |
|
|
363
|
+
- Use FlatList for large lists: Use FlashList
|
|
364
|
+
- Inline styles: Use StyleSheet.create
|
|
365
|
+
- Fetch in render: Use useEffect or React Query
|
|
366
|
+
- Ignore platform differences: Test on both iOS and Android
|
|
367
|
+
- Store secrets in code: Use environment variables
|
|
368
|
+
- Skip error boundaries: Handle crashes gracefully
|
|
369
|
+
- Animate on JS thread: Use Reanimated for native animations
|
|
370
|
+
- Forget offline handling: Implement offline-first
|
|
365
371
|
|
|
366
372
|
---
|
|
367
373
|
|
|
368
374
|
## ✅ Self-Check Before Completing
|
|
369
375
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
| ✅ **Secure?** | Tokens in SecureStore, not AsyncStorage? |
|
|
378
|
-
| ✅ **Navigation?** | Expo Router properly configured? |
|
|
376
|
+
- ✅ **Expo?**: Using Expo unless specifically required?
|
|
377
|
+
- ✅ **TypeScript?**: Full type coverage?
|
|
378
|
+
- ✅ **Offline?**: Handles offline state gracefully?
|
|
379
|
+
- ✅ **Platform?**: Tested on both iOS and Android?
|
|
380
|
+
- ✅ **Performance?**: FlashList, memoization, Reanimated?
|
|
381
|
+
- ✅ **Secure?**: Tokens in SecureStore, not AsyncStorage?
|
|
382
|
+
- ✅ **Navigation?**: Expo Router properly configured?
|
|
379
383
|
|
|
380
384
|
---
|
|
381
385
|
|
|
382
386
|
## 🔗 Related Skills
|
|
383
387
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
| React patterns | `react-patterns` |
|
|
389
|
-
| Testing | `testing-patterns` |
|
|
388
|
+
- Flutter comparison: `flutter-patterns`
|
|
389
|
+
- Mobile design: `mobile-design`
|
|
390
|
+
- React patterns: `react-patterns`
|
|
391
|
+
- Testing: `testing-patterns`
|
|
390
392
|
|
|
391
393
|
---
|
|
392
394
|
|