Jamie-BitFlight/transcript-analysis

Claude Codeセッションのトランスクリプト分析、エージェントパフォーマンスのレビュー、アンチパターンやツールの誤用の発見、ワークフローパターンのマイニング、カイゼン分析、エージェント動作のデバッグ、セッションフォレンジックを行うためのスキルです。

transcript-analysis とは?

このスキルは、Claude CodeのJSONL形式のセッショントランスクリプトを分析し、アンチパターン、非効率、ワークフロー改善の機会を検出するためのものです。分析対象のトランスクリプトは`~/.claude/projects/`以下にあり、DuckDB MCP(`kaizen-duckdb`)を使用して任意のSQLクエリを実行することで、ツールの誤用、繰り返し発生するエラー、欠落しているツール活用機会、サブエージェントの委譲パターンなどを体系的に抽出できます。また、`kaizen-analysis` MCPサーバーが提供するプロセスマイニングツール(`extract_tool_sequences`、`discover_process_model`、`check_conformance`など)を使用して、SQLでは表現できない高度なシーケンス分析やプロセスモデリングも可能です。分析結果は`.planning/kaizen/`以下に構造化されたMarkdownファイルとして出力され、セッションID、重大度、エビデンス、推奨される対策(フック追加、スキル修正、エージェントプロンプト修正、CLAUDE.md更新)が含まれます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/agentskill-kaizen/skills/transcript-analysis

Installed? Explore more 生産性&コラボレーション skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

トランスクリプト分析

Claude CodeのJSONLセッショントランスクリプトを分析し、アンチパターン、非効率、ワークフロー改善の機会を検出します。

データの場所

トランスクリプトは、プロジェクトパス名に基づくディレクトリ(スラッシュはハイフンに置換)内の ~/.claude/projects/ 以下にあります。

DuckDBの役割: kaizen-analysis の get_transcript_jsonl_schema または MCP resources/read kaizen://session-log/schema からフィールド/パスの完全な参照を読み込み、その後 kaizen-duckdb の execute_query を使用して、それらのファイルに対して 任意の DuckDB SQL を実行します(例や任意クエリワークフローについては DuckDB クエリパターン を参照)。セッション履歴はJSONL形式でディスク上に保持されます。DuckDB MCPのパスルール(絶対パスを使用し、SQL内では~を使用しないこと)。

~/.claude/projects/{project-key}/
├── {uuid}.jsonl              # メインのセッショントランスクリプト
├── agent-{id}.jsonl          # 孤立したエージェントトランスクリプト
└── {uuid}/
    ├── subagents/
    │   └── agent-{id}.jsonl  # サブエージェントトランスクリプト
    └── tool-results/
        └── {tool-use-id}.txt # 非同期タスク出力

JSONLレコードタイプ

各JSONL行は type フィールドで識別されるJSONオブジェクトです。

分析における主要なレコードタイプ:

  • assistant — ツール呼び出しとテキストを含むLLM応答ターン
  • user — ユーザー入力とツール結果
  • system — メタデータイベント(stop_hook_summary, turn_duration, compact_boundary, api_error, local_command)
  • progress — フック実行とサブエージェントストリーミング
  • file-history-snapshot — ファイル編集追跡
  • summary — セッションのタイトル/概要

各レコードタイプのJSON構造を含む完全なスキーマの詳細については、JSONL スキーマリファレンスを参照してください。

シグナルカタログ

以下の各分析ディメンションには、独自の抽出方法があります。

1. ツール誤用の検出

assistant.message.content[] から name == "Bash" のものを抽出します。input.command を解析し、ファイル操作パターンで組み込みツールを使用すべきものを特定します。SQL抽出クエリについては DuckDB クエリパターン を参照してください。

以下のBashコマンドに一致するtool_useブロックを解析します:

  • grep → Grepツールを使用すべき
  • find -name → Globツールを使用すべき
  • cat, head, tail → Readツールを使用すべき
  • ls → Glob または説明付きの Bash(ls) を使用すべき
  • sed, awk → Editツールを使用すべき

パイプライン内での正当な使用(git ... | grep, uv run ... | head)は除外します。

2. 繰り返し発生するエラー

is_error: true のツール結果から抽出します。エラータイプを分類します:

  • 「ファイルがまだ読み取られていません」 — 読み取り前編集のアンチパターン
  • 「置換する文字列が見つかりません」 — 古くなった編集ターゲット
  • 「ユーザーがツール使用を拒否しました」 — 権限/信頼の問題
  • プリコミットフックの失敗(終了コード1)
  • バイナリが見つからない / コマンドが見つからない

3. 欠落しているツール活用機会

セッション全体で繰り返される複数ステップの手動ワークフローを、ツールシーケンスのトライグラム分析により特定します。Bash → Bash → Bash や Read → Read → Read のような高頻度トライグラムは、スクリプトやスキルの欠落を示唆します。

4. サブエージェント委譲パターン

Task tool_useブロックから抽出します。subagent_type、description、model を追跡します。特殊エージェントが存在する場面で general-purpose が使用されている場合にフラグを立てます。

5. 最短経路分析

同じ目標に対する成功試行と失敗試行を比較します。目標ステートメント(ユーザーターン)から成功結果(最終アシスタントターン)までのツール呼び出し数を測定します。類似した目標に対するセッション間のばらつきが大きい場合、無駄なステップが存在することを示します。

6. 誤った手がかりの検出

放棄された調査ブランチを追跡します。シグナル: あるトピックに対する Read/Grep/Bash 呼び出しのシーケンスの後に、解決策なしで compact_boundary または方向転換が発生する。同じ放棄されたパスのセッション間の頻度は、体系的な誤った手がかりを明らかにします。

7. システムプロセスによる中断

system.compact_boundary、system.api_error、およびフック関連の progress イベントを抽出します。アクティブな作業に対するこれらの相対的な位置をマッピングし、システムプロセスがいつ正しい実行パスを妨害したかを特定します。

8. 欠落しているフック

セッション間で繰り返される手動修正を特定します。同じ修正が3回以上出現する場合、PreToolUseフック(拒否+リダイレクト)またはSubagentStartフック(コンテキスト注入)による自動防止の候補となります。

9. DuckDB SQLクエリ

kaizen-analysis の get_transcript_jsonl_schema またはリソース kaizen://session-log/schema を使用して完全なパス参照を取得し、その後 kaizen-duckdb の execute_query を使用してJSONLに対して 任意の SQL(read_ndjson_auto と 絶対パスを使用)を実行します。クックブックのクエリに限定されるわけではありません。

任意クエリワークフローと例については、DuckDB クエリパターンを参照してください。

プロセスマイニング手法

SQLでは表現できない分析には、kaizen-analysis MCPサーバーツールを使用します:

  • extract_tool_sequences — JSONL → セッションごとの順序付けられたツール呼び出し配列に変換
  • discover_process_model — ツール呼び出しシーケンスに対する軽量な遷移モデル
  • check_conformance — セッションを参照プロセスモデルと比較
  • find_frequent_patterns — PrefixSpanシーケンシャルパターンマイニング
  • cluster_sessions — 行動類似性によるトレースクラスタリング

分析ワークフロー

flowchart TD
    Start([分析タスクを受け取る]) --> Scope{スコープは定義されたか?}
    Scope -->|--project フラグ| Project[プロジェクトのトランスクリプトにフィルタ]
    Scope -->|フラグなし| Default[現在のプロジェクトを使用]
    Project --> Discover[SQL — セッション数、日付範囲、レコードタイプをカウント]
    Default --> Discover
    Discover --> Dimensions{どのディメンション?}
    Dimensions -->|すべて| RunAll[すべてのディメンションを実行]
    Dimensions -->|指定あり| RunSelected[選択されたディメンションを実行]
    RunAll --> Aggregate[結果を集約]
    RunSelected --> Aggregate
    Aggregate --> Write[.planning/kaizen/analysis-DATE.md に書き込み]

出力形式

分析結果は .planning/kaizen/ に構造化されたMarkdownとして書き出され、以下を含みます:

  • 各発見事項のセッションIDと日付
  • 重大度 (critical / warning / info)
  • エビデンス — 正確なJSONフィールドパスと値
  • 頻度 — パターンが現れるセッション数
  • 推奨タイプ — フック、スキルパッチ、エージェントプロンプト修正、CLAUDE.md更新

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Jamie-BitFlight/agentskill-kaizen-meta-docs

Agentskill kaizen plugin documentation index. Load when needing to read about cross-platform notes, improvement plans, or DuckDB integration.

Jamie-BitFlight/bash-51-features

Bash 5.1 release features and improvements with practical examples. Use when working with Bash 5.1 features, epoch time variables, redirection enhancements, or when user asks about Bash 5.1 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-52-features

Bash 5.2 release features and improvements with practical examples. Use when working with Bash 5.2 features, variable handling enhancements, readline improvements, or when user asks about Bash 5.2 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-53-features

Bash 5.3 release features and improvements with practical examples. Use when working with Bash 5.3 features, new command substitution, GLOBSORT, loadable builtins, or when user asks about Bash 5.3 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-development

This skill should be used when the user asks to "write a bash script", "create a shell script", "implement bash function", "parse arguments in bash", "handle errors in bash", or mentions bash development, shell scripting, script templates, or modern bash patterns.

Jamie-BitFlight/bash-lint

This skill should be used when the user asks to "lint bash script", "run shellcheck", "format shell script", "use shfmt", "fix shellcheck errors", or mentions shell script linting, formatting, code quality, or pre-commit hooks for bash.

Jamie-BitFlight/bash-logging

This skill should be used when the user asks to "add logging to bash script", "colorize output", "implement log levels", "CI/CD sections", "terminal colors in bash", or mentions logging functions, emoji output, collapsible CI sections, or shlocksmith.

Jamie-BitFlight/bash-portability

This skill should be used when the user asks about "POSIX compatibility", "portable shell scripts", "cross-shell compatibility", "bashisms", "shebang selection", or mentions writing scripts that work on different shells (bash, sh, dash, zsh) or different systems.

Jamie-BitFlight/bash-testing

This skill should be used when the user asks to "test bash script", "write shell tests", "use shunit2", "use shellspec", "create test suite for bash", or mentions unit testing, test frameworks, mocking, or test-driven development for shell scripts.

Jamie-BitFlight/brainstorming-skill

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or when users request help with ideation, marketing, and strategic planning. Explores user intent, requirements, and design before implementation using research-validated prompt patterns.

Jamie-BitFlight/clang-format

Configure clang-format code formatting. Use when: user mentions clang-format or .clang-format, analyzing code style/patterns, creating/modifying formatting config, troubleshooting formatting, brace styles/indentation/spacing/alignment/pointer alignment, or codifying conventions.

Jamie-BitFlight/commitlint

When setting up commit message validation for a project. When project has commitlint.config.js or .commitlintrc files. When configuring CI/CD to enforce commit format. When extracting commit rules for LLM prompt generation. When debugging commit message rejection errors.

Jamie-BitFlight/conventional-commits

When writing a git commit message. When task completes and changes need committing. When project uses semantic-release, commitizen, git-cliff. When choosing between feat/fix/chore/docs types. When indicating breaking changes. When generating changelogs from commit history.

Jamie-BitFlight/dasel-reference

Use when querying, modifying, or converting JSON, YAML, TOML, XML, CSV, HCL, or INI with dasel v3. Complete reference for selectors, functions, conditionals, variables, spread operator, type casting, and format-specific patterns.

Jamie-BitFlight/data-exploration

Use when exploring unknown structured data files with dasel v3 — discover schema, list keys, find nested values, sample arrays, identify data types across JSON, YAML, TOML, XML, CSV, HCL, INI formats

Jamie-BitFlight/data-transformation

Use when modifying, converting, or transforming structured data with dasel v3 — in-place mutations, format conversion, batch operations, array manipulation, object construction, and merge patterns across JSON, YAML, TOML, XML, CSV, HCL, INI

Jamie-BitFlight/delegate

Decompose substantive work into phases, dispatch each phase to a sub-agent, and adjudicate what comes back. Use whenever a request asks for implementation, investigation, a fix, a review, or any change to files — including small ones — and whenever you are about to read source or run a diagnostic yourself instead of handing it off. Also use when a report from a sub-agent needs judging, when a phase needs re-dispatching, or when a user names one instance of a pattern. Does not apply when your own prompt begins "Your ROLE_TYPE is sub-agent." — then follow references/sub-agent-contract.md instead.

Jamie-BitFlight/enterprise-hibernate-hbm

Dasel v3 query patterns for Hibernate .hbm.xml mapping files — entity-table binding, Java property-to-column extraction, one-to-many set/list/bag relationship tracing, many-to-one foreign key discovery, batch scanning across 60+ HBM files. Use when querying Hibernate ORM class mappings, extracting schema metadata from Java persistence layer, or auditing entity-column relationships in enterprise legacy codebases.

Jamie-BitFlight/enterprise-installanywhere

Dasel v3 query patterns for InstallAnywhere .iap_xml installer definitions — use when querying action sequences, discovering variables, resolving platform conditions, navigating panels, or comparing installer variants. Files are 2.5+ MB, 65,000+ lines — too large for context reads, requires structural dasel queries.

Jamie-BitFlight/enterprise-maven-pom

Dasel v3 selector patterns for Maven POM XML files — use when querying dependency versions, filtering by groupId or scope, extracting module hierarchy from parent POMs, or detecting version conflicts across enterprise multi-module Java projects. Load this skill when working with pom.xml files using dasel.

関連スキル