K

keeping-one-source-of-truth

by @riekeltv
4.6(120)

このスキルは、データ・設定・状態・定数・キャッシュなどを追加する際に、単一の真実源(シングルソース・オブ・トゥルース)を特定・維持する方法を案内します。保存ではなく導出、所有者の拡張、重複の吸収、不一致の表面化といった原則に基づき、複製によるデータのずれを防ぎます。列挙型や設定マッピング、デフォルト値などが重複しがちなコードベースで有効で、データ不整合によるトラブルシューティングの時間を大幅に減らし、保守性と信頼性を高めます。

single-source-of-truthdata-consistencysoftware-architecturecode-maintainabilityGitHub
インストール方法
npx skills add https://github.com/riekelt/principal-engineer --skill keeping-one-source-of-truth
compare_arrows

Before / After 効果比較

1 组
使用前

このスキルがない場合、設定・列挙型・定数が複数箇所にコピーされ、データ不整合が発生しがちです。各コピーを比較し、どれが古いかを調べるのに数時間かかり、暗黙の依存関係を見落とすこともあります。

使用後

このスキルは単一の真実源と導出を強制し、重複コピーを根本的に排除します。新しいデータは自動的に正しい所有者へ導かれ、不整合の問題は激減し、修正時間は数時間から30分以内に短縮され、システムを健全に保ちます。

SKILL.md

Keeping one source of truth

REQUIRED BACKGROUND: the principal-engineering skill.

Overview

Every fact about the system lives in exactly one place, and every other part of the system reads it from there. This outranks convenience: a second copy is a future contradiction, and the copy that drifts is always the one nobody remembers exists. When two places can hold the same truth they will eventually disagree, and the system then looks healthy while serving wrong data.

The doctrine

  1. Before adding data, find who already owns it. Extend that owner; do not start a rival. Finding the owner is cheaper than the incident two owners eventually cause.
  2. Derive rather than store. If the platform or an existing source can answer it at read time, read it there; do not copy the answer into a second source where it can go stale.
  3. Absorb duplicates you find on the way. When you touch code that hardcodes what a file already knows (or the reverse), fold the two together as part of the work instead of leaving a third variant behind.
  4. A missing entry fails loud (see handling-failures): the single source is only authoritative if absence from it is an error, never a silent default.
  5. Mark generated versus hand-edited, and never edit generated output. Every artifact states which it is; edits to derived files are lost work plus a divergence.
  6. Vocabulary is typed, not stringly. Identifiers, kinds, states, and names that code branches on are constants, enums, sealed types, or registry entries; a free string spelled twice is two sources of truth with a typo between them.
  7. When two sources disagree, say so. One of them is stale. Surfacing the contradiction is the first fix. The full fix determines which value is live, collapses to one source, and deletes the loser. Silently following either one launders the disagreement into whichever answer you happened to read first. On a declared critical path, a live disagreement earns a direct message to the owner, not only a tracked item; an unread ticket surfaces nothing.

Boundaries

  • Caches and read models are legitimate derived copies when their derivation is automatic and their staleness is bounded and observable. The rule bans copies a person keeps in sync by hand.
  • Test fixtures may freeze a copy of reality on purpose; the word fixture is the label that says so.
  • Documentation follows the same rule (an index routes, never decides); the technical-writer plugin's technical-writing skill carries that side where installed.

Common mistakes

  • Copying a threshold, URL, or mapping "temporarily". Temporary copies have the same lifetime as the TODO above them.
  • Creating thing-v2 beside thing instead of editing in place. The second file is a fork of the truth, and both will receive different fixes.
  • A default value in code that shadows the config file's value. When someone changes the config and nothing happens, this is why.
  • Two enums in two services spelling the same states. The day one gains a state, the boundary between them becomes a silent filter.

ユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数17.1K
評価4.6 / 5.0
バージョン
更新日2026年10月23日
比較事例1 件

ユーザー評価

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

この Skill を評価

0.0

対応プラットフォーム

🤖claude-code

タイムライン

作成2026年8月30日
最終更新2026年10月23日
🎁 Agent 知識カード
アンケート