moicle 2.0.0 → 2.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.
@@ -5,15 +5,19 @@ description: Documentation workflow for authoring project documentation manually
5
5
 
6
6
  # Documentation Workflow
7
7
 
8
- Author project documentation manually following stack conventions. **Use this when you want full control** over the output (README, API.md, ARCHITECTURE.md, CONTRIBUTING.md). For automated batch generation with review loop, use `/docs:sync` instead.
8
+ Hand-author project docs (README, API.md, ARCHITECTURE.md, CONTRIBUTING.md) with full control over voice and structure. For automated batch generation of a whole `docs/` tree with a review loop, use `/docs:sync` instead.
9
9
 
10
10
  ## When to use this skill
11
11
 
12
- - ✅ Authoring or updating a specific document (README, API, ARCHITECTURE, CONTRIBUTING)
13
- - ✅ Need to write opinionated prose, not just structure
12
+ - ✅ Authoring or updating a specific document
13
+ - ✅ Need opinionated prose, not just structure
14
14
  - ✅ Doc is small / scoped — a single file or section
15
- - ❌ Want fully automated multi-doc generation → use `/docs:sync`
16
- - ❌ Just need API reference from OpenAPI spec → use `/feature:api` Phase 4
15
+ - ❌ Want automated multi-doc generation → use `/docs:sync`
16
+ - ❌ Just need API reference from OpenAPI → use `/feature:api` Phase 4
17
+
18
+ ## Read Architecture First
19
+
20
+ Detect stack via `~/.claude/architecture/_shared/stack-detection.md`. Read `ddd-architecture.md` + stack doc. Docs must reflect the architecture, not contradict it.
17
21
 
18
22
  ---
19
23
 
@@ -23,98 +27,71 @@ Author project documentation manually following stack conventions. **Use this wh
23
27
  SCAN → ANALYZE → GENERATE → REVIEW (loop)
24
28
  ```
25
29
 
26
- ## Read Architecture First
27
-
28
- Before writing, read:
29
- 1. `~/.claude/architecture/ddd-architecture.md` (core)
30
- 2. Stack-specific doc (see Stack Detection below)
31
- 3. `.claude/architecture/` for project overrides (if any)
32
-
33
- **Documentation must accurately reflect the architecture and patterns used in the codebase.**
34
-
35
- ### Stack Detection
36
- | File | Doc |
37
- |------|-----|
38
- | `go.mod` | `go-backend.md` |
39
- | `package.json` + NestJS dep | `nodejs-nestjs.md` |
40
- | `package.json` + Vite config | `react-frontend.md` |
41
- | `remix.config.*` | `remix-fullstack.md` |
42
- | `composer.json` | `laravel-backend.md` |
43
- | `pubspec.yaml` | `flutter-mobile.md` |
44
-
45
30
  ---
46
31
 
47
32
  ## Phase 1: SCAN
48
33
 
49
- **Goal:** identify what needs documentation.
50
-
51
- ### Actions
52
- 1. Read architecture doc for the stack
53
- 2. Scan codebase:
54
- ```bash
55
- tree -L 3 -I 'node_modules|vendor|dist|build'
56
- find . -maxdepth 3 -name "*.md" -o -name "README*"
57
- ```
58
- 3. Identify documentable items:
59
- - README (project overview)
60
- - API documentation (endpoints, schemas)
61
- - ARCHITECTURE (system design, layer rules)
62
- - CONTRIBUTING (dev setup, PR flow, conventions)
63
- - Setup / deployment guides
64
- - Database schema
65
- - Configuration reference
34
+ ```bash
35
+ tree -L 3 -I 'node_modules|vendor|dist|build'
36
+ find . -maxdepth 3 -name "*.md" -o -name "README*"
37
+ ```
38
+
39
+ Identify what needs work:
40
+ - README (project overview)
41
+ - API.md (endpoints, schemas)
42
+ - ARCHITECTURE.md (system design)
43
+ - CONTRIBUTING.md (dev setup, PR flow)
44
+ - Setup / deployment / runbook
45
+ - DB schema, config reference
66
46
 
67
47
  ### Gate
68
48
  - [ ] Architecture doc read
69
49
  - [ ] Existing docs inventoried
70
- - [ ] Gaps identified
71
- - [ ] Priorities set (high → low)
50
+ - [ ] Gaps identified, priorities set
72
51
 
73
52
  ---
74
53
 
75
54
  ## Phase 2: ANALYZE
76
55
 
77
- **Goal:** define what each document MUST contain.
78
-
79
- For each doc:
80
- - **Purpose** — what problem does this doc solve?
81
- - **Audience** — new contributor / API consumer / ops team?
82
- - **Source** — which files / sections of the codebase feed this doc?
56
+ For each doc define:
57
+ - **Purpose** — what problem does this solve?
58
+ - **Audience** — new contributor / API consumer / on-call?
59
+ - **Source** — which files / sections of the code feed this doc?
83
60
 
84
61
  ### Required sections per doc type
85
62
 
86
- **README.md** must have:
63
+ **README.md**
87
64
  - One-line description + badges
88
- - Quick start (install → run in ≤5 commands)
65
+ - Quick start (≤5 commands)
89
66
  - Tech stack (link to architecture)
90
67
  - Common commands (build / test / lint / dev)
91
68
  - Project structure (top 2 levels only)
92
- - Link to ARCHITECTURE.md, CONTRIBUTING.md, API.md
69
+ - Link to ARCHITECTURE.md / CONTRIBUTING.md / API.md
93
70
 
94
- **API.md** must have:
95
- - Auth method (Bearer / OAuth / API key) + how to obtain
71
+ **API.md**
72
+ - Auth method + how to obtain credentials
96
73
  - Base URL per environment
97
- - For each endpoint: method, path, request schema, response schema, error codes, example
74
+ - Per endpoint: method, path, request, response, errors, example
98
75
  - Pagination convention (one block, not per endpoint)
99
76
  - Error response format (one block, not per endpoint)
100
77
  - Rate limits, versioning policy
101
78
 
102
- **ARCHITECTURE.md** must have:
103
- - 1 mermaid diagram of the layer structure (link to `ddd-architecture.md` for rules)
104
- - Domain list with 1-line responsibility each
79
+ **ARCHITECTURE.md**
80
+ - One mermaid layer diagram
81
+ - Domain list with 1-line responsibility
105
82
  - Cross-domain communication pattern (events)
106
- - Key tech decisions (why this DB, why this queue, why this auth)
107
- - Link to stack-specific architecture doc
83
+ - Key tech decisions (DB, queue, auth) with rationale
84
+ - Link to `~/.claude/architecture/<stack>.md` for layer rules
108
85
 
109
- **CONTRIBUTING.md** must have:
86
+ **CONTRIBUTING.md**
110
87
  - Local dev setup (prerequisites + ≤5 steps)
111
- - Branch / commit conventions
88
+ - Branch + commit conventions
112
89
  - PR flow + review expectations
113
90
  - Test commands + coverage expectations
114
91
  - Where to ask for help
115
92
 
116
93
  ### Gate
117
- - [ ] Each doc has clear purpose, audience, source
94
+ - [ ] Each doc has purpose, audience, source
118
95
  - [ ] Required sections listed
119
96
  - [ ] Aligned with architecture doc
120
97
 
@@ -122,83 +99,50 @@ For each doc:
122
99
 
123
100
  ## Phase 3: GENERATE
124
101
 
125
- **Goal:** write each doc using actual code examples from the codebase.
126
-
127
102
  ### Rules
128
103
  - **Use real code from the repo** — never invent examples
129
104
  - **Link to architecture docs**, don't duplicate them
130
105
  - **Code blocks must be runnable** — copy verbatim from working files
131
- - **Diagrams** — use mermaid; one per major concept
132
- - **Tables** for any list with >3 items and parallel structure (endpoints, env vars, commands)
106
+ - **Diagrams** — mermaid; one per major concept
107
+ - **Tables** for any list with >3 parallel items (endpoints, env vars, commands)
133
108
 
134
- ### Skeleton — README.md
109
+ ### Minimal skeletons
135
110
 
111
+ Use these as starting points. For full templates, see `/docs:sync` (which generates the full set).
112
+
113
+ **README.md** (≤80 lines for most projects)
136
114
  ```markdown
137
115
  # {Project Name}
138
116
 
139
117
  > One-line value proposition.
140
118
 
141
- [![ci](badge)](link) [![version](badge)](link)
142
-
143
119
  ## Quick Start
144
-
145
120
  ```bash
146
121
  {install}
147
122
  {run}
148
123
  ```
149
124
 
150
125
  ## Tech Stack
126
+ - {language + version}, {framework}, {DB / queue}
151
127
 
152
- - {language + version}
153
- - {framework}
154
- - {DB / queue / cache}
155
-
156
- See [ARCHITECTURE.md](./ARCHITECTURE.md) for layer structure.
157
-
158
- ## Common Commands
128
+ See [ARCHITECTURE.md](./ARCHITECTURE.md).
159
129
 
130
+ ## Commands
160
131
  | Command | Purpose |
161
132
  |---------|---------|
162
- | `{cmd}` | {what it does} |
163
-
164
- ## Project Structure
165
-
166
- ```
167
- {top 2 levels only}
168
- ```
169
-
170
- ## Documentation
133
+ | `{cmd}` | {what} |
171
134
 
172
- - [API.md](./API.md) — endpoint reference
173
- - [ARCHITECTURE.md](./ARCHITECTURE.md) system design
174
- - [CONTRIBUTING.md](./CONTRIBUTING.md) — dev guide
135
+ ## Docs
136
+ - [API.md](./API.md) · [ARCHITECTURE.md](./ARCHITECTURE.md) · [CONTRIBUTING.md](./CONTRIBUTING.md)
175
137
  ```
176
138
 
177
- ### Skeleton — API.md
178
-
139
+ **API.md** (per-endpoint block)
179
140
  ```markdown
180
- # API Reference
181
-
182
- **Base URL:** `https://api.example.com/v1`
183
- **Auth:** Bearer token in `Authorization` header
184
-
185
- ## Errors
186
-
187
- All errors return JSON:
188
- ```json
189
- { "error": { "code": "STRING", "message": "STRING", "details": {} } }
190
- ```
191
-
192
- ## Pagination
193
-
194
- Cursor-based: `?cursor=<opaque>&limit=<int, default 20, max 100>`.
195
- Response includes `pagination.next_cursor` (null if last page).
196
-
197
- ## Endpoints
198
-
199
141
  ### POST /resource
200
142
 
201
- Create a resource.
143
+ Create a resource. Idempotent via `Idempotency-Key` header.
144
+
145
+ **Auth:** Bearer
202
146
 
203
147
  **Request**
204
148
  ```json
@@ -210,115 +154,75 @@ Create a resource.
210
154
  { "id": "...", "field": "value" }
211
155
  ```
212
156
 
213
- **Errors:** 400 invalid_field, 401 unauthorized, 409 already_exists
157
+ **Errors:** `invalid_field` 400 · `unauthorized` 401 · `already_exists` 409
214
158
  ```
215
159
 
216
- ### Skeleton — ARCHITECTURE.md
217
-
160
+ **ARCHITECTURE.md** opener
218
161
  ```markdown
219
162
  # Architecture
220
163
 
221
164
  ## Overview
222
-
223
165
  {1-2 paragraphs: what this system does, key constraints}
224
166
 
225
- ## Layer Structure
226
-
167
+ ## Layers
227
168
  ```mermaid
228
169
  graph TD
229
170
  App[Application] --> Domain
230
171
  Domain --> Infra[Infrastructure]
231
172
  ```
232
-
233
- See [DDD architecture reference](~/.claude/architecture/ddd-architecture.md) for layer rules.
173
+ See [DDD rules](~/.claude/architecture/ddd-architecture.md) for layer details.
234
174
 
235
175
  ## Domains
236
-
237
176
  | Domain | Responsibility |
238
- |--------|----------------|
177
+ |--------|---------------|
239
178
  | {name} | {one line} |
240
-
241
- ## Cross-Domain Communication
242
-
243
- Domains communicate via **domain events** (no direct imports).
244
-
245
- ```mermaid
246
- sequenceDiagram
247
- DomainA->>EventBus: raises Event
248
- EventBus->>DomainB: Listener consumes
249
179
  ```
250
180
 
251
- ## Key Decisions
252
-
253
- | Decision | Rationale |
254
- |----------|-----------|
255
- | {tech / pattern} | {why} |
256
- ```
257
-
258
- ### Skeleton — CONTRIBUTING.md
259
-
181
+ **CONTRIBUTING.md** opener
260
182
  ```markdown
261
183
  # Contributing
262
184
 
263
- ## Prerequisites
264
- - {runtime + version}
265
- - {DB / service}
266
-
267
185
  ## Setup
268
186
  ```bash
269
187
  {1-5 commands}
270
188
  ```
271
189
 
272
- ## Branch & Commits
190
+ ## Branch + Commits
273
191
  - Branch: `{prefix}/{ticket}-{slug}`
274
- - Commit: Conventional Commits (`feat:`, `fix:`, `chore:`)
192
+ - Commit: Conventional Commits
275
193
 
276
194
  ## PR Flow
277
- 1. Open PR against `{base branch}`
278
- 2. CI must pass
279
- 3. At least 1 review approval
195
+ 1. Open PR vs `{base}`
196
+ 2. CI green
197
+ 3. 1 review approval
280
198
  4. Squash merge
281
-
282
- ## Tests
283
- ```bash
284
- {test command}
285
- ```
286
- Coverage target: {N}%
287
-
288
- ## Help
289
- - {Slack / issue / discussion link}
290
199
  ```
291
200
 
292
201
  ### Gate
293
202
  - [ ] All planned docs drafted
294
- - [ ] Code examples taken from real files (no invention)
295
- - [ ] Diagrams render (mermaid syntax valid)
203
+ - [ ] Code examples taken from real files
204
+ - [ ] Diagrams render
296
205
  - [ ] Cross-links between docs work
297
206
 
298
207
  ---
299
208
 
300
209
  ## Phase 4: REVIEW
301
210
 
302
- **Goal:** verify accuracy, consistency, and clarity.
303
-
304
- ### Review checklist per doc
305
-
211
+ ### Per-doc checklist
306
212
  - [ ] Reflects current architecture (not outdated)
307
213
  - [ ] All commands run as written (try them)
308
214
  - [ ] All file paths exist
309
215
  - [ ] All endpoints / functions referenced still exist
310
- - [ ] Links resolve (internal + external)
216
+ - [ ] Internal + external links resolve
311
217
  - [ ] Code blocks compile / are valid syntax
312
218
  - [ ] Diagrams match actual code structure
313
219
 
314
220
  ### Cross-doc consistency
315
-
316
- - [ ] README references match other docs' content
317
- - [ ] Same terminology used everywhere (e.g., "domain" vs "module")
221
+ - [ ] Same terminology everywhere (e.g., "domain" vs "module")
318
222
  - [ ] No duplicated info — link instead
319
223
 
320
224
  ### Loop
321
- If any issue found go back to **Phase 3** for that doc, fix, re-review.
225
+ If any issue → return to Phase 3 for that doc, fix, re-review.
322
226
 
323
227
  ---
324
228
 
@@ -327,19 +231,12 @@ If any issue found → go back to **Phase 3** for that doc, fix, re-review.
327
231
  ```markdown
328
232
  ## Documentation Update
329
233
 
330
- ### Files Created / Modified
234
+ ### Files
331
235
  - `README.md` — {changes}
332
236
  - `API.md` — {changes}
333
237
  - `ARCHITECTURE.md` — {changes}
334
238
  - `CONTRIBUTING.md` — {changes}
335
239
 
336
- ### Coverage
337
- - [x] Project overview
338
- - [x] API reference
339
- - [x] Architecture
340
- - [x] Contributing guide
341
- - [ ] Deployment (out of scope)
342
-
343
240
  ### Verification
344
241
  - [x] All commands tested
345
242
  - [x] All links resolve
@@ -348,24 +245,30 @@ If any issue found → go back to **Phase 3** for that doc, fix, re-review.
348
245
 
349
246
  ---
350
247
 
248
+ ## Hard Rules
249
+
250
+ - **Real examples only** — invented code drifts and lies
251
+ - **Link, don't duplicate** — refer to architecture docs, don't restate rules
252
+ - **Test every command** before publishing
253
+ - **Update the doc when you change the code** — stale docs are worse than no docs
254
+
255
+ ---
256
+
351
257
  ## Related Skills
352
258
 
353
259
  | When | Use |
354
260
  |------|-----|
355
- | Generate full doc site from codebase automatically | `/docs:sync` |
356
- | Document a newly added API endpoint | `/feature:api` (Phase 4) |
357
- | Onboard yourself / new dev to the codebase | `/research:onboarding` |
358
- | Write release notes / changelog | `release` (manually for now) |
359
-
360
- ---
261
+ | Generate full doc site from codebase | `/docs:sync` |
262
+ | Document a newly added API endpoint | `/feature:api` Phase 4 |
263
+ | Onboard self / new dev | `/research:onboarding` |
264
+ | Write blog / social content | `/marketing:content` |
361
265
 
362
266
  ## Recommended Agents
363
267
 
364
268
  | Phase | Agent | Purpose |
365
269
  |-------|-------|---------|
366
- | SCAN | `@clean-architect` | Identify doc needs from architecture |
270
+ | SCAN | `@clean-architect` | Identify doc needs |
367
271
  | ANALYZE (API) | `@api-designer` | API doc structure |
368
272
  | ANALYZE (DB) | `@db-designer` | Database doc structure |
369
273
  | GENERATE | `@docs-writer` | Write all docs |
370
- | REVIEW | `@code-reviewer` | Verify accuracy against code |
371
- | REVIEW | Stack-specific dev agent | Stack-specific review |
274
+ | REVIEW | `@code-reviewer` | Verify accuracy vs code |