knowledge-extractor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Knowledge Extractor Skill

Knowledge Extractor Skill

Purpose

用途

This skill automatically extracts, synthesizes, and preserves knowledge from conversations, debugging sessions, failed attempts, and solved problems. It converts ephemeral interactions into persistent organizational knowledge that improves future performance.
本Skill会自动从对话、调试会话、失败尝试和已解决问题中提取、合成并保存知识。它将短暂的交互转化为持久化的组织知识,以提升未来的工作表现。

When to Use This Skill

使用时机

  • Session End Analysis: Extract learnings before session context is lost
  • After Complex Debugging: Capture root causes and solutions while fresh
  • Following Failed Attempts: Document what didn't work and why
  • Successful Problem Solving: Preserve solutions for future reuse
  • New Pattern Discovery: Identify patterns that should be documented
  • Repeated Workflows: Recognize when to create new specialized agents
  • Cross-Session Learning: Build organizational memory from individual sessions
  • 会话结束分析:在会话上下文丢失前提取经验
  • 复杂调试后:趁记忆清晰时捕获根本原因和解决方案
  • 失败尝试后:记录无效方案及其原因
  • 问题解决成功后:保存解决方案以供未来复用
  • 新模式发现:识别应被记录的模式
  • 重复工作流:判断何时创建新的专用Agent
  • 跨会话学习:从单个会话中构建组织级记忆

Core Philosophy: Knowledge Preservation

核心理念:知识留存

Session Context: Ephemeral conversation context that will be lost without active preservation Persistent Knowledge: Structured learnings that improve future performance Pattern Recognition: Identifying when solutions are repeated and should be automated Organizational Growth: Converting individual learning into system-wide improvement
会话上下文:若不主动留存便会丢失的短暂对话信息 持久化知识:结构化的经验,可提升未来工作表现 模式识别:识别可自动化的重复解决方案 组织成长:将个人学习转化为全系统的能力提升

Knowledge Extraction Framework

知识提取框架

Three Types of Knowledge Extraction

三类知识提取

1. Discoveries - Novel Insights and Root Causes

1. 发现内容 - 新颖洞察与根本原因

What it captures: Problems encountered, root causes identified, solutions implemented
When to extract:
  • After solving a complex bug
  • When debugging reveals unexpected behavior
  • When discovering wrong assumptions
  • After identifying missing functionality
  • When learning why something failed
Format for DISCOVERIES.md:
markdown
undefined
捕获内容:遇到的问题、识别出的根本原因、已实施的解决方案
提取时机
  • 解决复杂Bug后
  • 调试发现意外行为时
  • 发现错误假设时
  • 识别缺失功能后
  • 了解失败原因后
DISCOVERIES.md 格式
markdown
undefined

[Brief Title] (YYYY-MM-DD)

[简短标题] (YYYY-MM-DD)

Issue

问题

What problem or challenge was encountered?
遇到了什么问题或挑战?

Root Cause

根本原因

Why did this happen? What was the underlying issue?
问题为何发生?潜在原因是什么?

Solution

解决方案

How was it resolved? Include code examples if relevant.
如何解决的?如有相关代码示例请附上。

Key Learnings

关键经验

What insights were gained? What should be remembered?
获得了哪些洞察?需要记住什么?

Prevention

预防措施

How can this be avoided in the future?

**Quality Criteria**:

- ✅ Specific problem, not generic advice
- ✅ Root cause clearly identified
- ✅ Working solution included
- ✅ Learning generalized for reuse
- ✅ Prevention strategy documented
未来如何避免此类问题?

**质量标准**:

- ✅ 具体问题,而非通用建议
- ✅ 明确识别根本原因
- ✅ 包含可行解决方案
- ✅ 经验可推广复用
- ✅ 记录预防策略

2. Patterns - Reusable Solutions

2. 模式 - 可复用解决方案

What it captures: Proven solutions to recurring problems, architectural approaches, design patterns
When to extract:
  • After solving a problem similar to known patterns
  • When recognizing a repeated problem type
  • When implementing a proven solution
  • When discovering a best practice that works
  • When solution applies across multiple contexts
Format for PATTERNS.md:
markdown
undefined
捕获内容:经验证的重复问题解决方案、架构方法、设计模式
提取时机
  • 解决与已知模式类似的问题后
  • 识别到重复出现的问题类型时
  • 实施经验证的解决方案后
  • 发现有效的最佳实践时
  • 解决方案可跨多场景应用时
PATTERNS.md 格式
markdown
undefined

Pattern: [Name]

Pattern: [名称]

Challenge

挑战

What problem does this pattern solve?
该模式解决了什么问题?

Solution

解决方案

How does the pattern work? Include code/examples.
模式如何运作?包含代码/示例。

Key Points

关键点

  • Main insight 1
  • Main insight 2
  • When to use / when not to use
  • 核心洞察1
  • 核心洞察2
  • 适用/不适用场景

When to Use

适用场景

Specific scenarios where this pattern applies.
该模式适用的具体场景。

Real Impact

实际效果

Where has this pattern been used successfully?
该模式在哪些场景下成功应用?

Related Patterns

相关模式

Links to similar or complementary patterns.

**Quality Criteria**:

- ✅ General enough to apply to multiple situations
- ✅ Problem clearly defined
- ✅ Solution has proven track record
- ✅ Working code examples
- ✅ Clear when/when-not-to-use guidance
相似或互补模式的链接。

**质量标准**:

- ✅ 具备多场景通用性
- ✅ 问题定义清晰
- ✅ 解决方案经实际验证
- ✅ 包含可行代码示例
- ✅ 明确适用/不适用指导

3. Agent Creation - Automation of Repeated Workflows

3. Agent创建 - 重复工作流自动化

What it captures: Workflows that are repeated frequently, specialized expertise areas, complex multi-step processes
When to extract:
  • After performing the same workflow 2-3 times
  • When recognizing a specialized skill area
  • When workflow has clear inputs/outputs
  • When automating would save significant time
  • When problem domain is narrow and well-defined
Agent Creation Trigger Checklist:
  • Same workflow repeated 2+ times
  • Workflow takes 30+ minutes to execute
  • Workflow has clear specialized focus
  • Workflow can be automated with current tools
  • Problem domain is narrow and well-defined
  • Would be high-value to automate
Example Agent Creation:
markdown
undefined
捕获内容:频繁重复的工作流、专业技能领域、复杂多步骤流程
提取时机
  • 同一工作流执行2-3次后
  • 识别到专业技能领域时
  • 工作流具备明确输入/输出时
  • 自动化可大幅节省时间时
  • 问题领域狭窄且定义明确时
Agent创建触发 checklist
  • 同一工作流重复执行2次以上
  • 工作流执行耗时30分钟以上
  • 工作流具备明确的专业聚焦
  • 工作流可通过现有工具自动化
  • 问题领域狭窄且定义明确
  • 自动化具备高价值
Agent创建示例
markdown
undefined

Recommended New Agent: [domain]-[specialty]

推荐新Agent: [领域]-[专业方向]

Problem

问题

What repeated workflow would this agent handle?
该Agent将处理哪些重复工作流?

Scope

范围

What's in scope | What's explicitly out of scope
包含内容 | 明确排除内容

Inputs

输入

What information does the agent need?
Agent需要哪些信息?

Process

流程

Step-by-step workflow the agent follows
Agent遵循的分步工作流

Outputs

输出

What does the agent produce?
Agent将生成什么结果?

Value

价值

How much time/effort does this save?
可节省多少时间/精力?

Integration

集成

Where in the workflow does this fit?
undefined
该Agent在工作流中的位置?
undefined

Step-by-Step Extraction Process

分步提取流程

Step 1: Session Analysis (5 minutes)

步骤1:会话分析(5分钟)

Review entire conversation/session:
1. What was the original problem/request?
2. What approaches were tried?
3. Which attempts failed and why?
4. What succeeded and why?
5. What was learned in the process?
6. What surprised you?
7. What took longer than expected?
8. What would have helped?
回顾整个对话/会话:
1. 最初的问题/请求是什么?
2. 尝试过哪些方法?
3. 哪些尝试失败了,原因是什么?
4. 哪些方法成功了,原因是什么?
5. 过程中学到了什么?
6. 有哪些意外发现?
7. 哪些步骤耗时超出预期?
8. 什么能对解决问题有所帮助?

Step 2: Pattern Recognition (5 minutes)

步骤2:模式识别(5分钟)

Identify patterns in the work:
1. Have I seen this problem before? (→ DISCOVERIES)
2. Is this a generalizable solution? (→ PATTERNS)
3. Would this be worth automating? (→ AGENT)
4. What was the root cause? (Why, not just what)
5. What should others know about this?
6. What should be remembered to avoid repetition?
识别工作中的模式:
1. 我之前遇到过这个问题吗?(→ 发现内容)
2. 这是可推广的解决方案吗?(→ 模式)
3. 值得自动化吗?(→ Agent)
4. 根本原因是什么?(要找原因,而非现象)
5. 其他人需要了解什么?
6. 需要记住什么以避免重复犯错?

Step 3: Knowledge Extraction (10 minutes)

步骤3:知识提取(10分钟)

Extract and structure knowledge:
For DISCOVERIES.md:
  • Specific issue encountered
  • Root cause analysis
  • Solution implemented
  • Key learnings generalized
  • Prevention strategy
For PATTERNS.md:
  • Problem the pattern solves
  • How the pattern works
  • When to use / when not to use
  • Working code examples
  • Related patterns
For New Agent:
  • Repeated workflow identified
  • Clear scope and boundaries
  • Input/output requirements
  • Step-by-step process
  • Expected value/time savings
提取并结构化知识:
针对DISCOVERIES.md
  • 遇到的具体问题
  • 根本原因分析
  • 已实施的解决方案
  • 可推广的关键经验
  • 预防策略
针对PATTERNS.md
  • 模式解决的问题
  • 模式运作方式
  • 适用/不适用场景
  • 可行代码示例
  • 相关模式
针对新Agent
  • 识别到的重复工作流
  • 明确的范围与边界
  • 输入/输出要求
  • 分步流程
  • 预期价值/时间节省

Step 4: Integration (3 minutes)

步骤4:集成(3分钟)

Place knowledge in correct locations:
Memory → Store discovery using store_discovery() from amplihack.memory.discoveries
PATTERNS.md → New pattern in appropriate section
Agent → Create in .claude/agents/amplihack/specialized/
将知识放置到正确位置:
内存 → 使用amplihack.memory.discoveries中的store_discovery()存储发现内容
PATTERNS.md → 在对应章节添加新模式
Agent → 在.claude/agents/amplihack/specialized/目录下创建

Step 5: Validation (2 minutes)

步骤5:验证(2分钟)

Ensure quality:
[ ] Entry is specific, not generic
[ ] Entry follows template format
[ ] Examples/code provided
[ ] Quality sufficient for reuse
[ ] Grammar and clarity checked
[ ] Related items cross-referenced
确保质量:
[ ] 内容具体,而非通用
[ ] 遵循模板格式
[ ] 提供示例/代码
[ ] 质量满足复用要求
[ ] 语法清晰无误
[ ] 关联内容已交叉引用

Usage Examples

使用示例

Example 1: Extract Discovery After Bug Fix

示例1:Bug修复后提取发现内容

Scenario: Just spent 45 minutes debugging why pre-commit hooks weren't working
User: Extract what we learned from debugging the pre-commit issue.

Claude:
1. Analyzes conversation showing:
   - Initial problem: hooks appeared to run but didn't modify files
   - False leads: blamed merge conflicts, tool versions
   - Root cause found: Hooks couldn't write to files due to cloud sync lock
   - Solution: Added exponential backoff retry logic
   - Time to discover: 45 minutes

2. Creates DISCOVERIES.md entry:
   - Issue: Pre-commit hooks silently failing
   - Root Cause: Cloud sync (OneDrive) file locks
   - Solution: Exponential backoff retry (0.1s, 0.2s, 0.4s...)
   - Key Learning: Cloud sync issues silent - need defensive coding
   - Prevention: Add retry logic for file I/O, test with cloud storage

3. Offers to also:
   - Add pattern for "Resilient File I/O" to PATTERNS.md
   - Suggest new agent for cloud-sync issue detection
场景:刚花45分钟调试pre-commit钩子不工作的问题
用户:提取我们从调试pre-commit问题中学到的内容。

Claude:
1. 分析对话内容:
   - 初始问题:钩子看似运行但未修改文件
   - 错误方向:归咎于合并冲突、工具版本
   - 根本原因:钩子因云同步锁定无法写入文件
   - 解决方案:添加指数退避重试逻辑
   - 排查耗时:45分钟

2. 创建DISCOVERIES.md条目:
   - 问题:Pre-commit钩子静默失败
   - 根本原因:云同步(OneDrive)文件锁定
   - 解决方案:指数退避重试(0.1s, 0.2s, 0.4s...)
   - 关键经验:云同步问题无提示 - 需要防御性编码
   - 预防措施:为文件I/O添加重试逻辑,使用云存储测试

3. 同时提供选项:
   - 在PATTERNS.md中添加"弹性文件I/O"模式
   - 建议创建云同步问题检测Agent

Example 2: Extract Pattern from Successful Implementation

示例2:从成功实施中提取模式

Scenario: Just finished implementing module regeneration strategy
User: Extract the pattern we discovered for building regeneratable modules.

Claude:
1. Analyzes implementation showing:
   - Clear __all__ exports defining public interface
   - Self-contained module structure
   - Type-hinted functions with docstrings
   - Comprehensive test coverage
   - Working examples

2. Creates PATTERNS.md entry:
   - Pattern: Module Regeneration Structure
   - Challenge: Modules become tightly coupled, hard to regenerate
   - Solution: Brick & studs design with __all__ public API
   - Key Points: Clear contracts, single responsibility, testable behavior
   - When to Use: Any utility module, anything that might be regenerated
   - Real Impact: Enables AI to rebuild modules without breaking system

3. Cross-references:
   - Relates to "Bricks & Studs Module Design"
   - Enables "Builder Agent Workflow"
场景:刚完成模块再生策略的实施
用户:提取我们发现的可再生模块构建模式。

Claude:
1. 分析实施内容:
   - 明确的__all__导出定义公共接口
   - 独立模块结构
   - 带类型提示的函数与文档字符串
   - 全面的测试覆盖
   - 可行示例

2. 创建PATTERNS.md条目:
   - Pattern: 模块再生结构
   - 挑战:模块耦合过紧,难以再生
   - 解决方案:带__all__公共API的积木式设计
   - 关键点:明确契约、单一职责、可测试行为
   - 适用场景:任何工具模块、可能需要再生的内容
   - 实际效果:支持AI在不破坏系统的情况下重建模块

3. 交叉引用:
   - 关联"积木式模块设计"
   - 支持"Builder Agent工作流"

Example 3: Identify New Agent Creation Opportunity

示例3:识别新Agent创建机会

Scenario: Just debugged CI failure using 5-step diagnostic process for 3rd time
User: We keep using the same CI debugging process. Should we automate it?

Claude:
1. Analyzes past sessions:
   - Session 1: 45 minutes CI debugging (version mismatch issue)
   - Session 2: 30 minutes CI debugging (pre-commit hook issue)
   - Session 3: 25 minutes CI debugging (merge conflict issue)
   - Pattern: Same 5-step process each time

2. Recommends new agent:
   - Name: ci-diagnostic-workflow
   - Problem: Each CI failure requires manual diagnosis, takes 30-45 min
   - Scope: Diagnoses CI failures, suggests fixes (doesn't auto-fix)
   - Process:
     1. Check environment (Python version, tool versions)
     2. Analyze CI logs for error patterns
     3. Detect common issues (conflicts, missing deps)
     4. Suggest solutions
     5. Coordinate parallel diagnostic agents
   - Value: Reduce diagnosis time from 45 min → 15 min

3. Proposes creating:
   - .claude/agents/amplihack/ci-diagnostic-workflow.md
   - Can delegate to: fix-agent for implementation
场景:第三次使用5步诊断流程调试CI失败
用户:我们一直在使用相同的CI调试流程。应该自动化吗?

Claude:
1. 分析过往会话:
   - 会话1:45分钟CI调试(版本不匹配问题)
   - 会话2:30分钟CI调试(pre-commit钩子问题)
   - 会话3:25分钟CI调试(合并冲突问题)
   - 模式:每次都使用相同的5步流程

2. 推荐新Agent:
   - 名称:ci-diagnostic-workflow
   - 问题:每次CI失败都需要手动诊断,耗时30-45分钟
   - 范围:诊断CI失败,建议修复方案(不自动修复)
   - 流程:
     1. 检查环境(Python版本、工具版本)
     2. 分析CI日志中的错误模式
     3. 检测常见问题(冲突、缺失依赖)
     4. 建议解决方案
     5. 协调并行诊断Agent
   - 价值:将诊断时间从45分钟缩短至15分钟

3. 提议创建:
   - .claude/agents/amplihack/ci-diagnostic-workflow.md
   - 可委托给fix-agent实施

Example 4: Multi-Level Extraction

示例4:多层级提取

Scenario: Complex architectural decision with multiple learnings
User: Extract everything we learned from deciding on the memory architecture.

Claude:
1. Session involved:
   - 2 failed approaches (too complex, wrong threat model)
   - 1 successful approach (simple, fits threat model)
   - Discovery of meta-pattern for architecture decisions

2. Creates THREE extractions:

   DISCOVERIES.md:
   - Issue: Pattern Applicability Analysis
   - Root Cause: Importing patterns without validating threat match
   - Solution: Five-phase applicability analysis framework
   - Learning: Threat model match is critical first check

   PATTERNS.md:
   - New Pattern: Threat Model Precision Principle
   - Challenge: Fault tolerance mechanisms mismatch problem space
   - Solution: Validate threat model before adopting patterns
   - When: Before adopting any "best practice" from different domain

   Recommended Agent:
   - Name: pattern-applicability-analyzer
   - Automate: Quick assessment of pattern applicability
   - Value: Prevent adopting wrong patterns early
场景:涉及多类经验的复杂架构决策
用户:提取我们在内存架构决策中学到的所有内容。

Claude:
1. 会话内容包括:
   - 2种失败方案(过于复杂、错误威胁模型)
   - 1种成功方案(简单、匹配威胁模型)
   - 发现架构决策的元模式

2. 创建三类提取内容:

   DISCOVERIES.md:
   - 问题:模式适用性分析
   - 根本原因:未验证威胁模型匹配便引入模式
   - 解决方案:五阶段适用性分析框架
   - 经验:威胁模型匹配是关键的首要检查项

   PATTERNS.md:
   - 新Pattern: 威胁模型精准原则
   - 挑战:容错机制与问题场景不匹配
   - 解决方案:采用模式前先验证威胁模型
   - 适用场景:从不同领域采用任何"最佳实践"前

   推荐Agent:
   - 名称:pattern-applicability-analyzer
   - 自动化:模式适用性快速评估
   - 价值:提前避免采用错误模式

Knowledge Quality Checklist

知识质量检查清单

Before finalizing an extraction, verify:
完成提取前,请验证:

For DISCOVERIES.md

针对DISCOVERIES.md

  • Issue is specific, not generic ("Pre-commit hooks failing" not "Tools broken")
  • Root cause is identified (Why, not just what)
  • Solution is working/proven
  • Learning is generalized (applies beyond this specific case)
  • Prevention strategy is actionable
  • No speculation or future-proofing
  • Code examples provided where relevant
  • 问题具体,而非通用(如"Pre-commit钩子失败"而非"工具损坏")
  • 已识别根本原因(找原因,而非现象)
  • 解决方案可行/经验证
  • 经验可推广(适用于该具体案例之外)
  • 预防措施可执行
  • 无推测或过度前瞻内容
  • 相关场景提供代码示例

For PATTERNS.md

针对PATTERNS.md

  • Problem is clear and recognizable
  • Solution has proven track record (used 2+ times successfully)
  • When/when-not-to-use guidance is clear
  • Pattern is general enough for reuse
  • Code examples are working and clear
  • Related patterns are cross-referenced
  • Real impact or usage is documented
  • 问题清晰可识别
  • 解决方案经实际验证(成功使用2次以上)
  • 适用/不适用场景指导明确
  • 模式具备复用性
  • 代码示例可行清晰
  • 相关模式已交叉引用
  • 记录实际效果或使用场景

For New Agent

针对新Agent

  • Workflow has been repeated 2+ times
  • Would save 30+ minutes per execution
  • Problem domain is narrow and well-defined
  • Inputs and outputs are clear
  • Step-by-step process documented
  • High-value worth the automation effort
  • Clear where it fits in workflow
  • 工作流已重复2次以上
  • 每次执行可节省30分钟以上
  • 问题领域狭窄且定义明确
  • 输入和输出清晰
  • 分步流程已记录
  • 自动化具备高价值
  • 明确在工作流中的位置

Integration with System

与系统的集成

Discovery Memory Lifecycle

发现内容内存生命周期

  1. Extraction: Stored in memory via
    store_discovery()
    during session
  2. Visibility: Retrieved by
    get_recent_discoveries()
    at session start
  3. Action: Agents can query memory when solving similar problems
  4. Prevention: Prevents repeating same mistakes across sessions
  5. Evolution: Updated when better solution found
  1. 提取:会话期间通过
    store_discovery()
    存储到内存
  2. 可见性:会话开始时通过
    get_recent_discoveries()
    检索
  3. 应用:Agent解决类似问题时可查询内存
  4. 预防:避免跨会话重复犯错
  5. 演进:找到更好解决方案时更新

PATTERNS.md Lifecycle

PATTERNS.md 生命周期

  1. Extraction: Added to PATTERNS.md when pattern proven
  2. Catalog: Becomes part of available patterns library
  3. Usage: Referenced in relevant agent instructions
  4. Teaching: Used in documentation and onboarding
  5. Refinement: Improved as more usage data collected
  1. 提取:模式经验证后添加到PATTERNS.md
  2. 目录:成为可用模式库的一部分
  3. 使用:在相关Agent指令中引用
  4. 教学:用于文档和入职培训
  5. 优化:根据更多使用数据改进

Agent Creation Lifecycle

Agent创建生命周期

  1. Recommendation: Identified as valuable automation candidate
  2. Proposal: Presented to system with expected value
  3. Creation: New agent created with clear scope/boundaries
  4. Integration: Added to delegation triggers in CLAUDE.md
  5. Usage: Available for orchestration across workflows
  1. 推荐:识别为有价值的自动化候选
  2. 提案:向系统提交包含预期价值的方案
  3. 创建:创建具有明确范围/边界的新Agent
  4. 集成:添加到CLAUDE.md中的委托触发项
  5. 使用:可在工作流中被编排调用

Real-World Impact Examples

实际效果示例

Impact 1: Prevent Wasted Debugging Time

效果1:避免重复调试时间浪费

Without knowledge extraction: Repeat same 45-minute debugging process With extraction: Retrieve from memory, fix in 10 minutes
无知识提取:重复相同的45分钟调试流程 有知识提取:从内存中检索,10分钟修复

Impact 2: Faster Solution Discovery

效果2:加快解决方案发现

Without extraction: Rediscover solutions from scratch With extraction: Reference PATTERNS.md, apply known solution
无知识提取:从零重新发现解决方案 有知识提取:参考PATTERNS.md,应用已知解决方案

Impact 3: Automated Workflows

效果3:工作流自动化

Without extraction: Manual CI debugging every time (30-45 min) With new agent: Automated diagnosis in 5-10 minutes
无知识提取:每次手动调试CI(30-45分钟) 有新Agent:5-10分钟自动诊断

Common Extraction Mistakes to Avoid

需避免的常见提取错误

Mistake 1: Too Generic

错误1:过于通用

BAD: "Learned that good error handling is important"
GOOD: "Discovered cloud sync issues cause silent file I/O failures - need exponential backoff retry"
错误示例:"学到了良好的错误处理很重要"
正确示例:"发现云同步问题会导致静默文件I/O失败 - 需要添加指数退避重试"

Mistake 2: Missing Root Cause

错误2:缺失根本原因

BAD: "CI failed, fixed it"
GOOD: "CI failed because version mismatch (local 3.12 vs CI 3.11) - fixed by updating pyproject.toml version constraint"
错误示例:"CI失败,已修复"
正确示例:"CI因版本不匹配失败(本地3.12 vs CI 3.11) - 通过更新pyproject.toml版本约束修复"

Mistake 3: No Actionable Learning

错误3:无可行经验

BAD: "This was complicated"
GOOD: "Multi-layer sanitization at every data transformation prevents credential leakage"
错误示例:"这很复杂"
正确示例:"在每次数据转换时进行多层清理可防止凭证泄露"

Mistake 4: Over-Generalizing Pattern

错误4:过度推广模式

BAD: "Always use caching everywhere"
GOOD: "Use smart caching with lifecycle management for expensive operations where results may become stale"
错误示例:"任何地方都要使用缓存"
正确示例:"对结果可能过期的昂贵操作,使用带生命周期管理的智能缓存"

Mistake 5: Agent Creation Without ROI

错误5:无投资回报的Agent创建

BAD: "Create agent for task that happens once per quarter"
GOOD: "Create agent for CI debugging workflow that happens 2-3x per week and takes 30-45 minutes"
错误示例:"为每季度执行一次的任务创建Agent"
正确示例:"为每周执行2-3次、耗时30-45分钟的CI调试工作流创建Agent"

Extraction Prompts

提取提示词

Use these prompts to trigger knowledge extraction:
使用以下提示词触发知识提取:

Extract Discoveries

提取发现内容

Extract what we discovered/learned from this session.
Focus on: root causes, unexpected behaviors, solutions that worked.
Update DISCOVERIES.md appropriately.
提取我们从本次会话中发现/学到的内容。
重点关注:根本原因、意外行为、有效的解决方案。
适当更新DISCOVERIES.md。

Extract Patterns

提取模式

What patterns should we capture for future reuse?
These should be proven solutions that apply to multiple situations.
Update PATTERNS.md appropriately.
我们应捕获哪些可未来复用的模式?
这些应为适用于多场景的经验证解决方案。
适当更新PATTERNS.md。

Identify Agent Opportunities

识别Agent创建机会

Should we create a new agent to automate any repeated workflows?
Check if any workflow has been done 2+ times and takes 30+ minutes.
Recommend creation with scope and value calculation.
我们是否应创建新Agent来自动化重复工作流?
检查是否有工作流已执行2次以上且耗时30分钟以上。
推荐创建并说明范围与价值。

Full Extraction

完整提取

Perform complete knowledge extraction on this session.
Extract: discoveries, patterns, and agent creation recommendations.
Verify quality and update all three knowledge bases.
对本次会话执行完整知识提取。
提取:发现内容、模式和Agent创建建议。
验证质量并更新所有三类知识库。

Integration Points

集成点

With Document-Driven Development

与文档驱动开发的集成

  • Use knowledge extraction to update specs and documentation
  • Extract patterns to guide next implementation
  • 使用知识提取更新规格和文档
  • 提取模式以指导后续实施

With Agent Delegation

与Agent委托的集成

  • Extract when delegating reveals new specializations needed
  • Create agents based on repeated delegation patterns
  • 委托时发现新专业需求时进行提取
  • 根据重复委托模式创建Agent

With Pre-Commit Analysis

与Pre-Commit分析的集成

  • Extract discoveries about CI/CD and testing patterns
  • Update PATTERNS.md with new approaches discovered
  • 提取关于CI/CD和测试模式的发现内容
  • 用新发现的方法更新PATTERNS.md

With Session Reflection

与会话反思的集成

  • Automatic knowledge extraction at session end
  • Preserve learnings before context compaction
  • 会话结束时自动执行知识提取
  • 上下文压缩前保留经验

Success Metrics

成功指标

Track effectiveness of knowledge extraction:
  • Discoveries Reused: How often DISCOVERIES.md prevents mistakes (target: 80%+)
  • Patterns Applied: How often PATTERNS.md enables faster solutions (target: 70%+)
  • Agent Usage: How often extracted agents used vs manual approaches (target: 60%+)
  • Time Saved: Cumulative time saved by reusing knowledge (target: hours/week)
  • Repeated Mistakes: Reduction in making same mistake twice (target: 95%+)
跟踪知识提取的有效性:
  • 发现内容复用率:DISCOVERIES.md避免错误的频率(目标:80%+)
  • 模式应用率:PATTERNS.md加快解决方案的频率(目标:70%+)
  • Agent使用率:提取的Agent与手动方式的使用比例(目标:60%+)
  • 节省时间:复用知识累计节省的时间(目标:每周数小时)
  • 重复错误率:重复犯错的减少比例(目标:95%+)

Future Evolution

未来演进

This skill should grow based on:
  • What types of knowledge are most valuable to extract?
  • What prevents good extraction?
  • How can we make extractions more actionable?
  • What knowledge sources are underutilized?
  • How can we better surface relevant knowledge?
Document learnings in
~/.amplihack/.claude/context/DISCOVERIES.md
.
本Skill应基于以下方向发展:
  • 哪种类型的知识最有提取价值?
  • 哪些因素阻碍了高质量提取?
  • 如何让提取内容更具可执行性?
  • 哪些知识来源未被充分利用?
  • 如何更好地展示相关知识?
将经验记录在
~/.amplihack/.claude/context/DISCOVERIES.md
中。