General-purpose coding policy for Baruch's AI agents
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
Coding Policy is a context plugin for Baruch’s AI agents. It gives them a small, language-agnostic set of engineering rules and a repeatable way to release changes. The rules cover commits, tests, errors, dependencies, file hygiene, CI, secrets, and formatting.
Keep shared rules focused on decisions that apply across repositories. Put release and onboarding steps in their on-demand skills, and leave repository-specific conventions in the repository that owns them. Add automation when it prevents a concrete failure that instructions or the platform cannot already handle.
See CHANGELOG.md for version history.
Install with ACR.
acr install github:jbaruch/coding-policy@latest
acr realizeIf ACR is unavailable in your project, use Tessl as a legacy fallback. Ask your project operator to plan a migration to ACR. These instructions do not migrate existing installations automatically.
tessl install jbaruch/coding-policyInstall Python 3.11+ and Go 1.24.11+. In an isolated Python environment, install pre-commit at the pinned revision below (v4.7.0), then run these commands from this repository's clone:
python3 -m pip install 'git+https://github.com/pre-commit/pre-commit@65bb884a567e8be6adc51e8bfbcf26f708eb35a2'
pre-commit install --install-hooks
pre-commit run gitleaksThe repository-local hook uses Gitleaks
to scan staged changes, redact matches in its output and block matching commits.
Run setup in each clone before committing. These commands change no global hooks
or Git configuration. Renovate renews the frozen Gitleaks revision in
.pre-commit-config.yaml; manual updates use pre-commit autoupdate --freeze.
Maintainers review pre-commit's installation pin monthly and re-pin its release
commit above in a dedicated dependency change.
After editing .github/renovate.json, run this command from the repository root.
npx --yes --package=renovate@45.11.2 -- renovate-config-validator --strict --no-global .github/renovate.jsonMaintainers check the validator pin against Renovate releases monthly and update it in a dedicated dependency change when a newer stable release is available.
--no-global checks the file as repository configuration. --strict makes the
check fail if the file needs migration. The
dependencyDashboard.autoclose
setting lets Renovate close the dashboard issue when no updates remain.
Compact rules keep startup boundaries and point to the relevant coding contracts before each affected action. References load through explicit reads; conditional frontmatter does not reduce Tessl imports. Combined native-session acceptance lives in the acceptance record.
| Category | Rule | Summary |
|---|---|---|
| Git | commit-conventions | Imperative mood, one change per commit, PR hygiene |
| Git | sync-before-work | Fetch and branch from the fresh remote default |
| Policy | required-read | Read the named sections or entire reference explicitly in its owning plugin. Missing content stops the affected action. |
| Testing | testing-standards | Outcome-based, deterministic, no binary fixtures |
| Errors | error-handling | Specific exceptions (with outer-boundary process-contract carve-out), actionable messages, structured logging |
| Deps | dependency-management | Stdlib-first, pinned versions kept fresh via a renewal mechanism, lock files |
| Files | file-hygiene | Proper .gitignore, no generated files committed |
| CI | ci-safety | Never skip tests, never modify CI without asking |
| Secrets | no-secrets | No credentials in code, env vars or secrets manager |
| Style | code-formatting | Use project's formatter, don't mix style with logic |
| Types | language-diagnostics | Enable the project's language server; its findings are non-dismissible without cause; gate the headless checker in CI at zero findings |
| Authoring | context-artifacts | Plugin structure, rule format, review iteration, surface sync, consistency checks |
| Authoring | context-writing-style | Prose discipline for rules, skills, and READMEs — what to cut, what to keep, structural format. PR descriptions carry the archive |
| Authoring | rule-frontmatter | Frontmatter conventions for rule files — passthrough, tiered host filtering of conditional rules, when to path-scope |
| Authoring | skill-authoring | SKILL.md structure, step numbering, typed calls, plugin.json reference |
| Authoring | script-delegation | Deterministic → script, fixed answers read by meaning → bounded classification, everything else → LLM. Standing operator approval permits direct routing within recorded question, model, score and action bounds. Script stdout carve-outs for paths, versions and wrapped commands |
| Authoring | script-as-black-box | Skills reference the script's contract (inputs/outputs/exit codes), not its internal logic — thresholds and predicates live in the script |
| Authoring | stateful-artifacts | Cross-invocation state: schema, owning skill/runtime/service, schema_version, reader contracts and migrations; runtime-owned tables use their migration schema |
| Review | reviewer-feedback-reading | Read all original review bodies and inline comments before disposing of feedback or merging. |
| Review | review-severity | Require a supported path or binding contract for blockers about claimed states. Verify findings independently before acting. |
| Design and review | simplicity | KISS and YAGNI — build only what today's problem needs; overengineering is forbidden, and machinery without a current caller or observed failure is a review finding; calibrate reviewers with matched inputs and useful outcomes |
| Concurrency | agent-worktree-isolation | Mandatory git worktrees for concurrent agent work; cleanup; read-only exception |
| Discipline | boy-scout | Fix coherent in-scope defects; record unrelated blocking risks once; advisories and maintenance create no delivery obligation |
| Scope | external-repo-contributions | Default deny on issues, PRs, comments, reactions, and discussions in repos the operator does not own; explicit permission required per repo and action type |
| Communication | response-clarity | Lead with the answer or action. Give verifiable outcomes and plain errors. Confirm destructive actions. |
| Discipline | ship-on-green | Merge authorized work once required gates pass, without asking twice. |
| Automation | hook-action-reporting | Summarize actionable startup findings and leave reported work alone without authorization. |
| Skill | Description |
|---|---|
| coding-contracts | Binding policy detail loaded before the action named by each rule router; ordinary startup loads the compact boundaries. |
| release | PR creation or explicit source-verified existing-PR resumption, Codex policy review + Claude code-quality review, merge + publication confirmation and cleanup |
| onboard-repo | Bootstrap a consumer repo onto coding-policy, then open a PR. Scaffolds the fleet reviewer (.github/fleet-review-enabled marker, a thin .github/workflows/review-trigger.yml that fires immediate Codex policy and Claude quality reviews in coding-policy); pins jbaruch/* tessl deps to latest (third-party pins left as-is); and adds the tessl-generated-artifacts .gitignore block (keeping AGENTS.md/CLAUDE.md/GEMINI.md committed). The coding-policy-fleet-reviewer GitHub App reviews policy with Codex; the separate jbaruch-claude-reviewer App reviews code quality with Claude; both subscription credentials live only in coding-policy; the consumer sets one FLEET_DISPATCH_TOKEN PAT. Supports --override for in-place upgrades. |
| adopt-fork-pr | Classify a PR by number. Same-repo PRs pass through to the reviewer; fork PRs get adopted into the base repo as a same-repo PR, preserving the contributor's commits. |
| migrate-to-plugin | Migrate a legacy tile.json plugin to the .tessl-plugin/plugin.json form: runs tessl plugin migrate, renames .tileignore, removes the obsolete tile.json, re-lints, then reconciles residual "tile" wording to "plugin" while preserving contract surfaces. |
On-demand review calibration compares a small fixed PR sample with the same role, instructions and source packet for both models. Assess useful defects, unsupported blockers, unnecessary work and observed rounds. The ordinary Codex-policy and Claude-quality lanes have different contexts and do not establish a matched model comparison.
The fleet policy reviewer loads the latest published ACR release of Coding Policy. It selects additional GitHub packages from the captured target commit's root agents.yaml. Use an exact release tag or commit, or latest for a first-party package. The reviewer validates an authored agent-plugin.yaml at the captured PR head.
For legacy Tessl dependencies, fleet consumers can commit .github/fleet-review-manifests with one repository-relative manifest path per line, such as tessl-workspace/tessl.json. Blank lines and comments beginning with # are allowed. The policy reviewer reads the list and manifests from the captured PR target commit. An absent or blank/comment-only list uses only the root tessl.json for Tessl. First-party (jbaruch/) plugins may use latest in extra manifests; third-party plugins declare exact registry versions. Missing or invalid optional manifests and unavailable optional installs appear in the review summary while review continues with the available rules.
A structurally valid jbaruch/nanoclaw-core declaration with a version and no source in a trusted Tessl manifest enrolls Core. The reviewer installs its own fixed Core version regardless of the declared version. If the reviewer cannot materialize enrolled Core, it stops before review.
The central publisher is retired. The historical publication contract retains source-bound resolver, archive, proof and confirmation readers for existing releases. The finalizer archives previously admitted runs and supports explicit later source proof without publication or consumer writes. New releases use each consumer's reviewed publication workflow; the reusable publisher remains available.
The release skill owns the hooks.
| Hook | Event | Description |
|---|---|---|
| session-start | SessionStart (native: Claude Code + Codex; portable: other agents) | The plugin's only SessionStart entry. Native for Claude Code and Codex, so it keeps the session's environment; the portable entry serves other agents and exits under a native one, so each session runs it once. Runs the four hooks below in order and merges their statuses into one payload. A failed hook is reported as its own status line. Never blocks. |
| check-git-sync | SessionStart (via session-start) | Fetches origin every session and fast-forwards a local default branch strictly behind origin/<default>; git refuses a non-fast-forward or an overwrite of local changes, and the refusal is reported. Repo hooks do not run. A diverged branch is reported only. Never blocks. |
| check-tessl-latest | SessionStart (via session-start) | Runs tessl update --yes and reports every jbaruch/* dependency's version, flagging one pinned instead of latest (rules/dependency-management.md). Third-party pins are out of scope. Never blocks. |
| check-acr-latest | SessionStart (via session-start) | In a project with agents.yaml, runs acr freshness run --policy install once the checkout is freshly fetched, contains origin's default branch, and has a clean tree: reconciles ACR dependencies declared latest, realizes changed files, and reports ACR's output (a restart_required notice included). An unsafe checkout gets a "not updated" status naming why, and nothing changes. Pinned tags and commits never move; agents.yaml is not rewritten. An acr older than ACR_MIN_VERSION (top of the script) is reported, not run. It is the deterministic check for the Runtime-Managed Manifest Carve-Out's consumer agents.yaml (rules/dependency-management.md): it names github:jbaruch/* dependencies not at latest and refuses to update while .agents/registry.lock is committed or not gitignored. Silent without agents.yaml. Never blocks. |
| check-leftover-worktrees | SessionStart (via session-start) | Cleans the session's own repository through its owner script, skills/release/lib/prune-worktrees.sh. Idle clean worktrees origin holds and local branches origin holds or merged go silently. GitHub's delete-branch-on-merge setting handles merged PR branches on origin. Lists only what the operator must decide: idle dirty or unpushed worktrees and unpushed local branches. A failed, timed-out or tool-less check is one "could not check" line. Runs under skills/release/lib/bounded-run.sh and never blocks. |
| session-end-cleanup | SessionEnd (Claude Code + Codex), sessionEnd (Cursor) | Removes the ending session's opt-in .coding-policy-disposable scratchpad folder. See file-hygiene and the script's docstring for the cleanup contract. |
alwaysApply: true. Rules whose prescriptions only fire in specific files or actions are alwaysApply: false with applyTo: declaring the scope. A host may omit them by script, then bounded classifier, and the agent's model narrows whatever reaches it. See rules/rule-frontmatter.md.See fleet publishing for enrollment and release recovery.
.tessl-plugin
rules
skills
adopt-fork-pr
coding-contracts
references
migrate-to-plugin
onboard-repo
release
hooks
references