AI coding agents become easier to trust when a repository gives them context, feedback, and boundaries. The hard part is knowing what to add first and how to tell whether each layer helped.
The open-source harness-score-live-tlc tutorial turns that problem into a repeatable exercise. You start with a tiny Meeting Cost CLI, then evolve the repository from an unstructured project into a harness with scoped instructions, automated sensors, runtime hooks, and a maturity gate.
This article walks through that progression and explains what each layer protects. The tutorial is intentionally agent-neutral for most steps. Its hook example uses the Cursor hook format because that runtime is recognized by the scanner.
TL;DR
- Start with a working Node.js application before adding agent-specific files.
- Add repository context, then scoped rules and reusable skills.
- Turn quality claims into tests, lint, typecheck, formatting, and CI.
- Use runtime hooks for high-risk actions and immediate feedback.
- Add a CI gate so the harness cannot silently regress below L4.
Prerequisites
The tutorial currently documents these prerequisites:
- Git.
- Node.js 24 or newer.
- A coding agent that can edit a local repository.
- GitHub CLI if you want to create a copy from the template.
The example fixes harness-score@1.5.2 for its scans. The scanner is the project being measured, while the tutorial repository is the workflow and example material around it. The README describes the expected levels as reference points, not guarantees. Agent output can vary, and extra files can change a score.
Create a copy from the GitHub template, or clone it locally for an experiment. The repository says that the tutorial does not contain the finished application or harness. You build those layers as you progress.
Step 1: Create a small product before the harness
The first prompt creates a minimal Node.js 24 ESM application called Meeting Cost CLI. It accepts participants, meeting duration in minutes, and hourly cost, then calculates labor cost.
The constraints matter. Keep the calculation in a pure exported function and argument parsing in a separate entry point. Reject non-finite numbers, fewer than one participant, non-positive duration, and negative hourly cost.
A minimal verification command is:
npm start -- 6 45 120
At this point, the repository is useful but deliberately lacks agent-specific context, tests, CI, hooks, and harness configuration. That baseline matters. If you add everything at once, you lose the ability to see which layer changed the repository and which layer merely added files.
The tutorial labels this starting point L0, or Unharnessed. Its reference score is 14 out of 108, but treat that number as an example from the documented progression rather than a promise about every run.
Step 2: Add context, then reduce it
The next stage adds a root AGENTS.md with the product goal, real commands, domain invariants, dependency constraints, security limits, and a completion checklist.
The tutorial asks you to make that file verbose before refactoring it. Context has a cost: a file loaded into every task should contain needed facts, not generic advice.
A compact context file should answer questions such as:
- What does this repository actually do?
- Which commands exist today?
- Which domain rules must never change?
- Which files or operations are outside the task boundary?
- What evidence counts as completion?
The documented progression calls this L1, or Documented. The reference score stays around 21 out of 108 after the reduction, which illustrates an important point: fewer words can preserve the same useful signal.
Step 3: Scope guidance and add hygiene
L2 adds guidance that is loaded only when relevant. The tutorial creates a path-scoped rule for the source directory, a reusable skill for adding calculation cases, and an explicit verification workflow.
It also adds repository hygiene for node_modules, coverage output, and environment files while allowing .env.example. The lockfile makes installation state reproducible.
The separation is practical:
-
AGENTS.mdprovides global repository context. - A scoped rule protects source-specific architecture.
- A skill packages a repeatable change procedure.
- A workflow names the verification action.
-
.gitignorereduces accidental credential and artifact commits.
This is more precise than putting every instruction in one root file. The rule applies where it matters, and the skill can be invoked when a calculation rule changes.
Step 4: Make quality claims executable
L3 turns statements such as "the code is checked" into commands that produce evidence. The tutorial specifies pinned development tools and asks for:
- Native Node.js tests for valid, rounded, invalid, and non-finite inputs.
- Strict TypeScript checking with JavaScript support.
- Biome linting and formatting.
- An
npm run checkcommand that runs the relevant sensors. - GitHub Actions that run
npm ci, lint, typecheck, and tests.
The workflow should have only read access to repository contents. Verification does not need write access to the repository.
The reference progression calls this L3, or Sensing. The sample score is 83 out of 108. The useful result is that future changes can be checked locally and independently in CI.
Step 5: Move critical boundaries into hooks
Instructions can reduce mistakes, but a runtime gate can block a known dangerous command before it runs. The L4 stage adds two Cursor hook events.
The beforeShellExecution gate reads JSON from standard input and returns JSON. It allows ordinary commands, denies high-risk patterns such as npm publish, forced pushes, hard resets, and destructive recursive removal, and returns ask when the payload is malformed instead of silently allowing it.
The afterFileEdit hook provides feedback by running the local formatter for supported JavaScript and JSON files. It is guidance, not the final authority. CI still decides whether the repository passes its checks.
The tutorial also asks for focused tests covering allowed commands, denied commands, and malformed payloads. That is the right level of testing for a hook: verify the boundary behavior directly instead of assuming the configuration is correct because it parses.
The documented reference score reaches 97 out of 108 at L4, or Self-correcting. That means the repository can detect more problems and prevent a defined class of unsafe actions. It does not mean every action is safe or every runtime supports the same hook format.
Step 6: Prevent regression
The final stage adds a separate GitHub Actions workflow that runs the Harness Score scanner with --min-level 4. It uses read-only contents permission, checkout, the scanner action, a fixed scanner version, and no badge generation for the exercise.
This creates a ratchet: the repository may improve, but a pull request that removes enough harness structure should fail the gate. Keep this workflow separate from product CI. One workflow verifies the application; the other verifies the infrastructure that helps agents change the application.
Why this works
The progression follows a feedback loop:
- Context tells the agent what matters.
- Scoped guidance narrows when instructions apply.
- Skills and workflows make repeated work explicit.
- Tests and static checks expose incorrect results.
- CI provides an independent execution environment.
- Hooks block selected unsafe actions and provide fast feedback.
- The maturity gate detects regression in the harness itself.
No individual layer is sufficient. A root file cannot enforce a rule, a hook cannot replace tests, and a score cannot prove that the product meets every business requirement. Together, the layers make uncertainty easier to inspect.
Limitations and security boundaries
The tutorial does not promise a specific score. Agent output can differ, and the scanner measures structural signals rather than complete product quality. The hook format is runtime-specific. A blocked command list is not a complete security policy, and CI permissions still need review.
Review every generated diff before committing. Do not allow automatic commits, and do not treat a passing maturity level as permission to skip code review, dependency review, or secret scanning.
FAQ
Does L4 mean the project is production-ready?
No. It means the documented harness signals and checks reached the tutorial's L4 target. Product behavior, dependencies, deployment, and operational risk still require separate review.
Can I use a different coding agent?
Yes for the general progression. The README says the prompts work with different agents. The hook example uses Cursor's recognized runtime format, so another agent may need an equivalent mechanism or no hook stage.
Are the reference scores guaranteed?
No. They are approximate values from the tutorial. Extra generated files or different agent output can change the result.
Where should I start if I already have CI?
Measure the current repository first, then add only the missing layer. A mature CI pipeline does not automatically provide agent context, scoped guidance, or runtime safety boundaries.
Takeaway
A useful AI coding harness is built in layers that can be inspected: establish a small working product, document the real constraints, scope repeated guidance, execute quality checks, enforce selected runtime boundaries, and gate regression. The harness-score-live-tlc repository provides a concrete path for practicing that sequence instead of treating agent readiness as a vague checklist.
What is the first harness layer you would add to an existing repository: scoped context, executable sensors, or a runtime action gate?
AI assistance disclosure: AI assistance was used to organize and edit this tutorial. The repository README, current public source, license, and linked primary documentation were checked before publication.
Top comments (0)