Agent Skills: Conversation Analysis

Analyze OpenCode conversation history to identify themes and patterns in user messages. Use when asked to analyze conversations, find themes, review how a user steers agents, or extract insights from session history.

UncategorizedID: connorads/dotfiles/opencode-conversation-analysis

Install this agent skill to your local

pnpm dlx add-skill https://github.com/connorads/dotfiles/tree/HEAD/.config/skills/personal/opencode-conversation-analysis

Skill Files

Browse the full folder contents for opencode-conversation-analysis.

Download Skill

Loading file tree…

.config/skills/personal/opencode-conversation-analysis/SKILL.md

Skill Metadata

Name
opencode-conversation-analysis
Description
Analyze OpenCode conversation history to identify themes and patterns in user messages. Use when asked to analyze conversations, find themes, review how a user steers agents, or extract insights from session history.

Conversation Analysis

Analyze user messages from OpenCode sessions to identify recurring themes, communication patterns, and steering behaviours.

How the pieces fit

Chunk files are ~320k chars (~80k tokens) each - reading one inline consumes the orchestrator's entire context, which is why the workflow is delegation-shaped when there are 2+ chunks:

  1. Pass chunk file paths to subagents; they read and analyze independently
  2. Run subagents in parallel - one per chunk
  3. Subagents return structured JSON; you only synthesize at the end

Gate the delegation: with a single chunk (or a total under ~40k tokens), analyse it inline - spawning one subagent just adds a hop and loses the orchestrator's direct view of the quotes.

Workflow

Step 1: Run Extraction

# From this skill directory:
scripts/extract.sh

This script:

  • Reads from ~/.local/share/opencode/opencode.db (SQLite) when available
  • Falls back to ~/.local/share/opencode/storage/ for older OpenCode installs
  • Extracts user messages from main sessions with metadata (session_id, title, timestamp, text)
  • Filters out messages < 10 characters
  • Chunks into ~320k char files (~80k tokens each)
  • Outputs to /tmp/opencode-analysis/chunk_*.jsonl

Review the output summary to see how many chunks were created.

Step 2: Launch Parallel Subagents

For each chunk file, spawn a general-purpose subagent with this prompt template:

Read the file /tmp/opencode-analysis/chunk_N.jsonl which contains user messages from coding sessions (JSONL format with fields: session_id, session_title, timestamp, text).

Analyze these messages to identify recurring themes in how the user steers/guides AI coding assistants. Look for patterns like:
- How they give feedback
- How they correct mistakes
- How they scope/refine requests
- Communication style preferences
- Technical approaches they emphasize

For each theme you identify, provide:
1. Theme name (short, descriptive)
2. Description (1-2 sentences)
3. 2-3 direct quote examples from the messages

Return ONLY valid JSON in this format:
{
  "themes": [
    {
      "name": "Theme Name",
      "description": "Description of the pattern",
      "examples": ["quote 1", "quote 2"]
    }
  ]
}

Launch ALL chunk subagents in parallel (single message, multiple Task tool calls). Skip this entirely for a single small chunk - analyse it inline (see the gate above).

Step 3: Synthesize Results

Once all subagents return:

  1. Collect all theme objects from all chunks
  2. Group similar themes (same name or overlapping descriptions)
  3. Merge examples from duplicate themes
  4. Rank themes by how many chunks they appeared in
  5. Pick the best 2-3 examples per theme

Step 4: Output Format

Present the final analysis as markdown with this structure:

# Themes in How You Steer AI Coding Assistants

Analysis of N messages across M sessions (date range)

---

## 1. Theme Name

Description of the pattern.

**Examples:**
- "direct quote 1"
- "direct quote 2"
- "direct quote 3"

---

## 2. Next Theme
...

Output directly to the user - don't write to a file unless asked.

Customisation Options

The user may request:

  • Different chunk sizes: Edit CHUNK_SIZE in extract.sh (default 320000 chars)
  • Different message filter: Edit MIN_TEXT_LEN in extract.sh (default 10 chars)
  • Include subagent sessions: Remove the parent_id IS NULL (SQLite) and parentID (legacy) filters in extract.sh
  • Time period filtering: Add timestamp filtering in extract.sh

Storage Format Reference

When the schema differs, extraction fails, or you need to adjust the SQL, read references/storage-format.md for OpenCode's conversation storage structure.