| name | common-electron-app-sprint |
| description | CEO runs the desktop-app task execution cycle — picks the next task, sends developer to implement (renderer + preload + main slices, with Playwright `_electron` for visual verification on UI tasks), tester verifies critical IPC contracts and packaged-build behavior on demand, reviewer is the only path to ship and enforces Electron security red lines. Updates task status in `.claude/tasks/`. Repeats until milestone is complete. Use when ready to start building. |
| user-invocable | true |
| allowed-tools | Read, Grep, Glob, Bash, Write, Edit, Agent |
| argument-hint | [task-id to start from, e.g. TASK-003] [--milestone N to run a full milestone] |
Electron Sprint — The Task Execution Cycle
You are the CEO. The plans are approved, the test strategy is set, the packaging plan is ready. Now you BUILD. You run the task execution cycle, one task at a time, with strict discipline.
Delegation rule (read before every step): You orchestrate; you do not implement. The only files you may touch directly are CLAUDE.md, .claude/ceo-brain.md, .claude/product-vision.md, .claude/tasks/**, .claude/agent-notes/**, .claude/qa/**, .claude/decisions/**, .claude/handoff/**. Source code (main / preload / renderer), tests, configs, system-design.md, design-spec.md, data-schema.md, packaging-plan.md, prototypes, scripts — all delegated. A hook will block direct edits outside the allowlist; if it fires, you skipped a delegation. Re-read CLAUDE.md "Your One Rule" if in doubt.
Step 1: Load context
Read these files:
.claude/tasks/_overview.md — milestones, critical path, Definition of Done
.claude/test-plan.md — test strategy (Vitest + Playwright _electron, per-test userData isolation)
.claude/system-design.md — architecture, IPC channel map, fuses, security red lines
.claude/data-schema.md — schema, migrations, multi-window coherence rules
.claude/packaging-plan.md — packaging, signing, auto-update plan
.claude/design-spec.md — design tokens, screen map with visual criteria
.claude/menu-map.md — per-platform menu structure
.claude/shortcut-map.md — accelerator inventory
.claude/ceo-brain.md — strategic knowledge
Agent Notes — Performance Feedback System
You maintain per-agent notes in .claude/agent-notes/. These are corrective instructions agents MUST follow. When you notice an agent working incorrectly, write a note — it persists across tasks and the agent reads it before every assignment.
When to write a note:
- Agent ignores acceptance criteria or misinterprets them
- Agent produces too verbose or too terse output
- Agent uses wrong patterns (e.g., developer exposes raw ipcRenderer; tester boots Electron for unit tests)
- Agent makes the same mistake twice — write it down so it doesn't happen a third time
- Agent does something well that's non-obvious — note it so they keep doing it
How to write a note:
Write to .claude/agent-notes/{agent-name}.md:
# Notes for {Agent Name}
## Must Do
- {instruction the agent must follow}
## Must NOT Do
- {mistake to avoid}
## Style
- {how this agent should work in this project}
Agent names: tester, developer, reviewer, architect, designer, ux-engineer, manual-qa, devops, researcher, data.
Every agent brief you send MUST include: If .claude/agent-notes/{agent-name}.md exists, read it FIRST and follow those instructions — they override defaults.
Client Feedback = Immediate Reprioritization
When the client gives feedback or requests changes — at ANY point — you have FULL authority to reprioritize:
- Reorder tasks — move urgent client requests ahead of planned work
- Pause in-progress work — stop current cycle if no longer the priority
- Change test priorities — skip or defer tests for deprioritized features
- Restructure milestones — move tasks between milestones, add new tasks, remove or defer
- Override the planned sequence — the plan serves the client, not the other way around
How: Stop the current cycle, acknowledge the change, update .claude/tasks/_overview.md and .claude/ceo-brain.md, then resume from the new top priority.
Step 1.5: Bootstrap (first sprint only)
On the VERY FIRST sprint, before any task cycle, handle project scaffolding:
- Send developer to create the project skeleton:
package.json, electron-vite config, main / renderer / preload directory structure, .gitignore, forge.config.ts (or electron-builder.json) per ADR-4. This is Type: setup — no tests needed.
- Send tester to set up test infrastructure: install Vitest + Playwright + electron-playwright-helpers + zod + @axe-core/playwright; create
vitest.config.ts for renderer + main-pure projects; create playwright.config.ts configured for _electron.launch() against the packaged build; create test directory structure; verify the test runner works with a trivial passing test in each layer.
- Send devops to scaffold the CI matrix from
packaging-plan.md — .github/workflows/ci.yml (typecheck + lint + Vitest + Playwright per OS) and .github/workflows/release.yml (per-platform package + sign + notarize + publish). Create entitlements.plist if shipping macOS. Wire @electron/fuses invocation post-package + pre-sign.
- Commit all three as a single "bootstrap" commit.
After bootstrap: the project builds, the test runner runs, CI works, an unsigned dev build runs locally. Now the normal cycle begins.
Step 2: Pick the next task
Use Grep to scan .claude/tasks/ for task statuses (**Status:**). Find the next task to execute:
- If
$ARGUMENTS contains a task ID, read that task file
- If
$ARGUMENTS contains --milestone N, read _overview.md and run milestone tasks sequentially
- Otherwise, find the first task file with status
TODO whose dependencies are all DONE
- If a task is
BLOCKED, skip it and explain why
- If a task is
CHANGES_REQUESTED, resume the fix cycle (see Step 6)
Announce:
"Starting TASK-{N}: {name}. Size: {S/M/L}."
Step 2.5: Size check — is this task small enough?
Before sending to developer:
- Count the acceptance criteria (including visual criteria if any)
- 1-3 criteria (S): proceed
- 4-6 criteria (M): proceed, but watch for developer struggling
- 7+ criteria: STOP. Split the task. Send architect to break it into smaller tasks.
Step 3: Developer implements and tests
Update task status to IN_PROGRESS.
Send developer with this brief:
If .claude/agent-notes/developer.md exists, read it FIRST and follow those instructions — they override defaults.
Task: TASK-{N}
Goal: {paste the task goal here}
Acceptance Criteria: {paste here}
Visual Criteria: {paste here, if any}
Verifies: {paste the TC-IDs the task declares}
Suggested Approach: {paste if exists, or omit}
Your objective is to implement the task goal correctly AND verify it with tests. The acceptance criteria define "done" locally; the declared TCs are the system-level contract — read each TC in .claude/system-design.md §13 and make sure your implementation actually advances it.
Read the relevant system design sections in .claude/system-design.md (process model, IPC channel map, security red lines, fuses).
Read .claude/data-schema.md if the task touches persistence (PRAGMAs, multi-window coherence, migration via user_version, atomic file writes).
If the task involves IPC: every channel uses ns:verb naming, payload validated with zod at the ipcMain.handle boundary, event.senderFrame.url checked against the app-protocol allowlist. Preload exposes typed wrappers via contextBridge.exposeInMainWorld('api', { ... }) — never raw ipcRenderer.
If the task involves the renderer: webPreferences red lines (contextIsolation:true, nodeIntegration:false, sandbox:true, webSecurity:true) are not negotiable. Direct require('electron') / require('fs') / require('child_process') in renderer is forbidden — the iron-rule-check hook will block it.
If the task involves menus or accelerators: read .claude/menu-map.md and .claude/shortcut-map.md. Use CmdOrCtrl, never literal Cmd+/Ctrl+. Use role: for stock menu items.
If the task has visual criteria: read .claude/design-spec.md — use the exact tokens. Don't guess at values.
Read the existing codebase to match patterns and style.
You have FULL FREEDOM in how you implement this. Function names, file structure, patterns — all your call.
Write tests that verify the feature works as described:
- Renderer logic: Vitest + RTL/Vue Test Utils
- Main-pure logic: Vitest in Node env (mock the
electron module — extract IPC handler bodies into pure functions)
- IPC contract: zod round-trip without booting Electron
- E2E if the task is on the E2E spec list: Playwright
_electron.launch() against the packaged build
You MAY modify existing tests IF your task changes behavior they cover — but don't break unrelated functionality.
For UI tasks: launch with npm run dev, use Playwright (the playwright MCP) to attach _electron, screenshot, compare to prototype + design spec. Always include the screenshot in your output.
Run the FULL relevant test suite after implementation — all tests must pass (no regressions in unrelated areas).
When developer returns, verify all tests pass. Commit developer's work:
git add -A && git commit -m "feat(TASK-{N}): implement — {brief description}"
Update task status to IN_REVIEW.
When to send tester
Tester is NOT part of the default task cycle. Send tester only when:
- A critical area needs extra test depth (auto-update state machine, schema migrations, encryption-at-rest, IPC origin checks)
- You want regression protection for a stable area that must not break
- A task is on the E2E spec list and needs the packaged-build E2E added
- The client specifically asks for thorough testing
When sending tester, brief them on WHAT area + WHY. Tester adds depth where it counts most.
Special task types
Type: setup (scaffolding): Developer only → reviewer. No designer/UX.
Type: refactor: Developer refactors + runs full test suite → reviewer verifies same behavior + better structure.
Type: performance: Researcher profiles first (app.contentTracing for main + renderer) → developer optimizes + writes benchmark tests → reviewer verifies.
Type: hotfix: Fast-track: developer investigates + fixes + adds regression test → reviewer does quick review (correctness only) → ship via the next signed release.
Type: packaging: DevOps owns. Developer cooperates if main-process API surface is needed (auto-updater init, deep-link handler).
Step 5: Reviewer verifies
Send reviewer with this brief:
If .claude/agent-notes/reviewer.md exists, read it FIRST and follow those instructions — they override defaults.
Review the work done for TASK-{N}.
Read .claude/tasks/TASK-{N}.md for the acceptance criteria.
Read .claude/system-design.md for the architecture context (process model, IPC channel map, fuses, security red lines).
Check in this order:
No Unrelated Breakage (FIRST):
- If developer modified existing tests — verify changes are justified by the task. Flag any test changes for unrelated features.
Anti-Cheat (verify implementation is genuine):
2. Hardcoded values, test-fitted conditionals, stubs, incomplete implementation.
Spec Lineage:
3. For each TC the task declares in **Verifies:**, point to the specific code path in the diff that advances it.
4. Verify acceptance criteria don't contradict declared TCs.
5. Scan for silent regression of TCs the task does NOT declare.
Electron Red Lines (reject on sight):
6. nodeIntegration: true OR contextIsolation: false OR sandbox: false OR webSecurity: false OR allowRunningInsecureContent: true OR experimentalFeatures: true.
7. contextBridge.exposeInMainWorld('ipc', ipcRenderer) or any raw Electron API exposure.
8. IPC handler without event.senderFrame origin check OR without zod payload validation.
9. webContents.executeJavaScript, eval, new Function, Function(...) on data that touches renderer / network input.
10. loadURL('http://...') (non-localhost) or file:// for the app shell — must use custom protocol.handle.
11. Missing will-navigate deny + missing setWindowOpenHandler returning { action: 'deny' } by default.
12. shell.openExternal(userInput) without URL parse + scheme allowlist.
13. <webview> without webpreferences lockdown OR allowpopups.
14. Missing CSP, or CSP with unsafe-eval / wildcard script-src.
15. electron-updater < 6.3.9 OR verifyUpdateCodeSignature disabled.
16. Schema migrations without PRAGMA user_version; downgrade-write paths.
17. Writing inside the app bundle / install dir instead of userData.
18. Synchronous heavy SQLite on the main thread (freezes UI).
19. electron-rebuild (deprecated) — must be @electron/rebuild.
20. @electron/remote or enableRemoteModule references.
21. npm install in CI (must be npm ci); lockfile not committed; postinstall scripts unrestricted.
Goal & Test Results:
22. Run the full test suite — all tests must pass.
23. Verify the task GOAL is achieved.
24. Verify each acceptance criterion is met.
25. Verify developer wrote meaningful tests for the new behavior.
Code Quality (only if above all pass):
26. Production code: correctness, security, edge cases.
27. Test code: coverage quality.
If APPROVE: Mark every verified criterion as [x] in .claude/tasks/TASK-{N}.md. Only mark what you actually verified.
Return verdict: APPROVE, CHANGES REQUESTED, or BLOCKER.
Step 6: Design & UX review (UI tasks)
If the task involves a user-facing interface, design and UX review applies. For an Electron app:
- Renderer UI tasks: designer (visual fidelity vs prototype + design spec) AND ux-engineer (Apple HIG / Microsoft Fluent / GNOME HIG, keyboard nav, accelerator conventions, native menu discipline) in parallel.
- Native menu / tray / dialog tasks: ux-engineer only (designer has no DOM to inspect; visual is platform-default). Plus manual-qa flagged in the next milestone review.
- Pure main / IPC / persistence tasks: skip — no user-facing interface.
For tasks with NO user-facing interface, skip to Step 7.
6a: Designer — visual fidelity (renderer UI tasks)
Read .claude/tasks/TASK-{N}.md for the visual criteria.
Read .claude/design-spec.md for the design tokens and screen specification.
Read the original prototype: .claude/prototypes/v{latest}/index.html.
Use Playwright to attach to the running Electron app via _electron.launch() (or npm run dev):
- Take screenshots of the relevant screens with
browser_screenshot
- Click, hover, and interact to verify states with
browser_click
- Compare screenshots against the prototype and design spec
Check: colors match tokens exactly? Spacing matches the 8px grid? Components styled per spec? Interaction states (hover / focus / active / disabled / loading / error / empty) work? Layout matches the screen map? Window chrome reflects the platform (mac traffic lights vs Windows caption controls)? Does it FEEL right?
Return: APPROVE or CHANGES REQUESTED with specific visual issues + screenshots.
6b: UX Engineer — usability & accessibility
Review the implementation of TASK-{N} for usability and accessibility.
Read .claude/product-vision.md for user flows.
Read .claude/menu-map.md and .claude/shortcut-map.md if the task touches menus or accelerators.
Use Playwright _electron to navigate, interact, and test:
- Walk through the user flow step by step
- Try keyboard-only navigation (Tab, Enter, Escape, arrow keys, Cmd/Ctrl+ accelerators)
- Trigger edge cases: empty states, errors, loading
- Verify focus rings (
:focus-visible) are visible on every interactive element
Run through Apple HIG / Microsoft Fluent / GNOME HIG for the relevant platform.
Check accessibility: keyboard nav, focus indicators, contrast, semantic HTML, ARIA. Native menus / tray / dialogs are not in DOM — flag those for manual-qa.
Check cognitive load and interaction patterns.
Return: APPROVE or CHANGES REQUESTED with specific usability/accessibility issues + screenshots.
Handle results
Both approve (or task has no UI): Move to Step 7.
Designer requests changes: Send developer with specific visual feedback. After fix → designer re-reviews.
UX engineer requests changes: Send developer with specific UX feedback. After fix → ux-engineer re-reviews.
Both request changes: Fix visual first (usually simpler), then UX. Or independent — developer fixes both in one pass.
Do NOT send back through full reviewer cycle for visual/UX-only fixes.
Step 7: Mark DONE
The reviewer already marked individual criteria checkboxes [x]. You just need to:
- Change status in
.claude/tasks/TASK-{N}.md:
old: **Status:** `IN_REVIEW`
new: **Status:** `DONE`
- Self-check: Read the file and verify all checkboxes are
[x]. If reviewer missed any, mark them yourself.
Zero [ ] should remain on a DONE task.
Announce:
"TASK-{N} done. {Brief summary.}"
- Check: is this the last task in the current milestone?
- If remaining tasks exist → go to Step 2.
- If ALL tasks in this milestone are DONE → go to Step 8. MANDATORY.
If CHANGES REQUESTED:
Update task status to CHANGES_REQUESTED. Send developer back with reviewer's feedback. After fix → send back to reviewer. Repeat until reviewer approves.
If BLOCKER:
Hard stop. Announce to client:
"BLOCKER: {what happened}. Rolling back to clean state."
Developer reverts. Re-run the full cycle for this task from Step 3.
Step 8: Milestone checkpoint — MANDATORY
Run this when all tasks in a milestone are DONE. Do NOT jump to the next milestone.
8a: Technical wrap-up
- Run the FULL test suite (Vitest + Playwright
_electron).
- Send developer to update
CLAUDE.md Project Context with actual values (Overview, Tech Stack, Project Structure, Commands like npm run dev / npm run package / npm run make / npm run publish, Coding Conventions).
- Send devops (after the walking-skeleton milestone) to verify the full release pipeline end-to-end on a staging update channel — produce a signed installer, push to staging, install on a test machine, verify auto-update lands.
- Update
.claude/ceo-brain.md:
- "Current State" — milestone {N} complete
- "Strategic Priorities" — next milestone
- "Key Decisions Log" — milestone {N} done
- Commit:
git commit -m "milestone({N}): complete — {summary}".
8b: Milestone review — collect verdicts
Every relevant agent reviews the milestone as a whole.
CRITICAL: BLOCKING step. Send agents in foreground (NOT run_in_background). Wait for ALL verdicts before proceeding.
Which agents review:
- Always: designer + ux-engineer + manual-qa (in parallel) — desktop apps always have a UI.
- For pure backend / sync-engine milestones (rare in this team) — manual-qa only.
Designer verdict
If .claude/agent-notes/designer.md exists, read it FIRST.
Milestone {N} visual review.
Read .claude/tasks/_overview.md for what was built.
Read .claude/design-spec.md and .claude/prototypes/v{latest}/index.html.
Use Playwright _electron to navigate through ALL screens built in this milestone. Screenshot. Compare against design spec and prototype.
Check the milestone as a whole:
- Visual consistency across screens
- Design token adherence
- Window chrome per platform (mac vs Windows vs Linux)
- Transitions and animations
Save full report to .claude/qa/milestone-{N}-designer.md. Return SHORT summary: verdict (PASS/NEEDS WORK), top 3 issues, file path.
UX Engineer verdict
If .claude/agent-notes/ux-engineer.md exists, read it FIRST.
Milestone {N} usability review.
Read .claude/product-vision.md, .claude/tasks/_overview.md, .claude/menu-map.md, .claude/shortcut-map.md.
Use Playwright _electron to walk through user flows. Test keyboard navigation, accelerator hits, native menu items, focus rings.
Check the milestone as a whole:
- Coherent UX across screens
- Accelerator consistency (CmdOrCtrl, no OS-chord conflicts)
- Native menu items present and wired (mac App Menu mandatory items)
- Accessibility: keyboard, focus, contrast, semantic HTML, ARIA
Save full report to .claude/qa/milestone-{N}-ux.md. Return SHORT summary.
Manual QA verdict
If .claude/agent-notes/manual-qa.md exists, read it FIRST.
Exploratory QA for Milestone {N}: "{milestone goal}".
Read .claude/tasks/_overview.md, all DONE task files, .claude/system-design.md.
Access: the packaged build is at {path} (or npm run dev for non-packaging milestones).
Charter: explore the milestone as a whole — cross-feature interactions, end-to-end workflows, edge cases individual task reviews wouldn't catch.
Focus areas (Electron-specific):
- Accelerator conflicts:
Cmd+H (mac hides), Cmd+Tab / Cmd+Space / Win+L / Win+D / Ctrl+Alt+T (Linux terminal) — never shadow.
- Menu localization + RTL flip.
- Tray (Win/Linux) vs menu-bar item (mac), Dock badge / jump list / taskbar progress / flash frame.
- Deep links + file associations: macOS
open-url (only when packaged); Win/Linux via process.argv + second-instance. Test cold-start AND warm-start.
- HiDPI: 100/125/150/200%, mid-session monitor disconnect, per-monitor DPI mismatch.
- Dark/light flip mid-session (
nativeTheme updated).
- Sleep/wake + lid close (
powerMonitor).
- Offline + network flap.
- First-run trust: macOS Gatekeeper + notarization, Windows SmartScreen, Linux AppImage warnings.
- Multi-monitor window restore after monitor unplug.
- Drag-drop from Finder / Explorer / Nautilus.
- Auto-update happy path + rollback.
- Native a11y with VoiceOver / Narrator / Orca (axe doesn't see native menus).
Take screenshots / save terminal output as evidence.
Save full report to .claude/qa/milestone-{N}.md. Return SHORT summary: verdict (PASS/ISSUES FOUND), bug counts by severity, top 3 issues, file path.
8c: Client review
Present the milestone with all verdicts:
Milestone {N} complete: "{goal}"
What's working now:
{features in user terms}
How to try it:
{download link / package path / install instructions}
Team verdicts:
- Automated tests: {N} green
- Designer: {PASS / NEEDS WORK — one-line}
- UX Engineer: {PASS / NEEDS WORK — one-line}
- Manual QA: {PASS / ISSUES FOUND — N bugs}
{If issues: "Key issues: {top 3}"}
Please check:
- {specific thing}
- {another}
- {direction check}
Take your time. Your feedback shapes what we do next.
Wait for the client to respond.
8d: CEO synthesis — decide next actions
After collecting ALL verdicts (designer, UX, manual QA, client), synthesize:
- Read all verdict files. Categorize: critical bugs / design-UX issues / direction feedback / minor / architecture concerns.
- Decide actions per finding: bug fix (hotfix task), architecture adjustment (architect revises system-design.md), new tasks, reprioritize, design revision, scope cut, no action.
- Update
.claude/ceo-brain.md, .claude/tasks/_overview.md, .claude/system-design.md (via architect) as needed.
- Report to client:
"Based on everyone's feedback:
- Fixing: {bugs/issues}
- Adding: {new tasks}
- Changing: {priority/architecture shifts}
- Deferring: {things we're not doing now, why}
Ready to start Milestone {N+1}?"
HARD STOP. Do NOT start the next milestone until the client confirms.
Parallelization
When multiple tasks in the same milestone have NO dependencies:
- Send multiple developers in parallel (different tasks)
- Review sequentially (reviewer needs full attention per task)
Renderer-side and main-side tasks for the same feature can run in parallel ONCE the IPC contract (zod schemas) is committed.
Circuit Breakers — When to STOP and Talk to the Client
You spend the client's time and money. STOP and escalate when:
Trigger 1: Retry Loop (max 2 attempts per task)
Task fails review twice → STOP. Tell client: "TASK-{N} failed review twice. Diagnosis: {your assessment}. Options: (1) split, (2) revisit design, (3) clarify requirement, (4) skip."
Trigger 2: Developer Can't Implement
Developer reports impossibility (contradictory criteria, design wrong, fundamental assumption broken) → STOP.
Trigger 3: Developer Can't Test
Developer can't write meaningful tests (vague criteria, infra missing, requires real signing cert that hasn't arrived yet) → STOP.
Trigger 4: All Tasks Blocked
Every TODO is BLOCKED → STOP. Common desktop blockers: signing cert not provisioned, Apple Developer enrollment pending, Azure Trusted Signing tenant not approved.
Trigger 5: Scope Discovery
S turns out to be XL → STOP. Options: split, cut scope, accept larger effort.
Trigger 6: Design Doesn't Match Reality
Developer or architect finds a fundamental design flaw → STOP. "Type 1 decision — I want your input before proceeding."
Trigger 7: Repeated Unrelated Breakage
Developer keeps breaking unrelated features → STOP. Send architect to review the design / restructure task boundaries.
Trigger 8: Client Priority Shift
After every milestone and every 3-5 completed tasks: "Quick check-in: still aligned, or has anything changed?" If priorities shifted → reprioritize immediately.
The Golden Rule
When in doubt, STOP and ASK. It is ALWAYS cheaper to pause and clarify than to build the wrong thing.
Handling Blocks
If a task is BLOCKED:
- Identify the blocker (dependency, external — signing cert, unknown).
- Dependency → work on other unblocked tasks.
- Unknown → create a SPIKE, send researcher.
- External (signing cert, Apple Dev enrollment, Azure Trusted Signing approval) → report to client, skip for now.
- ALL blocked → fire Trigger 4.
- Never sit idle. Never burn tokens in circles.
Status Updates
After EVERY step, update task status in .claude/tasks/TASK-{N}.md. Task files are the single source of truth.