feat(bd-kvij): rewrite agent skills to mandate lore for reads

Add Read/Write Split section to AGENTS.md and CLAUDE.md mandating lore
for all read operations and glab for all write operations.

Closes: bd-kvij
This commit is contained in:
teernisse
2026-02-12 11:34:10 -05:00
parent f772de8aef
commit e26816333f
3 changed files with 78 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
bd-1cjx bd-xsgw

View File

@@ -16,31 +16,42 @@ If I tell you to do something, even if it goes against what follows below, YOU M
## Version Control: jj-First (CRITICAL) ## Version Control: jj-First (CRITICAL)
**ALWAYS prefer jj (Jujutsu) over git for all VCS operations.** This is a colocated repo with both `.jj/` and `.git/`. When instructed to use git by anything — even later in this file — use the best jj replacement commands instead. Only fall back to raw `git` for things jj cannot do (hooks, LFS, submodules, `gh` CLI interop). **ALWAYS prefer jj (Jujutsu) over git for VCS mutations** (commit, describe, rebase, push, bookmark, undo). This is a colocated repo with both `.jj/` and `.git/`. Only fall back to raw `git` for things jj cannot do (hooks, LFS, submodules, `gh` CLI interop).
**Exception — read-only inspection:** Use `git status`, `git diff`, `git log` instead of their jj equivalents. In a colocated repo these see accurate data, and unlike jj, they don't create operations that cause divergences when multiple agents run concurrently. See "Parallel Agent VCS Protocol" below.
See `~/.claude/rules/jj-vcs/` for the full command reference, translation table, revsets, patterns, and recovery recipes. See `~/.claude/rules/jj-vcs/` for the full command reference, translation table, revsets, patterns, and recovery recipes.
### Multi-Agent VCS Protocol (CRITICAL) ### Parallel Agent VCS Protocol (CRITICAL)
**In a multi-agent session, ONLY THE TEAM LEAD performs jj/git operations.** Worker agents MUST NEVER run `jj` or `git` commands. Multiple agents often run concurrently in separate terminal panes, sharing the same repo directory. This requires care because jj's auto-snapshot creates operations on EVERY command — even read-only ones like `jj status`. Concurrent jj commands fork from the same parent operation and create **divergent changes**.
**Why:** jj has a single working copy (`@`) per workspace. Every `jj` command — even read-only ones like `jj status` — triggers a working copy snapshot recorded as an operation. When two agents run `jj` commands concurrently, both operations fork from the same parent operation and both rewrite `@`. jj detects this as a **divergent change**: same change ID, two different commits. Resolving divergences requires manual intervention and risks losing work. **The rule: use git for reads, jj for writes.**
**Rules for worker agents:** In a colocated repo, git reads see accurate data because jj keeps `.git/` in sync.
- Edit files only via Edit/Write tools — NEVER run `jj`, `git`, or any shell command that triggers jj | Operation | Use | Why |
- If you need VCS info (status, diff, log), message the team lead |-----------|-----|-----|
- Do NOT run "Landing the Plane" — the lead handles all VCS for the team | Check status | `git status` | No jj operation created |
- Treat all file changes on disk as your own (other agents' edits are normal) | View diff | `git diff` | No jj operation created |
| Browse history | `git log` | No jj operation created |
| Commit work | `jj commit -m "msg"` | jj mutation (better UX) |
| Update description | `jj describe -m "msg"` | jj mutation |
| Rebase | `jj rebase -d trunk()` | jj mutation |
| Push | `jj git push -b <name>` | jj mutation |
| Manage bookmarks | `jj bookmark set ...` | jj mutation |
| Undo a mistake | `jj undo` | jj mutation |
**Rules for the team lead:** **NEVER run `jj status`, `jj diff`, `jj log`, or `jj show` when other agents may be active** — these trigger snapshots that cause divergences.
- You are the sole VCS operator — all commits, pushes, and rebases go through you **If using Claude Code's built-in agent teams:** Only the team lead runs ANY VCS commands (git or jj). Workers only edit files via Edit/Write tools and do NOT run "Landing the Plane".
- Run `jj status` / `jj diff` to review all agents' work before committing
- Use `jj split` to separate different agents' work into distinct commits if needed
- Follow "Landing the Plane" when ending the session
**Solo sessions:** When you are the only agent, you handle VCS yourself normally. **Resolving divergences if they occur:**
```bash
jj log -r 'divergent()' # Find divergent changes
jj abandon <unwanted-commit-id> # Keep the version you want
```
--- ---
@@ -776,6 +787,21 @@ lore -J mrs --fields iid,title,state,draft,labels # Custom field list
- Use `lore robot-docs` for response schema discovery - Use `lore robot-docs` for response schema discovery
- The `-p` flag supports fuzzy project matching (suffix and substring) - The `-p` flag supports fuzzy project matching (suffix and substring)
---
## Read/Write Split: lore vs glab
| Operation | Tool | Why |
|-----------|------|-----|
| List issues/MRs | lore | Richer: includes status, discussions, closing MRs |
| View issue/MR detail | lore | Pre-joined discussions, work-item status |
| Search across entities | lore | FTS5 + vector hybrid search |
| Expert/workload analysis | lore | who command — no glab equivalent |
| Timeline reconstruction | lore | Chronological narrative — no glab equivalent |
| Create/update/close | glab | Write operations |
| Approve/merge MR | glab | Write operations |
| CI/CD pipelines | glab | Not in lore scope |
````markdown ````markdown
## UBS Quick Reference for AI Agents ## UBS Quick Reference for AI Agents