Create Meta-Prompt
Create prompts for complex tasks that benefit from research before implementation.
Task: $ARGUMENTS
If $ARGUMENTS is empty or vague, ask the user: "What task needs exploration? Describe what you want to accomplish." Do not proceed until you have a clear task description.
Use this when:
- •Task needs exploration to understand scope
- •Multiple approaches are possible
- •You need to understand existing code patterns first
If a dedicated slash command exists for the task type (e.g., /ddd-analysis, /extract-requirements), use that instead of creating a meta-prompt. See /pipeline for the complete list of pipeline commands.
Workflow: Research → Plan → Implement (using plan directly)
Steps
- •
Read project context
- •
CLAUDE.md(required if exists) - •
README.md
- •
- •
Check for existing workflows
bashls -d .prompts/*-research .prompts/*-plan 2>/dev/null
If any exist, list them and ask: "Continue one of these, or start new?" When checking, also consider whether the user's current task description might match an existing workflow under a different slug name.
- •If continuing: use that slug and proceed to step 4 — the decision table will determine which phase to generate next based on the existing artifacts (research.md, plan.md) in that workflow
- •If new: derive slug from task. If the derived slug matches an existing workflow directory, append a numeric suffix (e.g.,
refactor-payment-system-2) or ask the user for a different name.
- •
Determine slug (if starting new)
- •Lowercase, hyphenate, drop stopwords (a, an, the, of, for, to)
- •Example: "Refactor the payment system" →
refactor-payment-system
- •
Determine which phase to generate
Condition Action No research.mdGenerate research prompt research.mdexists, Status ispartialorfailedAsk user: re-run research or proceed with partial findings? If research.md contains a metadata block but no substantive findings (all questions unanswered or answered with "Could not determine"), recommend re-running with refined questions. research.mdexists but is empty or has no substantive contentTreat as if research.mddoes not exist — re-generate research promptresearch.mdexists, Status issuccess(or no metadata) AND has substantive content, noplan.mdGenerate plan prompt plan.mdexists, Status ispartialorfailedAsk user: re-generate plan or implement with current plan? plan.mdexists, Status issuccess(or no metadata)No prompt needed — tell user to implement with /run-prompt {slug}-plan - •
Generate the prompt — create the output directory (and
.prompts/parent if needed) usingmkdir -p.
Research Prompt
.prompts/{slug}-research/prompt.md:
# Research: [task]
## Objective
Understand [what needs to be understood] before implementation.
## Context
- Guidelines: `CLAUDE.md`
- Key files: [relevant paths]
- Stack: [if relevant]
## Questions to Answer
1. [Specific question about the codebase]
2. [Specific question about approach]
3. [Specific question about existing patterns]
4. [Specific question about constraints or risks]
## Explore
- [Key files/directories to examine]
- [What to search for]
## Output
Write findings to `.prompts/{slug}-research/research.md`:
- Answers to the questions above
- Existing patterns to follow
- Risks or concerns
- Recommended approach
- Metadata block (append at end):
## Metadata
### Status
[success | partial | failed]
### Dependencies
- [files or decisions this relies on, or "None"]
### Open Questions
- [unresolved issues, or "None"]
### Assumptions
- [what was assumed, or "None"]
Plan Prompt
.prompts/{slug}-plan/prompt.md:
# Plan: [task]
## Context
- Research: `.prompts/{slug}-research/research.md`
- Guidelines: `CLAUDE.md`
## Instructions
1. Read research.md
2. Design implementation as checkpoints
3. Each checkpoint must include:
- Build: what to implement
- Test: what unit tests to write for THIS checkpoint's code
- Verify: how to confirm all existing + new tests pass before moving on
4. NEVER design a dedicated "testing" checkpoint at the end. Tests are written alongside the code they verify, within the same checkpoint. Each checkpoint must leave the test suite green.
## Output
Write plan to `.prompts/{slug}-plan/plan.md`:
- Ordered checkpoints (implementation + tests each — no checkpoint without tests unless it is purely non-code work like documentation or configuration)
- Files to create/modify
- Metadata block (Status, Dependencies, Open Questions, Assumptions)
After Plan is Complete
No separate "do" prompt is needed. The plan.md contains the checkpoints. User implements by:
- •Running
/run-prompt {slug}-plan(executes the plan) - •Or asking directly: "Implement the plan in
.prompts/{slug}-plan/plan.md"
Progress will be tracked in .prompts/{slug}-plan/progress.md during execution. If interrupted, running the same command again will resume from the last incomplete checkpoint.
After Saving
Report what was created and what's next:
- •After research prompt: "Created research prompt. Run with
/run-prompt {slug}-research, then run/create-meta-prompt [same task]again to generate the plan phase." - •After plan prompt: "Created plan prompt. Run
/run-prompt {slug}-planto generate the plan. Once the plan is generated, run the same command again to implement it checkpoint by checkpoint."