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,1333 @@
1
+ ---
2
+ name: documentation
3
+ description: Documentation workflow for generating project documentation. Use when documenting, writing docs, generating documentation, or when user says "document", "generate docs", "write docs", "create documentation", "update docs".
4
+ ---
5
+
6
+ # Documentation Workflow
7
+
8
+ Complete workflow for creating and maintaining project documentation.
9
+
10
+ ## IMPORTANT: Read Architecture First
11
+
12
+ **Before writing documentation, 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
+ **Documentation must accurately reflect the architecture and patterns used in the codebase.**
32
+
33
+ ## Recommended Agents
34
+
35
+ | Phase | Agent | Purpose |
36
+ |-------|-------|---------|
37
+ | SCAN | `@clean-architect` | Identify documentation needs |
38
+ | ANALYZE | `@api-designer` | API documentation structure |
39
+ | ANALYZE | `@db-designer` | Database documentation |
40
+ | GENERATE | `@docs-writer` | Write all documentation |
41
+ | REVIEW | `@code-reviewer` | Verify accuracy |
42
+ | REVIEW | `@react-frontend-dev`, `@go-backend-dev`, `@laravel-backend-dev`, `@flutter-mobile-dev`, `@remix-fullstack-dev` | Stack-specific review |
43
+
44
+ ## Workflow Overview
45
+
46
+ ```
47
+ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
48
+ │ 1. SCAN │──▶│2. ANALYZE│──▶│3. GENERATE──▶│4. REVIEW │
49
+ └──────────┘ └──────────┘ └──────────┘ └──────────┘
50
+
51
+ ┌───────┘
52
+
53
+ Feedback Loop
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Phase 1: SCAN
59
+
60
+ **Goal**: Scan codebase to identify what needs documentation
61
+
62
+ ### Actions
63
+ 1. **Identify project stack and read architecture doc**
64
+ 2. Scan codebase structure based on architecture:
65
+ ```bash
66
+ # List directory structure
67
+ tree -L 3 -I 'node_modules|vendor|dist|build'
68
+
69
+ # Find existing docs
70
+ find . -name "*.md" -o -name "README*"
71
+
72
+ # Identify API files (based on stack)
73
+ # Flutter: lib/data/api/
74
+ # React: src/api/, src/services/
75
+ # Go: internal/handler/, internal/controller/
76
+ # Laravel: app/Http/Controllers/Api/
77
+ # Remix: app/routes/
78
+ ```
79
+
80
+ 3. Identify documentable items:
81
+ - [ ] README (project overview)
82
+ - [ ] API documentation (endpoints, schemas)
83
+ - [ ] Architecture documentation (system design)
84
+ - [ ] Setup/Installation guides
85
+ - [ ] User guides (how to use features)
86
+ - [ ] Developer guides (how to contribute)
87
+ - [ ] Database schema
88
+ - [ ] Configuration reference
89
+ - [ ] Deployment guides
90
+
91
+ ### Output
92
+ ```markdown
93
+ ## Documentation Scan
94
+
95
+ ### Stack & Architecture
96
+ - Stack: [Flutter/React/Go/Laravel/Remix/Monorepo]
97
+ - Architecture Doc: [path to architecture file]
98
+
99
+ ### Existing Documentation
100
+ - [ ] README.md
101
+ - [ ] API.md
102
+ - [ ] ARCHITECTURE.md
103
+ - [ ] CONTRIBUTING.md
104
+ - [ ] Other: [list]
105
+
106
+ ### Missing Documentation
107
+ - [ ] Item 1
108
+ - [ ] Item 2
109
+ - [ ] Item 3
110
+
111
+ ### Documentation Priorities (High to Low)
112
+ 1. [Most critical docs]
113
+ 2. [Important docs]
114
+ 3. [Nice-to-have docs]
115
+ ```
116
+
117
+ ### Gate
118
+ - [ ] Architecture doc read
119
+ - [ ] Codebase structure understood
120
+ - [ ] Documentation gaps identified
121
+ - [ ] Priorities set
122
+
123
+ ---
124
+
125
+ ## Phase 2: ANALYZE
126
+
127
+ **Goal**: Understand what information each document should contain
128
+
129
+ ### Actions
130
+ 1. **Re-read architecture doc** for documentation standards
131
+ 2. For each documentation type, analyze content:
132
+
133
+ **README Analysis**:
134
+ - Project purpose
135
+ - Tech stack (from architecture)
136
+ - Quick start
137
+ - Installation steps
138
+ - Usage examples
139
+ - Links to other docs
140
+
141
+ **API Documentation Analysis**:
142
+ - Identify all endpoints/routes
143
+ - Request/response schemas
144
+ - Authentication requirements
145
+ - Error codes
146
+ - Rate limits
147
+ - Examples
148
+
149
+ **Architecture Documentation Analysis**:
150
+ - System overview
151
+ - Layer structure (from architecture doc)
152
+ - Component relationships
153
+ - Data flow patterns
154
+ - Design decisions (ADRs)
155
+
156
+ **Developer Guide Analysis**:
157
+ - Project structure (from architecture)
158
+ - Coding standards
159
+ - Testing patterns
160
+ - Git workflow
161
+ - CI/CD pipeline
162
+
163
+ 3. Create documentation outline
164
+
165
+ ### Analysis Output
166
+ ```markdown
167
+ ## Documentation Plan
168
+
169
+ ### Reference
170
+ - Architecture Doc: [path]
171
+ - Stack Patterns: [patterns from doc]
172
+
173
+ ### [Doc Type 1] - e.g., README.md
174
+
175
+ **Purpose**: [what this doc achieves]
176
+
177
+ **Audience**: [who reads this]
178
+
179
+ **Content Outline**:
180
+ 1. Section 1
181
+ - Subsection A
182
+ - Subsection B
183
+ 2. Section 2
184
+ - Subsection A
185
+ 3. Section 3
186
+
187
+ **Source Information**:
188
+ - Files to reference: [list]
189
+ - Architecture sections: [sections from doc]
190
+ - Example code locations: [paths]
191
+
192
+ ### [Doc Type 2] - e.g., API.md
193
+
194
+ **Purpose**: [what this doc achieves]
195
+
196
+ **Audience**: [who reads this]
197
+
198
+ **Content Outline**:
199
+ [similar structure]
200
+
201
+ **Source Information**:
202
+ [similar structure]
203
+ ```
204
+
205
+ ### Gate
206
+ - [ ] Each document has clear purpose
207
+ - [ ] Content outlines complete
208
+ - [ ] Source information identified
209
+ - [ ] Aligned with architecture doc
210
+
211
+ ---
212
+
213
+ ## Phase 3: GENERATE
214
+
215
+ **Goal**: Write complete, accurate documentation
216
+
217
+ ### Actions
218
+ 1. **Read architecture doc** for patterns and conventions
219
+ 2. For each document type, follow templates below
220
+ 3. Use actual code examples from codebase
221
+ 4. Follow documentation standards from architecture
222
+ 5. Ensure all paths, commands, examples are accurate
223
+
224
+ ### Documentation Templates
225
+
226
+ #### README.md Template
227
+ ```markdown
228
+ # [Project Name]
229
+
230
+ [One-line description]
231
+
232
+ ## Overview
233
+
234
+ [2-3 paragraphs describing what this project does and why it exists]
235
+
236
+ ## Tech Stack
237
+
238
+ Based on [architecture doc reference]:
239
+
240
+ - **Language**: [language + version]
241
+ - **Framework**: [framework + version]
242
+ - **Architecture**: [pattern from architecture doc]
243
+ - **Database**: [database]
244
+ - **Other**: [key dependencies]
245
+
246
+ ## Quick Start
247
+
248
+ \`\`\`bash
249
+ # Clone
250
+ git clone [repo-url]
251
+
252
+ # Install dependencies (use command from architecture doc)
253
+ [npm install / go mod download / composer install / flutter pub get]
254
+
255
+ # Configure
256
+ cp .env.example .env
257
+ # Edit .env with your settings
258
+
259
+ # Run (use command from architecture doc)
260
+ [npm run dev / go run . / php artisan serve / flutter run]
261
+ \`\`\`
262
+
263
+ ## Installation
264
+
265
+ ### Prerequisites
266
+ - [prerequisite 1]
267
+ - [prerequisite 2]
268
+
269
+ ### Steps
270
+ 1. [Step 1]
271
+ 2. [Step 2]
272
+ 3. [Step 3]
273
+
274
+ ## Project Structure
275
+
276
+ Based on [architecture doc]:
277
+
278
+ \`\`\`
279
+ [directory tree following architecture doc]
280
+ \`\`\`
281
+
282
+ ## Usage
283
+
284
+ ### [Feature 1]
285
+ \`\`\`[language]
286
+ // Example code
287
+ \`\`\`
288
+
289
+ ### [Feature 2]
290
+ \`\`\`[language]
291
+ // Example code
292
+ \`\`\`
293
+
294
+ ## Configuration
295
+
296
+ See `.env.example` for all configuration options:
297
+
298
+ | Variable | Description | Default |
299
+ |----------|-------------|---------|
300
+ | VAR_1 | [description] | [default] |
301
+ | VAR_2 | [description] | [default] |
302
+
303
+ ## Development
304
+
305
+ ### Running Tests
306
+
307
+ \`\`\`bash
308
+ # From architecture doc
309
+ [test command]
310
+ \`\`\`
311
+
312
+ ### Code Style
313
+
314
+ \`\`\`bash
315
+ # From architecture doc
316
+ [format/lint commands]
317
+ \`\`\`
318
+
319
+ ## Architecture
320
+
321
+ See `.claude/architecture/[stack].md` for detailed architecture documentation.
322
+
323
+ **Key Patterns**:
324
+ - [Pattern 1 from architecture doc]
325
+ - [Pattern 2 from architecture doc]
326
+
327
+ ## API Documentation
328
+
329
+ See [API.md](./API.md) for complete API reference.
330
+
331
+ ## Contributing
332
+
333
+ 1. Fork the repository
334
+ 2. Create feature branch: `git checkout -b feature/name`
335
+ 3. Follow architecture patterns in `.claude/architecture/`
336
+ 4. Write tests
337
+ 5. Submit PR
338
+
339
+ ## License
340
+
341
+ [License information]
342
+ ```
343
+
344
+ #### API.md Template
345
+ ```markdown
346
+ # API Documentation
347
+
348
+ ## Overview
349
+
350
+ [Brief API description]
351
+
352
+ **Base URL**: `[base_url]`
353
+
354
+ **Authentication**: [auth method]
355
+
356
+ ## Authentication
357
+
358
+ ### [Auth Method]
359
+
360
+ \`\`\`http
361
+ POST /api/auth/login
362
+ Content-Type: application/json
363
+
364
+ {
365
+ "email": "user@example.com",
366
+ "password": "password"
367
+ }
368
+ \`\`\`
369
+
370
+ **Response**:
371
+ \`\`\`json
372
+ {
373
+ "token": "eyJ...",
374
+ "user": {
375
+ "id": 1,
376
+ "email": "user@example.com"
377
+ }
378
+ }
379
+ \`\`\`
380
+
381
+ ## Endpoints
382
+
383
+ ### [Resource Name]
384
+
385
+ #### Get All [Resources]
386
+
387
+ \`\`\`http
388
+ GET /api/[resources]
389
+ Authorization: Bearer {token}
390
+ \`\`\`
391
+
392
+ **Query Parameters**:
393
+ | Parameter | Type | Required | Description |
394
+ |-----------|------|----------|-------------|
395
+ | page | integer | No | Page number (default: 1) |
396
+ | limit | integer | No | Items per page (default: 10) |
397
+ | filter | string | No | Filter criteria |
398
+
399
+ **Response** (200 OK):
400
+ \`\`\`json
401
+ {
402
+ "data": [
403
+ {
404
+ "id": 1,
405
+ "field1": "value1",
406
+ "field2": "value2"
407
+ }
408
+ ],
409
+ "meta": {
410
+ "total": 100,
411
+ "page": 1,
412
+ "limit": 10
413
+ }
414
+ }
415
+ \`\`\`
416
+
417
+ #### Get Single [Resource]
418
+
419
+ \`\`\`http
420
+ GET /api/[resources]/{id}
421
+ Authorization: Bearer {token}
422
+ \`\`\`
423
+
424
+ **Response** (200 OK):
425
+ \`\`\`json
426
+ {
427
+ "id": 1,
428
+ "field1": "value1",
429
+ "field2": "value2"
430
+ }
431
+ \`\`\`
432
+
433
+ #### Create [Resource]
434
+
435
+ \`\`\`http
436
+ POST /api/[resources]
437
+ Authorization: Bearer {token}
438
+ Content-Type: application/json
439
+
440
+ {
441
+ "field1": "value1",
442
+ "field2": "value2"
443
+ }
444
+ \`\`\`
445
+
446
+ **Request Schema**:
447
+ | Field | Type | Required | Description |
448
+ |-------|------|----------|-------------|
449
+ | field1 | string | Yes | [description] |
450
+ | field2 | string | No | [description] |
451
+
452
+ **Response** (201 Created):
453
+ \`\`\`json
454
+ {
455
+ "id": 1,
456
+ "field1": "value1",
457
+ "field2": "value2"
458
+ }
459
+ \`\`\`
460
+
461
+ #### Update [Resource]
462
+
463
+ \`\`\`http
464
+ PUT /api/[resources]/{id}
465
+ Authorization: Bearer {token}
466
+ Content-Type: application/json
467
+
468
+ {
469
+ "field1": "new_value"
470
+ }
471
+ \`\`\`
472
+
473
+ **Response** (200 OK):
474
+ \`\`\`json
475
+ {
476
+ "id": 1,
477
+ "field1": "new_value",
478
+ "field2": "value2"
479
+ }
480
+ \`\`\`
481
+
482
+ #### Delete [Resource]
483
+
484
+ \`\`\`http
485
+ DELETE /api/[resources]/{id}
486
+ Authorization: Bearer {token}
487
+ \`\`\`
488
+
489
+ **Response** (204 No Content)
490
+
491
+ ## Error Responses
492
+
493
+ All endpoints may return these errors:
494
+
495
+ ### 400 Bad Request
496
+ \`\`\`json
497
+ {
498
+ "error": {
499
+ "code": "VALIDATION_ERROR",
500
+ "message": "Validation failed",
501
+ "details": [
502
+ {
503
+ "field": "email",
504
+ "message": "Invalid email format"
505
+ }
506
+ ]
507
+ }
508
+ }
509
+ \`\`\`
510
+
511
+ ### 401 Unauthorized
512
+ \`\`\`json
513
+ {
514
+ "error": {
515
+ "code": "UNAUTHORIZED",
516
+ "message": "Invalid or missing authentication token"
517
+ }
518
+ }
519
+ \`\`\`
520
+
521
+ ### 403 Forbidden
522
+ \`\`\`json
523
+ {
524
+ "error": {
525
+ "code": "FORBIDDEN",
526
+ "message": "You don't have permission to access this resource"
527
+ }
528
+ }
529
+ \`\`\`
530
+
531
+ ### 404 Not Found
532
+ \`\`\`json
533
+ {
534
+ "error": {
535
+ "code": "NOT_FOUND",
536
+ "message": "Resource not found"
537
+ }
538
+ }
539
+ \`\`\`
540
+
541
+ ### 500 Internal Server Error
542
+ \`\`\`json
543
+ {
544
+ "error": {
545
+ "code": "INTERNAL_ERROR",
546
+ "message": "An unexpected error occurred"
547
+ }
548
+ }
549
+ \`\`\`
550
+
551
+ ## Rate Limiting
552
+
553
+ - **Limit**: [requests per timeframe]
554
+ - **Headers**:
555
+ - `X-RateLimit-Limit`: Total requests allowed
556
+ - `X-RateLimit-Remaining`: Requests remaining
557
+ - `X-RateLimit-Reset`: Time when limit resets (Unix timestamp)
558
+
559
+ ## Examples
560
+
561
+ ### cURL
562
+
563
+ \`\`\`bash
564
+ # Login
565
+ curl -X POST [base_url]/api/auth/login \\
566
+ -H "Content-Type: application/json" \\
567
+ -d '{"email":"user@example.com","password":"password"}'
568
+
569
+ # Get resources
570
+ curl -X GET [base_url]/api/[resources] \\
571
+ -H "Authorization: Bearer {token}"
572
+ \`\`\`
573
+
574
+ ### JavaScript (fetch)
575
+
576
+ \`\`\`javascript
577
+ // Login
578
+ const response = await fetch('[base_url]/api/auth/login', {
579
+ method: 'POST',
580
+ headers: { 'Content-Type': 'application/json' },
581
+ body: JSON.stringify({
582
+ email: 'user@example.com',
583
+ password: 'password'
584
+ })
585
+ });
586
+ const { token } = await response.json();
587
+
588
+ // Get resources
589
+ const resources = await fetch('[base_url]/api/[resources]', {
590
+ headers: { 'Authorization': `Bearer ${token}` }
591
+ }).then(r => r.json());
592
+ \`\`\`
593
+
594
+ ### [Stack-specific client example]
595
+
596
+ \`\`\`[language]
597
+ // Example using your stack's HTTP client
598
+ \`\`\`
599
+ ```
600
+
601
+ #### ARCHITECTURE.md Template
602
+ ```markdown
603
+ # Architecture Documentation
604
+
605
+ ## Overview
606
+
607
+ This project follows [architecture pattern] as defined in `.claude/architecture/[stack].md`.
608
+
609
+ ## System Architecture
610
+
611
+ ### High-Level Diagram
612
+
613
+ \`\`\`mermaid
614
+ graph TB
615
+ Client[Client Layer]
616
+ Presentation[Presentation Layer]
617
+ Business[Business Logic Layer]
618
+ Data[Data Layer]
619
+ External[External Services]
620
+
621
+ Client --> Presentation
622
+ Presentation --> Business
623
+ Business --> Data
624
+ Business --> External
625
+ Data --> Database[(Database)]
626
+ \`\`\`
627
+
628
+ ### Layers
629
+
630
+ Based on `.claude/architecture/[stack].md`:
631
+
632
+ #### 1. [Layer 1 from architecture doc]
633
+
634
+ **Purpose**: [purpose]
635
+
636
+ **Components**:
637
+ - Component A: [description]
638
+ - Component B: [description]
639
+
640
+ **Location**: `[directory path from architecture]`
641
+
642
+ **Responsibilities**:
643
+ - [ ] Responsibility 1
644
+ - [ ] Responsibility 2
645
+
646
+ #### 2. [Layer 2 from architecture doc]
647
+
648
+ **Purpose**: [purpose]
649
+
650
+ **Components**:
651
+ - Component A: [description]
652
+ - Component B: [description]
653
+
654
+ **Location**: `[directory path from architecture]`
655
+
656
+ **Responsibilities**:
657
+ - [ ] Responsibility 1
658
+ - [ ] Responsibility 2
659
+
660
+ #### 3. [Layer 3 from architecture doc]
661
+
662
+ [Similar structure]
663
+
664
+ ## Directory Structure
665
+
666
+ Following `.claude/architecture/[stack].md`:
667
+
668
+ \`\`\`
669
+ [detailed directory tree with explanations]
670
+ \`\`\`
671
+
672
+ ## Data Flow
673
+
674
+ ### [Example Flow - e.g., User Authentication]
675
+
676
+ \`\`\`mermaid
677
+ sequenceDiagram
678
+ participant C as Client
679
+ participant P as Presentation
680
+ participant B as Business
681
+ participant D as Data
682
+ participant DB as Database
683
+
684
+ C->>P: POST /api/auth/login
685
+ P->>B: LoginUseCase.execute()
686
+ B->>D: UserRepository.findByEmail()
687
+ D->>DB: SELECT * FROM users
688
+ DB-->>D: User data
689
+ D-->>B: User entity
690
+ B->>B: Validate password
691
+ B->>B: Generate token
692
+ B-->>P: AuthToken
693
+ P-->>C: 200 OK {token}
694
+ \`\`\`
695
+
696
+ **Steps**:
697
+ 1. [Step 1 explanation following architecture]
698
+ 2. [Step 2 explanation]
699
+ 3. [Step 3 explanation]
700
+
701
+ ## Design Patterns
702
+
703
+ From `.claude/architecture/[stack].md`:
704
+
705
+ ### [Pattern 1 - e.g., Dependency Injection]
706
+
707
+ **Where**: [layers where used]
708
+
709
+ **Implementation**:
710
+ \`\`\`[language]
711
+ // Example from codebase
712
+ \`\`\`
713
+
714
+ ### [Pattern 2 - e.g., Repository Pattern]
715
+
716
+ **Where**: [layers where used]
717
+
718
+ **Implementation**:
719
+ \`\`\`[language]
720
+ // Example from codebase
721
+ \`\`\`
722
+
723
+ ## Key Components
724
+
725
+ ### [Component 1]
726
+
727
+ **Type**: [Controller/Service/Repository/etc.]
728
+
729
+ **Location**: `[file path]`
730
+
731
+ **Purpose**: [what it does]
732
+
733
+ **Dependencies**:
734
+ - Dependency 1
735
+ - Dependency 2
736
+
737
+ **Interface**:
738
+ \`\`\`[language]
739
+ // Interface or main methods
740
+ \`\`\`
741
+
742
+ ### [Component 2]
743
+
744
+ [Similar structure]
745
+
746
+ ## Database Schema
747
+
748
+ ### Tables
749
+
750
+ #### [Table 1]
751
+
752
+ | Column | Type | Constraints | Description |
753
+ |--------|------|-------------|-------------|
754
+ | id | integer | PK, AUTO_INCREMENT | Primary key |
755
+ | field1 | varchar(255) | NOT NULL | [description] |
756
+ | created_at | timestamp | DEFAULT NOW() | Creation time |
757
+
758
+ **Relationships**:
759
+ - Belongs to: [related table]
760
+ - Has many: [related table]
761
+
762
+ #### [Table 2]
763
+
764
+ [Similar structure]
765
+
766
+ ### ER Diagram
767
+
768
+ \`\`\`mermaid
769
+ erDiagram
770
+ TABLE1 ||--o{ TABLE2 : has
771
+ TABLE1 {
772
+ int id PK
773
+ string field1
774
+ }
775
+ TABLE2 {
776
+ int id PK
777
+ int table1_id FK
778
+ string field2
779
+ }
780
+ \`\`\`
781
+
782
+ ## Configuration
783
+
784
+ ### Environment Variables
785
+
786
+ See `.env.example`:
787
+
788
+ | Variable | Type | Required | Description | Default |
789
+ |----------|------|----------|-------------|---------|
790
+ | VAR_1 | string | Yes | [description] | - |
791
+ | VAR_2 | integer | No | [description] | 3000 |
792
+
793
+ ### Application Config
794
+
795
+ Configuration files and their purposes:
796
+
797
+ - `[config file 1]`: [purpose]
798
+ - `[config file 2]`: [purpose]
799
+
800
+ ## Testing Strategy
801
+
802
+ Based on architecture patterns:
803
+
804
+ ### Unit Tests
805
+
806
+ **Location**: [path from architecture doc]
807
+
808
+ **Coverage**: [target percentage]
809
+
810
+ **Run**: `[test command from architecture]`
811
+
812
+ \`\`\`[language]
813
+ // Example unit test following architecture patterns
814
+ \`\`\`
815
+
816
+ ### Integration Tests
817
+
818
+ **Location**: [path from architecture doc]
819
+
820
+ **Coverage**: [what's tested]
821
+
822
+ **Run**: `[test command]`
823
+
824
+ ### E2E Tests
825
+
826
+ **Location**: [path from architecture doc]
827
+
828
+ **Coverage**: [what's tested]
829
+
830
+ **Run**: `[test command]`
831
+
832
+ ## Deployment
833
+
834
+ ### Build
835
+
836
+ \`\`\`bash
837
+ [build commands from architecture]
838
+ \`\`\`
839
+
840
+ ### Deploy
841
+
842
+ \`\`\`bash
843
+ [deploy commands]
844
+ \`\`\`
845
+
846
+ ### Environments
847
+
848
+ | Environment | URL | Purpose |
849
+ |-------------|-----|---------|
850
+ | Development | [url] | Local development |
851
+ | Staging | [url] | Pre-production testing |
852
+ | Production | [url] | Live application |
853
+
854
+ ## Decision Records (ADRs)
855
+
856
+ ### ADR-001: [Decision Title]
857
+
858
+ **Date**: [date]
859
+
860
+ **Status**: [Accepted/Rejected/Superseded]
861
+
862
+ **Context**: [Why we needed to make this decision]
863
+
864
+ **Decision**: [What we decided]
865
+
866
+ **Consequences**: [Impact of this decision]
867
+
868
+ ### ADR-002: [Decision Title]
869
+
870
+ [Similar structure]
871
+
872
+ ## References
873
+
874
+ - Architecture Doc: `.claude/architecture/[stack].md`
875
+ - [Other relevant docs]
876
+ ```
877
+
878
+ #### CONTRIBUTING.md Template
879
+ ```markdown
880
+ # Contributing Guide
881
+
882
+ ## Getting Started
883
+
884
+ ### Prerequisites
885
+
886
+ - [prerequisite 1]
887
+ - [prerequisite 2]
888
+
889
+ ### Setup
890
+
891
+ 1. Fork and clone:
892
+ \`\`\`bash
893
+ git clone [your-fork-url]
894
+ cd [project]
895
+ \`\`\`
896
+
897
+ 2. Install dependencies:
898
+ \`\`\`bash
899
+ [install command from architecture]
900
+ \`\`\`
901
+
902
+ 3. Configure:
903
+ \`\`\`bash
904
+ cp .env.example .env
905
+ # Edit .env
906
+ \`\`\`
907
+
908
+ 4. Run:
909
+ \`\`\`bash
910
+ [run command from architecture]
911
+ \`\`\`
912
+
913
+ ## Architecture
914
+
915
+ **IMPORTANT**: Read `.claude/architecture/[stack].md` before contributing.
916
+
917
+ This project follows [architecture pattern]. Key principles:
918
+
919
+ - [Principle 1 from architecture doc]
920
+ - [Principle 2 from architecture doc]
921
+ - [Principle 3 from architecture doc]
922
+
923
+ ## Project Structure
924
+
925
+ Based on `.claude/architecture/[stack].md`:
926
+
927
+ \`\`\`
928
+ [directory structure with explanations]
929
+ \`\`\`
930
+
931
+ ## Development Workflow
932
+
933
+ ### 1. Create Branch
934
+
935
+ \`\`\`bash
936
+ git checkout -b feature/your-feature-name
937
+ # or
938
+ git checkout -b fix/your-bug-fix
939
+ \`\`\`
940
+
941
+ ### 2. Make Changes
942
+
943
+ Follow architecture patterns from `.claude/architecture/[stack].md`:
944
+
945
+ - **Layer boundaries**: [rules from architecture]
946
+ - **Naming conventions**: [conventions from architecture]
947
+ - **File organization**: [rules from architecture]
948
+
949
+ ### 3. Write Tests
950
+
951
+ Test location from architecture doc: `[test directory]`
952
+
953
+ \`\`\`bash
954
+ # Run tests
955
+ [test command from architecture]
956
+ \`\`\`
957
+
958
+ **Coverage requirement**: [percentage]
959
+
960
+ ### 4. Code Style
961
+
962
+ Follow coding standards:
963
+
964
+ \`\`\`bash
965
+ # Format code
966
+ [format command from architecture]
967
+
968
+ # Lint
969
+ [lint command from architecture]
970
+ \`\`\`
971
+
972
+ ### 5. Commit
973
+
974
+ Follow [Conventional Commits](https://www.conventionalcommits.org/):
975
+
976
+ \`\`\`bash
977
+ git commit -m "feat: add new feature"
978
+ git commit -m "fix: resolve bug in component"
979
+ git commit -m "docs: update README"
980
+ \`\`\`
981
+
982
+ **Types**:
983
+ - `feat`: New feature
984
+ - `fix`: Bug fix
985
+ - `docs`: Documentation
986
+ - `style`: Code style (formatting)
987
+ - `refactor`: Code refactoring
988
+ - `test`: Tests
989
+ - `chore`: Maintenance
990
+
991
+ ### 6. Push & PR
992
+
993
+ \`\`\`bash
994
+ git push origin feature/your-feature-name
995
+ \`\`\`
996
+
997
+ Create PR with:
998
+ - Clear title
999
+ - Description of changes
1000
+ - Reference to issue (if applicable)
1001
+ - Screenshots (if UI changes)
1002
+
1003
+ ## Code Standards
1004
+
1005
+ ### [Language] Style Guide
1006
+
1007
+ Based on `.claude/architecture/[stack].md`:
1008
+
1009
+ **Naming**:
1010
+ - Files: `[convention from architecture]`
1011
+ - Classes: `[convention]`
1012
+ - Functions: `[convention]`
1013
+ - Variables: `[convention]`
1014
+
1015
+ **Structure**:
1016
+ \`\`\`[language]
1017
+ // Example following architecture patterns
1018
+ \`\`\`
1019
+
1020
+ ### Documentation
1021
+
1022
+ - Document public APIs
1023
+ - Add comments for complex logic
1024
+ - Update README if needed
1025
+
1026
+ ### Testing
1027
+
1028
+ **Unit Tests**:
1029
+ \`\`\`[language]
1030
+ // Example following architecture test patterns
1031
+ \`\`\`
1032
+
1033
+ **Integration Tests**:
1034
+ \`\`\`[language]
1035
+ // Example
1036
+ \`\`\`
1037
+
1038
+ ## Pull Request Process
1039
+
1040
+ 1. **Before submitting**:
1041
+ - [ ] Code follows architecture patterns
1042
+ - [ ] Tests pass
1043
+ - [ ] Code is formatted/linted
1044
+ - [ ] Documentation updated
1045
+ - [ ] No breaking changes (or documented)
1046
+
1047
+ 2. **PR template**:
1048
+ \`\`\`markdown
1049
+ ## Description
1050
+ [What does this PR do?]
1051
+
1052
+ ## Type of Change
1053
+ - [ ] Bug fix
1054
+ - [ ] New feature
1055
+ - [ ] Breaking change
1056
+ - [ ] Documentation
1057
+
1058
+ ## Architecture Compliance
1059
+ - [ ] Follows patterns in .claude/architecture/[stack].md
1060
+ - [ ] Layer boundaries respected
1061
+ - [ ] Naming conventions followed
1062
+
1063
+ ## Testing
1064
+ - [ ] Unit tests added/updated
1065
+ - [ ] Integration tests added/updated
1066
+ - [ ] All tests pass
1067
+
1068
+ ## Checklist
1069
+ - [ ] Code formatted
1070
+ - [ ] Documentation updated
1071
+ - [ ] No console.log/debug code
1072
+ \`\`\`
1073
+
1074
+ 3. **Review process**:
1075
+ - Maintainer reviews
1076
+ - CI/CD checks pass
1077
+ - Approved → Merged
1078
+
1079
+ ## Common Tasks
1080
+
1081
+ ### Adding a New Feature
1082
+
1083
+ Follow `.claude/architecture/[stack].md`:
1084
+
1085
+ 1. **[Layer 1 from architecture]**: Create [component type]
1086
+ 2. **[Layer 2 from architecture]**: Create [component type]
1087
+ 3. **[Layer 3 from architecture]**: Create [component type]
1088
+ 4. Write tests
1089
+ 5. Update documentation
1090
+
1091
+ ### Fixing a Bug
1092
+
1093
+ 1. Identify affected layer (from architecture)
1094
+ 2. Write failing test
1095
+ 3. Fix bug
1096
+ 4. Verify test passes
1097
+ 5. Check no regressions
1098
+
1099
+ ### Refactoring
1100
+
1101
+ 1. Ensure tests exist
1102
+ 2. Refactor following architecture patterns
1103
+ 3. Verify tests still pass
1104
+ 4. Document why refactored
1105
+
1106
+ ## Questions?
1107
+
1108
+ - Read: `.claude/architecture/[stack].md`
1109
+ - Check: [ARCHITECTURE.md](./ARCHITECTURE.md)
1110
+ - Ask: [contact/discussion link]
1111
+ ```
1112
+
1113
+ ### Gate
1114
+ - [ ] All planned documents generated
1115
+ - [ ] Follow architecture patterns
1116
+ - [ ] Code examples are accurate
1117
+ - [ ] All links work
1118
+ - [ ] Formatting correct
1119
+
1120
+ ---
1121
+
1122
+ ## Phase 4: REVIEW
1123
+
1124
+ **Goal**: Verify documentation accuracy and completeness
1125
+
1126
+ ### Actions
1127
+ 1. **Compare with architecture doc**:
1128
+ - [ ] Documentation reflects actual architecture
1129
+ - [ ] Patterns described match code
1130
+ - [ ] Directory structures match
1131
+ - [ ] Examples use correct patterns
1132
+
1133
+ 2. **Verify accuracy**:
1134
+ - [ ] All commands work
1135
+ - [ ] All code examples compile/run
1136
+ - [ ] All file paths exist
1137
+ - [ ] All links resolve
1138
+ - [ ] Environment variables correct
1139
+
1140
+ 3. **Check completeness**:
1141
+ - [ ] All sections filled in
1142
+ - [ ] No TODO markers left
1143
+ - [ ] All endpoints documented (API docs)
1144
+ - [ ] All features explained (README)
1145
+
1146
+ 4. **Test documentation**:
1147
+ - [ ] Follow README from scratch
1148
+ - [ ] Try all code examples
1149
+ - [ ] Verify installation steps
1150
+ - [ ] Test API examples
1151
+
1152
+ 5. **Review checklist**:
1153
+ - [ ] Clear and concise
1154
+ - [ ] Appropriate for audience
1155
+ - [ ] No jargon (or explained)
1156
+ - [ ] Consistent formatting
1157
+ - [ ] Proper grammar/spelling
1158
+
1159
+ ### Review Output
1160
+ ```markdown
1161
+ ## Documentation Review
1162
+
1163
+ ### Architecture Compliance: [Pass/Fail]
1164
+ - Reference: [architecture doc]
1165
+ - Issues: [list any mismatches]
1166
+
1167
+ ### Accuracy: [Pass/Fail]
1168
+ - Commands tested: [results]
1169
+ - Code examples tested: [results]
1170
+ - Links verified: [results]
1171
+ - Issues: [list]
1172
+
1173
+ ### Completeness: [Pass/Fail]
1174
+ - Missing sections: [list]
1175
+ - TODOs remaining: [count]
1176
+ - Issues: [list]
1177
+
1178
+ ### Quality: [Good/Needs Work]
1179
+ - Clarity: [assessment]
1180
+ - Audience fit: [assessment]
1181
+ - Issues: [list]
1182
+
1183
+ ### Recommendations
1184
+ 1. [Recommendation 1]
1185
+ 2. [Recommendation 2]
1186
+ ```
1187
+
1188
+ ### Gate
1189
+ - [ ] Documentation matches architecture
1190
+ - [ ] All examples verified
1191
+ - [ ] No broken links
1192
+ - [ ] Quality acceptable
1193
+
1194
+ ### Feedback Loop
1195
+ If issues found:
1196
+ 1. Note specific problems
1197
+ 2. Return to GENERATE phase
1198
+ 3. Fix issues
1199
+ 4. Re-review
1200
+
1201
+ ---
1202
+
1203
+ ## Quick Reference
1204
+
1205
+ ### Architecture Docs
1206
+ | Stack | Doc |
1207
+ |-------|-----|
1208
+ | All | `clean-architecture.md` |
1209
+ | Flutter | `flutter-mobile.md` |
1210
+ | React | `react-frontend.md` |
1211
+ | Go | `go-backend.md` |
1212
+ | Laravel | `laravel-backend.md` |
1213
+ | Remix | `remix-fullstack.md` |
1214
+ | Monorepo | `monorepo.md` |
1215
+
1216
+ ### Documentation Types
1217
+
1218
+ | Type | File | Purpose | Priority |
1219
+ |------|------|---------|----------|
1220
+ | Project Overview | README.md | First impression, quick start | High |
1221
+ | API Reference | API.md | Endpoint documentation | High |
1222
+ | Architecture | ARCHITECTURE.md | System design, patterns | Medium |
1223
+ | Contributing | CONTRIBUTING.md | Contribution guidelines | Medium |
1224
+ | Setup Guide | SETUP.md | Detailed installation | Medium |
1225
+ | User Guide | GUIDE.md | Feature tutorials | Low |
1226
+ | Changelog | CHANGELOG.md | Version history | Low |
1227
+
1228
+ ### Phase Summary
1229
+ | Phase | Key Actions | Output |
1230
+ |-------|-------------|--------|
1231
+ | SCAN | Read architecture, identify gaps | Documentation gap list |
1232
+ | ANALYZE | Plan content, create outlines | Documentation plan |
1233
+ | GENERATE | Write docs using templates | Complete documentation |
1234
+ | REVIEW | Verify accuracy, test examples | Review report |
1235
+
1236
+ ### Doc Templates Quick Access
1237
+
1238
+ **README**: Project overview, quick start, usage
1239
+ **API**: Endpoints, schemas, examples, errors
1240
+ **ARCHITECTURE**: System design, layers, patterns, data flow
1241
+ **CONTRIBUTING**: Setup, workflow, standards, PR process
1242
+
1243
+ ### Verification Checklist
1244
+
1245
+ Before completing documentation:
1246
+
1247
+ **Technical Accuracy**:
1248
+ - [ ] All commands work
1249
+ - [ ] All paths exist
1250
+ - [ ] All code compiles
1251
+ - [ ] All examples run
1252
+
1253
+ **Architecture Alignment**:
1254
+ - [ ] Reflects actual architecture
1255
+ - [ ] Uses correct patterns
1256
+ - [ ] Follows conventions
1257
+ - [ ] Matches directory structure
1258
+
1259
+ **Completeness**:
1260
+ - [ ] All sections complete
1261
+ - [ ] No TODOs left
1262
+ - [ ] All features documented
1263
+ - [ ] All APIs documented
1264
+
1265
+ **Quality**:
1266
+ - [ ] Clear and concise
1267
+ - [ ] Consistent formatting
1268
+ - [ ] Proper grammar
1269
+ - [ ] Links work
1270
+
1271
+ ### Common Documentation Patterns
1272
+
1273
+ **Stack-Specific Commands**:
1274
+
1275
+ | Stack | Install | Run | Test | Format |
1276
+ |-------|---------|-----|------|--------|
1277
+ | Flutter | `flutter pub get` | `flutter run` | `flutter test` | `dart format .` |
1278
+ | React | `npm install` | `npm run dev` | `npm test` | `npm run format` |
1279
+ | Go | `go mod download` | `go run .` | `go test ./...` | `go fmt ./...` |
1280
+ | Laravel | `composer install` | `php artisan serve` | `php artisan test` | `./vendor/bin/pint` |
1281
+ | Remix | `npm install` | `npm run dev` | `npm test` | `npm run format` |
1282
+
1283
+ ### Mermaid Diagram Types
1284
+
1285
+ **Flowchart**: System architecture, data flow
1286
+ ```mermaid
1287
+ graph TB
1288
+ A[Start] --> B[Process]
1289
+ B --> C[End]
1290
+ ```
1291
+
1292
+ **Sequence**: API flow, request/response
1293
+ ```mermaid
1294
+ sequenceDiagram
1295
+ Client->>Server: Request
1296
+ Server->>DB: Query
1297
+ DB-->>Server: Data
1298
+ Server-->>Client: Response
1299
+ ```
1300
+
1301
+ **ER Diagram**: Database schema
1302
+ ```mermaid
1303
+ erDiagram
1304
+ USER ||--o{ ORDER : places
1305
+ USER {
1306
+ int id
1307
+ string email
1308
+ }
1309
+ ```
1310
+
1311
+ ---
1312
+
1313
+ ## Tips
1314
+
1315
+ 1. **Always read architecture doc first** - Documentation must match reality
1316
+ 2. **Test everything** - Run all commands, examples before publishing
1317
+ 3. **Use real examples** - Extract from actual codebase, not invented
1318
+ 4. **Keep it updated** - Documentation rots fast, update with code changes
1319
+ 5. **Target the audience** - README for users, CONTRIBUTING for developers
1320
+ 6. **Link liberally** - Cross-reference between docs
1321
+ 7. **Show, don't tell** - Examples > explanations
1322
+ 8. **Be consistent** - Same terminology, formatting throughout
1323
+
1324
+ ## Success Criteria
1325
+
1326
+ Documentation is complete when:
1327
+ 1. Follows architecture patterns from doc
1328
+ 2. All commands verified working
1329
+ 3. All code examples tested
1330
+ 4. New contributor can onboard using docs
1331
+ 5. API user can integrate using docs
1332
+ 6. No broken links or TODOs
1333
+ 7. Reviewed and approved