Frontend Development (Verified Stages)
Orchestrates frontend epic development with MidsReborn UI analysis and visual verification gates.
Invocation: /frontend-development epic-X.Y
Example: /frontend-development epic-1.1
Scope
This skill orchestrates frontend development by integrating with the superpowers plugin:
- ✅ Context Collection (previous epics, architecture docs, screenshots)
- ✅ MidsReborn UI Analysis Hook (Task tool with Explore agent)
- ✅ Planning Integration (invokes
/superpowers:write-plan via SlashCommand)
- ✅ Two-Gate Approval Flow (human reviews before execution)
- ✅ Execution Integration (invokes
/superpowers:execute-plan via SlashCommand)
- ✅ Visual Verification Workflow (compare with MidsReborn screenshots)
- ✅ Checkpoint Generation (documents progress and artifacts)
- ✅ Epic Progress Tracking (updates progress.json)
Key Integration: This skill does NOT directly create files. Instead, it:
- Analyzes MidsReborn UI (via Task tool)
- Invokes
/superpowers:write-plan to create plans
- Gets human approval at Gate 1
- Invokes
/superpowers:execute-plan to create components
- Facilitates visual verification at Gate 2
Parameters
epic-number (required): Epic identifier (e.g., epic-1.1, epic-2.2)
Process
Phase 1: Context Collection
Purpose: Load all relevant documents with deterministic file list.
Steps:
Parse epic number from invocation
- Extract from command:
/frontend-development epic-1.2 → 1.2
- Validate format:
epic-X.Y where X.Y is digit pattern
Read context map
- File:
docs/frontend/context-map.json (if exists, else use defaults)
- Look up key:
epic-X.Y
- Extract:
required_inputs, midsreborn_references
Check prerequisites
If not first epic (X.Y > 1.1):
Check: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md exists
Calculate previous epic number (e.g., 2.2 → 2.1)
If missing: ERROR and stop
ERROR: Previous epic not complete.
Cannot find: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
Complete Epic [X.Y-1] first before running Epic X.Y.
Check MidsReborn codebase:
Verify: /Users/w/code/mids-hero-web/external/dev/MidsReborn exists
If missing: ERROR
ERROR: MidsReborn codebase not found.
Expected: /Users/w/code/mids-hero-web/external/dev/MidsReborn
This is required for UI analysis and reference implementation.
Check MidsReborn screenshots:
- Location:
/Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots
- Screenshots are optional but highly recommended for visual verification
- If directory exists, load screenshot list for reference in analysis
Build explicit file list
Load common files (always required):
- docs/frontend/architecture.md
- docs/frontend/epic-breakdown.md
- docs/frontend/tech-stack.md (if exists)
- docs/midsreborn/00-navigation-map.md
- docs/midsreborn/01-architecture-overview.md
Load MidsReborn screenshots (if available):
- Check: /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots
- List available screenshots for visual reference
- Include screenshot paths in context for sub-agents
Load epic-specific inputs:
- Previous epic plan summary (if not Epic 1.1)
- Epic-specific requirements from epic-breakdown.md
- Relevant MidsReborn calculation specs (from
docs/midsreborn/calculations/)
Load all files
- Use Read tool for each file in the explicit list
- Store in context for next phases
- If any REQUIRED file missing → ERROR with specific filename
- Track which files were loaded for verification
Display context loaded summary
Phase 1: Context Collection
✅ Read: docs/frontend/architecture.md
✅ Read: docs/frontend/epic-breakdown.md
✅ Read: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
✅ Read: [N] MidsReborn reference docs
✅ Verified: MidsReborn codebase exists
✅ Found: [N] MidsReborn screenshots in shared/user/midsreborn-screenshots
Total files loaded: [N]
Context loaded. Proceeding to Phase 2...
Phase 2: MidsReborn UI Analysis Hook
Purpose: Analyze MidsReborn UI code to understand feature implementation.
Implementation: Dispatch sub-agent via Task tool.
Steps:
Build sub-agent prompt
You are a MidsReborn UI analysis agent for Epic X.Y of the Mids Hero Web frontend.
## CONTEXT
[Include all files loaded in Phase 1]
Epic to implement: Epic X.Y - [Feature Name]
MidsReborn codebase: /Users/w/code/mids-hero-web/external/dev/MidsReborn
MidsReborn screenshots: /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots (if available)
Frontend architecture: docs/frontend/architecture.md
Epic breakdown: docs/frontend/epic-breakdown.md
## YOUR TASK
### 1. Locate MidsReborn UI Components
Find the C# Windows Forms UI code for this feature:
- Use Glob to find relevant Form files: `external/dev/MidsReborn/**/*.cs`
- Search for UI components related to: [Feature Name from Epic X.Y]
- Example patterns to search:
- "ArchetypeSelector" for character creation
- "PowerPicker" for power selection
- "EnhancementSlotEditor" for slotting
- "BuildTotalsPanel" for stats display
### 2. Extract UI Component Structure
For each relevant Form/UserControl:
- **Layout**: How are controls arranged? (panels, grids, lists)
- **Data Displayed**: What information is shown to the user?
- **User Interactions**: What can users click/select/edit?
- **Data Flow**: How does UI get data? (direct DB calls, services, etc.)
- **Validation**: What validation rules exist?
- **Events**: What triggers recalculation/updates?
### 3. Extract Feature Requirements
From the UI code, determine:
- **MUST-HAVE features**: Core functionality that must be replicated
- **SHOULD-HAVE features**: Important but could be deferred
- **COULD-SKIP features**: Nice-to-have, not in v1 scope
Cross-reference with user's skip list:
- Skip: alternate IO slotting, enhancement boosters, attuned IOs, level scaling, incarnate powers, rotation recommendations
### 4. Identify State Management Needs
Determine what state this feature manages:
- **Server State**: What data comes from backend API?
- **Client State**: What is managed locally in the UI?
- **Shared State**: What state is shared across components?
- **Derived State**: What is computed from other state?
### 5. Map to Web Equivalent
For each MidsReborn UI pattern, propose web equivalent:
- **DataGridView** → TanStack Table or custom table
- **ListBox/ComboBox** → Select component or listbox
- **TabControl** → Tabs component
- **TreeView** → Tree component or nested lists
- **ToolTip** → Tooltip component (shadcn/ui)
- **Modal Dialogs** → Dialog/Modal component
### 6. Identify Available Screenshots
Check for existing screenshots in: `/Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots`
For each relevant screenshot found:
- Note filename and what it shows
- Reference in analysis report
- Use as visual reference for component design
If screenshots for this epic's features are missing:
- List specific screenshots that would be helpful
- Request user to capture them from MidsReborn
## OUTPUT FORMAT
Create: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
## Structure:
# MidsReborn UI Analysis: Epic X.Y - [Feature Name]
**Created**: [date]
**Epic**: [epic number and name]
**MidsReborn Forms Analyzed**: [list]
## Executive Summary
[2-3 sentences: what feature does, how MidsReborn implements it, key findings]
## MidsReborn UI Components
### Component 1: [Form/UserControl Name]
- **File**: `external/dev/MidsReborn/[path]`
- **Purpose**: [What this component does]
- **Layout**: [How controls are arranged]
- **Data Displayed**: [What information is shown]
- **User Interactions**: [What users can do]
### Component 2: [Name]
...
## Feature Requirements
### MUST-HAVE Features
1. **[Feature Name]**
- **Description**: [What it does]
- **MidsReborn Implementation**: [How MidsReborn does it]
- **Web Equivalent**: [How we'll implement it]
2. **[Feature Name]**
...
### SHOULD-HAVE Features
[Features to include if time permits]
### COULD-SKIP Features
[Features that can be deferred to v2]
## State Management Analysis
### Server State (TanStack Query)
- **Endpoint**: `GET /api/[resource]`
- **Data**: [What data is fetched]
- **Caching Strategy**: [How to cache]
### Client State (Zustand)
- **Store**: `[store-name]Store`
- **State Shape**: [TypeScript interface]
- **Actions**: [list of state mutations]
### Derived State
- **[Computed Value]**: Derived from [source state]
## Web Component Mapping
| MidsReborn Pattern | Web Equivalent | Library/Component |
| ------------------ | -------------- | ----------------- |
| DataGridView | Table | TanStack Table |
| ListBox | Listbox | shadcn/ui Listbox |
| ... | ... | ... |
## API Integration Points
### Backend Endpoints Needed
1. **GET /api/[resource]** - [Purpose]
2. **POST /api/[resource]** - [Purpose]
(Cross-reference with backend API implementation)
## Screenshot Analysis
### Available Screenshots
Location: `/Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots`
[List screenshots found that are relevant to this epic]
1. **[Screenshot filename]**
- Shows: [What it displays]
- Relevant to: [Which component/feature]
### Additional Screenshots Recommended
[If key screenshots are missing, list them here]
1. **[Feature] - [State]**
- Filename suggestion: `midsreborn-[feature]-[state].png`
- Should show: [What to capture]
- Needed for: [Why it's important]
## Implementation Notes
### Key Behaviors to Replicate
- [Important behavior 1]
- [Important behavior 2]
### UX Improvements for Web
- [Opportunity to improve on MidsReborn UX]
## Warnings & Edge Cases
- [Any edge cases found in MidsReborn code]
- [Potential issues to watch out for]
---
Dispatch sub-agent
Tool: Task
Parameters:
subagent_type: Explore
description: MidsReborn UI analysis for epic X.Y
prompt: [prompt from step 1]
model: sonnet (thorough analysis needed)
Wait for sub-agent completion
Sub-agent will create: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
Validate output
- Check file exists:
docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
- If missing: Error and offer retry
Display summary
Phase 2: MidsReborn UI Analysis Hook
Launching analysis sub-agent...
Analyzing MidsReborn Forms for Epic X.Y...
- Found: [N] relevant Form files
- Extracted: [M] UI components
- Identified: [K] features
✅ Created: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
- [N] MidsReborn components analyzed
- [M] features identified
- [K] screenshots recommended
Proceeding to Phase 3...
Phase 3: Planning Integration (write-plan)
Purpose: Create implementation plan with MidsReborn UI analysis via superpowers plugin.
Implementation: Invoke /superpowers:write-plan via SlashCommand tool.
Steps:
Prepare context message for write-plan
Before invoking the slash command, output a clear message to the user explaining what will happen:
Phase 3: Planning
Invoking /superpowers:write-plan to create implementation plan...
The planning agent will receive:
- All context from Phase 1 (architecture docs, previous epic)
- MidsReborn UI analysis from Phase 2
- Enhanced instructions for frontend component planning
This will create:
- Detailed plan: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
- Summary: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
Invoke the write-plan slash command
Use the SlashCommand tool:
Tool: SlashCommand
Parameters:
command: "/superpowers:write-plan"
Important: The write-plan agent has access to the ENTIRE conversation context up to this point, including:
- All files loaded in Phase 1
- MidsReborn UI analysis from Phase 2
- The enhanced instructions below (Section 3)
You do NOT need to pass parameters or repeat context - the agent sees everything in the conversation.
Enhanced instructions for write-plan (in this message)
The planning agent should create an implementation plan for Epic X.Y of the Mids Hero Web frontend.
CONTEXT PROVIDED
All context from Phase 1 (architecture docs, previous epic, MidsReborn references)
MidsReborn UI Analysis from Phase 2: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
MANDATORY REQUIREMENTS
1. Component-Driven Development
Break down implementation into React components:
- Component hierarchy (parent/child relationships)
- Props interface (TypeScript)
- State management (local vs global)
- API integration points
2. Test-Driven Development
For each component, include:
- Component test structure (React Testing Library)
- User interaction tests (click, type, select)
- State update tests
- API integration tests (mocked)
3. MidsReborn Reference
All UX decisions MUST reference the MidsReborn UI analysis.
Format: "Implements [Feature] as shown in MidsReborn [Form Name] (ref: MIDSREBORN-UI-ANALYSIS-epic-X.Y.md, Component 2)"
4. State Management Integration
Specify how components integrate with:
- TanStack Query: Server state, caching, mutations
- Zustand: Client state, actions, selectors
- React Hook Form: Form state (if applicable)
5. API Integration
For each backend API call:
- Endpoint:
GET /api/[resource]
- Request/Response TypeScript types
- Error handling strategy
- Loading states
6. Visual Design
Reference shadcn/ui components:
- Which shadcn/ui components to use
- Custom components to build
- Tailwind classes for layout
7. Previous Epic Context
This plan builds on previous epics. Reference and maintain consistency with:
- Previous epic: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
- Architecture decisions: docs/frontend/architecture.md
8. Epic Objectives Alignment
Your plan must accomplish objectives defined in:
docs/frontend/epic-breakdown.md (Epic X.Y section)
OUTPUT STRUCTURE
Create TWO files:
File 1: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
Detailed implementation plan:
- Background & Context (links to MidsReborn analysis, previous artifacts)
- Objectives (from epic breakdown)
- Component Specifications (detailed, with TypeScript interfaces)
- State Management Plan (TanStack Query + Zustand)
- API Integration Plan (endpoints, types, error handling)
- Implementation Tasks (step-by-step, with test examples)
- Acceptance Criteria (traceable to epic breakdown)
- Visual Verification Checklist (how to compare with MidsReborn)
File 2: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
Concise summary (500-1000 words):
- What this epic accomplishes
- Key components created
- State management approach
- API endpoints used
- Next epic preview
This becomes the master reference for Epic X.Y.
After planning completes
The write-plan agent will return when it has created both files.
Validate outputs and display summary
After write-plan returns, validate the outputs:
- Check both files exist:
docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
- Verify PLAN-SUMMARY is concise (500-1000 words)
- Verify detailed plan references MidsReborn UI analysis
Display summary
Phase 3: Planning
Invoking superpowers:write-plan...
Creating implementation plan with MidsReborn UI context...
✅ Created: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
✅ Created: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
Plan includes:
- [N] React components to build
- [M] API integration points
- [K] test suites
- [L] shadcn/ui components to install
Proceeding to Gate 1 (Human Approval)...
GATE 1: Human Approval (Post-Planning)
Purpose: Human reviews MidsReborn analysis and plan before execution.
Steps:
Display gate header
═══════════════════════════════════════════════════════════
EPIC X.Y PLANNING COMPLETE
═══════════════════════════════════════════════════════════
Display MidsReborn analysis summary
MidsReborn UI Analysis:
✅ docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
- [N] MidsReborn Forms analyzed
- [M] features identified
- [K] components to build
Display plan creation summary
Plan Created:
✅ docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
✅ docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
Display screenshot status
📸 MidsReborn Screenshots:
Found in /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots:
- [screenshot1.png] - [Description]
- [screenshot2.png] - [Description]
[If additional screenshots would be helpful:]
Additional screenshots recommended (optional):
1. midsreborn-[feature]-[state].png - [Description]
2. midsreborn-[feature]-[state].png - [Description]
Please capture from MidsReborn and save to shared/user/midsreborn-screenshots/
Display gate instructions
═══════════════════════════════════════════════════════════
NEXT: Execute plan to build React components
Please review:
1. MidsReborn UI analysis (are all features captured?)
2. Plan summary (does it align with epic objectives?)
3. Component specifications (do they make sense?)
Type 'proceed to execute' to continue
Type 'abort' to stop
═══════════════════════════════════════════════════════════
Wait for human response
- Listen for: "proceed to execute", "proceed", "execute", "continue", "yes"
- If user says "abort", "stop", "cancel": Exit skill gracefully
- If ambiguous: Ask for clarification
On approval, display transition
✅ Approval received. Proceeding to Phase 4...
Phase 4: Execution (execute-plan)
Purpose: Create all React components and tests per verified plan.
Implementation: Invoke /superpowers:execute-plan via SlashCommand tool.
Steps:
Prepare context message for execute-plan
Before invoking the slash command, output a clear message to the user explaining what will happen:
Phase 4: Execution
Invoking /superpowers:execute-plan to implement components...
The execution agent will receive:
- Implementation plan from Phase 3
- All context from Phase 1
- MidsReborn UI analysis
- Enhanced instructions for React component development
This will create React components, hooks, stores, and tests as specified in the plan.
Invoke the execute-plan slash command
Use the SlashCommand tool:
Tool: SlashCommand
Parameters:
command: "/superpowers:execute-plan"
Important: The execute-plan agent has access to the ENTIRE conversation context up to this point, including:
- Plans created in Phase 3
- All files loaded in Phase 1
- MidsReborn UI analysis from Phase 2
- The enhanced instructions below (Section 3)
You do NOT need to pass parameters or repeat context - the agent sees everything in the conversation.
Enhanced instructions for execute-plan (in this message)
The execution agent should implement the plan for Epic X.Y of the Mids Hero Web frontend.
CONTEXT PROVIDED
Plan: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
Plan Summary: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
All Phase 1 context (architecture docs, MidsReborn references)
MidsReborn UI analysis: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
EXECUTION REQUIREMENTS
1. Follow Plan Exactly
Implement all components as specified in the plan.
2. Create Files in Correct Locations
Frontend structure:
frontend/src/
├── components/ # React components
│ ├── [Feature]/
│ │ ├── [Component].tsx
│ │ ├── [Component].test.tsx
│ │ └── index.ts
├── hooks/ # Custom React hooks
│ ├── use[Feature].ts
│ └── use[Feature].test.ts
├── services/ # API client services
│ ├── [feature]Api.ts
│ └── [feature]Api.test.ts
├── stores/ # Zustand stores
│ ├── [feature]Store.ts
│ └── [feature]Store.test.ts
├── types/ # TypeScript types
│ └── [feature].types.ts
└── lib/ # Utilities
3. TypeScript Strict Mode
All code MUST be TypeScript with strict mode enabled:
- No
any types (use unknown if needed)
- Explicit return types on functions
- Proper interface definitions
4. Component Testing Pattern
Every component MUST have tests following this pattern:
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ComponentName } from './ComponentName';
describe('ComponentName', () => {
it('renders correctly', () => {
render(<ComponentName {...requiredProps} />);
expect(screen.getByRole('...')).toBeInTheDocument();
});
it('handles user interaction', async () => {
const user = userEvent.setup();
render(<ComponentName {...requiredProps} />);
await user.click(screen.getByRole('button'));
expect(...).toBeCalled();
});
});
5. State Management Integration
TanStack Query usage:
import { useQuery, useMutation } from "@tanstack/react-query";
export function useFeature() {
return useQuery({
queryKey: ["feature"],
queryFn: fetchFeature,
});
}
Zustand usage:
import { create } from "zustand";
interface FeatureState {
data: FeatureData | null;
actions: {
setData: (data: FeatureData) => void;
};
}
export const useFeatureStore = create<FeatureState>((set) => ({
data: null,
actions: {
setData: (data) => set({ data }),
},
}));
6. shadcn/ui Component Usage
Use shadcn/ui components as specified in plan:
import { Button } from "@/components/ui/button";
import { Dialog } from "@/components/ui/dialog";
If component not yet installed, note in checkpoint for manual installation.
7. Batch Execution with Review Checkpoints
Follow execute-plan skill's batch execution pattern.
Present work for review between logical groups.
8. API Integration
Use fetch or axios with proper error handling:
async function fetchResource(): Promise<Resource> {
const response = await fetch("/api/resource");
if (!response.ok) {
throw new Error(`Failed to fetch: ${response.statusText}`);
}
return response.json();
}
After execution completes
The execute-plan agent will return when it has created all components, hooks, stores, and tests.
Collect execution results and display summary
Track which files were created during execution for Phase 5 checkpoint.
Phase 4: Execution Complete
execute-plan has finished creating components...
Executing plan tasks...
✅ Created: frontend/src/components/[Feature]/[Component].tsx
✅ Created: frontend/src/components/[Feature]/[Component].test.tsx
✅ Created: frontend/src/hooks/use[Feature].ts
✅ Created: frontend/src/stores/[feature]Store.ts
✅ Created: frontend/src/services/[feature]Api.ts
Files created: [N] total
- [X] Components
- [Y] Tests
- [Z] Hooks
- [W] Stores
Proceeding to Phase 5 (Visual Verification & Checkpoint)...
Phase 5: Visual Verification & Checkpoint
Purpose: Generate checkpoint document, verify visually against MidsReborn, update progress.
Steps:
Collect execution results
From Phase 4, we have:
- List of all files created (components, tests, hooks, stores)
- Any execution errors (if any)
- Key decisions made (from plan)
Visual verification instructions
📸 VISUAL VERIFICATION REQUIRED
Please perform the following:
1. Run the development server: `cd frontend && npm start`
2. Navigate to: [URL/route for this feature]
3. Interact with the feature to test functionality
4. Capture screenshot: Save as docs/frontend/screenshots/implementation-[feature]-epic-X.Y.png
5. Compare with MidsReborn screenshot(s) from shared/user/midsreborn-screenshots/
Reference screenshots for comparison:
- shared/user/midsreborn-screenshots/[relevant-screenshot].png
Verification Checklist:
- [ ] Feature displays correctly
- [ ] User interactions work as expected
- [ ] Data loads from backend API
- [ ] UI matches MidsReborn functional layout (not pixel-perfect)
- [ ] No console errors
Type 'verified' when visual check is complete
Type 'issues found: [description]' if problems discovered
Wait for visual verification
- Listen for: "verified", "looks good", "working"
- If "issues found": Offer to fix before checkpoint
- If "not working": Offer to debug and re-run Phase 4
Generate checkpoint document
Create: docs/frontend/checkpoints/CHECKPOINT-epic-X.Y-[name].md
Template:
# CHECKPOINT: Epic X.Y - [Epic Name]
**Date**: [YYYY-MM-DD]
**Status**: Awaiting Approval
**Plan**: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
---
## Executive Summary
[3-5 sentences: what was accomplished, key components built, recommendation]
---
## Work Completed
- ✅ MidsReborn UI analysis completed ([N] Forms analyzed)
- ✅ Implementation plan created and approved
- ✅ [Major component 1] built with tests
- ✅ [Major component 2] built with tests
- ✅ [State management] implemented
- ✅ [API integration] completed
---
## Components Created
### React Components
- 📄 `frontend/src/components/[Feature]/[Component1].tsx` - [Description]
- 📄 `frontend/src/components/[Feature]/[Component2].tsx` - [Description]
### Hooks
- 📄 `frontend/src/hooks/use[Feature].ts` - [Description]
### Stores
- 📄 `frontend/src/stores/[feature]Store.ts` - [Description]
### Services
- 📄 `frontend/src/services/[feature]Api.ts` - [Description]
### Tests
- ✅ All components have test coverage
- ✅ [N] test suites created
- ✅ All tests passing
---
## Visual Verification
### MidsReborn Reference

_Caption: MidsReborn implementation of [Feature]_
_Source: /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots_
### Our Implementation

_Caption: Mids Hero Web implementation of [Feature] (Epic X.Y)_
### UX Parity Checklist
- [x] **Layout**: Functional parity achieved (modern web aesthetic)
- [x] **Data Display**: All data points from MidsReborn are shown
- [x] **User Interactions**: All core interactions work correctly
- [x] **Validation**: Input validation matches MidsReborn behavior
- [x] **Error States**: Proper error handling implemented
### UX Improvements Over MidsReborn
- [Improvement 1]: [Description]
- [Improvement 2]: [Description]
---
## Key Decisions Made
### Decision 1: [Decision Name]
**Rationale**: [2-3 sentences explaining why]
**Impact**: [What this enables or constrains]
**Implementation**: [How it was implemented]
---
## State Management
### TanStack Query Integration
- **Queries**: [List of queries created]
- **Mutations**: [List of mutations created]
- **Caching Strategy**: [How data is cached]
### Zustand Store
- **Store Name**: `[feature]Store`
- **State Shape**: [Brief description]
- **Actions**: [List of actions]
---
## API Integration
### Endpoints Used
1. **GET /api/[resource]** - [Purpose]
- Response type: `[TypeName]`
- Error handling: [Strategy]
2. **POST /api/[resource]** - [Purpose]
- Request type: `[TypeName]`
- Response type: `[TypeName]`
---
## Test Coverage
### Component Tests
- [Component1]: [N] tests, [M]% coverage
- [Component2]: [N] tests, [M]% coverage
### Integration Tests
- [Test suite 1]: [N] tests
- [Test suite 2]: [N] tests
### Test Results
PASS src/components/[Feature]/[Component].test.tsx
PASS src/hooks/use[Feature].test.ts
PASS src/stores/[feature]Store.test.ts
Test Suites: [N] passed, [N] total
Tests: [M] passed, [M] total
---
## Risks & Concerns Identified
[If any risks found during implementation]
⚠️ **[Risk 1: Risk Name]**
- **Description**: [What could go wrong]
- **Impact**: High/Medium/Low
- **Mitigation**: [Proposed approach]
---
## Dependencies for Next Epic
The next epic ([X.Y+1 - Epic Name]) requires:
- ✅ [PLAN-SUMMARY-epic-X.Y.md - Complete]
- ✅ [Components from this epic - Complete]
- ⏳ [Item waiting on external factor]
---
## Next Epic Preview
**Epic [X.Y+1]**: [Epic Name]
- **Will build**: [Key components]
- **Will accomplish**: [1-2 sentences]
- **Prerequisites**: [This checkpoint approval + any other items]
---
## Required Human Action
Please review this checkpoint and:
- [ ] Review all components created (links above)
- [ ] Visually verify implementation matches MidsReborn UX
- [ ] Review test coverage
- [ ] Test feature functionality locally
- [ ] **Provide approval to proceed**
### How to Respond
- **"Approved - proceed to Epic X.Y+1"** - Mark epic complete, ready for next epic
- **"Approved with changes: [details]"** - Make changes, regenerate checkpoint
- **"Request revision: [what needs to change]"** - Fix issues, re-run
---
**Generated by**: frontend-development orchestrator
**Visual Verification Status**: ✅ Verified
Update epic progress tracking
Update: docs/frontend/progress.json (or similar)
{
"current_epic": "X.Y",
"completed_epics": ["1.1", "1.2", "..."],
"epic_X.Y": {
"status": "complete",
"completed_date": "YYYY-MM-DD",
"components_created": N,
"tests_created": M,
"visual_verification": "passed"
}
}
Display checkpoint summary
Phase 5: Visual Verification & Checkpoint
Generating checkpoint...
Execution summary:
- [N] components created
- [M] tests created (all passing)
- [K] API endpoints integrated
Visual verification:
✅ Feature tested locally
✅ Screenshots captured
✅ UX parity confirmed
✅ Created: docs/frontend/checkpoints/CHECKPOINT-epic-X.Y-[name].md
✅ Updated: docs/frontend/progress.json
Proceeding to Gate 2 (Final Approval)...
GATE 2: Human Approval (Post-Checkpoint)
Purpose: Human reviews checkpoint and approves epic completion.
Steps:
Display gate header
═══════════════════════════════════════════════════════════
EPIC X.Y EXECUTION COMPLETE
═══════════════════════════════════════════════════════════
Display checkpoint summary
Checkpoint Generated:
📋 docs/frontend/checkpoints/CHECKPOINT-epic-X.Y-[name].md
Components Created: [N] total
✅ [X] React components
✅ [Y] Custom hooks
✅ [Z] Zustand stores
✅ [W] API services
✅ All with tests (100% passing)
Display visual verification status
Visual Verification:
✅ Feature tested locally
✅ Screenshots captured and compared
✅ UX parity with MidsReborn confirmed
✅ No console errors
Display gate instructions
═══════════════════════════════════════════════════════════
NEXT: Review checkpoint and approve to continue
Please review:
1. Checkpoint document (see all components and tests)
2. Visual verification (side-by-side screenshots)
3. Test coverage (all tests passing?)
4. Feature functionality (does it work correctly?)
Type 'approved - proceed to Epic X.Y+1' to complete
Type 'approved with changes: [details]' to revise
Type 'request revision: [what needs to change]' to fix issues
═══════════════════════════════════════════════════════════
Wait for human response
- Listen for: "approved", "approved - proceed to Epic X.Y+1"
- If "approved with changes": Note changes, offer to revise
- If "request revision": Note issues, offer to re-run phases
Final epic completion
a. Update progress tracking final timestamp
b. Display completion message:
═══════════════════════════════════════════════════════════
✅ EPIC X.Y COMPLETE
═══════════════════════════════════════════════════════════
Summary:
- MidsReborn Analysis: [N] Forms analyzed
- Planning: Complete
- Execution: [M] components + [K] tests created
- Visual Verification: ✅ Passed
- Checkpoint: Approved
Next Epic: X.Y+1 - [Epic Name]
Ready to run: /frontend-development epic-X.Y+1
═══════════════════════════════════════════════════════════
Error Handling
Prerequisite Errors
MidsReborn codebase missing:
ERROR: MidsReborn codebase not found.
Expected: /Users/w/code/mids-hero-web/external/dev/MidsReborn
This is required for UI analysis.
Previous epic missing:
ERROR: Previous epic not complete.
Cannot find: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
Complete Epic [X.Y-1] first.
Analysis Hook Errors
Sub-agent timeout:
ERROR: MidsReborn UI analysis sub-agent timed out.
Options:
1. Type 'retry' to run analysis again
2. Type 'abort' to stop
Analysis output file missing:
ERROR: Analysis sub-agent completed but did not create output file.
Expected: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
Options:
1. Type 'retry' to run analysis again
2. Type 'abort' to stop
Visual Verification Errors
Component doesn't render:
ERROR: Component failed to render during visual verification.
Check console for errors and fix before proceeding.
Options:
1. Type 'fix and retry' to debug and re-run Phase 4
2. Type 'abort' to stop
Tests failing:
ERROR: Tests are failing.
[Test output]
All tests must pass before proceeding to checkpoint.
Options:
1. Type 'fix and retry' to fix tests and re-run
2. Type 'abort' to stop
Notes
- Modeled after
verified-stage-development skill
- Frontend-specific adaptations for React/Next.js
- Visual verification is mandatory (not optional)
- Every component must have tests (TDD enforced)
- MidsReborn UI analysis informs all design decisions
1---2name: frontend-development-23description: Orchestrates frontend development with MidsReborn UI analysis, React component planning, visual verification, and quality gates4---5
6# Frontend Development (Verified Stages)
7
8Orchestrates frontend epic development with MidsReborn UI analysis and visual verification gates.
9
10**Invocation**: `/frontend-development epic-X.Y`
11
12**Example**: `/frontend-development epic-1.1`
13
14---
15
16## Scope
17
18This skill orchestrates frontend development by integrating with the superpowers plugin:
19
20- ✅ Context Collection (previous epics, architecture docs, screenshots)
21- ✅ MidsReborn UI Analysis Hook (Task tool with Explore agent)
22- ✅ Planning Integration (invokes `/superpowers:write-plan` via SlashCommand)
23- ✅ Two-Gate Approval Flow (human reviews before execution)
24- ✅ Execution Integration (invokes `/superpowers:execute-plan` via SlashCommand)
25- ✅ Visual Verification Workflow (compare with MidsReborn screenshots)
26- ✅ Checkpoint Generation (documents progress and artifacts)
27- ✅ Epic Progress Tracking (updates progress.json)
28
29**Key Integration**: This skill does NOT directly create files. Instead, it:
301. Analyzes MidsReborn UI (via Task tool)
312. Invokes `/superpowers:write-plan` to create plans
323. Gets human approval at Gate 1
334. Invokes `/superpowers:execute-plan` to create components
345. Facilitates visual verification at Gate 2
35
36---
37
38## Parameters
39
40- `epic-number` (required): Epic identifier (e.g., `epic-1.1`, `epic-2.2`)
41
42---
43
44## Process
45
46### Phase 1: Context Collection
47
48**Purpose:** Load all relevant documents with deterministic file list.
49
50**Steps:**
51
521. **Parse epic number from invocation**
53
54 - Extract from command: `/frontend-development epic-1.2` → `1.2`
55 - Validate format: `epic-X.Y` where X.Y is digit pattern
56
572. **Read context map**
58
59 - File: `docs/frontend/context-map.json` (if exists, else use defaults)
60 - Look up key: `epic-X.Y`
61 - Extract: `required_inputs`, `midsreborn_references`
62
633. **Check prerequisites**
64
65 **If not first epic (X.Y > 1.1):**
66
67 - Check: `docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md` exists
68 - Calculate previous epic number (e.g., 2.2 → 2.1)
69 - If missing: ERROR and stop
70
71 ```
72 ERROR: Previous epic not complete.
73
74 Cannot find: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
75
76 Complete Epic [X.Y-1] first before running Epic X.Y.
77 ```
78
79 **Check MidsReborn codebase:**
80
81 - Verify: `/Users/w/code/mids-hero-web/external/dev/MidsReborn` exists
82 - If missing: ERROR
83
84 ```
85 ERROR: MidsReborn codebase not found.
86
87 Expected: /Users/w/code/mids-hero-web/external/dev/MidsReborn
88
89 This is required for UI analysis and reference implementation.
90 ```
91
92 **Check MidsReborn screenshots:**
93
94 - Location: `/Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots`
95 - Screenshots are optional but highly recommended for visual verification
96 - If directory exists, load screenshot list for reference in analysis
97
984. **Build explicit file list**
99
100 Load common files (always required):
101
102 ```
103 - docs/frontend/architecture.md
104 - docs/frontend/epic-breakdown.md
105 - docs/frontend/tech-stack.md (if exists)
106 - docs/midsreborn/00-navigation-map.md
107 - docs/midsreborn/01-architecture-overview.md
108 ```
109
110 Load MidsReborn screenshots (if available):
111
112 ```
113 - Check: /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots
114 - List available screenshots for visual reference
115 - Include screenshot paths in context for sub-agents
116 ```
117
118 Load epic-specific inputs:
119
120 - Previous epic plan summary (if not Epic 1.1)
121 - Epic-specific requirements from epic-breakdown.md
122 - Relevant MidsReborn calculation specs (from `docs/midsreborn/calculations/`)
123
1245. **Load all files**
125
126 - Use Read tool for each file in the explicit list
127 - Store in context for next phases
128 - If any REQUIRED file missing → ERROR with specific filename
129 - Track which files were loaded for verification
130
1316. **Display context loaded summary**
132
133 ```
134 Phase 1: Context Collection
135 ✅ Read: docs/frontend/architecture.md
136 ✅ Read: docs/frontend/epic-breakdown.md
137 ✅ Read: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
138 ✅ Read: [N] MidsReborn reference docs
139 ✅ Verified: MidsReborn codebase exists
140 ✅ Found: [N] MidsReborn screenshots in shared/user/midsreborn-screenshots
141
142 Total files loaded: [N]
143 Context loaded. Proceeding to Phase 2...
144 ```
145
146---
147
148### Phase 2: MidsReborn UI Analysis Hook
149
150**Purpose:** Analyze MidsReborn UI code to understand feature implementation.
151
152**Implementation:** Dispatch sub-agent via Task tool.
153
154**Steps:**
155
1561. **Build sub-agent prompt**
157
158 ```markdown
159 You are a MidsReborn UI analysis agent for Epic X.Y of the Mids Hero Web frontend.
160
161 ## CONTEXT
162
163 [Include all files loaded in Phase 1]
164
165 Epic to implement: Epic X.Y - [Feature Name]
166 MidsReborn codebase: /Users/w/code/mids-hero-web/external/dev/MidsReborn
167 MidsReborn screenshots: /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots (if available)
168 Frontend architecture: docs/frontend/architecture.md
169 Epic breakdown: docs/frontend/epic-breakdown.md
170
171 ## YOUR TASK
172
173 ### 1. Locate MidsReborn UI Components
174
175 Find the C# Windows Forms UI code for this feature:
176
177 - Use Glob to find relevant Form files: `external/dev/MidsReborn/**/*.cs`
178 - Search for UI components related to: [Feature Name from Epic X.Y]
179 - Example patterns to search:
180 - "ArchetypeSelector" for character creation
181 - "PowerPicker" for power selection
182 - "EnhancementSlotEditor" for slotting
183 - "BuildTotalsPanel" for stats display
184
185 ### 2. Extract UI Component Structure
186
187 For each relevant Form/UserControl:
188
189 - **Layout**: How are controls arranged? (panels, grids, lists)
190 - **Data Displayed**: What information is shown to the user?
191 - **User Interactions**: What can users click/select/edit?
192 - **Data Flow**: How does UI get data? (direct DB calls, services, etc.)
193 - **Validation**: What validation rules exist?
194 - **Events**: What triggers recalculation/updates?
195
196 ### 3. Extract Feature Requirements
197
198 From the UI code, determine:
199
200 - **MUST-HAVE features**: Core functionality that must be replicated
201 - **SHOULD-HAVE features**: Important but could be deferred
202 - **COULD-SKIP features**: Nice-to-have, not in v1 scope
203
204 Cross-reference with user's skip list:
205
206 - Skip: alternate IO slotting, enhancement boosters, attuned IOs, level scaling, incarnate powers, rotation recommendations
207
208 ### 4. Identify State Management Needs
209
210 Determine what state this feature manages:
211
212 - **Server State**: What data comes from backend API?
213 - **Client State**: What is managed locally in the UI?
214 - **Shared State**: What state is shared across components?
215 - **Derived State**: What is computed from other state?
216
217 ### 5. Map to Web Equivalent
218
219 For each MidsReborn UI pattern, propose web equivalent:
220
221 - **DataGridView** → TanStack Table or custom table
222 - **ListBox/ComboBox** → Select component or listbox
223 - **TabControl** → Tabs component
224 - **TreeView** → Tree component or nested lists
225 - **ToolTip** → Tooltip component (shadcn/ui)
226 - **Modal Dialogs** → Dialog/Modal component
227
228 ### 6. Identify Available Screenshots
229
230 Check for existing screenshots in: `/Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots`
231
232 For each relevant screenshot found:
233
234 - Note filename and what it shows
235 - Reference in analysis report
236 - Use as visual reference for component design
237
238 If screenshots for this epic's features are missing:
239
240 - List specific screenshots that would be helpful
241 - Request user to capture them from MidsReborn
242
243 ## OUTPUT FORMAT
244
245 Create: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
246
247 ## Structure:
248
249 # MidsReborn UI Analysis: Epic X.Y - [Feature Name]
250
251 **Created**: [date]
252 **Epic**: [epic number and name]
253 **MidsReborn Forms Analyzed**: [list]
254
255 ## Executive Summary
256
257 [2-3 sentences: what feature does, how MidsReborn implements it, key findings]
258
259 ## MidsReborn UI Components
260
261 ### Component 1: [Form/UserControl Name]
262
263 - **File**: `external/dev/MidsReborn/[path]`
264 - **Purpose**: [What this component does]
265 - **Layout**: [How controls are arranged]
266 - **Data Displayed**: [What information is shown]
267 - **User Interactions**: [What users can do]
268
269 ### Component 2: [Name]
270
271 ...
272
273 ## Feature Requirements
274
275 ### MUST-HAVE Features
276
277 1. **[Feature Name]**
278
279 - **Description**: [What it does]
280 - **MidsReborn Implementation**: [How MidsReborn does it]
281 - **Web Equivalent**: [How we'll implement it]
282
283 2. **[Feature Name]**
284 ...
285
286 ### SHOULD-HAVE Features
287
288 [Features to include if time permits]
289
290 ### COULD-SKIP Features
291
292 [Features that can be deferred to v2]
293
294 ## State Management Analysis
295
296 ### Server State (TanStack Query)
297
298 - **Endpoint**: `GET /api/[resource]`
299 - **Data**: [What data is fetched]
300 - **Caching Strategy**: [How to cache]
301
302 ### Client State (Zustand)
303
304 - **Store**: `[store-name]Store`
305 - **State Shape**: [TypeScript interface]
306 - **Actions**: [list of state mutations]
307
308 ### Derived State
309
310 - **[Computed Value]**: Derived from [source state]
311
312 ## Web Component Mapping
313
314 | MidsReborn Pattern | Web Equivalent | Library/Component |
315 | ------------------ | -------------- | ----------------- |
316 | DataGridView | Table | TanStack Table |
317 | ListBox | Listbox | shadcn/ui Listbox |
318 | ... | ... | ... |
319
320 ## API Integration Points
321
322 ### Backend Endpoints Needed
323
324 1. **GET /api/[resource]** - [Purpose]
325 2. **POST /api/[resource]** - [Purpose]
326
327 (Cross-reference with backend API implementation)
328
329 ## Screenshot Analysis
330
331 ### Available Screenshots
332
333 Location: `/Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots`
334
335 [List screenshots found that are relevant to this epic]
336
337 1. **[Screenshot filename]**
338 - Shows: [What it displays]
339 - Relevant to: [Which component/feature]
340
341 ### Additional Screenshots Recommended
342
343 [If key screenshots are missing, list them here]
344
345 1. **[Feature] - [State]**
346 - Filename suggestion: `midsreborn-[feature]-[state].png`
347 - Should show: [What to capture]
348 - Needed for: [Why it's important]
349
350 ## Implementation Notes
351
352 ### Key Behaviors to Replicate
353
354 - [Important behavior 1]
355 - [Important behavior 2]
356
357 ### UX Improvements for Web
358
359 - [Opportunity to improve on MidsReborn UX]
360
361 ## Warnings & Edge Cases
362
363 - [Any edge cases found in MidsReborn code]
364 - [Potential issues to watch out for]
365
366 ---
367 ```
368
3692. **Dispatch sub-agent**
370
371 ```
372 Tool: Task
373 Parameters:
374 subagent_type: Explore
375 description: MidsReborn UI analysis for epic X.Y
376 prompt: [prompt from step 1]
377 model: sonnet (thorough analysis needed)
378 ```
379
3803. **Wait for sub-agent completion**
381
382 Sub-agent will create: `docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md`
383
3844. **Validate output**
385
386 - Check file exists: `docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md`
387 - If missing: Error and offer retry
388
3895. **Display summary**
390
391 ```
392 Phase 2: MidsReborn UI Analysis Hook
393 Launching analysis sub-agent...
394
395 Analyzing MidsReborn Forms for Epic X.Y...
396 - Found: [N] relevant Form files
397 - Extracted: [M] UI components
398 - Identified: [K] features
399
400 ✅ Created: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
401 - [N] MidsReborn components analyzed
402 - [M] features identified
403 - [K] screenshots recommended
404
405 Proceeding to Phase 3...
406 ```
407
408---
409
410### Phase 3: Planning Integration (write-plan)
411
412**Purpose:** Create implementation plan with MidsReborn UI analysis via superpowers plugin.
413
414**Implementation:** Invoke `/superpowers:write-plan` via SlashCommand tool.
415
416**Steps:**
417
4181. **Prepare context message for write-plan**
419
420 Before invoking the slash command, output a clear message to the user explaining what will happen:
421
422 ```
423 Phase 3: Planning
424 Invoking /superpowers:write-plan to create implementation plan...
425
426 The planning agent will receive:
427 - All context from Phase 1 (architecture docs, previous epic)
428 - MidsReborn UI analysis from Phase 2
429 - Enhanced instructions for frontend component planning
430
431 This will create:
432 - Detailed plan: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
433 - Summary: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
434 ```
435
4362. **Invoke the write-plan slash command**
437
438 Use the SlashCommand tool:
439
440 ```
441 Tool: SlashCommand
442 Parameters:
443 command: "/superpowers:write-plan"
444 ```
445
446 **Important**: The write-plan agent has access to the ENTIRE conversation context up to this point, including:
447 - All files loaded in Phase 1
448 - MidsReborn UI analysis from Phase 2
449 - The enhanced instructions below (Section 3)
450
451 You do NOT need to pass parameters or repeat context - the agent sees everything in the conversation.
452
4533. **Enhanced instructions for write-plan (in this message)**
454
455 The planning agent should create an implementation plan for Epic X.Y of the Mids Hero Web frontend.
456
457 ## CONTEXT PROVIDED
458
459 All context from Phase 1 (architecture docs, previous epic, MidsReborn references)
460 MidsReborn UI Analysis from Phase 2: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
461
462 ## MANDATORY REQUIREMENTS
463
464 ### 1. Component-Driven Development
465
466 Break down implementation into React components:
467
468 - Component hierarchy (parent/child relationships)
469 - Props interface (TypeScript)
470 - State management (local vs global)
471 - API integration points
472
473 ### 2. Test-Driven Development
474
475 For each component, include:
476
477 - Component test structure (React Testing Library)
478 - User interaction tests (click, type, select)
479 - State update tests
480 - API integration tests (mocked)
481
482 ### 3. MidsReborn Reference
483
484 All UX decisions MUST reference the MidsReborn UI analysis.
485
486 Format: "Implements [Feature] as shown in MidsReborn [Form Name] (ref: MIDSREBORN-UI-ANALYSIS-epic-X.Y.md, Component 2)"
487
488 ### 4. State Management Integration
489
490 Specify how components integrate with:
491
492 - **TanStack Query**: Server state, caching, mutations
493 - **Zustand**: Client state, actions, selectors
494 - **React Hook Form**: Form state (if applicable)
495
496 ### 5. API Integration
497
498 For each backend API call:
499
500 - Endpoint: `GET /api/[resource]`
501 - Request/Response TypeScript types
502 - Error handling strategy
503 - Loading states
504
505 ### 6. Visual Design
506
507 Reference shadcn/ui components:
508
509 - Which shadcn/ui components to use
510 - Custom components to build
511 - Tailwind classes for layout
512
513 ### 7. Previous Epic Context
514
515 This plan builds on previous epics. Reference and maintain consistency with:
516
517 - Previous epic: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
518 - Architecture decisions: docs/frontend/architecture.md
519
520 ### 8. Epic Objectives Alignment
521
522 Your plan must accomplish objectives defined in:
523 docs/frontend/epic-breakdown.md (Epic X.Y section)
524
525 ## OUTPUT STRUCTURE
526
527 Create TWO files:
528
529 ### File 1: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
530
531 Detailed implementation plan:
532
533 - Background & Context (links to MidsReborn analysis, previous artifacts)
534 - Objectives (from epic breakdown)
535 - Component Specifications (detailed, with TypeScript interfaces)
536 - State Management Plan (TanStack Query + Zustand)
537 - API Integration Plan (endpoints, types, error handling)
538 - Implementation Tasks (step-by-step, with test examples)
539 - Acceptance Criteria (traceable to epic breakdown)
540 - Visual Verification Checklist (how to compare with MidsReborn)
541
542 ### File 2: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
543
544 Concise summary (500-1000 words):
545
546 - What this epic accomplishes
547 - Key components created
548 - State management approach
549 - API endpoints used
550 - Next epic preview
551
552 This becomes the master reference for Epic X.Y.
553
5544. **After planning completes**
555
556 The write-plan agent will return when it has created both files.
557
5585. **Validate outputs and display summary**
559
560 After write-plan returns, validate the outputs:
561
562 - Check both files exist:
563 - `docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md`
564 - `docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md`
565 - Verify PLAN-SUMMARY is concise (500-1000 words)
566 - Verify detailed plan references MidsReborn UI analysis
567
5686. **Display summary**
569
570 ```
571 Phase 3: Planning
572 Invoking superpowers:write-plan...
573
574 Creating implementation plan with MidsReborn UI context...
575
576 ✅ Created: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
577 ✅ Created: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
578
579 Plan includes:
580 - [N] React components to build
581 - [M] API integration points
582 - [K] test suites
583 - [L] shadcn/ui components to install
584
585 Proceeding to Gate 1 (Human Approval)...
586 ```
587
588---
589
590### GATE 1: Human Approval (Post-Planning)
591
592**Purpose:** Human reviews MidsReborn analysis and plan before execution.
593
594**Steps:**
595
5961. **Display gate header**
597
598 ```
599 ═══════════════════════════════════════════════════════════
600 EPIC X.Y PLANNING COMPLETE
601 ═══════════════════════════════════════════════════════════
602 ```
603
6042. **Display MidsReborn analysis summary**
605
606 ```
607 MidsReborn UI Analysis:
608 ✅ docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
609 - [N] MidsReborn Forms analyzed
610 - [M] features identified
611 - [K] components to build
612 ```
613
6143. **Display plan creation summary**
615
616 ```
617 Plan Created:
618 ✅ docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
619 ✅ docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
620 ```
621
6224. **Display screenshot status**
623
624 ```
625 📸 MidsReborn Screenshots:
626
627 Found in /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots:
628 - [screenshot1.png] - [Description]
629 - [screenshot2.png] - [Description]
630
631 [If additional screenshots would be helpful:]
632 Additional screenshots recommended (optional):
633 1. midsreborn-[feature]-[state].png - [Description]
634 2. midsreborn-[feature]-[state].png - [Description]
635
636 Please capture from MidsReborn and save to shared/user/midsreborn-screenshots/
637 ```
638
6395. **Display gate instructions**
640
641 ```
642 ═══════════════════════════════════════════════════════════
643 NEXT: Execute plan to build React components
644
645 Please review:
646 1. MidsReborn UI analysis (are all features captured?)
647 2. Plan summary (does it align with epic objectives?)
648 3. Component specifications (do they make sense?)
649
650 Type 'proceed to execute' to continue
651 Type 'abort' to stop
652 ═══════════════════════════════════════════════════════════
653 ```
654
6556. **Wait for human response**
656
657 - Listen for: "proceed to execute", "proceed", "execute", "continue", "yes"
658 - If user says "abort", "stop", "cancel": Exit skill gracefully
659 - If ambiguous: Ask for clarification
660
6617. **On approval, display transition**
662
663 ```
664 ✅ Approval received. Proceeding to Phase 4...
665 ```
666
667---
668
669### Phase 4: Execution (execute-plan)
670
671**Purpose:** Create all React components and tests per verified plan.
672
673**Implementation:** Invoke `/superpowers:execute-plan` via SlashCommand tool.
674
675**Steps:**
676
6771. **Prepare context message for execute-plan**
678
679 Before invoking the slash command, output a clear message to the user explaining what will happen:
680
681 ```
682 Phase 4: Execution
683 Invoking /superpowers:execute-plan to implement components...
684
685 The execution agent will receive:
686 - Implementation plan from Phase 3
687 - All context from Phase 1
688 - MidsReborn UI analysis
689 - Enhanced instructions for React component development
690
691 This will create React components, hooks, stores, and tests as specified in the plan.
692 ```
693
6942. **Invoke the execute-plan slash command**
695
696 Use the SlashCommand tool:
697
698 ```
699 Tool: SlashCommand
700 Parameters:
701 command: "/superpowers:execute-plan"
702 ```
703
704 **Important**: The execute-plan agent has access to the ENTIRE conversation context up to this point, including:
705 - Plans created in Phase 3
706 - All files loaded in Phase 1
707 - MidsReborn UI analysis from Phase 2
708 - The enhanced instructions below (Section 3)
709
710 You do NOT need to pass parameters or repeat context - the agent sees everything in the conversation.
711
7123. **Enhanced instructions for execute-plan (in this message)**
713
714 The execution agent should implement the plan for Epic X.Y of the Mids Hero Web frontend.
715
716 ## CONTEXT PROVIDED
717
718 Plan: docs/frontend/plans/[YYYY-MM-DD]-epic-X.Y-[feature].md
719 Plan Summary: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
720 All Phase 1 context (architecture docs, MidsReborn references)
721 MidsReborn UI analysis: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
722
723 ## EXECUTION REQUIREMENTS
724
725 ### 1. Follow Plan Exactly
726
727 Implement all components as specified in the plan.
728
729 ### 2. Create Files in Correct Locations
730
731 **Frontend structure:**
732 ```
733
734 frontend/src/
735 ├── components/ # React components
736 │ ├── [Feature]/
737 │ │ ├── [Component].tsx
738 │ │ ├── [Component].test.tsx
739 │ │ └── index.ts
740 ├── hooks/ # Custom React hooks
741 │ ├── use[Feature].ts
742 │ └── use[Feature].test.ts
743 ├── services/ # API client services
744 │ ├── [feature]Api.ts
745 │ └── [feature]Api.test.ts
746 ├── stores/ # Zustand stores
747 │ ├── [feature]Store.ts
748 │ └── [feature]Store.test.ts
749 ├── types/ # TypeScript types
750 │ └── [feature].types.ts
751 └── lib/ # Utilities
752
753 ````
754
755 ### 3. TypeScript Strict Mode
756
757 All code MUST be TypeScript with strict mode enabled:
758
759 - No `any` types (use `unknown` if needed)
760 - Explicit return types on functions
761 - Proper interface definitions
762
763 ### 4. Component Testing Pattern
764
765 Every component MUST have tests following this pattern:
766
767 ```typescript
768 import { render, screen } from '@testing-library/react';
769 import userEvent from '@testing-library/user-event';
770 import { ComponentName } from './ComponentName';
771
772 describe('ComponentName', () => {
773 it('renders correctly', () => {
774 render(<ComponentName {...requiredProps} />);
775 expect(screen.getByRole('...')).toBeInTheDocument();
776 });
777
778 it('handles user interaction', async () => {
779 const user = userEvent.setup();
780 render(<ComponentName {...requiredProps} />);
781 await user.click(screen.getByRole('button'));
782 expect(...).toBeCalled();
783 });
784 });
785 ````
786
787 ### 5. State Management Integration
788
789 **TanStack Query usage:**
790
791 ```typescript
792 import { useQuery, useMutation } from "@tanstack/react-query";
793
794 export function useFeature() {
795 return useQuery({
796 queryKey: ["feature"],
797 queryFn: fetchFeature,
798 });
799 }
800 ```
801
802 **Zustand usage:**
803
804 ```typescript
805 import { create } from "zustand";
806
807 interface FeatureState {
808 data: FeatureData | null;
809 actions: {
810 setData: (data: FeatureData) => void;
811 };
812 }
813
814 export const useFeatureStore = create<FeatureState>((set) => ({
815 data: null,
816 actions: {
817 setData: (data) => set({ data }),
818 },
819 }));
820 ```
821
822 ### 6. shadcn/ui Component Usage
823
824 Use shadcn/ui components as specified in plan:
825
826 ```typescript
827 import { Button } from "@/components/ui/button";
828 import { Dialog } from "@/components/ui/dialog";
829 ```
830
831 If component not yet installed, note in checkpoint for manual installation.
832
833 ### 7. Batch Execution with Review Checkpoints
834
835 Follow execute-plan skill's batch execution pattern.
836 Present work for review between logical groups.
837
838 ### 8. API Integration
839
840 Use fetch or axios with proper error handling:
841
842 ```typescript
843 async function fetchResource(): Promise<Resource> {
844 const response = await fetch("/api/resource");
845 if (!response.ok) {
846 throw new Error(`Failed to fetch: ${response.statusText}`);
847 }
848 return response.json();
849 }
850 ```
851
8524. **After execution completes**
853
854 The execute-plan agent will return when it has created all components, hooks, stores, and tests.
855
8565. **Collect execution results and display summary**
857
858 Track which files were created during execution for Phase 5 checkpoint.
859
860 ```
861 Phase 4: Execution Complete
862
863 execute-plan has finished creating components...
864
865 Executing plan tasks...
866
867 ✅ Created: frontend/src/components/[Feature]/[Component].tsx
868 ✅ Created: frontend/src/components/[Feature]/[Component].test.tsx
869 ✅ Created: frontend/src/hooks/use[Feature].ts
870 ✅ Created: frontend/src/stores/[feature]Store.ts
871 ✅ Created: frontend/src/services/[feature]Api.ts
872
873 Files created: [N] total
874 - [X] Components
875 - [Y] Tests
876 - [Z] Hooks
877 - [W] Stores
878
879 Proceeding to Phase 5 (Visual Verification & Checkpoint)...
880 ```
881
882---
883
884### Phase 5: Visual Verification & Checkpoint
885
886**Purpose:** Generate checkpoint document, verify visually against MidsReborn, update progress.
887
888**Steps:**
889
8901. **Collect execution results**
891
892 From Phase 4, we have:
893
894 - List of all files created (components, tests, hooks, stores)
895 - Any execution errors (if any)
896 - Key decisions made (from plan)
897
8982. **Visual verification instructions**
899
900 ```
901 📸 VISUAL VERIFICATION REQUIRED
902
903 Please perform the following:
904
905 1. Run the development server: `cd frontend && npm start`
906 2. Navigate to: [URL/route for this feature]
907 3. Interact with the feature to test functionality
908 4. Capture screenshot: Save as docs/frontend/screenshots/implementation-[feature]-epic-X.Y.png
909 5. Compare with MidsReborn screenshot(s) from shared/user/midsreborn-screenshots/
910
911 Reference screenshots for comparison:
912 - shared/user/midsreborn-screenshots/[relevant-screenshot].png
913
914 Verification Checklist:
915 - [ ] Feature displays correctly
916 - [ ] User interactions work as expected
917 - [ ] Data loads from backend API
918 - [ ] UI matches MidsReborn functional layout (not pixel-perfect)
919 - [ ] No console errors
920
921 Type 'verified' when visual check is complete
922 Type 'issues found: [description]' if problems discovered
923 ```
924
9253. **Wait for visual verification**
926
927 - Listen for: "verified", "looks good", "working"
928 - If "issues found": Offer to fix before checkpoint
929 - If "not working": Offer to debug and re-run Phase 4
930
9314. **Generate checkpoint document**
932
933 Create: `docs/frontend/checkpoints/CHECKPOINT-epic-X.Y-[name].md`
934
935 Template:
936
937 ```markdown
938 # CHECKPOINT: Epic X.Y - [Epic Name]
939
940 **Date**: [YYYY-MM-DD]
941 **Status**: Awaiting Approval
942 **Plan**: docs/frontend/plans/PLAN-SUMMARY-epic-X.Y.md
943
944 ---
945
946 ## Executive Summary
947
948 [3-5 sentences: what was accomplished, key components built, recommendation]
949
950 ---
951
952 ## Work Completed
953
954 - ✅ MidsReborn UI analysis completed ([N] Forms analyzed)
955 - ✅ Implementation plan created and approved
956 - ✅ [Major component 1] built with tests
957 - ✅ [Major component 2] built with tests
958 - ✅ [State management] implemented
959 - ✅ [API integration] completed
960
961 ---
962
963 ## Components Created
964
965 ### React Components
966
967 - 📄 `frontend/src/components/[Feature]/[Component1].tsx` - [Description]
968 - 📄 `frontend/src/components/[Feature]/[Component2].tsx` - [Description]
969
970 ### Hooks
971
972 - 📄 `frontend/src/hooks/use[Feature].ts` - [Description]
973
974 ### Stores
975
976 - 📄 `frontend/src/stores/[feature]Store.ts` - [Description]
977
978 ### Services
979
980 - 📄 `frontend/src/services/[feature]Api.ts` - [Description]
981
982 ### Tests
983
984 - ✅ All components have test coverage
985 - ✅ [N] test suites created
986 - ✅ All tests passing
987
988 ---
989
990 ## Visual Verification
991
992 ### MidsReborn Reference
993
994 
995
996 _Caption: MidsReborn implementation of [Feature]_
997 _Source: /Users/w/code/mids-hero-web/shared/user/midsreborn-screenshots_
998
999 ### Our Implementation
1000
1001 
1002
1003 _Caption: Mids Hero Web implementation of [Feature] (Epic X.Y)_
1004
1005 ### UX Parity Checklist
1006
1007 - [x] **Layout**: Functional parity achieved (modern web aesthetic)
1008 - [x] **Data Display**: All data points from MidsReborn are shown
1009 - [x] **User Interactions**: All core interactions work correctly
1010 - [x] **Validation**: Input validation matches MidsReborn behavior
1011 - [x] **Error States**: Proper error handling implemented
1012
1013 ### UX Improvements Over MidsReborn
1014
1015 - [Improvement 1]: [Description]
1016 - [Improvement 2]: [Description]
1017
1018 ---
1019
1020 ## Key Decisions Made
1021
1022 ### Decision 1: [Decision Name]
1023
1024 **Rationale**: [2-3 sentences explaining why]
1025 **Impact**: [What this enables or constrains]
1026 **Implementation**: [How it was implemented]
1027
1028 ---
1029
1030 ## State Management
1031
1032 ### TanStack Query Integration
1033
1034 - **Queries**: [List of queries created]
1035 - **Mutations**: [List of mutations created]
1036 - **Caching Strategy**: [How data is cached]
1037
1038 ### Zustand Store
1039
1040 - **Store Name**: `[feature]Store`
1041 - **State Shape**: [Brief description]
1042 - **Actions**: [List of actions]
1043
1044 ---
1045
1046 ## API Integration
1047
1048 ### Endpoints Used
1049
1050 1. **GET /api/[resource]** - [Purpose]
1051
1052 - Response type: `[TypeName]`
1053 - Error handling: [Strategy]
1054
1055 2. **POST /api/[resource]** - [Purpose]
1056 - Request type: `[TypeName]`
1057 - Response type: `[TypeName]`
1058
1059 ---
1060
1061 ## Test Coverage
1062
1063 ### Component Tests
1064
1065 - [Component1]: [N] tests, [M]% coverage
1066 - [Component2]: [N] tests, [M]% coverage
1067
1068 ### Integration Tests
1069
1070 - [Test suite 1]: [N] tests
1071 - [Test suite 2]: [N] tests
1072
1073 ### Test Results
1074 ```
1075
1076 PASS src/components/[Feature]/[Component].test.tsx
1077 PASS src/hooks/use[Feature].test.ts
1078 PASS src/stores/[feature]Store.test.ts
1079
1080 Test Suites: [N] passed, [N] total
1081 Tests: [M] passed, [M] total
1082
1083 ```
1084
1085 ---
1086
1087 ## Risks & Concerns Identified
1088
1089 [If any risks found during implementation]
1090
1091 ⚠️ **[Risk 1: Risk Name]**
1092
1093 - **Description**: [What could go wrong]
1094 - **Impact**: High/Medium/Low
1095 - **Mitigation**: [Proposed approach]
1096
1097 ---
1098
1099 ## Dependencies for Next Epic
1100
1101 The next epic ([X.Y+1 - Epic Name]) requires:
1102
1103 - ✅ [PLAN-SUMMARY-epic-X.Y.md - Complete]
1104 - ✅ [Components from this epic - Complete]
1105 - ⏳ [Item waiting on external factor]
1106
1107 ---
1108
1109 ## Next Epic Preview
1110
1111 **Epic [X.Y+1]**: [Epic Name]
1112
1113 - **Will build**: [Key components]
1114 - **Will accomplish**: [1-2 sentences]
1115 - **Prerequisites**: [This checkpoint approval + any other items]
1116
1117 ---
1118
1119 ## Required Human Action
1120
1121 Please review this checkpoint and:
1122
1123 - [ ] Review all components created (links above)
1124 - [ ] Visually verify implementation matches MidsReborn UX
1125 - [ ] Review test coverage
1126 - [ ] Test feature functionality locally
1127 - [ ] **Provide approval to proceed**
1128
1129 ### How to Respond
1130
1131 - **"Approved - proceed to Epic X.Y+1"** - Mark epic complete, ready for next epic
1132 - **"Approved with changes: [details]"** - Make changes, regenerate checkpoint
1133 - **"Request revision: [what needs to change]"** - Fix issues, re-run
1134
1135 ---
1136
1137 **Generated by**: frontend-development orchestrator
1138 **Visual Verification Status**: ✅ Verified
1139
1140 ```
1141
11425. **Update epic progress tracking**
1143
1144 Update: `docs/frontend/progress.json` (or similar)
1145
1146 ```json
1147 {
1148 "current_epic": "X.Y",
1149 "completed_epics": ["1.1", "1.2", "..."],
1150 "epic_X.Y": {
1151 "status": "complete",
1152 "completed_date": "YYYY-MM-DD",
1153 "components_created": N,
1154 "tests_created": M,
1155 "visual_verification": "passed"
1156 }
1157 }
1158 ```
1159
11606. **Display checkpoint summary**
1161
1162 ```
1163 Phase 5: Visual Verification & Checkpoint
1164
1165 Generating checkpoint...
1166
1167 Execution summary:
1168 - [N] components created
1169 - [M] tests created (all passing)
1170 - [K] API endpoints integrated
1171
1172 Visual verification:
1173 ✅ Feature tested locally
1174 ✅ Screenshots captured
1175 ✅ UX parity confirmed
1176
1177 ✅ Created: docs/frontend/checkpoints/CHECKPOINT-epic-X.Y-[name].md
1178 ✅ Updated: docs/frontend/progress.json
1179
1180 Proceeding to Gate 2 (Final Approval)...
1181 ```
1182
1183---
1184
1185### GATE 2: Human Approval (Post-Checkpoint)
1186
1187**Purpose:** Human reviews checkpoint and approves epic completion.
1188
1189**Steps:**
1190
11911. **Display gate header**
1192
1193 ```
1194 ═══════════════════════════════════════════════════════════
1195 EPIC X.Y EXECUTION COMPLETE
1196 ═══════════════════════════════════════════════════════════
1197 ```
1198
11992. **Display checkpoint summary**
1200
1201 ```
1202 Checkpoint Generated:
1203 📋 docs/frontend/checkpoints/CHECKPOINT-epic-X.Y-[name].md
1204
1205 Components Created: [N] total
1206 ✅ [X] React components
1207 ✅ [Y] Custom hooks
1208 ✅ [Z] Zustand stores
1209 ✅ [W] API services
1210 ✅ All with tests (100% passing)
1211 ```
1212
12133. **Display visual verification status**
1214
1215 ```
1216 Visual Verification:
1217 ✅ Feature tested locally
1218 ✅ Screenshots captured and compared
1219 ✅ UX parity with MidsReborn confirmed
1220 ✅ No console errors
1221 ```
1222
12234. **Display gate instructions**
1224
1225 ```
1226 ═══════════════════════════════════════════════════════════
1227 NEXT: Review checkpoint and approve to continue
1228
1229 Please review:
1230 1. Checkpoint document (see all components and tests)
1231 2. Visual verification (side-by-side screenshots)
1232 3. Test coverage (all tests passing?)
1233 4. Feature functionality (does it work correctly?)
1234
1235 Type 'approved - proceed to Epic X.Y+1' to complete
1236 Type 'approved with changes: [details]' to revise
1237 Type 'request revision: [what needs to change]' to fix issues
1238 ═══════════════════════════════════════════════════════════
1239 ```
1240
12415. **Wait for human response**
1242
1243 - Listen for: "approved", "approved - proceed to Epic X.Y+1"
1244 - If "approved with changes": Note changes, offer to revise
1245 - If "request revision": Note issues, offer to re-run phases
1246
12476. **Final epic completion**
1248
1249 a. Update progress tracking final timestamp
1250
1251 b. Display completion message:
1252
1253 ```
1254 ═══════════════════════════════════════════════════════════
1255 ✅ EPIC X.Y COMPLETE
1256 ═══════════════════════════════════════════════════════════
1257
1258 Summary:
1259 - MidsReborn Analysis: [N] Forms analyzed
1260 - Planning: Complete
1261 - Execution: [M] components + [K] tests created
1262 - Visual Verification: ✅ Passed
1263 - Checkpoint: Approved
1264
1265 Next Epic: X.Y+1 - [Epic Name]
1266
1267 Ready to run: /frontend-development epic-X.Y+1
1268
1269 ═══════════════════════════════════════════════════════════
1270 ```
1271
1272---
1273
1274## Error Handling
1275
1276### Prerequisite Errors
1277
1278**MidsReborn codebase missing:**
1279
1280```
1281ERROR: MidsReborn codebase not found.
1282
1283Expected: /Users/w/code/mids-hero-web/external/dev/MidsReborn
1284
1285This is required for UI analysis.
1286```
1287
1288**Previous epic missing:**
1289
1290```
1291ERROR: Previous epic not complete.
1292
1293Cannot find: docs/frontend/plans/PLAN-SUMMARY-epic-[X.Y-1].md
1294
1295Complete Epic [X.Y-1] first.
1296```
1297
1298### Analysis Hook Errors
1299
1300**Sub-agent timeout:**
1301
1302```
1303ERROR: MidsReborn UI analysis sub-agent timed out.
1304
1305Options:
13061. Type 'retry' to run analysis again
13072. Type 'abort' to stop
1308```
1309
1310**Analysis output file missing:**
1311
1312```
1313ERROR: Analysis sub-agent completed but did not create output file.
1314
1315Expected: docs/frontend/analysis/MIDSREBORN-UI-ANALYSIS-epic-X.Y.md
1316
1317Options:
13181. Type 'retry' to run analysis again
13192. Type 'abort' to stop
1320```
1321
1322### Visual Verification Errors
1323
1324**Component doesn't render:**
1325
1326```
1327ERROR: Component failed to render during visual verification.
1328
1329Check console for errors and fix before proceeding.
1330
1331Options:
13321. Type 'fix and retry' to debug and re-run Phase 4
13332. Type 'abort' to stop
1334```
1335
1336**Tests failing:**
1337
1338```
1339ERROR: Tests are failing.
1340
1341[Test output]
1342
1343All tests must pass before proceeding to checkpoint.
1344
1345Options:
13461. Type 'fix and retry' to fix tests and re-run
13472. Type 'abort' to stop
1348```
1349
1350---
1351
1352## Notes
1353
1354- Modeled after `verified-stage-development` skill
1355- Frontend-specific adaptations for React/Next.js
1356- Visual verification is mandatory (not optional)
1357- Every component must have tests (TDD enforced)
1358- MidsReborn UI analysis informs all design decisions
1359
1360---