pragmatic-programmer
# pragmatic-programmer This Claude Code skill applies meta-principles of software craftsmanship from "The Pragmatic Programmer," including DRY, orthogonality, tracer bullets, and design by contract. Use it when evaluating system architecture, preventing technical debt, choosing between reversible and irreversible decisions, or when the user explicitly mentions best practices, software craftsmanship, broken windows, or code ownership concerns.
git clone --depth 1 https://github.com/wondelai/skills /tmp/pragmatic-programmer && cp -r /tmp/pragmatic-programmer/plugins/code-craftsmanship/skills/pragmatic-programmer ~/.claude/skills/pragmatic-programmerSKILL.md
# The Pragmatic Programmer Framework A systems-level approach to software craftsmanship from Hunt & Thomas' "The Pragmatic Programmer" (20th Anniversary Edition). Apply these meta-principles when designing systems, reviewing architecture, writing code, or advising on engineering culture -- how to think about software, not just how to write it. ## Core Principle **Care about your craft.** Software development demands continuous learning, disciplined practice, and personal responsibility -- pragmatic programmers think beyond the immediate problem to context, trade-offs, and long-term consequences. Great software comes from great habits: avoid duplication ruthlessly, keep components orthogonal, and treat every line of code as a living asset that must earn its place. The goal is not perfection -- it is systems that are easy to change, easy to understand, and easy to trust. ## Scoring **Goal: 10/10.** Score against the seven Quick Diagnostic rows: award ~1.4 points per row answered "yes" (7 yes = 10). Then band the result: - **9-10**: every principle holds -- DRY knowledge, orthogonal layers, a working tracer slice, contracts at boundaries, no broken windows, reversible vendor/DB choices, ranged estimates. - **5-6**: 1-2 violations that cost real change-effort (e.g. business logic coupled to the DB, single-point estimates). - **<=3**: pervasive duplication, global state, or accumulated broken windows -- entropy is winning. Always state the score, name the failing diagnostic rows, and give the specific fix from the Action column to reach 10/10. ## The Seven Meta-Principles Seven principles for building software that lasts: ### 1. DRY (Don't Repeat Yourself) **Core concept:** Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. DRY is about knowledge, not code -- duplicated logic, business rules, or configuration are far more dangerous than duplicated syntax. **Why it works:** Duplicated knowledge must be changed in multiple places; eventually one gets missed, introducing inconsistency. DRY reduces the surface area for bugs and makes systems easier to change. **Key insights:** - DRY applies to knowledge and intent, not textual similarity -- two identical code blocks serving different business rules are NOT duplication - Four types of duplication: imposed (environment forces it), inadvertent (developers don't realize), impatient (too lazy to abstract), inter-developer (multiple people duplicate) - Comments that restate the code violate DRY -- explain *why*, not *what* - Database schemas, API specs, and documentation duplicate knowledge unless generated from a single source - The opposite of DRY is WET: "Write Everything Twice" or "We Enjoy Typing" **Code applications:** | Context | Pattern | Example | |---------|---------|---------| | **Config values** | Single source of truth | DB connection in one env file, referenced everywhere | | **Validation rules** | Shared schema | One JSON Schema or Zod schema for client and server | | **API contracts** | Generate from spec | OpenAPI spec generates types, docs, and client code | See: [references/dry-orthogonality.md](references/dry-orthogonality.md) when classifying a specific duplication or deciding whether two code blocks are truly the same knowledge -- per-type examples and mitigations for the four duplication types. ### 2. Orthogonality **Core concept:** Two components are orthogonal if changes in one do not affect the other. Design systems where components are self-contained, independent, and have a single, well-defined purpose. **Why it works:** Decoupling localizes change -- a fix in one module can't ripple into unrelated ones, so blast radius stays bounded. Change the database layer and the UI should not break; change the auth provider and business logic should not care. **Key insights:** - Ask: "If I dramatically change the requirements behind a function, how many modules are affected?" The answer should be one - Eliminate effects between unrelated things -- a logging change should never break billing - Layered architectures promote orthogonality: presentation, domain logic, data access - Avoid global data -- every consumer of global state is coupled to it - Frameworks that force you to inherit from their classes reduce orthogonality **Code applications:** | Context | Pattern | Example | |---------|---------|---------| | **Architecture** | Layered separation | Controller -> Service -> Repository, each replaceable | | **Dependencies** | Dependency injection | Pass a `Notifier` interface, not a `SlackClient` concrete class | | **Testing** | Isolated unit tests | Test business logic without database, network, or filesystem | See: [references/dry-orthogonality.md](references/dry-orthogonality.md) when measuring coupling or refactoring toward decoupled layers -- the change-impact and stranger tests, layered-architecture diagram, and the helicopter analogy. ### 3. Tracer Bullets and Prototypes **Core concept:** Tracer bullets are end-to-end implementations connecting all layers of the system with minimal functionality. Unlike prototypes (which are throwaway), tracer bullet code is production code -- thin but real. **Why it works:** Tracer bullets give immediate end-to-end feedback before you invest in filling out every feature. Users see something real, developers have a framework to build on, and integration issues surface early. **Key insights:** - Tracer bullet: thin but complete path through the system (UI -> API -> DB) -- you keep it - Prototype: focused exploration of a single risky aspect -- you throw it away - Use tracer bullets when "shooting in the dark" -- vague requirements, unproven architecture - If a tracer misses, adjust and fire again -- the cost of iteration is low - Label prototypes clearly as throwaway -- never let one become production code **Code applications:** | Context | Pattern | Example | |---------|---------|---------| | **New project** | Verti
Build lean, opinionated products using the 37signals philosophy from "Getting Real", "Rework", and "Shape Up". Use when the user mentions "Getting Real", "Rework", "Shape Up", "37signals", "Basecamp method", "six-week cycles", "fixed time variable scope", "appetite vs estimates", "betting table", "breadboarding", "fat marker sketch", "build less", "underdo the competition", "opinionated software", "we have too many meetings", "how do we ship faster", or "stop overbuilding". Also trigger when cutting scope to ship sooner, running a small team, or avoiding long-term roadmaps. Covers shaping, betting, building, and the art of saying no. For MVP validation, see lean-startup. For design sprints, see design-sprint.
Create uncontested market space using value innovation instead of competing head-to-head. Use when the user mentions "blue ocean", "red ocean", "strategy canvas", "ERRC framework", "value innovation", "non-customers", "buyer utility map", "the market is too crowded", "how do we stand out", or "escape the price war". Also trigger when exploring a new market category, or finding underserved or non-customers. Covers the Four Actions Framework, Six Paths, buyer utility map, and value-cost trade-offs. For real strategy formulation and bad-strategy detection, see good-strategy-bad-strategy. For tech adoption strategy, see crossing-the-chasm. For product positioning, see obviously-awesome.
Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to entities. Use when the user mentions "architecture layers", "dependency rule", "ports and adapters (hexagonal)", "onion architecture", "screaming architecture", "where should business logic go", "decouple from the database", "swap the framework without a rewrite", or "keep business rules independent". Also trigger when deciding which layer code belongs in, isolating core logic from infrastructure, defining module boundaries, or debating whether the framework should call your code or the reverse. Covers component principles, boundaries, and SOLID. For code-level quality, see clean-code. For domain modeling, see domain-driven-design.
Write readable, maintainable code through disciplined naming, small functions, and clean error handling. Use when the user mentions "clean up this code", "this function is too long", "code smells", "naming conventions", "boy scout rule", "single responsibility", or "unit test quality". Also trigger when reviewing a pull request for readability, untangling a messy function, debating comment styles, or improving error-handling patterns. Covers SRP, comment discipline, formatting, and unit testing. For refactoring techniques, see refactoring-patterns. For architecture and dependency rules, see clean-architecture.
Engineer word-of-mouth and virality using the STEPPS framework (Social Currency, Triggers, Emotion, Public, Practical Value, Stories). Use when the user mentions "go viral", "word of mouth", "shareable content", "social currency", "why people share", "referral program", "nobody is sharing it", or "make this spread". Also trigger when designing shareable features, crafting social campaigns, or building products that spread through peer recommendation. Covers environmental triggers and high-arousal emotional content. For sticky messaging, see made-to-stick. For persuasion tactics, see influence-psychology.
Build a weekly cadence of customer touchpoints using Opportunity Solution Trees, assumption mapping, and interview snapshots. Use when the user mentions "continuous discovery", "opportunity solution tree", "weekly interviews", "assumption testing", "discovery habits", "product trio", "outcome-based roadmap", "how do I talk to customers regularly", "we keep building things nobody uses", or "connect research to the roadmap". Also trigger when setting up regular customer feedback loops, prioritizing which experiments to run, or tying discovery insights to delivery work. Covers experience mapping, co-creation, and prioritizing opportunities. For interview technique, see mom-test. For team structure, see inspired-product.
Audit websites and landing pages for conversion issues and design evidence-based A/B tests. Use when the user mentions "landing page isnt converting", "conversion rate", "A/B test", "why visitors leave", "objection handling", "bounce rate", "conversion funnel", "increase signups", or "people add to cart but dont buy". Also trigger when diagnosing why signups are low, designing experiment hypotheses, or auditing checkout flows for friction points. Covers funnel mapping, persuasion assets, and objection/counter-objection frameworks. For overall marketing strategy, see one-page-marketing. For usability issues, see ux-heuristics.
Navigate the technology adoption lifecycle from early adopters to mainstream market. Use when the user mentions "crossing the chasm", "beachhead segment", "whole product", "early adopters vs mainstream", "tech go-to-market", "bowling pin strategy", "technology adoption lifecycle", "pragmatist buyers", "growth stalled after early adopters", or "our go-to-market plan". Also trigger when planning go-to-market for a technical product. Covers the D-Day analogy, bowling-pin strategy, the tornado, and positioning against incumbents. For product positioning, see obviously-awesome. For new market creation, see blue-ocean-strategy.