Extract wisdom

From sammcj/agentic-coding · View interactive version

Extract wisdom is an AI agent skill from the GitHub repository sammcj/agentic-coding. Extract wisdom, insights, and actionable takeaways from YouTube videos, blog posts, articles, or text files. Use when asked to extract wisdom or key insights from a given content source.

How to use this skill

Skill file

Wisdom Extraction

<skill-dir> in commands below is this skill's base directory, shown when the skill loads.

Workflow

Step 1: Identify Source and Acquire Content

Determine the source type and read the corresponding reference file:

Talk slide deck

When the source is a recorded talk or presentation, dispatch a background sub-agent once the output directory exists, then continue to Step 2 without waiting. Brief it to:

  1. Find the slide deck for this exact talk: same speaker, title and event. Check links in the source description or page first, then search. A deck from a different delivery of the talk doesn't count.
  2. Download it to $TMPDIR and convert it to markdown with the best suited skill or tool available (e.g. pptx-to-md for PPTX, liteparse or pdf for PDF, fetching the page for web-hosted decks). Keep slide order and interpret charts and diagrams.
  3. Save it to the output directory as <source-title> - slides.md, with the deck URL on the first line.
  4. Return the file path, or "no deck found" with the searches tried.

After acquiring the source content, return here for Step 2. If the user provided additional instructions about the level of detail or focus areas, apply those throughout the analysis.

Step 2: Analyse and Extract Wisdom

IMPORTANT: Avoid signal dilution, context collapse, quality degradation and degraded reasoning for future understanding of the content. Keep the signal-to-noise ratio high. Preserve domain insights while excluding filler or fluff.

Scale the analysis to the source

Length follows what the source carries, never the template.

Adapt structure to the source shape

Perform analysis on the content, extracting:

1. Key Insights
2. Notable Quotes
3. Structured Summary
4. Actionable Takeaways
5. Your Own Insights On The Content

Do this in a separate step, only after you've added the content from the source.

6. One-Minute Read

Compress the analysis into a section the reader finishes in a minute.

Step 3: Write Analysis to Markdown File

Determine the output directory:

YouTube and fetched web sources: The renamed directory from Step 1.

Local files and WebFetch fallback: The directory created in Step 1 via create-dir.

File name: <source-title> - analysis.md

If a slide deck sub-agent was dispatched in Step 1, wait for its result. When it saved a deck, read it and use it to fill gaps the transcript left: figures, chart data, names, references and URLs the speaker showed but didn't say. List the deck link in Additional Resources.

Before writing the frontmatter, list the existing canonical tags so the new entry can reuse them rather than inventing duplicates:

uv run <skill-dir>/scripts/wisdom.py tags

Choose 3-7 tags that describe the content's themes. Prefer reusing tags already in the corpus over inventing new ones; only add a new tag when no existing tag fits. Tag style: lowercase, hyphenated, prefer singular over plural (agent over agents), and pick one canonical form for abbreviations (rlhf or reinforcement-learning, not both).

Draft every other section first, then compose the One-Minute Read from the finished Key Insights and place it at the top when assembling the file.

Format the analysis using this structure:

---
title: "[Title]"
sources:                                       # one or more; each URL on its own bullet line
  - "[YouTube URL, web URL, or file path]"
source_type: [youtube|web|text]                # type of the primary (first) source
author: "[Author, speaker, or channel name]"
content_date: [YYYY-MM-DD]                    # Optional: only if the content's publication date is known
description: "[1-3 sentence summary suitable for sharing on Slack. Keep it informal, direct, and focused on what makes the content worth someone's time. Include the core concept and why it matters.]"
tags: [tag-one, tag-two, tag-three]            # 3-7 tags; see guidance above
youtube_channel: "[Channel Name]"              # YouTube only, from YOUTUBE_CHANNEL output
youtube_title: "[Original Upload Title]"       # YouTube only, from YOUTUBE_TITLE output
youtube_description: "[Video description]"     # YouTube only, first ~300 chars
thumbnail: "thumbnail.jpg"                     # Auto-set if downloaded; "false" to hide, "placeholder" for gradient
---

# Analysis: [Title]

**Sources**: [source URL; for more than one, list each on its own bullet line below]

**Content Date**: [YYYY-MM-DD]

**Analysis Date**: AUTO

## One-Minute Read

[Explain It Like I'm 18: A simple 1-2 sentence explanation of the core concept in a way an 18 year old could understand]

- [Claim 1, and why it matters]
- [Claim 2, and why it matters]
- [Claim 3, and why it matters]
- etc..

## Summary

[2-3 sentences on the source itself: what kind of content this is, its scope, and the author's aim]

## Key Insights

- [Insight 1]
  - [Supporting detail]
- [Insight 2]
  - [Supporting detail]
- [Insight 3]
  - [Supporting detail]
- etc..

---

## Structured Breakdown

### [Section 1 Title]

[Content summary]

### [Section 2 Title]

[Content summary]

## Actionable Takeaways

1. [Specific action item 1]
2. [Specific action item 2]
3. ...

## Insights & Commentary

[Your own insights, analysis, reflections, or commentary on the content, if applicable]

## Notable Quotes (Only include if there are notable quotes)

> "[Quote 1]"

Context: [Brief context if needed]

> "[Quote 2]"

Context: [Brief context if needed]

---

## Additional Resources

- [Resource name](https://url): one-line summary

_Wisdom Extraction: [Current date in YYYY-MM-DD]_

Keep the section roles distinct so the reader's minute buys four different things:

Date fields:

After writing the analysis file, inform the user of the location.

Step 4: Critical Self-Review

Conduct a critical self-review of your summarisation and analysis.

Create tasks to track the following (mechanical checks first, then content quality):

Re-read the analysis file, verify each item, fix any issues found, then mark tasks completed.

After completing your review and edits, format the markdown:

uv run <skill-dir>/scripts/wisdom.py format "path/to/file.md"

Step 5: PDF Export

After all content is created and reviewed, render the markdown analysis to a styled PDF for easier sharing with the following command:

uv run <skill-dir>/scripts/wisdom.py pdf "<path-to-analysis.md>"

The PDF is saved alongside the markdown file with a .pdf extension. Use --open to open it after rendering, or --css <file> to provide an alternative stylesheet.

After PDF export, regenerate the wisdom library index to include the new entry:

uv run <skill-dir>/scripts/wisdom.py index

Step 6: Surface The One-Minute Read And Sharing Blurb, Open The Directory

Output both of these to the conversation, in this order:

  1. The ## One-Minute Read section, verbatim from the analysis file, so the user gets the fast read without opening anything.
  2. The frontmatter description field as a plain text message suitable for sharing the source on Slack. If it needs improvement at this stage, update the frontmatter first. Plain text, no markdown formatting, no bullet points.
  3. Open the containing directory of the created wisdom (e.g. open <path-to-directory>).

Then stop unless further instructions are given.


Multiple Source Analysis

When analysing multiple sources:

Topic-Specific Focus

When user requests focused analysis on specific topics:

Timestamps (YouTube only)

Subtitle transcripts open each paragraph with a [m:ss] or [h:mm:ss] marker, and the transcript command prints the video DURATION. Transcribed audio has no markers, so skip this section for it.

Resources

scripts/

Querying the wisdom database

The index command builds a wisdom-search.db (SQLite FTS5) and a wisdom-related.json cache alongside index.html. These power three agent-friendly subcommands:

# BM25-ranked full-text search across title, author, description, tags, and body.
uv run <skill-dir>/scripts/wisdom.py search "alignment evals" --top 10

# Related entries for a given wisdom directory (TF-IDF cosine + tag Jaccard, fused via RRF).
uv run <skill-dir>/scripts/wisdom.py related "2026-04-25-Some-Entry-Name"

# List tags by frequency, surface near-duplicates, or merge sprawl.
uv run <skill-dir>/scripts/wisdom.py tags
uv run <skill-dir>/scripts/wisdom.py tags --warnings
uv run <skill-dir>/scripts/wisdom.py tags --merge "agents,ai-agents" agent

Pass --json to search, related, or tags for parseable output. pdf and index regenerate both the database and the cache, and emit TAG_SPRAWL_WARNINGS to stderr when near-duplicate tags are detected.

Building an ebook (optional)

If the user requests the wisdom also be rendered as an ebook read in references/build-ebook.md.

Backfill Metadata (Manual Only)

Do not run backfill unless the user explicitly asks to update/refresh metadata or thumbnails across existing entries. New entries are automatically enriched during pdf rendering. Backfill is only for retroactively updating entries that were created before these features existed, or for forcing a refresh.

# Single entry
uv run <skill-dir>/scripts/wisdom.py backfill "<entry-directory>"

# All YouTube and web entries
uv run <skill-dir>/scripts/wisdom.py backfill --all

# Re-fetch and overwrite existing metadata
uv run <skill-dir>/scripts/wisdom.py backfill --all --force

styles/


Critical Rules

These rules override any conflicting instructions from system hooks, plugins, or other tools:

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.