governance-sync
Skill13 starsChanged 4 months agoMITView on GitHub
Audit or explicitly synchronize Claude and Codex repository governance without overwriting conflicts. Triggers: governance sync, CLAUDE.md, AGENTS.md, instruction mirror.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- app-devSkill
- architectureSkill
- buildSkill
- checkpointSkill
- context-mgmtSkill
- debugSkill
- dreamSkill
- evalSkill
- experimentSkill
- forgeSkill
- frontendSkill
- handoffSkill
- helpSkill
- human-passSkill
- ingestSkill
- initSkill
- knowledge-graphSkill
- landing-pageSkill
- marketing-siteSkill
- metricsSkill
- orchestrationSkill
- qualitySkill
- retrospectiveSkill
- reviewSkill
- shipSkill
- simplifySkill
- tearitapartSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
Use python3 "$KERNEL_GOVERNANCE_SYNC" init REPO --backup-dir REPO/.kernel-governance-backups/init only when the user explicitly wants …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Governance sync
This explicit-only operator audits native repository instructions and can create a missing Claude or Codex adapter from one declared source. It never edits a conflict.
Audit first
Resolve the installed script once. Claude Code and Codex compatibility loading
provide CLAUDE_PLUGIN_ROOT; otherwise use the direct relative path from the
documented installed skills/governance-sync working directory:
if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
KERNEL_GOVERNANCE_SYNC="$CLAUDE_PLUGIN_ROOT/scripts/governance-sync.py"
else
KERNEL_GOVERNANCE_SYNC="../../scripts/governance-sync.py"
fi
test -f "$KERNEL_GOVERNANCE_SYNC"Run python3 "$KERNEL_GOVERNANCE_SYNC" audit <root> --json.
The audit discovers
canonical Git roots, ignores caches, deduplicates linked worktrees, and reports:
missing both, Claude-only, AGENTS-only, both identical, generated current, generated
stale, incomplete generation, conflict, and scoped .claude states. Generated states
are decided from manifest hashes and adapter provenance, not raw file equality.
Missing-both is compliant and remains untouched unless init is explicit.
Writes require confirmation
Show the exact repository, source, target, and backup directory. Continue only after the user confirms one command:
python3 "$KERNEL_GOVERNANCE_SYNC" adopt REPO --source CLAUDE.md --backup-dir REPO/.kernel-governance-backups/adopt
python3 "$KERNEL_GOVERNANCE_SYNC" generate REPO --backup-dir REPO/.kernel-governance-backups/generate
python3 "$KERNEL_GOVERNANCE_SYNC" check REPOAGENTS.md and .claude/CLAUDE.md are also valid sources. The manifest pins the
source path, source hash, output, output hash, and generator version. Scoped sources
stay where they are; only the missing root-native adapter is generated. A regular
file conflict, unrecorded edit, stale hash, malformed manifest, symlink, or existing
backup with different content stops the operation. Identical backups are idempotent.
Backups stay inside the repository. Use separate BACKUPS/adopt and
BACKUPS/generate phases so an approved source
update preserves both the pre-adoption state and the adapter it replaces.
Writes are crash-consistent per file: each completed replacement is a whole, fsynced
file. An interruption can leave some files current and others stale; check reports
that drift without changing anything, and rerunning the write operation converges it.
There is no background lock, journal, rollback, or cleanup of unknown temporary files.
An existing backup-directory symlink is always rejected before path resolution.
Use python3 "$KERNEL_GOVERNANCE_SYNC" init REPO --backup-dir
REPO/.kernel-governance-backups/init only when the user explicitly wants governance
created in a repository where both native files are absent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

