AITM doesn't just read your source files — it builds a structured, queryable model of what your code actually does, so the AI stops guessing and starts checking.
How AITM Understands Your Project
Behavioral contracts
Every meaningful feature in your codebase can be captured as a behavioral contract: a machine-readable spec with an id, the module it belongs to, a one-line behavior description, the exact files it touches, a danger zone warning, and a confidence score. Contracts are stored per project in a local SQLite database, and the AI queries them over GraphQL before it touches a single line of code. That's the single biggest reason hallucinated file paths and invented methods drop off — the AI checks the contract instead of guessing.
Contracts don't go stale either: after every merge, the docs pipeline step automatically re-scans the change and updates any contract it affected.
Danger zones
Each contract can carry a danger zone — a plain-English warning about the blast radius of touching that code (say, "never call this without checking the skip flag first"). The AI reads danger zones up front, so it knows what NOT to break before it starts editing, not after a test fails.
The knowledge graph
Behind one GraphQL endpoint sit ten interconnected sources of truth about your project:
- The variables tree (
BL.*business-logic codes,UI.*interface codes) - Behavioral contracts
- The DOM element map
- The hint dictionary
- The documentation index
- The code map — imports/exports, high-coupling "god nodes", and module communities
- The test map — UI element to Playwright locator
- Screenshots
- Bugs
- Cross-module edges linking all of the above together
One query can pull related context across all ten sources at once, instead of the AI grepping blindly across your whole repository.
Project onboarding
When you import a project for the first time, AITM runs a deterministic static pre-scan before any AI touches it: language and stack detection, a full code map, DOM extraction via data-aitm attributes, variable backfill, and documentation pointers. Only after that does AITM optionally run AI passes — architecture discovery, git history mining for module coupling, and a deep per-module pass. In short: import a repo, and AITM maps it before the first task ever runs.
DOM map + Dev Panel
Real UI elements in your app are tagged with data-aitm attributes, each carrying trigger and triggered-by effect edges plus a pixel rect map of where it sits on screen. That map is what feeds reliable, self-healing E2E test selectors instead of brittle CSS locators.
Tips
- If the AI seems to "already know" a file it's never opened this session, that's a contract query at work, not a lucky guess.
- A contract's danger zone is worth reading even when you're changing the code yourself — it's often the fastest way to spot a hidden dependency.
- Re-importing a project after major refactors lets the onboarding pre-scan catch up with your new structure.