The Dead Files Wake Up: Turning Legacy Repo Docs into an Agentic Control Plane
Forgotten repo files like CONTRIBUTING.md and CODEOWNERS are no longer boilerplate. Pair them with a lean AGENTS.md router and on-demand Skills to govern coding agents.

In my earlier dispatches on AI-Native Engineering and AI-Native UX, I examined how autonomous agents reshape system boundaries, language selection, and human-in-the-loop interfaces. That works cleanly when scaffolding a greenfield service from scratch.
Real enterprise engineering rarely starts from a blank directory. Most production value lives inside existing repositories with years of accumulated domain logic, subtle invariants, and hard-won architectural scars.
For the past decade, GitHub and platform teams encouraged developers to populate repositories with standard community health and governance files: README.md, CONTRIBUTING.md, SECURITY.md, .github/CODEOWNERS, and .github/PULL_REQUEST_TEMPLATE.md. In practice, most teams treated them as compliance boilerplate. Someone generated them at repo creation, linked them in an onboarding wiki, and let them gather dust while human engineers learned the real rules through Slack threads and code reviews.
Autonomous coding agents have zero institutional memory. They do not absorb team norms by osmosis. When you point an agent at an existing repository, those neglected files at the root wake up as the primary ground truth loaded into the context window.
Stale documentation no longer just confuses a new hire on their first week. It actively misdirects agentic execution loops at scale.
Why Prompt Engineering Fails on Existing Repositories
When teams first introduce coding agents like Cursor, Windsurf, or Claude Code into mature codebases, they usually try to solve quality issues through better prompting. An engineer writes a detailed prompt explaining the feature, pastes in a few example files, and hopes the model respects local conventions.
That approach breaks down quickly in production:
- Context Drift: Every engineer prompts differently. One developer reminds the agent to preserve immutability and run unit tests; another forgets, and the agent introduces silent state mutations.
- Helpful Regressions: Without explicit architectural memory, an agent sees an unusual workaround, assumes it is legacy tech debt, and “cleans it up” right back into the exact production bug that workaround prevented.
- Unbounded Blast Radius: An agent asked to fix a UI bug might casually modify a shared build script, loosen a linter rule to make a check pass, or alter a core API contract without realizing downstream consumers depend on it.
Reliable agentic execution does not come from smarter one-off prompts. An agent’s reliability is a function of both the model and the deterministic harness surrounding it. In an existing codebase, your repository structure is that harness.
Wake Up Git’s Native Files First
Teams often ask where to put branching conventions, commit formats, PR checklists, and coding standards without turning their AI config into a 1,000-line wall of text.
The answer is already sitting in your repository. Git and GitHub standardized these boundaries years ago. Instead of inventing a parallel documentation system, refactor those legacy files from passive human etiquette into deterministic contracts for machine execution:
| Legacy Repo File | Old Human Purpose | Agentic Control Plane Role | What to Put Inside |
|---|---|---|---|
README.md |
High-level pitch and quickstart | Topology & Entry-Point Map | Exact directory tree, runtime prerequisites, and service boundaries. |
CONTRIBUTING.md |
Branch naming, PR etiquette | Branching & Verification Contract | Branch naming (feat/<ticket>-<slug>), commit style, and exact CLI commands (lint, typecheck, test). |
.github/CODEOWNERS |
Auto-assigning PR reviewers | Blast-Radius & Escalation Gate | High-risk paths (auth/, billing/, schemas) where agents must halt for human sign-off. |
SECURITY.md |
Vulnerability reporting contact | Hard Guardrails & Secret Hygiene | Banned libraries, forbidden APIs, and strict .env / secret handling rules. |
.github/PULL_REQUEST_TEMPLATE.md |
Checklist for PR authors | Structured Handoff Schema | Required evidence: test logs, typecheck output, and linked decision records. |
docs/adr/ |
Historical design notes | Anti-Regression Memory | Short architecture decision records explaining why non-obvious patterns exist. |
When CONTRIBUTING.md owns branching and verification commands, and .github/CODEOWNERS owns escalation boundaries, you never have to duplicate those rules across AI-specific config files. Both humans and agents read the same source of truth.
Keep AGENTS.md Lean: The Progressive Disclosure Architecture
What an onboarding doc is for a human,
AGENTS.mdis for an AI IDE.
Placed at the root of the repository, AGENTS.md gives any coding agent an immediate operational briefing before it reads a single line of application code.
The biggest mistake teams make is treating AGENTS.md as an encyclopedia. If you paste every branching rule, test pattern, and framework convention into the root file, it bloats past 500 lines, wastes context tokens on every turn, and dilutes model attention on the rules that actually matter.
Keep the root AGENTS.md under 100 to 150 lines by using three layers of progressive disclosure:
AGENTS.md(Always loaded, ultra-lean router): Verification commands, hard prohibitions, and pointers to where deeper rules live.- Git standards + path-scoped rules (Loaded by location): Repo-wide rules live in
CONTRIBUTING.mdandSECURITY.md, while language or framework rules live in nestedAGENTS.mdfiles (such aspackages/web-ui/AGENTS.md) or.agents/rules/so frontend rules never pollute backend workers. - Skills (Loaded on demand): Multi-step engineering workflows live in
.agents/skills/<skill-name>/SKILL.mdand only enter context when the task matches.
Template: A Lean Root AGENTS.md Router (Under 30 Lines)
# AGENTS.md
## Verification Commands
- Install: `pnpm install --frozen-lockfile`
- Typecheck: `pnpm run typecheck`
- Scoped tests: `pnpm test -- <path-to-spec>`
- Lint: `pnpm run lint`
## Hard Boundaries
- Never modify `infra/terraform/` or `.github/workflows/` without explicit human approval.
- Never weaken assertions, skip tests (`it.skip`), or disable linter rules to achieve a green build.
- Never commit secrets, tokens, or `.env` files.
## Where Rules Live
- Branching, commit conventions, and PR workflow: read `CONTRIBUTING.md`
- Security and banned patterns: read `SECURITY.md`
- Architectural trade-offs: check `docs/adr/` before refactoring core modules
- Repeatable workflows (story implementation, test writing, PR readiness): load the matching skill in `.agents/skills/`
Skills: The Missing Layer for Repeatable Engineering Work
Standard Git files define what the rules are. Skills define how to execute recurring tasks step by step.
If an agent is fixing a one-line CSS bug, it does not need your 80-line playbook on how your team breaks down a Jira story or structures integration test fixtures. Packaging those procedures as Skills keeps AGENTS.md fast while giving agents deterministic, repeatable execution whenever a complex workflow is triggered.
| Skill | When It Triggers | What It Encodes |
|---|---|---|
story-implementation |
Implementing a feature ticket or user story | Reading acceptance criteria, creating the branch per CONTRIBUTING.md, building vertical slices, and running pre-PR checks. |
test-authoring |
Writing unit, integration, or E2E tests | Test file placement, fixture factories, mocking boundaries, and required edge-case coverage. |
pr-readiness |
Preparing a branch for code review | Running typecheck, scoped tests, security checks, and filling out .github/PULL_REQUEST_TEMPLATE.md. |
schema-migration |
Modifying database tables or API contracts | Backward-compatibility checks, rollback scripts, and CODEOWNERS escalation triggers. |
Example: How a story-implementation Skill Triggers Without Bloating AGENTS.md
---
name: story-implementation
description: Implement a feature ticket or user story end-to-end following repo branching, testing, and PR standards. Use when the user provides a ticket, spec, or asks to build a new feature.
---
# Story Implementation
1. Read `CONTRIBUTING.md` for branch naming (`feat/<ticket>-<slug>`) and create a clean branch.
2. Check `docs/adr/` for any architectural constraints touching the target modules.
3. Implement the smallest testable vertical slice first.
4. Load the `test-authoring` skill to add unit and integration coverage.
5. Run the verification commands in `AGENTS.md` and complete `.github/PULL_REQUEST_TEMPLATE.md`.
Control Plane Readiness Checklist
Before pointing an autonomous coding agent at an existing repository, run through this quick audit:
Click to expand: 6-Point Agentic Repo Audit
- Root
AGENTS.mdis under 150 lines and leads with exact CLI verification commands. CONTRIBUTING.mdspecifies branching and commit rules without vague “make sure tests pass” prose..github/CODEOWNERSprotects high-blast-radius directories (auth, billing, infra, schemas).- Path-scoped rules or nested
AGENTS.mdfiles isolate frontend, backend, and infra conventions. - Core workflows (
story-implementation,test-authoring,pr-readiness) live in Skills rather than the root prompt. - Stale docs are pruned or archived so agents never ingest conflicting legacy instructions.
You do not need to invent a proprietary AI framework to make coding agents reliable on mature codebases. Wake up the standard Git files you already have, keep AGENTS.md lean as your routing table, and move your repeatable engineering craft into Skills.
