This snippet should be used when creating technical execution plans in HTML format with mandatory quality review before display.
Create clear, actionable technical execution plans with mandatory quality review before display.
ALWAYS create a comprehensive plan BEFORE taking any action.
Best Practices:
Must include:
Example:
🏗️ System Architecture Overview
[Mermaid Flowchart Here]
**System Summary**: Chrome extension that captures webpage elements and saves them to a persistent canvas using Shadow DOM isolation and chrome.storage for cross-context state management.
**Key Components**:
- Background Worker (service worker, manages storage)
- Content Script (injected into pages, captures elements)
- Canvas UI (React app, displays saved elements)
- Storage Layer (chrome.storage.local, source of truth)
**Data Flow**: User triggers capture → Content script extracts element → Background worker persists to storage → Canvas UI reacts to storage change → UI updates
Must include:
Example Step Format:
<li>
<strong>Step 3:</strong> Create <code>src/content/ElementSelector.tsx</code> - React component for hover overlay
<div class="indent-1">
<strong>Key functions</strong>:
- <code>handleMouseMove(e)</code>: Update overlay position based on cursor
- <code>handleClick(e)</code>: Capture element HTML and metadata
- <code>injectStyles()</code>: Add styles to Shadow DOM
</div>
<div class="indent-1 muted">
File: src/content/ElementSelector.tsx
</div>
<div class="tech-note">
<strong>Technical Note:</strong> Use absolute positioning with z-index: 2147483647 to ensure overlay appears above all page content. Inject styles into Shadow DOM to prevent page CSS conflicts.
</div>
</li>
CRITICAL: Do NOT write HTML until AFTER review.
mcp__codex__codex({
prompt: `Review the following technical implementation plan and provide critical analysis:
[PLAN SUMMARY - Include key sections: Overview, Executive Summary, Implementation Steps]
Analyze:
1. **Technical Accuracy**: Are the proposed solutions technically sound?
- Check for API misuse, incorrect algorithms, architecture anti-patterns
2. **Implementation Completeness**: Are there missing steps or edge cases?
- Look for unstated assumptions, missing error handling, incomplete workflows
3. **Architecture**: Is this the best architectural choice?
- Consider scalability, maintainability, testability tradeoffs
4. **Security Considerations**: Any security issues with the approach?
- Check for injection vulnerabilities, authentication gaps, data exposure
5. **Code Quality**: Review code snippets for correctness and best practices
- Check syntax, idioms, performance implications
6. **Testing Strategy**: Is the testing approach comprehensive enough?
- Verify test coverage of happy path, edge cases, error conditions
7. **Risk Assessment**: What are the biggest risks?
- Identify show-stoppers, performance bottlenecks, user impact
Provide specific, actionable recommendations for improvement.`,
cwd: "[current working directory]",
});
Task({
subagent_type: "general-purpose",
description: "Review and critique plan",
prompt: `Review the following technical implementation plan:
[PLAN SUMMARY]
Provide:
1. **Strengths**: Well-thought-out aspects
2. **Potential Issues**: Problems or edge cases missed
3. **Suggestions**: How to improve the plan
4. **Risk Assessment**: Biggest technical risks
5. **Alternative Approaches**: Better ways to accomplish this
Be critical. Look for:
- Missing error handling
- Overlooked dependencies
- Performance/scalability concerns
- Security vulnerabilities
- Testing gaps
- Unclear technical specifications`,
});
// Check if Codex MCP is available
if (typeof mcp__codex__codex === 'function') {
// Use Codex MCP review (preferred for technical accuracy)
await mcp__codex__codex({...});
} else {
// Fallback to Task agent
await Task({subagent_type: "general-purpose", ...});
}
CRITICAL: Use plan template at ${CLAUDE_PLUGIN_ROOT}/templates/html/plan-template.html
{{TITLE}}<!-- ===== CONTENT GOES HERE ===== -->claude_html/ and openmkdir -p claude_htmlclaude_html/plan_[task_description].htmlopen claude_html/plan_[task_description].htmlUser Request
→ Draft Plan (memory, with diagram)
→ Review (Codex MCP or Task agent)
→ Incorporate Feedback
→ Read Plan Template
→ Write HTML
→ Open File
→ User Reviews
→ User Approves
→ Execute