Write. Check. Ship.
When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.
Not an API Gateway. Not a folder linter. If the check is not required on the PR, the config is just documentation.
- 04 Presentation
- 03 Application
- 02 Domain
- 01 Infrastructure — rules file active
01.5 / The Problem
AI writes spaghetti code at light speed.
Agents take the shortest path. If they need data in a Domain layer, they might directly import a database adapter.
Traditional linters catch these architectural violations in CI after the agent has finished its work, breaking the flow and requiring manual intervention.
ArkGate solves this by shifting the check to the exact moment of writing. By intercepting file writes through IDE hooks or MCP, it ensures that if the agent writes a bad import, the write doesn't land. The agent gets immediate feedback and can self-correct before saving to disk.
02 / One minute
Install. Apply. Run doctor.
Four lines. That is the product. Stuck? Run
arkgate-check --doctor. Do #1.
03 / Rules file
Domain does not import Infrastructure. As data.
The rules file is ark.config.json.
Agents read it. CI enforces it.
{
"include": ["src"],
"layers": [
{
"name": "Domain",
"patterns": ["src/domain/**"],
"forbiddenGlobals": ["fetch", "Date.now"]
},
{ "name": "Infrastructure", "patterns": ["src/infrastructure/**"] }
],
"rules": [
{ "from": "Domain", "to": "Infrastructure", "allowed": false }
]
}
src/domain/order.ts
Domain cannot import Infrastructure.
04 / Doctor
One light. One next move.
Thin or new tree
Finish start. Run doctor again.
Not fully protected
Do action #1 until the light moves.
Honest edges
Boundaries hold. Keep required CI.
Imports clean. Design not finished.
One small refactor at a time.
One minute
Write. Check. Ship.
When the agent writes a bad import, the write doesn’t land.