Hooks, not instructions: the engineering system behind the products
Built the harness every Stratas product is developed with: a Claude Code plugin whose hooks enforce the rules in any repository, a read-only reviewer agent, a product template that applies every lesson from past incidents by default, and a multi-agent product pipeline.
My contribution
Defined how agent-assisted development should be governed, then designed and implemented the harness, the client harness plugin, the product template and the multi-agent product pipeline, and rolled them out across every product repository.
Open full-size image ↗
Situation
Coding agents were writing most of the code across a growing fleet of products, in parallel sessions on several machines and in the cloud. An inventory in September 2026 found the same stack in all three live revenue products, with each defense applied to a different subset of them. Whatever the building session happened to remember is what shipped.
Rules written in CLAUDE.md were followed most of the time. Most of the time is not good enough for a migration on the default branch or a test someone quietly deleted.
Task
Make the rules hold every time, in every repository, including client repositories, without slowing the work down or relying on anyone to remember them.
Action
Architecture
Hooks for what must always hold. The client harness is a Claude Code plugin a repository declares once; every session on any machine loads the current version. PreToolUse hooks make migrations on the default branch immutable and let tests grow but never shrink, and block risky git commands. A PostToolUse hook runs the project's own linter on each edited file. A Stop hook runs the repository's checks and the turn cannot end while they fail. Every hook answers its own self-test.
A reviewer that cannot act. The reviewer agent holds read, grep and glob and no shell, so it is read-only by construction rather than by instruction. It reviews a diff against its spec and reports only gaps that affect correctness.
CI that a person cannot skip. Setup writes a test-count check against a committed baseline, a secret scan that redacts its findings, a pull-request template that asks for evidence, and dependabot. The check is required, because a gate that is not required is advice.
Defaults instead of memories. The product template (Next.js, Supabase, Trigger.dev, Stripe, Vercel) maps every module to the incident it prevents: webhook routes exempt from auth, environment keys checked at startup, login history recorded in the database, and a daily cross-host check that scheduled jobs really fired.
Agents with roles and gates. Product Factory runs an orchestrator and seven specialist agents (planner, UX designer, prototyper, frontend, backend, QA, deploy) on a live Kanban, with human approval at planning, prototype and review. The agent workspaces monorepo holds Trigger.dev, MindStudio and n8n builds and splits a single product out into its own client repository.
Implementation
- Client harness plugin with four hooks, each with a self-test, plus the reviewer agent and human-triggered ship and setup commands.
- Escape hatches that are deliberate, visible and narrow, because a block with no way out gets disabled.
- Product template with a rename script and a day-one checklist.
- Product Factory on Next.js and Supabase Realtime, with lessons from failed runs fed into later prompts.
Verification
- Every hook answers
--selftest. - The reviewer reads the diff as a file and reports only gaps that affect correctness.
- CI requires the test count to equal the committed baseline.
Result
- One starting point for every new product, with every known defense applied.
- The same enforcement in internal and client repositories, loaded automatically in every session.
- Review that scales with the agents: a read-only reviewer on every diff and CI checks no one can skip.
What I would do differently: move to hooks sooner. Rules written only as instructions let the same class of mistake through more than once.
Skills evidenced
- Claude Code platform building: plugins, hooks with self-tests, reviewer agents and marketplaces.
- Engineering governance for AI-written code: protected paths, test baselines, secret scanning and evidence in every pull request.
- Platform defaults from incident history: a template where every module answers a real failure.
- Multi-agent product pipelines with human approval gates.
Portable lessons
- An instruction in a prompt is a request. A hook is enforcement. Anything that must hold every time belongs in a hook with its own self-test.
- Make the reviewer read-only by construction. An allowlist of command names is not an execution allowlist.
- A gate that is not required is advice. Make the CI check required, or expect it to be skipped.
Want to discuss the decisions behind it?
Over fifteen years of consulting and growth, and hands-on AI delivery from discovery to daily operations. I can share my CV and talk through how I connect business outcomes with systems that run.
Available for a chat. In person in Stavanger, or remotely worldwide.