skills/think/SKILL.md
Design exploration with adversarial critique by critic-design. Assembles the surviving approach into a structured plan, self-checks it, and returns it to the caller. The issue's Plan section is the plan's only persistent home. Do NOT use for codebase investigation without planning intent (use /research instead).
npx skillsauth add thkt/dotclaude thinkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Subject 2+ approaches to critic-design critique, and let only the surviving approach reach the structured plan. Write the plan to a draft file following the templates/plan.md skeleton and also return it in conversation. Persistence happens when /issue transfers it into the issue's Plan section.
$ARGUMENTS carries the task description and research context. If empty, confirm with the user via AskUserQuestion. The first line is the task title.
Read .claude/OUTCOME.md. If it does not exist, generate it via /outcome. Who needs this and with what pain (with evidence), what counts as success, and why now. Design starts only once this Why is readable from $ARGUMENTS and the conversation. Do not proceed on placeholders; pin it down via AskUserQuestion.
Ground the approaches in the real code and existing research. Read the relevant code, and read any research output under .claude/workspace/research/ that matches the task. Treat findings whose Next Action reads record only as background knowledge, not plan scope. Generate 2+ approaches from distinct perspectives (simplest thing that works / structure and extensibility / developer experience). Do not bundle independent technical decisions into one question; ask each separately with a recommendation and trade-offs.
critic-design on the approaches. Include the task title verbatim in the prompt, and have it return a single JSON object { verdict: "GO" | "NO-GO", weaknesses: string[], actionable: string[] }Decompose the approved design into units, independently implementable bundles of outcome, in implementation order, and serialize them into PLAN_SCHEMA-equivalent JSON { test_command, reference_module, units: [{ id, goal, contract, files: string[], tests: [{ id, name }], seam }] }. Construct the decomposition tests-first, so unit size is decided mechanically from the test bundles. Enumerate acceptance-test candidates from the whole design, group them into bundles of 4 or fewer per unit of outcome, and assign each bundle the files it touches to form a unit. Split any bundle whose assignment reaches 4 or more files. Outcomes with no verifiable behavior (docs / config) are added separately as units with empty tests.
seam: true. Its tests run the real modules across the unit boundary, fake only I/O with external systems, and assert the connections between units. build's validate() rejects a plan with no seam unitUNIT_CAPS in workflows/build.js. Change this description and UNIT_CAPS in the same commit${CLAUDE_SKILL_DIR}/templates/plan.md skeleton to .claude/workspace/planning/YYYY-MM-DD-<slug>.plan.md. The slug is the lowercase hyphenated title. Include both the ## Plan and ## Backlog candidates sectionsA contract cites a behavior at one call site, which cannot stop the surrounding structure from being hand-rolled. Search for an existing module with the same shape as the one being planned (a matching set of screens or layers, in any domain), record it as reference_module: { path, files, instances }. The reference_module section itself is what carries the structure, and every unit refers to it. Make U-001 its structure replication (same directory layout, component names, export names; tests is an empty array) only when the skeleton fits under 4 files; otherwise split units by layer and let each unit replicate its own slice. State the shared conventions to keep (which shared components it composes, where formatting lives, how state is passed); deviating is allowed only with a stated reason in the plan. When several candidates match, pick the one whose screen set is closest and name the others in the prose. When none matches, write null and say in the prose why this shape is new (a null with no reason is a planning defect). When instances is 2 or more, say "Nth instance" in the prose, telling the implementer to replicate rather than design.
Select, do not generate. Never sketch behavior in prose or invent new code fragments; a contract is a citation plus one intent line. Pick the citation in this priority order: an existing shape in the codebase (path + public symbol, under the same stable-anchor rules as Preconditions) > a docs/wiki page > a deep link into the pinned version's official docs; external libraries follow SOURCING.md. For a new shape with no citable source, do not invent a signature; leave the shape to implementation and let the acceptance tests pin the behavior. Cited paths + symbols also go into ### Preconditions.
List existing dependencies only, each line repo-root-relative in one of two forms: path only, or path + stable anchor. An anchor is limited to a single exported / public symbol name that ugrep -F matches as a literal fixed string; never private implementation details, comment strings, or line numbers. When no stable symbol exists, write the line as path only. Files newly created by a unit are never listed.
A test_command failure must be attributable to the planned scope alone. On a repository with pre-existing debt (repo-wide type errors, format drift), scope the gate by paths: lint the touched directories and filter type-check output by path patterns, never by content grep.
base: names the branch the plan will be implemented against (the PR base). Read it from the task description or the conversation; when nothing names one, write the current checkout's branch.
Verify from the same repository root as the build workflow's Revalidate; fix or drop any failing line. When base: names a branch other than the current checkout, verify file existence via git cat-file -e <base>:<path> instead of test -f <path>, and anchors via git show <base>:<path> | ugrep -F '<pattern>'.
### Preconditions line: paths via test -f <path>, anchors via ugrep -F '<pattern>' <path> (base-branch forms above when base differs)units[].files and reference_module.files entry that refers to an existing file, via test -f <path> (same base-branch substitution)### Preconditions is empty or absent, that is a failure; add a line anchoring the load-bearing dependencyreference_module: null with no stated reason in the prose failsfiles entries and T-NNN entries; no unit has 4 or more files or 5 or more tests. If one does, split it and re-verify### test_command and state the scoping reason in the plan proseReturn the following to the caller in conversation.
| Item | Content |
| ------------------ | ------------------------------------------------------------------------------------ |
| ready | true when the plan passed the self-check and no undecided points remain |
| plan | The self-checked structured plan |
| plan file | Path of the written .plan.md |
| blockers | Causes of ready = false that need a user decision |
| backlog candidates | Candidates carved out of scope. "none" if none |
| design summary | Adopted approach, compared approaches, the critic-design verdict, DR needed or not |
tools
Delegate implementation to codex (coder) via the herdr-agentchat plugin and drive a two-pane conversation to completion.
development
Extract recurring patterns from past closed PRs/issues and the research findings in workspace/research/, verify them against the latest code, and propose them to docs/wiki/ via PR.
development
Create Decision Records (DR) in MADR v4 format with auto-numbering.
development
Detect flaky tests by shaking them — repeated runs under varied order, parallelism, and seed — plus a static smell scan that flags latent flakiness in tests that currently pass. Classify each target as confirmed-flaky, latent-flaky, or stable and fix the root cause without weakening the test. Do NOT use to fix a confirmed single bug (use /fix) or for static-only code review (use /audit).