Purpose
Systematically implement approved plans using small, test-backed changes that respect RE-Engine's architecture, TypeScript strict mode, and production deployment requirements.
Prerequisites
- •✅ Approved plan exists in
plans/YYYY-MM-DD-target.md - •✅ Repository documentation is current (run @mcp-repo-scan if uncertain)
- •✅ No uncommitted changes exist
- •✅ All tests pass on current state:
npm test && npm run test:integration
Implementation Strategy
Follow iterative, test-driven approach:
- •Work one plan step at a time
- •Make minimal, focused changes
- •Test after each change
- •Commit frequently with descriptive messages
- •Document decisions inline
Execution Phase
1. Environment Setup
Steps:
- •Ensure on correct branch (usually
develop) - •Pull latest changes:
git pull origin develop - •Install dependencies if needed:
npm install - •Verify build:
npm run build - •Verify tests:
npm test && npm run test:integration
2. Iterative Implementation
For each step in the approved plan:
Step A: Code Changes
- •
Identify target files from plan
- •
Follow existing patterns and conventions:
- •Respect TypeScript strict mode
- •Follow error handling patterns
- •Use existing utility functions where applicable
- •Maintain consistent naming conventions
- •
Make minimal changes to achieve goal
- •
Add inline comments for complex logic
- •
Ensure code is testable
Step B: Unit Testing
- •Create or update unit tests for changed code
- •Test edge cases and error conditions
- •Verify test coverage for new code
- •Run tests:
npm testin affected component - •Fix any failures before proceeding
Component-Specific Testing:
- •Engine: Test service methods, API handlers, business logic
- •Web-Dashboard: Test React components, hooks, API calls
- •Playwright: Test automation scenarios, page interactions
- •MCP Servers: Test tool handlers, input validation, error responses
Step C: Integration Testing
- •Test integration with other components
- •Verify data flow between components
- •Test API endpoints (if applicable)
- •Run integration tests:
npm run test:integration - •Fix any failures
Step D: Type Checking & Linting
- •Run type checker:
npm run typecheck - •Fix any TypeScript errors
- •Run linter:
npm run lint - •Fix any linting issues
- •Run formatter:
npm run format - •Verify code style compliance
Step E: Commit Changes
- •Stage changed files:
git add <files> - •Write descriptive commit message following conventional commits:
- •
feat:for new features - •
fix:for bug fixes - •
refactor:for code refactoring - •
docs:for documentation changes - •
test:for test changes - •
chore:for maintenance tasks
- •
- •Commit:
git commit -m "descriptive message"
3. MCP Integration (If Applicable)
If Adding/Modifying MCP Tools:
- •Define tool schema in MCP server
- •Implement tool handler with error handling
- •Add unit tests for tool logic
- •Test tool invocation locally
- •Document tool in
docs/MCP_SERVERS.md
If Creating New MCP Server:
- •Create directory:
mcp/mcp-reengine-<name>/ - •Initialize with package.json
- •Define tool schemas
- •Implement tool handlers
- •Add test scripts
- •Document in
docs/MCP_SERVERS.md
MCP Testing:
- •Start MCP servers:
npm run mcp:start - •Test tool calls from Cascade or test scripts
- •Verify tool responses match schema
- •Test error conditions
- •Document any changes needed
4. Cross-Component Testing
After all component changes:
- •Run full test suite in each component:
bash
cd engine && npm test && cd - cd web-dashboard && npm test && cd - cd playwright && npm test && cd - cd mcp/mcp-reengine-core && npm test && cd - cd mcp/mcp-reengine-browser && npm test && cd - cd mcp/mcp-reengine-tinyfish && npm test && cd -
- •Run integration tests:
npm run test:integration - •Verify Playwright tests:
npm run test:e2e(if applicable) - •Verify build:
npm run build
5. Documentation Updates
Update Documentation Files:
- •
Update
docs/CHANGELOG.md:- •Add entry with date, category, and description
- •Link to relevant PRs or commits
- •Note any breaking changes
- •
Update
docs/ARCHITECTURE.md(if structure changed):- •Document new components or patterns
- •Update component responsibilities
- •Add diagrams if helpful
- •
Update
docs/FLOWS.md(if workflows changed):- •Document new or modified flows
- •Update flow diagrams
- •Note any user-facing changes
- •
Update
docs/MCP_SERVERS.md(if MCP changed):- •Document new tools or servers
- •Update tool descriptions
- •Add usage examples
- •
Update inline documentation:
- •Add JSDoc comments for new public APIs
- •Update existing comments for clarity
- •Document complex algorithms
6. Quality Gates
Verify All Quality Requirements:
- •TypeScript: No type errors (
npm run typecheck) - •Linting: No linting errors (
npm run lint) - •Tests: All tests pass (
npm test && npm run test:integration) - •Build: Successful build (
npm run build) - •Security: No vulnerabilities (
npm audit)
If Quality Gates Fail:
- •Analyze failures
- •Fix issues
- •Re-run tests
- •Document fixes in commit messages
7. Commit & Push
Final Commit:
- •Stage all changes:
git add . - •Review changes:
git status - •Create final commit:
bash
git commit -m "feat: implement <feature> - Add <specific changes> - Update <relevant files> - Add tests for <new functionality> Closes: <issue number if applicable>"
- •Push to branch:
git push origin <branch-name>
8. Pull Request Preparation
Create PR Description:
- •Use template from PR_DESCRIPTION.md
- •Link to plan:
plans/YYYY-MM-DD-target.md - •Summarize changes
- •List breaking changes (if any)
- •Note testing performed
- •Request specific review focus areas
PR Checklist:
- •✅ All tests passing
- •✅ Documentation updated
- •✅ Type-checking clean
- •✅ Linting clean
- •✅ No security vulnerabilities
- •✅ Build successful
- •✅ Changes align with plan
9. Post-Implementation Review
Verify Implementation:
After implementation complete:
- •Run full test suite again
- •Verify all components build
- •Test end-to-end flows
- •Verify MCP integration (if applicable)
- •Document any lessons learned
Present to User:
Provide implementation summary:
- •Changes made
- •Tests passed
- •Documentation updated
- •Any deviations from plan
- •Next steps (testing, review, deployment)
- •Request user approval for next phase (testing, PR, or deployment)
Supporting Files:
- •
.windsurf/skills/mcp-implement-plan/commit-template.md - •
.windsurf/skills/mcp-implement-plan/test-strategy.md - •
.windsurf/skills/mcp-implement-plan/mcp-testing-guide.md - •
.windsurf/skills/mcp-implement-plan/quality-gate-checklist.md