From quiver
Create a structured implementation plan with parallel agent research before coding.
npx claudepluginhub yagizdo/quiver --plugin quiverThis skill uses the workspace's default tool permissions.
```
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.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
!`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 for clarifying questions:
AskUserQuestion with action buttons -- never ask clarifying questions as plain text.Assess complexity:
| Complexity | Signals | Agents to Dispatch |
|---|---|---|
| Light | 1-3 files, single layer, well-understood | Explore |
| Standard | 3-10 files, 2+ layers, moderate unknowns | Explore + best-practices-researcher |
| Deep | 10+ files, architectural impact, security/auth/payments, unfamiliar domain | Explore + 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 LSP availability once. 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 this flag 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 Explore agent to verify file paths and current patterns are still accurate.
Agent(
subagent_type="Explore",
description="Map codebase for planning: {short task summary}",
prompt="Task: {full task description from Step 1}
lsp_available: {true|false from Step 2.5}
## Code Navigation Strategy
You have been provided an `lsp_available` flag above.
**When `lsp_available: true`:**
- For finding where a function/class/type is defined: use LSP goToDefinition first.
- For finding all callers or consumers of a symbol: use LSP findReferences first.
- For getting a structural overview of a file: use LSP documentSymbol first.
- If LSP returns empty or unhelpful results for any operation, inform the user:
'LSP returned no results for {operation} on `{symbol}` -- falling back to grep-based search.'
Then use Grep as fallback.
- For file discovery and pattern matching: always use Grep/Glob regardless of LSP availability.
**When `lsp_available: false`:**
- Use Grep, Glob, and Read for all code navigation.
---
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 Explore 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 contain actionable content. These are plan failures -- never write them:
processItems(), some task must define it)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, review it before presenting to the user. This is an internal check -- do not show it as a separate section to the user.
clearLayers() in Task 3 but clearFullLayers() in Task 7 is a bug in the plan.Fix issues inline. No need to re-review after fixes -- just fix and move on.
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.After saving the plan file:
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.Known gotchas:
skills/code-navigation/SKILL.md.review_iteration is determined by counting prior plans with the same review_source field; if naming conventions drift, the iteration count can desync.