This repo uses mainline (mq) to coordinate the protected main branch.
mq is installed globally and auto-discovers the repo from cwd.
The repo root checkout is the canonical protected main. Keep it clean
and boring. All feature work happens in topic worktrees.
mq submit queues durably then opportunistically drains the queue
itself — no daemon required. This repo has [publish].Mode = 'auto'.
- Never commit, merge, rebase, push, or reset on
main. The root checkout is read-only for development. - Allowed on
main:git status,git diff,git log,git show,git fetch,git worktree add. - If the repo root checkout is dirty or not on
main, treat that as a workflow/setup bug and fix it before continuing. - Create feature worktrees with
wtnew <branch>. Do all work there. - Run
pnpm installonce in a new worktree (they don't sharenode_modules). - Land through
mq, never through manual merge or push. - Clean up after landing:
wtdrop <worktree-path>.
# 1. Create a feature worktree and install deps
wtnew my-feature
cd ~/Projects/_wt/recallnet/codecontext/my-feature
pnpm install
# 2. Do all work in the worktree
# edit, test, commit (repeat as needed)
# 3. Submit — default to waiting for the remote-landed result
mq submit --check-only --json # dry-run before expensive work
mq submit --wait --for landed --timeout 30m --json
# 4. Clean up
wtdrop ~/Projects/_wt/recallnet/codecontext/my-feature
Follow the submission_id, not the branch name. The default agent path is
to wait for landed. Plain mq submit --wait is only an integration result,
not the normal end-state to rely on.
mq land --json --timeout 30m # submit + integrate + publish, one shot
mq submit --json # or: capture submission_id
mq wait --submission <id> --for landed --json --timeout 30m # then wait for remote landing by id
Do not use sleeps, branch-name polling, mq logs, mq events, or
mq watch as the primary way to determine completion.
- If integration fails (conflict, check failure),
mainis untouched. Fix in the feature worktree, commit, then:mq retry --submission <id> - To abandon:
mq cancel --submission <id> - Check what went wrong with
mq status --json, then usemq logs --followormq events --follow --json --lifecyclefor deeper debugging. - Auto-repair stuck states:
mq doctor --fix
mq status --json— primary status surface for queue state and current progressmq doctor— health check (branch, locks, queue)mq repo show --json— config, worktrees, upstream statusmq repo root --json— canonical root trust statusmq repo audit --json— local branches not yet merged intomainmq logs --follow— audit/debug historymq watch— interactive debug/status refreshmq events --follow --json --lifecycle— lifecycle debug stream
- All commits happen in feature worktrees, never on
main. - This is a Recall Labs repo. Use the global
recall-commitskill for commits here. - Default commit flow for this repo:
stage the intended changes
capture any high-leverage learnings in
AGENT-LEARNINGS.mdif warranted commit with a conventional commit message using the recall-commit format - Do not use ad hoc one-line commits when the recall-commit guard applies.
- After committing, land through
mq submit --wait --for landed --timeout 30m --json.
- Use inline
@contextannotations for non-obvious, high-value reasoning that future edits could easily erase. - Required for: critical decision logic and invariants security-sensitive behavior and hard-won lessons external integration quirks and contract mismatches regression guards explaining why a simpler change would be wrong
- Preferred forms:
@context decision@context risk@context requirement@context history - Keep notes short and specific: what is true, why it matters, and what would break if changed.
- Use
{@link ...}for supporting material when helpful. Refs are just pointers to repo files, URLs, skills, or docs. Do not require any special doc schema. - Before editing critical files, run:
npx @recallnet/codecontext-cli --scope <file> - After editing, run:
npx @recallnet/codecontext-cli --diff HEAD <file> - For broader repo orientation, run:
npx @recallnet/codecontext-cli --report - Do not use
@contextfor obvious narration, duplicated ADR prose, or generic comments.
- This repo publishes packages through Changesets, not from every successful
merge to
main. - The publish automation lives in
.github/workflows/publish-packages.yml. - The only user-facing package registry for this repo is npmjs.
- Do not send users to GitHub Packages for install or version verification.
- Do not send users to repo git URLs for install when a public npm package
exists. The
piextension should be installed as@recallnet/codecontext-pifrom npmjs, not fromgit:github.com/recallnet/codecontext.git. - npmjs publishing uses GitHub Actions trusted publishing via OIDC, not an
NPM_TOKENsecret. - New npm packages need their own npmjs trusted-publisher entry pointing at
recallnet/codecontextand.github/workflows/publish-packages.ymlbefore automated releases will work for that package. - That workflow only publishes when CI succeeds on
mainand there is at least one pending file in.changeset/. - If there is no pending changeset, the workflow does nothing, even if code in a publishable package changed.
- Add a changeset for each publishable package that needs a new release.
- Commit the changeset with the code fix in the feature worktree.
- Submit through
mq submit --wait --for landed --timeout 30m --json. - Wait for
CIto pass onmain. - Wait for
Publish Packagesto run after CI. - Verify the new version is actually on the registry before telling anyone the fix is published.
@recallnet/codecontext-cliowns repo-wide file scanning and--reportbehavior. Parser releases do not ship CLI-only fixes.- Do not close a bug as "published" just because the fix merged. Confirm the package version changed on the registry.
- For public installs and published-version checks, use npmjs with
npm view. - If a package fix merged without a changeset, publishing will not happen until a new commit adds the missing changeset.
- Use the repo docs governance stack instead of hand-rolled markdown parsing.
- Keep docs frontmatter valid and review dates current.
- Default active docs to
periodic-7. This is the recommended default because active docs drift quickly; if a repo cannot sustain 7-day review, it usually has too many docs. - Use
generated,codebound, orhistoricalonly when they are genuinely correct, not as an escape hatch from freshness enforcement. - Add new docs to the rooted docs graph so orphan checks stay clean.
- Root the graph from
docs/INDEX.mdunless the repo has a stronger canonical entrypoint. - Prefer deleting stale docs over re-dating them. Git history already preserves old text; the live docs tree should describe current reality, not accumulate dead docs.
- Removing stale or duplicate docs is a good default behavior.
rmis often the right answer. - Run
pnpm docs:lintbefore merging doc structure or policy changes.
This repo uses gh skill publish (GitHub CLI v2.90.0+) to publish skills.
Prerequisite: Ensure GitHub CLI v2.90.0+ is installed: gh --version
When modifying skills:
- Make changes to skill files in
skills/{skill-name}/ - Commit and merge to main
- Run
gh skill publish --tag vX.Y.Zto create a release - The
agent-skillstopic will be added automatically
Installing skills from this repo:
gh skill install recallnet/codecontext codecontext-setup --agent codex