2026-02-14 18:20:07 +01:00
# CLAUDE.md — Laputa App
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## ⛔ BEFORE EVERY COMMIT
2026-02-20 21:19:41 +01:00
2026-02-20 21:47:05 +01:00
```bash
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
pnpm lint && npx tsc --noEmit
pnpm test
pnpm test:coverage # frontend ≥70%
cargo test
2026-02-27 15:53:05 +01:00
cargo llvm-cov --manifest-path src-tauri/Cargo.toml --no-clean --fail-under-lines 85
2026-02-20 21:47:05 +01:00
```
2026-03-24 15:47:31 +01:00
**CodeScene Code Health** — the pre-commit and pre-push hooks enforce:
- Hotspot Code Health ≥ 9.5 (most-edited files)
- Average Code Health ≥ 9.0 (project-wide, ALL files)
**Both gates block commit/push.** If either fails: extract hooks, split large components, reduce function complexity. Never add `// eslint-disable` , `#[allow(...)]` , or `as any` to pass the gate. Check both scores via MCP CodeScene after every significant change:
- `hotspot_code_health.now` ≥ 9.5
- `code_health.now` ≥ 9.0 (average — do NOT ignore this one)
If Average Code Health is below 9.0, you must fix regressions before pushing — even in files you didn't directly modify, if your changes indirectly affected complexity.
2026-02-20 21:19:41 +01:00
2026-03-24 15:58:23 +01:00
**Boy Scout Rule (Robert C. Martin):** Leave every file you touch better than you found it. When working on any task:
1. Before modifying a file, check its CodeScene health: `mcp__codescene__code_health_review`
2. If the file has issues (complexity, duplication, large functions), fix them as part of your work
3. After your changes, verify the file's score is higher than before: `mcp__codescene__code_health_score`
4. The goal: every commit either maintains or raises the overall average. No commit should lower it.
This is not optional — it's how we incrementally raise the codebase quality with every task.
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## ⛔ BEFORE FIRING laputa-task-done — Two-phase QA
2026-02-20 21:19:41 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
### Phase 1: Playwright (you do this)
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
Write a test in `tests/smoke/<slug>.spec.ts` that covers every acceptance criterion. The test must fail before your fix and pass after. Run it:
2026-03-06 08:36:01 +01:00
```bash
2026-03-17 22:01:26 +01:00
pnpm dev --port 5201 &
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
sleep 3
2026-03-17 22:01:26 +01:00
BASE_URL="http://localhost:5201" npx playwright test tests/smoke/<slug>.spec.ts
2026-03-08 20:56:40 +01:00
```
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
**If your task touches filesystem, git, AI, MCP, or any native Tauri command**: also test with `pnpm tauri dev` against `~/Laputa` (not demo vault). Use `osascript` keyboard events — no mouse, no `cliclick` .
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
### Phase 2: Native QA (Brian does this after push)
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
Brian installs the release build and runs keyboard-only QA. Phase 1 must pass first or the task goes to To Rework.
2026-02-28 23:47:56 +01:00
2026-03-18 13:08:53 +01:00
Fire done signal only after Phase 1 passes — **two steps, both required ** :
2026-02-22 10:09:26 +01:00
```bash
2026-03-18 13:08:53 +01:00
# 1. Move task to In Review on Todoist
curl -s -X POST "https://api.todoist.com/api/v1/tasks/<task_id>/move" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"section_id": "6g3XjX33FF4Vj86M"}'
# 2. Notify Brian
2026-03-17 22:01:26 +01:00
openclaw system event --text "laputa-task-done:<task_id>" --mode now
2026-02-22 10:09:26 +01:00
```
2026-02-23 22:33:11 +01:00
## Project
2026-02-23 08:11:03 +01:00
2026-02-23 22:33:11 +01:00
Tauri v2 + React + TypeScript desktop app. Reads a vault of markdown files with YAML frontmatter.
2026-02-23 08:11:03 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
- **Spec**: `docs/PROJECT-SPEC.md` | **Architecture ** : `docs/ARCHITECTURE.md` | **Abstractions ** : `docs/ABSTRACTIONS.md`
- **Wireframes**: `ui-design.pen` | **Luca's vault ** : `~/Laputa/` (~9200 markdown files)
- Stack: Rust backend, React + BlockNote editor, Vitest + Playwright + cargo test, pnpm
2026-02-14 18:54:27 +01:00
2026-02-23 22:33:11 +01:00
## How to Work
2026-02-15 13:45:24 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
- **Push directly to main** — no PRs ever. The pre-push hook runs all checks.
- **⛔ NEVER open a PR** — branches diverge and cause rebase churn.
- **⛔ NEVER use --no-verify**
- Commit every 20– 30 min: `feat:` , `fix:` , `refactor:` , `test:` , `docs:`
2026-03-07 04:05:40 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## TDD (mandatory)
2026-03-07 04:05:40 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
Red → Green → Refactor → Commit. One cycle per commit. For bugs: write a failing regression test first, then fix. Exception: pure CSS/layout with no logic.
2026-02-14 18:54:27 +01:00
2026-03-17 21:35:47 +01:00
**Test quality (Kent Beck's Desiderata):** every test must be Isolated (no shared state), Deterministic (no flakiness), Fast, Behavioral (tests behavior not implementation), Structure-insensitive (refactoring doesn't break it), Specific (failure points to exact cause), Predictive (all pass = production-ready). Fix flaky/non-deterministic tests before adding new ones. E2E tests over unit tests for user flows.
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## ⛔ Docs — Keep docs/ in sync
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
After adding a Tauri command, new component/hook, data model change, or new integration: update `docs/ARCHITECTURE.md` , `docs/ABSTRACTIONS.md` , and/or `docs/GETTING-STARTED.md` in the same commit. Use Mermaid for diagrams (not ASCII). Exception: spatial wireframe layouts.
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## Design File (UI tasks)
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
1. Open `ui-design.pen` first — study existing frames for visual language.
2. Design in light mode. Create `design/<slug>.pen` for the task.
3. On merge to main: merge frames into `ui-design.pen` , delete `design/<slug>.pen` .
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## Vault Retrocompatibility
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
Every feature that depends on vault files must auto-bootstrap: check if file/folder exists on vault open, create with defaults if missing (silent, idempotent). Register with the central `Cmd+K → "Repair Vault"` command.
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
## Keyboard-First + Menu Bar (mandatory)
2026-03-06 08:36:01 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
Every feature must be reachable via keyboard. Every new command palette entry must also appear in the macOS menu bar (File / Edit / View / Note / Vault / Window). This is a QA requirement.
2026-03-06 08:36:01 +01:00
2026-02-23 22:33:11 +01:00
## macOS / Tauri Gotchas
2026-02-23 08:11:03 +01:00
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
- `Option+N` → special chars on macOS. Use `e.code` or `Cmd+N` .
- Tauri menu accelerators: `MenuItemBuilder::new(label).accelerator("CmdOrCtrl+1")` .
2026-02-23 22:33:11 +01:00
- `app.set_menu()` replaces the ENTIRE menu bar — include all submenus.
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
- `mock-tauri.ts` silently swallows Tauri calls — not a substitute for native app testing.
2026-02-23 08:11:03 +01:00
2026-02-23 22:33:11 +01:00
## QA Scripts
2026-02-23 08:11:03 +01:00
2026-02-23 21:33:41 +01:00
```bash
bash ~/.openclaw/skills/laputa-qa/scripts/focus-app.sh laputa
2026-02-23 22:33:11 +01:00
bash ~/.openclaw/skills/laputa-qa/scripts/screenshot.sh /tmp/out.png
bash ~/.openclaw/skills/laputa-qa/scripts/shortcut.sh "command" "s"
2026-02-23 21:33:41 +01:00
```
2026-02-27 15:27:35 +01:00
2026-03-13 19:22:36 +01:00
## Documentation Diagrams
docs: compress CLAUDE.md 360→93 lines — remove verbose explanations, keep rules
Removed: TDD rationale paragraphs, Phase 1 QA bullet lists (Claude infers from context),
verbose Vault Retrocompatibility pattern, design file node commands, menu bar structure
explanation, Push Workflow verbose anti-PR rationale.
Kept: all concrete rules, checklist commands, thresholds, scripts, gotchas.
2026-03-13 19:56:49 +01:00
Prefer Mermaid for all diagrams (`flowchart` , `sequenceDiagram` , `classDiagram` , `stateDiagram-v2` ). ASCII only for spatial wireframe layouts. GitHub renders Mermaid natively.