You are currently in a Windows environment. Be sure to only use terminal commands that work on Windows, and other appropriate tools. THE 'jq' COMMAND DOES NOT EXIST.

To kill a running process (e.g. `app.exe`), use PowerShell: `powershell -Command "Stop-Process -Name app -Force -ErrorAction SilentlyContinue"`. The `taskkill` command does not work from bash.

## Code Tips

The `code_tips/` folder contains hard-won lessons from past debugging sessions — SQLite gotchas, Slint quirks, etc. Before writing or modifying code that touches a technology covered by a tips file, you and your subagents MUST read the relevant file(s) in `code_tips/`.
Current tips files: `SLINT_TIPS.md`, `SQLITE_TIPS.md`, `CALLBACK_PIPELINE.md`.

If you reach the end of an execution phase having encountered such lessons, add or edit the necessary files in `code_tips/` to describe each one.

## Data Architecture

Before any work that touches data structs, sync logic, storage, or field definitions, you and your subagents MUST read `.planning/DATA-FLOW.md`. This is the authoritative reference for all data entities, field sources, and sync directions.

**Mandatory rules (enforced):**
- No new data fields on any struct without a documented source in DATA-FLOW.md.
- SQLite is the single read source for the app (once implemented). Never read from in-memory Repository in production.
- GH Issues (`ww-card`, `ww-product` in `BigscreenVR/beyond-outgoing`) are the cloud of record.
- `github_profile_url` does NOT exist as a GH Project column. Never add or query it. See RULE-01 in DATA-FLOW.md.

**Update obligation:** If you change data architecture (add fields, change sources, modify sync flow), update DATA-FLOW.md in the same commit.

## Pre-fix sibling search

Before writing any fix that modifies sync logic, callbacks, modals, or optimistic updates in `.rs` or `.slint` files:

1. Grep for the function/callback name being modified across `crates/app/src/` and `crates/app/ui/`
2. Grep for the most relevant property name or string literal across the same directories
3. Document the sibling sites found (in commit body or plan notes)

This rule is enforced by a soft-warning hook (`.claude/hooks/sibling-search-warn.sh`) that reminds you if you edit a function without prior grep. See `.planning/RETRO-AGENT-FAILURE-PATTERNS.md` M-2 for rationale.

## Reopened-bug policy

If a debug doc is moved out of `.planning/debug/resolved/` a second time, add an entry to `.planning/REOPENED.md` with the reopen date and a one-sentence root cause.

## Modal state machines

Before modifying modal state machines (lookup-modal, state-transition-modal, settings-modal, add-product-form), read `.planning/MODAL-STATE.md`. After modifying, update it in the same commit. The modal layer is the single most fragile area — 71% of recent gap-closure fixes touched modal-related code.

## Owl messaging

- Start your own `/owl listen` session if you don't have one already.
- Always assign an ID to every subagent you spawn, and instruct each one to run `/owl listen <id>` using that ID.
- Freely use `/owl send` to communicate with subagents as needed to more efficiently achieve project goals.

## BUGSWEEPER — Live Debugging Framework

BUGSWEEPER is an HTTP debug server embedded in the app behind `--features bugsweeper`. It gives agents full programmatic control of the running Slint frontend: reading/writing UI properties, invoking callbacks, dumping the card model as JSON, querying SQLite directly, and inspecting discovery/archive state. For UI debugging, it works best in combination with the screen-timelapse plugin tools.

**Guide:** `crates/bugsweeper/GUIDE.md` — full endpoint reference, curl examples, and typical workflows.

**When to use:**
- Before human UAT rounds — run a smoke test to catch data/UI issues before the user sees them.
- When debugging UI state — query properties and card data without guessing from screenshots alone.
- When verifying callback wiring — invoke callbacks and check resulting state changes.

**Build:** `cargo build --features bugsweeper` (server on `127.0.0.1:9876`). Production builds are unaffected.

**Session rule:** Any mutations to card data, properties, or state during a debug session MUST be reverted before the session ends. Do not invoke callbacks that write to external services (GH Project, Discord) unless explicitly testing that path.

**Self-healing rule:** If a BUGSWEEPER debug session cannot perform all required test tasks due to missing endpoints, unregistered properties/callbacks, or other framework limitations:
1. Immediately run `/gsd:quick` to address the shortcoming(s) in BUGSWEEPER itself. Prefer broadly applicable solutions over narrow fixes — your fix should handle similar future scenarios, not just the exact one encountered now.
2. After the quick fix is committed, resume the debug session using the newly improved BUGSWEEPER to complete the remaining tasks.
3. All BUGSWEEPER improvements must stay modular, minimally intrusive, and must not bloat the core app. The `#[cfg(feature = "bugsweeper")]` gate is inviolable.