···33This is a monorepo managed by `monopam`. Each subdirectory is a git subtree
44from a separate upstream repository.
5566-## Making Changes
66+> **Note:** Check `CLAUDE.local.md` (if it exists) for additional local
77+> configuration or preferences specific to this workspace.
7888-1. Edit code in any subdirectory as normal
99-2. Build and test: `opam exec -- dune build` and `opam exec -- dune test`
1010-3. Commit your changes to this monorepo with git
99+## Quick Reference
11101212-## Exporting Changes to Upstream
1111+| Task | Command |
1212+|------|---------|
1313+| Check status | `monopam status` |
1414+| Sync all repos | `monopam sync` |
1515+| Sync and push upstream | `monopam sync --remote` |
1616+| Sync one repo | `monopam sync <repo-name>` |
1717+| Build | `opam exec -- dune build` |
1818+| Test | `opam exec -- dune test` |
13191414-After committing changes here, they must be exported to the individual
1515-repositories before they can be pushed upstream:
2020+## Daily Workflow
16211717-```
1818-monopam push
1919-```
2222+```bash
2323+# 1. Check what needs syncing
2424+monopam status
20252121-This extracts your commits into the individual checkouts in `../src/`.
2222-You then review and push each one manually:
2626+# 2. Sync your monorepo with all upstreams
2727+monopam sync
2828+2929+# 3. Make your changes, build and test
3030+opam exec -- dune build && opam exec -- dune test
3131+3232+# 4. Commit your changes
3333+git add -A && git commit -m "Description of changes"
23342424-```
2525-cd ../src/<repo-name>
2626-git log --oneline -5 # review the changes
2727-git push origin main # push to upstream
3535+# 5. Sync and push to upstream remotes
3636+monopam sync --remote
2837```
29383030-## Pulling Updates from Upstream
3939+## Understanding Status Output
31403232-To fetch the latest changes from all upstream repositories:
4141+Run `monopam status` to see the sync state:
33423434-```
3535-monopam pull
3636-```
4343+- `local:=` - Monorepo and checkout in sync
4444+- `local:+N` - Monorepo is N commits ahead (run `monopam sync`)
4545+- `local:-N` - Checkout is N commits ahead (run `monopam sync`)
4646+- `local:sync` - Trees differ, needs sync (run `monopam sync`)
4747+- `remote:=` - Checkout and upstream in sync
4848+- `remote:+N` - You have N commits to push (run `monopam sync --remote`)
4949+- `remote:-N` - Upstream has N commits to pull (run `monopam sync`)
37503838-This updates both the checkouts and merges changes into this monorepo.
5151+## Making Changes
5252+5353+1. **Edit code** in any subdirectory as normal
5454+2. **Build and test**: `opam exec -- dune build && opam exec -- dune test`
5555+3. **Commit** your changes: `git add -A && git commit`
5656+4. **Sync**: `monopam sync --remote` to push to upstreams
39574058## Important Notes
41594242-- **Always commit before push**: `monopam push` only exports committed changes
4343-- **Check status first**: Run `monopam status` to see which repos have changes
6060+- **Always commit before sync**: `monopam sync` only exports committed changes
6161+- **Check status first**: Run `monopam status` to see what needs attention
4462- **One repo per directory**: Each subdirectory maps to exactly one git remote
4545-- **Shared repos**: Multiple opam packages may live in the same subdirectory
4646- if they share an upstream repository
47634864## Troubleshooting
49655050-If `monopam push` fails with "dirty state", you have uncommitted changes.
5151-Commit or stash them first.
6666+### "Dirty packages" Error
6767+Commit your changes first:
6868+```bash
6969+git status && git add -A && git commit -m "Your message"
7070+```
52715353-If merge conflicts occur during `monopam pull`, resolve them in this monorepo,
5454-commit, then the next pull will succeed.
7272+### "local:sync" in Status
7373+Trees differ but need syncing:
7474+```bash
7575+monopam sync
7676+```
7777+7878+### Merge Conflicts
7979+Resolve conflicts, commit, then sync:
8080+```bash
8181+git add -A && git commit -m "Resolve merge conflicts"
8282+monopam sync
8383+```
8484+8585+### Push Fails
8686+Check credentials:
8787+```bash
8888+cd ../src/<repo-name>
8989+git push origin main # For better error messages
9090+```
9191+9292+## Getting Help
9393+9494+```bash
9595+monopam --help # Main help
9696+monopam sync --help # Sync command help
9797+monopam status --help # Status command help
9898+```