一键导入
feature-worker
Full-stack feature development for Complete Care — database, server actions, API routes, and UI. MUST invoke the frontend-design skill for all UI work.
菜单
Full-stack feature development for Complete Care — database, server actions, API routes, and UI. MUST invoke the frontend-design skill for all UI work.
| name | feature-worker |
| description | Full-stack feature development for Complete Care — database, server actions, API routes, and UI. MUST invoke the frontend-design skill for all UI work. |
The primary workhorse for the Complete Care UK care management platform. Handles full-stack feature development end-to-end: database schema additions, server actions, API routes, and all frontend UI. Responsible for ~90% of features in the backlog.
CRITICAL: This worker MUST invoke the frontend-design skill (via the Skill tool) before writing ANY frontend or UI code. Every component, page, layout, form, table, and dashboard element must go through the frontend-design skill to ensure beautiful, modern, intuitive design. This is non-negotiable.
| Layer | Technology |
|---|---|
| Runtime | Bun |
| Framework | Next.js 15 (App Router) |
| Database | Vercel Postgres (Neon) |
| ORM | Drizzle ORM |
| Auth | Auth.js v5 |
| AI | AWS Bedrock |
| Payments | Stripe |
| Styling | Tailwind CSS + shadcn/ui |
| Forms | react-hook-form + zod |
| Testing | Vitest + React Testing Library |
| Language | TypeScript (strict) |
Use the feature-worker for any task that involves both backend logic and frontend UI, including:
Do NOT use for pure infrastructure tasks (database-only schema, auth config, middleware) — those belong to the infrastructure-worker.
| Skill | Purpose | When Invoked |
|---|---|---|
frontend-design | Ensures beautiful, modern, intuitive UI/UX for all frontend code | Before writing ANY UI component, page, or layout |
The frontend-design skill MUST be invoked via the Skill tool before any frontend work begins. This applies to:
.factory/library/ files for project conventions, directory structure, component patterns, and architectural decisions..factory/research/tech-stack-patterns.md for Drizzle, Auth.js, and Next.js patterns..factory/research/platform-features.md for care domain workflows and data requirements..factory/research/emar-clinical-standards.md if the feature involves medication management..factory/research/regulatory-compliance.md if the feature has compliance implications.$inferSelect, $inferInsert).bun run db:generate.src/app/ co-located with their routes, or in src/actions/ for shared actions.frontend-design SkillBefore writing ANY UI code, invoke the frontend-design skill:
Invoke Skill: frontend-design
Provide the skill with:
Follow the skill's guidance for:
Following the frontend-design skill's guidance:
"use client" only when needed (forms, interactive state, event handlers).Run all verification commands:
bun run typecheck # TypeScript strict mode — zero errors
bun run lint # ESLint — zero warnings/errors
bun run test # Vitest — all tests pass
For database changes, also verify:
bun run db:generate # Generate Drizzle migration SQL
If the feature has UI, use the agent-browser skill to:
Write a clear, descriptive commit message:
feat(visits): add visit scheduling page with drag-and-drop rota builder
- visits and visit_tasks Drizzle schema with carer/client FK relations
- createVisit, updateVisit, deleteVisit server actions with zod validation
- weekly rota view with drag-and-drop carer assignment (dnd-kit)
- visit detail sheet with task checklist and care notes
- conflict detection: double-booking, travel time, skills mismatch warnings
- 23 tests covering scheduling logic, form validation, and component rendering
{
"status": "completed",
"feature": "Medication Administration (eMAR) — recording and dashboard",
"filesChanged": [
"src/db/schema/medications.ts",
"src/db/schema/medication-administrations.ts",
"src/db/migrations/0007_add_emar_tables.sql",
"src/actions/medications.ts",
"src/actions/medication-administrations.ts",
"src/app/(dashboard)/[orgSlug]/clients/[clientId]/medications/page.tsx",
"src/app/(dashboard)/[orgSlug]/clients/[clientId]/medications/loading.tsx",
"src/app/(dashboard)/[orgSlug]/clients/[clientId]/medications/error.tsx",
"src/components/medications/medication-list.tsx",
"src/components/medications/medication-form.tsx",
"src/components/medications/administration-record.tsx",
"src/components/medications/emar-chart.tsx",
"src/components/medications/medication-due-badge.tsx",
"tests/actions/medications.test.ts",
"tests/actions/medication-administrations.test.ts",
"tests/components/medications/medication-list.test.tsx",
"tests/components/medications/medication-form.test.tsx",
"tests/components/medications/emar-chart.test.tsx"
],
"summary": "Implemented the eMAR (electronic Medication Administration Record) feature for recording and viewing medication administration. Database schema includes medications table (drug name, dosage, route, frequency, PRN flag, prescriber, start/end dates) and medication_administrations table (scheduled time, actual time, status enum [given/refused/omitted/withheld/self-administered], witness requirement, notes, administering carer FK). Server actions handle CRUD for medications and recording administrations with strict validation — refuses recording outside the ±60 minute administration window, enforces witness signatures for controlled drugs, and requires reason codes for refused/omitted/withheld statuses per CQC guidelines. UI built following frontend-design skill guidance: medication list with colour-coded due-status badges (green=given, amber=due-soon, red=overdue, grey=not-yet-due), administration recording form with real-time validation, and a 7-day eMAR chart view matching the paper MAR chart format care staff are familiar with. All components use shadcn/ui with Tailwind CSS. 31 tests covering schema constraints, administration window logic, controlled drug witness flow, CQC reason codes, component rendering, and form validation. Typecheck, lint, and all tests pass.",
"skillsInvoked": ["frontend-design"],
"testResults": {
"total": 31,
"passed": 31,
"failed": 0
},
"verificationCommands": [
"bun run typecheck — 0 errors",
"bun run lint — 0 warnings",
"bun run test -- tests/actions/medications.test.ts — 9 passed",
"bun run test -- tests/actions/medication-administrations.test.ts — 8 passed",
"bun run test -- tests/components/medications/medication-list.test.tsx — 5 passed",
"bun run test -- tests/components/medications/medication-form.test.tsx — 5 passed",
"bun run test -- tests/components/medications/emar-chart.test.tsx — 4 passed",
"bun run db:generate — migration 0007_add_emar_tables.sql generated"
],
"browserVerification": [
"Navigated to /acme-care/clients/1/medications — page loads with medication list",
"Added new medication via form — validation works, saved successfully",
"Recorded administration — time window enforced, status badge updated to green",
"Viewed eMAR chart — 7-day grid renders correctly with all status colours",
"Responsive check at 768px — table scrolls horizontally, form stacks vertically"
],
"commitHash": "e8b4f19",
"commitMessage": "feat(emar): add medication administration recording and eMAR chart"
}
Return to the orchestrator when: