Skip to content

About

This repo outlines an approach to coding in the era of AI agents. It maximizes the value of strategic decisions and maintains clear documentation for optimal context efficiency when working with AI coding assistants.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

33 Commits

Folders and files

Repository files navigation

Strategic Agentic Coding: A Documentation Framework for AI Agents

A template you copy into a new project at the start, so the coding agent knows the goals, the conventions and the reasons behind past decisions before the work is scoped.

This framework encourages building with a product and project focused mindset from the outset, ensuring technical decisions align with strategic goals.


Why This Framework Exists

The Problem: Current agents read code quickly, but code doesn't say why it exists or what "done" means. Without that, agents:

  • Make reasonable-looking guesses that contradict earlier decisions
  • Miss project conventions nobody wrote down (plots without legends, parameters hardcoded in notebooks)
  • Lose the reasoning behind choices once plans are rewritten
  • Can't align their work with the long-term vision

The Solution: Document what code can't say, each kind of thing in one place:

  1. Intent at two levels:

    • Strategic: "Why are we building this? What's the vision?" β†’ ROADMAP.md and PROJECT_PLAN.md
    • Implementation: "How does this module work? What conventions apply?" β†’ CLAUDE.md
  2. Conventions and a Definition of Done: Specific, checkable rules in CLAUDE.md, checked with /check-done before a task is reported finished

  3. One home for decisions: Reasons and rejected options go in DECISIONS.md, so they survive when plans change

  4. Lessons that become rules: Mistakes go in LESSONS_LEARNED.md and are promoted to Conventions, so the agent doesn't repeat them


Success Criteria

This framework is working when:

  • βœ… The agent follows project conventions without being reminded
  • βœ… The agent says what it did not verify, instead of reporting everything done
  • βœ… Documentation updates have minimal workflow disruption
  • βœ… Strategic decisions are preserved and discoverable months later

Framework Overview

Core Documentation Hierarchy (Tier 1)

your-project/
β”œβ”€β”€ README.md                    # Public-facing overview
β”œβ”€β”€ CLAUDE.md                    # 🎯 Main entry point for AI agents
β”œβ”€β”€ ROADMAP.md                   # Strategic vision (quarters/years)
β”œβ”€β”€ PROJECT_PLAN.md              # Tactical execution (weeks/months)
β”œβ”€β”€ CHANGELOG.md                 # Feature and change history
β”œβ”€β”€ DECISIONS.md                 # Why we chose X over Y (ADRs)
β”œβ”€β”€ LESSONS_LEARNED.md           # What went wrong and what we do now
β”œβ”€β”€ CONTRIBUTING.md              # Contributor guidelines
β”‚
└── src/
    └── your-module/
        └── CLAUDE.md            # Optional: rules for this module only

What Goes Where?

Content Type Root CLAUDE.md Subfolder CLAUDE.md Code Comments
Setup & installation βœ“ Primary
High-level architecture βœ“ Overview Detailed design
Design patterns Mention Explain + examples Reference
API contracts Link Full specification Implementation notes
Why decisions made Link to ADR in DECISIONS.md Link to ADR in DECISIONS.md Edge cases
Conventions & Definition of Done βœ“ Primary Module-specific additions
How to extend General guidance Specific steps Implementation details

Document Purposes

Document Timeframe Purpose Example Content
ROADMAP.md Quarters/Years Strategic vision - the "destination" "Q2 2024: Multi-tenancy support"
PROJECT_PLAN.md Weeks/Months Tactical execution - the "route" "Sprint 3: Implement OAuth middleware"
CLAUDE.md (root) Always current Navigation hub + setup Task routing, env setup, common commands
CLAUDE.md (subfolder, optional) Always current Rules for one module, loaded only in that folder "Noise is added to training labels only"
SYNCHRONIZATIONS.md (optional) Always current Event-driven projects: how modules react to each other "When user.delete fires β†’ post.deleteAll follows"
CHANGELOG.md Historical What changed "v2.1.0: Added rate limiting"
DECISIONS.md Historical, append-only Why we chose X over Y "ADR-004: Batch predictions before real-time serving"
LESSONS_LEARNED.md Historical, append-only What experience taught us, and the rule it led to "LL-002: Agent skipped legends β†’ save_figure() helper"

Roadmap, plan, changelog, and decisions answer different questions. The roadmap and plan look forward and get rewritten, so any "why" written there disappears as they change. The changelog records what happened but not the reasoning. DECISIONS.md is the one place the reasoning, including the options you rejected, is kept.


Quick Start

New here? See GETTING_STARTED.md for a step-by-step walkthrough including the skills workflow and a DS/ML project example.

1. Copy Template Files to Your Project

# Clone this template
git clone https://github.com/Zarif-S/agentic-coding-framework.git

# Copy the core templates to your project (everything in templates/, including .env.example)
cp -r agentic-coding-framework/templates/. your-project/

# Optional: start a module CLAUDE.md from the example (or generate one with /module-doc)
mkdir -p your-project/src/your-module
cp agentic-coding-framework/examples/ml-workflow/CLAUDE.md your-project/src/your-module/

2. Customize for Your Project

  1. Edit CLAUDE.md: Replace placeholders with your project's stack, commands, and Conventions. The Conventions and Definition of Done sections are what stop the agent missing details, so make them specific to your project
  2. Edit ROADMAP.md: Add your strategic goals and milestones
  3. Edit PROJECT_PLAN.md: Add current sprint/iteration plans
  4. Edit CHANGELOG.md: Document your first version

3. Copy the Claude Skills (optional)

If you use Claude Code, copy the included skills into your project:

cp -r agentic-coding-framework/.claude your-project/

This gives you nine /commands that automate the most common framework tasks, plus /teach:

Command What it does
/module-doc Writes a module CLAUDE.md: what the module does, rules that must not break, gotchas
/plan-feature Plans a feature, triages which docs need updating, and asks whether a decision needs recording
/decision Appends an ADR to DECISIONS.md (options considered, decision, consequences)
/check-done Checks the current diff against CLAUDE.md's Conventions and Definition of Done, including opening any changed figures
/sync-flow Event-driven projects only: adds a SYNC-NNN entry to SYNCHRONIZATIONS.md
/changelog-gen Parses recent commits and drafts CHANGELOG.md entries
/doc-health Scans all docs for broken links, stale dates, missing sections, leftover placeholders
/polish Readability pass on a milestone's code (or, with prose, its docs and notebook text) by a fresh subagent, then checks nothing was lost
/walkthrough Writes docs/code_walkthrough_m[N].md so you can explain a milestone's code without reading it first
/teach Not a framework command: teaches you a topic over several sessions, keeping MISSION.md, GLOSSARY.md and learning records in the current directory. Run it in a separate folder, not your project root

Where each command fits in a project:

flowchart TD
    subgraph setup["Setup (once)"]
        copy["Copy templates"] --> fill["Fill in CLAUDE.md and ROADMAP.md"]
        fill --> sketch["Sketch 'The system' in CLAUDE.md"]
    end

    subgraph milestone["Each milestone"]
        plan["/plan-feature"] --> approve["Agent states the plan; you approve"]
        approve --> build["Build"]
        build --> done["/check-done"]
        done --> polish["/polish"]
        polish --> walk["/walkthrough"]
    end

    subgraph anytime["As needed"]
        decision["/decision: the agent runs it when a choice is made"]
        changelog["/changelog-gen before a release"]
        health["/doc-health when docs feel out of sync"]
        module["/module-doc when a module needs its own rules"]
        syncflow["/sync-flow in event-driven projects"]
    end

    sketch --> plan
    walk -->|next milestone| plan
    build -.-> decision
Loading

See .claude/commands/ for the full command definitions.

To make the commands available in every project instead of copying them, link your user-level commands folder to this repo (git pull then updates them everywhere):

ln -s "$(pwd)/agentic-coding-framework/.claude/commands" ~/.claude/commands

Projects can still keep their own commands in .claude/commands/; give them names that don't clash with the shared ones.

4. Start Using with AI Agents

When working with Claude Code or other AI assistants:

  • Point them to CLAUDE.md as the main entry point
  • Reference specific sections for focused context
  • Update docs as you make changes (see PROJECT_PLAN.md for documentation debt tracking)

Working with AI Agents

The framework changes how you work with an agent, not just how things are documented. The key shift: write down the rules that must not break before writing code, then work in small, checked steps.

The workflow

1. Sketch the system

Before touching code, ask the agent to draft "The system" section of the root CLAUDE.md:

"I'm building a project that [brief description]. Draft 'The system' section for CLAUDE.md: a short sketch of how data flows through it, and the rules a wrong change would break silently. Don't write any code yet."

Review it. Getting it wrong here is a five-minute fix; getting it wrong in code is a refactor.

2. Work one milestone at a time

Plan, approve, build, then /check-done and /polish. One milestone per session keeps each task small enough to check.

3. Add a module CLAUDE.md when a module needs its own rules

When one module has rules the agent keeps breaking, or the root CLAUDE.md fills up with one module's detail, run /module-doc. Claude Code loads a folder's CLAUDE.md only when working in that folder, so those rules cost nothing elsewhere. A small project doesn't need any.

4. Event-driven projects only: synchronizations

If modules react to each other's events ("when a model passes evaluation, stage it for deployment"), record each reaction in SYNCHRONIZATIONS.md with /sync-flow, so no module has to know about the others. This follows Meng & Jackson's concept design. A pipeline that runs its steps in order doesn't need it; the sketch from step 1 covers that. See examples/SYNCHRONIZATIONS.md.

Keeping the agent careful

Agents tend to rush and miss small details: a plot without a legend, a parameter hardcoded in a notebook instead of config. This is mostly a missing-convention problem, not a speed problem. Without a stated rule, the agent does whatever is most common. In order of payoff:

  1. Write the convention down, specifically, in CLAUDE.md's Conventions section. "No literals in notebook cells" works; "write clean code" doesn't.
  2. Plan before editing. Use plan mode (Shift+Tab in Claude Code) for anything non-trivial, or start with: "Before writing code, tell me your assumptions and where any new parameters will live."
  3. Keep tasks small. Details get dropped when one prompt asks for five things.
  4. Make it check its own output. Run /check-done before calling a task finished. For plots, the agent must open the saved image; it can't see a missing legend otherwise.
  5. Review with fresh context. Ask a subagent (or a new session) to review the diff against Conventions. Fresh eyes catch what the author missed.
  6. Escalate repeat misses: first a LESSONS_LEARNED entry, then code that enforces the rule, then a hook. See Advanced Features 7–8.

Recording decisions as you go

When you and the agent choose between alternatives (a library, a data format, where something lives), the agent runs /decision right then, while the context is in the conversation; you don't need to ask. Writing ADRs after the fact is how they end up never written.

What this buys you

  • Smaller agent tasks: Each milestone has a plan you approved and a check at the end.
  • Rules as a safety net: The rules that must not break are written where the agent loads them, and /check-done checks each diff against them. You don't have to restate them in every prompt.
  • Context where it's needed: Module rules load only when the agent works in that module.
  • Reasoning that survives: Decisions and lessons are recorded as they happen, not reconstructed later.

Advanced Features (Tier 2)

Once you're comfortable with the core framework, explore these optional patterns:

1. DOCS.md Index Pattern

When to use: Projects with 10+ documented folders

2. PR Documentation Checklist

When to use: Team collaboration starts

3. Documentation Debt Tracking

When to use: Fast iteration creates doc gaps

4. Conflict Detection Patterns

When to use: Multiple people editing docs

5. Multi-Folder Strategy Guide

When to use: Project structure evolves

6. Scheduled Retrospectives

When to use: Continuous improvement culture

7. Enforcing Conventions in Code

When to use: The agent keeps missing the same detail despite a CLAUDE.md rule

8. Hooks

When to use: A rule needs to run every time, not when remembered


Real-World Example

The examples/ folder has two module docs and an optional synchronizations file:

File What it demonstrates
examples/ml-workflow/CLAUDE.md A module CLAUDE.md for a training pipeline: what it does, rules that must not break, gotchas, common tasks
examples/deployment/CLAUDE.md A module CLAUDE.md for a deployment service that reacts to events from the pipeline
examples/SYNCHRONIZATIONS.md Optional, for event-driven projects: how the two modules coordinate without either knowing about the other

Philosophy & Principles

1. Hierarchical Separation of Concerns

Documentation exists at different altitudes:

  • Strategic (ROADMAP): Where are we going and why?
  • Tactical (PROJECT_PLAN): What are we doing right now?
  • Architectural (CLAUDE.md): How does the system work?
  • Implementation (Code): What does this specific function do?

2. Flexible Guidelines, Not Rigid Rules

The "What Goes Where" table is a guide, not a law. Use your judgment:

  • If repetition aids clarity, repeat
  • If a detail feels important at multiple levels, include it at both
  • Optimize for findability, not purity

3. Document What Code Can't Say

Agents read code quickly; they can't read your intent. Spend documentation on:

  • Why: decisions and rejected alternatives (DECISIONS.md)
  • Rules: conventions and the Definition of Done (CLAUDE.md)
  • Direction: what we're doing now and next (PROJECT_PLAN.md)

Don't spend it on restating file structure or code the agent can read directly; that drifts out of date and a stale doc misleads more than a missing one. Root CLAUDE.md is loaded into every session, so every line in it should earn its place.

4. No Workflow Interruption

Documentation should:

  • βœ… Be updated after completing a task (batch at task end)
  • βœ… Use severity levels for conflicts (only critical ones interrupt)
  • ❌ Never pause development mid-task for doc updates
  • ❌ Never enforce strict rules that slow down iteration

Contributing

This framework is designed to evolve based on real-world usage. Contributions welcome:

  • Share your adaptations and improvements
  • Report what works (and what doesn't) in your projects
  • Suggest new advanced patterns based on your experience

See CONTRIBUTING.md for guidelines.


License

MIT License - see LICENSE file for details.

Use this framework freely in your projects, commercial or personal.


Future Improvements

This framework is designed to evolve. Potential enhancements being considered:

1. Specialized Sub-Agents Support

Concept: Documentation patterns for teams using different LLMs for different purposes

Examples:

  • Gemini for code reviews
  • Claude Code for coding and implementation
  • OpenAI for brainstorming and ideation
  • Specialized models for data science workflows

Value: Guide teams on how to document when different AI agents handle different aspects of development

2. Compound Engineering Integration

Resource: Compound Engineering Plugin

Concept: Integrate compound engineering principles into the documentation framework

Value: Enhanced patterns for building complex systems with clear documentation boundaries

3. Automation Tooling

Validation Script (scripts/check_docs.sh):

  • Detect broken internal links
  • Find inconsistent terminology
  • Verify hierarchical structure
  • Check documentation debt items

GitHub Actions Workflow:

  • Automated doc checks on pull requests
  • Link validation in CI/CD
  • Documentation coverage reporting

Pre-commit Hooks:

  • Remind developers to update relevant docs
  • Validate markdown formatting
  • Check for placeholder text

Status: Focus is on establishing manual patterns first, then automate when pain points are clear.

4. Model Context Protocol (MCP) Integration

Concept: Integrate Model Context Protocol to enable AI agents to access contextual information more efficiently

Potential Features:

  • MCP servers for documentation navigation
  • Context-aware documentation retrieval
  • Standardized interfaces for AI agents to query project structure
  • Dynamic context loading based on agent tasks

Value: Reduces token usage and improves AI agent performance by providing only relevant context when needed

5. Claude Skills Integration βœ…

Shipped: Nine Claude Code commands (plus /teach) are included in .claude/commands/ and ready to copy into any project. See the table in Quick Start step 3.

Value: Each command enforces framework conventions automatically: decisions land in DECISIONS.md, module rules stay short, and work gets checked against the Definition of Done before it's called finished.

6. Framework Plugin/Extension

Concept: Create a standalone plugin that scaffolds and maintains this documentation structure

Features:

  • One-command project initialization with templates
  • Automatic detection of documentation drift
  • Interactive documentation update wizard
  • Integration with popular IDEs and editors
  • Documentation health metrics and dashboards

Value: Lower barrier to entry and easier maintenance for teams adopting the framework


Acknowledgments

This framework emerged from practical experience using AI coding assistants for coding and optimising documentation during onboarding, particularly when using Claude Code.

Inspired by the need to maintain clarity and strategic alignment in fast-moving AI-assisted development environments.

Research: The philosophy of this framework is supported by research from MIT, notably: Meng, E. and Jackson, D. (2025). What You See Is What It Does: A Structural Pattern for Legible Software. Available at: https://arxiv.org/abs/2508.14511.

Contributors: Thanks to James Algers for contributing.


Last Updated: 2026-10-01 Status: Template v1.2 - Ready for use Feedback: GitHub Issues

About

This repo outlines an approach to coding in the era of AI agents. It maximizes the value of strategic decisions and maintains clear documentation for optimal context efficiency when working with AI coding assistants.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors