CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

jbaruch/coding-policy

General-purpose coding policy for Baruch's AI agents

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

README.md

jbaruch/coding-policy

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.

How to use

Install with ACR.

acr install github:jbaruch/coding-policy@latest
acr realize

If 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-policy

Contributor setup

Install 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 gitleaks

The 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.json

Maintainers 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.

What's Included

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.

CategoryRuleSummary
Gitcommit-conventionsImperative mood, one change per commit, PR hygiene
Gitsync-before-workFetch and branch from the fresh remote default
Policyrequired-readRead the named sections or entire reference explicitly in its owning plugin. Missing content stops the affected action.
Testingtesting-standardsOutcome-based, deterministic, no binary fixtures
Errorserror-handlingSpecific exceptions (with outer-boundary process-contract carve-out), actionable messages, structured logging
Depsdependency-managementStdlib-first, pinned versions kept fresh via a renewal mechanism, lock files
Filesfile-hygieneProper .gitignore, no generated files committed
CIci-safetyNever skip tests, never modify CI without asking
Secretsno-secretsNo credentials in code, env vars or secrets manager
Stylecode-formattingUse project's formatter, don't mix style with logic
Typeslanguage-diagnosticsEnable the project's language server; its findings are non-dismissible without cause; gate the headless checker in CI at zero findings
Authoringcontext-artifactsPlugin structure, rule format, review iteration, surface sync, consistency checks
Authoringcontext-writing-styleProse discipline for rules, skills, and READMEs — what to cut, what to keep, structural format. PR descriptions carry the archive
Authoringrule-frontmatterFrontmatter conventions for rule files — passthrough, tiered host filtering of conditional rules, when to path-scope
Authoringskill-authoringSKILL.md structure, step numbering, typed calls, plugin.json reference
Authoringscript-delegationDeterministic → 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
Authoringscript-as-black-boxSkills reference the script's contract (inputs/outputs/exit codes), not its internal logic — thresholds and predicates live in the script
Authoringstateful-artifactsCross-invocation state: schema, owning skill/runtime/service, schema_version, reader contracts and migrations; runtime-owned tables use their migration schema
Reviewreviewer-feedback-readingRead all original review bodies and inline comments before disposing of feedback or merging.
Reviewreview-severityRequire a supported path or binding contract for blockers about claimed states. Verify findings independently before acting.
Design and reviewsimplicityKISS 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
Concurrencyagent-worktree-isolationMandatory git worktrees for concurrent agent work; cleanup; read-only exception
Disciplineboy-scoutFix coherent in-scope defects; record unrelated blocking risks once; advisories and maintenance create no delivery obligation
Scopeexternal-repo-contributionsDefault deny on issues, PRs, comments, reactions, and discussions in repos the operator does not own; explicit permission required per repo and action type
Communicationresponse-clarityLead with the answer or action. Give verifiable outcomes and plain errors. Confirm destructive actions.
Disciplineship-on-greenMerge authorized work once required gates pass, without asking twice.
Automationhook-action-reportingSummarize actionable startup findings and leave reported work alone without authorization.

Skills

SkillDescription
coding-contractsBinding policy detail loaded before the action named by each rule router; ordinary startup loads the compact boundaries.
releasePR creation or explicit source-verified existing-PR resumption, Codex policy review + Claude code-quality review, merge + publication confirmation and cleanup
onboard-repoBootstrap 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-prClassify 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-pluginMigrate 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.

Historical central fleet publication

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.

Hooks

The release skill owns the hooks.

HookEventDescription
session-startSessionStart (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-syncSessionStart (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-latestSessionStart (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-latestSessionStart (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-worktreesSessionStart (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-cleanupSessionEnd (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.

Philosophy

  • Language-agnostic code rules. The code quality rules (commits through formatting) apply to Python, TypeScript, Go, Rust, Java — any language. No framework-specific assumptions.
  • Context authoring rules. These apply when working on plugin artifacts. Channel-specific requirements apply only to the channel in use.
  • One concern per rule. Each file covers one topic. Easy to read, easy to reference, easy to override if a project needs an exception.
  • Opinionated but practical. These rules reflect real patterns found across 17+ repositories and the Tessl plugin authoring workflow. They solve problems that actually come up when agents write and ship code.
  • Scoped by intent, filtered cheapest first. Universal rules are 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.

Maintainers

See fleet publishing for enrollment and release recovery.

README.md

tile.json