@mr.dj2u/knowledge 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/content/checklists/ship-test-loop.md +16 -0
  2. package/dist/content/checklists/unified-agent-bundle-validation.md +8 -0
  3. package/dist/content/examples/ship-test-loop.md +13 -0
  4. package/dist/content/examples/unified-agent-bundle-bootstrap.md +8 -0
  5. package/dist/content/guides/animation-performance.md +30 -0
  6. package/dist/content/guides/post-create-onboarding.md +113 -0
  7. package/dist/content/patterns/api/api-routes.md +314 -0
  8. package/dist/content/patterns/api/error-handling.md +311 -0
  9. package/dist/content/patterns/database/drizzle-schema.md +280 -0
  10. package/dist/content/patterns/database/migrations.md +365 -0
  11. package/dist/content/patterns/database/query-organization.md +537 -0
  12. package/dist/content/patterns/database/relations.md +450 -0
  13. package/dist/content/patterns/deployment/build-configuration.md +452 -0
  14. package/dist/content/patterns/deployment/ci-cd-patterns.md +448 -0
  15. package/dist/content/patterns/deployment/environment-config.md +380 -0
  16. package/dist/content/patterns/deployment/hosting-setup.md +425 -0
  17. package/dist/content/patterns/project/configuration-patterns.md +459 -0
  18. package/dist/content/patterns/project/documentation-org.md +506 -0
  19. package/dist/content/patterns/project/folder-structure.md +398 -0
  20. package/dist/content/patterns/project/library-exports.md +465 -0
  21. package/dist/content/patterns/project/monorepo-structure.md +500 -0
  22. package/dist/content/patterns/routing/dynamic-routes.md +221 -0
  23. package/dist/content/patterns/routing/file-based-routing.md +186 -0
  24. package/dist/content/patterns/routing/route-groups.md +429 -0
  25. package/dist/content/patterns/state/persistence-middleware.md +521 -0
  26. package/dist/content/patterns/state/selector-hooks.md +538 -0
  27. package/dist/content/patterns/state/store-organization.md +539 -0
  28. package/dist/content/patterns/state/zustand-patterns.md +348 -0
  29. package/dist/content/patterns/styling/component-styling.md +468 -0
  30. package/dist/content/patterns/styling/responsive-patterns.md +398 -0
  31. package/dist/content/patterns/styling/theme-configuration.md +426 -0
  32. package/dist/content/patterns/styling/uniwind-setup.md +412 -0
  33. package/dist/content/prompts/continue-development.md +27 -0
  34. package/dist/content/prompts/create-expo-super-stack.md +29 -0
  35. package/dist/content/prompts/fix-seo.md +29 -0
  36. package/dist/content/prompts/onboard-new-expo-app.md +11 -0
  37. package/dist/content/prompts/prepare-deploy.md +29 -0
  38. package/dist/content/prompts/project-research-plan.md +29 -0
  39. package/dist/content/prompts/review-expo-project.md +29 -0
  40. package/dist/content/prompts/run-doctor.md +30 -0
  41. package/dist/content/prompts/ship-test-loop.md +24 -0
  42. package/dist/content/reference/create-expo-stack-uniwind.md +29 -0
  43. package/dist/content/reference/doctor-dogfood.md +42 -0
  44. package/dist/content/reference/mcp-sdk-transport.md +30 -0
  45. package/dist/content/reference/package-ci-patterns.md +24 -0
  46. package/dist/content/reference/reference-repo-evacuation.md +31 -0
  47. package/dist/content/resource-index.json +67 -0
  48. package/dist/content/rules/app-folder-architecture.md +13 -0
  49. package/dist/content/rules/env-hygiene.md +9 -0
  50. package/dist/content/rules/seo-metadata.md +7 -0
  51. package/dist/content/rules/ssr-safety.md +9 -0
  52. package/dist/content/skills/api-routes.md +33 -0
  53. package/dist/content/skills/continue-development.md +31 -0
  54. package/dist/content/skills/debugging.md +31 -0
  55. package/dist/content/skills/deployment.md +32 -0
  56. package/dist/content/skills/dev-server-management.md +31 -0
  57. package/dist/content/skills/env-vars.md +32 -0
  58. package/dist/content/skills/expo-router-architecture.md +33 -0
  59. package/dist/content/skills/expo-ssr-safety.md +32 -0
  60. package/dist/content/skills/plugin-creation.md +41 -0
  61. package/dist/content/skills/production-server-patterns.md +31 -0
  62. package/dist/content/skills/project-onboarding.md +31 -0
  63. package/dist/content/skills/research-plan-intake.md +31 -0
  64. package/dist/content/skills/seo-metadata.md +31 -0
  65. package/dist/content/skills/super-stack-startup.md +31 -0
  66. package/dist/content/skills/uniwind-theming.md +32 -0
  67. package/dist/index.d.ts +46 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +369 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/patterns/index.d.ts +78 -0
  72. package/dist/patterns/index.d.ts.map +1 -0
  73. package/dist/patterns/index.js +264 -0
  74. package/dist/patterns/index.js.map +1 -0
  75. package/dist/prompts/index.d.ts +35 -0
  76. package/dist/prompts/index.d.ts.map +1 -0
  77. package/dist/prompts/index.js +270 -0
  78. package/dist/prompts/index.js.map +1 -0
  79. package/dist/skills/index.d.ts +3 -0
  80. package/dist/skills/index.d.ts.map +1 -0
  81. package/dist/skills/index.js +2 -0
  82. package/dist/skills/index.js.map +1 -0
  83. package/package.json +50 -0
@@ -0,0 +1,506 @@
1
+ # Documentation Organization Pattern
2
+
3
+ ## Description
4
+
5
+ Documentation organization establishes consistent structure for project metadata, guides, and architectural decisions. This pattern uses structured markdown files in dedicated `project/` directories alongside inline code documentation to keep knowledge accessible and maintainable.
6
+
7
+ ## MDS Project Memory Update
8
+
9
+ New MDS onboarding uses four project memory files:
10
+
11
+ - `project/info.md` for product intent and context.
12
+ - `project/todo.md` for roadmap and next work.
13
+ - `project/style.md` for visual/design direction only.
14
+ - `project/guidelines.md` for technical rules, agent behavior, workflow, and architecture.
15
+
16
+ Generated agent instructions should treat the `project/` folder as the source of
17
+ truth and should not make changes that conflict with those files.
18
+
19
+ ## When to Use
20
+
21
+ **Organize documentation when:**
22
+ - ✅ Starting a new project
23
+ - ✅ Scaling team from solo to multiple developers
24
+ - ✅ Recording architectural decisions
25
+ - ✅ Documenting API endpoints and conventions
26
+ - ✅ Creating onboarding guides
27
+ - ✅ Maintaining style guides and design systems
28
+
29
+ ## Core Concepts
30
+
31
+ **Documentation Tiers:**
32
+ ```
33
+ 1. Project Metadata (project/info.md)
34
+ ├── Purpose, stack, status
35
+ └── Quick reference
36
+
37
+ 2. Architecture Docs (project/architecture.md, copilot-instructions.md)
38
+ ├── System design
39
+ ├── Tech decisions
40
+ └── Patterns used
41
+
42
+ 3. Style & Standards (project/style.md)
43
+ ├── Code style
44
+ ├── Naming conventions
45
+ └── Best practices
46
+
47
+ 4. Roadmap (project/todo.md)
48
+ ├── Features
49
+ ├── Bugs
50
+ └── Improvements
51
+
52
+ 5. Inline Code Comments
53
+ ├── Complex logic
54
+ ├── Why decisions
55
+ └── Usage examples
56
+ ```
57
+
58
+ ## Code Examples
59
+
60
+ ### Project Info File (project/info.md)
61
+
62
+ ```markdown
63
+ # DJsPortfolio - Project Information
64
+
65
+ ## Overview
66
+ Personal portfolio and project showcase for David J Grimsley.
67
+
68
+ ## Core Stack
69
+ - **Framework**: Expo SDK 55 + React Native 0.83
70
+ - **Routing**: Expo Router (file-based)
71
+ - **Styling**: Uniwind v1.2.6 + Tailwind v4
72
+ - **State**: Zustand (atomic stores)
73
+ - **Database**: Supabase (PostgreSQL) + Drizzle ORM
74
+ - **Deployment**: Plesk VPS + EAS Build
75
+ - **Platforms**: iOS, Android, Web
76
+
77
+ ## Project Status
78
+ - Phase: Active Development
79
+ - Last Updated: 2025-01-15
80
+ - Team Size: 1 (solo)
81
+ - Production: Yes (davidjgrimsley.com)
82
+
83
+ ## Getting Started
84
+ ```bash
85
+ pnpm install
86
+ pnpm dev
87
+ ```
88
+
89
+ ## Key Features
90
+ - Portfolio showcase with projects
91
+ - Contact form integration
92
+ - Blog section
93
+ - Dark mode support
94
+ - PWA support (offline-capable)
95
+
96
+ ## Important Files
97
+ - `app.json` - Expo config
98
+ - `global.css` - Theme definitions
99
+ - `src/app/` - Routing structure
100
+ - `src/store/` - State management
101
+
102
+ ## Team Contacts
103
+ - David J Grimsley (solo dev)
104
+ - Email: contact@davidjgrimsley.com
105
+
106
+ ## Resources
107
+ - Production: https://davidjgrimsley.com
108
+ - Repository: https://github.com/DavidJGrimsley/DavidsPortfolio
109
+ - Issues: [GitHub Issues]
110
+ ```
111
+
112
+ ### Style Guide File (project/style.md)
113
+
114
+ ```markdown
115
+ # DJsPortfolio - Style Guide
116
+
117
+ ## Code Style
118
+
119
+ ### TypeScript
120
+ - **Strict Mode**: Enabled
121
+ - **Line Length**: 100 characters
122
+ - **Imports**: Organized by: external → internal → types
123
+ - **Naming**: camelCase for variables/functions, PascalCase for components/classes
124
+
125
+ ### React Components
126
+ ```typescript
127
+ // Functional components with TypeScript
128
+ interface ComponentProps {
129
+ title: string;
130
+ onPress: () => void;
131
+ children?: ReactNode;
132
+ }
133
+
134
+ export function MyComponent({ title, onPress, children }: ComponentProps) {
135
+ return <View>{/* ... */}</View>;
136
+ }
137
+ ```
138
+
139
+ ### State Management
140
+ - Use Zustand for global state
141
+ - One store per domain (authStore, postStore, etc.)
142
+ - Use selectors to prevent re-renders
143
+ - Persist cross-platform data to AsyncStorage
144
+
145
+ ### Styling
146
+ - Use `className` (Uniwind) for layout/spacing
147
+ - Use `style={{}}` only for dynamic values
148
+ - No CSS-in-JS or StyleSheet.create()
149
+ - Define colors in `src/constants/theme.ts`
150
+
151
+ ### Error Handling
152
+ ```typescript
153
+ try {
154
+ const result = await api.call();
155
+ } catch (error) {
156
+ console.error('Context:', error);
157
+ setError(error.message);
158
+ }
159
+ ```
160
+
161
+ ## File Organization
162
+
163
+ ### Component Structure
164
+ ```
165
+ components/
166
+ ├── Button/
167
+ │ ├── Button.tsx # Implementation
168
+ │ ├── Button.stories.tsx # Storybook (if used)
169
+ │ └── index.ts # Export
170
+ ```
171
+
172
+ ### Feature Structure
173
+ ```
174
+ features/auth/
175
+ ├── hooks/
176
+ ├── services/
177
+ ├── store.ts
178
+ ├── types.ts
179
+ └── index.ts
180
+ ```
181
+
182
+ ## Naming Conventions
183
+
184
+ ### Files
185
+ - Routes: lowercase (`profile.tsx`, `[id].tsx`)
186
+ - Components: PascalCase (`Button.tsx`, `UserCard.tsx`)
187
+ - Utilities: camelCase (`formatting.ts`, `validators.ts`)
188
+ - Types: PascalCase in files (`types.ts`, `User` interface)
189
+
190
+ ### Variables
191
+ - Constants: UPPER_SNAKE_CASE (`API_URL`, `MAX_RETRIES`)
192
+ - Variables: camelCase (`userName`, `isLoading`)
193
+ - Classes: PascalCase (`UserService`, `AuthProvider`)
194
+
195
+ ### Functions
196
+ - Hooks: camelCase prefixed with `use` (`useAuth()`, `useForm()`)
197
+ - Handlers: camelCase prefixed with `handle` (`handlePress()`, `handleChange()`)
198
+ - Async: descriptive name (`fetchUsers()`, `createPost()`)
199
+
200
+ ## Git Workflow
201
+
202
+ ### Branch Naming
203
+ - Feature: `feature/description` → PR → merge to develop
204
+ - Fix: `fix/description` → PR → merge to develop
205
+ - Release: `release/version` → PR → merge to main + develop
206
+
207
+ ### Commit Messages
208
+ ```
209
+ feat: add user authentication
210
+ fix: resolve navigation bug
211
+ docs: update README
212
+ style: format code
213
+ perf: optimize list rendering
214
+ ```
215
+
216
+ ## Documentation
217
+
218
+ ### Comments in Code
219
+ - Explain WHY, not WHAT
220
+ - Use for complex logic only
221
+ - Keep updated with code changes
222
+
223
+ ```typescript
224
+ // ✅ Good - explains intent
225
+ // Retry with exponential backoff to handle transient failures
226
+ const retryWithBackoff = (fn, maxAttempts) => { ... };
227
+
228
+ // ❌ Bad - just describes code
229
+ // Loop through items
230
+ items.forEach(item => { ... });
231
+ ```
232
+
233
+ ### JSDoc for Public APIs
234
+ ```typescript
235
+ /**
236
+ * Fetch posts for a user
237
+ * @param userId - The user ID to fetch posts for
238
+ * @param limit - Maximum number of posts to return (default: 10)
239
+ * @returns Array of posts or error
240
+ */
241
+ export async function getUserPosts(
242
+ userId: string,
243
+ limit: number = 10
244
+ ): Promise<Post[]> {
245
+ // ...
246
+ }
247
+ ```
248
+
249
+ ## Design System
250
+
251
+ ### Colors
252
+ Use semantic naming:
253
+ ```typescript
254
+ colors: {
255
+ primary: '#007AFF', // Main action color
256
+ secondary: '#5AC8FA', // Secondary action
257
+ success: '#34C759', // Success state
258
+ error: '#FF3B30', // Error state
259
+ warning: '#FF9500', // Warning state
260
+ }
261
+ ```
262
+
263
+ ### Spacing Scale
264
+ ```typescript
265
+ spacing: {
266
+ xs: 4, // Small gaps
267
+ sm: 8, // Component internal spacing
268
+ md: 16, // Section spacing
269
+ lg: 24, // Page spacing
270
+ xl: 32, // Large sections
271
+ }
272
+ ```
273
+
274
+ ### Typography
275
+ ```typescript
276
+ typography: {
277
+ h1: { size: 32, weight: 700 }, // Page title
278
+ h2: { size: 24, weight: 700 }, // Section title
279
+ body: { size: 16, weight: 400 }, // Body text
280
+ small: { size: 14, weight: 400 }, // Meta text
281
+ }
282
+ ```
283
+ ```
284
+
285
+ ### Architecture Decisions (project/architecture.md)
286
+
287
+ ```markdown
288
+ # DJsPortfolio - Architecture Decisions
289
+
290
+ ## ADR-001: State Management
291
+ **Decision**: Use Zustand for global state
292
+
293
+ **Rationale**:
294
+ - Minimal boilerplate vs Redux
295
+ - Atomic subscriptions prevent re-renders
296
+ - Built-in persistence middleware
297
+ - TypeScript-first design
298
+
299
+ **Alternatives Considered**:
300
+ - Redux: Too verbose for small team
301
+ - Context API: Performance concerns at scale
302
+
303
+ ## ADR-002: Styling Approach
304
+ **Decision**: Uniwind (Tailwind v4) + CSS Variables for theming
305
+
306
+ **Rationale**:
307
+ - Familiar Tailwind syntax
308
+ - Cross-platform (native + web)
309
+ - CSS Variables support light/dark mode
310
+ - Build-time optimization
311
+
312
+ **Migration Path**:
313
+ - From NativeWind v4 to Uniwind (Q1 2025)
314
+
315
+ ## ADR-003: Database
316
+ **Decision**: Supabase (PostgreSQL) + Drizzle ORM
317
+
318
+ **Rationale**:
319
+ - Type-safe query building
320
+ - Auto-generated migrations
321
+ - Row-level security (RLS)
322
+ - Automatic schema inference
323
+
324
+ **Limitations**:
325
+ - PostgreSQL only (no other databases)
326
+ - Schema must be defined in Drizzle
327
+
328
+ ## ADR-004: API Design
329
+ **Decision**: RESTful API with clear versioning
330
+
331
+ **Rationale**:
332
+ - Simple, familiar conventions
333
+ - Easy to test and document
334
+ - Versioning allows breaking changes
335
+
336
+ **Endpoints**:
337
+ ```
338
+ GET /api/v1/posts
339
+ POST /api/v1/posts
340
+ GET /api/v1/posts/:id
341
+ PUT /api/v1/posts/:id
342
+ DELETE /api/v1/posts/:id
343
+ ```
344
+
345
+ ## ADR-005: Deployment
346
+ **Decision**: Plesk VPS + EAS Build
347
+
348
+ **Rationale**:
349
+ - Full control over server
350
+ - nginx reverse proxy
351
+ - SSL/TLS management
352
+ - EAS handles app store builds
353
+
354
+ **Current Infrastructure**:
355
+ - Primary: davidjgrimsley.com (Plesk)
356
+ - Static exports: Web build
357
+ - API Server: Node.js on port 3000
358
+ ```
359
+
360
+ ### Roadmap File (project/todo.md)
361
+
362
+ ```markdown
363
+ # DJsPortfolio - Roadmap & TODO
364
+
365
+ ## Current Quarter (Q1 2025)
366
+ - [ ] Migrate from NativeWind to Uniwind
367
+ - [ ] Add blog system (Markdown-based)
368
+ - [ ] Implement analytics (privacy-respecting)
369
+ - [ ] Add dark mode toggle (currently auto)
370
+
371
+ ## Backlog - High Priority
372
+ - [ ] Add search functionality
373
+ - [ ] Implement offline support (PWA)
374
+ - [ ] Add AI chat for portfolio questions
375
+ - [ ] Create reusable component library
376
+
377
+ ## Backlog - Medium Priority
378
+ - [ ] Add internationalization (i18n)
379
+ - [ ] Create admin dashboard
380
+ - [ ] Add form validation improvements
381
+ - [ ] Implement caching strategy
382
+
383
+ ## Backlog - Low Priority
384
+ - [ ] Add animations (micro-interactions)
385
+ - [ ] Create design system docs
386
+ - [ ] Add performance monitoring
387
+ - [ ] Create CI/CD dashboard
388
+
389
+ ## Known Issues
390
+ - [ ] Mobile landscape orientation needs adjustment
391
+ - [ ] Some animations jank on older devices
392
+ - [ ] Form validation messages need i18n
393
+
394
+ ## Completed ✅
395
+ - ✅ Initial portfolio setup (v1)
396
+ - ✅ Dark mode support
397
+ - ✅ Mobile optimization
398
+ - ✅ SSL/TLS setup
399
+ - ✅ Contact form integration
400
+ ```
401
+
402
+ ### GitHub-Specific Instructions (copilot-instructions.md)
403
+
404
+ ```markdown
405
+ # Copilot Instructions
406
+
407
+ When working on this repository, follow these guidelines:
408
+
409
+ ## Architecture
410
+ - See [project/architecture.md](./project/architecture.md)
411
+
412
+ ## Component Style
413
+ - Functional React components with TypeScript
414
+ - Props interface required
415
+ - Use Uniwind for styling
416
+ - Prefer Pressable over TouchableOpacity
417
+
418
+ ## State Management
419
+ - Zustand for global state
420
+ - One store per domain
421
+ - Use selectors for derived state
422
+
423
+ ## File Organization
424
+ - Routes in src/app/
425
+ - Components in src/components/
426
+ - Business logic in src/features/
427
+ - Types in src/types/
428
+
429
+ ## Common Tasks
430
+
431
+ ### Adding a New Feature
432
+ 1. Create feature folder: `src/features/feature-name/`
433
+ 2. Add types: `src/features/feature-name/types.ts`
434
+ 3. Add hooks: `src/features/feature-name/hooks/`
435
+ 4. Add services: `src/features/feature-name/services/`
436
+ 5. Create store: `src/features/feature-name/store.ts`
437
+ 6. Export barrel: `src/features/feature-name/index.ts`
438
+
439
+ ### Adding a New Screen
440
+ 1. Create route in `src/app/feature/screen.tsx`
441
+ 2. Create component in `src/components/screens/ScreenComponent.tsx`
442
+ 3. Import component in route file
443
+ 4. Update navigation if needed
444
+
445
+ ### Testing Changes
446
+ ```bash
447
+ pnpm dev # Start dev server
448
+ pnpm lint # Check lint
449
+ pnpm typecheck # Check types
450
+ ```
451
+ ```
452
+
453
+ ## Documentation Best Practices
454
+
455
+ ### ✅ DO
456
+
457
+ 1. **Keep docs close to code**
458
+ ```
459
+ src/features/auth/
460
+ ├── README.md # Feature-specific docs
461
+ ├── types.ts
462
+ └── hooks/
463
+ ```
464
+
465
+ 2. **Use clear file names**
466
+ ```
467
+ ✅ info.md, style.md, todo.md
468
+ ❌ meta.md, guide.md, work.md
469
+ ```
470
+
471
+ 3. **Update docs with code changes**
472
+ ```markdown
473
+ # When you change API
474
+ Update: src/services/api.ts AND project/architecture.md
475
+ ```
476
+
477
+ ### ❌ DON'T
478
+
479
+ 1. **Don't let docs become stale**
480
+ ```markdown
481
+ ❌ "Last updated: 2023-01-01"
482
+ ✅ Link to relevant code files
483
+ ```
484
+
485
+ 2. **Don't duplicate information**
486
+ ```markdown
487
+ ❌ Copy-paste into multiple files
488
+ ✅ Link to single source of truth
489
+ ```
490
+
491
+ 3. **Don't ignore documentation**
492
+ ```markdown
493
+ ❌ "Will document later"
494
+ ✅ Write docs as you code
495
+ ```
496
+
497
+ ## Related Patterns
498
+
499
+ - [Folder Structure](./folder-structure.md) — Project layout
500
+ - [Configuration Patterns](./configuration-patterns.md) — Config files
501
+ - [Library Exports](./library-exports.md) — Package exports
502
+
503
+ ---
504
+
505
+ *Pattern extracted from production repositories: DJsPortfolio, not-hot-dog*
506
+ *Examples: project/info.md, project/style.md, copilot-instructions.md*