Skip to content

AI mental model

rocambille edited this page Jun 4, 2026 · 2 revisions

Summary: This page explains the "AI-Native" philosophy of StartER and why its architecture is suited for co-creation with AI agents.

Why "Zero Magic" matters for AI

AI agents work by predicting the next tokens based on context. When a framework uses "Magic" (hidden middleware, complex ORMs, dynamic dependency injection, etc.), that logic is invisible to the AI's current context window.

StartER prioritizes transparency. By keeping every layer of the stack explicit and readable, we provide the AI with a perfect mental model.

Synchronous SQLite

Most Node.js frameworks are heavily asynchronous. While powerful, async/await chains often lead to "context drift" where AI loses track of execution flow or introduces race conditions.

  • StartER choice: use SQLite's synchronous API.
  • AI benefit: the code is linear and easier for an LLM to parse and generate without structural errors.

Output parsing vs. type assertions

AI often generates "silent bugs" by assuming data structures that aren't there.

  • StartER choice: parse database outputs through a Zod schema bound to the TypeScript type (z.ZodType<Item>).
  • AI benefit: Zod .parse() acts as a runtime guardrail. If an AI generates a new field in the type, it is forced to update the runtime schema, preventing silent failures. It reduces the boilerplate of manual primitive casting (Number(), String()) while maintaining perfect type safety.
  • Separation of concerns: Note that this Output Schema (for type safety) is strictly separated from the Input Schema in Validators (for business rules).

Flat module structure

Deeply nested inheritance or complex service layers confuse AI agents, requiring them to "jump" between too many files.

  • StartER choice: module-based co-location (Actions, Repository, and Routes in one folder).
  • AI benefit: the agent can see the entire "business logic" of a resource within a single context window.

Simplicity as a guardrail

In StartER, simplicity isn't just for beginners: it's a security feature for AI coding.

  • Lower hallucination rate: AI doesn't have to "guess" how a hidden framework component works.
  • Faster verification: because the code is readable, you (and the AI) can verify correctness in seconds.
  • Smaller context footprint: you can fit more of your actual logic into the AI's memory because the framework "boilerplate" is minimal.

See also

Clone this wiki locally