forge

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Forge Skill

Forge 技能

Typically runs automatically via SessionEnd hook.
Extract knowledge from session transcripts.
通常通过SessionEnd hook自动运行。
从会话记录中提取知识。

How It Works

工作原理

The SessionEnd hook runs:
bash
ao forge transcript --last-session --queue --quiet
This queues the session for knowledge extraction.
SessionEnd hook会执行以下命令:
bash
ao forge transcript --last-session --queue --quiet
该命令将会话加入知识提取队列。

Manual Execution

手动执行

Given
/forge [path]
:
当输入
/forge [路径]
时:

Step 1: Identify Transcript

步骤1:识别会话记录

With ao CLI:
bash
undefined
使用ao CLI:
bash
undefined

Mine recent sessions

挖掘近期会话

ao forge --recent
ao forge --recent

Mine specific transcript

挖掘指定会话记录

ao forge transcript <path>

**Without ao CLI:**
Look at recent conversation history and extract learnings manually.
ao forge transcript <path>

**不使用ao CLI:**
查看近期对话历史,手动提取经验。

Step 2: Extract Knowledge Types

步骤2:提取知识类型

Look for these patterns in the transcript:
TypeSignalsWeight
Decision"decided to", "chose", "went with"0.8
Learning"learned that", "discovered", "realized"0.9
Failure"failed because", "broke when", "didn't work"1.0
Pattern"always do X", "the trick is", "pattern:"0.7
在会话记录中寻找以下模式:
类型识别信号权重
决策"decided to", "chose", "went with"0.8
经验"learned that", "discovered", "realized"0.9
失误"failed because", "broke when", "didn't work"1.0
模式"always do X", "the trick is", "pattern:"0.7

Step 3: Write Candidates

步骤3:撰写候选条目

Write to:
.agents/forge/YYYY-MM-DD-forge.md
markdown
undefined
写入至:
.agents/forge/YYYY-MM-DD-forge.md
markdown
undefined

Forged: YYYY-MM-DD

挖掘结果:YYYY-MM-DD

Decisions

决策

  • [D1] <decision made>
    • Source: <where in conversation>
    • Confidence: <0.0-1.0>
  • [D1] <所做决策>
    • 来源:<对话中的对应位置>
    • 置信度:<0.0-1.0>

Learnings

经验

  • [L1] <what was learned>
    • Source: <where in conversation>
    • Confidence: <0.0-1.0>
  • [L1] <所获得的经验>
    • 来源:<对话中的对应位置>
    • 置信度:<0.0-1.0>

Failures

失误

  • [F1] <what failed and why>
    • Source: <where in conversation>
    • Confidence: <0.0-1.0>
  • [F1] <失误内容及原因>
    • 来源:<对话中的对应位置>
    • 置信度:<0.0-1.0>

Patterns

模式

  • [P1] <reusable pattern>
    • Source: <where in conversation>
    • Confidence: <0.0-1.0>
undefined
  • [P1] <可复用模式>
    • 来源:<对话中的对应位置>
    • 置信度:<0.0-1.0>
undefined

Step 4: Index for Search

步骤4:建立索引以便搜索

bash
ao forge index .agents/forge/YYYY-MM-DD-forge.md 2>/dev/null
bash
ao forge index .agents/forge/YYYY-MM-DD-forge.md 2>/dev/null

Step 5: Report Results

步骤5:汇报结果

Tell the user:
  • Number of items extracted by type
  • Location of forge output
  • Candidates ready for promotion to learnings
告知用户以下信息:
  • 按类型统计的提取条目数量
  • 挖掘结果的存储位置
  • 已准备好升级为正式经验的候选条目

The Quality Pool

质量池

Forged candidates enter at Tier 0:
Transcript → /forge → .agents/forge/ (Tier 0)
                   Human review or 2+ citations
                   .agents/learnings/ (Tier 1)
挖掘得到的候选条目初始为0级:
会话记录 → /forge → .agents/forge/ (0级)
                   人工审核或被引用2次及以上
                   .agents/learnings/ (1级)

Key Rules

核心规则

  • Runs automatically - usually via hook
  • Extract, don't interpret - capture what was said
  • Score by confidence - not all extractions are equal
  • Queue for review - candidates need validation
  • 自动运行 - 通常通过hook触发
  • 仅提取不解读 - 如实记录对话内容
  • 按置信度评分 - 并非所有提取内容的价值都相同
  • 加入审核队列 - 候选条目需经过验证