AI-Rig / plugins
AGENTS.md31 starsChanged 3 months agoApache-2.0View on GitHub
Root AGENTS.md and the shipped Codex Rig global template (plugins/codex-rig/assets/AGENTS.md) already apply here and are not restated: edit scope (root), core principles, multi-OS executables, benchmark isolation, focused delegation, Markdown structure and no-wrap (template), and the test/lint workflow (both). This file adds only what is specific to authoring plugins.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- benchmarks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- plugins/CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
40 rules. About 0 are common, 19 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 7
Keep intentional agent-specific diffs and note when no counterpart change is needed.
- Very specific: line 15
Run .venv/bin/python -m pytest -q plugins/<name> for the touched plugin.
- Very specific: line 17
When plugins/<name>/scripts/build_package.py and validate_package.py exist, build into a temporary directory and validate the produced …
- Distinctive: line 36
Ask the user when evidence cannot establish whether a difference is intentional, the correct common behavior is ambiguous, or a counterpart …
- Very specific: line 37
Before completion, repeat the scan for missed or stale uses, run affected contract/calibration/package checks, and summarize synchronized …
- Very specific: line 42
Use # for real Markdown headings and, inside fenced bash or python blocks, code comments.
- Very specific: line 43
Never use # as a fake prose comment or load directive because plain-text # breaks heading hierarchy.
- Very specific: line 49
Every file must work after claude plugin install <name>@borda-ai-rig.
- Very specific: line 51
Do not hardcode sibling-plugin paths, plugins/<name>/ directories, or absolute user or temporary paths.
- Distinctive: line 58
Treat each plugin as independently installable: never use local or relative paths to another plugin.
- Very specific: line 59
Use plugin-prefixed agent or skill names, such as foundry:sw-engineer.
- Distinctive: line 63
Never propose a prerequisite-plugin or global-registration dependency as the resilience mechanism.
- Distinctive: line 68
Add the consumer reference before creating the shared file.
- Distinctive: line 70
Keep resilience code in the plugin whose users need the fallback, not in the plugin that may be absent.
- Very specific: line 71
Every plugin resolves its own skills/_shared through its own resolver and reads only files it ships itself.
- Very specific: line 72
Never use $HOME/.claude/skills/_shared/...
- Very specific: line 73
Never read another plugin's _shared or bin/ either (except the optional-provider instances and the loop-checker resolver below).
- Distinctive: line 93
Every diagram closes with a footer stating its non-normative status, the update obligation and its normative source.
- Very specific: line 108
Use bin/ only for deterministic transforms such as argument parsing, path resolution, or one-value computation.
- Very specific: line 109
Keep decision flow, branching prompts, and agent dispatch in SKILL.md prose.
- Very specific: line 110
Use Bash only for install-path resolution, safe $ARGUMENTS parsing, or simple find | sort | head pipelines without business logic.
- Distinctive: line 116
Every instruction that adds to a ledger names its mechanism.
- Very specific: line 131
Every changelog bullet states what changed and its user-visible impact.
- Very specific: line 138
Before changing a version, run git diff HEAD --name-only -- plugins/<name>/ and stop with no bump when every changed path is under tests/, …
- Distinctive: line 141
Only entries for changes this commit lands count.
- Distinctive: line 142
Test-only changes need no bump.
- Very specific: line 144
After calculating the bump, update every shipped runtime manifest, including .codex-plugin/plugin.json when present, so it shares the …
- Distinctive: line 146
Update CHANGELOG or release metadata only when a change affects shipped product or plugin behavior and the plugin convention requires it.
- Distinctive: line 151
Default to relaxed; tighten only with a concrete, user-accepted justification.
- Distinctive: line 158
Never enumerate bypass strings to grow the guard: repeated reviews grew it from about 328 to about 2800, then about 3400 lines and kept …
- Distinctive: line 159
Add quiet classes only with a positive model: a short explicit allowed-program-and-option table, never a known-bad deny-list, because quiet …
- Distinctive: line 162
Read-only entries never gain write options.
- Distinctive: line 164
No round, finding, probe or task numbers in test names, titles, labels, markers or comments.
- Very specific: line 168
Before editing policy, inspect the document-level policy-sibling-sync contract and any section-specific policy-sibling marker.
- Distinctive: line 170
Before completion, verify the intended README and cross-references.
- Very specific: line 171
Run plugins/cc_foundry/bin/propagate_shared.py with no flag when shared files are involved — check mode is the default.
- Very specific: line 172
Run check_orphaned_bin.py when bin/ files are involved.
- Very specific: line 173
Before a mass edit of shipped files, search the repo for the sha256 of each target's HEAD bytes (git show HEAD:<path> | shasum -a 256), not …
- Distinctive: line 174
Run the relevant tests or lint checks.
- Distinctive: line 175
Run git diff --check on every owned file and confirm added prose paragraphs are not hard-wrapped.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md 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
Plugin Authoring Rules
<!-- policy-sibling-sync: CLAUDE.md, AGENTS.md, plugins/AGENTS.md, plugins/CLAUDE.md -->- A policy change in one listed file → relevance review of all other listed files before done.
- Sync applicable shared policy in both directions.
- Keep intentional agent-specific diffs and note when no counterpart change is needed.
- Apply these rules to every file under
plugins/. plugins/CLAUDE.mdremains the full authoring reference, and this file is the Codex-facing distillation.
Root AGENTS.md and the shipped Codex Rig global template (plugins/codex-rig/assets/AGENTS.md) already apply here and are not restated: edit scope (root), core principles, multi-OS executables, benchmark isolation, focused delegation, Markdown structure and no-wrap (template), and the test/lint workflow (both). This file adds only what is specific to authoring plugins.
Plugin Workflow
- Run
.venv/bin/python -m pytest -q plugins/<name>for the touched plugin; use focused test paths while iterating, then the full plugin suite before completion. - OpenCode Rig runs on Node instead: use
npm --prefix plugins/opencode-rig run check(ormake rig-check) for the full gate andnpx vitest run tests/<path>for a focused suite. It has no pytest module. - When
plugins/<name>/scripts/build_package.pyandvalidate_package.pyexist, build into a temporary directory and validate the produced package before commit. - There is no shared automatic release command. Update the owning manifests and CHANGELOG, validate the package, and leave remote publication to the human workflow.
- Completion requires relevant tests, lint/format where applicable, package validation where available, README synchronization, the SemVer gate, and
git diff --check.
Plugin Tests
- Ruff (the pinned
ruff-checkpre-commit hook) enforces docstrings on every test module, class, method and function (D100–D103, tests only), the 120-character docstring line (W505), and thepytest.skip()ban (TID251). The remaining test-style rules live in foundryrules/python-testing.md§Mechanical Enforcement and Codex Rigshared/global-baseline-details.md§"Testing details" and are checked by review; fix the test, never add a custom checker script. - Classify a check before writing it: if the test did not exist, could anything actually break undetected? If not, it is linting and belongs in a pre-commit hook or Ruff rule, not pytest.
- Shared test helpers and fixtures stay inside the same plugin's
tests/directory, inconftest.pyor an_-prefixed module. Never import across plugins:installed_plugintests run from the installed plugin without the repository. - Past 15 test files, a plugin's
tests/groups into topic subfolders of 4 or more files; helpers and the tree-wideconftest.pystay at the plugin'stests/root. Full rule: foundryrules/python-testing.md§File Layout and Codex Rigshared/global-baseline-details.md§"Testing details". - Shipped executables (
bin/, hooks) stay independent, self-contained scripts and never import a test helper. Byte-identical propagated copies stay identical; a test's convenience never justifies diverging one. - Real-tool tests —
integration,packaging,installed_plugin,live, and end-to-end hook runs — stay real. Mock only boundaries the test does not cover, never for speed. - Contract tests over shipped Markdown (skills, rules, agents) parse it line by line, per foundry
rules/python-testing.md§Tests Reading Markdown or Prose. Never reflow or edit instruction Markdown to make a test pass.
Change Consistency
- Before any plugin addition, edit, or deletion, ask which other uses share the same behavior or contract, then scan the owning plugin and other plugins for similar implementations, invocation patterns, consumers, documentation, tests, and calibration cases. Do not limit the scan to exact names or already-touched files.
- Record relevant counterparts before implementation. Apply the change to every counterpart that shares the contract, including removal of obsolete references after deletions; extend file ownership and verification scope explicitly when needed.
- Preserve intentional differences in behavior, permissions, platform support, and plugin independence. Similar wording alone does not justify identical changes, a shared abstraction, or a new cross-plugin dependency.
- Ask the user when evidence cannot establish whether a difference is intentional, the correct common behavior is ambiguous, or a counterpart requires authority outside the requested scope. Present the concrete counterparts and recommended treatment; continue unaffected authorized work.
- Before completion, repeat the scan for missed or stale uses, run affected contract/calibration/package checks, and summarize synchronized counterparts plus intentional exclusions with reasons. A confirmed applicable counterpart left inconsistent keeps the task incomplete unless the user explicitly defers it.
Markdown Annotation Convention
- In plugin Markdown, write prose annotations, notes, and load directives as
>blockquotes. - Use
#for real Markdown headings and, inside fencedbashorpythonblocks, code comments. - Never use
#as a fake prose comment or load directive because plain-text#breaks heading hierarchy. - Comments in procedural code explain only WHY: non-obvious constraints, workarounds, incidents, or safety rationale.
- Comments in example or pattern code may also explain expected output, motivation, or when to apply the pattern.
Installability
- Every file must work after
claude plugin install <name>@borda-ai-rig. - Assume only the installed plugin path, never the source tree.
- Do not hardcode sibling-plugin paths,
plugins/<name>/directories, or absolute user or temporary paths. - Each executable Claude block begins
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name <plugin>) || exit $?; export PLUGIN_ROOT, then calls helpers aspython "$PLUGIN_ROOT/bin/<name>.py". The host substitutes the plain token in skills and agents; loaders render it in loaded fragments. Never use defaulted tokens or cwd-relative bootstrap paths. - The shared resolver selects the install record before validated cache versions; source fallback is last and restricted to its own AI-Rig checkout with cwd inside that checkout. Use a plugin loader or
render_plugin_root.pyfor fragments containing executable bootstrap tokens;catis only for token-free documents. Codex recipes retain their explicit portable-launcher policy. - Codex agent waits follow Agent Waits, including blocking waits, status reporting and the owning workflow's deadline. Claude
Agent()background notifications and health monitoring follow Claude installability; they do not govern Codex waits.
Independent Plugins and Cross-References
- Treat each plugin as independently installable: never use local or relative paths to another plugin.
- Use plugin-prefixed agent or skill names, such as
foundry:sw-engineer. - An agent
subagent_typemust match its filename. - Cross-plugin calls and prose references must check whether the dependency plugin is available and degrade gracefully when it is absent.
- Annotate prose command references with (requires
<plugin>plugin). - Never propose a prerequisite-plugin or global-registration dependency as the resilience mechanism.
Shared Files and Orphan References
- Each file added under a skill's
modes/,templates/, or_shared/must either have its basename as a literal string in a consumer Markdown file or carry a<!-- file: <basename> — consumers: ... -->header. - Add the consumer reference before creating the shared file.
- Manifested shared files are byte-identical copies: edit the canonical file, run
plugins/cc_foundry/bin/propagate_shared.py --apply, and verify by running the script with no flag at all. Check mode is the default and has no flag; passing--checkexits 2 withunrecognized arguments. - Keep resilience code in the plugin whose users need the fallback, not in the plugin that may be absent.
- Every plugin resolves its own
skills/_sharedthrough its own resolver and reads only files it ships itself. - Never use
$HOME/.claude/skills/_shared/...or a bare.claude/skills/_shared/...path./foundry:setupsymlinks onlyrules/*.mdandTEAM_PROTOCOL.md, and purges any leftover~/.claude/skills/link; a directory carryingSKILL.mdthere registers as a user-level skill and shadows Claude Code's bundled skill of the same name. - Never read another plugin's
_sharedorbin/either (except the optional-provider instances and the loop-checker resolver below); duplicate the content into each plugin and add apropagate_shared.pyMANIFEST entry instead of borrowing. - One exception, the optional-provider contract: a consumer may read or execute a provider plugin's shipped file at runtime when the consumer's feature is a no-op without that provider, resolution goes through the active install record (
resolve_shared_path.py <provider> <subdir>, registry tier first; the resolver's newest-cache tier is a degraded fallback reached only without a usable install record or when the recorded install lacks the subdir, and a wrapper never globs the cache itself), and absence degrades to the consumer's own fallback line. Current instances:resolve_shared_path.py codemap-py claude-skills/_sharedreads the provider contract;resolve_shared_path.py foundry binexecutes the provider'scompact_gate.pyrather than reading a file, with a same-line[ -f "$_GD/compact_gate.py" ]presence check and the consumer's own fallback echocompact-gate: continue (foundry gate unavailable). Add each new instance to this enumerated list and audit Check 27. All three conditions apply to both. Content needed to survive a plugin's absence never qualifies. - A second exception, the loop-checker resolver:
rules/_full/adversarial-loop.mdships byte-identical in every Claude plugin (propagate_shared.pyMANIFEST, canonicalplugins/codex-rig/shared/adversarial-loop.md), so it cannot name its own plugin. Its Claude resolver globs the cache for any plugin's byte-identicalbin/adversarial_loop.py, takes the newest by modification time whose version directory carries no.orphaned_at, and falls back to the source tree. Under mixed releases the pick may come from another release; newer checkers still read older ledger and actions schemas. No other rule, skill or wrapper may glob the cache for a sibling'sbin/. - Audit Check 27 enforces both halves.
README Synchronization
- Any edit to
agents/,skills/,rules/, orhooks/requires the owning plugin README to be updated before completion. - Synchronize tables, descriptions, triggers, scope, NOT-for boundaries, hook behavior, user-facing arguments, invocation syntax, cross-plugin references, model-tier lines, relationship tiering, and relevant curator antipatterns.
- Propagate changed interfaces to every cross-plugin README that mentions them.
Diagram Sync — animated SVG architecture diagrams
<!-- policy-sibling: plugins/CLAUDE.md §Skill Diagram Sync -->A plugin may ship animated SVG diagrams of its runs, blocking gates, agent fan-out and any work that overlaps: one per multi-agent or multi-gate skill at <plugin>/assets/images/<skill>-arch.svg, and one plugin-level overview of how the plugin's parts connect at <plugin>/assets/images/<plugin-topic>-architecture.svg. Each is embedded in the matching README section. A diagram is documentation, never a contract: no skill loads it, and it carries no authority.
SKILL.md,modes/*.md,shared/contracts, and source win on any disagreement. A diagram that contradicts them is a defect in the diagram, never a licence to change behavior to match the picture.- Update the diagram in the same change as any edit to step order, gate placement, agent fan-out, spawn width, what runs beside what, a route or mode topology, or a process boundary, permission or transport a plugin-level diagram shows. Review every diagram that names the touched skill or component; record "no diagram change needed" when none applies. A stale diagram is worse than none.
- Edit the SVG text directly, keep every fact in
<text>so it stays greppable, and render it once to confirm nothing overlaps. No script, external font or link inside the SVG: it must render inside an<img>on GitHub. - Every diagram closes with a footer stating its non-normative status, the update obligation and its normative source.
- Each
SKILL.mdwith a skill diagram carries one HTML comment after the frontmatter and before its first heading naming the SVG, so an editor meets the obligation at the point of edit. - Claim an overlap only where the skill genuinely dispatches work in one wave. Never document aspirational parallelism.
- Format is a block schema, not a step list: named blocks flow top to bottom,
FAN nmarks concurrent lanes dispatched together andJOINwhere they are collected; a split into mutually exclusive paths is a branch, never aFAN. Every arrow beyond plain "block finished, next block starts" carries a short pill naming its condition, bound or reason. A stage drawn more than once is a dashed↺reuse ghost of one solid home card. Keep fonts at 10.5px or larger. - Cards stay short and structured: at most 4 fragment lines of about 45 characters (
label: value,A · B · C), never sentences; longer detail goes into a compact table row or stays in the normative source. Mark the key noun, gate or artifact with a bold<tspan>(at most 2 per line) and qualifiers, conditions and bounds with an italic<tspan>; never bold a whole line. Emphasis stays inside the same<text>so every fact remains greppable. - Optional per skill: add one where runs, gates and fan-out are hard to hold in the head, and skip it for a linear single-agent skill. A plugin without multi-agent skills ships the single plugin-level overview instead.
- Shipped Codex Rig files are digest-listed: after editing a diagram or the
SKILL.mdcomment, regenerate its manifest withbuild_package.py --updateand runscripts/check_codex_private_refs.py; write SVG path commands asM 56,518, neverM56,518, since its work-item patternM\d{2}flags the latter. - Claude counterpart:
plugins/CLAUDE.md§Skill Diagram Sync (same obligations;SKILL.mdandmodes/*.mdare its normative sources, and there is no manifest regeneration).
Python and bin/ Policy
- Python is the default
bin/language and requires Python 3.10+, type hints, a module docstring, anif __name__ == "__main__"guard, and ruff-format at 120 columns. - OpenCode Rig is the TypeScript exception: its
bin/entrypoint and release scripts are ESM.mjswith a Node engine floor declared inpackage.json, formatted by Prettier, and gated bynpm run check. Do not add a Python launcher or use these files as a pattern for Python plugins. - Interpreter bootstrap exception: the shared
bin/pythonPOSIX shell launcher and native Windowsbin/python.cmd, plus Codemap runtime launchers, may select and validate Python before any Python code can run. Keep application logic in Python; bootstrap preserves arguments, streams, and exit status without workload retries. - Pure functions use doctests; code that performs I/O, subprocesses, environment reads, or argv parsing uses pytest coverage in the adjacent
tests/directory. - Use
bin/only for deterministic transforms such as argument parsing, path resolution, or one-value computation. - Keep decision flow, branching prompts, and agent dispatch in SKILL.md prose.
- Use Bash only for install-path resolution, safe
$ARGUMENTSparsing, or simplefind | sort | headpipelines without business logic. - Inline SKILL.md Python is limited to cases requiring JSON parsing, multiline string manipulation, or numeric computation.
Growing Ledgers
- A file that only grows —
.jsonlrecord logs,.tsvrows,.logfiles, diaries, journals, results ledgers — is appended to, never re-written; a read-modify-write round trip can silently drop or reword earlier records. - Every instruction that adds to a ledger names its mechanism; "append", or "append with the Write/Edit tool", is not one.
- A model-valued record is staged as one record in
<ledger>.rec, then appended by the plugin's ownbin/append_ledger.py "$LEDGER", which supplies a missing trailing newline and deletes the staged file. Do not usecat … >> … && rm -f …:rmis outside Claude's plugin allow list and blueprint manifest, so that form prompts on every append. - Parallel writers stage separate
<ledger>.<writer>.recfiles, appended by oneappend_ledger.pycall after all writers return. Values already in the shell are appended directly withprintforjq -credirected with>>; files already on disk withappend_ledger.py "$LEDGER" --from <files>. - Corrections are appended as new event records and readers take the last record per key; values derived later go to a sidecar file, not back into the ledger.
- A helper that owns a ledger's schema appends and validates it itself, for example
gap_ledger.pyfor a run'sgaps.jsonl(cc_oss stages gap-only records ingaps.jsonl.recand callsgap_emit.py append, which fills the run identity and delegates togap_ledger.py), and neverappend_ledger.py. - Exempt, where editing or rewriting is correct: single-value state, mtime-clock
agent-watch-*.tsvbatch files, compaction contracts, digest- or validator-bound rendered artifacts, dedup and merge reconciliation, the artifact being refined, and frozen plans. tests/instructions/test_append_only_ledgers.pyenforces the instruction wording;plugins/CLAUDE.md§Growing Ledgers holds the full rationale.- Codex Rig keeps the same
.recstaging but has noappend_ledger.py: the helper that owns a ledger's schema appends and validates the staged record (codex-rig/shared/native-skill-contract.md§Append-Only Ledgers). Intentional difference — Codex has no permission matcher or blueprint manifest to satisfy, and per-schema validation rejects a bad record before it lands.
Version Pre-Bump Gate
- Apply the repository Version Continuity rule to serialized artifact schemas separately from this plugin SemVer gate; compare each schema family with its own committed
HEADbaseline before handoff. - Every commit touching a plugin's non-test file must apply exactly one SemVer bump to that plugin from its HEAD baseline (from the commit's parent when amending or rewriting a commit that already bumps — root
AGENTS.md§Version Continuity), except a generated package manifest updated only to record test-file bytes. - A commit changing only files under
plugins/<name>/tests/needs no bump. When the plugin ships its tests, regenerate and validate the package manifest for those test bytes without bumping the version or updating the changelog. - Pure test, CI, and documentation changes need no changelog entry unless they change shipped product or plugin behavior.
- Every changelog bullet states what changed and its user-visible impact. A bare file or mechanism name ("Sync report-header-table.js", "update helper", "refactor") says nothing; name the behaviour, and trace each claim to the diff.
- A changelog entry claiming a cost, token or time saving cites
(measured: <label>)for a complete before/after pair or says(unmeasured). Runpython plugins/cc_foundry/bin/profile_pair.py check-claims plugins/<plugin>/CHANGELOG.md --section Unreleasedfor a pending## Unreleasedsection. When amending a commit that already renamed the pending section, use--section <version>with that commit's version heading. The command exits 1 when the named section matches no heading. - Changelog shape is a plain list: every line of a section is a
-entry or a sub-entry of one, with no free paragraph before, between or after entries and no blank lines between items. One entry per topic: a few related sentences saying what changed and its user-visible impact, compact but complete. Sub-bullets only enumerate parallel items. No rationale, implementation mechanics or long example lists; compress, never drop a change. Match the released sections below. mdformat turns the whole list loose when any item has a blank line and re-adds every blank removed one edit at a time, so delete them all in one write and confirm the section has none. - Versions are decided at commit time. While editing, a plugin's manifests keep their
HEADversion; the commit step runs the checklist below, writes the single bump to every shipped manifest and renames that plugin's## Unreleasedchangelog heading to## <version>in the same commit, so the heading equals every shipped manifest. An entry-exempt change has no## Unreleasedsection: there is no heading to rename and the bump alone lands. When the version is determined, also consolidate that version's changelog entries in the same step: apply the grouping rule below (one entry per topic, same-topic entries adjacent and merged, reverted changes dropped, most user-visible first) before the heading is renamed. - Changelog is continuous refinement under
## Unreleased: edit it as you work, not at commit time. When a change is notable (user-visible behaviour, contract, permission, flag or default), add an entry for it or update the existing entry for that topic in the top## Unreleasedsection, creating it above the newest released heading when missing. Refine an entry instead of appending a second one when the same topic changes again, and drop it when the change is reverted. A heading that exists inHEAD's changelog is released history: never add or reword a bullet there; a change that needs one is a new entry in## Unreleased. When amending a commit that already flipped its heading, the baseline is that commit's parent and its own heading is the pending section. - Changelog grouping: keep a section readable and consistent with one top-level entry per topic (a feature, workflow, guard, platform or fix family), entries of one topic adjacent, the most user-visible topics first, and topic wording reused from earlier sections of the same file. Sub-bullets enumerate parallel facets of that topic. Merge small related fixes into one entry instead of one entry per file or commit.
- Each touched plugin is evaluated independently, and one commit applies at most one bump per plugin.
- Before changing a version, run
git diff HEAD --name-only -- plugins/<name>/and stop with no bump when every changed path is undertests/, or the only additional path is the generated package manifest updated for those tests. - Otherwise read the baseline with
git show HEAD:plugins/<name>/.claude-plugin/plugin.json | grep versionand the on-disk version withgrep version plugins/<name>/.claude-plugin/plugin.json; when disk already differs from HEAD, still calculate the bump from HEAD and require the on-disk value to equal it, else reset it to the result. - Classify the bump from the plugin's
## Unreleasedchangelog section, the running record of its notable changes, not from a fresh read of the diff. Minor (X) when an entry describes a new capability, agent, skill, or designed behavior, resetting patch to zero. Patch (Y) when every entry is a fix, wording change, refinement, or restoration of intended behavior, and also when a non-test file changed with no## Unreleasedsection (refactor, cleanup, internal restructuring). - Only entries for changes this commit lands count. A change that deserves an entry but has none is a changelog defect: add the entry, then classify. The commit step reads file names only (
git diff HEAD --name-only), never the full diff, to classify. - Test-only changes need no bump.
- Calculate from HEAD and write exactly that single bump; never increment from a previously bumped on-disk value.
- After calculating the bump, update every shipped runtime manifest, including
.codex-plugin/plugin.jsonwhen present, so it shares the bumped version with.claude-plugin/plugin.json. - OpenCode Rig is the npm exception. Apply the HEAD-derived bump to
plugins/opencode-rig/package.json, then runnode plugins/opencode-rig/scripts/sync_version.mjs --writeto update the three mirrors (rig.json,src/version.ts, and the README marker). Verify withnode plugins/opencode-rig/scripts/sync_version.mjs --check. - Update CHANGELOG or release metadata only when a change affects shipped product or plugin behavior and the plugin convention requires it.
Permission Gates
- A feature that adds a permission gate, approval question or stop first diffs its gate list against
HEADbehaviour; an operation that ran without a stop atHEADkeeps running without one unless the user asked for the new stop. - Default to relaxed; tighten only with a concrete, user-accepted justification. Push stays always-ask and force push forbidden; no other git class gains an always-ask stop.
plugins/CLAUDE.md§Permission Gates — Diff Against HEAD holds the Claude counterpart.
Shell-Text Guards — What Not To Do
Repository-maintainer rules for the opencode-rig shell guard; not applicable to shipped user content.
- Never enumerate bypass strings to grow the guard: repeated reviews grew it from about 328 to about 2800, then about 3400 lines and kept finding holes in new spellings.
- Add quiet classes only with a positive model: a short explicit allowed-program-and-option table, never a known-bad deny-list, because quiet needs understood behaviour.
- Say in user docs: text classifier = speed bump, not security boundary; further hardening needs sandboxing or isolation because string rules cannot enforce it.
- Fix a review budget first; when spent, document limits and open gaps instead of widening, because spelling enumeration does not converge.
- Read-only entries never gain write options; programs that write or run code leave the list, because names do not establish safety.
- Resolve program identity in one function for every lookup; no second raw-spelling match, because divergent identity creates bypasses.
- No round, finding, probe or task numbers in test names, titles, labels, markers or comments; name by scope and behaviour and merge into scope-named files, because evidence must stand alone.
Verification
- Before editing policy, inspect the document-level
policy-sibling-synccontract and any section-specificpolicy-siblingmarker. - Review every listed instruction sibling even when no synchronized edit is ultimately needed, and update applicable shared policy in either direction.
- Before completion, verify the intended README and cross-references.
- Run
plugins/cc_foundry/bin/propagate_shared.pywith no flag when shared files are involved — check mode is the default. - Run
check_orphaned_bin.pywhenbin/files are involved. - Before a mass edit of shipped files, search the repo for the sha256 of each target's
HEADbytes (git show HEAD:<path> | shasum -a 256), not its git blob OID, excluding regenerated manifests; leave digest-pinned files untouched (plugins/CLAUDE.md§Edit Quality Gate). - Run the relevant tests or lint checks.
- Run
git diff --checkon every owned file and confirm added prose paragraphs are not hard-wrapped.
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.

