principal-engineering
riekelt/principal-engineer
Evidence-based engineering discipline for safe, verifiable changes to code, data, and infrastructure.
What is principal-engineering?
Principal engineering is a foundational skill that encodes disciplined practices for any non-trivial engineering work: implementing, debugging, refactoring, or investigating system behavior. It enforces grounding decisions in actual code and data, establishes hard safety rules (no silent errors, immutable migrations, verified claims), and requires a pre-change checkpoint documenting current behavior, blast radius, invariants, and verification method.
- Enforce evidence-over-theory discipline: check actual system behavior rather than relying on patterns or memory
- Establish mandatory pre-change checkpoint: document grounded state, blast radius, invariants, and verification command before writing code
- Enforce hard safety rules: no silent error swallows, immutable applied migrations, secret-value protection, and destructive-operation oversight
- Classify work into risk tiers to calibrate rigor: top-tier paths demand maximum proof; ordinary paths get standard rigor
- Guide when to load sibling skills for specific engineering tasks: grounding, failure handling, source-of-truth, verification, safety, scoping, testing, and architecture
How to install principal-engineering
npx skills add https://github.com/riekelt/principal-engineer --skill principal-engineeringHow to use principal-engineering
- 1.Before any non-trivial change, fill the mandatory checkpoint in working notes: state what you read or ran to know current behavior, what this change touches, what must not break, and the command that proves it worked
- 2.Load the appropriate sibling skill based on the task type (grounding, failures, source-of-truth, verification, safety, scoping, testing, unit tests, architecture, or dependencies)
- 3.Apply the hard rules: log or rethrow every error (no silent swallows), treat applied migrations as immutable history, name what was checked when claiming done, protect secret values, and require eyes-first review for destructive operations
- 4.Use evidence from code, data, and profiling to ground decisions rather than pattern-matching or memory
- 5.State the risk tier when not obvious; apply maximum rigor to top-tier paths (money, user data, safety gates, irreversible operations)
Use cases
- Starting a change, debug session, or work in unfamiliar code: load grounding-before-coding
- Writing or touching error paths, fallbacks, or defaults: load handling-failures
- Adding data, config, state, or duplicates: load keeping-one-source-of-truth
- Claiming a task is done, fixed, or passing: load verifying-before-done
- Deleting, overwriting, restarting, or touching secrets or live systems: load operating-safely
- Backend and infrastructure engineers making production changes
- Developers debugging complex systems or unfamiliar codebases
- DevOps and SRE teams operating live services
- Anyone responsible for code or data where being wrong has a cost
principal-engineering FAQ
Load principal-engineering for any non-trivial engineering work as the foundation. Then load the matching sibling skill based on your task: grounding-before-coding for starting work, handling-failures for error paths, keeping-one-source-of-truth for data/config, verifying-before-done when claiming done, operating-safely for destructive operations, scoping-changes when scope shifts, testing-changes for test decisions, writing-unit-tests for test code, guarding-architecture for module boundaries, and adding-dependencies for package changes.
Before writing the first line of a non-trivial change, state in working notes: 'Grounded: <what you read or ran to know current behavior> | Blast radius: <what this change touches> | Invariants: <what must not break> | Verify: <the command that proves it worked>'. Fill it from actual code and data, not memory. A field you cannot fill is work you do first.
No silent error swallows (every catch logs and rethrows or returns a typed failure); applied migrations are immutable history (corrections are new migrations); never claim verified without naming what was checked; secret values are never read, printed, or decrypted to disk; destructive operations need eyes first; and evidence beats theory (profile and query before concluding).
All rules hold at every tier; the tier sets how much proof they demand. Top-tier work (money paths, user data, safety gates, irreversible operations) gets maximum rigor: invariant tests, independent verification, and the full checkpoint taken literally. Ordinary paths get standard rigor. Tooling and throwaway work still obey hard rules but earn no gold-plating. State the tier when not obvious.
A duplicate in code you are touching gets absorbed as part of the work. One merely noticed elsewhere gets surfaced and tracked, not silently fixed and not silently left. This is part of the keeping-one-source-of-truth discipline.
Full instructions (SKILL.md)
Source of truth, from riekelt/principal-engineer.
name: principal-engineering description: Use when doing any non-trivial engineering work - implementing, debugging, refactoring, configuring, operating, or investigating why a system misbehaves - or any change where being wrong has a cost. Encodes the evidence-over-theory discipline, the hard safety rules, and the pre-change checkpoint. Use whenever code, data, or infrastructure is about to change or must be understood before it can, even if the task looks routine or is only "find out why". Foundation for the sibling skills.
Principal engineering
Overview
Check what the system actually does rather than recalling a pattern for it. Ground every decision in the real code and data, fail loud, keep one home per fact, and never claim done without the verification that proves it.
Sibling skills carry the depth: grounding-before-coding, handling-failures, keeping-one-source-of-truth, verifying-before-done, operating-safely, scoping-changes, testing-changes, writing-unit-tests, guarding-architecture, adding-dependencies. Load the matching one on top of this.
When to invoke
| The task is | Also load |
|---|---|
| Starting a change, a debug, or work in unfamiliar code | grounding-before-coding |
| Writing or touching any error path, fallback, or default | handling-failures |
| Adding data, config, state, or a second copy of anything | keeping-one-source-of-truth |
| Claiming "done", "fixed", or "passing" | verifying-before-done |
| Deleting, overwriting, restarting, or touching secrets or live systems | operating-safely |
| Deciding how big a fix should be, or noticing scope move mid-task | scoping-changes |
| Deciding what tests a change owes, or facing an empty test diff | testing-changes |
| Writing or fixing a unit test, or taming a flaky or unreadable one | writing-unit-tests |
| Crossing module boundaries or touching stated principles | guarding-architecture |
| Adding, updating, vetting, or removing a package, library, or base image | adding-dependencies |
The documents around the work (specs, decisions, changelogs, runbooks, postmortems, issues) are the technical-writer plugin's job where installed; these skills govern the engineering itself and defer to it for the prose.
Scope limits
- Not a style guide: formatting, naming taste, and framework choice belong to the repository's own conventions, which win.
- Not a replacement for project instructions: CLAUDE.md and repository rules outrank everything here.
- Not a source of product decisions: what to build comes from the owner; this governs how built things stay true and safe.
Mandatory checkpoint before a non-trivial change
Before writing the first line, state in working notes:
Grounded: <what you read or ran to know the current behavior> | Blast radius: <what this change touches> | Invariants: <what must not break> | Verify: <the command that will prove it worked>
Fill it from the code and data, not from memory or plausibility. A field you cannot fill is the work you do first.
Hard rules
Non-negotiable, in every repository:
- No silent error swallows. Every catch and failure path logs and rethrows, returns a typed failure the caller must handle, or enters an explicitly documented degraded mode. A new silent swallow is an automatic review BLOCKER. See
handling-failures. - An applied migration is immutable history. Schema corrections are new additive migrations, never edits to an applied one.
- Never claim verified without naming what was checked. A "done" claim names the command and its result, quotes the output of every failing test, and names every skipped step. See
verifying-before-done. - Secret values are never read, printed, or decrypted to disk. Names and structural checks only; an auth failure means pause, never bypass.
- Destructive operations need eyes first. Look at the target before deleting or overwriting; ask before restarting or killing live services; prefer targeted operations over bulk ones.
- Evidence beats theory. Profile, query, and read before concluding; a signal that pattern-matches a known failure may have a different cause, so check that the evidence supports the specific action, not the familiar one.
Risk tiers set the rigor
The rules hold at every tier; the tier sets how much proof they demand. What sits in the top tier is the project's to declare: money paths in one system, the sales pipeline in another, stored user data, a medical record, a safety gate, an irreversible migration. The project's rules or CLAUDE.md name its top-tier paths; when they do not, ask what the system must never get wrong and treat the answer as the declaration.
Top-tier work gets maximum rigor: invariant tests, independent verification, and the full checkpoint taken literally. Ordinary paths get standard rigor. Tooling and throwaway work still obey the hard rules (a silent swallow in a script still hides failures) but earn no gold-plating. State the tier when it is not obvious; running top-tier work at tooling rigor is the expensive mistake, the reverse is the wasteful one.
The rule lifecycle
Something that bites twice becomes a written rule with its provenance (what happened, when, how to avoid it); once is learning. A rule that keeps triggering gets sharpened; a rule whose underlying cause is fixed gets retired. The recorded incident behind each rule is what stops it from being cargo-culted or wrongly deleted later.
Common mistakes
- Acting on a document's claim about the system instead of the system; doc status goes stale fast, the code and the history are the record.
- Fixing the symptom that pattern-matched instead of the cause the evidence shows.
- Treating "the tests are green" as "the change works"; a green suite over code that cannot work means the suite does not run or does not test.
- Leaving a duplicate untouched in code you are changing: a duplicate in code you touch gets absorbed as part of the work; one merely noticed elsewhere gets surfaced and tracked, not silently fixed and not silently left. See
keeping-one-source-of-truth. - Growing a fix past its trigger because improvements were adjacent. See
scoping-changes.
Related skills
More from riekelt/principal-engineer and the wider catalog.

scoping-changes
Right-size fixes to their trigger; decompose visibly instead of trimming quietly.

testing-changes
Determine what tests a behavior change requires and verify test coverage is sufficient.

verifying-before-done
Verify every completion claim by driving the change at its surface and running the verify command before declaring done.

writing-unit-tests
Behavior-first unit testing: one claim per test, deterministic setup, mocks only at external boundaries.

diagramming-processes
Diagram business processes, workflows, and system interactions as maintainable source code.

documenting-contracts
Document HTTP APIs, message contracts, and file formats with exhaustive wire-level detail at the right abstraction level.