Frontend Worker
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
When to Use This Skill
Use for features that involve React component changes, UI additions, styling, and client-side logic in a Next.js app with shadcn/radix components.
Work Procedure
- Read reference files first. Before any code changes, read at least 3 similar files to understand the patterns. The feature description lists specific reference files — read ALL of them.
- Plan the changes. Based on the reference files, plan exactly what imports, hooks, handlers, and JSX you need to add. Do not guess patterns — copy from existing code.
- Implement the changes. Make the edits following the exact patterns found in reference files. Key rules:
- Use
resolveActionResultto call server actions - Use
useMutationfrom@tanstack/react-queryfor mutations - Use
dialogManager.confirm()for delete confirmations - Use
dialogManager.input()for rename dialogs - Use
useQueryClient+invalidateQueriesfor cache invalidation - Use
toastfromsonnerfor success/error messages - Stop event propagation on menu triggers inside Links:
e.preventDefault(); e.stopPropagation();
- Run verification commands:
pnpm ts— must pass with zero errorspnpm lint— must passvitest run— existing tests must pass
- Fix any errors found in step 4 before completing.
Example Handoff
{
"salientSummary": "Added ContextMenu and DropdownMenu with Rename/Delete to ThumbnailCard. Both menus share the same handlers using dialogManager.input() for rename and dialogManager.confirm() for delete. Ran tsc --noEmit (0 errors), eslint (clean), vitest run (all passing).",
"whatWasImplemented": "Added hover-reveal '...' DropdownMenu button and right-click ContextMenu to ThumbnailCard in thumbnails-page-client.tsx. Rename uses dialogManager.input() + updatePromptNameAction. Delete uses dialogManager.confirm() + deletePromptAction. Both invalidate promptKeys.all on success.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{ "command": "pnpm ts", "exitCode": 0, "observation": "No type errors" },
{ "command": "pnpm lint", "exitCode": 0, "observation": "No lint errors" },
{ "command": "pnpm test:ci", "exitCode": 0, "observation": "All 12 tests passing" }
],
"interactiveChecks": []
},
"tests": {
"added": []
},
"discoveredIssues": []
}
When to Return to Orchestrator
- A server action needed for the feature does not exist yet
- The UI component (e.g., context-menu.tsx) is missing and needs to be installed first
- TypeScript errors that cannot be resolved by reading existing patterns
- Import paths that don't resolve (missing modules/exports)