clarify

Decompose user intent through structured brainstorming. Detects underspecification, ambiguity, and false premises through hypothesis-driven questioning. Use when a request is unclear, could have multiple valid interpretations, or critical details are missing.

211 stars

Best use case

clarify is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Decompose user intent through structured brainstorming. Detects underspecification, ambiguity, and false premises through hypothesis-driven questioning. Use when a request is unclear, could have multiple valid interpretations, or critical details are missing.

Teams using clarify should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/clarify/SKILL.md --create-dirs "https://raw.githubusercontent.com/ryanthedev/code-foundations/main/skills/clarify/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/clarify/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How clarify Compares

Feature / AgentclarifyStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Decompose user intent through structured brainstorming. Detects underspecification, ambiguity, and false premises through hypothesis-driven questioning. Use when a request is unclear, could have multiple valid interpretations, or critical details are missing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Skill: clarify

Understand what the user needs before committing to work.

LLMs default to assuming rather than asking — even frontier models proceed without clarification in 70% of cases where information is missing. This skill counteracts that bias by classifying what's unclear and generating targeted clarifying questions.

Your output is a conversation: clarifying questions, differential examples, restatements. Think out loud WITH the user — collaborative exploration, not interrogation.

---

## Classifying What's Unclear

Not all gaps are the same. Classifying the type determines what kind of question to ask.

### Fault Types

**Intention faults** — The real goal isn't recoverable from the request.
- Indirect intent: "Can you check if this is possible?" (often means "please do this")
- Vague objectives: "Make it better" (better how? for whom?)
- Contextual irrelevance: user introduces an unrelated goal mid-task

**Premise faults** — An assumption in the request is wrong.
- False presupposition: "Fix the race condition in the cache" (no race condition exists)
- Capability mismatch: asking for something the system can't do
- Factual error: assumptions based on code that has since changed

**Parameter faults** — Required details are missing or conflicting.
- Insufficient information: "Build a login page" (OAuth? email/password? SSO?)
- Contradictions: "Keep it simple but handle every edge case"
- Missing priorities: everything seems equally important

**Expression faults** — The language prevents unique interpretation.
- Referential ambiguity: "Update that component" (which one?)
- Lexical ambiguity: "Clean up the API" (refactor? deprecate? document?)
- Scope ambiguity: "Production-ready" means different things to different people

### Ambiguity Direction

Once you've identified a gap, classify which direction it pulls — this shapes your question:

| Direction | Signal | Clarification Action |
|-----------|--------|---------------------|
| **Semantic** | Key terms have multiple valid meanings | Disambiguate: "do you mean A or B?" |
| **Too broad** | Clear intent but scope is huge | Specify: "which part matters most right now?" |
| **Too narrow** | Request is oddly specific for the likely goal | Generalize: "what's the broader outcome you're after?" |

### For Coding Tasks Specifically

Three concrete ways a coding request becomes ambiguous:

- **Missing goal**: the what/why is absent — only the how is stated
- **Missing premises**: constraints are unstated (sort order, error handling, edge cases)
- **Ambiguous terminology**: precise terms replaced with vague ones ("sorted appropriately" vs "ascending by date")

Inconsistencies between requirements are the hardest to detect. Explicitly check whether parts of the request conflict with each other.

---

## Generating Questions

### Think in Hypotheses

Don't start with "what should I ask?" Start with "what are the plausible interpretations?" Then find the question whose answer eliminates the most of them.

1. Generate 2-4 competing interpretations of the request
2. Identify what distinguishes them — the axis of disagreement
3. Ask about that axis

**Example:**
- Request: "Add caching to the API"
- Interpretation A: In-memory cache for latency
- Interpretation B: External cache (Redis) for scaling
- Interpretation C: HTTP cache headers for clients
- Axis: what problem are they solving — speed, load, or bandwidth?
- Question: "What's driving the caching need — slow responses, high server load, or reducing redundant client requests?"

One question targeting the axis of disagreement beats three questions about implementation details.

### Select for Information Gain

Among possible questions, ask the one that maximally reduces uncertainty across your interpretations. If question A would split your hypotheses 50/50 and question B would split them 90/10, ask A — it's more informative regardless of the answer.

Target convergence in 3-5 rounds. Beyond that, returns diminish sharply.

### Concrete Over Abstract

When possible, show the user what different interpretations produce rather than asking abstract questions:

- Weak: "How should error handling work?"
- Strong: "Right now errors silently return null. Option A: throw and let the caller handle it. Option B: return a Result type. They'd look like [snippet A] vs [snippet B]."

Show differential behavioral examples — "If you mean X, here's what happens for input Z. If you mean Y, here's what happens instead." Let the user pick based on observable behavior, not abstract description.

### Five Clarification Strategies

Match your approach to the fault type:

| Strategy | When | Example |
|----------|------|---------|
| **Ask for parameter** | Specific detail is missing | "What should happen when the input is empty?" |
| **Disambiguate** | Multiple valid interpretations exist | "By 'refactor,' do you mean restructure the module or clean up naming?" |
| **Propose alternatives** | Constraints make the request impossible as stated | "That endpoint doesn't support pagination. We could add it, or switch to cursor-based fetching." |
| **Confirm risk** | High-stakes irreversible action | "This would drop the existing table. Proceed, or migrate the data first?" |
| **Report blocker** | Objective barrier exists | "The API rate-limits to 100 req/s. The current design needs 300. How should we handle that?" |

---

## Question Quality

### Attributes

Every question should pass these checks:

| Attribute | Test |
|-----------|------|
| **Focused** | Addresses ONE gap — no compound questions |
| **Answerable** | User can answer from what they already know |
| **Discriminative** | The answer meaningfully narrows interpretations |
| **Non-leading** | Doesn't presuppose the answer |
| **Task-relevant** | Directly advances the work at hand |
| **Constructive** | Builds toward shared understanding, not just gathering data |

### Effort Awareness

Estimate the effort each question requires from the user:

| Effort | Example | Policy |
|--------|---------|--------|
| **Low** | "Should this be async or sync?" | Ask freely — user already knows |
| **Medium** | "What's the expected request volume?" | Ask only if important — user might not know |
| **High** | "What does the upstream service return on timeout?" | Don't ask — investigate yourself |

**The principle: ask about intent, goals, and constraints (the user's knowledge). Figure out implementation details yourself (your job).**

---

## Managing the Conversation

### Track Intent State

Maintain two mental sets as the conversation progresses:

- **Confirmed** (+): interpretations, constraints, and goals the user has validated
- **Ruled out** (-): interpretations the user has rejected or that contradict confirmed information

Score remaining interpretations by alignment with confirmed items and conflict with ruled-out items. This naturally narrows the space with each turn.

### Decouple the Decisions

Three separate questions, in order:

1. **Should I clarify?** — Is there meaningful ambiguity that would change my approach?
2. **What type of clarification?** — Which fault type and strategy apply?
3. **How do I phrase it?** — What specific question, with what framing?

Don't collapse these. Deciding to clarify and blurting out the first question that comes to mind skips the targeting step.

### Short-Circuit Rules

- If all key information is present and you have no competing hypotheses, proceed directly.
- When asking and not-asking would produce equally good outcomes, don't ask. Favor action on ties.
- If the user signals "just do it" or "whatever works," stop asking and work with your best interpretation.

---

## Anti-Patterns

| Pattern | Problem | Instead |
|---------|---------|---------|
| Proceeding without checking | 70% default execution bias | Run detection as a separate pass first |
| Asking implementation details | Shifts investigation to the user | Figure it out from the codebase |
| Rapid-fire question lists | Feels like an interrogation | 1-3 questions max per turn |
| Asking what you could read from code | Wastes their time | Read first, ask about what you can't determine |
| Over-asking on clear requests | Delays work, erodes trust | If it's clear, proceed |
| Abstract questions | Harder for the user to reason about | Show differential examples |
| Leading questions | Biases response, masks intent | Open-ended, or balanced options |
| One round and done | Complex requests need iteration | Continue until hypotheses converge |
| Asking when outcomes are equivalent | Unnecessary friction | Favor direct action on ties |

---

## Chain

| After | Next |
|-------|------|
| Ambiguity resolved, shared understanding reached | Return to calling skill with goal/scope/constraints/approach |
| New ambiguity surfaces during work | Re-enter clarify loop |

Related Skills

whiteboarding-planning

211
from ryanthedev/code-foundations

Standard/Full planning pipeline for whiteboarding. Steps: discover, classify, explore, detail, save, check, confirm, handoff. Use when dispatched from whiteboarding command for Medium/Complex tasks. Triggers on 'planning pipeline', 'standard track', 'full track'.

welc-legacy-code

211
from ryanthedev/code-foundations

Use when facing untested legacy code, test harness problems, dependency issues, or time pressure. Triggers on: legacy code, no tests, can't test, afraid to change, need to modify untested code.

performance-optimization

211
from ryanthedev/code-foundations

Use when code is too slow, has performance issues, timeouts, OOM errors, high CPU/memory, or doesn't scale. Triggers on: profiler hot spots, latency complaints, needs optimization, critical path analysis.

code-clarity-and-docs

211
from ryanthedev/code-foundations

Use when reviewing code clarity, writing comments, checking documentation accuracy, or auditing AI-facing docs. Triggers on: naming, comments, documentation, README, CLAUDE.md.

cc-routine-and-class-design

211
from ryanthedev/code-foundations

Use when designing routines or classes, reviewing class interfaces, choosing between inheritance and containment, or evaluating routine cohesion. Also trigger when inheritance is used without LSP verification, or when design issues are present despite passing tests

cc-refactoring-guidance

211
from ryanthedev/code-foundations

Use when modifying existing code, improving structure without changing behavior, or deciding between refactor, rewrite, or fix-first.

cc-quality-practices

211
from ryanthedev/code-foundations

Use when planning QA, choosing review methods, designing tests, or debugging fails. Triggers on: defects found late, tests pass but production bugs, coverage disputes, review ineffective, spending excessive time debugging.

cc-pseudocode-programming

211
from ryanthedev/code-foundations

Use when designing routines, stuck on where to start coding, caught in compile-debug loops, or code works but you don't understand why. Triggers on: starting a new coding task

cc-defensive-programming

211
from ryanthedev/code-foundations

Use when auditing defensive code, designing barricades, choosing assertion vs error handling, or deciding correctness vs robustness strategy. Triggers on: empty catch blocks, missing input validation, assertions with side effects, wrong exception abstraction level, garbage in garbage out mentality, deadline pressure to skip validation, trusted source rationalization.

cc-control-flow-quality

211
from ryanthedev/code-foundations

Use when code has deep nesting (3+ levels), complex conditionals, loop design questions, high cyclomatic complexity (McCabe >10), or callback hell. Symptoms: arrow-shaped code, repeated conditions, confusing loop exits, lengthy if-else chains

ca-architecture-boundaries

211
from ryanthedev/code-foundations

Use when designing system architecture, drawing boundaries between business logic and infrastructure, or when changes touch many unrelated files. Triggers on: architecture design, dependency direction, separating business rules from database/UI/frameworks.

aposd-verifying-correctness

211
from ryanthedev/code-foundations

Use after implementing code. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.