thanh-kit 2.5.1 → 2.5.2

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 (123) hide show
  1. package/dist/index.js +20 -61
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/{commands → command-archive}/ask.md +5 -5
  5. package/templates/{commands → command-archive}/ck-help.md +18 -2
  6. package/templates/command-archive/docs/init.md +38 -0
  7. package/templates/command-archive/docs/summarize.md +22 -0
  8. package/templates/command-archive/docs/update.md +76 -0
  9. package/templates/command-archive/journal.md +18 -0
  10. package/templates/{commands → command-archive}/kanban.md +5 -7
  11. package/templates/{commands → command-archive}/plan/archive.md +2 -2
  12. package/templates/command-archive/plan/red-team.md +200 -0
  13. package/templates/command-archive/plan/validate.md +188 -0
  14. package/templates/command-archive/preview.md +283 -0
  15. package/templates/command-archive/review/codebase/parallel.md +122 -0
  16. package/templates/{commands → command-archive}/test/ui.md +3 -3
  17. package/templates/{commands → command-archive}/use-mcp.md +6 -2
  18. package/templates/command-archive/worktree.md +109 -0
  19. package/templates/{workflows → rules}/development-rules.md +12 -53
  20. package/templates/rules/orchestration-protocol.md +43 -0
  21. package/templates/{workflows → rules}/primary-workflow.md +16 -4
  22. package/templates/rules/team-coordination-rules.md +90 -0
  23. package/templates/schemas/ck-config.schema.json +381 -0
  24. package/templates/commands/README.md +0 -251
  25. package/templates/commands/bootstrap/auto/fast.md +0 -111
  26. package/templates/commands/bootstrap/auto/parallel.md +0 -66
  27. package/templates/commands/bootstrap/auto.md +0 -115
  28. package/templates/commands/bootstrap.md +0 -137
  29. package/templates/commands/brainstorm.md +0 -74
  30. package/templates/commands/build.md +0 -39
  31. package/templates/commands/checkpoint.md +0 -156
  32. package/templates/commands/code/auto.md +0 -170
  33. package/templates/commands/code/no-test.md +0 -158
  34. package/templates/commands/code/parallel.md +0 -55
  35. package/templates/commands/code-simplifier.md +0 -71
  36. package/templates/commands/code.md +0 -176
  37. package/templates/commands/compact.md +0 -57
  38. package/templates/commands/content/cro.md +0 -43
  39. package/templates/commands/content/enhance.md +0 -14
  40. package/templates/commands/content/fast.md +0 -13
  41. package/templates/commands/content/good.md +0 -16
  42. package/templates/commands/context.md +0 -48
  43. package/templates/commands/cook/auto/fast.md +0 -26
  44. package/templates/commands/cook/auto/parallel.md +0 -49
  45. package/templates/commands/cook/auto.md +0 -15
  46. package/templates/commands/cook/fast.md +0 -47
  47. package/templates/commands/cook/hard.md +0 -80
  48. package/templates/commands/cook/parallel.md +0 -90
  49. package/templates/commands/cook.md +0 -105
  50. package/templates/commands/create-feature.md +0 -48
  51. package/templates/commands/db-migrate.md +0 -52
  52. package/templates/commands/debug.md +0 -13
  53. package/templates/commands/design/3d.md +0 -83
  54. package/templates/commands/design/describe.md +0 -23
  55. package/templates/commands/design/fast.md +0 -31
  56. package/templates/commands/design/good.md +0 -35
  57. package/templates/commands/design/screenshot.md +0 -34
  58. package/templates/commands/design/video.md +0 -34
  59. package/templates/commands/docs/init.md +0 -39
  60. package/templates/commands/docs/summarize.md +0 -31
  61. package/templates/commands/docs/update.md +0 -57
  62. package/templates/commands/feature.md +0 -62
  63. package/templates/commands/fix/ci.md +0 -17
  64. package/templates/commands/fix/fast.md +0 -19
  65. package/templates/commands/fix/hard.md +0 -39
  66. package/templates/commands/fix/logs.md +0 -26
  67. package/templates/commands/fix/parallel.md +0 -54
  68. package/templates/commands/fix/test.md +0 -20
  69. package/templates/commands/fix/types.md +0 -9
  70. package/templates/commands/fix/ui.md +0 -48
  71. package/templates/commands/fix-issue.md +0 -177
  72. package/templates/commands/fix.md +0 -43
  73. package/templates/commands/generate-dto.md +0 -67
  74. package/templates/commands/git/cm.md +0 -5
  75. package/templates/commands/git/cp.md +0 -4
  76. package/templates/commands/git/merge.md +0 -40
  77. package/templates/commands/git/pr.md +0 -48
  78. package/templates/commands/integrate/polar.md +0 -28
  79. package/templates/commands/integrate/sepay.md +0 -28
  80. package/templates/commands/investigate.md +0 -324
  81. package/templates/commands/journal.md +0 -7
  82. package/templates/commands/lint.md +0 -47
  83. package/templates/commands/migration.md +0 -111
  84. package/templates/commands/performance.md +0 -110
  85. package/templates/commands/plan/ci.md +0 -33
  86. package/templates/commands/plan/cro.md +0 -69
  87. package/templates/commands/plan/fast.md +0 -86
  88. package/templates/commands/plan/hard.md +0 -103
  89. package/templates/commands/plan/parallel.md +0 -152
  90. package/templates/commands/plan/preview.md +0 -40
  91. package/templates/commands/plan/two.md +0 -52
  92. package/templates/commands/plan/validate.md +0 -132
  93. package/templates/commands/plan.md +0 -36
  94. package/templates/commands/pr.md +0 -49
  95. package/templates/commands/preview.md +0 -87
  96. package/templates/commands/release-notes.md +0 -144
  97. package/templates/commands/review/post-task.md +0 -157
  98. package/templates/commands/review-changes.md +0 -46
  99. package/templates/commands/review.md +0 -56
  100. package/templates/commands/scout/ext.md +0 -35
  101. package/templates/commands/scout.md +0 -283
  102. package/templates/commands/security.md +0 -119
  103. package/templates/commands/skill/add.md +0 -36
  104. package/templates/commands/skill/create.md +0 -29
  105. package/templates/commands/skill/fix-logs.md +0 -22
  106. package/templates/commands/skill/optimize/auto.md +0 -25
  107. package/templates/commands/skill/optimize.md +0 -34
  108. package/templates/commands/skill/plan.md +0 -45
  109. package/templates/commands/worktree.md +0 -126
  110. package/templates/memory/session-log.md +0 -186
  111. package/templates/router/README.md +0 -294
  112. package/templates/router/agents-guide.md +0 -38
  113. package/templates/router/commands-guide.md +0 -122
  114. package/templates/router/decision-flow.md +0 -92
  115. package/templates/router/skills-guide.md +0 -127
  116. package/templates/router/workflows-guide.md +0 -68
  117. package/templates/workflows/README.md +0 -241
  118. package/templates/workflows/orchestration-protocol.md +0 -16
  119. /package/templates/{commands → command-archive}/coding-level.md +0 -0
  120. /package/templates/{commands → command-archive}/review/codebase.md +0 -0
  121. /package/templates/{commands → command-archive}/test.md +0 -0
  122. /package/templates/{commands → command-archive}/watzup.md +0 -0
  123. /package/templates/{workflows → rules}/documentation-management.md +0 -0
@@ -0,0 +1,283 @@
1
+ ---
2
+ description: View files/directories OR generate visual explanations, slides, diagrams
3
+ arguments:
4
+ - name: path
5
+ description: Path to file/directory to preview, OR topic for generation modes
6
+ required: false
7
+ ---
8
+
9
+ Universal viewer + visual generator. View existing content OR generate new visual explanations.
10
+
11
+ ## Usage
12
+
13
+ ### View Mode (existing behavior)
14
+ - `/preview <file.md>` - View markdown file in novel-reader UI
15
+ - `/preview <directory/>` - Browse directory contents
16
+ - `/preview --stop` - Stop running server
17
+
18
+ ### Generation Mode (new)
19
+ - `/preview --explain <topic>` - Generate visual explanation (ASCII + Mermaid + prose)
20
+ - `/preview --slides <topic>` - Generate presentation slides (one concept per slide)
21
+ - `/preview --diagram <topic>` - Generate focused diagram (ASCII + Mermaid)
22
+ - `/preview --ascii <topic>` - Generate ASCII-only diagram (terminal-friendly)
23
+
24
+ ## Examples
25
+
26
+ ```bash
27
+ # View mode
28
+ /preview plans/my-plan/plan.md # View markdown file
29
+ /preview plans/ # Browse plans directory
30
+
31
+ # Generation mode
32
+ /preview --explain OAuth flow # Generate OAuth explanation
33
+ /preview --slides API architecture # Generate architecture slides
34
+ /preview --diagram data flow # Generate data flow diagram
35
+ /preview --ascii auth process # Generate ASCII-only diagram
36
+ ```
37
+
38
+ ## Argument Resolution
39
+
40
+ When processing arguments, follow this priority order:
41
+
42
+ 1. **`--stop`** → Stop server (exit)
43
+ 2. **Generation flags** (`--explain`, `--slides`, `--diagram`, `--ascii`) → Generation mode
44
+ 3. **Resolve path from argument:**
45
+ - If argument is an explicit path → use directly
46
+ - If argument is a contextual reference (e.g., "that file", "the report", "this") → resolve from recent conversation context (look for file paths, URLs, or recently mentioned files)
47
+ 4. **Resolved path exists on filesystem** → View mode
48
+ 5. **Path doesn't exist or can't resolve** → Ask user to clarify which file they meant
49
+
50
+ **Topic-to-slug conversion:**
51
+ - Lowercase the topic
52
+ - Replace spaces/special chars with hyphens
53
+ - Remove non-alphanumeric except hyphens
54
+ - Collapse multiple hyphens → single hyphen
55
+ - Trim leading/trailing hyphens
56
+ - **Max 80 chars** - truncate at word boundary if longer
57
+ - If result is empty (topic was all special chars) → Error: ask for valid topic
58
+
59
+ Example: `OAuth 2.0 Flow` → `oauth-2-0-flow.md`
60
+
61
+ **Multiple flags:** If multiple generation flags provided, use first one; remaining treated as topic.
62
+ Example: `/preview --explain --slides topic` → `--explain` mode, topic = "--slides topic"
63
+
64
+ **Placeholder `{topic}`:** Replaced with original user input in title case (not the slug).
65
+
66
+ ## Execution
67
+
68
+ **IMPORTANT:** Run server as Claude Code background task using `run_in_background: true` with the Bash tool. This makes the server visible in `/tasks` and manageable via `KillShell`.
69
+
70
+ The skill is located at `.claude/skills/markdown-novel-viewer/`.
71
+
72
+ ### Stop Server
73
+
74
+ If `--stop` flag is provided:
75
+
76
+ ```bash
77
+ node .claude/skills/markdown-novel-viewer/scripts/server.cjs --stop
78
+ ```
79
+
80
+ ### Start Server
81
+
82
+ Otherwise, run the `markdown-novel-viewer` server as CC background task with `--foreground` flag (keeps process alive for CC task management):
83
+
84
+ ```bash
85
+ # Determine if path is file or directory
86
+ INPUT_PATH="{{path}}"
87
+ if [[ -d "$INPUT_PATH" ]]; then
88
+ # Directory mode - browse
89
+ node .claude/skills/markdown-novel-viewer/scripts/server.cjs \
90
+ --dir "$INPUT_PATH" \
91
+ --host 0.0.0.0 \
92
+ --open \
93
+ --foreground
94
+ else
95
+ # File mode - view markdown
96
+ node .claude/skills/markdown-novel-viewer/scripts/server.cjs \
97
+ --file "$INPUT_PATH" \
98
+ --host 0.0.0.0 \
99
+ --open \
100
+ --foreground
101
+ fi
102
+ ```
103
+
104
+ **Critical:** When calling the Bash tool:
105
+ - Set `run_in_background: true` to run as CC background task
106
+ - Set `timeout: 300000` (5 minutes) to prevent premature termination
107
+ - Parse JSON output and report URL to user
108
+
109
+ Example Bash tool call:
110
+ ```json
111
+ {
112
+ "command": "node .claude/skills/markdown-novel-viewer/scripts/server.cjs --dir \"path\" --host 0.0.0.0 --open --foreground",
113
+ "run_in_background": true,
114
+ "timeout": 300000,
115
+ "description": "Start preview server in background"
116
+ }
117
+ ```
118
+
119
+ After starting, parse the JSON output (e.g., `{"success":true,"url":"http://localhost:3456/view?file=...","networkUrl":"http://192.168.1.x:3456/view?file=..."}`) and report:
120
+ - Local URL for browser access
121
+ - Network URL for remote device access (if available)
122
+ - Inform user that server is now running as CC background task (visible in `/tasks`)
123
+
124
+ **CRITICAL:** MUST display the FULL URL including path and query string (e.g., `http://localhost:3456/view?file=/path/to/file.md`). NEVER truncate to just `host:port` (e.g., `http://localhost:3456`). The full URL is required for direct file access.
125
+
126
+ ---
127
+
128
+ ## Generation Mode
129
+
130
+ When `--explain`, `--slides`, `--diagram`, or `--ascii` flag is provided:
131
+
132
+ ### Step 1: Determine Output Location
133
+
134
+ 1. Check if there's an active plan context (from `## Plan Context` in hook injection)
135
+ 2. If active plan exists: save to `{plan_dir}/visuals/{topic-slug}.md`
136
+ 3. If no active plan: save to `plans/visuals/{topic-slug}.md`
137
+ 4. Create `visuals/` directory if it doesn't exist
138
+
139
+ ### Step 2: Generate Content
140
+
141
+ **Mermaid Diagram Syntax:**
142
+ When generating ` ```mermaid ` code blocks, use `/mermaidjs-v11` skill for v11 syntax rules.
143
+
144
+ **Essential rules (always apply):**
145
+ - Quote node text with special characters: `A["text with /slashes"]`
146
+ - Escape brackets in labels: `A["array[0]"]`
147
+
148
+ Use the appropriate template based on flag:
149
+
150
+ #### --explain (Visual Explanation)
151
+ ```markdown
152
+ # Visual Explanation: {topic}
153
+
154
+ ## Overview
155
+ Brief description of what we're explaining.
156
+
157
+ ## Quick View (ASCII)
158
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
159
+ │ Component A │───>│ Component B │───>│ Component C │
160
+ └─────────────┘ └─────────────┘ └─────────────┘
161
+
162
+ ## Detailed Flow
163
+ \```mermaid
164
+ sequenceDiagram
165
+ participant A as Component A
166
+ participant B as Component B
167
+ A->>B: Request
168
+ B-->>A: Response
169
+ \```
170
+
171
+ ## Key Concepts
172
+ 1. **Concept A** - Explanation
173
+ 2. **Concept B** - Explanation
174
+
175
+ ## Code Example (if applicable)
176
+ \```typescript
177
+ // Relevant code snippet with comments
178
+ \```
179
+ ```
180
+
181
+ #### --slides (Presentation Format)
182
+ ```markdown
183
+ # {Topic} - Visual Presentation
184
+
185
+ ---
186
+
187
+ ## Slide 1: Introduction
188
+ - One concept per slide
189
+ - Bullet points only
190
+
191
+ ---
192
+
193
+ ## Slide 2: The Problem
194
+ \```mermaid
195
+ flowchart TD
196
+ A[Problem] --> B[Impact]
197
+ \```
198
+
199
+ ---
200
+
201
+ ## Slide 3: The Solution
202
+ - Key point 1
203
+ - Key point 2
204
+
205
+ ---
206
+
207
+ ## Slide 4: Summary
208
+ Key takeaways...
209
+ ```
210
+
211
+ #### --diagram (Focused Diagram)
212
+ ```markdown
213
+ # Diagram: {topic}
214
+
215
+ ## ASCII Version
216
+ ┌──────────────────────────────────────────┐
217
+ │ Architecture │
218
+ ├─────────────┬──────────────┬─────────────┤
219
+ │ Layer 1 │ Layer 2 │ Layer 3 │
220
+ └─────────────┴──────────────┴─────────────┘
221
+
222
+ ## Mermaid Version
223
+ \```mermaid
224
+ flowchart TB
225
+ subgraph Layer1[Layer 1]
226
+ A[Component A]
227
+ end
228
+ subgraph Layer2[Layer 2]
229
+ B[Component B]
230
+ end
231
+ A --> B
232
+ \```
233
+ ```
234
+
235
+ #### --ascii (Terminal-Friendly Only)
236
+ ```
237
+ ┌────────────────────────────────────────────────────────┐
238
+ │ {Topic} Overview │
239
+ ├────────────────────────────────────────────────────────┤
240
+ │ │
241
+ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
242
+ │ │ Input │──────>│ Process │──────>│ Output │ │
243
+ │ └─────────┘ └─────────┘ └─────────┘ │
244
+ │ │
245
+ │ Legend: │
246
+ │ ──────> Data flow │
247
+ │ ────── Connection │
248
+ │ │
249
+ └────────────────────────────────────────────────────────┘
250
+ ```
251
+
252
+ ### Step 3: Save and Preview
253
+
254
+ 1. Write generated content to determined path
255
+ 2. Start preview server with the generated file:
256
+ ```bash
257
+ node .claude/skills/markdown-novel-viewer/scripts/server.cjs \
258
+ --file "<generated-file-path>" \
259
+ --host 0.0.0.0 \
260
+ --open \
261
+ --foreground
262
+ ```
263
+
264
+ ### Step 4: Report to User
265
+
266
+ Report:
267
+ - Generated file path
268
+ - Preview URL (local + network)
269
+ - Remind: file saved in plan's `visuals/` folder for future reference
270
+
271
+ ## Error Handling
272
+
273
+ | Error | Action |
274
+ |-------|--------|
275
+ | Invalid topic (empty) | Ask user to provide a topic |
276
+ | Flag without topic (`/preview --explain`) | Ask user: "Please provide a topic: `/preview --explain <topic>`" |
277
+ | Topic becomes empty after sanitization | Ask user to provide topic with alphanumeric characters |
278
+ | File write failure | Report error, suggest checking permissions |
279
+ | Server startup failure | Check if port in use, try `/preview --stop` first |
280
+ | No generation flag + unresolvable reference | Ask user to clarify which file they meant |
281
+ | Existing file at output path | Overwrite with new content (no prompt) |
282
+ | Server already running | Reuse existing server instance, just open new URL |
283
+ | Parent `plans/` dir missing | Create directories recursively before write |
@@ -0,0 +1,122 @@
1
+ ---
2
+ description: ⚡⚡⚡ Ultrathink edge cases, then parallel verify with code-reviewers
3
+ argument-hint: [scope-or-prompt]
4
+ ---
5
+
6
+ **Ultrathink** to exhaustively list ALL potential edge cases, then dispatch parallel `code-reviewer` agents to verify: <scope>$ARGUMENTS</scope>
7
+
8
+ **IMPORTANT:** Activate needed skills. Ensure token efficiency. Sacrifice grammar for concision.
9
+
10
+ ## Workflow
11
+
12
+ ### 1. Ultrathink Edge Cases
13
+
14
+ Main agent deeply analyzes the scope to LIST all potential edge cases FIRST:
15
+ - Read `codebase-summary.md` for context
16
+ - Use `/scout:ext` to find relevant files
17
+ - **Think exhaustively** about what could go wrong:
18
+ - Null/undefined scenarios
19
+ - Boundary conditions (off-by-one, empty, max values)
20
+ - Error handling gaps
21
+ - Race conditions, async edge cases
22
+ - Input validation holes
23
+ - Security vulnerabilities
24
+ - Resource leaks
25
+ - Untested code paths
26
+
27
+ **Output format:**
28
+ ```markdown
29
+ ## Edge Cases Identified
30
+
31
+ ### Category: [scope-area]
32
+ 1. [edge case description] → files: [file1, file2]
33
+ 2. [edge case description] → files: [file3]
34
+
35
+ ### Category: [another-area]
36
+ 1. [edge case description] → files: [file4, file5]
37
+ ```
38
+
39
+ ### 2. Categorize & Assign
40
+
41
+ Group edge cases by similar scope for parallel verification:
42
+ - Each category → one `code-reviewer` agent
43
+ - Max 6 categories (merge small ones)
44
+ - Each reviewer gets specific edge cases to VERIFY, not discover
45
+
46
+ ### 3. Parallel Verification
47
+
48
+ Launch N `code-reviewer` subagents simultaneously:
49
+ - Pass: category name, list of edge cases, relevant files
50
+ - Task: **VERIFY** if each edge case is properly handled in code
51
+ - Report: which edge cases are handled vs unhandled
52
+
53
+ **Reviewer instruction:**
54
+ ```
55
+ Verify these specific edge cases in the given files:
56
+ [list of edge cases]
57
+
58
+ For each, report:
59
+ - ✅ Handled: [how it's handled]
60
+ - ❌ Unhandled: [what's missing]
61
+ - ⚠️ Partial: [what needs improvement]
62
+ ```
63
+
64
+ ### 4. Aggregate Results
65
+
66
+ Collect all verification reports:
67
+ ```markdown
68
+ ## Edge Case Verification Report
69
+
70
+ ### Summary
71
+ - Total edge cases: X
72
+ - Handled: Y ✅
73
+ - Unhandled: Z ❌
74
+ - Partial: W ⚠️
75
+
76
+ ### Unhandled Edge Cases (Need Fix)
77
+ | # | Edge Case | File | Status |
78
+ |---|-----------|------|--------|
79
+ | 1 | ... | ... | ❌ |
80
+
81
+ ### Partial Handling (Need Review)
82
+ | # | Edge Case | File | Issue |
83
+ |---|-----------|------|-------|
84
+ | 1 | ... | ... | ... |
85
+ ```
86
+
87
+ ### 5. Auto-Fix Pipeline
88
+
89
+ **IF** unhandled/partial edge cases found:
90
+ - Ask: "Found N unhandled edge cases. Fix with /fix --parallel? [Y/n]"
91
+ - **IF yes:** Trigger `/fix --parallel` with unhandled list
92
+
93
+ ### 6. Final Report
94
+
95
+ - Summary of verification
96
+ - Ask: "Commit? [Y/n]" → use `git-manager`
97
+
98
+ ## Example
99
+
100
+ ```
101
+ User: /review:codebase:parallel auth module
102
+
103
+ 1. Ultrathink → Lists 12 edge cases for auth:
104
+ - Empty password submission
105
+ - Token expiry during request
106
+ - Concurrent login attempts
107
+ - Invalid refresh token
108
+ ...
109
+
110
+ 2. Categorize → 3 groups:
111
+ - Login flow (4 cases)
112
+ - Token handling (5 cases)
113
+ - Session management (3 cases)
114
+
115
+ 3. Parallel → 3 code-reviewers verify simultaneously
116
+
117
+ 4. Aggregate → 8 handled, 3 unhandled, 1 partial
118
+
119
+ 5. Fix → User approves → /fix --parallel
120
+
121
+ 6. Final → Commit changes
122
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: ⚡⚡ Run UI tests on a website & generate a detailed report.
3
- argument-hint: [url] [options]
2
+ description: '⚡⚡ Run UI tests on a website & generate a detailed report.'
3
+ argument-hint: '[url] [options]'
4
4
  ---
5
5
 
6
6
  Activate the chrome-devtools skill.
@@ -70,7 +70,7 @@ node screenshot.js --url https://example.com/settings --output settings.png --cl
70
70
  - `--clear true` - Clear saved auth session
71
71
 
72
72
  ## Workflow
73
- - Use `planning` skill to organize the test plan & report in the current project directory.
73
+ - Use `plan` skill to organize the test plan & report in the current project directory.
74
74
  - All the screenshots should be saved in the same report directory.
75
75
  - Browse $URL with the specified $OPTIONS, discover all pages, components, and endpoints.
76
76
  - Create a test plan based on the discovered structure
@@ -9,7 +9,8 @@ Execute MCP operations via **Gemini CLI** to preserve context budget.
9
9
  1. **Execute task via Gemini CLI** (using stdin pipe for MCP support):
10
10
  ```bash
11
11
  # IMPORTANT: Use stdin piping, NOT -p flag (deprecated, skips MCP init)
12
- echo "$ARGUMENTS. Return JSON only per GEMINI.md instructions." | gemini -y -m gemini-2.5-flash
12
+ # Read model from .claude/.ck.json: gemini.model (default: gemini-3-flash-preview)
13
+ echo "$ARGUMENTS. Return JSON only per GEMINI.md instructions." | gemini -y -m <gemini.model>
13
14
  ```
14
15
 
15
16
  2. **Fallback to mcp-manager subagent** (if Gemini CLI unavailable):
@@ -30,5 +31,8 @@ Execute MCP operations via **Gemini CLI** to preserve context budget.
30
31
 
31
32
  ```bash
32
33
  # BROKEN - deprecated -p flag skips MCP server connections!
33
- gemini -y -m gemini-2.5-flash -p "..."
34
+ gemini -y -m <gemini.model> -p "..."
35
+
36
+ # ALSO BROKEN - --model flag with -p
37
+ gemini -y -p "..." --model gemini-3-flash-preview
34
38
  ```
@@ -0,0 +1,109 @@
1
+ ---
2
+ description: 'Create isolated git worktree for parallel development'
3
+ argument-hint: '[feature-description] OR [project] [feature] (monorepo)'
4
+ ---
5
+
6
+ Create an isolated git worktree for parallel feature development.
7
+
8
+ ## Workflow
9
+
10
+ ### Step 1: Get Repo Info
11
+
12
+ ```bash
13
+ node .claude/scripts/worktree.cjs info --json
14
+ ```
15
+
16
+ Parse JSON response for: `repoType`, `baseBranch`, `projects`, `worktreeRoot`, `worktreeRootSource`.
17
+
18
+ ### Step 2: Detect Branch Prefix
19
+
20
+ From user's description:
21
+ - "fix", "bug", "error", "issue" → `fix`
22
+ - "refactor", "restructure", "rewrite" → `refactor`
23
+ - "docs", "documentation", "readme" → `docs`
24
+ - "test", "spec", "coverage" → `test`
25
+ - "chore", "cleanup", "deps" → `chore`
26
+ - "perf", "performance", "optimize" → `perf`
27
+ - Default → `feat`
28
+
29
+ ### Step 3: Convert to Slug
30
+
31
+ "add authentication system" → `add-auth`
32
+ "fix login bug" → `login-bug`
33
+ Max 50 chars, kebab-case.
34
+
35
+ ### Step 4: Handle Monorepo
36
+
37
+ If `repoType === "monorepo"` and project not specified, use AskUserQuestion:
38
+ ```javascript
39
+ AskUserQuestion({
40
+ questions: [{
41
+ header: "Project",
42
+ question: "Which project for the worktree?",
43
+ options: projects.map(p => ({ label: p.name, description: p.path })),
44
+ multiSelect: false
45
+ }]
46
+ })
47
+ ```
48
+
49
+ ### Step 5: Execute
50
+
51
+ **Monorepo:**
52
+ ```bash
53
+ node .claude/scripts/worktree.cjs create "<PROJECT>" "<SLUG>" --prefix <TYPE>
54
+ ```
55
+
56
+ **Standalone:**
57
+ ```bash
58
+ node .claude/scripts/worktree.cjs create "<SLUG>" --prefix <TYPE>
59
+ ```
60
+
61
+ **Options:**
62
+ - `--prefix` - Branch type: feat|fix|refactor|docs|test|chore|perf
63
+ - `--worktree-root <path>` - Override default location (only if needed)
64
+ - `--json` - JSON output
65
+ - `--dry-run` - Preview
66
+
67
+ ### Step 6: Install Dependencies
68
+
69
+ Based on project context, run in background:
70
+ - `bun.lock` → `bun install`
71
+ - `pnpm-lock.yaml` → `pnpm install`
72
+ - `yarn.lock` → `yarn install`
73
+ - `package-lock.json` → `npm install`
74
+ - `poetry.lock` → `poetry install`
75
+ - `requirements.txt` → `pip install -r requirements.txt`
76
+ - `Cargo.toml` → `cargo build`
77
+ - `go.mod` → `go mod download`
78
+
79
+ ## Commands
80
+
81
+ | Command | Usage | Description |
82
+ |---------|-------|-------------|
83
+ | `create` | `create [project] <feature>` | Create worktree |
84
+ | `remove` | `remove <name-or-path>` | Remove worktree |
85
+ | `info` | `info` | Repo info with worktree location |
86
+ | `list` | `list` | List worktrees |
87
+
88
+ ## Example
89
+
90
+ ```
91
+ User: /worktree fix the login validation bug
92
+
93
+ Claude: [Runs: node .claude/scripts/worktree.cjs info --json]
94
+ repoType: standalone
95
+ worktreeRoot: /home/user/worktrees
96
+ worktreeRootSource: sibling directory
97
+
98
+ [Prefix: fix, Slug: login-validation-bug]
99
+ [Runs: node .claude/scripts/worktree.cjs create "login-validation-bug" --prefix fix]
100
+
101
+ Output: Worktree created at /home/user/worktrees/my-project-login-validation-bug
102
+ ```
103
+
104
+ ## Notes
105
+
106
+ - Script auto-detects superproject, monorepo, and standalone repos
107
+ - Default worktree location is smart: superproject > monorepo > sibling
108
+ - Use `--worktree-root` only to override defaults
109
+ - Env templates (`.env*.example`) auto-copied with `.example` suffix removed
@@ -4,38 +4,30 @@
4
4
  **IMPORTANT:** You ALWAYS follow these principles: **YAGNI (You Aren't Gonna Need It) - KISS (Keep It Simple, Stupid) - DRY (Don't Repeat Yourself)**
5
5
 
6
6
  ## General
7
-
8
7
  - **File Naming**: Use kebab-case for file names with a meaningful name that describes the purpose of the file, doesn't matter if the file name is long, just make sure when LLMs read the file names while using Grep or other tools, they can understand the purpose of the file right away without reading the file content.
9
- - **File Size Management**: Keep individual code files under 300 lines for optimal context management
8
+ - **File Size Management**: Keep individual code files under 200 lines for optimal context management
10
9
  - Split large files into smaller, focused components/modules
11
10
  - Use composition over inheritance for complex widgets
12
11
  - Extract utility functions into separate modules
13
12
  - Create dedicated service classes for business logic
14
- - Use `docs-seeker` skill for exploring latest docs of plugins/packages if needed
13
+ - When looking for docs, activate `docs-seeker` skill (`context7` reference) for exploring latest docs.
15
14
  - Use `gh` bash command to interact with Github features if needed
16
15
  - Use `psql` bash command to query Postgres database for debugging if needed
17
16
  - Use `ai-multimodal` skill for describing details of images, videos, documents, etc. if needed
18
17
  - Use `ai-multimodal` skill and `imagemagick` skill for generating and editing images, videos, documents, etc. if needed
19
- - Use `sequential-thinking` skill and `debugging` skills for sequential thinking, analyzing code, debugging, etc. if needed
18
+ - Use `sequential-thinking` and `debug` skills for sequential thinking, analyzing code, debugging, etc. if needed
20
19
  - **[IMPORTANT]** Follow the codebase structure and code standards in `./docs` during implementation.
21
20
  - **[IMPORTANT]** Do not just simulate the implementation or mocking them, always implement the real code.
22
21
 
23
22
  ## Code Quality Guidelines
24
-
25
23
  - Read and follow codebase structure and code standards in `./docs`
26
24
  - Don't be too harsh on code linting, but **make sure there are no syntax errors and code are compilable**
27
25
  - Prioritize functionality and readability over strict style enforcement and code formatting
28
26
  - Use reasonable code quality standards that enhance developer productivity
29
27
  - Use try catch error handling & cover security standards
30
28
  - Use `code-reviewer` agent to review code after every implementation
31
- - **[CRITICAL] Class Responsibility Rule:**
32
- - Logic belongs in LOWEST layer: Entity/Model > Service > Component/Handler
33
- - Backend: Entity mapping → Command.UpdateEntity() or DTO.MapToEntity(), NOT in Handler
34
- - Frontend: Constants, column arrays, role lists → static properties in Model class, NOT in Component
35
- - Frontend: Display logic (CSS class, status text) → instance getter in Model, NOT switch in Component
36
29
 
37
30
  ## Pre-commit/Push Rules
38
-
39
31
  - Run linting before commit
40
32
  - Run tests before push (DO NOT ignore failed tests just to pass the build or github actions)
41
33
  - Keep commits focused on the actual code changes
@@ -43,51 +35,18 @@
43
35
  - Create clean, professional commit messages without AI references. Use conventional commit format.
44
36
 
45
37
  ## Code Implementation
46
-
47
38
  - Write clean, readable, and maintainable code
48
39
  - Follow established architectural patterns
49
40
  - Implement features according to specifications
50
41
  - Handle edge cases and error scenarios
51
42
  - **DO NOT** create new enhanced files, update to the existing files directly.
52
43
 
53
- ## Mandatory Post-Task Two-Pass Review Protocol
54
-
55
- **CRITICAL:** After ANY code changes (bug fix or feature), execute this protocol BEFORE task completion.
56
-
57
- ### Pass 1: Initial Review
58
-
59
- 1. Run `git diff` to examine unstaged changes
60
- 2. Verify changes correctly implement the task requirements
61
- 3. Check compliance with project conventions and best practices:
62
- - Backend: repository patterns, validation fluent API, DTOs, event handlers
63
- - Frontend: base classes, stores, BEM classes, untilDestroyed()
64
- 4. Identify security vulnerabilities and edge cases
65
- 5. Fix any issues found → mark `MADE_CHANGES = true`
66
-
67
- ### Pass 2: Re-Review (Conditional)
68
-
69
- **ONLY IF Pass 1 made changes:**
70
-
71
- 1. Run `git diff` again to verify all current changes
72
- 2. Re-execute full review checklist on updated code
73
- 3. Ensure corrections didn't introduce new issues
74
- 4. Apply minimal, targeted fixes if needed
75
-
76
- ### Quick Reference
77
-
78
- ```bash
79
- # Execute review
80
- /review:post-task
81
-
82
- # Or use code-reviewer subagent for complex reviews
83
- Task tool → code-reviewer subagent
84
- ```
85
-
86
- ### Review Checklist Quick Reference
87
-
88
- - [ ] Task objective achieved correctly
89
- - [ ] No unrelated/unnecessary modifications
90
- - [ ] Follows project code conventions
91
- - [ ] No security vulnerabilities
92
- - [ ] Edge cases handled
93
- - [ ] Ready for commit
44
+ ## Visual Aids
45
+ - Use `/preview --explain` when explaining unfamiliar code patterns or complex logic
46
+ - Use `/preview --diagram` for architecture diagrams and data flow visualization
47
+ - Use `/preview --slides` for step-by-step walkthroughs and presentations
48
+ - Use `/preview --ascii` for terminal-friendly diagrams (no browser needed to understand)
49
+ - **Plan context:** Active plan determined from `## Plan Context` in hook injection; visuals save to `{plan_dir}/visuals/`
50
+ - If no active plan, fallback to `plans/visuals/` directory
51
+ - For Mermaid diagrams, use `/mermaidjs-v11` skill for v11 syntax rules
52
+ - See `primary-workflow.md` Step 6 for workflow integration