session-intelligence-harvester
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSession Intelligence Harvester
Session Intelligence Harvester
Overview
概述
Transform session learnings into permanent organizational intelligence by implementing updates across RII components. After productive sessions involving corrections, discoveries, or pattern identification, systematically extract what was learned, route it to the correct component, and apply the changes.
Why this matters: One-time fixes that aren't encoded into RII components will recur. The Chapter N skill format drift happened because no check existed to prevent it. After harvesting, that failure mode is encoded in 4 files—future sessions automatically benefit.
通过在RII组件中实施更新,将会话经验转化为永久的组织智能。在涉及修正、发现或模式识别的高效会话结束后,系统地提取所学到的内容,将其导入正确的组件,并应用相应更改。
重要性:未编码到RII组件中的一次性修复问题会再次出现。Chapter N技能的格式偏差问题就是因为缺乏相应的检查机制导致的。在完成经验收获后,该失效模式已被编码到4个文件中——未来的会话将自动从中受益。
When to Use This Skill
何时使用本技能
Automatic Triggers (proactively suggest harvesting):
- Session corrected format drift (wrong file structure, YAML, invocation)
- Session added missing checks to orchestration files
- Session identified failure mode worth preventing
- Session touched 3+ files with similar pattern corrections
- PHR was created documenting significant learning
Manual Triggers (user requests):
- "Harvest learnings from this session"
- "Capture session intelligence"
- "What should we encode from this work?"
- "Update RII with what we learned"
自动触发场景(主动建议进行经验收获):
- 会话中修复了格式偏差(错误的文件结构、YAML配置、调用方式)
- 会话中为编排文件添加了缺失的检查项
- 会话中识别出值得预防的失效模式
- 会话中对3个以上文件进行了类似的模式修正
- 创建了记录重要经验的PHR
手动触发场景(用户主动请求):
- “收获本次会话的经验”
- “捕获会话智能”
- “我们应该将哪些工作内容进行编码?”
- “用本次学到的内容更新RII”
Workflow
工作流程
Default to action: Implement all updates rather than only proposing them. Read target files, make edits, and commit changes. Only propose without implementing if explicitly asked.
默认执行操作:直接实施所有更新,而非仅提出建议。读取目标文件、进行编辑并提交更改。仅在明确要求时,才只提出建议而不执行修改。
Step 1: Session Analysis
步骤1:会话分析
Analyze the session by answering these questions. Write your analysis to track progress:
1. CORRECTIONS MADE
- What errors/drift were corrected?
- What was wrong vs what is now correct?
- Why did the error occur? (missing check, format drift, etc.)
WHY THIS MATTERS: Understanding root cause determines which RII
component prevents recurrence. Format drift → agent convergence
pattern. Missing context → CLAUDE.md protocol step.
2. PATTERNS IDENTIFIED
- What recurring patterns emerged?
- What canonical sources were referenced?
- What validation would have caught this earlier?
WHY THIS MATTERS: Patterns that recur across sessions deserve
encoding. If you referenced a canonical source, other sessions
will need that same reference.
3. LEARNING CLASSIFICATION
- Context-gathering gap? (CLAUDE.md)
- Pedagogical/teaching issue? (Constitution)
- Agent convergence pattern? (Agents)
- Reusable workflow? (Skills)
- Missing orchestration check? (Commands)
WHY THIS MATTERS: Wrong routing means learnings don't trigger at
the right time. A convergence pattern in CLAUDE.md won't help
chapter-planner catch it during planning.通过回答以下问题分析会话内容。撰写分析报告以跟踪进度:
1. 已完成的修正
- 修正了哪些错误/偏差?
- 错误内容与修正后的正确内容分别是什么?
- 错误发生的原因是什么?(缺失检查项、格式偏差等)
重要性:了解根本原因才能确定使用哪个RII组件来防止问题复发。格式偏差→Agent收敛模式;缺失上下文→CLAUDE.md协议步骤。
2. 识别出的模式
- 出现了哪些重复模式?
- 参考了哪些权威来源?
- 哪些验证措施可以更早发现问题?
重要性:在会话中重复出现的模式值得进行编码。如果参考了权威来源,其他会话也会需要同样的参考内容。
3. 经验分类
- 上下文收集缺口?(CLAUDE.md)
- 教学法/教学问题?(Constitution)
- Agent收敛模式?(Agent文件)
- 可复用工作流?(Skills)
- 缺失的编排检查项?(Commands)
重要性:错误的导入路径会导致经验无法在正确的时机触发。在CLAUDE.md中设置的收敛模式无法帮助chapter-planner在规划阶段发现问题。Step 2: Route to RII Components
步骤2:导入至RII组件
Use this routing table. Route learnings to the component where they will be discovered at the right time:
| Learning Type | Target Component | Location | What to Add | When It Triggers |
|---|---|---|---|---|
| Context-gathering gaps | CLAUDE.md | Section I | New step in context protocol | Before ANY platform work |
| Failure mode example | CLAUDE.md | Failure modes | Named example with correction | When similar situation detected |
| Pedagogical framework | Constitution | Section IIa | Teaching method update | During lesson design |
| Agent convergence pattern | Agent file | Convergence Patterns | Pattern + why + correction | During agent execution |
| Agent self-monitoring | Agent file | Self-Monitoring Checklist | New checklist item | Before agent finalizes output |
| Canonical source lookup | Multiple agents | Analysis Questions | Cross-reference check | During planning phase |
| Reusable workflow | New skill | .claude/skills/ | New SKILL.md | When user invokes skill |
| Orchestration check | Command file | Phase 0 or relevant phase | New validation step | During workflow execution |
| Format specification | Canonical source chapter | Lesson content | Authoritative format | When teaching that pattern |
WHY ROUTING MATTERS: Learnings placed in the wrong component don't prevent recurrence. A check in won't help if the error happens during execution.
content-implementer.mdchapter-planner使用以下路由表,将经验导入到能在正确时机被调用的组件中:
| 经验类型 | 目标组件 | 位置 | 需添加内容 | 触发时机 |
|---|---|---|---|---|
| 上下文收集缺口 | CLAUDE.md | 第一部分 | 上下文协议中的新步骤 | 任何平台工作开始前 |
| 失效模式示例 | CLAUDE.md | 失效模式部分 | 带修正方案的命名示例 | 检测到类似场景时 |
| 教学框架 | Constitution | 第二部分a | 教学方法更新 | 课程设计阶段 |
| Agent收敛模式 | Agent文件 | 收敛模式部分 | 模式+原因+修正方案 | Agent执行阶段 |
| Agent自我监控 | Agent文件 | 自我监控清单 | 新的清单项 | Agent完成输出前 |
| 权威来源查询 | 多个Agent | 分析问题 | 交叉引用检查 | 规划阶段 |
| 可复用工作流 | 新技能 | .claude/skills/ | 新的SKILL.md | 用户调用技能时 |
| 编排检查项 | Command文件 | 第0阶段或相关阶段 | 新的验证步骤 | 工作流执行阶段 |
| 格式规范 | 权威来源章节 | 课程内容 | 权威格式定义 | 教授该模式时 |
路由的重要性:导入到错误组件的经验无法防止问题复发。如果错误发生在执行阶段,中的检查项无法发挥作用。
chapter-plannercontent-implementer.mdStep 3: Read Target Files and Generate Updates
步骤3:读取目标文件并生成更新内容
For each identified learning:
- Read the target file to understand current structure and find exact placement
- Generate the update with surrounding context for precise placement
- Track progress as you work through multiple files
markdown
undefined针对每个识别出的经验:
- 读取目标文件,了解当前结构并确定精确的插入位置
- 生成更新内容,包含周围上下文以确保精准插入
- 跟踪进度,完成多个文件的更新工作
markdown
undefinedLearning: [Brief Title]
经验:[简短标题]
Type: [Context gap | Failure mode | Convergence pattern | etc.]
Target: [File path]
Current State (after reading file):
[What's missing or incorrect - quote existing content if helpful]
Exact Placement:
[Which section, after which content - be specific enough to Edit]
Content to Add:
[Exact content, matching the file's style and format]
Rationale:
[Why this prevents recurrence - what will trigger this check]
Canonical Source (if applicable):
[Which chapter/lesson defines the authoritative format]
undefined类型:[上下文缺口 | 失效模式 | 收敛模式 | 等]
目标:[文件路径]
当前状态(读取文件后):
[缺失或错误的内容 - 如有需要可引用现有内容]
精确插入位置:
[具体章节、插入到哪部分内容之后 - 需具体到可直接编辑]
需添加的内容:
[与文件风格和格式匹配的精确内容]
理由:
[该内容如何防止问题复发 - 什么场景会触发此检查]
权威来源(如适用):
[定义权威格式的章节/课程]
undefinedStep 4: Implement Updates
步骤4:实施更新
Take action: Edit each target file. Use the Edit tool to make changes.
For each update:
- Read the target file (if not already read)
- Locate the exact insertion point
- Apply the edit using Edit tool
- Verify the edit was applied correctly
Track completion:
Updates Progress:
- [x] CLAUDE.md - Added failure mode section
- [x] chapter-planner.md - Added convergence pattern 6
- [ ] sp.loopflow.v2.md - Adding Phase 0 check (in progress)
- [ ] content-implementer.md - Pending执行操作:编辑每个目标文件。使用编辑工具进行更改。
针对每个更新:
- 读取目标文件(如尚未读取)
- 定位精确的插入点
- 使用编辑工具应用更改
- 验证更改已正确应用
跟踪完成情况:
更新进度:
- [x] CLAUDE.md - 添加了失效模式章节
- [x] chapter-planner.md - 添加了收敛模式6
- [ ] sp.loopflow.v2.md - 正在添加第0阶段检查项
- [ ] content-implementer.md - 待处理Step 5: Validation
步骤5:验证
Before finalizing, verify each of these (check the box as you confirm):
- [ ] Read each target file before editing (no speculation about structure)
- [ ] Verified each learning routes to the component where it triggers at the right time
- [ ] Confirmed updates include exact placement context (not vague locations)
- [ ] Checked canonical sources exist for format-related learnings
- [ ] Searched target files to confirm no duplicate information exists
- [ ] Used imperative form for agent files, appropriate style for others
- [ ] Added cross-references where pattern appears in multiple files
- [ ] All edits applied successfully (no pending changes)完成前,验证以下各项(确认后勾选):
- [ ] 编辑前已读取每个目标文件(不猜测文件结构)
- [ ] 验证每个经验都被导入到能在正确时机触发的组件中
- [ ] 确认更新内容包含精确的插入位置上下文(非模糊位置)
- [ ] 检查格式相关经验的权威来源是否存在
- [ ] 搜索目标文件以确认无重复信息
- [ ] Agent文件使用命令式语气,其他文件使用合适风格
- [ ] 在模式出现的多个文件中添加了交叉引用
- [ ] 所有编辑已成功应用(无待处理更改)Step 6: Create PHR and Commit
步骤6:创建PHR并提交
-
Create PHR documenting:
- What was learned
- Where it was encoded (list all files)
- Why this improves future work
-
Commit changes with descriptive message:
feat(intelligence): Harvest session learnings into RII Updates: - [File 1]: [What was added] - [File 2]: [What was added] Prevents: [What failure mode this prevents]
-
创建PHR,记录:
- 学到的内容
- 编码位置(列出所有文件)
- 该内容如何改进未来工作
-
提交更改,并添加描述性消息:
feat(intelligence): Harvest session learnings into RII Updates: - [文件1]: [添加的内容] - [文件2]: [添加的内容] Prevents: [该内容防止的失效模式]
RII Component Reference
RII组件参考
CLAUDE.md Structure
CLAUDE.md结构
Section I: Context Gathering Protocol
- Step 1-N: Sequential context steps
- Each step has WHAT to do and WHY it matters
- "Find canonical source" step for pattern teaching
Failure Modes (between Section I and II):
- Named failure examples: "FAILURE MODE: [Name] Example"
- "What I did wrong" list
- "What I should have done" numbered steps
- "Result" showing what was prevented第一部分:上下文收集协议
- 步骤1-N:按顺序排列的上下文步骤
- 每个步骤包含操作内容和重要性说明
- 模式教学的“查找权威来源”步骤
失效模式(第一部分与第二部分之间):
- 命名的失效示例:“失效模式:[名称]示例”
- “我之前的错误操作”列表
- “正确操作步骤”编号列表
- “结果”说明防止了什么问题Agent File Structure
Agent文件结构
Analysis Questions (Section III):
- Numbered questions with "Why this matters" explanation
- Self-check prompt at end
Principles (Section IV):
- Named principles with Framework + What this means + Application guidance
- Self-check prompt
Convergence Patterns (Section VI):
- "Generic pattern" description
- "Why this is convergence" explanation
- "Correction" with specific steps
Self-Monitoring Checklist (Section VIII):
- Numbered checklist with checkmark emoji prefix
- Each item is a verification question分析问题(第三部分):
- 带“重要性”说明的编号问题
- 末尾的自我检查提示
原则(第四部分):
- 带框架、含义说明和应用指导的命名原则
- 自我检查提示
收敛模式(第六部分):
- “通用模式”描述
- “为何属于收敛模式”说明
- 带具体步骤的“修正方案”
自我监控清单(第八部分):
- 带勾选表情前缀的编号清单
- 每个项都是一个验证问题Command File Structure
Command文件结构
Phase 0: Foundation checks
- Constitutional reading
- Canonical source checks (for educational content)
- Each step explains WHY
Convergence Patterns:
- Symptom description
- Detection method
- Correction steps第0阶段:基础检查
- 宪法内容读取
- 权威来源检查(针对教育内容)
- 每个步骤说明重要性
收敛模式:
- 症状描述
- 检测方法
- 修正步骤Output Format
输出格式
After completing harvest, provide summary:
markdown
undefined完成经验收获后,提供以下总结:
markdown
undefinedSession Intelligence Harvest Summary
会话智能收获总结
Session: [Brief description]
Date: [ISO date]
Status: COMPLETE
会话:[简短描述]
日期:[ISO格式日期]
状态:已完成
Learnings Extracted: [N]
提取的经验数量:[N]
| # | Learning | Type | Target | Status |
|---|---|---|---|---|
| 1 | [Title] | [Type] | [File] | Applied |
| 2 | [Title] | [Type] | [File] | Applied |
| 序号 | 经验内容 | 类型 | 目标文件 | 状态 |
|---|---|---|---|---|
| 1 | [标题] | [类型] | [文件] | 已应用 |
| 2 | [标题] | [类型] | [文件] | 已应用 |
Updates Applied
已应用的更新
- [File]: [What was added] (lines X-Y)
- [File]: [What was added] (lines X-Y)
- [文件]:[添加的内容](第X-Y行)
- [文件]:[添加的内容](第X-Y行)
PHR Created
创建的PHR
- Path: [PHR path]
- Stage: [Stage]
- 路径:[PHR路径]
- 阶段:[阶段]
Canonical Sources Referenced
参考的权威来源
- [Pattern]: [Chapter X Lesson Y]
- [模式]:[第X章第Y课]
Commit
提交记录
- Hash: [commit hash]
- Message: [commit message summary]
undefined- 哈希值:[提交哈希]
- 消息:[提交消息摘要]
undefinedExamples
示例
Example 1: Format Drift Correction (Multi-File)
示例1:格式偏差修正(多文件)
Session: Fixed skill format to use domain-based structure
Analysis:
CORRECTIONS MADE:
- Wrong: .claude/skills/section-writer.md (flat file, no domain)
- Correct: .claude/skills/authoring/section-writer/SKILL.md (domain + directory structure)
- Root cause: No domain organization for skills/agents
PATTERNS IDENTIFIED:
- Skills must be in authoring/ or engineering/ domain folders
- Agents must be in authoring/ or engineering/ domain folders
- Multiple files referenced old flat structure
CLASSIFICATION:
- Failure mode → CLAUDE.md
- Convergence pattern → chapter-planner.md, content-implementer.md
- Skill structure → skill-creator, session-intelligence-harvesterUpdates Applied:
- CLAUDE.md: Updated agent architecture section
- skill-creator: Added domain organization requirement
- session-intelligence-harvester: Updated routing table with domain paths
- Moved all skills to authoring/ or engineering/
- Moved all agents to authoring/ or engineering/
- Generals Skills are at .claude/skills/
会话:修复技能格式以使用基于领域的结构
分析:
已完成的修正:
- 错误:.claude/skills/section-writer.md(扁平文件,无领域划分)
- 正确:.claude/skills/authoring/section-writer/SKILL.md(领域+目录结构)
- 根本原因:技能/Agent缺乏领域组织机制
识别出的模式:
- 技能必须放在authoring/或engineering/领域文件夹中
- Agent必须放在authoring/或engineering/领域文件夹中
- 多个文件引用了旧的扁平结构
经验分类:
- 失效模式→CLAUDE.md
- 收敛模式→chapter-planner.md, content-implementer.md
- 技能结构→skill-creator, session-intelligence-harvester已应用的更新:
- CLAUDE.md:更新了Agent架构章节
- skill-creator:添加了领域组织要求
- session-intelligence-harvester:更新了路由表中的领域路径
- 将所有技能移动到authoring/或engineering/文件夹
- 将所有Agent移动到authoring/或engineering/文件夹
- 通用技能位于.claude/skills/
Example 2: Missing Validation (Single File)
示例2:缺失验证项(单文件)
Session: Discovered lessons weren't checking chapter-index.md for prerequisites
Analysis:
CORRECTIONS MADE:
- Wrong: Started chapter work without reading chapter-index.md
- Correct: MUST read chapter-index.md first to get Part, proficiency, prerequisites
- Root cause: No mandatory step in context protocol
CLASSIFICATION:
- Context-gathering gap → CLAUDE.md Section IUpdates Applied:
- CLAUDE.md: Added Step 1 to read chapter-index.md with specific extraction requirements
会话:发现课程未检查chapter-index.md中的前置条件
分析:
已完成的修正:
- 错误:未读取chapter-index.md就开始章节工作
- 正确:必须先读取chapter-index.md以获取Part、熟练度要求和前置条件
- 根本原因:上下文协议中缺失强制步骤
经验分类:
- 上下文收集缺口→CLAUDE.md第一部分已应用的更新:
- CLAUDE.md:添加了读取chapter-index.md的步骤1,并明确提取要求
Example 3: Hallucinated Facts (Chapter 2 Incident)
示例3:幻觉事实(第2章事件)
Session: Wrote 6 lessons with unverified statistics, dates, and adoption numbers
Analysis:
CORRECTIONS MADE:
- Wrong: "50-75% time savings" for goose
- Correct: "75% of engineers save 8-10+ hours/week" (verified via Block announcement)
- Wrong: Conflated Agent Skills timeline (said single date)
- Correct: Oct 16, 2025 = Claude Code launch; Dec 18, 2025 = open standard release
- Wrong: Generic agent support lists
- Correct: Verified lists from official AAIF announcement
- Root cause: Trusted plausible-sounding data from memory instead of web verification
PATTERNS IDENTIFIED:
- Statistics, dates, and quotes MUST be web-verified before publication
- Existing factual-verifier agent was available but not used
- 50% of session time was spent fixing hallucinated facts
CLASSIFICATION:
- Critical failure mode → CLAUDE.md Failure Prevention + new section
- Process gap → Missing mandatory fact-check stepUpdates Applied:
- CLAUDE.md: Added "Content Fact-Checking (MANDATORY)" section
- CLAUDE.md: Added failure mode example to Failure Prevention list
- Documented factual-verifier agent invocation pattern
会话:撰写6课时内容时使用了未验证的统计数据、日期和采用率数字
分析:
已完成的修正:
- 错误:“goose可节省50-75%时间”
- 正确:“75%的工程师每周可节省8-10+小时”(经Block公告验证)
- 错误:混淆了Agent Skills的时间线(仅提及单个日期)
- 正确:2025年10月16日=Claude Code发布;2025年12月18日=开放标准发布
- 错误:通用Agent支持列表
- 正确:经官方AAIF公告验证的列表
- 根本原因:依赖记忆中看似合理的数据,而非通过网络验证
识别出的模式:
- 统计数据、日期和引用内容在发布前必须通过网络验证
- 已有factual-verifier Agent但未被使用
- 50%的会话时间用于修复幻觉事实
经验分类:
- 严重失效模式→CLAUDE.md失效预防+新章节
- 流程缺口→缺失强制事实检查步骤已应用的更新:
- CLAUDE.md:添加“内容事实检查(强制)”章节
- CLAUDE.md:在失效预防列表中添加失效模式示例
- 记录factual-verifier Agent的调用模式
Self-Monitoring
自我监控
Before marking harvest complete, verify you have:
- Analyzed session to identify all corrections and patterns
- Classified each learning to determine correct routing
- Read each target file before editing (no speculation)
- Applied all edits using Edit tool (not just proposed)
- Verified edits match target file's style and structure
- Added cross-references where patterns appear in multiple files
- Created PHR documenting the harvest
- Committed changes with descriptive message
- Generated summary showing all updates applied
在标记经验收获完成前,验证以下内容:
- 分析会话以识别所有修正和模式
- 对每个经验进行分类以确定正确的导入路径
- 编辑前已读取每个目标文件(不猜测结构)
- 使用编辑工具应用所有更改(而非仅提出建议)
- 验证编辑内容与目标文件的风格和结构匹配
- 在模式出现的多个文件中添加了交叉引用
- 创建了记录经验收获的PHR
- 提交更改并添加了描述性消息
- 生成了显示所有已应用更新的总结
undefined