thanh-kit 2.5.1 → 2.5.3

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 +50 -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thanh-kit",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "CLI tool to scaffold AI agent projects with pre-configured kits (Claude, OpenCode, Codex)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,10 +8,10 @@ Technical question or architecture challenge:
8
8
  <questions>$ARGUMENTS</questions>
9
9
 
10
10
  Current development workflows, system constraints, scale requirements, and business context will be considered:
11
- - Primary workflow: `./.claude/workflows/primary-workflow.md`
12
- - Development rules: `./.claude/workflows/development-rules.md`
13
- - Orchestration protocols: `./.claude/workflows/orchestration-protocol.md`
14
- - Documentation management: `./.claude/workflows/documentation-management.md`
11
+ - Primary workflow: `./.claude/rules/primary-workflow.md`
12
+ - Development rules: `./.claude/rules/development-rules.md`
13
+ - Orchestration protocols: `./.claude/rules/orchestration-protocol.md`
14
+ - Documentation management: `./.claude/rules/documentation-management.md`
15
15
 
16
16
  **Project Documentation:**
17
17
  ```
@@ -35,7 +35,7 @@ You operate by the holy trinity of software engineering: **YAGNI** (You Aren't G
35
35
 
36
36
  ## Process
37
37
  1. **Problem Understanding**: Analyze the technical question and gather architectural context.
38
- - If the architecture context doesn't contain the necessary information, use [`SlashCommand(/scout)`](`./.claude/commands/scout.md`) to scout the codebase again.
38
+ - If the architecture context doesn't contain the necessary information, use the `scout` skill to scout the codebase again.
39
39
  2. **Expert Consultation**:
40
40
  - Systems Designer: Define system boundaries, data flows, and component relationships
41
41
  - Technology Strategist: Evaluate technology choices, patterns, and industry best practices
@@ -6,7 +6,23 @@ argument-hint: [category|command|task description]
6
6
  Think harder.
7
7
  All-in-one ClaudeKit guide. Run the script and present output based on type markers.
8
8
 
9
- ## Pre-Processing
9
+ ## Intent Validation
10
+
11
+ The script uses keyword matching with smart weighting. After getting results, **validate** against these heuristics:
12
+
13
+ | Sentence Pattern | Primary Intent | Example |
14
+ |------------------|----------------|---------|
15
+ | `[action verb] my [object]` | The action verb | "commit my changes" → git |
16
+ | `[context] [subject noun]` | The subject noun | "setup notifications" → notifications |
17
+ | `[noun] [noun]` | Last noun (topic) | "discord webhook" → notifications |
18
+
19
+ **Action verbs** (high intent when first): fix, test, commit, push, build, create, review, deploy, run, check, find, plan, refactor
20
+
21
+ **Context words** (low intent, modify subject): setup, add, start, new, my, the, configure
22
+
23
+ **Override script only if:** result clearly mismatches the sentence pattern above. Otherwise trust the algorithm.
24
+
25
+ ## Translation
10
26
 
11
27
  **IMPORTANT: Always translate `$ARGUMENTS` to English before passing to script.**
12
28
 
@@ -108,6 +124,6 @@ Never replace or summarize the script output. Always show it fully, then enhance
108
124
 
109
125
  ## Important: Correct Workflows
110
126
 
111
- - **`/plan` → `/code`**: Plan first, then execute the plan
127
+ - **`/plan` → `/cook`**: Plan first, then execute the plan
112
128
  - **`/cook`**: Standalone - plans internally, no separate `/plan` needed
113
129
  - **NEVER** suggest `/plan` → `/cook` (cook has its own planning)
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: ⚡⚡⚡⚡ Analyze the codebase and create initial documentation
3
+ ---
4
+
5
+ ## Phase 1: Parallel Codebase Scouting
6
+
7
+ 1. Scan the codebase and calculate the number of files with LOC in each directory (skip credentials, cache or external modules directories, such as `.claude`, `.opencode`, `.git`, `tests`, `node_modules`, `__pycache__`, `secrets`, etc.)
8
+ 2. Target directories **that actually exist** - adapt to project structure, don't hardcode paths
9
+ 3. Activate `scout` skill to explore the code base and return detailed summary reports to the main agent
10
+ 4. Merge scout reports into context summary
11
+
12
+ ## Phase 2: Documentation Creation (docs-manager Agent)
13
+
14
+ **CRITICAL:** You MUST spawn `docs-manager` agent via Task tool with merged reports. Do not wait for user input.
15
+
16
+ Pass the gathered context to docs-manager agent to create initial documentation:
17
+ - `README.md`: Update README with initial documentation (keep it under 300 lines)
18
+ - `docs/project-overview-pdr.md`: Project overview and PDR (Product Development Requirements)
19
+ - `docs/codebase-summary.md`: Codebase summary
20
+ - `docs/code-standards.md`: Codebase structure and code standards
21
+ - `docs/system-architecture.md`: System architecture
22
+ - `docs/project-roadmap.md`: Project roadmap
23
+ - `docs/deployment-guide.md` [optional]: Deployment guide
24
+ - `docs/design-guidelines.md` [optional]: Design guidelines
25
+
26
+ Use `docs/` directory as the source of truth for documentation.
27
+
28
+ ## Phase 3: Size Check (Post-Generation)
29
+
30
+ After docs-manager completes:
31
+ 1. Run `wc -l docs/*.md 2>/dev/null | sort -rn` to check LOC
32
+ 2. Use `docs.maxLoc` from session context (default: 800)
33
+ 3. For files exceeding limit:
34
+ - Report which files exceed and by how much
35
+ - docs-manager should have already split proactively per Section 6 guidelines
36
+ - If still oversized, ask user: split now or accept as-is?
37
+
38
+ **IMPORTANT**: **Do not** start implementing.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: '⚡ Analyze the codebase and update documentation'
3
+ argument-hint: '[focused-topics] [should-scan-codebase]'
4
+ ---
5
+
6
+ Activate `scout` skill to analyze the codebase and update `docs/codebase-summary.md` and respond with a summary report.
7
+
8
+ ## Arguments:
9
+ $1: Focused topics (default: all)
10
+ $2: Should scan codebase (`Boolean`, default: `false`)
11
+
12
+ ## Focused Topics:
13
+ <focused_topics>$1</focused_topics>
14
+
15
+ ## Should Scan Codebase:
16
+ <should_scan_codebase>$2</should_scan_codebase>
17
+
18
+ ## Important:
19
+ - Use `docs/` directory as the source of truth for documentation.
20
+ - Do not scan the entire codebase unless the user explicitly requests it.
21
+
22
+ **IMPORTANT**: **Do not** start implementing.
@@ -0,0 +1,76 @@
1
+ ---
2
+ description: ⚡⚡⚡ Analyze the codebase and update documentation
3
+ ---
4
+
5
+ ## Phase 1: Parallel Codebase Scouting
6
+
7
+ 1. Scan the codebase and calculate the number of files with LOC in each directory (skip credentials, cache or external modules directories, such as `.claude`, `.opencode`, `.git`, `tests`, `node_modules`, `__pycache__`, `secrets`, etc.)
8
+ 2. Target directories **that actually exist** - adapt to project structure, don't hardcode paths
9
+ 3. Activate `scout` skill to explore the code base and return detailed summary reports to the main agent
10
+ 4. Merge scout reports into context summary
11
+
12
+ ## Phase 1.5: Parallel Documentation Reading
13
+
14
+ **You (main agent) must spawn readers** - subagents cannot spawn subagents.
15
+
16
+ 1. Count docs: `ls docs/*.md 2>/dev/null | wc -l`
17
+ 2. Get LOC: `wc -l docs/*.md 2>/dev/null | sort -rn`
18
+ 3. Strategy:
19
+ - 1-3 files: Skip parallel reading, docs-manager reads directly
20
+ - 4-6 files: Spawn 2-3 `Explore` agents
21
+ - 7+ files: Spawn 4-5 `Explore` agents (max 5)
22
+ 4. Distribute files by LOC (larger files get dedicated agent)
23
+ 5. Each agent prompt: "Read these docs, extract: purpose, key sections, areas needing update. Files: {list}"
24
+ 6. Merge results into context for docs-manager
25
+
26
+ ### Workload Distribution Example
27
+
28
+ | Agent | Files | Est. LOC |
29
+ |-------|-------|----------|
30
+ | 1 | codebase-summary.md (800) | 800 |
31
+ | 2 | system-architecture.md (400), code-standards.md (300) | 700 |
32
+ | 3 | project-overview-pdr.md (500), project-roadmap.md (200) | 700 |
33
+
34
+ ## Phase 2: Documentation Update (docs-manager Agent)
35
+
36
+ **CRITICAL:** You MUST spawn `docs-manager` agent via Task tool with merged reports and doc readings. Do not wait for user input.
37
+
38
+ Pass the gathered context to docs-manager agent to update documentation:
39
+ - `README.md`: Update README (keep it under 300 lines)
40
+ - `docs/project-overview-pdr.md`: Update project overview and PDR (Product Development Requirements)
41
+ - `docs/codebase-summary.md`: Update codebase summary
42
+ - `docs/code-standards.md`: Update codebase structure and code standards
43
+ - `docs/system-architecture.md`: Update system architecture
44
+ - `docs/project-roadmap.md`: Update project roadmap
45
+ - `docs/deployment-guide.md` [optional]: Update deployment guide
46
+ - `docs/design-guidelines.md` [optional]: Update design guidelines
47
+
48
+ ## Additional requests
49
+ <additional_requests>
50
+ $ARGUMENTS
51
+ </additional_requests>
52
+
53
+ ## Phase 3: Size Check (Post-Update)
54
+
55
+ After docs-manager completes:
56
+ 1. Run `wc -l docs/*.md 2>/dev/null | sort -rn` to check LOC
57
+ 2. Use `docs.maxLoc` from session context (default: 800)
58
+ 3. For files exceeding limit:
59
+ - Report which files exceed and by how much
60
+ - docs-manager should have already split proactively per Section 6 guidelines
61
+ - If still oversized, ask user: split now or accept as-is?
62
+
63
+ ## Phase 4: Documentation Validation (Post-Update)
64
+
65
+ Run validation to detect potential hallucinations:
66
+ 1. Run: `node .claude/scripts/validate-docs.cjs docs/`
67
+ 2. Display validation report (warnings only, non-blocking)
68
+ 3. Checks performed:
69
+ - Code references: Verify `functionName()` and `ClassName` exist in codebase
70
+ - Internal links: Verify `[text](./path.md)` links point to existing files
71
+ - Config keys: Verify `ENV_VAR` mentioned in docs exist in `.env.example`
72
+
73
+ ## Important
74
+ - Use `docs/` directory as the source of truth for documentation.
75
+
76
+ **IMPORTANT**: **Do not** start implementing.
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: ⚡ Write some journal entries.
3
+ ---
4
+
5
+ ## Writing Style Detection
6
+
7
+ Before writing, check for a writing-styles directory:
8
+ 1. Check `docs/writing-styles/` — if exists, read all `.md` files inside
9
+ 2. Check `assets/writing-styles/` — if exists and step 1 not found, read all `.md` files inside
10
+ 3. If writing styles found → adopt tone, vocabulary, sentence structure, and formatting rules from those files
11
+ 4. If no writing-styles directory found → write freely in a natural, conversational tone
12
+
13
+ ## Journal Writing
14
+
15
+ Use the `journal-writer` subagent to explore the memories and recent code changes, and write journal entries.
16
+ - Concise, focused on important events, key changes, impacts, and decisions
17
+ - Apply detected writing style (if any) to the journal voice
18
+ - Keep journal entries in `docs/journal/` directory
@@ -1,8 +1,8 @@
1
1
  ---
2
- description: AI agent orchestration board (Coming Soon)
2
+ description: 'AI agent orchestration board (Coming Soon)'
3
3
  arguments:
4
4
  - name: dir
5
- description: Plans directory (default: ./plans)
5
+ description: 'Plans directory (default: ./plans)'
6
6
  required: false
7
7
  ---
8
8
 
@@ -26,16 +26,14 @@ Plans dashboard with progress tracking and timeline visualization.
26
26
 
27
27
  **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`.
28
28
 
29
- Check if this script is located in the current workspace or in `$HOME/.claude/skills/plans-kanban` directory:
30
- - If in current workspace: `$SKILL_DIR_PATH` = `./.claude/skills/plans-kanban/`
31
- - If in home directory: `$SKILL_DIR_PATH` = `$HOME/.claude/skills/plans-kanban/`
29
+ The skill is located at `.claude/skills/plans-kanban/`.
32
30
 
33
31
  ### Stop Server
34
32
 
35
33
  If `--stop` flag is provided:
36
34
 
37
35
  ```bash
38
- node $SKILL_DIR_PATH/scripts/server.cjs --stop
36
+ node .claude/skills/plans-kanban/scripts/server.cjs --stop
39
37
  ```
40
38
 
41
39
  ### Start Server
@@ -48,7 +46,7 @@ INPUT_DIR="{{dir}}"
48
46
  PLANS_DIR="${INPUT_DIR:-./plans}"
49
47
 
50
48
  # Start kanban dashboard
51
- node $SKILL_DIR_PATH/scripts/server.cjs \
49
+ node .claude/skills/plans-kanban/scripts/server.cjs \
52
50
  --dir "$PLANS_DIR" \
53
51
  --host 0.0.0.0 \
54
52
  --open \
@@ -38,8 +38,8 @@ Start archiving the plans based on the user's choice:
38
38
 
39
39
  ### Step 5: Ask if user wants to commit the changes
40
40
  Use `AskUserQuestion` tool to ask if user wants to commit the changes with these options:
41
- - Stage and commit the changes (Use `/git:cm` slash command)
42
- - Commit and push the changes (Use `/git:cp` slash command)
41
+ - Stage and commit the changes (Use `/git cm` slash command)
42
+ - Commit and push the changes (Use `/git cp` slash command)
43
43
  - Nah, I'll do it later
44
44
 
45
45
  ## Output
@@ -0,0 +1,200 @@
1
+ ---
2
+ description: Adversarial plan review — spawn hostile reviewers to find flaws, security holes, false assumptions, failure modes
3
+ argument-hint: [plan-path]
4
+ ---
5
+
6
+ ## Your Mission
7
+
8
+ Adversarially review an implementation plan by spawning parallel reviewer subagents that try to tear it apart. Each reviewer adopts a different hostile lens. You then adjudicate findings, and the user decides which to apply.
9
+
10
+ **Mindset:** Like hiring someone who hates the implementer to destroy their work.
11
+
12
+ ## Plan Resolution
13
+
14
+ 1. If `$ARGUMENTS` provided → Use that path
15
+ 2. Else check `## Plan Context` section → Use active plan path
16
+ 3. If no plan found → Ask user to specify path or run `/plan` first
17
+
18
+ ## Workflow
19
+
20
+ ### Step 1: Read Plan Files
21
+
22
+ Read the plan directory:
23
+ - `plan.md` — Overview, phases, dependencies
24
+ - `phase-*.md` — All phase files (full content)
25
+ - Note: architecture decisions, assumptions, scope, risks, implementation steps
26
+
27
+ Collect all plan file paths for reviewers to read directly.
28
+
29
+ ### Step 2: Scale Reviewer Count
30
+
31
+ Scale reviewers based on plan complexity:
32
+
33
+ | Phase Count | Reviewers | Lenses Selected |
34
+ |-------------|-----------|-----------------|
35
+ | 1-2 phases | 2 | Security Adversary + Assumption Destroyer |
36
+ | 3-5 phases | 3 | + Failure Mode Analyst |
37
+ | 6+ phases | 4 | + Scope & Complexity Critic (all lenses) |
38
+
39
+ ### Step 3: Define Adversarial Lenses
40
+
41
+ Available lenses (select per Step 2):
42
+
43
+ | Reviewer | Lens | Focus |
44
+ |----------|------|-------|
45
+ | **Security Adversary** | Attacker mindset | Auth bypass, injection, data exposure, privilege escalation, supply chain, OWASP top 10 |
46
+ | **Failure Mode Analyst** | Murphy's Law | Race conditions, data loss, cascading failures, recovery gaps, deployment risks, rollback holes |
47
+ | **Assumption Destroyer** | Skeptic | Unstated dependencies, false "will work" claims, missing error paths, scale assumptions, integration assumptions |
48
+ | **Scope & Complexity Critic** | YAGNI enforcer | Over-engineering, premature abstraction, unnecessary complexity, missing MVP cuts, scope creep, gold plating |
49
+
50
+ ### Step 4: Spawn Reviewers
51
+
52
+ Launch reviewers simultaneously via Task tool with `subagent_type: "code-reviewer"`.
53
+
54
+ **Each reviewer prompt MUST include:**
55
+ 1. This override: `"IGNORE your default code-review instructions. You are reviewing a PLAN DOCUMENT, not code. There is no code to lint, build, or test. Focus exclusively on plan quality."`
56
+ 2. Their specific adversarial lens and persona
57
+ 3. The plan file paths so they can read original files directly
58
+ 4. These instructions:
59
+
60
+ ```
61
+ You are a hostile reviewer. Your job is to DESTROY this plan.
62
+ Adopt the {LENS_NAME} perspective. Find every flaw you can.
63
+
64
+ Rules:
65
+ - Be specific: cite exact phase/section where the flaw lives
66
+ - Be concrete: describe the failure scenario, not just "could be a problem"
67
+ - Rate severity: Critical (blocks success) | High (significant risk) | Medium (notable concern)
68
+ - Skip trivial observations (style, naming, formatting) — not worth reporting.
69
+ - No praise. No "overall looks good". Only findings.
70
+ - 5-10 findings per reviewer. Quality over quantity.
71
+
72
+ Output format per finding:
73
+ ## Finding {N}: {title}
74
+ - **Severity:** Critical | High | Medium
75
+ - **Location:** Phase {X}, section "{name}"
76
+ - **Flaw:** {what's wrong}
77
+ - **Failure scenario:** {concrete description of how this fails}
78
+ - **Evidence:** {quote from plan or missing element}
79
+ - **Suggested fix:** {brief recommendation}
80
+ ```
81
+
82
+ ### Step 5: Collect, Deduplicate & Cap
83
+
84
+ After all reviewers complete:
85
+ 1. Collect all findings
86
+ 2. Deduplicate overlapping findings (merge if same root issue)
87
+ 3. Sort by severity: Critical → High → Medium
88
+ 4. **Cap at 15 findings:** Keep all Critical, top High by specificity, note dropped Medium count
89
+
90
+ ### Step 6: Adjudicate
91
+
92
+ For each finding, the main agent evaluates and proposes a disposition:
93
+
94
+ | Disposition | Meaning |
95
+ |-------------|---------|
96
+ | **Accept** | Valid flaw — plan should be updated |
97
+ | **Reject** | False positive, acceptable risk, or already handled |
98
+
99
+ **Adjudication format:**
100
+
101
+ ```markdown
102
+ ## Red Team Findings
103
+
104
+ ### Finding 1: {title} — {SEVERITY}
105
+ **Reviewer:** {lens name}
106
+ **Location:** {phase/section}
107
+ **Flaw:** {description}
108
+ **Failure scenario:** {concrete scenario}
109
+ **Disposition:** Accept | Reject
110
+ **Rationale:** {why accept/reject — be specific}
111
+ ```
112
+
113
+ ### Step 7: User Review
114
+
115
+ Present the adjudicated findings to the user via `AskUserQuestion`:
116
+
117
+ ```
118
+ Review red-team findings. Which dispositions do you want to change?
119
+ ```
120
+
121
+ Options:
122
+ - "Looks good, apply accepted findings" — proceed with current Accept/Reject
123
+ - "Let me review each one" — walk through findings individually
124
+ - "Reject all, plan is fine" — discard all findings
125
+
126
+ **If "Let me review each one":**
127
+ For each finding marked Accept, ask via `AskUserQuestion`:
128
+ - "Apply this fix to the plan?"
129
+ - Options: "Yes, apply" | "No, reject" | "Modify suggestion"
130
+
131
+ **If "Modify suggestion":**
132
+ Ask via `AskUserQuestion`: "Describe your modification to this finding's suggested fix:"
133
+ (user provides free text via "Other" option)
134
+ Record the modified suggestion in the finding's "Suggested fix" field.
135
+ Set disposition to "Accept (modified)" in the Red Team Review table.
136
+
137
+ ### Step 8: Apply to Plan
138
+
139
+ For each accepted finding:
140
+ 1. Locate the target phase file and section
141
+ 2. Add the fix/note inline with a marker:
142
+ ```markdown
143
+ <!-- Red Team: {finding title} — {date} -->
144
+ ```
145
+ 3. If finding requires new content, add to the most relevant section
146
+ 4. If finding requires removing/changing content, edit in place
147
+
148
+ After applying, add a `## Red Team Review` section to `plan.md`.
149
+ If section already exists (repeat run), **append** a new session block — never overwrite history.
150
+
151
+ **Placement order in plan.md** (bottom of file):
152
+ 1. `## Red Team Review` (before validation)
153
+ 2. `## Validation Log` (after red-team)
154
+
155
+ This ordering matches the execution sequence: red-team → validate.
156
+
157
+ ```markdown
158
+ ## Red Team Review
159
+
160
+ ### Session — {YYYY-MM-DD}
161
+ **Findings:** {total} ({accepted} accepted, {rejected} rejected)
162
+ **Severity breakdown:** {N} Critical, {N} High, {N} Medium
163
+
164
+ | # | Finding | Severity | Disposition | Applied To |
165
+ |---|---------|----------|-------------|------------|
166
+ | 1 | {title} | Critical | Accept | Phase 2 |
167
+ | 2 | {title} | High | Reject | — |
168
+ ```
169
+
170
+ ## Output
171
+
172
+ After completion, provide summary:
173
+ - Total findings by severity
174
+ - Accepted vs rejected count
175
+ - Files modified
176
+ - Key risks addressed
177
+ - Remaining concerns (if any rejected findings were borderline)
178
+
179
+ ## Next Steps (MANDATORY)
180
+
181
+ After providing the summary, remind the user:
182
+
183
+ > **Plan updated with red-team findings.** Consider running:
184
+ > ```
185
+ > /plan:validate {ABSOLUTE_PATH_TO_PLAN_DIR}/plan.md
186
+ > ```
187
+ > to re-validate decisions after changes, then:
188
+ > ```
189
+ > /cook --auto {ABSOLUTE_PATH_TO_PLAN_DIR}/plan.md
190
+ > ```
191
+ > to implement.
192
+
193
+ ## Important Notes
194
+
195
+ **IMPORTANT:** Reviewers must be HOSTILE, not helpful. No softening language.
196
+ **IMPORTANT:** Deduplicate aggressively — reviewers will find overlapping issues.
197
+ **IMPORTANT:** Adjudication must be evidence-based. Don't reject valid findings to be nice.
198
+ **IMPORTANT:** If plan has a Validation Log from `/plan:validate`, reviewers should check if validation answers introduced new assumptions.
199
+ **IMPORTANT:** Sacrifice grammar for concision in reports.
200
+ **IMPORTANT:** Reviewers read plan files directly — do NOT duplicate content in a summary.
@@ -0,0 +1,188 @@
1
+ ---
2
+ description: Validate plan with critical questions interview
3
+ argument-hint: [plan-path]
4
+ ---
5
+
6
+ ## Your mission
7
+
8
+ Interview the user with critical questions to validate assumptions, confirm decisions, and surface potential issues in an implementation plan before coding begins.
9
+
10
+ ## Plan Resolution
11
+
12
+ 1. If `$ARGUMENTS` provided → Use that path
13
+ 2. Else check `## Plan Context` section → Use active plan path
14
+ 3. If no plan found → Ask user to specify path or run `/plan --hard` first
15
+
16
+ ## Configuration (from injected context)
17
+
18
+ Check `## Plan Context` section for validation settings:
19
+ - `mode` - Controls auto/prompt/off behavior
20
+ - `questions` - Range like `3-8` (min-max)
21
+
22
+ These values are automatically injected from user config. Use them as constraints.
23
+
24
+ ## Workflow
25
+
26
+ ### Step 1: Read Plan Files
27
+
28
+ Read the plan directory:
29
+ - `plan.md` - Overview and phases list
30
+ - `phase-*.md` - All phase files
31
+ - Look for decision points, assumptions, risks, tradeoffs
32
+
33
+ ### Step 2: Extract Question Topics
34
+
35
+ Scan plan content for:
36
+
37
+ | Category | Keywords to detect |
38
+ |----------|-------------------|
39
+ | **Architecture** | "approach", "pattern", "design", "structure", "database", "API" |
40
+ | **Assumptions** | "assume", "expect", "should", "will", "must", "default" |
41
+ | **Tradeoffs** | "tradeoff", "vs", "alternative", "option", "choice", "either/or" |
42
+ | **Risks** | "risk", "might", "could fail", "dependency", "blocker", "concern" |
43
+ | **Scope** | "phase", "MVP", "future", "out of scope", "nice to have" |
44
+
45
+ ### Step 3: Generate Questions
46
+
47
+ For each detected topic, formulate a concrete question:
48
+
49
+ **Question format rules:**
50
+ - Each question must have 2-4 concrete options
51
+ - Mark recommended option with "(Recommended)" suffix
52
+ - Include "Other" option is automatic - don't add it
53
+ - Questions should surface implicit decisions
54
+
55
+ **Example questions:**
56
+
57
+ ```
58
+ Category: Architecture
59
+ Question: "How should the validation results be persisted?"
60
+ Options:
61
+ 1. Save to plan.md frontmatter (Recommended) - Updates existing plan
62
+ 2. Create validation-answers.md - Separate file for answers
63
+ 3. Don't persist - Ephemeral validation only
64
+ ```
65
+
66
+ ```
67
+ Category: Assumptions
68
+ Question: "The plan assumes API rate limiting is not needed. Is this correct?"
69
+ Options:
70
+ 1. Yes, rate limiting not needed for MVP
71
+ 2. No, add basic rate limiting now (Recommended)
72
+ 3. Defer to Phase 2
73
+ ```
74
+
75
+ ### Step 4: Interview User
76
+
77
+ Use `AskUserQuestion` tool to present questions.
78
+
79
+ **Rules:**
80
+ - Use question count from `## Plan Context` → `Validation: mode=X, questions=MIN-MAX`
81
+ - Group related questions when possible (max 4 questions per tool call)
82
+ - Focus on: assumptions, risks, tradeoffs, architecture
83
+
84
+ ### Step 5: Document Answers
85
+
86
+ After collecting answers, update `plan.md` with a detailed validation log. If a `## Validation Log` section already exists (from previous sessions), **append** a new session block — never overwrite history.
87
+
88
+ 1. Add or append to `## Validation Log` section in `plan.md`:
89
+
90
+ ```markdown
91
+ ## Validation Log
92
+
93
+ ### Session 1 — {YYYY-MM-DD}
94
+ **Trigger:** {what prompted this validation — initial plan creation, re-validation after scope change, etc.}
95
+ **Questions asked:** {count}
96
+
97
+ #### Questions & Answers
98
+
99
+ 1. **[{Category}]** {full question text}
100
+ - Options: {A} | {B} | {C}
101
+ - **Answer:** {user's choice}
102
+ - **Custom input:** {verbatim "Other" text if user selected Other, otherwise omit this line}
103
+ - **Rationale:** {why this decision matters for implementation}
104
+
105
+ 2. **[{Category}]** {full question text}
106
+ - Options: {A} | {B} | {C}
107
+ - **Answer:** {user's choice}
108
+ - **Custom input:** {verbatim text, omit if N/A}
109
+ - **Rationale:** {why this matters}
110
+
111
+ #### Confirmed Decisions
112
+ - {decision}: {choice} — {brief why}
113
+
114
+ #### Action Items
115
+ - [ ] {specific change needed based on answers}
116
+
117
+ #### Impact on Phases
118
+ - Phase {N}: {what needs updating and why}
119
+ ```
120
+
121
+ **Recording rules:**
122
+ - **Full question text**: Copy the exact question asked, not a summary
123
+ - **All options**: List every option that was presented
124
+ - **Verbatim custom input**: If user selected "Other" and typed custom text, record it exactly as entered — this often contains critical context
125
+ - **Rationale**: Explain why the decision affects implementation (helps future agents understand intent)
126
+ - **Session numbering**: Increment session number from last existing session. First validation = Session 1
127
+ - **Trigger**: State what prompted this validation round (initial, re-validation, scope change, etc.)
128
+
129
+ 2. If answers require plan changes, document them in `#### Impact on Phases` section.
130
+
131
+ ### Step 6: Propagate Changes to Phases (Auto-Apply)
132
+
133
+ **Auto-propagate** validation decisions to affected phase files.
134
+
135
+ **Process:**
136
+ 1. Parse "Impact on Phases" section → If empty, skip and report "No phase changes required"
137
+ 2. For each phase reference (accepts "Phase 2", "phase-02", "P2"):
138
+ - Glob for `phase-{N:02d}-*.md` → If missing, warn and skip
139
+ - Locate target section (exact → fuzzy → fallback to Key Insights)
140
+ - Apply change + add marker: `<!-- Updated: Validation Session N - {change} -->`
141
+ - Skip if same-session marker already exists (prevent duplication)
142
+
143
+ **Section mapping:**
144
+ | Change Type | Target Section |
145
+ |-------------|----------------|
146
+ | Requirements | Requirements |
147
+ | Architecture | Architecture |
148
+ | Scope | Overview / Implementation Steps |
149
+ | Risk | Risk Assessment |
150
+ | Unknown | Key Insights (new subsection) |
151
+
152
+ **Error handling:** Best-effort — log warnings for missing files/sections, continue with others, report all in Output.
153
+
154
+ ## Output
155
+
156
+ After validation completes, provide summary:
157
+ - Number of questions asked
158
+ - Key decisions confirmed
159
+ - **Phase propagation results:**
160
+ - ✅ Files updated (with section names)
161
+ - ⚠️ Warnings (skipped phases, fallback sections)
162
+ - ❌ Errors (if any write failures)
163
+ - Any items flagged for plan revision
164
+ - Recommendation: proceed to implementation or revise plan first
165
+
166
+ ## Next Steps (MANDATORY)
167
+
168
+ **IMPORTANT:** After providing the validation summary, you MUST remind the user with the **full absolute path**:
169
+
170
+ > **Best Practice:** Run `/clear` before implementing to start with fresh context.
171
+ > Then run:
172
+ > ```
173
+ > /cook --auto {ABSOLUTE_PATH_TO_PLAN_DIR}/plan.md
174
+ > ```
175
+ > *(Replace with actual absolute path, e.g., `/home/user/project/plans/260203-1234-feature/plan.md`)*
176
+ >
177
+ > **Why `--auto`?** Plan was already validated - safe to skip review gates.
178
+ > **Why absolute path?** After `/clear`, the new session loses context. Worktree paths won't be discoverable without the full path.
179
+ >
180
+ > Fresh context helps Claude focus solely on implementation without planning context pollution, improving plan adherence.
181
+
182
+ This reminder is **NON-NEGOTIABLE** - always output it at the end of validation with the actual absolute path.
183
+
184
+ ## Important Notes
185
+
186
+ **IMPORTANT:** Only ask questions about genuine decision points - don't manufacture artificial choices.
187
+ **IMPORTANT:** If plan is simple with few decisions, it's okay to ask fewer than min questions.
188
+ **IMPORTANT:** Prioritize questions that could change implementation significantly.