knowledge-graph-builder
Skill1 starsChanged 7 months agoMITView on GitHub
Match yesterday's Slack threads against yesterday's Notion page edits, score similarity, and bidirectionally link strong matches — Slack thread gets a bot reply citing the related Notion page; Notion page gets a "Related discussions" section with the Slack permalink. Designed for daily 18:00 launchd cron with a strict precision threshold to avoid noise.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- sohaibdevv/Claude-Agentic-Skills2.0-versiontheir own version, first seen Jun 9, 2026
- vignesh2027/Claude-Agentic-Skills2.0-versiontheir own version, first seen May 20, 2026
- context-is-everything/skillstheir own version, first seen Feb 3, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- vignesh2027/Claude-Agentic-Skills2.0-version★ 6same name
- sohaibdevv/Claude-Agentic-Skills2.0-version★ 2same name
- context-is-everything/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- battle-card-builderSkill
- blocker-radarSkill
- deal-context-loaderSkill
- decision-log-keeperSkill
- follow-up-radarSkill
- inbox-zero-triageSkill
- meeting-prep-pullSkill
- okr-syncSkill
- project-briefSkill
- spec-from-threadSkill
- thread-zombie-killerSkill
- ticket-triage-routerSkill
- weekly-shipped-from-noiseSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Default mode does not need a canonical resource — it writes cross-references back into the matched Slack threads and Notion pages directly.
- Very specific: line 91
Keep only matches with score ≥ --threshold.
- Distinctive: line 106
If the section does not exist, create it as a heading_2 + bulleted_list_item
- Distinctive: line 148
Never claim "this is the official decision page" — the skill links related material, it does not adjudicate authority
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
knowledge-graph-builder
Same topic, two homes — and the homes do not know each other. The Notion page "API auth design" sits next to a separate Slack thread debating the same decision; new hires see only one side. Hand-linking is a willpower problem nobody wins. This skill closes the loop automatically: every evening it scans the day's Slack threads and Notion edits, finds high-confidence matches, and inserts cross-references on both sides. False positives are the entire risk model — so the skill defaults to high-precision matching and never auto-links low-confidence pairs.
Zero-config: in default mode the skill writes cross-references back into the Slack threads and Notion pages it matched, so no canonical resource is needed. In --review-mode, it auto-resolves the parent page "Knowledge Graph Review" and creates a daily child page underneath it — see docs/auto-resolve.md. Slack channels are auto-derived from the day's thread activity when not specified.
Input
--since YYYY-MM-DD(optional, defaults to yesterday 00:00 KST) — earliest message/edit to consider--slack-channels <comma-separated>(override only — defaults to auto-derived from observed thread activity. Env override:CLAUDE_CODE_TOOLKIT_KG_CHANNELS)--notion-workspace <id>(override only — defaults to whole-account search scope. Env override:CLAUDE_CODE_TOOLKIT_KG_WORKSPACE)--threshold N(optional, default 0.75) — minimum similarity score (0.0~1.0) to auto-link--review-mode(optional flag) — output match candidates to a Notion review page instead of writing cross-references directly. Recommended for the first 1-2 weeks
Output
2026-04-27 (since 2026-04-26): scanned T threads · P pages → M strong matches (≥0.75) → L bidirectional links written
- Auto-linked: <count>
- Below threshold (skipped): <count>
- Review-mode page: <Notion URL> (when --review-mode is set)Procedure
1. Parse input
--sincemissing → yesterday 00:00 KST- Slack channels: when missing, default to auto-derived from observed thread activity (mentions / cross-references). On large workspaces, pass
--slack-channelsto limit scope explicitly. Env override:CLAUDE_CODE_TOOLKIT_KG_CHANNELS. - Default mode does not need a canonical resource — it writes cross-references back into the matched Slack threads and Notion pages directly.
--review-modeonly: auto-resolve the parent page "Knowledge Graph Review" via the algorithm in docs/auto-resolve.md (cache-first, fall through to notion-search withtype=page). The skill creates a daily child page namedKnowledge Graph Review — YYYY-MM-DDunder it. Override: edit~/.claude-code-toolkit/auto-resolve.jsondirectly.--thresholdclamped to [0.6, 1.0]; below 0.6 the false-positive rate becomes unacceptable
2. Collect Slack threads
Invoke slack-scout once per channel with the --since window. Then, for each thread surfaced (≥3 messages, ≥2 distinct authors), call mcp__claude_ai_Slack__slack_read_channel with the thread ts to fetch full replies.
Skip threads with <3 messages or single-author monologues — those rarely produce decision content worth cross-linking.
3. Collect Notion page edits
Invoke notion-scout with a custom prompt:
description: "Recent Notion edits scout"
subagent_type: "notion-scout"
prompt: |
Search Notion for pages whose last_edited_time is within the window 2026-04-26 ~ 2026-04-27.
Limit to the top 30 most-recently-edited.
For each page, fetch title + the first 500 characters of the body.
Output the standard format.4. Build matching features
For each Slack thread:
- Extract noun phrases, project codenames, ALL_CAPS abbreviations, URLs
- Compute a bag-of-features signature
For each Notion page:
- Extract the same features from title + body excerpt
- Compute the same signature
5. Score matches (LLM-assisted)
For each (thread, page) candidate pair where the bag-of-features overlap is ≥30%, call the LLM with a focused prompt:
Compare this Slack thread to this Notion page. Output a similarity score 0.0~1.0 plus 1-line rationale.
Score 1.0 = same topic, same scope, same decision being recorded
Score 0.7~0.9 = same topic, partial overlap (e.g. thread is a debate, page is the decision)
Score 0.4~0.6 = related but different scope (thread mentions the topic in passing)
Score below 0.4 = coincidence
Be conservative — when in doubt, score lower.
Slack thread: <thread summary>
Notion page: <title> + <body excerpt>This LLM step is the core of precision — do not skip it. Pure embedding distance over-merges.
6. Filter by threshold
Keep only matches with score ≥ --threshold. Discard the rest.
7. Write cross-references (or review-mode output)
Default mode — for each surviving match, write both directions:
- Slack: post a thread reply via
mcp__claude_ai_Slack__slack_send_message(in-thread, as a bot) with text:📚 Related Notion: <page title> — <URL> Reply with :x: to remove this suggestion. - Notion: update the page via
mcp__claude_ai_Notion__notion-update-page, appending to a "Related discussions" section a bullet:
If the section does not exist, create it as a heading_2 + bulleted_list_item- <YYYY-MM-DD> #<channel> thread — <permalink>
--review-mode — instead of writing, append match candidates to a Notion review page (Knowledge Graph Review — YYYY-MM-DD) with score + rationale + both URLs. The operator manually applies (or rejects) the links. Use this for the first 1-2 weeks to calibrate the threshold.
Hook behavior: the plugin's PreToolUse(mcp__claude_ai_Notion__notion-update-page) and PreToolUse(mcp__claude_ai_Slack__slack_send_message) hooks fire — Slack post is never bypassed even in cron mode (a wrong public bot reply is not silently recoverable). Notion updates can be bypassed with CLAUDE_CODE_TOOLKIT_CRON_MODE=1 after the first successful run signs off the threshold; audit log lives at ~/.claude-code-toolkit/audit/knowledge-graph-YYYY-MM-DD.jsonl.
8. Output
Print the one-line console summary + (if review-mode) the review page URL. Done.
Automated operation (cron)
Recommended launchd cron at daily 18:00 KST:
# ~/Library/LaunchAgents/<reverse-domain>.claude-code-toolkit.knowledge-graph.plist
# Program: /usr/local/bin/claude
# ProgramArguments: -p "/claude-code-toolkit:knowledge-graph-builder"
# StartCalendarInterval: { Hour=18, Minute=0 }
# EnvironmentVariables:
# CLAUDE_CODE_TOOLKIT_CRON_MODE=1
# # Optional — only set if you want to override auto-resolve
# CLAUDE_CODE_TOOLKIT_KG_CHANNELS=#eng,#product,#design,#research
# CLAUDE_CODE_TOOLKIT_KG_WORKSPACE=<id>For the first 1-2 weeks, run with --review-mode (interactive only) to validate match quality. Switch to direct write only after the precision is verified.
Pitfalls
- False positives are catastrophic: a wrong "Related Notion" reply on a public Slack thread is visible to everyone. Never lower the threshold below 0.6, and prefer
--review-modefor the first runs - LLM scoring drift: the same pair scored at different times can vary by ±0.1. When near the threshold, prefer not-linking
- Notion edits storm: API rate limits trigger on >20 update_page calls in a minute. Cap at 15 links per run; queue the rest for the next day
- Slack bot post permission:
chat:writescope must be approved by the workspace admin. Without it, only the Notion side can be written — print this asymmetry in the output - Thread author dislikes the bot reply: respect a
:x:reaction by the thread author or the OP — track via a dedupe ledger to avoid re-posting the same suggestion the next day - Page → page linking is out of scope: Notion-to-Notion knowledge graph is a separate skill (see roadmap). This skill only crosses Slack ↔ Notion
Tone
- The Slack reply is a single line + footer. No rationale, no scoring exposed to readers
- The Notion bullet is a permalink with a date — no editorial summary
- "Speculative" wording is welcome in the review-mode page (when score is borderline)
- Never claim "this is the official decision page" — the skill links related material, it does not adjudicate authority
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

