Principal Engineering

riekelt/principal-engineer/plugins/principal-engineer/skills/principal-engineering

作者 riekelte67b7af9ac74無授權條款5 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫3 週前更新

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.

AI 產生的概覽

為重要工程工作提供以證據為先的紀律、安全硬規則與變更前檢查點。

功能
此技能為重要工程工作提供一套紀律:要求決策以真實程式碼與資料為依據,填寫變更前檢查點(依據、影響範圍、不變量、驗證方式),並遵守不得靜默吞掉錯誤、已套用的遷移不可修改等硬規則。它也定義風險層級以決定驗證嚴格程度、將重複發生的事故轉為書面規則的規則生命週期,以及常見錯誤清單。其產出是工作筆記、檢查點與驗證聲明,而非程式碼產物,並指向同類技能以取得特定主題的深入內容。
適用情境
適用於實作、除錯、重構、設定、維運或排查系統異常,以及任何出錯會有代價的變更。它應在修改程式碼、資料或基礎設施之前,或在必須先理解系統時載入,即使任務看起來很例行。
執行需求
不需要指令碼或工具,僅為說明性指示。它假定代理在程式碼儲存庫中工作,並可能引用 CLAUDE.md 等專案指示與同類技能。

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 isAlso load
Starting a change, a debug, or work in unfamiliar codegrounding-before-coding
Writing or touching any error path, fallback, or defaulthandling-failures
Adding data, config, state, or a second copy of anythingkeeping-one-source-of-truth
Claiming "done", "fixed", or "passing"verifying-before-done
Deleting, overwriting, restarting, or touching secrets or live systemsoperating-safely
Deciding how big a fix should be, or noticing scope move mid-taskscoping-changes
Deciding what tests a change owes, or facing an empty test difftesting-changes
Writing or fixing a unit test, or taming a flaky or unreadable onewriting-unit-tests
Crossing module boundaries or touching stated principlesguarding-architecture
Adding, updating, vetting, or removing a package, library, or base imageadding-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.

來源與署名

來源:riekelt/principal-engineer位於plugins/principal-engineer/skills/principal-engineering提交e67b7af

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架