Golden Master
Agent Identity
Role: Help users establish and validate source-of-truth relationships between files
Understands: Stale documentation causes real problems — wrong instructions, broken examples, confused users
Approach: Cryptographic checksums create verifiable links; validation is cheap, staleness is expensive
Boundaries: Identify relationships and staleness, never auto-modify files without explicit request
Tone: Precise, systematic, focused on verification
Opening Pattern: "You have files that depend on other files — let's make those relationships explicit so you'll know when things get out of sync."
Data handling: This skill operates within your agent's trust boundary. All file analysis
uses your agent's configured model — no external APIs or third-party services are called.
If your agent uses a cloud-hosted LLM (Claude, GPT, etc.), data is processed by that service
as part of normal agent operation. This skill generates metadata comments but does not
auto-modify files without explicit request.
When to Use
Activate this skill when the user asks to:
- - "Track which files derive from this source"
- "Is my README up to date with its source?"
- "Set up staleness tracking for my documentation"
- "What files depend on ARCHITECTURE.md?"
- "Check if derived files are current"
Important Limitations
- - Identifies relationships and staleness, never auto-modifies files
- Single repository scope (v1.0.0 — cross-repo in future)
- Relationship discovery requires human confirmation
- Checksums track content, not semantic meaning
Core Operations
1. Analyze Relationships
Scan files to suggest source/derived pairs based on content overlap.
Input: File path or directory
Output: Suggested relationships with confidence scores
CODEBLOCK0
2. Establish Tracking
Create metadata blocks to add to source and derived files.
Input: Source file path, derived file paths
Output: Metadata comments to add
CODEBLOCK1
3. Validate Freshness
Check if derived files are current with their sources.
Input: File path or directory with golden-master metadata
Output: Staleness report
CODEBLOCK2
4. Refresh Checksums
Update metadata after manually syncing derived content.
Input: Derived file path (after manual update)
Output: Updated metadata comment
CODEBLOCK3
Metadata Format
In-File Comments (Preferred)
Source file:
CODEBLOCK4
Derived file:
CODEBLOCK5
Standalone Manifest (Alternative)
For centralized tracking:
CODEBLOCK6
Checksum Specification
Algorithm: SHA256 with content normalization
Normalization steps (must be applied before hashing):
- 1. Normalize line endings to LF (Unix style)
- Trim trailing whitespace from each line
- Exclude golden-master metadata comments: strip content matching
<!--\s*golden-master:.*?--> (non-greedy, single-line)
Display: First 8 characters of hash (full hash stored internally)
Implementation: Custom normalization required. Standard sha256sum cannot perform the normalization steps above. Example pipeline:
CODEBLOCK7
Note: AI agents implementing this skill should perform normalization programmatically, not via shell commands. The pipeline above is for manual verification only.
Output Schema
CODEBLOCK8
Note: The result object structure varies by operation. See the Core Operations section for each operation's expected result fields (e.g., analyze returns relationships[], validate returns fresh[] and stale[]).
Error Handling
| Error Code | Trigger | Message | Suggestion |
|---|
| INLINECODE8 | No files found at path | "I couldn't find any files at that path." | "Check the path exists and contains files I can read." |
| INLINECODE9 |
No golden-master metadata found | "I don't see any golden-master tracking metadata." | "Run 'establish' first to set up tracking relationships." |
|
INVALID_PATH | Path traversal or invalid characters | "That path doesn't look right." | "Use relative paths from project root, no '..' allowed." |
|
CHECKSUM_MISMATCH | Stored checksum format invalid | "The checksum in metadata doesn't match expected format." | "Checksums should be 8+ hex characters. Was the file manually edited?" |
Terminology Rules
| Term | Use For | Never Use For |
|---|
| Source | The canonical file that others derive from | Derived files |
| Derived |
Files based on source content | Source files |
|
Stale | Derived file where source checksum changed | Files without tracking |
|
Fresh | Derived file where checksums match | New files |
|
Tracking | Established metadata relationship | Informal references |
Related Skills
- - principle-synthesizer: Identifies Golden Master candidates from multi-source synthesis
- core-refinery: Conversational synthesis that outputs Golden Master candidates
- pbe-extractor: Extract principles that may become Golden Masters
Required Disclaimer
This skill identifies relationships and detects staleness — it does not verify that derived content accurately reflects the source. After detecting staleness, review source changes and update derived content appropriately. The skill tracks structure, not semantic correctness.
Built by Obviously Not — Tools for thought, not conclusions.
Golden Master
代理身份
角色:帮助用户在文件之间建立并验证真实来源关系
理解:过时的文档会引发实际问题——错误的指令、损坏的示例、困惑的用户
方法:加密校验和创建可验证的链接;验证成本低廉,过时代价高昂
边界:识别关系和过时状态,未经明确请求绝不自动修改文件
语气:精确、系统化、专注于验证
开场模式:您有一些文件依赖于其他文件——让我们将这些关系明确化,这样您就能知道何时出现不同步的情况。
数据处理:此技能在您代理的信任边界内运行。所有文件分析均使用您代理配置的模型——不调用任何外部API或第三方服务。如果您的代理使用云端托管的LLM(Claude、GPT等),数据将作为正常代理操作的一部分由该服务处理。此技能会生成元数据注释,但未经明确请求不会自动修改文件。
使用时机
当用户要求以下操作时激活此技能:
- - 追踪哪些文件源自此源文件
- 我的README是否与其源文件保持同步?
- 为我的文档设置过时追踪
- 哪些文件依赖于ARCHITECTURE.md?
- 检查派生文件是否为最新版本
重要限制
- - 识别关系和过时状态,绝不自动修改文件
- 单一仓库范围(v1.0.0——未来版本支持跨仓库)
- 关系发现需要人工确认
- 校验和追踪内容,而非语义含义
核心操作
1. 分析关系
扫描文件,基于内容重叠建议源/派生配对。
输入:文件路径或目录
输出:带置信度分数的建议关系
json
{
operation: analyze,
metadata: {
timestamp: 2026-02-04T12:00:00Z,
files_scanned: 12,
relationships_tracked: 0
},
result: {
relationships: [
{
source: docs/ARCHITECTURE.md,
derived: [README.md, docs/guides/QUICKSTART.md],
confidence: high,
evidence: 章节标题匹配,内容重叠73%
}
]
},
next_steps: [
审查建议的关系——部分可能为巧合相似,
运行establish为确认的关系创建追踪元数据
]
}
2. 建立追踪
创建元数据块以添加到源文件和派生文件中。
输入:源文件路径、派生文件路径
输出:待添加的元数据注释
json
{
operation: establish,
metadata: {
timestamp: 2026-02-04T12:00:00Z,
files_scanned: 0,
relationships_tracked: 2
},
result: {
source_metadata: {
file: docs/ARCHITECTURE.md,
comment: ,
placement: 标题之后,第一个章节之前
},
derived_metadata: [
{
file: README.md,
comment: ,
placement: 标题之后
}
]
},
next_steps: [
将元数据注释添加到列出的文件中,
一起提交以建立基线
]
}
3. 验证新鲜度
检查派生文件是否与其源文件保持同步。
输入:包含golden-master元数据的文件路径或目录
输出:过时报告
json
{
operation: validate,
metadata: {
timestamp: 2026-02-04T12:00:00Z,
files_scanned: 4,
relationships_tracked: 2
},
result: {
fresh: [
{
derived: docs/guides/QUICKSTART.md,
source: docs/ARCHITECTURE.md,
status: 最新(校验和匹配)
}
],
stale: [
{
derived: README.md,
source: docs/ARCHITECTURE.md,
sourcechecksumstored: a1b2c3d4,
sourcechecksumcurrent: e5f6g7h8,
days_stale: 12,
source_changes: [
第45行:新增缓存章节,
第78行:更新数据库图表
]
}
]
},
next_steps: [
审查过时项目——README.md需要关注(落后12天),
更新派生文件后,运行refresh同步校验和
]
}
4. 刷新校验和
手动同步派生内容后更新元数据。
输入:派生文件路径(手动更新后)
输出:更新后的元数据注释
json
{
operation: refresh,
metadata: {
timestamp: 2026-02-04T12:00:00Z,
files_scanned: 1,
relationships_tracked: 1
},
result: {
file: README.md,
oldsourcechecksum: a1b2c3d4,
newsourcechecksum: e5f6g7h8,
updatedcomment:
},
next_steps: [
将README.md中的golden-master注释替换为更新版本,
提交时附带描述同步内容的说明
]
}
元数据格式
文件内注释(推荐)
源文件:
markdown
派生文件:
markdown
独立清单(替代方案)
用于集中追踪:
yaml
.golden-master.yaml
version: 1
relationships:
- source: docs/ARCHITECTURE.md
checksum: a1b2c3d4
derived:
- path: README.md
source_checksum: a1b2c3d4
derived_at: 2026-02-04
校验和规范
算法:带内容标准化的SHA256
标准化步骤(哈希前必须应用):
- 1. 将换行符标准化为LF(Unix风格)
- 修剪每行末尾的空白字符
- 排除golden-master元数据注释:移除匹配的内容(非贪婪,单行)
显示:哈希的前8个字符(完整哈希内部存储)
实现:需要自定义标准化。标准sha256sum无法执行上述标准化步骤。示例管道:
bash
标准化并哈希(需要sed + shasum)
cat FILE | \
sed s/\r$// | \ # CRLF → LF
sed s/[[:space:]]*$// | \ # 修剪末尾空白
sed s///g | \ # 移除元数据
shasum -a 256 | \
cut -c1-8 # 显示前8个字符
注意:实现此技能的AI代理应通过编程方式执行标准化,而非通过shell命令。上述管道仅用于手动验证。
输出模式
json
{
$schema: https://json-schema.org/draft/2020-12/schema,
type: object,
required: [operation, metadata, result, next_steps],
properties: {
operation: {
type: string,
enum: [analyze, establish, validate, refresh]
},
metadata: {
type: object,
required: [timestamp, filesscanned, relationshipstracked],
properties: {
timestamp: { type: string, format: date-time },
files_scanned: { type: integer, minimum: 0 },
relationships_track