Every time you want an AI coding assistant to follow solid engineering principles, you run into the problem of context limits and tool incompatibilities. agent-rules-books tackles this by distilling 14 classic software engineering books into Markdown rule sets tailored for AI agents like Claude Code, Cursor, and Codex. It’s a practical take on how to operationalize decades of software wisdom within modern AI tooling constraints.
What agent-rules-books provides and how it’s structured
At its core, agent-rules-books offers MIT-licensed, tool-agnostic Markdown files that encode rules from foundational software engineering literature. These aren’t just loose notes — the repo organizes each book’s rules into three context-budget tiers: full, mini, and nano. The full tier is the entire canonical source, mini is a recommended subset for real tasks, and nano is a compact fallback for tight token limits.
This tiered approach is a smart acknowledgment of AI agents’ token budget challenges. For example, the full Domain-Driven Design rule set has 523 rules spanning 979 lines and 42KB of text, while the Clean Code nano set shrinks to just 14 rules in 32 lines and 1.2KB.
The repo covers a broad range of topics:
- Architecture: Clean Architecture, Domain-Driven Design
- Code quality: Clean Code, Code Complete
- Refactoring: Martin Fowler’s Refactoring, Refactoring.Guru
- Reliability in production: Release It!
- Legacy code management: Working Effectively with Legacy Code
Each rule set is Markdown-based, ensuring compatibility with any AI environment that can consume text prompts. The repo also documents editor-specific setups (like always-on vs on-demand rule usage), scoped rules, and multi-context patterns like MCP (Multi-Context Prompting) and RAG (Retrieval Augmented Generation) in USAGE.md.
Why the tiered Markdown rule sets matter
What sets this repo apart is its pragmatic bridging of classic software engineering and AI agent constraints. The tradeoff is clear: you can’t just dump 40KB of rules into an AI prompt and expect effective guidance. Token limits and prompt engineering force you to prioritize and compress.
By curating full, mini, and nano tiers, the repo caters to different AI workflows and context budgets. You might start with a nano set to bootstrap guidance and then selectively load mini or full sets for deeper dives.
The rule counting is deterministic and transparent — rules are individually enumerated and tracked by lines and bytes. This makes it easier to estimate token usage before pushing rules to an AI agent.
The code quality here is less about executable code and more about the discipline of documentation and structure. The Markdown is well-organized, consistent, and carefully segmented to aid agents’ consumption. The USAGE.md file adds practical instructions to integrate these rules effectively into real-world AI-assisted coding scenarios.
The tradeoffs are mostly about granularity versus feasibility. The full sets are comprehensive but heavy, making them impractical for many prompt contexts. The mini and nano sets sacrifice detail but keep core principles accessible. This tiering is a thoughtful balance but not a silver bullet — users still need to tailor rule loading based on their specific AI tool and task.
Explore the project
Since no direct installation or quickstart commands are provided, the best way to get started is to clone the repo and explore its structure:
rules/directory contains subfolders for each classic book, each with full, mini, and nano Markdown rule files.USAGE.mdexplains how to apply these rule sets with AI agents, including editor configuration, usage modes, and multi-context strategies.README.mdoffers an overview and links to the original books and rule metrics.
You can pick a domain you want your AI assistant to respect, load the appropriate tier of rules, and experiment with integrating those rules into your prompt engineering or AI tooling setup.
Verdict
agent-rules-books is a niche but valuable resource for developers building or customizing AI coding agents who want a principled foundation grounded in classic software engineering. It thoughtfully addresses the token budget problem with tiered rule sets and provides transparent metrics to help estimate prompt size.
The Markdown format makes it broadly compatible, but the repo requires manual integration and some AI tool fluency. It’s not a plug-and-play solution but a well-crafted knowledge base you can build on.
If you’re experimenting with AI-assisted coding and want to operationalize proven engineering principles without overwhelming your agent’s context, this repo is worth a look. Just be ready to tailor rule loading to your agent’s limits and task complexity.
Related Articles
- Inside agents: a granular multi-agent orchestration system with PluginEval quality assurance — Explore agents, a Python-based multi-agent orchestration repo featuring 184 AI agents, 78 plugins, and a three-layer Plu
- Open Design: repurposing coding-agent CLIs into a modular local-first design engine — Open Design turns 12 coding-agent CLIs into a deterministic design engine with 31 composable skills and 72+ design syste
→ GitHub Repo: ciembor/agent-rules-books ⭐ 793