mcpField
S
session-intelligence-harvester

session-intelligence-harvester

github.com/panaversityエージェントワークフロー48 回インストール
リポジトリ

session-intelligence-harvester について

作業セッションでの修正、発見、パターンを組織知に変えるスキルです。学びを適切なRIIファイルに振り分けて更新・検証し、同じ問題の再発を防ぎます。

主な機能

  1. 01セッションの修正点や学びの特定
  2. 02学びを適切なRIIコンポーネントへ振り分け
  3. 03対象ファイルを読んで更新を実施
  4. 04配置と重複内容の確認
  5. 05PHRの作成と変更のコミット

活用シーン

  1. 01フォーマットのずれを記録して修正
  2. 02新たな失敗パターンをチェック項目に変換
  3. 03複数ファイルに関わるパターンを関連Agentやコマンドに記録
  4. 04重要なセッションの学びをRIIに反映

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/panaversity/agentfactory --skill session-intelligence-harvester

インストール後、Claude Code で/session-intelligence-harvesterを入力して読み込まれたか確認します。

詳細

セッションインテリジェンスの収集

概要

RII の各コンポーネントに更新を実装し、セッションで得た学びを組織の恒久的な知見に変えます。修正、発見、パターンの特定などを伴う有意義なセッションの後は、学びを体系的に抽出し、適切なコンポーネントに振り分けて変更を適用します。

これが重要な理由:RII のコンポーネントに反映されていない一度限りの修正は、繰り返し発生します。第 N 章のスキル形式のずれは、それを防ぐチェックがなかったために起きました。収集後は、その失敗パターンが 4 つのファイルに記録され、以後のセッションで自動的に活用されます。

このスキルを使うタイミング

自動トリガー(積極的に収集を提案します):

  • セッションで形式のずれ(誤ったファイル構造、YAML、呼び出し方法)が修正された
  • セッションでオーケストレーションファイルに不足していたチェックが追加された
  • セッションで再発防止に値する失敗パターンが特定された
  • セッションで類似したパターン修正を伴う 3 つ以上のファイルが変更された
  • 重要な学びを記録した PHR が作成された

手動トリガー(ユーザーからのリクエスト):

  • 「このセッションの学びを収集して」
  • 「セッションの知見を記録して」
  • 「この作業から何を反映すべきですか?」
  • 「学んだことを RII に反映して」

ワークフロー

実行を基本とします:提案だけでなく、すべての更新を実装します。対象ファイルを読み、編集し、変更をコミットします。明示的に依頼された場合に限り、実装せずに提案だけを行います。

ステップ 1:セッションの分析

以下の質問に答えてセッションを分析します。進捗を追跡できるよう、分析内容を記録します。

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.
ステップ 2:RII コンポーネントへの振り分け

以下の振り分け表を使います。適切なタイミングで学びが見つかるコンポーネントに振り分けます。

学びの種類対象コンポーネント場所追加する内容トリガーされるタイミング
コンテキスト収集の不足CLAUDE.mdセクション Iコンテキストプロトコルに新しいステッププラットフォーム作業の前
失敗パターンの例CLAUDE.md失敗パターン修正方法を含む名前付きの例類似の状況が検出されたとき
教育フレームワークConstitutionセクション IIa教授法の更新レッスンの設計中
エージェントの収束パターンエージェントファイル収束パターンパターン、理由、修正方法エージェントの実行中
エージェントの自己監視エージェントファイル自己監視チェックリスト新しいチェック項目エージェントが出力を確定する前
正規ソースの参照複数のエージェント分析の質問相互参照チェック計画フェーズ中
再利用可能なワークフロー新しいスキル.claude/skills/新しい SKILL.mdユーザーがスキルを呼び出したとき
オーケストレーションのチェックコマンドファイルフェーズ 0 または該当フェーズ新しい検証ステップワークフローの実行中
形式の仕様正規ソースの章レッスンの内容権威ある形式そのパターンを教えるとき

振り分けが重要な理由:学びを誤ったコンポーネントに配置しても、再発は防げません。content-implementer.md にチェックを追加しても、chapter-planner の実行中にエラーが起きるのであれば役に立ちません。

ステップ 3:対象ファイルの読み込みと更新の生成

特定した学びごとに、以下を行います。

  1. 対象ファイルを読む:現在の構造を把握し、正確な配置場所を見つけます
  2. 更新を生成する:正確に配置できるよう、周囲のコンテキストも含めます
  3. 進捗を追跡する:複数のファイルを順に処理しながら進捗を記録します
## Learning: [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]
Step 4: 更新を実装する

実行:対象ファイルをそれぞれ編集します。Edit ツールを使って変更を加えます。

各更新について:

  1. 対象ファイルを読み込みます(まだ読み込んでいない場合)
  2. 正確な挿入位置を特定します
  3. Edit ツールを使って編集を適用します
  4. 編集が正しく適用されたことを確認します

完了状況を記録します:

Updates Progress:
- [x] CLAUDE.md - Added failure mode section
- [x] chapter-planner.md - Added convergence pattern 6
- [x] sp.loopflow.v2.md - Removed (deprecated, replaced by native Plan Mode)
- [ ] content-implementer.md - Pending
Step 5: 検証

完了前に、以下の項目をそれぞれ確認し、確認したらチェックを付けます:

- [ ] 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)
Step 6: PHR を作成してコミットする
  1. 以下を記録した PHR を作成します:

    • 学んだこと
    • それを反映した場所(すべてのファイルを列挙)
    • 今後の作業がどのように改善されるか
  2. 説明的なメッセージを付けて変更をコミットします:

    feat(intelligence): Harvest session learnings into RII
    
    Updates:
    - [File 1]: [What was added]
    - [File 2]: [What was added]
    
    Prevents: [What failure mode this prevents]
    

RII コンポーネントリファレンス

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
エージェントファイルの構成
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
コマンドファイルの構成
Phase 0: Foundation checks
  - Constitutional reading
  - Canonical source checks (for educational content)
  - Each step explains WHY

Convergence Patterns:
  - Symptom description
  - Detection method
  - Correction steps

出力形式

収集を完了したら、概要を提示します:

## Session Intelligence Harvest Summary

**Session**: [Brief description]
**Date**: [ISO date]
**Status**: COMPLETE

### Learnings Extracted: [N]

| #   | Learning | Type   | Target | Status  |
| --- | -------- | ------ | ------ | ------- |
| 1   | [Title]  | [Type] | [File] | Applied |
| 2   | [Title]  | [Type] | [File] | Applied |

### Updates Applied

1. **[File]**: [What was added] (lines X-Y)
2. **[File]**: [What was added] (lines X-Y)

### PHR Created

- Path: [PHR path]
- Stage: [Stage]

### Canonical Sources Referenced

- [Pattern]: [Chapter X Lesson Y]

### Commit

- Hash: [commit hash]
- Message: [commit message summary]

例

例 1: フォーマットのずれを修正(複数ファイル)

セッション:スキルの形式をドメインベースの構成に修正

分析:

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-harvester

適用した更新:

  1. CLAUDE.md:エージェントアーキテクチャのセクションを更新
  2. skill-creator:ドメインごとに整理する要件を追加
  3. session-intelligence-harvester:ドメインパスを使うようルーティングテーブルを更新
  4. すべてのスキルを authoring/ または engineering/ に移動
  5. すべてのエージェントを authoring/ または engineering/ に移動
  6. Generals Skills は .claude/skills/ にあります
例 2: 検証の不足(単一ファイル)

セッション:レッスンで前提条件を確認するために chapter-index.md を参照していないことを発見

分析:

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 I

適用した更新:

  1. CLAUDE.md:chapter-index.md を読み込み、必要な情報を具体的に抽出する Step 1 を追加
例 3: 事実の幻覚(Chapter 2 のインシデント)

セッション:検証されていない統計、日付、採用数を含むレッスンを 6 件執筆

分析:

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 step

適用した更新:

  1. CLAUDE.md:「コンテンツのファクトチェック(必須)」セクションを追加
  2. CLAUDE.md:失敗防止リストに失敗例を追加
  3. factual-verifier エージェントの呼び出しパターンを文書化

セルフモニタリング

収集の完了とする前に、以下を確認してください:

  • セッションを分析し、すべての修正点とパターンを特定した
  • 各学びを分類し、適切な反映先を決定した
  • 編集前に各対象ファイルを読み込んだ(推測していない)
  • Edit ツールを使ってすべての編集を適用した(提案だけで終わっていない)
  • 編集内容が対象ファイルのスタイルと構成に合っていることを確認した
  • 複数のファイルにパターンがある場合、相互参照を追加した
  • 収集内容を記録した PHR を作成した
  • 説明的なメッセージを付けて変更をコミットした
  • 適用したすべての更新を示す概要を生成した

コメント