···11+# Agent Instructions
22+33+You are a **Dev Agent** (full stack) working in an isolated workspace. Your role:
44+- Implement features and fix bugs
55+- Write tests and documentation
66+- Run quality checks before marking done
77+- Prepare deployments when needed
88+99+The **Coordinator** (human) manages the project, reviews your plans, and merges completed work.
1010+1111+## Resources
1212+1313+- `TODO.md` - Project tasks and priorities
1414+- `CLAUDE.md` - Project-specific instructions
1515+- `notes/development.md` - Architecture and dev guide
1616+1717+## Status Reporting
1818+1919+Report status so the coordinator knows your progress:
2020+2121+```bash
2222+agent-status "working" "brief description"
2323+agent-status "blocked" "what you need" # Only when truly stuck
2424+agent-status "review" "ready for review"
2525+agent-status "done" "what you accomplished"
2626+```
2727+2828+---
2929+3030+## Policies
3131+3232+### Policy: Autonomy
3333+3434+- **Work independently** - Make reasonable decisions without asking. You have full access to the codebase.
3535+- **Don't ask for basic permissions** - Common tools (ls, find, npm, yarn, jj, node, etc.) are pre-approved.
3636+- **Batch your work** - Do multiple related operations before pausing.
3737+- **Only interrupt when truly blocked** - Not for confirmations, only for missing information you can't find.
3838+3939+### Policy: Workspace
4040+4141+- **Work in your current directory** - Your workspace is an isolated jj worktree with a full copy of the repo.
4242+- **CRITICAL: Use YOUR workspace path for all file operations** - When using Read/Edit tools, files must be in YOUR workspace directory (check with `pwd`), NOT the main repo. Example: if your workspace is `/path/to/repo/tmp/mobile-1234/`, edit `/path/to/repo/tmp/mobile-1234/src/file.js`, NOT `/path/to/repo/src/file.js`.
4343+- **Never use hardcoded paths to ~/misc/mpeek or similar** - Always resolve paths relative to your current working directory.
4444+4545+### Policy: Commands
4646+4747+- **Use package.json scripts or shell scripts** - Always prefer `yarn test`, `yarn build`, `./scripts/foo.sh` over raw commands. These can be added to the allow list permanently.
4848+- **NEVER combine commands** - Do not use `&&`, `;`, or `|` to chain commands. Combined commands cannot be added to the allow list and require approval every time. Run commands separately instead.
4949+- **NEVER write giant compound shell sequences** - If you need a multi-step shell operation, create a script in `package.json` or `scripts/`. Do not attempt to execute long inline command chains. This applies to build processes, deployment steps, file operations, etc. Always prefer a named, reusable script over inline complexity.
5050+5151+### Policy: Version Control
5252+5353+**This repo uses jj (Jujutsu), not git. Never use git commands directly.**
5454+5555+```bash
5656+jj st # status
5757+jj log # log recent changes
5858+jj diff # diff working copy
5959+jj commit -m "message" # commit your work
6060+jj squash -m "message" # squash into parent with message (when finishing)
6161+```
6262+6363+Key differences from git:
6464+- No staging area - all changes tracked automatically
6565+- `jj commit` creates new empty change on top
6666+- **NEVER move the main bookmark** - coordinator handles that via `mmerge`
6767+- Don't push directly - coordinator handles pushing after merge
6868+6969+### Policy: Sync Before Starting Work
7070+7171+After your plan is approved and before starting implementation, **always rebase on main** to get the latest changes:
7272+7373+```bash
7474+jj rebase -d main
7575+```
7676+7777+This ensures you have the latest code and TODO.md state from other agents or the coordinator.
7878+7979+### Policy: Commits
8080+8181+- Ask before committing - don't commit automatically, but do offer to commit when work is done
8282+- User (dietrich ayala) is sole author of all commits
8383+8484+### Policy: Quality
8585+8686+Before marking any task as done:
8787+8888+1. **Tests** - Write tests for new functionality. Run all tests and ensure they pass.
8989+2. **Documentation** - Update relevant docs (README, API docs, etc.) if behavior changes.
9090+3. **Development notes** - Add notes to `notes/` if you discovered important context, gotchas, or architectural decisions.
9191+4. **Verify** - Run the build/lint/tests. Do NOT mark done if tests fail.
9292+9393+### Policy: Cleanup
9494+9595+When your task is complete, you MUST complete this checklist:
9696+9797+**1. Mark task complete in TODO.md**
9898+- Find your task in the Today section, change `- [~]` (in-progress) to `- [x]` (done)
9999+- Move to Done section under current week heading (`### YYYY-WNN`)
100100+101101+**2. Write development notes** (if applicable)
102102+- Add to existing file in `notes/` or create new one
103103+- Focus on what future developers need to know
104104+105105+**3. Sync changes back to agent-workflow repo** (only if you have new learnings)
106106+- **Learnings**: Append new tips/gotchas to `~/sync/Dev/agent-workflow/CLAUDE.md` using Edit tool (don't overwrite - other agents may have added content)
107107+- **Permissions**: Skip - coordinator will consolidate permissions manually
108108+109109+**4. Merge workspace back to main**
110110+```bash
111111+jj squash -m "description of changes" # Squash your work
112112+# Coordinator will handle the actual merge with mmerge
113113+```
114114+115115+**5. Check if deployment needed**
116116+- Server changes (`backend/server/`): Ask coordinator about Railway deploy
117117+- Mobile changes (`backend/tauri-mobile/`): Note TestFlight build may be needed
118118+- Desktop only: No deployment needed
119119+120120+**6. Report completion**
121121+```bash
122122+agent-status "done" "summary of what you accomplished"
123123+```
124124+125125+**Do NOT skip these steps.** The coordinator relies on TODO.md and permissions being updated.
126126+127127+---
128128+129129+## Your Taskdaily data snapshots saved to compress archives in ~/sync/peek-backups
130130+131131+Enter plan mode (use EnterPlanMode tool) and create a detailed implementation plan.
132132+Wait for my review before executing. Do NOT auto-execute.
+1-1
TODO.md
···1111Be able to use the app on mobile and desktop with the safety of knowing there's also at least one remote copy.
12121313Today
1414-- [~][desktop] daily data snapshots saved to compress archives in ~/sync/peek-backups
1514- [ ][desktop] e2e sync test: desktop + server in debug and then in prod, verify via railway logs for production package
1615- [ ][mobile] pull-to-refresh triggers sync
1716- [ ][mobile] fix big bottom bar showing again
···423422424423### 2026-W04
425424425425+- [x][desktop] daily data snapshots saved to compress archives in ~/sync/peek-backups
426426- [x][workflow] restore git/github push for Railway deploys
427427- [x][desktop] fix better-sqlite3 node vs electron version mismatch
428428- [x][sync] investigate remaining sync edge cases