Working with AI
In DeviceShelf, ServerShelf and WealthWallet, AI agents co-write a large share of the code and tests. Architecture, specifications, review and sign-off stay with me. The agents work under a self-developed, tiered rulebook of general and project-specific rules. A fixed order makes the result reliable: only checks in code can enforce anything.
- PromptAn instruction to the model, for example “do not make up numbers”. Whether it complies is open. An instruction proves nothing.
- ModelMany models refuse risky requests on their own. You cannot rely on that: a different model or a cleverly worded input behaves differently, and the behaviour cannot be proven.
- Check in codeA check that runs as ordinary code outside the model and always decides the same way for the same input. Before any model output can have an effect, such as saving something or showing a number, it has to pass this check. A test proves it holds, even against a model that deliberately tries to get around it. Every rule of the kind “this must never happen” rests on such a check.
A tiered rulebook
The rules for the agents come in two tiers. General rules are kept in one place and apply in every repository where agents work. On top of them come rules that apply to one project only. When a mistake happens, it becomes a rule at the right tier and, where possible, an automated check. A general mistake therefore does not come back in the next project.
Protection outside the model
A prompt can only instruct a model. Whether the model follows it is not guaranteed. Only code that runs outside the model is binding. Rules of the “never” kind are implemented so that no executable path leads from model output to the protected asset. A test with a deliberately hostile fake model proves this.
Avoiding hallucinations
A statement by an agent only counts with evidence: a test that checks the claimed result, a real query with a checked response, or the source itself. A process list or a plain “it is running” is not enough. In WealthWallet, numbers, formulas and keys come only from the Excel model and the Figma annotation; keys are never guessed. If a value is missing, the UI shows a visible error instead of an estimate. In the WealthWallet assistant only the calculation engine supplies numbers; any model sentence containing a digit is dropped. This limits invented numbers but does not replace checking the other statements.
Checks in the repository
The project rules run as scripts before every push: types, lint, design system, thin components, provenance of numbers, an E2E test for every route and accessibility. A state only counts as green once the whole hook script has run.
Review by several models
Reviews are done by several other models (Codex, Kimi), never by the model that wrote the code. Each reviewer gets its own instructions and a different focus, so they do not all miss the same thing. Every finding is reproduced before it is accepted, and a good share do not hold up.
Regression tests
Every bug found becomes a case in a regression list. The list runs in full after every change. Each new test is run once against the code without the fix and has to fail there.
Agents with fixed rules
Hooks block force-push, hard reset and plaintext secrets. Agents work in their own worktrees. Nothing goes out without approval, and merging waits for a manual test.