{"slug": "one-of-every-lever", "title": "One of every lever", "summary": "A developer rebuilt their production coding-agent charter—originally 25 rules, 17 skills, 7 review agents, 7 commands and 19 hook and gate scripts—as a 30-file, roughly 550-line skeleton with one of each lever around a toy split_cents money function. The skeleton pairs prose guidance (CLAUDE.md, path-scoped rules, skills, commands, agents, evals) with more than half its files as scripts, including five Claude Code hooks and two diff gates that check the agent actually followed the rules. The developer frames it as a teaching model rather than a drop-in starter, since the small version hides why the full charter grew.", "body_md": "The charter for the app I work on every day runs on nWave. It has 25 rules, 17 skills, 7 review agents, 7 commands, and 19 hook and gate scripts. It works, but I can’t see its shape anymore. So I rebuilt it with one of each lever around a ten-line toy service: 30 files, about 550 lines. I built it as an example for learners. The small version hides why the big one grew, so read it as a model, not a starter to drop into your repo.\n\nA charter is the set of standards a coding agent reads and obeys: the root instruction file, the rules, the skills, and the hooks. The harness is the machinery that applies those standards. I call each piece a lever: anything that constrains the model, whether it’s a rule, a hook, a skill, an agent, a setting, or the code itself. When I open the real charter, though, I see files. Every lever shows up eight times, and the repetition buries the design.\n\nA skeleton fixes that by cutting every lever down to one. You get one always-on rule, one path-scoped rule, one feature doc, one skill, one command, one agent, and one eval. Around those sit five hooks and two diff gates.\n\nThe domain is a toy, so apply it to your domain. It’s a split_cents function that divides money into parts and puts the remainder on the first part. Money makes a good toy because it’s easy to get wrong and expensive when you do, so the rules have something real to guard.\n\nHere’s the directory, minus the git files. The comment on each folder says what belongs there, and the comment on each file says what this one does:\n\n```\ncharter-skeleton/├── CLAUDE.md # the index: what loads, and what wins a conflict├── AGENTS.md # the same index, for hosts that read AGENTS.md├── CHARTER.md # facts no single rule owns, plus the rule schema├── GLOSSARY.md # domain terms and the aliases to avoid├── CHARTER-CHANGELOG.md # every charter change: what the agent must relearn├── Makefile # every command the agent is allowed to run├── .nwave/config.json # framework switches; general craft lives in nWave├── .claude/│ ├── settings.json # tools allowed and denied, and which hook fires when│ ├── rules/ # project facts, one area per file, loaded by paths:│ │ ├── commits.md # paths: \"**\" (always loaded)│ │ └── payouts-high-risk.md # paths: src/payout*.py (iron law)│ ├── features/ # reference for one area: flows, entities, gotchas│ │ └── payout-flow.md│ ├── skills/ # multi-phase jobs with a handoff at the end│ │ └── start/SKILL.md # intent → open PR, test first│ ├── commands/ # one-shot prompts you run by name│ │ └── learn.md # lesson → rule│ ├── agents/ # read-only review lenses no plugin provides│ │ └── scope-guard.md│ ├── evals/cases/ # probes: does a rule change what the agent does?│ │ └── integer-cents.md│ └── debt-ledger.md # known charter compromises a scan can't find├── scripts/│ ├── hooks/ # git hooks: the gate for humans and agents alike│ │ └── pre-commit # → make pre-commit│ └── charter/ # Claude Code hooks, diff gates, and their tests│ ├── session-start.sh # SessionStart│ ├── load-feature-docs.sh # PreToolUse: Read|Edit|Write│ ├── check-banned-tokens.sh # PreToolUse: Edit|Write│ ├── check-commit-msg.sh # PreToolUse: Bash│ ├── stop-hook.sh # Stop│ ├── check-diff-size.sh # diff gate: blast radius│ ├── check-regression-test.sh # diff gate: tests ship with src│ ├── charter-lint.sh # frontmatter and references│ └── hooks.test.sh # probes every hook├── src/payout.py # the toy domain, and a lever: the agent copies it└── tests/test_payout.py\n```\n\nLook at the split first. More than half the files are scripts, because the prose tells the agent what to do and the scripts check that it did. Then look at CLAUDE.md, which is short. It names the rules, says which layer wins when two disagree, and gets out of the way. Everything specific lives in a file that loads only when it’s needed.\n\nMy real charter sorts its levers into five pillars. The skeleton keeps that split because each pillar maps onto a folder or two.\n\n**Guidance** is what the agent reads: CLAUDE.md, CHARTER.md, the glossary, the rules, and the feature docs. Every rule carries the same frontmatter. That’s a description, the paths: that load it, a layer, a locked flag for iron laws, and a why. Don’t skip the why. A rule without a reason teaches the letter, and on the first edge case the agent guesses.\n\n**Guardrails** are what checks the agent. The tool posture in settings.json allows make and git and denies python and pip. So the agent has to go through the Makefile, where the gates live.\n\n**Workflows** are the repeatable jobs. /start takes one intent to one open PR. It sizes the work with nWave’s nw-auto, writes the failing test, and makes it pass. Then it runs the scope-guard agent and commits through the hook. Each step calls the framework’s craft skill instead of restating that craft.\n\n**Flywheel** is how a lesson becomes a rule: /learn and the eval cases.\n\n**Discipline** keeps the charter honest about itself. The changelog tells the agent what it has to relearn, and the debt ledger records the compromises a scan can’t find. Then make charter-lint catches the ones a scan can. The linter fails when a rule is missing a frontmatter field, or when CLAUDE.md names a rule that doesn’t exist.\n\nThe skeleton can stay this small because it runs on [nWave](https://nwave.ai/), an open-source delivery framework for coding agents. nWave carries the general craft: design, test design, review, refactoring, and root-cause analysis. The charter carries only what’s true for this project. I wrote about that split in [My charter only says what’s true here](https://blog.tacoda.dev/my-charter-only-says-whats-true-here-4e468fb77e54), and the skeleton shows it in four places.\n\nSo the skeleton’s rules are short because they don’t teach. Each one points at the craft it relies on and keeps the facts nWave can’t know.\n\nMost of the design comes down to one question. You have something the agent should know or do, so where does it go? The real charter answers that in its own files, and the answers stack into a ladder. Start at the top and stop at the first rung that fits.\n\nThe first four rungs come first because none of them adds charter text you have to keep true. Below them, every answer is a file somebody has to keep true.\n\nThe folder view hides the most useful thing about these levers, which is timing. Each one fires at a different moment in a turn, and the moment decides what it can catch:\n\n*Guidance arrives before the agent acts. Every refusal goes back to the agent, not to a person.*\n\nGuidance loads first. Claude Code loads a rule when the agent touches a file that matches its paths:. So payouts-high-risk.md appears the moment the agent opens src/payout.py, and stays out of context the rest of the time. Feature docs don’t get that treatment, so load-feature-docs.sh does the same job for them, and make charter-hooks-test checks that it loads each doc once per session.\n\nThen the sensors fire during the turn. check-banned-tokens.sh runs before every edit and refuses a breakpoint() or a stray print( in src/. Its partner, check-commmit-msg.sh, runs before every shell command. It refuses a commit whose subject isn’t type(scope): subject, and one that carries an AI attribution trailer. Both exit with code 2, which tells Claude Code to block the call and hand the message back to the agent.\n\nThe gates fire last. The git hook runs make pre-commit, which runs the two diff gates and the tests. The Stop hook covers the agent that says “done” with uncommitted code. It runs the same gate and won’t let the turn end until it passes, which turns “I’m done” from a claim into a check.\n\nThe diagram is easier to believe when you watch it run. So here’s one task, run against the skeleton: add a function that charges a 2.5% fee on a payout. That’s the same task as the eval case, so you can compare the two.\n\nThe agent’s first edit leaves a debugging line in the function. The edit hook catches it before the file changes:\n\n```\ncharter: refused edit to src/payout.py. Banned token (debugging leftover):2: print(total)Remove it, or mark one deliberate line with `# charter:allow`.\n```\n\nThe hook exits with code 2, so nothing lands. The agent drops the print, and the function goes in as total * 25 // 1000: integer cents, rounded down.\n\nNext the agent tries to commit with git commit -am “added fee”. The command hook reads the message before git ever runs:\n\n```\ncharter: refused commit. Subject 'added fee' is not type(scope): subject. See .claude/rules/commits.md.\n```\n\nSo the agent rewrites the subject as feat(payout): add fee_cents and tries again. This time git starts, and the git hook runs make pre-commit:\n\n```\ncharter: regression-test gate. src/ changed with no tests/ change. See .claude/rules/payouts-high-risk.md.make: *** [charter-gates] Error 2\n```\n\nThe agent writes a test that checks 1,999 cents gives a fee of 49, and the commit lands with four tests passing.\n\nYou get three refusals from three events: the edit, the command, and the commit. Each message also names the rule it enforces, so the agent gets the reason along with the refusal. None of the three needed a person. The only human moment left is the review of a diff that has already passed every check.\n\nI wrote about why rules and hooks come in pairs in [Rules feed forward, hooks feed back](https://blog.tacoda.dev/rules-feed-forward-hooks-feed-back-a86f1f6f1362). The skeleton keeps one of each pair, so you can see all of them at once:\n\nThe agent handles judgment and the script handles counting. You need both, because a file count can’t tell a rename sweep from scope creep. And an agent reviewing its own diff can talk itself into anything.\n\nOne rule has no script: integer cents. That gap is why the eval case exists. A regex can catch float( in a diff, but it can’t tell you whether the agent reaches for floats when nobody warns it. So integer-cents.md is a probe. It asks for a 2.5% fee function with no hint about money, then checks that the answer stays in integer cents. If it doesn’t, the rule isn’t reaching the agent on that path.\n\nA charter that only grows turns into the 25-rule version I couldn’t read. The flywheel is how it grows on purpose:\n\n*/learn waits for the second refusal, and a failing eval sends the rule back to it.*\n\n/learn looks only at what the run recorded, never at what the agent remembers. The strongest signal is a gate that refused the same thing twice. That means reality enforces a constraint the charter never stated. One occurrence doesn’t qualify, and “nothing qualified” is a valid answer.\n\nWhen something does qualify, /learn tightens an existing rule before it writes a new file. It shows you the diff, applies it on approval, and logs it in the changelog. An iron law also gets an eval case, so the next run can tell you whether the rule landed.\n\nThe real charter has exactly one eval case. I think that’s its most underbuilt lever, and the skeleton made that obvious in a way the full tree never did.\n\nThe case for keeping the big charter big is real, because most of what I cut exists to fix something that went wrong. The skeleton has no index of every rule and skill. It has no charter-which script to show what loads for a file against the 60 KB load budget. It has no drift scan for rules whose globs match nothing, and no cost metrics per card. And it has one skill where the real charter has 17.\n\nEach of those earned its place by solving a problem the skeleton doesn’t have yet. So treat it as the floor. If yours is much bigger, that’s fine, as long as you can still say which lever each file is.\n\nBuilding the small one paid off in the big one. It turned up a few bugs in the real charter and changed how it’s structured. The audit behind it also let me prune context that had gone stale.\n\nYou might expect me to start new repos from this skeleton and grow it one lever at a time. I wouldn’t. I’d script the scaffolding and then have the agent suggest what to fill in, the way I already do with [Keystone](https://tacoda.dev/keystone/). This skeleton has a toy project in it because without a project, the charter is meaningless. The scaffolding structure is what I would focus on scripting.\n\nThe skeleton is at [github.com/tacoda/charter-skeleton](https://github.com/tacoda/charter-skeleton). Clone it and run make install-hooks. Then run make charter-hooks-test and watch nine probes pass.\n\nNext, open your own charter and sort every file into one of the five pillars. The pillar with nothing in it is where your next lever goes.", "url": "https://wpnews.pro/news/one-of-every-lever", "canonical_source": "https://tacoda.medium.com/one-of-every-lever-5b9836a35af6?source=rss-bf474619cf47------2", "published_at": "2026-12-03 15:58:15+00:00", "updated_at": "2026-12-03 16:15:58.296118+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-safety"], "entities": ["nWave", "Claude Code"], "also_reported_by": [], "takeaway": "Pair each prose lever (rule, skill, command, agent) with a script that checks it—five hooks and two diff gates here—so the charter's standards are enforced rather than merely described.", "recommendation": {"advice": "Keep the root instruction file short and load area-specific rules by path, then back each rule with a hook or diff gate that verifies the agent complied.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/one-of-every-lever", "markdown": "https://wpnews.pro/news/one-of-every-lever.md", "text": "https://wpnews.pro/news/one-of-every-lever.txt", "jsonld": "https://wpnews.pro/news/one-of-every-lever.jsonld"}}