Check and fix errors
≈ 5 min · you will have a way to read check results, know which errors block deploy and when to nudge the agent.
check validates the project in four layers as soon as the agent writes files. Errors block deploy, warnings don’t, and every line names the file, the line and the fix.
Agents write code fast but repeat a few mistakes: an antd prop that no longer exists, a call to an API that isn’t there, a library outside the stack. Each check rule matches a kind of mistake that once broke an app at runtime, so the agent learns what’s wrong before the app’s users do.
Four layers
check runs the cheap layers first:
- Syntax: parses every
.ts/.tsxfile. - Gate: code patterns that crash the app or leave the stack, plus quality warnings.
- Contract: the route tree, pages calling APIs that exist, the
.ts/.tsxboundary, handler schemas. - Types: full TypeScript over the app’s code, about 5–15 seconds.
When check runs
- Every time the agent writes files: the first three layers run at once and the result comes back in the same call. The agent fixes things in its next write.
- When the agent calls
check: the first three layers; addtypecheck: truefor the type layer too. The agent should run it once at the end of each part of the build. - On deploy: all four layers, and deploy is refused while errors remain. The running app stays as it was.
Reading a result
✗ 2 error(s)
Errors:
- [gate:code.antd-v6-no-visible-prop] app/orders/page.tsx:42 <Modal visible={…}> — antd v6 Modal ignores `visible`, so it never opens. Use `open={…}` …
- [contract] app/orders/page.tsx FE calls GET /orders/stats but no matching BE route found
Warnings:
- [gate:perf.order-unindexed] app/orders/repository.ts:18 orders.createdAt is used in orderBy but …Each line has the layer (gate, contract, syntax, types), the rule id when there is one, the file, the line and the message.
The two errors above are fixed like this: change visible to open on line 42; add a handler app/orders/stats/get.ts or drop the call. The last warning doesn’t block deploy, but createdAt should get an index.
Let the agent fix it
Usually you do nothing: the agent reads the result and fixes it in its next call. After each write, check or deploy, manh.run also returns a Progress line (check, layout, deploy, demo data, checkpoint) and the next step, so the agent doesn’t stop halfway.
Step in when the agent keeps circling the same error. Paste the error line to the agent and say what you want, for example: “This contract error means the page calls an API that doesn’t exist. Write the handler app/orders/stats/get.ts returning order totals per month.”
Good to know
- While syntax errors remain, most gate rules pause. Fix syntax first, then run again.
- Type errors are the only kind deploy can skip, with
deploy({ force: true, reason })when you’re sure the app still works. Errors in the first three layers can’t be skipped. - A file tree that once deployed successfully can always deploy again, even after new rules, so rolling back is never blocked.
Next steps
- Deploy — once the errors are gone, put the app live.
- Reading check errors — common errors and how to fix each one.
- check rules — the main rules by group.