Skills and rules for the NanoClaw host agent (Claude Code on Mac). Tile promotion, container management, staging checks, repo chain safety, and public sync.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
qwibitai/nanoclaw (upstream) → jbaruch/nanoclaw-public (public fork) → jbaruch/nanoclaw (private)Updates flow DOWN the chain:
upstream → public → privateContributions flow UP:
private → (scrub) → public → (PR) → upstreamscripts/sync-to-public.sh.upstream remote in private points to jbaruch/nanoclaw-public, NOT qwibitai/nanoclaw.This is non-negotiable. Do not:
The gh CLI defaults to the upstream fork for PRs and comments when working in a fork. Always use --repo jbaruch/nanoclaw-public or --repo jbaruch/nanoclaw explicitly. Never rely on the default.
Why: a misplaced comment or PR on upstream exposes private information to the upstream community. This has happened — it's not hypothetical.
Every gh pr, gh issue, and gh api command MUST include an explicit --repo flag. No exceptions.
# WRONG — may default to upstream
gh pr create --base main
# RIGHT
gh pr create --repo jbaruch/nanoclaw-public --base mainThis rule applies to every fork, not just the qwibitai chain. The gh CLI's "open PR against parent" default is the same footgun in any forked repo. If a checkout has an upstream remote OR git config remote.origin.gh-resolved set, treat the next gh command as load-bearing — pass --repo $(git remote get-url origin | sed -E 's|.*[:/]([^/]+/[^/]+)(\.git)?$|\1|') (or the literal target) explicitly. The (\.git)?$ group makes the suffix optional so the regex matches both SSH (git@github.com:owner/repo.git) and HTTPS-without-suffix (https://github.com/owner/repo) remotes — GitHub stores HTTPS clones either way.
Concretely: when iterating across a fleet of forks (e.g. setting up shared CI on every nanoclaw* repo), assume EVERY repo might be a fork until proven otherwise — pass --repo even when you "know" the repo isn't a fork. The cost of a stray --repo is zero; the cost of a misfired PR is closing it on the wrong upstream and re-opening on the right repo, plus the stomach-drop when you realize where the PR landed.
A one-liner to check whether the current checkout has any fork relationship before running gh:
git config --get remote.upstream.url \
|| git remote -v | grep -E '^upstream\b' \
|| gh repo view --json parent --jq '.parent // empty'If any of those produce output, the checkout is a fork (or has an upstream-style remote configured) — pass --repo explicitly. The gh repo view --json parent form catches the case where there's no upstream remote but GitHub still treats the repo as a fork.
A gh pr create that landed on the wrong upstream cannot be re-targeted (GitHub doesn't support changing a PR's base repo). Recovery is:
gh pr close <wrong-pr-number> --repo <wrong-target> --comment "Wrong target — re-opening against <correct-target>"gh pr create --repo <correct-target> ... with the same bodyBranch already pushed to your fork's origin is fine — closing the wrong-target PR doesn't delete the branch.
git fetch upstream
git merge upstream/main
# Resolve conflicts if anyThis is what /update-nanoclaw does.
Run scripts/sync-to-public.sh — it:
sync/YYYY-MM-DD branchNever push directly to public main. Always create a PR and review the diff.