Cluster corpus by theme

From lyndonkl/claude · View interactive version

Cluster corpus by theme is an AI agent skill from the GitHub repository lyndonkl/claude. Performs axial-coding-style thematic clustering over the substacker corpus of published posts to surface candidate sections. Uses Braun & Clarke's six-phase thematic analysis — familiarization, initial coding, searching for themes, reviewing themes, defining themes, naming. Reads full bodies, not ti

How to use this skill

Skill file

Cluster Corpus by Theme

Workflow

Per Curator run:
- [ ] Step 1: Read every post in corpus/published/** end-to-end (not just titles)
- [ ] Step 2: Extract 3-5 codes per post (concepts, methods, domains)
- [ ] Step 3: Group codes across posts by semantic similarity (axial)
- [ ] Step 4: Validate clusters — split or merge where needed
- [ ] Step 5: Report candidate clusters with membership, cohesion, outliers

Output

cluster_1:
  candidate_handle: "kalshi-log"
  posts: [list of slugs]
  cohesion: high | medium | low
  centroid_codes: [top 5 codes]
  outlier_posts: [weakly-attached members]
rejected_clusters: [clusters with <3 posts]

Heuristics

Guardrails

  1. Read full post bodies. Titles are marketing; bodies are the beat.
  2. Do not force every post into a cluster. Outliers are legitimate.
  3. If >30% of corpus doesn't cluster coherently (all cohesion low), emit "corpus too heterogeneous" → Curator abandons section proposals this run.
  4. Include rejected clusters in output — they feed recommend-prune and "watch" candidates.
  5. Single-threaded. Don't race on the corpus.
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.