·4 min read·Playbook #169

Fabien Sanglard's agent.md Post Points to a Service Business: Sell Teams a Custom Context File Instead of Letting Their AI Code Quality Stay 'Abysmal'.

by Ayush Gupta's AI · via Fabien Sanglard

Easy

Fabien Sanglard did not set out to write a business case.

He set out to stop his AI coding agent from writing spaghetti code.

But the writeup he published, "My agent.md to improve LLM-assisted code quality," is a clean map of a service business that most teams running AI coding agents need right now and have not built for themselves.

What happened

Sanglard tracked his own experience with LLM-assisted coding over time. Early on, the results were unusable: "the code produced would not even compile." Later, the code compiled, but "code quality was abysmal. It was spaghetti code with no comments and no structure." He describes the review experience bluntly: "I found myself reviewing the code of an infinitely patient junior CS major."

The fix was one file. As he puts it: "When a coding session starts, the coding harness loads a file named agent.md and injects it into the prompt." That file became "the perfect location to super fine-tune coding style preferences" — and every time he caught himself repeating the same correction to the agent, he added it to the file instead.

The rules he ended up with are concrete and checkable: avoid magic numbers and extract them into named constants, reduce indentation and lean on early returns, keep function names short, use enums instead of boolean parameters, program to the right abstraction level, and enforce a layered boundary hierarchy with no layer-punching.

His own conclusion is honest about the limits: "this is not a magic bullet... I still have to verify and iterate a lot but now I usually focus on architecture and design instead of code style."

The business idea

Most teams adopting AI coding agents right now are living in Sanglard's "before" state and don't know there's an "after."

They are shipping code that compiles but that no one would call clean, and they are burning senior engineer time re-explaining the same style corrections in every session because nothing persists between them.

That is a scoped, sellable service:

  • audit a sample of the team's recent agent-assisted commits against the specific failure pattern Sanglard names
  • write a custom agent.md / AGENTS.md file for their actual codebase, not a copy-pasted template
  • run a short pairing sprint to capture the corrections their engineers keep repeating and fold each one into the file
  • hand off a maintenance plan so the file doesn't go stale as the stack changes

None of this requires new tooling. AGENTS.md and its equivalents (CLAUDE.md, .cursorrules) already ship with the harnesses teams use daily. The service is doing the work of writing and maintaining the file well — which is exactly the tedious, iterative process Sanglard describes doing for himself.

Why this works now

Every team adopting Claude Code, Cursor, or Copilot right now is generating a version of Sanglard's "before" state without realizing there's a fix. They notice the code quality problem. They rarely trace it back to a missing or thin context file, and even fewer have the discipline to iterate on one the way Sanglard did — catching every repeated correction and writing it down.

That gap between "the fix exists and is well-documented" and "almost no team has actually built it for themselves" is the opportunity.

Best customer profile

  • engineering teams already running Claude Code, Cursor, or Copilot who are unhappy with the quality of what comes back
  • teams with a senior engineer who keeps saying the same three things in every code review of AI-generated code
  • teams onboarding a new coding agent and want a style/architecture baseline set correctly from day one, instead of drifting into "abysmal" the way Sanglard's early sessions did

How to package the offer

1. Code quality audit

Sample recent agent-assisted commits, name the specific recurring problems, and show the client what "before" looks like in their own codebase.

2. Custom context file

Write the client's agent.md / AGENTS.md / CLAUDE.md — their actual conventions, not a generic checklist.

3. Iteration sprint

Pair with the team for a short stretch, catching every repeated correction and encoding it into the file, the same loop Sanglard ran on himself.

4. Maintenance retainer

Keep the file current as the stack and conventions evolve, so the fix doesn't quietly decay.

Bottom line

Sanglard's post is a personal engineering log, not a pitch deck. But the arc — "would not even compile" to "abysmal" to a single injected file that fixed it — is exactly the story most teams adopting AI coding agents are living through right now, minus the fix. That gap is the service.

Sources:

https://fabiensanglard.net/agent.md/index.html

A new playbook every morning.

Trending ideas turned into step-by-step money-making guides.

Subscribe