Bug clustering

From jeremylongshore/claude-code-plugins-plus-skills · View interactive version

Bug clustering is an AI agent skill from the GitHub repository jeremylongshore/claude-code-plugins-plus-skills. Normalize supplied X post objects, redact common sensitive strings, score heuristic signals, deduplicate similar text, and persist deterministic bug clusters with the repository's Bun libraries. Use when developing or testing the local clustering stage. Trigger with "cluster these supplied bug posts

How to use this skill

Skill file

Bug Clustering

Exercise the repository's real normalization and clustering libraries on data the operator supplies.

This skill does not fetch X posts, infer truth, or provide a packaged end-to-end runner.

Overview

parseCandidate() performs regex-based extraction, classification, redaction, and scoring.

deduplicateCandidates() groups similar text with trigram and token-Jaccard similarity.

clusterCandidates() writes cluster and cluster-post rows to SQLite. Read

the runtime contract before treating any score as evidence.

Prerequisites

Authentication

No external authentication is used. This skill reads supplied local data and may write only to the

operator-selected SQLite path through the local Bun libraries.

Instructions

  1. Inspect the input count and schema before execution. Refuse unknown binary or private-source files.
  2. Parse each post with parseCandidate(post, runId, approvedAccounts, sourceType?) from

lib/parser.ts.

  1. Verify raw_text_redacted and pii_flags. The redactor covers configured patterns, not every

possible sensitive value; stop if the sample still exposes private content.

  1. Pass { post_id, text, public_metrics } objects to deduplicateCandidates(). Its default threshold

is 0.70; record any override.

  1. Insert the triage run and only the approved candidates into the selected database.
  2. Call clusterCandidates(db, candidates, runId, threshold?). It clusters only four eligible

classification families and skips non-clustering classifications.

  1. Report new, updated, skipped, and suppressed counts. Do not invent audit rows: this function writes

clusters and links, but does not itself emit the audit events claimed by older documentation.

  1. Run the relevant Bun tests after changing library behavior.

Output

Return:

Examples

Input: tests/fixtures/x-api/mentions-response.json
Database: /tmp/x-bug-triage-demo.db
Threshold: 0.70
Result: 3 parsed; 3 forwarded; 2 new clusters; 1 skipped; 0 suppressed
Warning: scores are deterministic heuristics, not verified bug truth.
No execution performed: the requested database was data/triage.db and no backup or mutation approval
was provided.

Error Handling

| Situation | Response |

| ----------------------------------- | ---------------------------------------------------------------------- |

| Input is not X-shaped JSON | Stop and report the missing fields. |

| Redaction leaves sensitive text | Do not persist that candidate. |

| Database is not explicitly selected | Use a disposable path or request a path; never assume production data. |

| Candidate references a missing run | Insert the run first or stop on the foreign-key error. |

| One library call throws | Roll back the caller-managed batch and report the exact stage. |

Guardrails

Resources

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.