Every execution produces a SUMMARY.md for quick human scanning. Each prompt gets its own folder in .prompts/ with output artifacts, enabling clear provenance and chain detection.
<folder_structure>
.prompts/
├── 001-auth-research/
│ ├── completed/001-auth-research.md # archived after run
│ ├── auth-research.md # full output (XML for Claude)
│ └── SUMMARY.md # executive summary (markdown for human)
├── 002-auth-plan/
│ ├── completed/002-auth-plan.md
│ ├── auth-plan.md
│ └── SUMMARY.md
└── 003-auth-implement/
├── completed/003-auth-implement.md
└── SUMMARY.md
</folder_structure>
If context provided, infer purpose from keywords:
implement,build,create,fix→ Doplan,roadmap,strategy,phases→ Planresearch,understand,analyze,explore→ Researchrefine,improve,iterate,update→ Refine
Extract topic identifier (kebab-case, e.g. auth, stripe-payments). Ask 2-4 clarifying questions based on purpose gaps. Confirm before generating.
<prompt_structure> All generated prompts include:
- Objective — what to accomplish and why
- Context — referenced files (@), dynamic context (!)
- Requirements — specific instructions
- Output specification — save location and structure
- Metadata (Research/Plan only) — XML tags required in output
- SUMMARY.md requirement — all prompts must produce one
- Success criteria — how to verify it worked
For Research and Plan outputs, require these XML tags:
<confidence>— confidence level in findings<dependencies>— what's needed to proceed<open_questions>— what remains uncertain<assumptions>— what was assumed
SUMMARY.md must contain: one-liner, Key Findings, Decisions Needed, Blockers, Next Step. </prompt_structure>
Sequential: chained prompts where each depends on previous output — execute in order, stop on failure.
Parallel: independent prompts with no dependencies — spawn all Task agents in a single message.
Mixed: build dependency layers, run parallel within each layer, sequential between layers.
After each completion: validate output exists, is non-empty, has required metadata tags and SUMMARY.md. Archive prompt to completed/ subfolder on success.
Show inline SUMMARY.md content in results so user sees findings without opening files.
<failure_handling> Sequential failure: stop chain, report completed/failed/not-started, offer retry or stop.
Parallel failure: continue others, collect all results, report failures with details, offer retry.
Missing dependencies: warn user, offer to create missing prompt first or continue anyway. </failure_handling>
<success_criteria>
- Purpose and topic identified during intake
- Chain detection performed, relevant files referenced
- Prompt generated with correct structure for purpose
- Folder created in
.prompts/with correct naming - SUMMARY.md requirement and metadata requirements included
- Prompts executed in correct dependency order
- Output validated after each completion
- Successful prompts archived to
completed/ - SUMMARY.md displayed inline in results </success_criteria>
