Programming principles

From theheavenlyd3mon/hermes-profiles · View interactive version

Programming principles is an AI agent skill from the GitHub repository theheavenlyd3mon/hermes-profiles. Distilled coding principles from 14 classic software books.

How to use this skill

Skill file

Programming Principles (14 Books)

Principles distilled from the mattpocock/agent-rules-books repo — 14 pre-made

AGENTS.md rule sets derived from classic software engineering books. Use this

skill directly during code review, refactoring, design, and implementation.

For deeper per-book coverage, load the relevant reference file.

Task-to-Book Mapping

When the task involves... Load / apply principles from

────────────────────────────────────────────────────────────────────────

Everyday implementation & code review Clean Code, Code Complete

Refactoring existing code Refactoring, WELC

Architecture / dependency management Clean Architecture, APoSD

Domain modeling / business rules DDD, DDD Distilled, IDDD

Enterprise app patterns / layering PoEAA

Production reliability / stability Release It!

Data consistency / scalability / events DDIA

Engineering craft / automation Pragmatic Programmer

Designing APIs / module boundaries APoSD

Legacy code / risky changes WELC, Refactoring

How to Perform a Code Assessment

For a structured, reproducible workflow that combines book principles with

actual repo exploration, see references/code-assessment-workflow.md. It

covers: loading the evaluation framework, reading the repo and GitHub context,

deduplicating against existing issues/PRs, classifying findings by book +

priority, and deciding whether each merits an issue.

Cross-Cutting Principles

Principles synthesized from multiple books, organized by concern.

Naming & Communication

technical implementation detail.

— never to narrate code or compensate for bad names.

Functions & Routines

full scope, it's a candidate for decomposition. Split by stable

responsibility boundary, not by execution order or framework convention.

cleanup from the main flow.

Architecture & Boundaries

cases never import frameworks, databases, UI, or vendor SDKs.

SDKs — must sit behind a trait or interface owned by inner layers. Direct

instantiation of infrastructure code inside application or domain logic is

a structural violation (Dependency Inversion Principle).

details. Keep them behind ports, gateways, and adapters.

(controllers/, services/, repositories/).

IMPLEMENT them.

Pass-through layers are debt.

Data & State

sets, Value Objects for meaningful primitives, and booleans only for binary

meanings.

cached, or ephemeral data.

earn themselves.

generate everything else.

Testing

implementation details.

Error & Failure Handling

expected domain failures (return/result type), retryable failures, and

permanent failures.

of failing in slow, partial, or prolonged ways.

exponential backoff and jitter. Never retry validation errors or permanent

failures — distinguish retryable from non-retryable outcomes.

semantics of things from outside the process.

supervision and isolation.

Refactoring & Change

feature or redesign as cleanup.

local reasoning.

feature only when it makes the feature safer or simpler.

next cleanup would be speculative.

responsibilities. A module you can't name in a single sentence is

doing too much — extract the cohesive sub-concepts.

substitute.

Per-Book Compressed Rules

Clean Code (Martin)

Readability, local reasoning, maintainability. Corrects: "working code = clean."

A Philosophy of Software Design (Ousterhout)

Deep modules, information hiding, complexity reduction. Corrects: "familiar patterns = simple."

Clean Architecture (Martin)

Business rules independent of frameworks/databases/UI. Corrects: "details = architecture."

Code Complete (McConnell)

Construction discipline, defect reduction, verifiable code. Corrects: "typing = construction."

Domain-Driven Design (Evans) + DDD Distilled (Vernon)

Ubiquitous language, bounded contexts, tactical patterns. Corrects: "model = data schema."

Implementing DDD (Vernon)

Practical DDD: aggregates, events, services, persistence. Corrects: "renamed CRUD = DDD."

Patterns of Enterprise Application Architecture (Fowler)

Layering, patterns for enterprise apps. Corrects: "more patterns = better design."

Refactoring (Fowler)

Behavior-preserving structural improvement. Corrects: "cleanup = rewrite."

Working Effectively with Legacy Code (Feathers)

Safe change in untested code. Corrects: "rewrite = first move."

Designing Data-Intensive Applications (Kleppmann)

Distributed data, consistency, events, replication. Corrects: "everything is local/ordered/exactly-once."

Release It! (Nygard)

Production reliability, stability patterns. Corrects: "happy path = production readiness."

The Pragmatic Programmer (Hunt & Thomas)

Engineering craft, accountability, automation. Corrects: "local edit = done."

Refactoring.Guru

Smell catalog and technique catalog. Corrects: "pattern = always the answer."

Compatibility Guide

Books that CONFLICT (do not load as equal guidance):

Books that OVERLAP (choose one, they push similar pressure):

All other pairs are complementary. Default: one primary always-on book, others

loaded on-demand per task.

Local Reference Files

Each book's mini rule set is available as a local reference file under

references/. Load any with:

skill_view(name='programming-principles', file_path='references/{book-dir}.mini.md')

| File | Book |

|------|------|

| references/a-philosophy-of-software-design.mini.md | A Philosophy of Software Design |

| references/clean-architecture.mini.md | Clean Architecture |

| references/clean-code.mini.md | Clean Code |

| references/code-complete.mini.md | Code Complete |

| references/designing-data-intensive-apps.mini.md | Designing Data-Intensive Applications |

| references/domain-driven-design.mini.md | Domain-Driven Design |

| references/domain-driven-design-distilled.mini.md | DDD Distilled |

| references/implementing-domain-driven-design.mini.md | Implementing DDD |

| references/patterns-of-eaa.mini.md | Patterns of Enterprise App Architecture |

| references/refactoring.mini.md | Refactoring |

| references/refactoring-guru.mini.md | Refactoring.Guru |

| references/release-it.mini.md | Release It! |

| references/the-pragmatic-programmer.mini.md | The Pragmatic Programmer |

| references/working-effectively-with-legacy-code.mini.md | Working Effectively with Legacy Code |

| references/code-assessment-workflow.md | Assessment methodology — not a book, but the workflow for combining all books against a real repo |

Each book also has a full version (11-63 KB) for deep reference when you need

the complete rule catalog. Load on demand:

skill_view(name='programming-principles', file_path='references/{name}.full.md')

| Full File | Book | Size |

|-----------|------|------|

| references/a-philosophy-of-software-design.full.md | A Philosophy of Software Design | 13 KB |

| references/clean-architecture.full.md | Clean Architecture | 17 KB |

| references/clean-code.full.md | Clean Code | 13 KB |

| references/code-complete.full.md | Code Complete | 12 KB |

| references/designing-data-intensive-apps.full.md | Designing Data-Intensive Applications | 16 KB |

| references/domain-driven-design.full.md | Domain-Driven Design | 42 KB |

| references/domain-driven-design-distilled.full.md | DDD Distilled | 11 KB |

| references/implementing-domain-driven-design.full.md | Implementing DDD | 12 KB |

| references/patterns-of-eaa.full.md | Patterns of Enterprise App Architecture | 15 KB |

| references/refactoring.full.md | Refactoring | 17 KB |

| references/refactoring-guru.full.md | Refactoring.Guru | 62 KB |

| references/release-it.full.md | Release It! | 13 KB |

| references/the-pragmatic-programmer.full.md | The Pragmatic Programmer | 13 KB |

| references/working-effectively-with-legacy-code.full.md | Working Effectively with Legacy Code | 13 KB |

Progressive disclosure pattern: load the mini file for daily guidance (triggers,

decision rules, final checklist). Load the full file only for deep sessions,

audits, or when you need the complete rule catalog with code-smell indexes and

technique references.

Known Weaknesses (from repo criticism)

benchmarked. Apply judgment about whether rules improve actual outcomes.

primary always-on set + one task-specific on-demand set.

come from real failures, not theory.

the actual task. Test outputs against real requirements, not rule conformity.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.