From cwf
Resolves requirement ambiguity before implementation by decomposing into decision points and asking targeted questions. Auto-selects depth: default research mode or --light Q&A based on input specificity.
npx claudepluginhub corca-ai/claude-plugins --plugin cwfThis skill uses the workspace's default tool permissions.
Resolve ambiguity before planning so implementation starts from explicit decisions, not assumptions.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Resolve ambiguity before planning so implementation starts from explicit decisions, not assumptions.
cwf:clarify <requirement> # Research-first (default)
cwf:clarify <requirement> --light # Direct Q&A, no sub-agents
Before entering Default or --light mode, assess clarify depth based on input specificity:
next-session.md exists in the active session directory or current workspace, read it as optional prior-session context.| Input specificity | Clarify depth | Rationale |
|---|---|---|
| All 3 present (files + changes + criteria) | AskUserQuestion only — ask 2-3 binary/choice questions for remaining ambiguities, skip Phases 2-2.5 | Prior session retro effectively served as clarify |
| 1-2 present | --light mode — iterative Q&A without sub-agents | Partial clarity, direct questions suffice |
| None present (vague requirement) | Default mode — full research + expert analysis | Scope is open, exploration needed |
This heuristic can be overridden by explicit --light flag or user instruction.
Use the live-state helper for scalar fields, then edit list fields in the resolved live-state file:
bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh set . \
phase="clarify" \
task="{requirement summary}"
live_state_file=$(bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh resolve)
Set live.key_files in {live_state_file} to files relevant to the requirement.
Resolve the effective live-state file, then read live.dir before any {session_dir} placeholder use:
live_state_file=$(bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh resolve)
session_dir=$(bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh get . dir)
session_dir: "{live.dir value from resolved live-state file}"
## Original Requirement
"{user's original request verbatim}"
## Decision Points
1. {specific question}
2. {specific question}
...
Apply the context recovery protocol to these files:
{session_dir}/clarify-codebase-research.md{session_dir}/clarify-web-research.mdLaunch sub-agents simultaneously using the Task tool (only for missing or invalid results).
Task tool:
subagent_type: Explore
max_turns: 20
prompt: |
Read `{SKILL_DIR}/references/research-guide.md` and follow
**Section 1: Codebase Research** exactly.
Report evidence only — do not make decisions.
Decision points:
{list from Phase 1}
Write your complete findings to: {session_dir}/clarify-codebase-research.md
The file MUST exist when you finish. End your output file with the exact
line `<!-- AGENT_COMPLETE -->` as the last line.
Task tool:
subagent_type: general-purpose
max_turns: 20
prompt: |
Read `{SKILL_DIR}/references/research-guide.md` and follow
**Section 2: Web / Best Practice Research** exactly.
Also follow the "Web Research Protocol" section in
`{CWF_PLUGIN_DIR}/references/agent-patterns.md` for tool order
and fallback behavior.
Report findings only — do not make decisions.
Decision points:
{list from Phase 1}
Write your complete findings to: {session_dir}/clarify-web-research.md
The file MUST exist when you finish. End your output file with the exact
line `<!-- AGENT_COMPLETE -->` as the last line.
Both sub-agents run in parallel. Wait for both to complete. Read the output files from session dir (not the in-memory Task return values).
Apply the context recovery protocol to these files:
{session_dir}/clarify-expert-alpha.md{session_dir}/clarify-expert-beta.mdLaunch two domain expert sub-agents simultaneously using the Task tool (only for missing or invalid results).
Expert selection:
expert_roster from cwf-state.yamldomain fieldTask tool:
subagent_type: general-purpose
max_turns: 12
prompt: |
Read {CWF_PLUGIN_DIR}/references/expert-advisor-guide.md.
You are Expert α, operating in **clarify mode**.
Your identity: {selected expert name}
Your framework: {expert's domain from roster or independent selection}
Decision points:
{list from Phase 1}
Research findings summary:
{summarized outputs from Phase 2 codebase + web research}
Analyze which decisions are most critical through your published framework.
Use web search to verify your expert identity and cite published work.
Output your analysis in the clarify mode format from the guide.
Write your complete findings to: {session_dir}/clarify-expert-alpha.md
The file MUST exist when you finish. End your output file with the exact
line `<!-- AGENT_COMPLETE -->` as the last line.
Task tool:
subagent_type: general-purpose
max_turns: 12
prompt: |
Read {CWF_PLUGIN_DIR}/references/expert-advisor-guide.md.
You are Expert β, operating in **clarify mode**.
Your identity: {selected expert name — contrasting framework from Expert α}
Your framework: {expert's domain from roster or independent selection}
Decision points:
{list from Phase 1}
Research findings summary:
{summarized outputs from Phase 2 codebase + web research}
Analyze which decisions are most critical through your published framework.
Use web search to verify your expert identity and cite published work.
Output your analysis in the clarify mode format from the guide.
Write your complete findings to: {session_dir}/clarify-expert-beta.md
The file MUST exist when you finish. End your output file with the exact
line `<!-- AGENT_COMPLETE -->` as the last line.
Both expert sub-agents run in parallel. Wait for both to complete. Read the output files from session dir (not the in-memory Task return values).
--light mode: Phase 2.5 is skipped (consistent with --light skipping all sub-agents).
Read {SKILL_DIR}/references/aggregation-guide.md for full classification rules.
For each decision point, classify using three evidence sources: codebase research (Phase 2), web research (Phase 2), and expert analysis (Phase 2.5).
Constructive tension: When sources conflict, classify as T3. Expert analysis provides additional signal but does not override direct codebase or best-practice evidence.
Present the classification:
## Agent Decisions (T1 & T2)
| # | Decision Point | Tier | Decision | Evidence |
|---|---------------|------|----------|----------|
| 1 | ... | T1 | ... | file paths |
| 2 | ... | T2 | ... | sources |
## Requires Human Decision (T3)
| # | Decision Point | Reason |
|---|---------------|--------|
| 3 | ... | conflict / no evidence / subjective |
If zero T3 items: Skip Phases 3.5 and 4 entirely. Go to Phase 5.
Apply the context recovery protocol to these files:
{session_dir}/clarify-advisor-alpha.md{session_dir}/clarify-advisor-beta.mdLaunch two advisory sub-agents simultaneously (only for missing or invalid results):
Task tool:
subagent_type: general-purpose
model: haiku
max_turns: 12
prompt: |
Read `{SKILL_DIR}/references/advisory-guide.md`. You are Advisor α.
Tier 3 decision points:
{list of T3 items}
Research context:
{codebase findings for these items}
{web research findings for these items}
Argue for the first perspective per the guide's side-assignment rules.
Write your complete findings to: {session_dir}/clarify-advisor-alpha.md
The file MUST exist when you finish. End your output file with the exact
line `<!-- AGENT_COMPLETE -->` as the last line.
Task tool:
subagent_type: general-purpose
model: haiku
max_turns: 12
prompt: |
Read `{SKILL_DIR}/references/advisory-guide.md`. You are Advisor β.
Tier 3 decision points:
{list of T3 items}
Research context:
{codebase findings for these items}
{web research findings for these items}
Argue for the opposing perspective per the guide's side-assignment rules.
Write your complete findings to: {session_dir}/clarify-advisor-beta.md
The file MUST exist when you finish. End your output file with the exact
line `<!-- AGENT_COMPLETE -->` as the last line.
Both advisors run in parallel. Wait for both to complete. Read the output files from session dir (not the in-memory Task return values).
Read {SKILL_DIR}/references/questioning-guide.md for full methodology.
For each T3 item, use AskUserQuestion with:
After each answer:
## Requirement Clarification Summary
### Before (Original)
"{original request verbatim}"
### After (Clarified)
**Goal**: {precise description}
**Scope**: {what is included and excluded}
**Constraints**: {limitations and requirements}
### Expert Analysis
(Only in default mode, omitted in --light)
| Expert | Framework | Key Insight |
|--------|-----------|-------------|
| {Expert α name} | {framework} | {1-line summary of analysis} |
| {Expert β name} | {framework} | {1-line summary of analysis} |
### All Decisions
| # | Decision Point | Decision | Decided By | Evidence |
|---|---------------|----------|------------|----------|
| 1 | ... | ... | Agent (T1) | file paths |
| 2 | ... | ... | Agent (T2) | sources |
| 3 | ... | ... | Human | advisory context |
Save this clarified requirement to a project-appropriate location with a descriptive filename (required).
Completion tracking (after writing the required summary file):
bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh set . clarify_completed_at="{ISO 8601 UTC timestamp}"bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh set . clarify_result_file="{saved summary file path}"This state is what cwf:impl Phase 1.0 checks as a pre-condition.
Follow-up suggestions (when CWF plugin is loaded):
cwf:review --mode clarify — Multi-perspective review of the clarified requirement before implementationcwf:handoff --phase — Generate a phase handoff document that captures HOW context (protocols, rules, must-read references, constraints) for the implementation phase. Recommended when context will be cleared before implementation, as plan.md carries WHAT but not HOW.Present both suggestions. If context is getting large or the user is about to clear context, emphasize the phase handoff suggestion.
Fast, direct clarification without sub-agents. The original clarify behavior with added persistence.
Read {SKILL_DIR}/references/questioning-guide.md for methodology.
Loop using AskUserQuestion:
while ambiguities remain:
pick most critical ambiguity
ask with 2-4 concrete options
why-dig on surface-level answers (2-3 levels)
detect tensions with prior answers
check for new ambiguities
## Requirement Clarification Summary
### Before (Original)
"{original request verbatim}"
### After (Clarified)
**Goal**: {precise description}
**Reason**: {the ultimate purpose or jobs-to-be-done}
**Scope**: {what is included and excluded}
**Constraints**: {limitations, requirements, preferences}
**Success Criteria**: {how to verify correctness}
### Decisions Made
| Question | Decision |
|----------|----------|
| ... | ... |
Save the summary to a project-appropriate location with a descriptive filename (required).
Completion tracking (after writing the required summary file):
bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh set . clarify_completed_at="{ISO 8601 UTC timestamp}"bash {CWF_PLUGIN_DIR}/scripts/cwf-live-state.sh set . clarify_result_file="{saved summary file path}"This state is what cwf:impl Phase 1.0 checks as a pre-condition.
Expert Roster Update (when experts were used in Phase 2.5): Follow the Roster Maintenance procedure in {CWF_PLUGIN_DIR}/references/expert-advisor-guide.md.
Follow-up (when CWF plugin is loaded): Suggest cwf:handoff --phase if the user plans to clear context before implementation.