import { describe, it, expect } from 'vitest'; import { parsePlan, parseTasks, extractFrontmatter } from './plan-parser.js'; // ─── Fixtures ──────────────────────────────────────────────────────────────── const FULL_PLAN = `--- phase: 03-features plan: 01 type: execute wave: 2 depends_on: [01-01, 01-02] files_modified: [src/models/user.ts, src/api/users.ts, src/components/UserList.tsx] autonomous: true requirements: [R001, R003] must_haves: truths: - "User can see existing messages" - "User can send a message" artifacts: - path: src/components/Chat.tsx provides: Message list rendering min_lines: 30 - path: src/app/api/chat/route.ts provides: Message CRUD operations key_links: - from: src/components/Chat.tsx to: /api/chat via: fetch in useEffect pattern: "fetch.*api/chat" --- Implement complete User feature as vertical slice. Purpose: Self-contained user management that can run parallel to other features. Output: User model, API endpoints, and UI components. @~/.claude/get-shit-done/workflows/execute-plan.md @~/.claude/get-shit-done/templates/summary.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md # Only include SUMMARY refs if genuinely needed @src/relevant/source.ts Task 1: Create User model src/models/user.ts src/existing/types.ts, src/config/db.ts Define User type with id, email, name, createdAt. Export TypeScript interface. tsc --noEmit passes - User type is exported from src/models/user.ts - Type includes id, email, name, createdAt fields User type exported and usable Task 2: Create User API endpoints src/api/users.ts, src/api/middleware.ts GET /users (list), GET /users/:id (single), POST /users (create). Use User type from model. fetch tests pass for all endpoints All CRUD operations work Verify UI visually src/components/UserList.tsx Start dev server and present for review. User confirms layout is correct Visual verification passed - [ ] npm run build succeeds - [ ] API endpoints respond correctly - All tasks completed - User feature works end-to-end `; const MINIMAL_PLAN = `--- phase: 01-test plan: 01 type: execute wave: 1 depends_on: [] files_modified: [] autonomous: true requirements: [] must_haves: truths: [] artifacts: [] key_links: [] --- Minimal test plan. Single task output.txt Create output.txt test -f output.txt File exists `; const MULTILINE_ACTION_PLAN = `--- phase: 02-impl plan: 01 type: execute wave: 1 depends_on: [] files_modified: [src/server.ts] autonomous: true requirements: [R005] must_haves: truths: [] artifacts: [] key_links: [] --- Build server with config src/server.ts Create the Express server with the following setup: 1. Import express and configure middleware 2. Add routes for health check and API 3. Configure error handling with proper types: - ValidationError => 400 - NotFoundError => 404 - Default => 500 Example code structure: \`\`\`typescript const app = express(); app.get('/health', (req, res) => { res.json({ status: 'ok' }); }); \`\`\` Make sure to handle the edge case where \`req.body\` contains angle brackets like