Build Your Own Legs Before the Crutches Fail
Published revised 5 min read
TL;DR
- An AI draft can get me started. Understanding its assumptions is what lets me maintain it.
- The loop I use is borrow -> inspect -> rebuild -> own.
- Two cases from my own repos below: a schema that looked right and matched nothing real, and an API layer that was "compatible" until I read the spec against it.
- In both, the fix that lasted was a generated artifact and a test, so the same mistake fails a build instead of waiting for me to notice.
AI made me faster right up until it did not.
I had it sketch a refactor that looked clean on first pass: fewer conditionals, nicer names, one less ugly branch around an edge case I was tired of thinking about. It compiled. The tests were mostly happy.
Then I hit the case the model had simplified away. It was one input shape that only exists because an older integration still exists, on a path where "optional" really means "present but malformed." The generated code had no way to know that history, and I had not told it.
That did not make me anti-AI. I use AI-assisted development every day to get oriented in a codebase, compare approaches, and draft a first pass. The risk is accepting the first pass without learning enough to debug it.
Borrow, inspect, rebuild, own
Autocomplete is borrowed memory. A linter is borrowed discipline. An AI draft is borrowed competence at a higher level, and it expires the first time the system does something the draft did not anticipate.
So I treat a draft as a loan:
- Borrow. Take the draft. It is usually a faster start than a blank file.
- Inspect. Read it against the thing it claims to describe: the spec, the upstream source, the real data.
- Rebuild. Rewrite the parts I could not explain, even when they work.
- Own. Turn what I learned into a check that runs without me.
The fourth step is the one I used to skip. The two cases below are why I stopped.
Case one: the schema that looked right
This site has a browser tool that validates fi-fhir Source Profiles, the files that tell my HL7v2-to-FHIR engine how to parse a feed. The page shipped with a JSON schema that had been drafted to make the editor work. It was tidy, consistent, and camelCase throughout.
It was also invented. fi-fhir reads profile files through Go structs, and the field names come from those structs' YAML tags. I had not read the draft schema against that source. The editor validated its own examples perfectly and did not describe the profiles the engine actually ships.
I found it in September 2026 during an audit of this site's demos, and the repair had three parts:
- I transcribed the schema from fi-fhir's profile package, with the Go comments as field descriptions. All 13 real profiles and templates in the repo now validate against it.
- A script copies the example profiles and test messages from fi-fhir byte for byte. It finds each code citation by anchor text inside a named function, so if fi-fhir moves a line, regeneration fails. A stale line number cannot slip through.
- The validators are generated at build time from the schema, and a test fails when a committed validator no longer matches a fresh build.
Asking a model to reconcile the two shapes would have produced another plausible schema. What I needed was for the page to inherit its contract from the source, and for a build to break when they drift.
Case two: "OpenAI-compatible"
FlexInfer's proxy puts an OpenAI-style API in front of the models I serve at home. It is easy for "compatible" to mean only that my own clients work.
A hardening pass replaced that with an explicit audit: which endpoints are supported, whether request parsing matches the published spec, and whether errors come back in the envelope a standard client expects. A model was useful here. It summarized the spec, listed the surface area, and drafted the first table of gaps.
The table was not the deliverable. The deliverable was the tests around request parsing and error envelopes, because those are what fail when someone changes the proxy later. I can also now say exactly which endpoints are supported, without waving at the word "compatible."
What the checks are for
If you are technical but do not write production code every day, the visible code is the smaller half of the job. Around it sits machinery that catches mistakes and forces explanations:
- Pre-commit hooks catch formatting drift, leaked credentials, and stale generated files while the change is still fresh.
- CI runs the tests somewhere that is not my laptop, so "works for me" stops being evidence.
- Review is where I have to state a change's intent and risk to another person, or to myself a day later.
- Budgets and gates on performance and bundle size turn "seems fine" into a number that can fail.
AI can help write all of these. What it cannot do is decide which mistakes are worth a gate. That decision comes from having been wrong in a specific way, which is the reason to inspect the draft myself and not delegate that part.
How I tell whether it is working
These are the signs that I am leaning on the tool and not learning from it:
- I can prompt for a fix, but I cannot debug the failure without prompting again.
- I am accepting abstractions I would struggle to explain to another engineer.
- I keep returning to the model for the same category of problem, because I never turned the last answer into a check.
- I treat a CI failure as an obstacle and not as information.
When I catch one of these, I pick the smallest piece I cannot explain and rebuild it by hand.
Closing
I expect AI to stay in my development loop. It is too useful not to.
What I want from it over time is fewer things I have to remember. Each of the two cases above ended with a script, a generated file, and a test, and I have not had to think about either problem since. I can also debug both without asking the tool, which is the test that matters to me.
Related posts
8 min read
The First 90 Days: Introducing AI-Assisted Dev to a New Team
A 90-day rollout for AI-assisted development: start with bounded habits, measure the work, and standardize only after the team has evidence.
Shared tags: agents · ai-assisted-dev
4 min read
A One-Page AI Usage Policy for an Engineering Team
A short, adoptable AI usage policy for engineering teams: what to put on the page, what to leave off, and why the policy matters less than the habits it makes explicit.
Shared tags: ai-assisted-dev
16 min read
A Green Run That Checks Nothing: Seven Silence Modes, Seventy Repos, One Day
A fleet-wide maintenance day exposed seven ways CI can report success without useful work—and the merge-queue discipline and recurring checks built to catch them.
Shared tags: agents
Comments
Join the discussion. Be respectful.