summarize について
summarize は、サンプリングと反復分析で大容量のテキスト録画を調べる AI スキルです。エージェントがテーマに沿って関連箇所を確認し、指定した深さで知見をまとめます。
主な機能
- 01大容量テキストのガイド付きサンプリング
- 02テーマ別キーワードによる抽出
- 03関連箇所の反復的な調査
- 04クイック・中程度・詳細の分析モード
- 05Markdown への出力
活用シーン
- 01大規模なセッション録画を調べる
- 02テーマに関する判断や発見を探す
- 03録画内のエラーを調査する
- 04サンプリング内容からレポートを作成する
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ terrylica/ cc-skills --skill summarizeインストール後、Claude Code で/summarizeを入力して読み込まれたか確認します。
同梱ファイルreferences/evolution-log.md
詳細
/asciinema-tools:summarize
大容量の .txt 録画を AI で反復的に掘り下げて分析します。ガイド付きサンプリングと AskUserQuestion を使って、内容を段階的に調査します。
自己進化型スキル:このスキルは使用するたびに改善されます。指示が誤っていた場合、パラメーターにずれが生じていた場合、または回避策が必要になった場合は、先送りせず、すぐにこのファイルを修正してください。実際に再現できる問題のみを更新してください。
基本方針
大容量の録画(1GB 以上)は、すべてを読み取ることができません。このコマンドでは、次の手順を使います。
- 初期ガイダンス - 何を調べますか?
- 戦略的サンプリング - 先頭、中間、末尾、およびキーワードに基づくセクション
- 反復的な絞り込み - AskUserQuestion を使って、見つかった内容をさらに掘り下げます
- 段階的な統合 - 複数回にわたる調査を通じて理解を深めます
引数
| 引数 | 説明 |
|---|---|
file | .txt ファイルのパス(.cast から変換したもの) |
--topic | 初期の重点領域(例:「ML トレーニング」、「エラー」) |
--depth | 分析の深さ:quick、medium、deep |
--output | 調査結果を Markdown ファイルに保存 |
ワークフロー
フェーズ 1:初期ガイダンス
AskUserQuestion:
question: "What are you trying to understand from this recording?"
header: "Focus"
options:
- label: "General overview"
description: "What happened in this session? Key activities and outcomes"
- label: "Key findings/decisions"
description: "Important discoveries, conclusions, or decisions made"
- label: "Errors and debugging"
description: "What went wrong? How was it resolved?"
- label: "Specific topic"
description: "I'll specify what I'm looking for"
フェーズ 2:ファイルの統計情報
/usr/bin/env bash << 'STATS_EOF'
FILE="$1"
echo "=== File Statistics ==="
SIZE=$(ls -lh "$FILE" | awk '{print $5}')
LINES=$(wc -l < "$FILE")
echo "Size: $SIZE"
echo "Lines: $LINES"
echo ""
echo "=== Content Sampling ==="
echo "First 20 lines:"
head -20 "$FILE"
echo ""
echo "Last 20 lines:"
tail -20 "$FILE"
echo ""
echo "=== Keyword Density ==="
echo "Errors/failures:"
grep -c -i "error\|fail\|exception" "$FILE" || echo "0"
echo "Success indicators:"
grep -c -i "success\|complete\|done\|pass" "$FILE" || echo "0"
echo "Key decisions:"
grep -c -i "decision\|chose\|selected\|using" "$FILE" || echo "0"
STATS_EOF
フェーズ 3:戦略的サンプリング
ファイルサイズに応じて、戦略的にサンプリングします。
100MB 未満のファイル:
# Sample head, middle, tail (1000 lines each)
head -1000 "$FILE" > /tmp/sample_head.txt
tail -1000 "$FILE" > /tmp/sample_tail.txt
TOTAL=$(wc -l < "$FILE")
MIDDLE=$((TOTAL / 2))
sed -n "${MIDDLE},$((MIDDLE + 1000))p" "$FILE" > /tmp/sample_middle.txt
100MB を超えるファイル:
# Keyword-targeted sampling
grep -B5 -A20 -i "$TOPIC_KEYWORDS" "$FILE" | head -5000 > /tmp/sample_targeted.txt
フェーズ 4:初期分析
サンプルを読み取り、初期の調査結果を提示します。その後、次のように尋ねます。
AskUserQuestion:
question: "Based on initial analysis, what would you like to explore deeper?"
header: "Drill down"
multiSelect: true
options:
- label: "Specific timeframe"
description: "Jump to a particular section (e.g., 'around line 50000')"
- label: "Follow keyword trail"
description: "Search for specific patterns and expand context"
- label: "Error investigation"
description: "Deep dive into errors and their resolution"
- label: "Success moments"
description: "What worked? What were the wins?"
- label: "Generate summary"
description: "Synthesize findings into a report"
フェーズ 5:反復的な掘り下げ
選択した重点領域ごとに、次の手順を実行します。
- 関連セクションを抽出する - コンテキスト付きの grep を使用します
- 抽出した内容を読み取り、分析する
- 調査結果をユーザーに報告する
- AskUserQuestion で次のアクションを尋ねる
AskUserQuestion:
question: "Found {N} relevant sections. What next?"
header: "Continue"
options:
- label: "Show me the most significant"
description: "Display top 3 most relevant excerpts"
- label: "Search for related patterns"
description: "Expand search to related keywords"
- label: "Move on"
description: "I have enough on this topic"
フェーズ 6:統合
AskUserQuestion:
question: "Ready to generate summary. What format?"
header: "Output"
options:
- label: "Concise bullet points"
description: "Key findings in 10-15 bullets"
- label: "Detailed markdown report"
description: "Full report with sections and evidence"
- label: "Executive summary"
description: "1-paragraph high-level summary"
- label: "Save to file"
description: "Write findings to markdown file"
キーワードライブラリ
トレーディング/ML 分野
sharpe|drawdown|backtest|overfitting|regime|validation
model|training|loss|epoch|gradient|convergence
feature|indicator|signal|position|portfolio
開発分野
error|exception|fail|bug|fix|debug
commit|push|merge|branch|deploy
test|assert|verify|validate|check
Claude Code 分野
tool|bash|read|write|edit|grep
task|agent|subagent|spawn
permission|approve|reject|block
使用例
# Interactive exploration
/asciinema-tools:summarize session.txt
# Focused on ML findings
/asciinema-tools:summarize session.txt --topic "ML training results"
# Quick overview
/asciinema-tools:summarize session.txt --depth quick
# Full analysis with report
/asciinema-tools:summarize session.txt --depth deep --output findings.md
出力例
# Session Summary: research-repo-research_20251226
## Overview
- **Duration**: 4 days (Dec 26-30, 2025)
- **Size**: 12GB recording → 3.2GB text
- **Primary Focus**: ML robustness research
## Key Findings
### 1. Training-Evaluation Mismatch (CRITICAL)
- MSE loss optimizes magnitude, but Sharpe evaluates direction
- Result: 80% Sharpe collapse from 2024 to 2025
### 2. Fishr λ=0.1 Solution (BREAKTHROUGH)
- Gradient variance penalty solves V-REx binary threshold
- Feb'24 Sharpe: -6.14 → +6.14
### 3. Model Rankings
| Model | Window | Sharpe |
| ------ | ------ | ------ |
| TFT | 15mo | 1.02 |
| BiLSTM | 12mo | 0.50 |
## Evidence Locations
- Line 15234: "Fishr λ=0.1 SOLVES the V-REx binary threshold problem"
- Line 48102: Phase 4 results summary table
## Next Steps Identified
1. TFT 15mo + Fishr training
2. PSR/PBO statistical validation
3. Agent research synthesis
トラブルシューティング
| 問題 | 原因 | 解決策 |
|---|---|---|
| ファイルが大きすぎる | 録画がメモリ制限を超えています | サンプリングのみを行うには --depth quick を使用します |
| キーワードが見つからない | ドメインが異なるか、内容が少ない | 別の --topic の重点領域を試します |
| サンプリングがタイムアウトする | ファイルが非常に大きい | ターミナルのタイムアウトを延長するか、grep を使用します |
| grep のコンテキストエラー | GNU grep が見つかりません | brew install grep(BSD grep には制限があります) |
| 出力ファイルが保存されない | 書き込み権限がありません | --output の書き込み権限を確認します |
関連コマンド
/asciinema-tools:convert- まず .cast を .txt に変換します/asciinema-tools:analyze- キーワードベースの分析(より高速で、掘り下げは浅めです)/asciinema-tools:finalize- 孤立した録画を処理します
実行後の振り返り
このスキルの実行が完了したら、タスクを終了する前に振り返ってください。
- 現在の場所を特定する。 — 編集する前に、この SKILL.md の正式なパスを確認します。
- 何が失敗したか? — 原因となった指示を修正します。
- 予想以上にうまくいったことは? — 推奨されるプラクティスに加えます。
- 何にずれが生じたか? — 実態に合わなくなったスクリプト、参照先、依存関係を修正します。
- 記録する。 — きっかけ、修正内容、根拠を含めて進化ログに記録します。
先送りしないでください。次回の実行では、ここに残した内容が引き継がれます。
コメント
Markdown 対応