Files
portfolio/.ralph/ralph-loop.state.json
T

13 lines
6.8 KiB
JSON

{
"active": true,
"iteration": 6,
"minIterations": 1,
"maxIterations": 0,
"completionPromise": "COMPLETE",
"tasksMode": false,
"taskPromise": "READY_FOR_NEXT_TASK",
"prompt": "# Ralph Wiggum Loop - Iteration Prompt\n\nYou are operating inside an automated loop. Each iteration you receive fresh context - you have NO memory of previous iterations. Your only persistence is the filesystem.\n\nYou are implementing **Design 7: The Clinical Record** — a Patient Medical Record (PMR) system that presents Andy's CV as a clinician would view a patient record. This is a complete redesign from the previous ECG Heartbeat concept.\n\n**The Concept:**\nThe \"patient\" is Andy's career. Users navigate a genuine NHS clinical software interface (similar to EMIS Web, SystmOne, Vision) with a patient banner, sidebar navigation, consultation journal, medications table, clinical alerts, and a login sequence. The design works on two levels: clinicians recognize the interface immediately; recruiters get a novel, information-dense presentation.\n\n## Your Task This Iteration\n\n1. **Use the /frontend-design skill** (REQUIRED for visual components): Before writing ANY code for components that involve visual design, styling, animations, or UI elements, you MUST invoke the `/frontend-design` skill. This includes: LoginScreen, PatientBanner, ClinicalSidebar, ClinicalAlert, all View components (Summary, Consultations, Medications, Problems, Investigations, Documents, Referrals), and any table, card, or form component.\n\n2. **Read the plan**: Open `IMPLEMENTATION_PLAN.md` and find the highest-priority unchecked item (`- [ ]`). Items are listed in priority order - pick the first unchecked one.\n\n3. **Read accumulated learnings**: Open `progress.txt` and read the \"Codebase Patterns\" section. This contains learnings from previous iterations about PMR design system, data architecture, animation approach, and clinical system authenticity.\n\n4. **Read guardrails**: Open `guardrails.md` and read ALL guardrails. These are hard rules you MUST follow. Key guardrails include:\n - Light-mode only (clinical systems don't have dark mode)\n - Instant view switching (no animations between views)\n - Proper semantic table markup for all data tables\n - Traffic lights must always have text labels\n - Exact NHS blue color (#005EB8)\n - ECG must end with flatline (not fade to white)\n - Login typing animation specifics\n - Consultation History/Examination/Plan format\n - Coded entries in [XXX000] format\n\n5. **Implement the item**: Complete the single task you selected. Keep changes focused - one task per iteration. Write production-quality React/TypeScript code that faithfully reproduces a clinical information system. This is a design showcase requiring absolute thematic fidelity.\n\n6. **Run quality checks**: Execute the quality check commands listed in `IMPLEMENTATION_PLAN.md` under \"Quality Checks\". Fix any issues before proceeding.\n\n7. **Commit your changes**: Stage and commit all changes with a descriptive message referencing the task you completed.\n\n8. **Mark the item complete**: In `IMPLEMENTATION_PLAN.md`, change the item from `- [ ]` to `- [x]`.\n\n9. **Update progress.txt**: Append to the \"Iteration Log\" section with:\n - Which task you completed\n - Any learnings or codebase patterns discovered (add to \"Codebase Patterns\" section)\n - Any issues encountered\n - Design decisions made (if visual component)\n\n10. **Commit the progress update**: Stage and commit the updated `IMPLEMENTATION_PLAN.md` and `progress.txt`.\n\n11. **Determine if another iteration is needed**: Review your work and the codebase. The project needs another iteration if ANY of these are true:\n - Any task in the checklist is unchecked (`- [ ]`) or blocked (`- [B]`)\n - Quality checks would fail (run them to verify)\n - There are uncommitted changes\n - progress.txt has open questions or guidance for \"next iteration\"\n - The implementation doesn't fully satisfy the plan requirements\n - You have lingering doubts about correctness or completeness\n\n12. **Send completion signal ONLY if truly complete**: If and ONLY if the project definitely does NOT need another iteration — all tasks verified done, quality checks pass, no guidance for next iteration — output this exact signal on its own line:\n\n```\n<promise>COMPLETE</promise>\n```\n\nDO NOT output this string if there's any chance another iteration is needed. When in doubt, do NOT send the promise — leave it for the next iteration to determine.\n\n## Critical Rules\n\n- **ALWAYS invoke /frontend-design skill before writing visual component code** — this is mandatory for all UI components\n- **Only work on ONE task per iteration**\n- **Always read progress.txt AND guardrails.md before starting** — previous iterations may have left important context\n- **If a task is blocked or unclear**, document why in progress.txt and move to the next unchecked item\n- **Keep commits atomic and well-described**\n- **If quality checks fail, fix the issues before committing**\n- **The visual quality bar is HIGH** — this must look like real clinical software\n- **Preserve clinical system authenticity** — instant navigation, proper tables, NHS blue, coded entries, traffic lights\n- **Use TypeScript strictly** — no `any` types, proper interfaces for all PMR data structures\n- **Follow the established project structure** — components in `src/components/`, data in `src/data/`, types in `src/types/`\n- **Respect prefers-reduced-motion** — animations must have instant fallbacks\n\n## Reference Files\n\n- `designs/07-the-clinical-record.md` — Complete design specification with all visual details, animations, and interactions\n- `References/CV_v4.md` — Source CV content (roles, achievements, numbers, dates)\n- `References/concept.html` — Previous ECG implementation (timing reference only for boot sequence)\n\n## Design Document Highlights\n\n**Color Palette (Light-mode only):**\n- Main content: `#F5F7FA`\n- Cards: `#FFFFFF`\n- Sidebar: `#1E293B`\n- NHS blue: `#005EB8`\n- Green (active): `#22C55E`\n- Amber (alerts): `#F59E0B`\n\n**Typography:**\n- Inter for general text\n- Geist Mono for coded entries and data values\n\n**Key Interactions:**\n- Login sequence: typing username/password character-by-character\n- Clinical alert: slides down, acknowledges with checkmark → collapse\n- Consultation entries: expand/collapse with History/Examination/Plan\n- Medications table: sortable columns, expandable prescribing history\n- Sidebar: instant view switching, no animations\n\n**Responsive Strategy:**\n- Desktop (>1024px): 220px sidebar with labels\n- Tablet (768-1024px): 56px icon-only sidebar\n- Mobile (<768px): Bottom navigation bar\n",
"startedAt": "2026-02-11T01:23:49.238Z",
"model": "openrouter/openrouter/pony-alpha",
"agent": "opencode"
}