本文へ移動
cccskills
無料GitHub で公開

kb-gap-mining

Weekly reusable-session ticket-to-KB loop. Reads recently resolved Plain threads, clusters them into recurring topics, cross-references {{kb_path}} of {{kb_repo}} and a durable ledger to find topics with real volume and no article, drafts the top gaps from the actual resolutions, and opens a PR only — never publishing or merging.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<skill name="kb-gap-mining"> <overview> Turn resolved Plain support tickets into knowledge-base coverage without duplicating what already exists. A weekly cron re-prompts a persistent session, pulls recently resolved threads, clusters them into recurring topics, and checks each topic against the KB repo's existing articles and the session's own ledger of topics already drafted or covered. Topics that clear both bars — recurring enough to matter, and genuinely undocumented — get drafted from the real resolutions used in their tickets. Each run opens one PR. The agent never publishes and never merges.

Proactive and schedule-driven; the ledger is what keeps runs from redrafting the same gap or duplicating a PR still under review. </overview>

<when-to-load> - The weekly cron fires the ticket-to-KB sweep. - A human asks the agent to check for KB gaps or run a mining pass. - A prior run's PR needs a follow-up before the next batch starts. </when-to-load> <workflow>

Step 0 — Orient and resume

# Read the durable ledger first — covered topics, drafted-but-unmerged
# topics, and clusters seen before that didn't clear the bar.
cat memory/kb-gap-mining-log.md 2>/dev/null || echo "(no ledger yet)"

# Check any open KB-gap PR from a prior run.
gh pr list --repo {{kb_repo}} --state open \
  --search 'in:title "kb: draft" OR label:kb-gap' \
  --json number,title,headRefName,statusCheckRollup,url

If a prior PR is still open and unreviewed, note its topics and don't duplicate them in this run's batch.

Step 1 — Pull recently resolved tickets from Plain (read-only)

Using PLAIN_API_KEY, pull threads resolved since the ledger's last-run timestamp (or the trailing 7 days if this is the first run). For each resolved thread, extract:

  • The question or problem as the customer originally stated it.
  • The resolution actually used to close it — the steps, the answer, the workaround — in the agent's or teammate's own words.
  • Enough context (thread ID) to trace the draft back to its source tickets, without carrying customer names or account details forward.

Skip threads with no reusable resolution (spam, duplicate of an in-progress bug, "never replied").

Step 2 — Cluster into topics

Group extracted tickets into topics using intent, not wording — "can't reset my password" and "reset link never arrives" are the same topic if the underlying question and resolution are the same; a superficially similar phrase with a different root cause is a different topic. For each candidate topic, keep: the ticket count, a representative set of the actual resolution steps, and the source thread IDs.

Step 3 — Freshen the KB repo and check existing coverage

if [ -d /workspace/repo/.git ]; then
  cd /workspace/repo && git fetch origin && git checkout main && git reset --hard origin/main
else
  git clone --filter=blob:none https://github.com/{{kb_repo}}.git /workspace/repo
  cd /workspace/repo
fi

grep -ril "<likely topic keyword>" {{kb_path}} 2>/dev/null

For each candidate topic from Step 2, check both {{kb_path}} in the repo and the ledger's covered-topics list. A topic is a gap only if neither shows an existing article for it. A topic with an article that's out of date is not a gap for this skill — that's a refresh, not a new draft; skip it here.

Step 4 — Rank and select this week's batch

Rank remaining gap topics by ticket volume (how many resolved threads recurred on it). Re-check against the ledger's "seen before, below bar" entries — a topic that just crossed the volume threshold this week is promoted; a topic that's been circling near the bar for months without crossing it stays logged, not drafted. Take the top 3–5 as this week's batch.

Step 5 — Isolated drafting branch

cd /workspace/repo
BRANCH="kb-gap/$(date +%Y-W%V)"
git checkout -b "$BRANCH" origin/main

One branch per weekly run.

Step 6 — Draft each article from real resolutions

For each topic in the batch:

  1. Write the article under {{kb_path}}, matching the existing article format and tone in that directory.
  2. Base every step in the article on the actual resolution steps gathered in Step 1 — never invent a fix the source tickets don't support.
  3. Strip all customer names, account identifiers, and specifics; generalize to the reusable version of the question and answer.
  4. Note the ticket count and topic in the PR description (not in the article itself) so the reviewer can judge whether the batch reflects real demand.

Step 7 — Commit

cd /workspace/repo
git add {{kb_path}}
git commit -m "kb: draft $(date +%Y-W%V) batch

$(for each topic: echo "- <article path>: <ticket count> resolved tickets")"

Step 8 — Open the PR (draft only, never publish)

cd /workspace/repo
git push origin "$BRANCH"
gh pr create --repo {{kb_repo}} --base main --head "$BRANCH" \
  --title "kb: draft $(date +%Y-W%V) batch" \
  --label kb-gap \
  --body "Generated by the ticket-to-KB agent. Each article was drafted from
the real resolutions used to close its cluster of Plain tickets, with
customer specifics stripped. Per article: the topic, the resolved-ticket
count that triggered it, and source thread IDs for verification. This PR is
never merged by the agent — a human reviews, edits, and decides what
publishes."

Step 9 — Update the ledger

Append a dated entry to memory/kb-gap-mining-log.md (see <ledger-format>).

</workflow> <ledger-format> Lives at `memory/kb-gap-mining-log.md`. Every run appends a dated entry with: run timestamp, branch, PR link (or "not opened — nothing cleared the bar"), a **Drafted topics** table (topic / article path / ticket count / source thread IDs), the **full candidate list** considered that week including gaps that didn't clear the volume threshold (topic / ticket count / status: covered, drafted-pending-review, or below-bar), and **blockers for next run**. </ledger-format> <guardrails> - **Draft only, never publish.** The agent opens a PR against an isolated branch and stops. It never pushes to the live docs branch and never merges its own work. - **Real resolutions only.** Every drafted step must trace back to an actual ticket resolution from Step 1. Never fabricate a fix the source tickets don't support. - **No customer detail in a draft.** Names, account identifiers, and ticket-specific context are stripped before anything is written to `{{kb_path}}`. - **Read-only tickets.** Plain access is read-only. The agent cannot edit, close, or reply to a ticket while mining it. - **`{{kb_path}}` is the only write surface.** Files outside that path in `{{kb_repo}}` are read-only to this agent. - **Sandbox isolation.** Drafts are written and reviewed on an isolated branch in the session sandbox. Nothing reaches the repo until `git push` runs. - **Secrets scoped.** `PLAIN_API_KEY` and `GH_TOKEN` are injected at runtime, never written to disk or logged. - **One PR per run, one run per week.** If a prior PR is still open, don't duplicate its topics — extend it or wait for review. - **Volume plus absence, not either alone.** A single ticket never justifies a draft, and an existing-but-stale article is never redrafted here. </guardrails> </skill>

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Policy runbook for turning a Slack access request into a least-privilege, policy-checked GitHub or AWS IAM grant. Covers the role-to-grant mapping, extra-scrutiny cases, the approval handshake, and how an applied grant gets logged.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月13日 更新

Get a complete picture of any company or person before outreach. This skill always works with web search, and gets significantly better with enrichment and CRM data.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月13日 更新

Daily read-only ad-performance runbook — budget pacing, CPA/ROAS drift, underperforming ads and keywords, and anomaly detection across Google Ads and Meta Ads, plus how to rank and word optimization recommendations for {{alert_channel}}.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月13日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月13日 更新

Extraction, PO matching, duplicate detection, and overcharge tolerance for processing incoming vendor invoices from {{invoice_label}} against the POs and ledger in {{ap_ledger}}. Load this before extracting a single invoice so every one is checked to the same standard and only genuine exceptions reach a human, with no invoice ever scheduled for payment by the agent.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月13日 更新

Daily brand-mention monitoring loop for {{brand_terms}}. Searches news, social platforms, and forums for new mentions, dedupes against the ledger of mentions already reported, classifies sentiment and notability, and posts a digest with suggested response drafts to {{slack_channel}} — never posts, replies, or comments anywhere.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月13日 更新

kortix-ai のスキルをすべて見る

このスキルの問題を報告する