# A code example in the docs no longer runs

A code example in the docs no longer runs: Point at the broken example, and get a version that actually runs against the current code.

Source: https://codeherder.com/starter-briefs/code-example-that-no-longer-runs/

Starter briefs

Point at the broken example, and get a version that actually runs against the current code.

[Request access →](https://codeherder.com/get-started/#request-access) [Part of: Keep the docs true →](https://codeherder.com/use-cases/keep-the-docs-true/)

## The brief

Copy this text as it is, or change the specifics to match your own case, then file it as a task.

Copy this and file it as a task

Copy brief

```
There's a code example in the docs that used to work but no longer runs against the current version of the code, probably because the interface it calls has changed. Update the example so it runs cleanly against the code as it exists today, and check it actually executes rather than just looking plausible.
```

## Why this works

A broken example has a binary pass/fail: it runs or it doesn't. That makes the brief checkable in a way prose corrections aren't, and an agent can prove the fix by actually executing the corrected example.

How it runs

## Plan, code, review, merge, verify

1. plan Runs the existing example against current code to see exactly where and why it fails.
2. code Updates the example to match the current interface, then runs it again to confirm it succeeds.
3. review Checks the corrected example still teaches the original concept, and no different shortcut.
4. merge Opens a pull request that touches only the one example.
5. verify Confirms the example runs cleanly from a clean checkout, the way a new reader would try it.

## What you need on hand

- The doc page with the broken example
- A way to run the example against the current codebase
- A person who knows the interface the example calls, to review the correction

## Done when

- The example runs without errors against current code
- It still demonstrates the same concept it did before
- The surrounding explanation still matches the corrected example

## Proof, not a promise

No real task in examples.ts matches this brief's exact shape yet. What's real is the mechanism: an agent runs a doc's own example against current code, fixes what the interface change broke, and proves the fix by running it again instead of reading the diff and guessing.

Keep going

## Related briefs

[A label that is wrong in one place only Name the one screen where a label or copy string says the wrong thing, and get it corrected everywhere it needs to be.](https://codeherder.com/starter-briefs/label-wrong-in-one-place/) [Cover the one file nobody has tests for Name a file with no test coverage, and get a real test suite for what it actually does.](https://codeherder.com/starter-briefs/cover-the-untested-file/) [Delete a dead flag and every reference to it Name the flag that always resolves one way now. Get it and its dead branch removed.](https://codeherder.com/starter-briefs/delete-a-dead-flag/)

[← See every brief](https://codeherder.com/starter-briefs)
