From quiver
Orchestrates structured planning with parallel research agents to clarify scope, assess complexity, and produce step-by-step implementation plans before coding.
How this skill is triggered — by the user, by Claude, or both
Slash command
/quiver:plan <task description>When to use
user asks to make a plan, structure work, or plan a feature -- '/plan', 'make a plan', 'plan this out', 'how should I approach X'
<task description>The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
!`git rev-parse --is-inside-work-tree 2>/dev/null || echo "NO_GIT"`
!`git branch --show-current 2>/dev/null || echo "NO_GIT"`
!`git log --oneline -5 2>/dev/null || echo "NO_GIT"`
!`git branch --sort=-committerdate 2>/dev/null || echo "NO_GIT"`
You are a planning orchestrator. Your job is to clarify the task, dispatch research agents in parallel, synthesize their findings, and draft a step-by-step implementation plan. You do NOT write code -- you research, design, and document.
If any gather-context block above returned NO_GIT, this directory is not a git repository.
Print: > No git repository detected -- skipping branch/commit context.
Proceed to Step 1. Treat all git-sourced fields (branch, log, diff, status) as empty.
If $ARGUMENTS is empty and the conversation has no obvious pending task:
No task to plan. Usage:
/plan <describe the task you want to plan>Stop here.
Otherwise:
Restate the task goal in one sentence.
List boundaries -- what is in scope, what is out.
Identify the focus area. If the task description is broad or ambiguous (e.g., "refactor the map page", "improve the dashboard"), use AskUserQuestion to clarify scope. Build action buttons from the relevant categories detected during initial context gathering. Always include a free-text option as the last button.
Example -- for a broad "refactor X page" request:
What aspect of {area} should the plan focus on? Buttons:
["UI/Design -- layout, styling, animations", "Architecture -- state management, code structure", "Performance -- loading, caching, optimization", "All of the above -- full overhaul", "Other (I'll describe)"]
Example -- for an ambiguous "add auth" request:
Which authentication approach should the plan target? Buttons:
["OAuth2 (Google, GitHub)", "Email/password", "Magic links", "SSO/SAML", "Other (I'll describe)"]
Rules: Use AskUserQuestion with codebase-derived buttons (never plain text). Include "Other" as last option. At most ONE question -- skip if task is clear.
Assess complexity:
| Complexity | Signals | Agents to Dispatch |
|---|---|---|
| Light | 1-3 files, single layer, well-understood | code-navigator |
| Standard | 3-10 files, 2+ layers, moderate unknowns | code-navigator + best-practices-researcher |
| Deep | 10+ files, architectural impact, security/auth/payments, unfamiliar domain | code-navigator + best-practices-researcher + architecture-strategist |
If the task is trivial (single file, obvious change), use AskUserQuestion:
This task is straightforward enough to implement directly. Buttons:
["Skip plan -- implement directly", "Create a plan anyway"]
$ARGUMENTS contains a path matching .claude/reports/review-*.md or review-*_*-*-*.md, this is a review-fix plan..claude/plans/ for existing plans with the same review_source frontmatter. Count them to determine the review_iteration number (first fix plan = 1, second = 2).review_iteration would be 3 or higher, warn the user:
This would be iteration {N} of the review-fix cycle. The maximum is 2 iterations. Consider addressing remaining findings manually or accepting them as-is. Buttons:
["Create the plan anyway", "Stop -- I'll handle it manually"]
If the user picks "Skip plan", stop here and implement. Otherwise continue.
Discover available agents before dispatch:
Tier 1 -- Research agents (dynamic): Scan agents/research/*.md. For each .md file, read YAML frontmatter to extract name and description.
Tier 2 -- Review agents (selective): Scan agents/review/*.md. Only dispatch review agents when the complexity is Deep and the agent's description matches the task domain (e.g., architecture-strategist for structural changes, security-audit for auth/security tasks).
Tier 3 -- Project and user agents: Scan .claude/agents/*.md and ~/.claude/agents/*.md. Dispatch any whose description matches the task domain.
Agent identifiers use quiver:{name} for plugin agents, bare {name} for project/user agents.
Before dispatching agents, detect navigation capabilities once.
CodeGraph: Check if .codegraph/ exists at project root. Set codegraph_available to true or false. No user prompt.
LSP: Follow the detection flow from the code-navigation skill:
Check project memory for a cached LSP preference (lsp_preference.md). If lsp_declined or lsp_confirmed is found, use the cached value and skip to step 4.
Attempt a lightweight LSP probe (e.g., documentSymbol on any source file from the project root).
If LSP is not available, detect the project language from manifest files and use AskUserQuestion to suggest installation:
LSP is not available for this project. Installing a language server (e.g., {recommended_server} for {language}) would enable better code navigation -- go-to-definition, find-references, and symbol search. Would you like to set it up? (You can always use /plan without it -- grep-based navigation works fine.)
Buttons: ["Yes, help me set it up", "No, continue with grep"]
lsp_confirmed in project memory.lsp_declined in project memory.Set lsp_available to true or false. Pass both codegraph_available and lsp_available to all agents dispatched in Step 3.
Spawn all qualifying agents simultaneously using multiple Agent tool calls in a single response. Every agent prompt must be self-contained -- agents have zero memory of this conversation.
Review-fix plans: reduced dispatch. If Step 1 detected review-fix context, the review report already identified the problems and affected files. Skip best-practices-researcher and architecture-strategist -- they add no value when the scope is "fix these specific findings." Dispatch only the code-navigator agent to verify file paths and current patterns are still accurate.
Agent(
subagent_type="quiver:code-navigator",
description="Map codebase for planning: {short task summary}",
prompt="Task: {full task description from Step 1}
codegraph_available: {true|false from Step 2.5}
lsp_available: {true|false from Step 2.5}
Search this codebase for all files related to this task. For each file found, report:
1. File path
2. One-line description of its role
3. Whether it has associated test files
Also report:
- Current patterns used in this area (naming, structure, abstractions)
- Any existing utilities or helpers that could be reused
- Test framework and conventions observed
Focus on directories: {relevant dirs if known, otherwise 'scan broadly'}",
)
Agent(
subagent_type="quiver:best-practices-researcher",
description="Research best practices for: {short topic}",
prompt="Task context: {full task description}
The project uses:
- Languages: {detected from project files}
- Frameworks: {detected}
- Key libraries: {detected}
Research current best practices specifically for: {the technical areas the task touches, e.g., 'authentication middleware in Express', 'database migration patterns in Rails'}
Focus on:
1. Recommended patterns for this type of work
2. Any deprecations or breaking changes in the detected stack versions
3. Common pitfalls to avoid
4. Framework-specific conventions that apply
Keep findings actionable -- each recommendation should be something that can inform a plan step.",
)
Agent(
subagent_type="quiver:architecture-strategist",
description="Analyze architecture for: {short task summary}",
prompt="Task context: {full task description}
Project root listing:
{ls output of project root}
Analyze the existing architecture and assess how this planned change should integrate. Report:
1. Current architectural patterns (layer boundaries, dependency direction, module organization)
2. Where new code should live to follow existing conventions
3. Boundary constraints -- which layers must not be violated
4. Structural risks of the proposed change
5. Dependency implications
Do NOT review existing code quality. Focus strictly on where and how the new work fits the architecture.",
)
If agent discovery found project/user agents whose description matches the task domain, dispatch them with the same self-contained prompt pattern.
After all agents return, merge findings into a unified research brief:
Using the synthesized research, draft the plan following this document structure and detail level rules:
| Level | Complexity | Sections |
|---|---|---|
| Brief | Light | Goal, Steps, Acceptance Criteria |
| Standard | Standard | + Context (with agent findings), Risks, File Map |
| Comprehensive | Deep | + Alternatives Considered, Phased Rollout, Rollback Strategy, Architectural Constraints |
File structure mapping (before defining tasks): Map out which files will be created, modified, or deleted. This locks in decomposition decisions before task writing begins.
exact/path/to/new-file.ext -- one-line purposeexact/path/to/existing.ext -- what changes and whytests/path/to/test-file.ext -- which test files are new or updatedexact/path/to/removed.ext -- only if applicableTask granularity:
TDD task structure (when the project has tests): If the code-navigator agent found an existing test framework, structure each task following the TDD cycle:
Not every task requires TDD (e.g., config changes, docs, migrations). Apply it to tasks that produce testable behavior.
No placeholders rule: Every step must have actionable content. Never write: "TBD"/"TODO"/"implement later", "add appropriate handling"/"handle edge cases", "similar to Task N" (repeat details), "write tests" without scenarios, steps without file paths or expected outcomes, references to undefined symbols.
Language rule: Always write plan documents in English, regardless of the conversation language. Only write in another language if the user explicitly requests it.
Research integration (mandatory):
Review-fix plan frontmatter (when review-fix context detected in Step 1):
Include these fields in the plan's YAML frontmatter:
review_source: .claude/reports/review-YYYY-MM-DD_HH-MM-SS.md
review_iteration: 1 # increments for each fix plan targeting the same review
Acceptance Criteria are mandatory for review-fix plans. Derive them directly from the review findings:
After drafting the plan, run these 6 checks before presenting to the user. This is an internal quality gate -- do not show it as a separate section to the user.
Search the plan for: "TBD", "TODO", "implement later", "fill in details", "add appropriate", "handle edge cases", "similar to Task N", raw {...} template text, and steps without file paths or expected outcomes. Replace every match with concrete content. (FIX)
Extract all symbol names (functions, types, variables, file names) from every task. Flag any symbol appearing in 2+ tasks with different spellings. Normalize to the first-used spelling. (FIX)
If the plan has a brainstorm spec reference (Context section referencing docs/brainstorms/*.md) or a review source (frontmatter review_source), read the source and verify:
Flag tasks that: modify more than 3 files, have more than 5 sub-steps, lack an expected outcome, or reference no file paths. (NOTE)
Probe file paths mentioned in the plan:
If the plan has a "File Map" section: every map entry must appear in at least one task, and every task file must appear in the map. (FIX for orphans, ADD for missing entries)
After running all 6 checks:
### Plan Guard Notes subsection in the plan's Context section before the user sees the plan.After applying fixes, proceed to Step 6.5. No re-run of checks. The human review gate (Step 7) is the convergence anchor.
Skip conditions (check in order -- if any match, proceed directly to Step 7):
If neither skip condition matches, dispatch the plan-reviewer agent:
Spawn a single quiver:plan-reviewer agent with a self-contained prompt containing:
Agent(
subagent_type="quiver:plan-reviewer",
description="Semantic review of implementation plan",
prompt="Review this implementation plan for logical coherence, dependency ordering,
coverage completeness, and spec alignment.
## Plan
{full plan content with Step 6 fixes already applied}
## Source Specification
{spec content if available from the plan's Context section or spec_source frontmatter,
otherwise: 'No source specification provided.'}
## Project Context
{relevant directory listings for file paths mentioned in the plan}
Report findings using the action taxonomy: FIX, ADD, REORDER, NOTE.
If zero findings, state that explicitly.",
)
### Plan Guard Notes subsection in the plan's Context section (create it if it does not exist from Step 6).Present the full plan to the user. Then call the AskUserQuestion tool with these parameters:
If the plan exceeds 15 steps, append to the question: " Consider splitting into sub-plans or phasing the work."
Handle each response:
AskUserQuestion again.This step has TWO mandatory parts. Do NOT stop after saving.
Part A -- Save the plan:
.claude/plans/ if it does not exist..claude/plans/YYYY-MM-DD-<descriptive-name>-plan.md (use date '+%Y-%m-%d' for the date prefix).Part B -- Present follow-up options:
Immediately after saving, call AskUserQuestion with these exact parameters:
.claude/plans/{filename}. What would you like to do next?"You MUST call the AskUserQuestion tool -- do not skip it, do not present follow-up options as plain text.
Handle each response:
work skill with the saved plan path.Follow all rules in .claude/rules/skill-rules.md. Additionally:
Trigger: /plan <task description> (and /quiver:plan should also work)
Setup:
.claude/plans/ directory..claude/reports/review-*.md file exists and is passed as the argument.Expected behavior:
.claude/reports/review-*.md and adds review_source + review_iteration to the plan frontmatter.AskUserQuestion for the Step 7 review gate (Approve / Modify / Reject).Approve, skill saves the plan to .claude/plans/YYYY-MM-DD-<name>-plan.md, reads it back to verify, then invokes AskUserQuestion again for the Step 8 next-step gate.Verification checklist:
/plan..claude/plans/ with the date-prefixed filename.review_source and review_iteration.{placeholder} strings remain in the saved plan.AskUserQuestion calls, not plain-text prompts.codegraph_available flag detected and passed to agents when .codegraph/ exists.Known gotchas:
agents/research/code-navigator.md) owns the Code Navigation Strategy. When updating the strategy in skills/code-navigation/SKILL.md, update the agent file too.review_iteration is determined by counting prior plans with the same review_source field; if naming conventions drift, the iteration count can desync.Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub yagizdo/quiver --plugin quiver