Create validated implementation plans with research
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemint[feature description, bug report, or improvement idea]<worktree_status>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/worktree-context.sh
</worktree_status>
<stack_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/machete-context.sh
</stack_context>
Load patterns skill first:
Skill({ skill: "crew:crew-patterns" });
This provides: <pattern name="research-agents"/>, <pattern name="task-file"/>.
<output_files>
.claude/plans/<feature-slug>.md.claude/branches/<slugified-branch>/tasks/*.md</output_files>
<notes> - **NEVER CODE** - This command researches and writes plans only - Branch early for state directory, agents per @rules/agent-limits.md - spec-flow-analyzer runs after all research collected </notes> <process> <phase name="memory-recall"> **Query claude-mem for past learnings before expensive research:**// Search for relevant past decisions, discoveries, gotchas
mcp__claude_mem__search({
query: "<feature keywords>",
type: "decision,discovery,bugfix",
limit: 10
});
// If relevant results found (~50 tokens per result), evaluate ROI
// Fetch full details only for high-relevance matches
mcp__claude_mem__get_observations({
ids: [relevant_ids] // ~500 tokens per observation
});
Why: Prevents re-discovering known gotchas and respects past architectural decisions. Costs ~1000 tokens vs re-researching from scratch.
CRITICAL - Memory vs Current Request:
AskUserQuestion({
questions: [{
question: "I found a past observation that suggests [X], but your current request implies [Y]. Which approach should I follow?",
options: [
"Follow my current request (Y)",
"Use the past approach (X)",
"Explain both so I can decide"
]
}]
});
Skip if: No claude-mem MCP available or empty results. </phase>
<phase name="validate-input"> If empty or unclear: ```javascript AskUserQuestion({ questions: [{ question: "What would you like to design?", header: "Type", options: [ { label: "New feature", description: "Add new functionality" }, { label: "Bug fix", description: "Fix an existing issue" }, { label: "Refactoring", description: "Improve code structure" }, { label: "Infrastructure", description: "DevOps or tooling" } ], multiSelect: false }] }); ``` </phase> <phase name="branch-setup"> ```javascript const branch = Bash({ command: "git branch --show-current" }).trim(); if (branch === "main" || branch === "master") { // AskUserQuestion: feature branch or stacked branch Bash({ command: `git checkout -b feat/${slug}` }); } // If stacked: git machete add --onto <parent> ``` </phase> <phase name="parallel-research"> Launch ALL 4 agents in SINGLE message using `<pattern name="research-agents"/>`:codebase-analyst - Repository structure, patterns, conventions, git historydocs-researcher - External best practices via Context7/OctoCode MCParchitecture-analyst - API design, data models, external integrationsquality-analyst - Performance, security (STRIDE), UX, accessibilityPlus Codex MCP (direct call, not Task):
MCPSearch({ query: "select:mcp__plugin_crew_codex__codex" });
mcp__plugin_crew_codex__codex({
question: `Architecture design for: ${feature}. Key decisions, trade-offs, risks?`,
});
</phase>
<phase name="collect-research">
```javascript
// Collect ALL 4 agent results
const results = {};
for (const agent of agents) {
results[agent.type] = TaskOutput({ task_id: agent.id, block: true });
}
```
</phase>
<phase name="spec-analysis">
Launch spec-flow-analyzer with ALL research context:
```javascript
Task({
subagent_type: "spec-flow-analyzer",
prompt: `CONTEXT: ${feature}\nRESEARCH: ${JSON.stringify(results)}\nOUTPUT: User stories (P1/P2/P3), FR-XXX requirements, SC-XXX success criteria, gaps`,
run_in_background: false
});
```
</phase>
<phase name="write-plan">
Write to `.claude/plans/<feature-slug>.md` using the plan template:
// Read template and populate with research findings
Read({
file_path: `${CLAUDE_PLUGIN_ROOT}/skills/todo-tracking/templates/plan-template.md`,
});
// Fill in template with:
// - Problem Statement: From spec analysis
// - User Stories: From spec-flow-analyzer (P1/P2/P3 priorities)
// - Functional Requirements: FR-XXX requirements
// - Technical Approach: From Codex synthesis
// - Codebase Context: From codebase-analyst
// - External Research: From docs-researcher
// - Architecture: From architecture-analyst (API, Data, Integrations)
// - Quality: From quality-analyst (Performance, Security, UX)
// - Success Criteria: SC-XXX criteria
// - Open Questions: Max 3 NEEDS CLARIFICATION items
</phase>
<phase name="generate-tasks">
Create task files using `<pattern name="task-file"/>`:
const slugBranch = branch.replace(/\//g, "-");
Bash({ command: `mkdir -p .claude/branches/${slugBranch}/tasks` });
// Naming: {order}-{status}-{priority}-{story}-{slug}.md
// 001-009: setup tasks
// 010-019: us1 tasks
// 020-029: us2 tasks
// 090-099: polish tasks
Story labels: setup, found, us1, us2, us3, polish
</phase>
// Read and output the entire plan file
const planContent = Read({ file_path: `.claude/plans/${slug}.md` });
// Output the plan content directly to the user (not a summary)
Output the complete plan content followed by:
Files created:
- Plan: .claude/plans/<slug>.md
- Tasks: .claude/branches/<branch>/tasks/*.md (X tasks)
Then ask user to continue:
AskUserQuestion({
questions: [
{
question: "Ready to start building this plan?",
header: "Next step",
options: [
{
label: "Start building",
description: "Run /crew:build to implement the plan",
},
{
label: "Interview first",
description: "Flesh out details with /crew:interview before building",
},
{
label: "Edit plan first",
description: "Make manual changes before building",
},
{ label: "Just save", description: "Save the plan for later" },
],
multiSelect: false,
},
{
question: "Add this branch to the machete stack?",
header: "Stacking",
options: [
{
label: "Stack on main",
description: "Add branch to stack with main as parent (Recommended)",
},
{
label: "Stack on current",
description: "Add branch stacked on the current parent branch",
},
{
label: "No stacking",
description: "Keep branch independent, not in machete stack",
},
],
multiSelect: false,
},
{
question: "Enable iteration loop during build?",
header: "Loop mode",
options: [
{
label: "With loop",
description: "Iterate until all tasks pass CI checks (Recommended)",
},
{
label: "Single pass",
description: "Run build once without automatic iteration",
},
],
multiSelect: false,
},
],
});
Based on responses:
Stacking (execute first if building):
Bash({ command: "git machete add --onto main" });Bash({ command: "git machete add" }); (uses current parent)Next step:
Skill({ skill: "crew:build", args: "<slug> --loop" });Skill({ skill: "crew:build", args: "<slug>" });SlashCommand({ command: "/crew:interview .claude/plans/<slug>.md" });.claude/plans/<slug>.md and run /crew:build when ready<success_criteria>
</success_criteria>