
principal-engineering
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.
- Installs
- 18.4K
- Last 24h
- +390
- Trending rank
- #785
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/riekelt/principal-engineer --skill principal-engineering- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads principal-engineering automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
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.
FAQ
What does the principal-engineering skill do?
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.
How do I install principal-engineering?
Run npx skills add https://github.com/riekelt/principal-engineer --skill principal-engineering in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/principal-engineering/ (personal) or .claude/skills/principal-engineering/ (project).
Which AI agents can use principal-engineering?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is principal-engineering safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains principal-engineering?
It is published by riekelt in riekelt/principal-engineer. It has 18,415 recorded installs.
More from riekelt/principal-engineer
writing-unit-tests
riekelt/principal-engineer
Use when writing or refactoring unit tests - a new test file, added cases, a flaky test, an unreadable one. Encodes behavior-first testing: one behavior per test, names that state the claim, deterministic setup, mocks only at boundaries you do not own. Use whenever a test is being written, even a quick one, and whenever a test needs a sleep, a mock of your own code, or a copy of the implementation's math.
verifying-before-done
riekelt/principal-engineer
Use when about to say "done", "fixed", "passing", or "shipped", or when reporting the outcome of any change. Encodes verification as the definition of done: drive the change at its surface, run the verify command, report faithfully, distrust green suites, own failing gates. Use before every completion claim, even when the change was small and obviously correct, which is when this is skipped.
guarding-architecture
riekelt/principal-engineer
Use when a change crosses module boundaries, adds a dependency direction between modules, touches a critical path, or conflicts with a stated principle - and when writing or updating architecture principles themselves. Encodes structural invariants as named, enforced contracts: statement, rationale, guard. Use whenever "we'll just import it from there for now" appears, which is how boundaries die.
keeping-one-source-of-truth
riekelt/principal-engineer
Use when adding data, config, state, constants, an enum-like string, a cache, or anything that could exist in two places - or when two sources already disagree. Encodes the one-fact-one-source doctrine for code and data: derive rather than store, extend the owner, absorb duplicates. Use at the moment copying a value feels faster than referencing it.
testing-changes
riekelt/principal-engineer
Use when deciding what tests a change needs - a feature, a bug fix, a refactor, any behavior change - or when reviewing whether a diff's tests are sufficient. Encodes tests-change-with-behavior, the bug-regression pattern, and assertion discrimination. Use whenever behavior changes and the test diff is empty, especially when the change is "too small to test".
grounding-before-coding
riekelt/principal-engineer
Use when starting any non-trivial change, investigating a bug, or working in unfamiliar code - before the first line is written. Also use for pure investigation with no change planned yet - "dig into this", "figure out why", "sometimes the export is empty", intermittent errors after a deploy. Encodes the ground-first discipline: map the real code and data, quote evidence, never guess conventions. Use whenever a change or a conclusion is about to be built from belief instead of from the tree, even under time pressure.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.