From awl-dev
Create detailed implementation plans through an interactive process
npx claudepluginhub threading-needles/awl --plugin awl-devinherit# Implementation Plan You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications. ## Prerequisites Before executing, verify Linear integration is available: ## Execution Mode Detection Detect whether running interactively or headless (e.g., `claude -p`): **Mode behavior:** - **Interactive**: Discuss options with user, ask clarifying questions using **AskUserQuestion** tool - **Headless**: Use research context to make ...
/create_planCreates technical implementation plan from PRD via codebase research, tracing paths, and pattern analysis; outputs plan.md with architecture, phases.
/create_planCreates detailed implementation plans interactively by analyzing tickets, reading codebase files fully, gathering historical context, and spawning research agents.
/create_planCreates detailed implementation plans interactively by researching tickets, task descriptions, and codebase using specialized analysis agents.
/create_planCreates detailed implementation plans interactively by researching tickets, codebase files, and context via specialized agents.
/create_planCreate detailed implementation plans through interactive research and iteration
/create_planCreates detailed implementation plan based on requirements and design specifications.
You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications.
Before executing, verify Linear integration is available:
# Validate plugin prerequisites (includes LINEAR_API_TOKEN check)
if [[ -f "${CLAUDE_PLUGIN_ROOT}/scripts/check-prerequisites.sh" ]]; then
"${CLAUDE_PLUGIN_ROOT}/scripts/check-prerequisites.sh" || exit 1
fi
Detect whether running interactively or headless (e.g., claude -p):
MODE=$("${CLAUDE_PLUGIN_ROOT}/scripts/workflow-context.sh" detect-mode)
# MODE will be "interactive" or "headless"
Mode behavior:
Check workflow context for current ticket:
CURRENT_TICKET=$("${CLAUDE_PLUGIN_ROOT}/scripts/workflow-context.sh" get-ticket)
If no current ticket:
I need a Linear ticket to attach this plan to.
Please either:
1. Run `/awl-dev:research-codebase PROJ-123` first (recommended - includes research phase)
2. Provide a ticket ID now: I'll set it and continue
Which would you prefer?
If user provides ticket, set it:
"${CLAUDE_PLUGIN_ROOT}/scripts/workflow-context.sh" set-ticket "$TICKET_ID"
If current ticket exists:
I'll create an implementation plan for ticket {CURRENT_TICKET}.
Let me check for existing research on this ticket...
This MUST be the first action after confirming ticket:
mcp__linear__save_issue to update the ticket state to "Plan in Progress" immediately - this is THE FIRST thing we do.mcp__linear__save_comment to add a comment "Starting implementation planning" to the ticket.Use mcp__linear__get_issue with the ticket ID to retrieve the issue and its attached documents. Look for documents with title starting with "Research:".
If research found:
I found existing research for {CURRENT_TICKET}:
- Research: {title}
I'll use this as context for the plan. Let me read it...
Read the research document content using linear-document-analyzer.
After reading the research document, check for unanswered blocking questions:
Look for questions marked (blocking) that still have the pattern: **Answer**: _[please fill in]_
Note: Non-blocking questions can remain unanswered - proceed with noted defaults if present.
If unanswered blocking questions found:
❌ Cannot proceed: Research document has unanswered questions
The following questions need answers before planning can begin:
**Q1 (blocking)**: {question text}
→ Location: Research document attached to {CURRENT_TICKET}
**Q2 (blocking)**: {question text}
→ Location: Research document attached to {CURRENT_TICKET}
Please answer these questions in the Linear document, then run:
/awl-dev:create-plan
Hard fail - do not proceed until all blocking questions have answers.
If all questions answered (or no questions section):
Continue to Step 3b.
If no research found:
No research document found for {CURRENT_TICKET}.
Would you like me to:
1. Create a plan without research (you'll provide context)
2. Run /awl-dev:research-codebase first (recommended)
After finding research (or deciding to proceed without it), check for existing plan documents. Use mcp__linear__get_issue with the ticket ID to retrieve the issue and its attached documents. Look for documents with title starting with "Plan:".
If existing plan found:
Store the document ID and title for later use:
EXISTING_PLAN_ID={document_id}
EXISTING_PLAN_TITLE={title}
Continue to Step 3c for iteration decision.
If multiple plans found:
Found multiple plans for {CURRENT_TICKET}:
1. Plan: {title1} (created {date1})
2. Plan: {title2} (created {date2})
Which plan should I iterate on? (enter number, or 'new' for fresh plan)
If no existing plan found:
Continue to Step 4 (create new plan flow).
If MODE is "interactive":
I found an existing plan for {CURRENT_TICKET}:
- {EXISTING_PLAN_TITLE}
Options:
1. **Iterate existing plan** - incorporate feedback and research updates
2. **Create new plan** - start fresh (existing plan preserved)
Which would you prefer? (1 or 2)
Wait for user response.
If MODE is "headless":
Automatically choose to iterate the existing plan:
Found existing plan: {EXISTING_PLAN_TITLE}
Proceeding with iteration (headless mode).
If user chooses "Create new plan" or no existing plan:
Continue to Step 4 (existing flow).
If iterating existing plan:
Continue to Step 4b (iteration flow).
Get assignee for headless mode (used for document mentions):
Use mcp__linear__get_issue with the ticket ID to retrieve the issue details, including the assignee name. Extract the assignee from the response for use in document mentions.
If MODE is "interactive":
I'll help you create a detailed implementation plan for {CURRENT_TICKET}.
Please provide:
1. What feature/change are we implementing?
2. Any specific requirements or constraints
3. Preferred approach (if you have one)
I'll analyze this along with the research and work with you to create a comprehensive plan.
Then wait for the user's input.
If MODE is "headless":
mcp__linear__get_issue with the ticket IDWhen iterating an existing plan (instead of creating new):
Use mcp__linear__get_document with the existing plan document ID to retrieve the full plan content.
Parse the existing plan to identify:
Compare existing plan against:
In headless mode, look for ticket comments containing feedback. Use mcp__linear__get_issue with the ticket ID to retrieve the issue details including comments.
Preserve these sections (do not regenerate):
Update these sections:
If MODE is "interactive":
Here are the proposed changes to the existing plan:
**Added:**
- Phase 4: New validation requirements
- Success criterion: API response time < 200ms
**Modified:**
- Phase 2: Updated approach based on research findings
- Overview: Clarified scope
**Preserved:**
- Phase 1 (already complete)
- Manual verification checklist
Does this look correct? (yes/no/edit)
If MODE is "headless":
Proceed directly to Step 5 with the updated plan content.
After Step 4b, continue to Step 5 (Save Plan to Linear) with the iteration path.
Read the ticket details from Linear using mcp__linear__get_issue with the ticket ID
Read any research documents using linear-document-analyzer
Spawn initial research tasks to gather codebase context:
Read all files identified by research tasks FULLY into main context
Present informed understanding and ask focused questions:
Present a brief summary of your understanding, then use the AskUserQuestion tool for any questions that your research couldn't answer. Examples:
In interactive mode: Always use AskUserQuestion — do NOT just print questions as text. Wait for answers before proceeding.
In headless mode: Note questions for embedding in the plan document later.
After getting initial clarifications:
Spawn parallel sub-tasks for comprehensive research:
For local codebase:
For historical context:
For external research:
For existing Linear documents:
For related tickets:
Wait for ALL sub-tasks to complete before proceeding
Present findings and ask design questions:
Present a brief summary of your findings and the design options you've identified.
In interactive mode: Use the AskUserQuestion tool to ask about design choices and open questions. Frame options clearly so the user can choose. Examples:
Wait for the user's answers before proceeding to plan structure.
In headless mode: Make reasonable decisions based on research findings and note any questions for the document.
Once aligned on approach:
Create initial plan outline:
Here's my proposed plan structure:
## Overview
[1-2 sentence summary]
## Implementation Phases:
1. [Phase name] - [what it accomplishes]
2. [Phase name] - [what it accomplishes]
3. [Phase name] - [what it accomplishes]
Does this phasing make sense? Should I adjust the order or granularity?
Get feedback on structure before writing details
After structure approval, create the plan document content:
# [Feature/Task Name] Implementation Plan
**Ticket**: {CURRENT_TICKET}
**Date**: {date}
**Branch**: {branch-name}
**Repository**: {repo-name}
## Overview
[Brief description of what we're implementing and why]
## Current State Analysis
[What exists now, what's missing, key constraints discovered]
## Desired End State
[A Specification of the desired end state after this plan is complete, and how to verify it]
### Key Discoveries:
- [Important finding with file:line reference]
- [Pattern to follow]
- [Constraint to work within]
## What We're NOT Doing
[Explicitly list out-of-scope items to prevent scope creep]
## Implementation Approach
[High-level strategy and reasoning]
## Phase 1: [Descriptive Name]
### Overview
[What this phase accomplishes]
### Changes Required:
#### 1. [Component/File Group]
**File**: `path/to/file.ext`
**Changes**: [Summary of changes]
```[language]
// Specific code to add/modify
```
### Success Criteria:
#### Automated Verification:
- [ ] Migration applies cleanly: `make migrate`
- [ ] Unit tests pass: `make test-component`
- [ ] Type checking passes: `npm run typecheck`
- [ ] Linting passes: `make lint`
#### Manual Verification:
- [ ] Feature works as expected when tested via UI
- [ ] Performance is acceptable under load
- [ ] No regressions in related features
---
## Phase 2: [Descriptive Name]
[Similar structure...]
---
## Questions for User
{HEADLESS MODE ONLY — In interactive mode, all questions were already asked and answered via
AskUserQuestion during the planning process. Do NOT include this section in interactive mode.}
{If ASSIGNEE is set:}
@{ASSIGNEE} - Please answer before proceeding to /awl-dev:implement-plan:
{If no ASSIGNEE:}
Please answer before proceeding to /awl-dev:implement-plan:
> **Q1 (blocking)**: {Question that must be answered before implementation}
> **Context**: {Why this matters for implementation}
> **Options**: A) {option} B) {option} C) {option}
> **Answer**: _[please fill in]_
> **Q2 (non-blocking)**: {Question that helps but has a reasonable default}
> **Context**: {Background information}
> **Answer**: _[please fill in]_
{Note: Only include questions that genuinely arose during planning and affect implementation}
---
## Testing Strategy
### Unit Tests:
- [What to test]
- [Key edge cases]
### Integration Tests:
- [End-to-end scenarios]
### Manual Testing Steps:
1. [Specific step to verify feature]
2. [Another verification step]
## References
- Ticket: {CURRENT_TICKET}
- Research: (attached to ticket in Linear)
If creating new plan (no existing plan or user chose "new"):
mcp__linear__create_document to create a new Linear document with the plan content. Set the title to "Plan: {DESCRIPTION}" and include the full plan markdown as the content. Attach it to the current ticket.mcp__linear__save_comment to add a completion comment to the ticket: "Implementation plan created and attached to this ticket."If updating existing plan (iteration):
mcp__linear__update_document with the existing plan document ID to update its content with the revised plan.mcp__linear__save_comment to add an iteration comment to the ticket: "Implementation plan updated with latest feedback and research."Add metadata comment at top of plan to track iterations:
<!-- Plan iteration: {N} -->
<!-- Last updated: {timestamp} -->
<!-- Previous update: {previous_timestamp} -->
In headless mode with embedded questions:
If the document contains a "Questions for User" section with unanswered questions:
Use mcp__linear__save_issue to set the ticket status to "Spec Needed" to signal human input is required.
Then output a clear message:
✅ Implementation plan created with questions pending.
**Ticket**: {CURRENT_TICKET}
**Status**: Spec Needed
The plan document has been attached to the ticket with {N} questions
that need answers before proceeding to /awl-dev:implement-plan.
Please answer the questions in the Linear document, then run:
claude -p "/awl-dev:implement-plan"
If new plan created:
✅ Implementation plan created!
**Ticket**: {CURRENT_TICKET}
**Linear Document**: Plan: {description}
## 📊 Context Status
Current usage: {X}% ({Y}K/{Z}K tokens)
{If >60%}:
⚠️ **Context Alert**: We're at {X}% context usage.
**Recommendation**: Clear context before implementation phase.
**What to do**:
1. ✅ Review the plan in Linear
2. ✅ Close this session (clear context)
3. ✅ Start fresh session
4. ✅ Run `/awl-dev:implement-plan`
{If <60%}:
✅ Context healthy ({X}%).
---
Please review the plan and let me know:
- Are the phases properly scoped?
- Are the success criteria specific enough?
- Any technical details that need adjustment?
If existing plan updated (iteration):
✅ Implementation plan updated!
**Ticket**: {CURRENT_TICKET}
**Linear Document**: {EXISTING_PLAN_TITLE} (iteration #{N})
**Changes made:**
- {summary of what was updated}
- {sections preserved}
## 📊 Context Status
Current usage: {X}% ({Y}K/{Z}K tokens)
{If >60%}:
⚠️ **Context Alert**: We're at {X}% context usage.
**Recommendation**: Clear context before implementation phase.
**What to do**:
1. ✅ Review the updated plan in Linear
2. ✅ Close this session (clear context)
3. ✅ Start fresh session
4. ✅ Run `/awl-dev:implement-plan`
{If <60%}:
✅ Context healthy ({X}%).
---
Please review the updated plan and let me know:
- Do the changes address the feedback?
- Are the preserved sections still accurate?
- Any additional modifications needed?
mcp__linear__update_document with the document ID and revised contentBe Skeptical:
Be Interactive:
Be Thorough:
Be Practical:
Track Progress:
No Open Questions in Final Plan:
Always separate success criteria into two categories:
Automated Verification (can be run by execution agents):
make test, npm run lint, etc.Manual Verification (requires human testing):
Format example:
### Success Criteria:
#### Automated Verification:
- [ ] Database migration runs successfully: `make migrate`
- [ ] All unit tests pass: `go test ./...`
- [ ] No linting errors: `golangci-lint run`
- [ ] API endpoint returns 200: `curl localhost:8080/api/new-endpoint`
#### Manual Verification:
- [ ] New feature appears correctly in the UI
- [ ] Performance is acceptable with 1000+ items
- [ ] Error messages are user-friendly
- [ ] Feature works correctly on mobile devices
/awl-dev:research-codebase PROJ-123 → research document
↓
/awl-dev:create-plan → implementation plan (this command)
↓
/awl-dev:implement-plan → code changes
↓
/awl-dev:describe-pr → PR created
How it connects:
/awl-dev:implement-plan finds plan via linear-document-locator# After running /awl-dev:research-codebase PROJ-123...
/awl-dev:create-plan
# You:
# 1. Get current ticket from workflow context (PROJ-123)
# 2. Update ticket status to "Plan in Progress" (THE FIRST thing)
# 3. Find research document in Linear
# 4. Read research content
# 5. Ask for planning input
# 6. Research codebase further
# 7. Create plan outline
# 8. Get user approval
# 9. Write detailed plan
# 10. Save to Linear as "Plan: {description}"
# 11. Present summary
EVERY workflow step MUST update status as the FIRST action:
mcp__linear__save_issue to set the ticket state back to "Research in Progress"mcp__linear__save_comment to add a comment: "Planning failed: {ERROR_REASON}"