Repo Governance
Universal entry point for repository judgment before modifying files, history, or remotes.
1. Frame & Quick Guard
- Frame: Identify outcome, operation, target paths, and explicit user authorizations. Target check: exists -> inspect tracked/dirty. Never assume absent. Action request != unstated branch/worktree/stash/rewrite authorization.
- Quick Guard: Read-only local inspection (
bash scripts/git-stack.sh state --path <target>). Resolves root, branch, clean status, STASHES count, linked worktrees, and TARGET_OVERLAP (named branches with unmerged commits touching the target). Absence of script degrades to direct git read commands.
2. Route Selection
Route enum is strictly pinned to: execute | plan-work | recover | guardrails | specialist (never invent routes).
| Situation / Evidence |
Route |
Action / Reference |
| Plain commit/push/merge; staged or disjoint work; clean state |
execute |
Silent fast-lane -> hand off directly to git-ops |
Dirty tree, target path modified elsewhere, TARGET_OVERLAP != NONE, or unclassified history rewrite |
plan-work |
Read orient.md -> workstreams.md |
| Interrupted op (merge/rebase/cherry-pick), divergence, or suspected lost work |
recover |
Read orient.md -> recover.md |
| Branch protections, CI policies, environments, secret scanning posture |
guardrails |
Hand off to repo-guardrails |
| Cleanup, changelog/doc sync, release packaging, README positioning |
specialist |
Route to repo-hygiene, update-docs, git-ops, or repo-prettifier |
3. Return or Continue
- Fast Lane (
ROUTE: execute, APPROVAL: NOT_NEEDED): Proceed immediately and silently to git-ops. Output only the final git-ops execution box.
- Halt / Delegation: Emit full structured block when halting for authorization, entering
recover, or delegating:
OUTCOME: <intended repository result>
FACTS: <root; branch/status; upstream; worktrees; targets>
CLASS: <PRIVATE | PUBLISHED_SOLO | SHARED | UNKNOWN | NOT_NEEDED>
RISK: <flags or NONE>
ROUTE: <execute | plan-work | recover | guardrails | specialist>
DECISION: <why this route and boundary fit>
APPROVAL: <NOT_NEEDED | REQUIRED: exact effect>
NEXT: <one safe action>
- Unrequested Mutation Guard: Before unrequested structural, destructive, provider, or shared-history changes, halt and prompt:
Observed: <facts> | Proposed: <effect> | Risk/Recovery: <point> | Authorize? (Y/N).
- Handoff Mechanism: Load sibling skill by name; if host cannot load, execute with native git and apply bundle invariants inline. Missing specialist never blocks routine work.
Invariants
- Repository-local authority (
AGENTS.md, repo configs) outranks generic defaults.
- Changed-file overlap outranks branch-name or issue similarity.
- Branch = history/review boundary; Worktree = concurrent filesystem/hands boundary.
- Unknown ownership blocks only dependent history rewrites; non-destructive work continues.
1---2name: repo-governance3description: Universal repository governance front door. Evaluates Git/GitHub requests (commit, push, branch, worktree, stash, merge, rebase, amend, reset, force-push, PR, release). Selects workstreams, prevents file/worktree collisions, classifies history before rewrites, or halts for recovery. Do not use for non-repo file work or read-only Git concept explanations.4---56# Repo Governance78Universal entry point for repository judgment before modifying files, history, or remotes.910## 1. Frame & Quick Guard1112- **Frame**: Identify outcome, operation, target paths, and explicit user authorizations. Target check: exists -> inspect tracked/dirty. Never assume absent. Action request != unstated branch/worktree/stash/rewrite authorization.13- **Quick Guard**: Read-only local inspection (`bash scripts/git-stack.sh state --path <target>`). Resolves root, branch, clean status, `STASHES` count, linked worktrees, and `TARGET_OVERLAP` (named branches with unmerged commits touching the target). Absence of script degrades to direct git read commands.1415## 2. Route Selection1617Route enum is strictly pinned to: `execute | plan-work | recover | guardrails | specialist` (never invent routes).1819| Situation / Evidence | Route | Action / Reference |20|---|---|---|21| Plain commit/push/merge; staged or disjoint work; clean state | `execute` | Silent fast-lane -> hand off directly to `git-ops` |22| Dirty tree, target path modified elsewhere, `TARGET_OVERLAP` != `NONE`, or unclassified history rewrite | `plan-work` | Read [orient.md](references/orient.md) -> [workstreams.md](references/workstreams.md) |23| Interrupted op (merge/rebase/cherry-pick), divergence, or suspected lost work | `recover` | Read [orient.md](references/orient.md) -> [recover.md](references/recover.md) |24| Branch protections, CI policies, environments, secret scanning posture | `guardrails` | Hand off to `repo-guardrails` |25| Cleanup, changelog/doc sync, release packaging, README positioning | `specialist` | Route to `repo-hygiene`, `update-docs`, `git-ops`, or `repo-prettifier` |2627## 3. Return or Continue2829- **Fast Lane (`ROUTE: execute`, `APPROVAL: NOT_NEEDED`)**: Proceed immediately and silently to `git-ops`. Output only the final `git-ops` execution box.30- **Halt / Delegation**: Emit full structured block when halting for authorization, entering `recover`, or delegating:3132```text33OUTCOME: <intended repository result>34FACTS: <root; branch/status; upstream; worktrees; targets>35CLASS: <PRIVATE | PUBLISHED_SOLO | SHARED | UNKNOWN | NOT_NEEDED>36RISK: <flags or NONE>37ROUTE: <execute | plan-work | recover | guardrails | specialist>38DECISION: <why this route and boundary fit>39APPROVAL: <NOT_NEEDED | REQUIRED: exact effect>40NEXT: <one safe action>41```4243- **Unrequested Mutation Guard**: Before unrequested structural, destructive, provider, or shared-history changes, halt and prompt: `Observed: <facts> | Proposed: <effect> | Risk/Recovery: <point> | Authorize? (Y/N)`.44- **Handoff Mechanism**: Load sibling skill by name; if host cannot load, execute with native git and apply bundle invariants inline. Missing specialist never blocks routine work.4546## Invariants4748- Repository-local authority (`AGENTS.md`, repo configs) outranks generic defaults.49- Changed-file overlap outranks branch-name or issue similarity.50- Branch = history/review boundary; Worktree = concurrent filesystem/hands boundary.51- Unknown ownership blocks only dependent history rewrites; non-destructive work continues.