moicle 2.3.1 → 3.0.1

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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -49
  3. package/assets/commands/marketing.md +6 -6
  4. package/assets/skills/challenge/SKILL.md +57 -0
  5. package/assets/skills/docs/sync/SKILL.md +195 -157
  6. package/assets/skills/feature/build/SKILL.md +891 -0
  7. package/assets/skills/feature/track/SKILL.md +8 -8
  8. package/assets/skills/fix/bug/SKILL.md +449 -0
  9. package/assets/skills/fix/incident/SKILL.md +6 -6
  10. package/assets/skills/marketing/brand/SKILL.md +304 -0
  11. package/assets/skills/marketing/content/SKILL.md +199 -141
  12. package/assets/skills/research/explore/SKILL.md +392 -0
  13. package/assets/skills/review/code/SKILL.md +622 -0
  14. package/dist/commands/install/usage.js +2 -2
  15. package/dist/commands/install/usage.js.map +1 -1
  16. package/package.json +1 -1
  17. package/assets/skills/docs/write/SKILL.md +0 -274
  18. package/assets/skills/feature/api/SKILL.md +0 -277
  19. package/assets/skills/feature/deprecate/SKILL.md +0 -276
  20. package/assets/skills/feature/new/SKILL.md +0 -273
  21. package/assets/skills/feature/refactor/SKILL.md +0 -269
  22. package/assets/skills/fix/hotfix/SKILL.md +0 -233
  23. package/assets/skills/fix/pr-comment/SKILL.md +0 -186
  24. package/assets/skills/fix/root-cause/SKILL.md +0 -276
  25. package/assets/skills/marketing/logo/SKILL.md +0 -252
  26. package/assets/skills/marketing/seo-blog/SKILL.md +0 -367
  27. package/assets/skills/marketing/video/SKILL.md +0 -258
  28. package/assets/skills/research/onboarding/SKILL.md +0 -225
  29. package/assets/skills/research/spike/SKILL.md +0 -228
  30. package/assets/skills/research/web/SKILL.md +0 -204
  31. package/assets/skills/review/architect/SKILL.md +0 -274
  32. package/assets/skills/review/branch/SKILL.md +0 -277
  33. package/assets/skills/review/pr/SKILL.md +0 -231
  34. package/assets/skills/review/tdd/SKILL.md +0 -245
@@ -1,70 +1,189 @@
1
1
  ---
2
2
  name: docs-sync
3
- description: Sync documentation workflow - reads codebase and docs folder to generate structured output docs with architecture, use cases, diagrams, and README index. Includes automated review loop. Use when user says "sync docs", "sync documentation", "generate docs", "update docs sync", "doc sync".
3
+ description: Documentation workflow with two modes — SINGLE (hand-author a specific doc like README/API.md/ARCHITECTURE.md with full control over voice) and FULL (auto-generate the whole docs/ site — business, architecture, use-cases with sequence diagrams, README index with a 3-iteration review loop). Use when user says "document", "generate docs", "write docs", "create documentation", "update docs", "sync docs", "sync documentation", "doc sync".
4
+ args: "[MODE]"
4
5
  ---
5
6
 
6
- # Sync Docs Workflow
7
+ # Documentation Workflow
7
8
 
8
- Generate a complete `docs/` site (business overview, architecture, use cases with sequence diagrams, README index) from the current codebase. Includes a 3-iteration auto-review loop.
9
+ One skill, two depths: hand-author a single doc, or batch-generate a whole docs site.
9
10
 
10
- ## When to use this skill
11
+ ## Pick your mode
11
12
 
12
- - Re-generate the whole `docs/` site from current code
13
- - ✅ Existing docs have drifted; want batch sync with review loop
14
- - Project has no structured docs at all
15
- - Authoring a single doc by hand (README / API.md only) → use `/docs-write`
16
- - ❌ Understand the codebase, not document it → use `/research-onboarding`
17
- - ❌ Adding doc for one endpoint → use `/feature-api` Phase 4
13
+ | Situation | Mode | Jump to |
14
+ |-----------|------|---------|
15
+ | Authoring / updating a specific doc with opinionated prose | **SINGLE** | [Mode SINGLE](#mode-single) |
16
+ | Re-generating the whole `docs/` site from current code | **FULL** | [Mode FULL](#mode-full) |
17
+
18
+ - ❌ Just need API reference from OpenAPI → use `/feature-build` (API mode), Phase 4
19
+ - ❌ Understand the codebase, not document it → use `/research-explore` (ONBOARDING)
18
20
 
19
- ## Read Architecture First
21
+ ## Read Architecture First (both modes)
20
22
 
21
- Detect stack via `~/.claude/architecture/_shared/stack-detection.md`. Read `ddd-architecture.md` + stack doc.
23
+ Detect stack via `~/.claude/architecture/_shared/stack-detection.md`. Read `ddd-architecture.md` + the stack doc. Docs must reflect the architecture, not contradict it.
22
24
 
25
+ ---
23
26
  ---
24
27
 
28
+ # Mode SINGLE
29
+
30
+ Hand-author project docs (README, API.md, ARCHITECTURE.md, CONTRIBUTING.md) with full control over voice and structure.
31
+
32
+ ## When to use
33
+ - ✅ Authoring or updating a specific document
34
+ - ✅ Need opinionated prose, not just structure
35
+ - ✅ Doc is small / scoped — a single file or section
36
+ - ❌ Want automated multi-doc generation → **Mode FULL**
37
+
25
38
  ## Workflow
26
39
 
27
40
  ```
28
- SCAN → CONFIRM mode → GENERATE → REVIEW loop (≤3x) → COMPLETE
41
+ SCAN → ANALYZE → GENERATE → REVIEW (loop)
42
+ ```
43
+
44
+ ## Phase 1: SCAN
45
+
46
+ ```bash
47
+ tree -L 3 -I 'node_modules|vendor|dist|build'
48
+ find . -maxdepth 3 -name "*.md" -o -name "README*"
49
+ ```
50
+
51
+ Identify what needs work: README, API.md, ARCHITECTURE.md, CONTRIBUTING.md, setup/deployment/runbook, DB schema, config reference.
52
+
53
+ ### Gate
54
+ - [ ] Architecture doc read · Existing docs inventoried · Gaps identified, priorities set
55
+
56
+ ## Phase 2: ANALYZE
57
+
58
+ For each doc define: **Purpose** (what problem it solves), **Audience** (new contributor / API consumer / on-call), **Source** (which code feeds it).
59
+
60
+ ### Required sections per doc type
61
+
62
+ **README.md** — one-line description + badges · quick start (≤5 commands) · tech stack (link to architecture) · common commands · project structure (top 2 levels) · links to other docs
63
+
64
+ **API.md** — auth method + credentials · base URL per env · per endpoint (method, path, request, response, errors, example) · pagination (one block) · error format (one block) · rate limits, versioning
65
+
66
+ **ARCHITECTURE.md** — one mermaid layer diagram · domain list with 1-line responsibility · cross-domain communication (events) · key tech decisions with rationale · link to `~/.claude/architecture/<stack>.md`
67
+
68
+ **CONTRIBUTING.md** — local dev setup (≤5 steps) · branch + commit conventions · PR flow + review expectations · test commands + coverage · where to ask for help
69
+
70
+ ### Gate
71
+ - [ ] Each doc has purpose, audience, source · Required sections listed · Aligned with architecture doc
72
+
73
+ ## Phase 3: GENERATE
74
+
75
+ ### Rules
76
+ - **Use real code from the repo** — never invent examples
77
+ - **Link to architecture docs**, don't duplicate them
78
+ - **Code blocks must be runnable** — copy verbatim from working files
79
+ - **Diagrams** — mermaid; one per major concept
80
+ - **Tables** for any list with >3 parallel items
81
+
82
+ ### Minimal skeletons
83
+
84
+ **README.md** (≤80 lines for most projects)
85
+ ```markdown
86
+ # {Project Name}
87
+ > One-line value proposition.
88
+ ## Quick Start
89
+ `{install}` then `{run}`
90
+ ## Tech Stack
91
+ - {language + version}, {framework}, {DB / queue} → see [ARCHITECTURE.md](./ARCHITECTURE.md)
92
+ ## Commands
93
+ | Command | Purpose |
94
+ ## Docs
95
+ - [API.md](./API.md) · [ARCHITECTURE.md](./ARCHITECTURE.md) · [CONTRIBUTING.md](./CONTRIBUTING.md)
29
96
  ```
30
97
 
31
- `CONFIRM` asks the user to pick **REFACTOR** (full restructure of `docs/`) or **UPDATE** (keep existing structure, refresh content).
98
+ **API.md** (per-endpoint block)
99
+ ```markdown
100
+ ### POST /resource
101
+ Create a resource. Idempotent via `Idempotency-Key` header.
102
+ **Auth:** Bearer
103
+ **Request** `{ "field": "value" }`
104
+ **Response 201** `{ "id": "...", "field": "value" }`
105
+ **Errors:** `invalid_field` 400 · `unauthorized` 401 · `already_exists` 409
106
+ ```
107
+
108
+ **ARCHITECTURE.md** opener
109
+ ```markdown
110
+ # Architecture
111
+ ## Overview
112
+ {1-2 paragraphs: what this system does, key constraints}
113
+ ## Layers
114
+ ```mermaid
115
+ graph TD
116
+ App[Application] --> Domain
117
+ Domain --> Infra[Infrastructure]
118
+ ```
119
+ See [DDD rules](~/.claude/architecture/ddd-architecture.md) for layer details.
120
+ ## Domains
121
+ | Domain | Responsibility |
122
+ ```
123
+
124
+ **CONTRIBUTING.md** opener
125
+ ```markdown
126
+ # Contributing
127
+ ## Setup
128
+ `{1-5 commands}`
129
+ ## Branch + Commits
130
+ - Branch: `{prefix}/{ticket}-{slug}` · Commit: Conventional Commits
131
+ ## PR Flow
132
+ 1. Open PR vs `{base}` → 2. CI green → 3. ≥1 review approval → 4. Squash merge
133
+ ```
134
+
135
+ ### Gate
136
+ - [ ] All planned docs drafted · Code examples from real files · Diagrams render · Cross-links work
137
+
138
+ ## Phase 4: REVIEW
139
+
140
+ ### Per-doc checklist
141
+ - [ ] Reflects current architecture (not outdated)
142
+ - [ ] All commands run as written (try them)
143
+ - [ ] All file paths exist · All endpoints / functions referenced still exist
144
+ - [ ] Internal + external links resolve · Code blocks compile · Diagrams match code
145
+
146
+ ### Cross-doc consistency
147
+ - [ ] Same terminology everywhere · No duplicated info — link instead
148
+
149
+ ### Loop
150
+ If any issue → return to Phase 3 for that doc, fix, re-review.
32
151
 
152
+ ---
33
153
  ---
34
154
 
35
- ## Phase 1: SCAN
155
+ # Mode FULL
156
+
157
+ Generate a complete `docs/` site (business overview, architecture, use cases with sequence diagrams, README index) from the current codebase. Includes a 3-iteration auto-review loop.
158
+
159
+ ## When to use
160
+ - ✅ Re-generate the whole `docs/` site from current code
161
+ - ✅ Existing docs have drifted; want batch sync with review loop
162
+ - ✅ Project has no structured docs at all
163
+ - ❌ Authoring a single doc by hand → **Mode SINGLE**
164
+ - ❌ Understand the codebase, not document it → `/research-explore` (ONBOARDING)
36
165
 
37
- **Goal:** map codebase + existing docs in one pass.
166
+ ## Workflow
167
+
168
+ ```
169
+ SCAN → CONFIRM mode → GENERATE → REVIEW loop (≤3x) → COMPLETE
170
+ ```
171
+
172
+ ## Phase 1: SCAN
38
173
 
39
174
  ```bash
40
- # Existing docs
41
175
  find . -name "*.md" -not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/.dart_tool/*" | sort
42
176
  ls docs/ 2>/dev/null
43
-
44
- # Code surface
45
177
  tree -L 4 -I 'node_modules|vendor|dist|build|.dart_tool|.git'
46
-
47
- # Entry points / use cases (per stack)
48
- # Go: grep -r "func.*Handler" internal/
49
- # NestJS: grep -r "@Controller\|@Get\|@Post" src/
50
- # Laravel: cat routes/web.php routes/api.php
51
- # Remix: ls app/routes/
52
- # Flutter: grep -r "MaterialPageRoute\|GoRoute" lib/
178
+ # Entry points per stack:
179
+ # Go: grep -r "func.*Handler" internal/ · NestJS: grep -r "@Controller\|@Get\|@Post" src/
180
+ # Laravel: cat routes/web.php routes/api.php · Remix: ls app/routes/ · Flutter: grep -r "GoRoute" lib/
53
181
  ```
54
182
 
55
- ### Extract
56
- - Stack + framework
57
- - All domains / modules
58
- - All user-facing flows (endpoints / screens / commands)
59
- - Existing docs structure (if any)
183
+ **Extract:** stack + framework, all domains/modules, all user-facing flows, existing docs structure.
60
184
 
61
185
  ### Gate
62
- - [ ] Stack identified
63
- - [ ] All domains listed
64
- - [ ] All use cases listed (count + brief name)
65
- - [ ] Existing docs inventoried
66
-
67
- ---
186
+ - [ ] Stack identified · All domains listed · All use cases listed (count + name) · Existing docs inventoried
68
187
 
69
188
  ## Phase 1.5: CONFIRM
70
189
 
@@ -72,21 +191,16 @@ Ask the user **explicitly** which mode:
72
191
 
73
192
  | Mode | When to use | Effect |
74
193
  |------|-------------|--------|
75
- | **REFACTOR** | Existing docs are messy / partial / wrong structure | Restructure `docs/` from scratch, may delete old files |
76
- | **UPDATE** | Existing structure is fine, content is stale | Keep file paths + headings, refresh content + add missing sections |
194
+ | **REFACTOR** | Existing docs messy / partial / wrong structure | Restructure `docs/` from scratch, may delete old files |
195
+ | **UPDATE** | Existing structure fine, content stale | Keep file paths + headings, refresh content + add missing sections |
77
196
 
78
- If the user is unsure: default to **UPDATE** (less destructive).
197
+ If unsure: default to **UPDATE** (less destructive).
79
198
 
80
199
  ### Gate
81
- - [ ] User confirmed mode
82
- - [ ] If REFACTOR: explicit OK to remove old files
83
-
84
- ---
200
+ - [ ] User confirmed mode · If REFACTOR: explicit OK to remove old files
85
201
 
86
202
  ## Phase 2: GENERATE
87
203
 
88
- **Goal:** produce the target `docs/` tree.
89
-
90
204
  ### Target structure (REFACTOR mode)
91
205
 
92
206
  ```
@@ -96,150 +210,74 @@ docs/
96
210
  ├── architecture.md # HOW it's structured (layers + domains + tech)
97
211
  ├── use-cases/
98
212
  │ ├── README.md # Index of use cases
99
- ├── <use-case-1>.md # One file per user-facing flow, with sequence diagram
100
- │ └── ...
213
+ └── <use-case>.md # One file per user-facing flow, with sequence diagram
101
214
  ├── api.md # If service has external API
102
215
  └── runbook.md # How to run / deploy / debug
103
216
  ```
104
217
 
105
218
  ### File rules
106
-
107
- **`docs/README.md`** — index only (≤30 lines).
108
- - One-line description, link to each sub-doc, last-updated timestamp.
109
-
110
- **`docs/business.md`** — for non-engineers.
111
- - NO API endpoints, NO code blocks, NO file paths
112
- - Cover: what problem this solves, who uses it, key user journeys (named like a PRD), success metrics
113
- - Plain language, no jargon
114
-
115
- **`docs/architecture.md`** — for engineers.
116
- - Layer diagram (mermaid)
117
- - Domain list with 1-line responsibility
118
- - Cross-domain communication pattern
119
- - Tech decisions (DB, queue, cache, auth — with rationale)
120
- - Link to `~/.claude/architecture/<stack>.md` for layer rules
121
-
122
- **`docs/use-cases/<name>.md`** — one per flow.
123
- - Trigger (who, what action)
124
- - Preconditions
125
- - Sequence diagram (mermaid `sequenceDiagram`) showing actor → handler → usecase → infra → response
126
- - Postconditions / side effects (events raised, notifications sent)
127
- - Errors (each with HTTP code + meaning)
128
-
129
- **`docs/api.md`** — only if external API exists.
130
- - Auth, base URL, error format, pagination — then endpoint table
131
- - For deep API ref, link to OpenAPI spec
132
-
133
- **`docs/runbook.md`** — for ops / on-call.
134
- - Local dev (≤5 commands)
135
- - Deploy steps
136
- - Common failures + how to recover
137
- - Monitoring dashboards + log queries
219
+ - **`docs/README.md`** — index only (≤30 lines): one-line description, link to each sub-doc, last-updated timestamp.
220
+ - **`docs/business.md`** — for non-engineers. NO API endpoints, NO code blocks, NO file paths. Cover: what problem this solves, who uses it, key user journeys (named like a PRD), success metrics. Plain language.
221
+ - **`docs/architecture.md`** — for engineers. Layer diagram (mermaid), domain list, cross-domain communication, tech decisions with rationale, link to `~/.claude/architecture/<stack>.md`.
222
+ - **`docs/use-cases/<name>.md`** — one per flow: trigger (who, what), preconditions, sequence diagram (mermaid `sequenceDiagram`: actor → handler → usecase → infra → response), postconditions / side effects, errors (HTTP code + meaning).
223
+ - **`docs/api.md`** — only if external API exists. Auth, base URL, error format, pagination → then endpoint table. Deep ref → link to OpenAPI spec.
224
+ - **`docs/runbook.md`** for ops/on-call: local dev (≤5 commands), deploy steps, common failures + recovery, monitoring dashboards + log queries.
138
225
 
139
226
  ### Mermaid rules
140
-
141
- - Sequence diagrams for use cases
142
- - Class diagrams only when ER is non-obvious
143
- - Validate syntax: `mermaid-cli` if available, otherwise eyeball test
144
- - ≤7 actors per sequence (split if more)
227
+ Sequence diagrams for use cases · class diagrams only when ER is non-obvious · validate syntax · ≤7 actors per sequence (split if more).
145
228
 
146
229
  ### Gate
147
- - [ ] All target files written
148
- - [ ] business.md has zero code / endpoints
149
- - [ ] Every use case has a sequence diagram
150
- - [ ] README.md links to every file
151
- - [ ] All file paths in docs resolve (no broken references)
152
-
153
- ---
230
+ - [ ] All target files written · business.md has zero code/endpoints · Every use case has a sequence diagram · README links to every file · All file paths resolve
154
231
 
155
232
  ## Phase 3: REVIEW LOOP (≤3 iterations)
156
233
 
157
- **Goal:** auto-check + fix until docs pass.
158
-
159
234
  For each iteration:
235
+ - **3.1 Structure** — all target files exist · README links resolve · no duplicate content
236
+ - **3.2 Business** — plain language (no `API`/`JSON`/`class`/file paths) · covers all top-level journeys
237
+ - **3.3 Architecture** — layer diagram matches code · every domain has a table row
238
+ - **3.4 Use cases** — one file per identified use case · each has trigger/preconditions/sequence/postconditions/errors · diagrams render
239
+ - **3.5 Consistency** — same terminology everywhere · no nonexistent file paths / endpoints referenced
160
240
 
161
- ### 3.1 Structure
162
- - [ ] All target files exist
163
- - [ ] README.md links resolve
164
- - [ ] No duplicate content across files
165
-
166
- ### 3.2 Business
167
- - [ ] business.md uses plain language (no `API`, `JSON`, `class`, file paths)
168
- - [ ] business.md covers all top-level user journeys
169
-
170
- ### 3.3 Architecture
171
- - [ ] Layer diagram matches actual code structure
172
- - [ ] Every code domain has a row in domain table
173
-
174
- ### 3.4 Use cases
175
- - [ ] One file per identified use case (Phase 1)
176
- - [ ] Each has trigger / preconditions / sequence / postconditions / errors
177
- - [ ] Sequence diagrams render
178
-
179
- ### 3.5 Consistency
180
- - [ ] Same terminology everywhere (e.g., "domain" vs "module")
181
- - [ ] No file paths referenced that don't exist
182
- - [ ] No endpoints referenced that don't exist in code
183
-
184
- ### Loop
185
- - If any check fails → fix that section, restart the relevant subset of checks
186
- - Max 3 iterations; if still failing → report what's blocking + ask user
187
-
188
- ---
241
+ **Loop:** any check fails → fix that section, restart the relevant subset. Max 3 iterations; if still failing → report what's blocking + ask user.
189
242
 
190
243
  ## Phase 4: COMPLETE
191
244
 
192
245
  ```markdown
193
246
  ## Docs Sync Complete
194
-
195
247
  ### Mode: {REFACTOR / UPDATE}
196
-
197
- ### Files
198
- - Created: {N}
199
- - Updated: {N}
200
- - Deleted: {N — REFACTOR mode only}
201
-
202
- ### Coverage
203
- - Domains documented: {N/N}
204
- - Use cases documented: {N/N}
205
- - Diagrams: {N}
206
-
248
+ ### Files: Created {N} · Updated {N} · Deleted {N — REFACTOR only}
249
+ ### Coverage: Domains {N/N} · Use cases {N/N} · Diagrams {N}
207
250
  ### Review iterations: {1/2/3}
208
-
209
- ### Next steps for the team
210
- - Review `docs/business.md` with product
211
- - Validate `docs/use-cases/*.md` flows with team leads
212
- - Set up doc lint in CI (broken-link checker)
251
+ ### Next steps: review business.md with product · validate use-cases with leads · set up doc lint in CI
213
252
  ```
214
253
 
254
+ ---
215
255
  ---
216
256
 
217
- ## Hard Rules
218
-
219
- - **business.md is for humans** — strip jargon, no code, no file paths
220
- - **architecture.md links to canonical rules**, doesn't duplicate them
221
- - **One use case per file** — easier to update, easier to review
222
- - **Mermaid only if it renders** — broken diagrams worse than no diagrams
223
- - **REFACTOR mode requires explicit user OK** — never delete docs without confirmation
224
- - **Max 3 review iterations** — beyond that, the prompt or scope is the problem, not the docs
257
+ ## Hard Rules (both modes)
225
258
 
226
- ---
259
+ - **Real examples only** — invented code drifts and lies.
260
+ - **Link, don't duplicate** — refer to architecture docs, don't restate rules.
261
+ - **Test every command** before publishing.
262
+ - **Update the doc when you change the code** — stale docs are worse than no docs.
263
+ - **SINGLE:** opinionated prose, full voice control.
264
+ - **FULL:** business.md is for humans (strip jargon, no code/paths); one use case per file; mermaid only if it renders; **REFACTOR mode requires explicit user OK** — never delete docs without confirmation; max 3 review iterations.
227
265
 
228
266
  ## Related Skills
229
267
 
230
268
  | When | Use |
231
269
  |------|-----|
232
- | Author single doc by hand | `/docs-write` |
233
- | Onboard self / new dev | `/research-onboarding` |
234
- | Doc only one new endpoint | `/feature-api` Phase 4 |
235
- | Architecture itself needs review | `/review-architect` |
270
+ | Document a newly added API endpoint | `/feature-build` (API mode), Phase 4 |
271
+ | Onboard self / new dev | `/research-explore` (ONBOARDING) |
272
+ | Architecture itself needs review | `/review-code` (ARCHITECT mode) |
273
+ | Write blog / social content | `/marketing-content` |
236
274
 
237
275
  ## Recommended Agents
238
276
 
239
277
  | Phase | Agent | Purpose |
240
278
  |-------|-------|---------|
241
- | SCAN | `@clean-architect` | Identify domains + patterns |
242
- | GENERATE | `@docs-writer` | Write all doc files |
243
- | GENERATE | `@api-designer` | API reference accuracy |
244
- | GENERATE | `@db-designer` | Data model accuracy |
245
- | REVIEW | `@code-reviewer` | Verify code refs resolve |
279
+ | SCAN | `@clean-architect` | Identify doc needs / domains + patterns |
280
+ | ANALYZE / GENERATE (API) | `@api-designer` | API doc structure + accuracy |
281
+ | ANALYZE / GENERATE (DB) | `@db-designer` | Database doc structure + accuracy |
282
+ | GENERATE | `@docs-writer` | Write all docs |
283
+ | REVIEW | `@code-reviewer` | Verify accuracy vs code |