@mr.dj2u/knowledge 0.1.6 → 0.1.8

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 (74) hide show
  1. package/dist/content/checklists/push-merge-loop.md +17 -17
  2. package/dist/content/checklists/unified-agent-bundle-validation.md +9 -9
  3. package/dist/content/examples/push-merge-loop.md +14 -14
  4. package/dist/content/examples/unified-agent-bundle-bootstrap.md +8 -8
  5. package/dist/content/guides/animation-performance.md +31 -1
  6. package/dist/content/guides/post-create-onboarding.md +140 -140
  7. package/dist/content/patterns/animation/animation-motion-selection.md +155 -0
  8. package/dist/content/patterns/api/api-routes.md +313 -313
  9. package/dist/content/patterns/api/error-handling.md +310 -310
  10. package/dist/content/patterns/database/drizzle-schema.md +279 -279
  11. package/dist/content/patterns/database/migrations.md +364 -364
  12. package/dist/content/patterns/database/query-organization.md +536 -536
  13. package/dist/content/patterns/database/relations.md +449 -449
  14. package/dist/content/patterns/deployment/build-configuration.md +440 -440
  15. package/dist/content/patterns/deployment/ci-cd-patterns.md +447 -447
  16. package/dist/content/patterns/deployment/environment-config.md +379 -379
  17. package/dist/content/patterns/deployment/hosting-setup.md +424 -424
  18. package/dist/content/patterns/project/configuration-patterns.md +459 -459
  19. package/dist/content/patterns/project/documentation-org.md +506 -506
  20. package/dist/content/patterns/project/folder-structure.md +397 -397
  21. package/dist/content/patterns/project/library-exports.md +464 -464
  22. package/dist/content/patterns/project/monorepo-structure.md +500 -500
  23. package/dist/content/patterns/routing/dynamic-routes.md +220 -220
  24. package/dist/content/patterns/routing/file-based-routing.md +185 -185
  25. package/dist/content/patterns/routing/route-groups.md +428 -428
  26. package/dist/content/patterns/state/persistence-middleware.md +520 -520
  27. package/dist/content/patterns/state/selector-hooks.md +537 -537
  28. package/dist/content/patterns/state/store-organization.md +538 -538
  29. package/dist/content/patterns/state/zustand-patterns.md +347 -347
  30. package/dist/content/patterns/styling/component-styling.md +467 -467
  31. package/dist/content/patterns/styling/responsive-patterns.md +397 -397
  32. package/dist/content/patterns/styling/theme-configuration.md +425 -425
  33. package/dist/content/patterns/styling/uniwind-setup.md +411 -411
  34. package/dist/content/prompts/continue-development.md +35 -35
  35. package/dist/content/prompts/fix-seo.md +29 -29
  36. package/dist/content/prompts/onboard-new-expo-app.md +11 -11
  37. package/dist/content/prompts/prepare-deploy.md +29 -29
  38. package/dist/content/prompts/project-research-plan.md +29 -29
  39. package/dist/content/prompts/push-merge-loop.md +25 -25
  40. package/dist/content/prompts/review-expo-project.md +29 -29
  41. package/dist/content/prompts/review-motion.md +58 -0
  42. package/dist/content/prompts/run-doctor.md +38 -38
  43. package/dist/content/prompts/wrap-up.md +67 -67
  44. package/dist/content/reference/create-expo-stack-uniwind.md +29 -29
  45. package/dist/content/reference/mcp-sdk-transport.md +30 -30
  46. package/dist/content/reference/reference-repo-evacuation.md +31 -31
  47. package/dist/content/resource-index.json +3 -0
  48. package/dist/content/skills/animation-motion.md +68 -0
  49. package/dist/content/skills/api-routes.md +33 -33
  50. package/dist/content/skills/continue-development.md +32 -32
  51. package/dist/content/skills/debugging.md +32 -32
  52. package/dist/content/skills/deployment.md +32 -32
  53. package/dist/content/skills/dev-server-management.md +32 -32
  54. package/dist/content/skills/env-vars.md +32 -32
  55. package/dist/content/skills/expo-router-architecture.md +33 -33
  56. package/dist/content/skills/expo-ssr-safety.md +32 -32
  57. package/dist/content/skills/plugin-creation.md +41 -41
  58. package/dist/content/skills/production-server-patterns.md +31 -31
  59. package/dist/content/skills/project-onboarding.md +31 -31
  60. package/dist/content/skills/research-plan-intake.md +32 -32
  61. package/dist/content/skills/seo-metadata.md +31 -31
  62. package/dist/content/skills/super-stack-startup.md +34 -34
  63. package/dist/content/skills/uniwind-theming.md +32 -32
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +27 -1
  66. package/dist/index.js.map +1 -1
  67. package/dist/patterns/index.d.ts +9 -1
  68. package/dist/patterns/index.d.ts.map +1 -1
  69. package/dist/patterns/index.js +17 -0
  70. package/dist/patterns/index.js.map +1 -1
  71. package/dist/prompts/index.d.ts.map +1 -1
  72. package/dist/prompts/index.js +17 -0
  73. package/dist/prompts/index.js.map +1 -1
  74. package/package.json +6 -1
@@ -1,221 +1,221 @@
1
- # Dynamic Routes with Parameters
2
-
3
- ## Description
4
-
5
- Dynamic routes capture URL parameters using bracket syntax `[param].tsx` in Expo Router. Parameters are extracted via `useLocalSearchParams()` hook with full TypeScript support. This enables parameterized pages for lists (detail views, user profiles, etc.) while maintaining type safety.
6
-
7
- ## When to Use
8
-
9
- **Use dynamic routes** for:
10
- - ✅ Detail pages from lists (`/events/123`, `/user/alice`)
11
- - ✅ Nested hierarchies (`/guides/PLZA/strategies/15`)
12
- - ✅ Optional parameters with catch-all routes (`[...slug]`)
13
- - ✅ Single or multiple dynamic segments
14
-
15
- ## Code Example
16
-
17
- ### Single Dynamic Segment
18
-
19
- ```typescript
20
- // File: app/events/[id].tsx
21
- import { useLocalSearchParams } from 'expo-router';
22
- import { EventDetailScreen } from '@/components/EventDetailScreen';
23
-
24
- export default function EventDetailRoute() {
25
- const { id } = useLocalSearchParams<{ id: string }>();
26
-
27
- if (!id) {
28
- return <ErrorScreen message="Event ID is required" />;
29
- }
30
-
31
- return <EventDetailScreen eventId={id} />;
32
- }
33
-
34
- // Navigation
35
- import { router } from 'expo-router';
36
- router.push(`/events/${eventId}`);
37
- router.push({
38
- pathname: '/events/[id]',
39
- params: { id: eventId },
40
- });
41
- ```
42
-
43
- **From:** PokePages/src/app/(drawer)/events/[event].tsx
44
-
45
- ### Multiple Dynamic Segments
46
-
47
- ```typescript
48
- // File: app/guides/[region]/[guide].tsx
49
- import { useLocalSearchParams } from 'expo-router';
50
-
51
- export default function GuideDetailRoute() {
52
- const { region, guide } = useLocalSearchParams<{
53
- region: string;
54
- guide: string;
55
- }>();
56
-
57
- return (
58
- <GuideDetailScreen
59
- region={region}
60
- guide={guide}
61
- />
62
- );
63
- }
64
-
65
- // Usage
66
- router.push({
67
- pathname: '/guides/[region]/[guide]',
68
- params: { region: 'PLZA', guide: 'elite-four' },
69
- });
70
- // Results in: /guides/PLZA/elite-four
71
- ```
72
-
73
- **From:** PokePages/src/app/(drawer)/guides/PLZA/strategies/[id].tsx pattern
74
-
75
- ### Catch-All Routes (Variable Segments)
76
-
77
- ```typescript
78
- // File: app/docs/[...slug].tsx
79
- import { useLocalSearchParams } from 'expo-router';
80
-
81
- export default function DocsRoute() {
82
- const { slug } = useLocalSearchParams<{ slug: string[] }>();
83
- // slug is an array: ['api', 'reference', 'functions']
84
-
85
- return (
86
- <DocsScreen
87
- path={slug?.join('/') || ''}
88
- breadcrumbs={slug}
89
- />
90
- );
91
- }
92
-
93
- // Navigation
94
- router.push('/docs/api/reference/functions');
95
- // slug becomes: ['api', 'reference', 'functions']
96
- ```
97
-
98
- **From:** Expo Router conventions, applicable to content-heavy hierarchies
99
-
100
- ## Configuration
101
-
102
- ### TypeScript Setup for Type-Safe Params
103
-
104
- ```typescript
105
- // Define param types for each route
106
- type EventDetailParams = {
107
- id: string;
108
- };
109
-
110
- type GuideDetailParams = {
111
- region: string;
112
- guide: string;
113
- };
114
-
115
- // In route file
116
- const { id } = useLocalSearchParams<EventDetailParams>();
117
- ```
118
-
119
- ### Query Parameters (Search Strings)
120
-
121
- ```typescript
122
- // Navigation with query params
123
- router.push({
124
- pathname: '/search',
125
- params: {
126
- q: 'pikachu',
127
- type: 'pokemon',
128
- generation: '1'
129
- }
130
- });
131
-
132
- // Results in: /search?q=pikachu&type=pokemon&generation=1
133
-
134
- // In route
135
- const { q, type, generation } = useLocalSearchParams<{
136
- q?: string;
137
- type?: string;
138
- generation?: string;
139
- }>();
140
- ```
141
-
142
- ## Best Practices
143
-
144
- ### ✅ DO
145
-
146
- 1. **Type your params** for IDE autocomplete and type checking
147
- ```typescript
148
- const { id } = useLocalSearchParams<{ id: string }>();
149
- // TypeScript knows id is string
150
- ```
151
-
152
- 2. **Handle missing params** with validation
153
- ```typescript
154
- const { id } = useLocalSearchParams<{ id: string }>();
155
-
156
- if (!id) {
157
- return <ErrorScreen />;
158
- }
159
-
160
- // Safe to use id here
161
- ```
162
-
163
- 3. **Use descriptive param names**
164
- ```
165
- ✅ [userId].tsx
166
- ✅ [eventId].tsx
167
- ❌ [id].tsx (too generic)
168
- ```
169
-
170
- 4. **Nest dynamic routes** for logical hierarchies
171
- ```
172
- guides/
173
- ├── [region]/
174
- │ ├── [guide].tsx → /guides/:region/:guide
175
- ```
176
-
177
- 5. **Use catch-all for documentation or content hierarchies**
178
- ```
179
- docs/[...slug].tsx → /docs/api/reference/functions
180
- ```
181
-
182
- ### ❌ DON'T
183
-
184
- 1. **Don't mix route parameters and query parameters unnecessarily**
185
- ```typescript
186
- // ❌ AVOID
187
- /events/123?id=456&eventId=789
188
-
189
- // ✅ BETTER - use route params
190
- /events/123
191
- ```
192
-
193
- 2. **Don't rely on optional params without defaults**
194
- ```typescript
195
- // ❌ RISKY
196
- const { id } = useLocalSearchParams<{ id: string }>();
197
- return <EventDetail id={id} />; // Could be undefined
198
-
199
- // ✅ SAFE
200
- const { id } = useLocalSearchParams<{ id?: string }>();
201
- if (!id) return <ErrorScreen />;
202
- return <EventDetail id={id} />;
203
- ```
204
-
205
- 3. **Don't create overly deep param nesting** without cause
206
- ```
207
- ❌ /app/[userId]/posts/[postId]/comments/[commentId]/likes/[likeId]
208
- ✅ /posts/[postId] with comment data in store/props
209
- ```
210
-
211
- ## Related Patterns
212
-
213
- - [File-Based Routing](./file-based-routing.md) — Route file structure
214
- - [Route Groups](./route-groups.md) — Organizing routes hierarchically
215
- - [Navigation Patterns](./navigation-patterns.md) — router.push, Link components
216
- - [API Routes](./api-routes.md) — Dynamic API endpoints
217
-
218
- ---
219
-
220
- *Pattern extracted from production repositories: PokePages, not-hot-dog, Expo Router documentation*
1
+ # Dynamic Routes with Parameters
2
+
3
+ ## Description
4
+
5
+ Dynamic routes capture URL parameters using bracket syntax `[param].tsx` in Expo Router. Parameters are extracted via `useLocalSearchParams()` hook with full TypeScript support. This enables parameterized pages for lists (detail views, user profiles, etc.) while maintaining type safety.
6
+
7
+ ## When to Use
8
+
9
+ **Use dynamic routes** for:
10
+ - ✅ Detail pages from lists (`/events/123`, `/user/alice`)
11
+ - ✅ Nested hierarchies (`/guides/PLZA/strategies/15`)
12
+ - ✅ Optional parameters with catch-all routes (`[...slug]`)
13
+ - ✅ Single or multiple dynamic segments
14
+
15
+ ## Code Example
16
+
17
+ ### Single Dynamic Segment
18
+
19
+ ```typescript
20
+ // File: app/events/[id].tsx
21
+ import { useLocalSearchParams } from 'expo-router';
22
+ import { EventDetailScreen } from '@/components/EventDetailScreen';
23
+
24
+ export default function EventDetailRoute() {
25
+ const { id } = useLocalSearchParams<{ id: string }>();
26
+
27
+ if (!id) {
28
+ return <ErrorScreen message="Event ID is required" />;
29
+ }
30
+
31
+ return <EventDetailScreen eventId={id} />;
32
+ }
33
+
34
+ // Navigation
35
+ import { router } from 'expo-router';
36
+ router.push(`/events/${eventId}`);
37
+ router.push({
38
+ pathname: '/events/[id]',
39
+ params: { id: eventId },
40
+ });
41
+ ```
42
+
43
+ **From:** PokePages/src/app/(drawer)/events/[event].tsx
44
+
45
+ ### Multiple Dynamic Segments
46
+
47
+ ```typescript
48
+ // File: app/guides/[region]/[guide].tsx
49
+ import { useLocalSearchParams } from 'expo-router';
50
+
51
+ export default function GuideDetailRoute() {
52
+ const { region, guide } = useLocalSearchParams<{
53
+ region: string;
54
+ guide: string;
55
+ }>();
56
+
57
+ return (
58
+ <GuideDetailScreen
59
+ region={region}
60
+ guide={guide}
61
+ />
62
+ );
63
+ }
64
+
65
+ // Usage
66
+ router.push({
67
+ pathname: '/guides/[region]/[guide]',
68
+ params: { region: 'PLZA', guide: 'elite-four' },
69
+ });
70
+ // Results in: /guides/PLZA/elite-four
71
+ ```
72
+
73
+ **From:** PokePages/src/app/(drawer)/guides/PLZA/strategies/[id].tsx pattern
74
+
75
+ ### Catch-All Routes (Variable Segments)
76
+
77
+ ```typescript
78
+ // File: app/docs/[...slug].tsx
79
+ import { useLocalSearchParams } from 'expo-router';
80
+
81
+ export default function DocsRoute() {
82
+ const { slug } = useLocalSearchParams<{ slug: string[] }>();
83
+ // slug is an array: ['api', 'reference', 'functions']
84
+
85
+ return (
86
+ <DocsScreen
87
+ path={slug?.join('/') || ''}
88
+ breadcrumbs={slug}
89
+ />
90
+ );
91
+ }
92
+
93
+ // Navigation
94
+ router.push('/docs/api/reference/functions');
95
+ // slug becomes: ['api', 'reference', 'functions']
96
+ ```
97
+
98
+ **From:** Expo Router conventions, applicable to content-heavy hierarchies
99
+
100
+ ## Configuration
101
+
102
+ ### TypeScript Setup for Type-Safe Params
103
+
104
+ ```typescript
105
+ // Define param types for each route
106
+ type EventDetailParams = {
107
+ id: string;
108
+ };
109
+
110
+ type GuideDetailParams = {
111
+ region: string;
112
+ guide: string;
113
+ };
114
+
115
+ // In route file
116
+ const { id } = useLocalSearchParams<EventDetailParams>();
117
+ ```
118
+
119
+ ### Query Parameters (Search Strings)
120
+
121
+ ```typescript
122
+ // Navigation with query params
123
+ router.push({
124
+ pathname: '/search',
125
+ params: {
126
+ q: 'pikachu',
127
+ type: 'pokemon',
128
+ generation: '1'
129
+ }
130
+ });
131
+
132
+ // Results in: /search?q=pikachu&type=pokemon&generation=1
133
+
134
+ // In route
135
+ const { q, type, generation } = useLocalSearchParams<{
136
+ q?: string;
137
+ type?: string;
138
+ generation?: string;
139
+ }>();
140
+ ```
141
+
142
+ ## Best Practices
143
+
144
+ ### ✅ DO
145
+
146
+ 1. **Type your params** for IDE autocomplete and type checking
147
+ ```typescript
148
+ const { id } = useLocalSearchParams<{ id: string }>();
149
+ // TypeScript knows id is string
150
+ ```
151
+
152
+ 2. **Handle missing params** with validation
153
+ ```typescript
154
+ const { id } = useLocalSearchParams<{ id: string }>();
155
+
156
+ if (!id) {
157
+ return <ErrorScreen />;
158
+ }
159
+
160
+ // Safe to use id here
161
+ ```
162
+
163
+ 3. **Use descriptive param names**
164
+ ```
165
+ ✅ [userId].tsx
166
+ ✅ [eventId].tsx
167
+ ❌ [id].tsx (too generic)
168
+ ```
169
+
170
+ 4. **Nest dynamic routes** for logical hierarchies
171
+ ```
172
+ guides/
173
+ ├── [region]/
174
+ │ ├── [guide].tsx → /guides/:region/:guide
175
+ ```
176
+
177
+ 5. **Use catch-all for documentation or content hierarchies**
178
+ ```
179
+ docs/[...slug].tsx → /docs/api/reference/functions
180
+ ```
181
+
182
+ ### ❌ DON'T
183
+
184
+ 1. **Don't mix route parameters and query parameters unnecessarily**
185
+ ```typescript
186
+ // ❌ AVOID
187
+ /events/123?id=456&eventId=789
188
+
189
+ // ✅ BETTER - use route params
190
+ /events/123
191
+ ```
192
+
193
+ 2. **Don't rely on optional params without defaults**
194
+ ```typescript
195
+ // ❌ RISKY
196
+ const { id } = useLocalSearchParams<{ id: string }>();
197
+ return <EventDetail id={id} />; // Could be undefined
198
+
199
+ // ✅ SAFE
200
+ const { id } = useLocalSearchParams<{ id?: string }>();
201
+ if (!id) return <ErrorScreen />;
202
+ return <EventDetail id={id} />;
203
+ ```
204
+
205
+ 3. **Don't create overly deep param nesting** without cause
206
+ ```
207
+ ❌ /app/[userId]/posts/[postId]/comments/[commentId]/likes/[likeId]
208
+ ✅ /posts/[postId] with comment data in store/props
209
+ ```
210
+
211
+ ## Related Patterns
212
+
213
+ - [File-Based Routing](./file-based-routing.md) — Route file structure
214
+ - [Route Groups](./route-groups.md) — Organizing routes hierarchically
215
+ - [Navigation Patterns](./navigation-patterns.md) — router.push, Link components
216
+ - [API Routes](./api-routes.md) — Dynamic API endpoints
217
+
218
+ ---
219
+
220
+ *Pattern extracted from production repositories: PokePages, not-hot-dog, Expo Router documentation*
221
221
  *Implementations: PokePages/src\app\(drawer)\events\[event].tsx*