provenance

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Provenance Skill

Provenance Skill

Trace knowledge artifact lineage to sources.
追踪知识工件的来源谱系。

Execution Steps

执行步骤

Given
/provenance <artifact>
:
当输入
/provenance <artifact>
时:

Step 1: Read the Artifact

步骤1:读取工件

Tool: Read
Parameters:
  file_path: <artifact-path>
Look for provenance metadata:
  • Source references
  • Session IDs
  • Dates
  • Related artifacts
Tool: Read
Parameters:
  file_path: <artifact-path>
查找来源元数据:
  • 来源引用
  • 会话ID
  • 日期
  • 相关工件

Step 2: Trace Source Chain

步骤2:追溯来源链

bash
undefined
bash
undefined

Check for source metadata in the file

检查文件中的来源元数据

grep -i "source|session|from|extracted" <artifact-path>
grep -i "source|session|from|extracted" <artifact-path>

Search for related transcripts using ao

使用ao搜索相关对话记录

ao forge search "<artifact-name>" 2>/dev/null
undefined
ao forge search "<artifact-name>" 2>/dev/null
undefined

Step 3: Search Session Transcripts with CASS

步骤3:使用CASS搜索会话对话记录

Use CASS to find when this artifact was discussed:
bash
undefined
使用CASS查找该工件的讨论时间:
bash
undefined

Extract artifact name for search

提取工件名称用于搜索

artifact_name=$(basename "<artifact-path>" .md)
artifact_name=$(basename "<artifact-path>" .md)

Search session transcripts

搜索会话对话记录

cass search "$artifact_name" --json --limit 5

**Parse CASS results to find:**
- Sessions where artifact was created/discussed
- Timeline of references
- Related sessions by workspace

**CASS JSON output fields:**
```json
{
  "hits": [{
    "title": "...",
    "source_path": "/path/to/session.jsonl",
    "created_at": 1766076237333,
    "score": 18.5,
    "agent": "claude_code"
  }]
}
cass search "$artifact_name" --json --limit 5

**解析CASS结果以查找:**
- 工件创建/讨论的会话
- 引用时间线
- 工作区相关会话

**CASS JSON输出字段:**
```json
{
  "hits": [{
    "title": "...",
    "source_path": "/path/to/session.jsonl",
    "created_at": 1766076237333,
    "score": 18.5,
    "agent": "claude_code"
  }]
}

Step 4: Build Lineage Chain

步骤4:构建谱系链

Transcript (source of truth)
Forge extraction (candidate)
Human review (promotion)
Pattern recognition (tier-up)
Skill creation (automation)
对话记录(事实来源)
Forge提取(候选)
人工审核(升级)
模式识别(提升等级)
Skill创建(自动化)

Step 5: Write Provenance Report

步骤5:生成来源报告

markdown
undefined
markdown
undefined

Provenance: <artifact-name>

Provenance: <artifact-name>

Current State

当前状态

  • Tier: <0-3>
  • Created: <date>
  • Citations: <count>
  • Tier: <0-3>
  • Created: <date>
  • Citations: <count>

Source Chain

来源链

  1. Origin: <transcript or session>
    • Line/context: <where extracted>
    • Extracted: <date>
  2. Promoted: <tier change>
    • Reason: <why promoted>
    • Date: <when>
  1. 起源: <对话记录或会话>
    • 行/上下文:<提取位置>
    • 提取时间:<date>
  2. 升级: <等级变更>
    • 原因:<升级理由>
    • 时间:<when>

Session References (from CASS)

会话引用(来自CASS)

DateSessionAgentScore
<date><session-id><agent><score>
日期会话Agent得分
<date><session-id><agent><score>

Related Artifacts

相关工件

  • <related artifact 1>
  • <related artifact 2>
undefined
  • <related artifact 1>
  • <related artifact 2>
undefined

Step 6: Report to User

步骤6:向用户汇报

Tell the user:
  1. Artifact lineage
  2. Original source
  3. Promotion history
  4. Session references (from CASS)
  5. Related artifacts
需向用户告知:
  1. 工件谱系
  2. 原始来源
  3. 升级历史
  4. 会话引用(来自CASS)
  5. 相关工件

Finding Orphans

查找孤立工件

bash
/provenance --orphans
Find artifacts without source tracking:
bash
undefined
bash
/provenance --orphans
查找无来源追踪的工件:
bash
undefined

Files without "Source:" or "Session:" metadata

无“Source:”或“Session:”元数据的文件

for f in .agents/learnings/*.md; do grep -L "Source|Session" "$f" 2>/dev/null done
undefined
for f in .agents/learnings/*.md; do grep -L "Source|Session" "$f" 2>/dev/null done
undefined

Finding Stale Artifacts

查找过时工件

bash
/provenance --stale
Find artifacts where source may have changed:
bash
undefined
bash
/provenance --stale
查找来源可能已变更的工件:
bash
undefined

Artifacts older than their sources

存在超过30天的工件

find .agents/ -name "*.md" -mtime +30 2>/dev/null
undefined
find .agents/ -name "*.md" -mtime +30 2>/dev/null
undefined

Key Rules

核心规则

  • Every insight has a source - trace it
  • Track promotions - know why tier changed
  • Find orphans - clean up untracked knowledge
  • Maintain lineage - provenance enables trust
  • Use CASS - find when artifacts were discussed
  • 所有洞见必有来源 —— 追踪到底
  • 追踪升级记录 —— 了解等级变更原因
  • 查找孤立工件 —— 清理未追踪的知识
  • 维护谱系 —— 来源可追溯建立信任
  • 使用CASS —— 查找工件的讨论时间