From flowstate
Enhance an existing plan with parallel research agents per section. Adds best practices, edge cases, code examples, and learnings references. Does not rewrite -- only enriches. Triggers: "deepen", "enhance plan", "add research to plan", or after initial planning when more depth is needed.
npx claudepluginhub c-reichert/flowstate --plugin flowstateThis skill uses the workspace's default tool permissions.
Enhance an existing plan by running parallel research agents per section. This adds depth -- best practices, performance considerations, edge cases, concrete code examples, and references to past learnings. The original plan structure is preserved; content is only added, never removed.
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.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Enhance an existing plan by running parallel research agents per section. This adds depth -- best practices, performance considerations, edge cases, concrete code examples, and references to past learnings. The original plan structure is preserved; content is only added, never removed.
Requires a path to an existing plan file in docs/plans/.
If the plan path is not provided:
docs/plans/ for the most recently modified plan:
ls -lt docs/plans/*.md 2>/dev/null | head -5
[path]. Should I deepen this one?"Do not proceed until you have a valid plan file.
Read the plan file completely. Extract a section manifest:
Create a structured list of sections to enhance. Each section gets its own research focus.
For each section in the manifest, spawn a research agent (Sonnet) in parallel:
For each section:
Task section-researcher(section_content, technologies_mentioned)
Model: Sonnet
Focus areas:
- Industry standards and conventions for this area
- Performance considerations specific to this section
- Common pitfalls and how to avoid them
- Concrete code examples from real-world usage
- Security implications (if applicable)
Also query in parallel:
Context7 MCP for framework documentation:
WebSearch for current best practices:
Search docs/solutions/ for relevant documented learnings that apply to this plan:
Task learnings-discovery(plan_summary, technologies, components)
Model: Haiku
Strategy (grep-first filtering):
1. Extract keywords from plan: technology names, component names, error types, patterns
2. Run parallel grep calls on docs/solutions/:
- grep by title/filename
- grep by tags in YAML frontmatter
- grep by module/component name
- grep by symptoms
3. Always check docs/solutions/patterns/critical-patterns.md
4. Read frontmatter of matched files
5. Score relevance: strong / moderate / weak
6. Full read of strong and moderate matches only
7. Return: file path, relevance score, key insight, applicable section
For each relevant learning found, note which plan section it should enhance.
For each section, integrate research findings. Add a Research Insights subsection:
#### Research Insights
**Best Practices:**
- [Concrete recommendation with source]
- [Convention to follow]
**Performance Considerations:**
- [Optimization opportunity with expected impact]
- [Benchmark or measurement guidance]
**Edge Cases:**
- [Edge case scenario] -- [handling strategy]
- [Boundary condition] -- [validation approach]
**Code Examples:**
```[language]
// Example from [source/pattern]
[concrete code example relevant to this section]
Learnings from Past Work:
References:
**Rules for enhancement:**
- Do NOT remove or rewrite existing content -- only add
- Do NOT replace the original implementation plan -- augment it
- Place Research Insights as a subsection under each enhanced section
- If a section already has research context, merge new findings (no duplicates)
- Keep enhancements concise -- each insight should earn its place
- Code examples should be directly applicable, not generic
---
## Phase 5: Add Enhancement Summary
At the **top of the plan** (after YAML frontmatter, before the first section), add:
```markdown
## Enhancement Summary
**Deepened on:** YYYY-MM-DD
**Sections enhanced:** [count] of [total]
**Research sources:** [count] external, [count] learnings, [count] framework docs
**Key Improvements:**
1. [Most impactful improvement -- e.g., "Added retry strategy for API calls based on past outage resolution"]
2. [Second improvement -- e.g., "Identified race condition edge case in concurrent user scenario"]
3. [Third improvement -- e.g., "Added performance benchmarks from framework documentation"]
**Learnings Applied:**
- [docs/solutions/path/file.md] -- [one-line insight]
- [docs/solutions/path/file.md] -- [one-line insight]
Before saving, invoke the flowstate:document-review skill to verify the enhanced plan remains coherent. Confirm that new research insights do not contradict existing content, that no sections were accidentally removed, and that the enhancements add genuine value.
Address any critical or important issues found by the review before proceeding.
Write the enhanced plan back to the same file path -- preserve the original filename.
# Verify the file was updated
wc -l docs/plans/[filename]
Then commit:
git add docs/plans/[filename]
git commit -m "docs: deepen plan for [brief description]"
Confirm: "Plan deepened and updated at docs/plans/[filename]"
/workflow:reviewUse the AskUserQuestion tool to present:
Question: "Plan deepened with [X] sections enhanced and [Y] learnings applied. What next?"
Options:
/workflow:work -- Begin TDD implementation of this planplanning skill.