AI (Artificial Intelligence)

Your Codebase is the Curriculum for Practical AI

Your Codebase is the Curriculum for Practical AI

A developer can explain a feature perfectly in a meeting and still miss the one detail that matters: the retry rule buried in a queue handler, the validation shared by three endpoints, or the test that explains why a seemingly redundant check exists. An AI assistant faces the same problem, with less of the accumulated context that helps a team recognize a bad suggestion.

That is why practical AI adoption starts with the codebase. The repository is not a complete description of the system, and it certainly is not always correct. But it is where design decisions, compromises, naming conventions, and operational assumptions leave traces. Making those traces understandable gives both people and AI systems a better chance of producing useful work.

The repository teaches through consequences

General programming knowledge can tell an assistant how to write a cache. Your codebase must explain which data can be cached, how it becomes stale, and what happens when the cache is unavailable. Without that local context, a plausible implementation can quietly violate the contract your application depends on.

Tests are one source of that context. A test named for an observable behavior, with a clear setup and meaningful assertions, can show an assistant what must remain true. A test that only checks whether a method was called may be useful for a narrow purpose, but it says less about the behavior users rely on.

The same distinction applies to documentation. “The service processes orders” is a label. “An order may be submitted more than once, so processing must tolerate duplicate requests” gives a developer a constraint to carry into a change. The most valuable repository knowledge often describes boundaries: what can fail, what must be preserved, and which decisions should not be made casually.

Make important knowledge discoverable

You do not need to document every function before using AI. Start with the questions a capable newcomer would ask when changing a consequential part of the system.

  • Where does a request enter, and where does its work continue? Point to the relevant components and describe the path across boundaries.
  • Which rules must survive a change? Record invariants such as authorization checks, data ownership, and duplicate-handling requirements.
  • How can a change be checked? Provide the commands or procedures your team actually uses, including prerequisites and relevant limitations.
  • What commonly surprises people? Explain non-obvious constraints near the code or in a short, maintained guide.

Location matters as much as content. A carefully written architecture document is less useful if nobody knows it exists or it contradicts the implementation. Keep guidance close enough to the work to be found, assign ownership where possible, and update it when behavior changes. If a rule matters enough to automate, consider whether a test or validation check can express it alongside the prose.

Give agents a bounded assignment

An AI agent is more likely to help when the task defines an outcome and a way to judge it. “Improve error handling” leaves too much open. “When the payment provider times out, preserve the pending order and return the existing retryable error; add coverage for that behavior” gives the agent a boundary to investigate.

A useful assignment includes the relevant area of the repository, expected behavior, constraints, and verification steps. It can also identify decisions that require human review, such as changes to authorization, persistent data, or external side effects. These are not guarantees that the agent will make the right choice; they make its work easier to inspect.

For example, suppose an agent proposes retrying a failed payment request. Review the failure path before accepting the change. A timeout does not necessarily mean the provider failed to process the request. Retrying safely may depend on an idempotency mechanism and on how the application reconciles uncertain outcomes. A neat loop around the request is not enough evidence that a second charge cannot occur.

Treat generated changes as proposals with evidence

Review the result in the same way you would review any unfamiliar contribution: follow the data, examine the assumptions, and check the paths that fail. Ask what happens when input is malformed, a dependency is slow, a request is repeated, or a process stops halfway through. The questions should fit the change; a text-only update does not need the same scrutiny as a migration.

Tests and automated checks provide evidence, but passing checks do not prove that the right behavior was implemented. Inspect whether new tests cover the requested outcome and whether existing tests were weakened to make the change pass. If the agent could not run a check, that is useful information too. Record the gap and decide what verification is needed before release.

Use permissions that match the assignment. Reading a repository and proposing a patch is different from deploying code, changing production data, or calling a service that creates a real transaction. Keep consequential actions behind controls your team understands, and make the action and its outcome visible to the people accountable for it.

Improve the curriculum as you work

When an assistant repeatedly misses the same constraint, resist the urge to solve the problem only with a longer prompt. The gap may be in the repository: an important rule might live only in someone’s memory, a test might have an unclear name, or two documents might describe different behavior. Fixing the underlying source helps the next person as well as the next tool.

Not every mistake deserves a new policy. Look for recurring misunderstandings and costly ambiguity. Add a concise explanation, improve a test, or make a verification step easier to find. Then check whether the change helps on a real task. Documentation that nobody maintains can become another source of confident mistakes.

Practical AI does not remove the need for engineering judgment. It makes the quality and accessibility of that judgment more consequential. A codebase that explains its rules, exposes its failure paths, and makes verification routine becomes a better place to work with any collaborator. The lesson it teaches is simple: useful speed comes from making the important things clear.

Blog author portrait

Mihajlo

I’m Mihajlo — a developer driven by curiosity, discipline, and the constant urge to create something meaningful. I share insights, tutorials, and free services to help others simplify their work and grow in the ever-evolving world of software and AI.