moicle 1.1.1 → 1.2.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.
@@ -0,0 +1,607 @@
1
+ ---
2
+ name: onboarding
3
+ description: Codebase onboarding workflow for understanding new projects. Use when joining a project, exploring codebase, or when user says "explain codebase", "onboard me", "new to project", "understand project", "explore codebase", "project overview".
4
+ ---
5
+
6
+ # Codebase Onboarding Workflow
7
+
8
+ Complete workflow for understanding and navigating new codebases effectively.
9
+
10
+ ## IMPORTANT: Read Architecture First
11
+
12
+ **Before analyzing the codebase, you MUST read the appropriate architecture reference:**
13
+
14
+ ### Global Architecture Files
15
+ ```
16
+ ~/.claude/architecture/
17
+ ├── clean-architecture.md # Core principles for all projects
18
+ ├── flutter-mobile.md # Flutter + Riverpod
19
+ ├── react-frontend.md # React + Vite + TypeScript
20
+ ├── go-backend.md # Go + Gin
21
+ ├── laravel-backend.md # Laravel + PHP
22
+ ├── remix-fullstack.md # Remix fullstack
23
+ └── monorepo.md # Monorepo structure
24
+ ```
25
+
26
+ ### Project-specific (if exists)
27
+ ```
28
+ .claude/architecture/ # Project overrides
29
+ ```
30
+
31
+ **Understanding the architecture first helps you grasp the codebase structure faster.**
32
+
33
+ ## Recommended Agents
34
+
35
+ | Phase | Agent | Purpose |
36
+ |-------|-------|---------|
37
+ | SCAN | `@clean-architect` | Identify architecture patterns |
38
+ | ANALYZE | `@clean-architect` | Analyze layer structure and boundaries |
39
+ | ANALYZE | `@code-reviewer` | Code quality and conventions analysis |
40
+ | ANALYZE | `@security-audit` | Security patterns review |
41
+ | EXPLAIN | `@docs-writer` | Generate documentation/explanation |
42
+ | GUIDE | `@docs-writer` | Create navigation guide |
43
+
44
+ ## Workflow Overview
45
+
46
+ ```
47
+ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
48
+ │ 1. SCAN │──▶│ 2. ANALYZE──▶│ 3. EXPLAIN──▶│ 4. GUIDE │
49
+ └──────────┘ └──────────┘ └──────────┘ └──────────┘
50
+ │ │ │ │
51
+ └──────────────┴───────────────┴──────────────┘
52
+ Comprehensive Understanding
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Phase 1: SCAN
58
+
59
+ **Goal**: Get a quick overview of project structure and tech stack
60
+
61
+ ### Actions
62
+ 1. Identify project type and stack:
63
+ ```bash
64
+ # Check package files
65
+ ls -la | grep -E "package.json|pubspec.yaml|go.mod|composer.json|requirements.txt"
66
+
67
+ # Check framework markers
68
+ ls -la | grep -E "next.config|vite.config|angular.json|remix.config"
69
+ ```
70
+
71
+ 2. **Identify and read the appropriate architecture doc** based on stack
72
+
73
+ 3. Scan directory structure:
74
+ ```bash
75
+ tree -L 2 -I 'node_modules|vendor|dist|build|.git'
76
+ # or
77
+ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g'
78
+ ```
79
+
80
+ 4. Check tech stack and dependencies:
81
+ - `package.json` (Node.js/JS)
82
+ - `pubspec.yaml` (Flutter)
83
+ - `go.mod` (Go)
84
+ - `composer.json` (PHP/Laravel)
85
+ - `requirements.txt` (Python)
86
+
87
+ 5. Look for documentation:
88
+ - README.md
89
+ - CONTRIBUTING.md
90
+ - docs/ directory
91
+ - .claude/architecture/ (project-specific)
92
+
93
+ ### Output Template
94
+ ```markdown
95
+ ## Project Scan Results
96
+
97
+ ### Stack Identification
98
+ - **Primary Language**: [JavaScript/TypeScript/Dart/Go/PHP/Python]
99
+ - **Framework**: [React/Flutter/Gin/Laravel/Django/etc]
100
+ - **Architecture Doc**: [path to applicable architecture reference]
101
+ - **Build Tool**: [Vite/Webpack/Maven/Gradle/etc]
102
+ - **Package Manager**: [npm/bun/yarn/pub/go mod/composer]
103
+
104
+ ### Directory Structure
105
+ ```
106
+ project/
107
+ ├── src/ # [description based on architecture doc]
108
+ ├── tests/ # [testing structure]
109
+ ├── config/ # [configuration]
110
+ └── docs/ # [documentation]
111
+ ```
112
+
113
+ ### Key Dependencies (Top 5)
114
+ 1. [dependency] - [purpose]
115
+ 2. [dependency] - [purpose]
116
+ 3. [dependency] - [purpose]
117
+
118
+ ### Documentation Available
119
+ - [ ] README.md
120
+ - [ ] Architecture docs (.claude/architecture/)
121
+ - [ ] API documentation
122
+ - [ ] Contributing guide
123
+ ```
124
+
125
+ ### Gate
126
+ - [ ] Stack identified
127
+ - [ ] Architecture doc read
128
+ - [ ] Directory structure mapped
129
+ - [ ] Dependencies listed
130
+
131
+ ---
132
+
133
+ ## Phase 2: ANALYZE
134
+
135
+ **Goal**: Deep dive into architecture, patterns, and conventions
136
+
137
+ ### Actions
138
+ 1. **Analyze architecture based on the reference doc**:
139
+ - Identify layers (from architecture doc)
140
+ - Find data flow patterns (from architecture doc)
141
+ - Map dependency injection patterns (from architecture doc)
142
+
143
+ 2. **Identify code patterns and conventions**:
144
+ ```bash
145
+ # Find main entry points
146
+ grep -r "main\|index\|app" --include="*.{js,ts,dart,go,php,py}"
147
+
148
+ # Find common patterns
149
+ grep -r "class\|interface\|type\|struct" --include="*.{js,ts,dart,go,php}"
150
+
151
+ # Find state management
152
+ grep -r "useState\|Provider\|Redux\|Riverpod\|Bloc" --include="*.{js,ts,dart}"
153
+ ```
154
+
155
+ 3. **Analyze configuration**:
156
+ - Environment variables (.env, .env.example)
157
+ - Config files (config/, .config/)
158
+ - Build configuration
159
+
160
+ 4. **Check testing setup**:
161
+ - Test framework (Jest, Vitest, PHPUnit, Go test)
162
+ - Test directory structure
163
+ - Coverage setup
164
+
165
+ 5. **Review code quality setup**:
166
+ - Linter configuration (.eslintrc, analysis_options.yaml)
167
+ - Formatter (prettier, gofmt, php-cs-fixer)
168
+ - Pre-commit hooks
169
+
170
+ ### Analysis Output
171
+ ```markdown
172
+ ## Architecture Analysis
173
+
174
+ ### Reference Document
175
+ **Architecture Doc**: [path]
176
+ **Pattern**: [Clean Architecture/MVVM/MVC/etc]
177
+
178
+ ### Layer Structure (from architecture doc)
179
+ 1. **[Layer 1 - e.g., Presentation]**
180
+ - Location: [directory path]
181
+ - Responsibilities: [from doc]
182
+ - Key files: [list]
183
+
184
+ 2. **[Layer 2 - e.g., Domain]**
185
+ - Location: [directory path]
186
+ - Responsibilities: [from doc]
187
+ - Key files: [list]
188
+
189
+ 3. **[Layer 3 - e.g., Data]**
190
+ - Location: [directory path]
191
+ - Responsibilities: [from doc]
192
+ - Key files: [list]
193
+
194
+ ### Data Flow (from architecture doc)
195
+ ```
196
+ [User Input] → [Presentation] → [Domain] → [Data] → [External APIs/DB]
197
+ ← ← ←
198
+ ```
199
+
200
+ ### Key Patterns Identified
201
+ - **State Management**: [pattern used]
202
+ - **Dependency Injection**: [pattern used]
203
+ - **Routing**: [pattern used]
204
+ - **API Communication**: [pattern used]
205
+ - **Error Handling**: [pattern used]
206
+
207
+ ### Naming Conventions
208
+ - **Files**: [convention - kebab-case, snake_case, PascalCase]
209
+ - **Classes**: [convention]
210
+ - **Functions**: [convention]
211
+ - **Constants**: [convention]
212
+
213
+ ### Code Quality
214
+ - **Linter**: [ESLint/Dart Analyzer/golangci-lint/etc]
215
+ - **Formatter**: [Prettier/dartfmt/gofmt/etc]
216
+ - **Testing**: [Jest/PHPUnit/Go test/etc]
217
+ - **Coverage Target**: [percentage if specified]
218
+
219
+ ### Configuration
220
+ - **Environment Variables**: [.env location and key vars]
221
+ - **Config Files**: [list important configs]
222
+ - **Build Config**: [description]
223
+ ```
224
+
225
+ ### Gate
226
+ - [ ] Architecture pattern identified (matches doc)
227
+ - [ ] Layers mapped (per architecture doc)
228
+ - [ ] Code conventions documented
229
+ - [ ] Testing setup understood
230
+
231
+ ---
232
+
233
+ ## Phase 3: EXPLAIN
234
+
235
+ **Goal**: Generate comprehensive documentation/explanation
236
+
237
+ ### Actions
238
+ 1. **Create architectural overview** following the reference doc
239
+ 2. **Document key components** in each layer
240
+ 3. **Map common workflows** (how data flows through layers)
241
+ 4. **List important files** and their purposes
242
+ 5. **Document setup process**
243
+
244
+ ### Explanation Template
245
+ ```markdown
246
+ ## Codebase Explanation
247
+
248
+ ### Project Overview
249
+ **Name**: [project name]
250
+ **Purpose**: [what it does]
251
+ **Stack**: [tech stack]
252
+ **Architecture**: [pattern - with reference to doc]
253
+
254
+ ---
255
+
256
+ ### Architecture Overview
257
+
258
+ This project follows **[architecture pattern from doc]**
259
+
260
+ #### Directory Structure Explained
261
+ ```
262
+ project/
263
+ ├── [layer1]/ # [Purpose based on architecture doc]
264
+ │ ├── [component]/ # [Specific purpose]
265
+ │ └── [component]/ # [Specific purpose]
266
+ ├── [layer2]/ # [Purpose based on architecture doc]
267
+ │ ├── [component]/ # [Specific purpose]
268
+ │ └── [component]/ # [Specific purpose]
269
+ └── [layer3]/ # [Purpose based on architecture doc]
270
+ ├── [component]/ # [Specific purpose]
271
+ └── [component]/ # [Specific purpose]
272
+ ```
273
+
274
+ ---
275
+
276
+ ### Key Components
277
+
278
+ #### 1. [Component Name]
279
+ - **Location**: [path]
280
+ - **Layer**: [which layer from architecture doc]
281
+ - **Purpose**: [what it does]
282
+ - **Key Files**:
283
+ - `[file1]` - [purpose]
284
+ - `[file2]` - [purpose]
285
+ - **Dependencies**: [what it depends on]
286
+
287
+ #### 2. [Component Name]
288
+ - **Location**: [path]
289
+ - **Layer**: [which layer from architecture doc]
290
+ - **Purpose**: [what it does]
291
+ - **Key Files**:
292
+ - `[file1]` - [purpose]
293
+ - `[file2]` - [purpose]
294
+ - **Dependencies**: [what it depends on]
295
+
296
+ (Repeat for top 5-10 components)
297
+
298
+ ---
299
+
300
+ ### Common Workflows
301
+
302
+ #### Workflow 1: [e.g., User Authentication]
303
+ ```
304
+ 1. User enters credentials in [Presentation Layer Component]
305
+ 2. [UseCase/Service] validates input
306
+ 3. [Repository/Data Source] calls API
307
+ 4. Response flows back through layers
308
+ 5. UI updates with result
309
+ ```
310
+
311
+ **Files Involved**:
312
+ - [file1] - [role]
313
+ - [file2] - [role]
314
+ - [file3] - [role]
315
+
316
+ #### Workflow 2: [e.g., Data Fetching]
317
+ ```
318
+ [Describe step by step following architecture layers]
319
+ ```
320
+
321
+ **Files Involved**:
322
+ - [file1] - [role]
323
+ - [file2] - [role]
324
+
325
+ ---
326
+
327
+ ### Important Files Reference
328
+
329
+ #### Core Files
330
+ - `[file]` - [purpose]
331
+ - `[file]` - [purpose]
332
+
333
+ #### Configuration
334
+ - `[file]` - [purpose]
335
+ - `[file]` - [purpose]
336
+
337
+ #### Entry Points
338
+ - `[file]` - [main entry]
339
+ - `[file]` - [test entry]
340
+
341
+ ---
342
+
343
+ ### Setup & Development
344
+
345
+ #### Installation
346
+ ```bash
347
+ # [step-by-step installation based on project]
348
+ ```
349
+
350
+ #### Development Commands
351
+ ```bash
352
+ # Start dev server
353
+ [command]
354
+
355
+ # Run tests
356
+ [command]
357
+
358
+ # Build
359
+ [command]
360
+
361
+ # Lint
362
+ [command]
363
+ ```
364
+
365
+ #### Environment Variables
366
+ Required variables (see .env.example):
367
+ - `[VAR]` - [purpose]
368
+ - `[VAR]` - [purpose]
369
+
370
+ ---
371
+
372
+ ### Testing Strategy
373
+ - **Unit Tests**: [location and pattern]
374
+ - **Integration Tests**: [location and pattern]
375
+ - **E2E Tests**: [location and pattern if available]
376
+ - **Run Tests**: `[command]`
377
+
378
+ ---
379
+
380
+ ### Code Style & Conventions
381
+ - **Code Style**: [description]
382
+ - **Naming**: [conventions]
383
+ - **Comments**: [when and how]
384
+ - **Linting**: [configuration]
385
+ ```
386
+
387
+ ### Gate
388
+ - [ ] Architecture explained clearly
389
+ - [ ] Key components documented
390
+ - [ ] Workflows mapped
391
+ - [ ] Setup instructions provided
392
+
393
+ ---
394
+
395
+ ## Phase 4: GUIDE
396
+
397
+ **Goal**: Create a practical navigation guide for common tasks
398
+
399
+ ### Actions
400
+ 1. **Create task-based guides** (how to add features, fix bugs)
401
+ 2. **Document where to find things** (quick reference)
402
+ 3. **List common gotchas** and solutions
403
+ 4. **Provide quick wins** (easy first tasks)
404
+
405
+ ### Guide Template
406
+ ```markdown
407
+ ## Navigation Guide
408
+
409
+ ### How to Add a New Feature
410
+
411
+ Following the **[architecture pattern from doc]**, here's the step-by-step:
412
+
413
+ 1. **Define in Domain Layer** (if applicable):
414
+ - Create entity: `[path]/entities/`
415
+ - Create use case: `[path]/usecases/`
416
+
417
+ 2. **Implement in Data Layer**:
418
+ - Create repository: `[path]/repositories/`
419
+ - Create data source: `[path]/datasources/`
420
+
421
+ 3. **Build in Presentation Layer**:
422
+ - Create UI component: `[path]/screens/` or `[path]/pages/`
423
+ - Add state management: `[path]/providers/` or `[path]/stores/`
424
+
425
+ 4. **Add Tests**:
426
+ - Unit tests: `[path]/test/`
427
+ - Integration tests: `[path]/test/`
428
+
429
+ 5. **Update Documentation**:
430
+ - Update README if needed
431
+ - Add inline documentation
432
+
433
+ ### How to Fix a Bug
434
+
435
+ 1. **Locate the Layer** (use architecture doc):
436
+ - UI bug? → Check Presentation layer at `[path]`
437
+ - Business logic bug? → Check Domain layer at `[path]`
438
+ - Data bug? → Check Data layer at `[path]`
439
+
440
+ 2. **Find Related Files**:
441
+ - Search by feature: `grep -r "[feature_name]" [layer_path]`
442
+ - Check recent changes: `git log --oneline [file]`
443
+
444
+ 3. **Fix Following Patterns** (from architecture doc)
445
+
446
+ 4. **Test**:
447
+ - Run existing tests: `[command]`
448
+ - Add regression test
449
+
450
+ ### Where to Find Things
451
+
452
+ | What | Where |
453
+ |------|-------|
454
+ | API endpoints | `[path]` |
455
+ | Database models | `[path]` |
456
+ | UI components | `[path]` |
457
+ | Business logic | `[path]` |
458
+ | State management | `[path]` |
459
+ | Constants | `[path]` |
460
+ | Utils/Helpers | `[path]` |
461
+ | Config | `[path]` |
462
+ | Tests | `[path]` |
463
+ | Types/Interfaces | `[path]` |
464
+
465
+ ### Common Tasks Quick Reference
466
+
467
+ #### Add a new API endpoint
468
+ ```bash
469
+ 1. Define route in [path]
470
+ 2. Create controller in [path]
471
+ 3. Add service logic in [path]
472
+ 4. Update types in [path]
473
+ 5. Test with [command]
474
+ ```
475
+
476
+ #### Add a new UI component
477
+ ```bash
478
+ 1. Create component in [path]
479
+ 2. Add styles in [path]
480
+ 3. Export from [path]
481
+ 4. Use in [path]
482
+ ```
483
+
484
+ #### Add a new database table/model
485
+ ```bash
486
+ 1. Create migration in [path]
487
+ 2. Define model in [path]
488
+ 3. Add repository in [path]
489
+ 4. Run migration: [command]
490
+ ```
491
+
492
+ ### Common Gotchas & Solutions
493
+
494
+ 1. **[Gotcha 1]**
495
+ - Problem: [description]
496
+ - Solution: [how to fix]
497
+
498
+ 2. **[Gotcha 2]**
499
+ - Problem: [description]
500
+ - Solution: [how to fix]
501
+
502
+ 3. **[Gotcha 3]**
503
+ - Problem: [description]
504
+ - Solution: [how to fix]
505
+
506
+ ### Quick Wins (Easy First Tasks)
507
+
508
+ Good first issues to familiarize yourself:
509
+
510
+ 1. **Fix a typo or improve documentation**
511
+ - Files: README.md, comments
512
+ - Impact: Low risk, good learning
513
+
514
+ 2. **Add a simple utility function**
515
+ - Location: `[path]/utils/`
516
+ - Pattern: [describe pattern]
517
+
518
+ 3. **Add a test for existing code**
519
+ - Location: `[path]/test/`
520
+ - Framework: [test framework]
521
+
522
+ 4. **Improve error messages**
523
+ - Location: `[path]/errors/`
524
+ - Pattern: [describe pattern]
525
+
526
+ ### Git Workflow
527
+
528
+ ```bash
529
+ # Create feature branch
530
+ git checkout -b feature/[name]
531
+
532
+ # Make changes following architecture
533
+
534
+ # Commit (follow conventional commits)
535
+ git commit -m "[type]: [description]"
536
+
537
+ # Push and create PR
538
+ git push origin feature/[name]
539
+ gh pr create
540
+ ```
541
+
542
+ ### Getting Help
543
+
544
+ - **Architecture Reference**: `~/.claude/architecture/[stack].md`
545
+ - **Project Docs**: `docs/` or `README.md`
546
+ - **Code Comments**: Well-documented files in `[path]`
547
+ - **Tests as Examples**: `[path]/test/` shows usage patterns
548
+ ```
549
+
550
+ ### Gate
551
+ - [ ] Task guides created
552
+ - [ ] Navigation reference provided
553
+ - [ ] Common gotchas documented
554
+ - [ ] Quick wins identified
555
+
556
+ ---
557
+
558
+ ## Quick Reference
559
+
560
+ ### Architecture Docs
561
+ | Stack | Doc |
562
+ |-------|-----|
563
+ | All | `clean-architecture.md` |
564
+ | Flutter | `flutter-mobile.md` |
565
+ | React | `react-frontend.md` |
566
+ | Go | `go-backend.md` |
567
+ | Laravel | `laravel-backend.md` |
568
+ | Remix | `remix-fullstack.md` |
569
+ | Monorepo | `monorepo.md` |
570
+
571
+ ### Phase Summary
572
+ | Phase | Key Actions | Output |
573
+ |-------|-------------|--------|
574
+ | SCAN | Identify stack, read arch doc, map structure | Project overview |
575
+ | ANALYZE | Deep dive into layers, patterns, conventions | Architecture analysis |
576
+ | EXPLAIN | Document components, workflows, setup | Comprehensive guide |
577
+ | GUIDE | Create task guides, navigation, quick wins | Practical handbook |
578
+
579
+ ### Onboarding Checklist
580
+
581
+ After completing this workflow, you should understand:
582
+ - [ ] Project tech stack and dependencies
583
+ - [ ] Architecture pattern and layers
584
+ - [ ] Directory structure and where to find things
585
+ - [ ] How to add new features (following architecture)
586
+ - [ ] How to fix bugs (following architecture)
587
+ - [ ] Testing strategy and how to run tests
588
+ - [ ] Development workflow and commands
589
+ - [ ] Common patterns and conventions
590
+ - [ ] Where to get help
591
+
592
+ ### Success Criteria
593
+
594
+ Onboarding is complete when you can:
595
+ 1. Explain the project architecture (based on reference doc)
596
+ 2. Locate any component or feature quickly
597
+ 3. Add a simple feature following the architecture
598
+ 4. Run tests and understand the output
599
+ 5. Navigate the codebase confidently
600
+
601
+ ### Next Steps After Onboarding
602
+
603
+ 1. **Pick a Quick Win** - Complete an easy first task
604
+ 2. **Read Architecture Doc** - Deep dive into the specific patterns
605
+ 3. **Pair with Code** - Review existing features to learn patterns
606
+ 4. **Ask Questions** - Clarify anything unclear
607
+ 5. **Start Contributing** - Begin with small features following the architecture