Agent skill

Knowledge Wiki Merge

by CatChen in CatChen/knowledge-wiki-template

Interactively find and merge duplicate concept files in the knowledge wiki.

MITAuto-check passedKnowledge Management

Install Knowledge Wiki Merge

skills CLI
$ npx skills add CatChen/knowledge-wiki-template --skill knowledge-wiki-merge -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install CatChen/knowledge-wiki-template knowledge-wiki-merge --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/CatChen/knowledge-wiki-template.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/knowledge-wiki-merge .claude/skills/knowledge-wiki-merge && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
knowledge-wiki-merge
GitHub stars
106
Token cost
~2.6k tokens
SKILL.md length
1,218 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Interactively find and merge duplicate concept files in the knowledge wiki.

  • Works in 4 steps: Establish the working directory → Find and filter duplicate candidates → Present and resolve each candidate → …
  • Knowledge Management work in your project
  • Calls node and git

What it does

Knowledge Wiki Merge is an agent skill from CatChen/knowledge-wiki-template. Interactively find and merge duplicate concept files in the knowledge wiki. Presents candidate pairs one at a time and asks whether to merge, dismiss, or skip each one. Run after accumulating new concepts or when the wiki feels redundant.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Knowledge Management. The licence is MIT.

When your agent uses it

  • Knowledge Management work in your project

Example prompts

  • “/knowledge-wiki-merge”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Establish the working directory
  2. Find and filter duplicate candidates
  3. Present and resolve each candidate
  4. Print summary

What it can do on your machine

Read from SKILL.md and the folder at commit 77b9be8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Knowledge Wiki Merge loads about 2.6k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 1,218 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from CatChen/knowledge-wiki-template at commit 77b9be8, republished under its MIT licence (© CatChen). 1,218 words, ~2,559 tokens.

Download SKILL.mdSave it as .claude/skills/knowledge-wiki-merge/SKILL.md (or your agent's skills folder).
name
knowledge-wiki-merge
description
Interactively find and merge duplicate concept files in the knowledge wiki. Presents candidate pairs one at a time and asks whether to merge, dismiss, or skip each one. Run after accumulating new concepts or when the wiki feels redundant.

Knowledge Wiki Merge

Detect duplicate concept pairs and interactively merge them. Presents one pair at a time — you decide whether to merge, dismiss (never show again), or skip. Merging is destructive and irreversible, so each decision is confirmed before execution.

Steps

1. Establish the working directory

The knowledge base root is the Git repository root. Run git rev-parse --show-toplevel and store the result as KNOWLEDGE_PATH.

Use KNOWLEDGE_PATH for all subsequent steps.

2. Find and filter duplicate candidates

Structural candidates are pairs detected by shared source material — concept files that share two or more ## Sources entries. Run:

bash
node {KNOWLEDGE_PATH}/scripts/wiki/candidates.mjs find-shared-source-concepts

This script automatically filters out previously dismissed pairs from Wiki/.state.json. Output is { "candidates": [...] } sorted by shared source count descending. Tag each as detection: "structural". Do not pipe through head or any other truncating command — every candidate must be evaluated.

LLM pre-filter (structural only): Before proceeding, review the structural candidates and eliminate any pair that is clearly about different topics despite sharing sources — pairs where the shared sources happen to cover two unrelated ideas (e.g. applescript and email-marketing appearing in the same AppleScript email tutorial). For each eliminated pair, call:

bash
node {KNOWLEDGE_PATH}/scripts/wiki/wiki-state.mjs dismiss-pair knowledge-wiki-merge {pathA} {pathB}

where pathA and pathB are the full relative paths (e.g. Wiki/Concepts/applescript.md). Be conservative: only dismiss pairs you are confident are unrelated. A wrongly auto-dismissed pair is hidden from all future runs and requires manually editing Wiki/.state.json to recover.

Semantic candidates are pairs identified by conceptual overlap — synonyms, one being a strict subset of the other, or articles that would naturally be merged — without necessarily sharing sources. Perform this pass by running:

bash
node {KNOWLEDGE_PATH}/scripts/wiki/wiki-index.mjs read-concepts > /tmp/wiki-concepts.md

Then read /tmp/wiki-concepts.md in full using the Read tool, using offset/limit to page through it if the file exceeds the Read tool's line limit. Do not pipe through head or any other truncating command — the concept list may be thousands of lines, and truncating it means missing potential duplicate pairs. Use your judgment to identify semantically overlapping pairs from the complete list. Tag each as detection: "semantic". Pairs found by both structural and semantic methods are tagged detection: "structural+semantic". Skip the LLM pre-filter for semantic candidates — they were already identified by LLM judgment.

If no candidates remain, print No duplicate candidates found. and stop.

3. Present and resolve each candidate

Process one candidate at a time. Use a separate interaction for each pair — never combine multiple pairs into a single question, even if you intend to recommend the same action for several in a row.

For each remaining candidate pair, work through the following sub-steps in order.


3a. Summarize the pair

Read both concept files. Present a brief summary as a markdown table (not in a code block) so it renders:


Candidate pair (shared sources: {N}, detection: {structural | semantic | structural+semantic})

ConceptDescription
{Display Name A}{one-sentence description}
{Display Name B}{one-sentence description}

Before asking, determine which concept should be the primary by applying these factors in order:

  1. Semantic scope (primary factor): the broader or more general concept is the primary; the narrower or more specific concept merges into it
  2. Prose depth: if scope is similar, more paragraphs → likely primary
  3. Source count: if prose is similar, more sources → likely primary

Ask the user what to do using exactly four options as follows.

Always include both merge directions. Never drop one because you think it is obviously wrong — the user makes that call.

Never add "(Recommended)" to Dismiss or Skip — not in the label, not in the description, not anywhere. These options are always neutral.

If a clear primary can be determined, put (Recommended) after the recommended merge option and place it first:

#OptionDescription
1Merge {Secondary} → {Primary} (Recommended){Secondary} is deleted; its content is merged into {Primary}
2Merge {Primary} → {Secondary}{Primary} is deleted; reverse direction
3DismissThey are distinct; never show this pair again
4SkipLeave for now; show again next run

If no clear primary can be determined (both concepts are similarly scoped, similarly long, and have similar source counts), state this explicitly. Do not add (Recommended) to any option:

#OptionDescription
1Merge {Display Name A} → {Display Name B}{A} is deleted; its content is merged into {B}
2Merge {Display Name B} → {Display Name A}{B} is deleted; its content is merged into {A}
3DismissThey are distinct; never show this pair again
4SkipLeave for now; show again next run

When using an interactive question/options tool, keep the question text short: "What would you like to do with this candidate pair?" Do not cram the summary, reasoning, or option details into one long question line.

The user must still be able to see the full decision context while choosing: the candidate summary, recommendation reasoning, all four options, and the stop instruction. This context may be in the tool's body/details area, or in an immediately preceding assistant message if that message remains expanded and visible while the dialog is open. If the available question tool cannot keep that context visible together with the options, do not use it for this prompt. Instead, render the summary, reasoning, numbered options, and reply instructions as one normal markdown message, then wait for the user's reply. Accept 1, 2, 3, or 4 (or "stop" to halt all remaining pairs).

Show full SKILL.md (389 more words)Show less
3c. If a Merge option was selected

State the direction explicitly before executing:

Primary: {Display Name} ({primary-path}) Secondary: {Display Name} ({secondary-path}) — will be merged in and deleted

Then execute:

  1. Integrate prose: Add any information from the secondary's body not already covered in the primary — extend existing paragraphs or add new ones. Write in the primary's established voice and style, using American English spelling (e.g. "organize" not "organise", "recognize" not "recognise"). Convert any British spellings from the secondary's text before integrating.

  2. Merge tags: Take the union of the tags arrays from both concepts' frontmatter. Preserve the primary's existing tag order, then append any tags from the secondary that are not already present. If either concept's frontmatter omits the tags field entirely, treat it as an empty array. Use this combined list as the primary's new tags value.

  3. Write the primary file back to disk with the integrated prose from step 1 and the merged tags from step 2 — Sources and Connected Concepts will be handled by the scripts below.

  4. Merge Sources: For each ## Sources entry in the secondary, extract the summary path (the content between [[ and ]]) and run:

    bash
    node {KNOWLEDGE_PATH}/scripts/wiki/wiki-concept.mjs insert-source "{primary-slug}" "{summary-path}"

    The command is idempotent — entries already in the primary are skipped automatically.

  5. Merge Connected Concepts: For each ## Connected Concepts entry in the secondary, extract the linked slug and display name (from [[Wiki/Concepts/{slug}|{Display Name}]]), then run:

    bash
    node {KNOWLEDGE_PATH}/scripts/wiki/wiki-concept.mjs insert-connected-concept "{primary-slug}" "{linked-slug}" "{Display Name}"

    The command is idempotent — entries already in the primary are skipped automatically.

  6. Update backlinks: Run:

    bash
    node {KNOWLEDGE_PATH}/scripts/wiki/wiki-backlinks.mjs update-after-merge {secondary-path} {primary-path} "{primary display name}"

    This finds every wiki file that links to the secondary concept and handles each one correctly: if the file already has a link to the primary, it removes the secondary link line to avoid creating a duplicate; otherwise it replaces the secondary wikilink with the primary.

  7. Delete the secondary file:

    bash
    rm {KNOWLEDGE_PATH}/{secondary-path}
  8. Update the index: Run:

    bash
    node {KNOWLEDGE_PATH}/scripts/wiki/wiki-index.mjs delete-concept "{secondary-slug}"

    If the primary's one-line description has changed meaningfully, also run:

    bash
    node {KNOWLEDGE_PATH}/scripts/wiki/wiki-index.mjs upsert-concept "{primary-slug}" "{primary display name}" "{updated one-line description}"
3d. If Dismiss

Call:

bash
node {KNOWLEDGE_PATH}/scripts/wiki/wiki-state.mjs dismiss-pair knowledge-wiki-merge {pathA} {pathB}

Continue to the next candidate.

3e. If Skip

Continue to the next candidate without recording anything.

3f. If "stop" (typed in Other field)

Exit the loop immediately. Proceed to step 4.


4. Print summary
Knowledge Wiki Merge

Auto-dismissed {N} pair(s) (clearly unrelated):
  - {Display Name A} / {Display Name B}

Merged {N} pair(s):
  - {Secondary Display Name} → {Primary Display Name}

Dismissed {N} pair(s):
  - {Display Name A} / {Display Name B}

Skipped {N} pair(s).
[Omit any section with 0 items.]

© CatChen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/knowledge-wiki-merge of CatChen/knowledge-wiki-template.

Open the folder on GitHubat commit 77b9be8

Compare with similar skills

Knowledge Wiki Merge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Knowledge Wiki Merge compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Knowledge Wiki Merge this skillCatChen/knowledge-wiki-template106—~2.6kAutomated safety check: PassMIT
Baoyu URL To Markdownsdyckjq-lab/llm-wiki-skill2.5k3 repos~3.2kAutomated safety check: PassNone
Logseq Review Workflow Evallogseq/logseq45k—~1kAutomated safety check: PassAGPL-3.0
Obsidian CLIAtmosphere/atmosphere3.8k13 repos~795Automated safety check: PassApache-2.0
Esm Cjs Risk Scanlogseq/logseq45k—~3.3kAutomated safety check: PassAGPL-3.0
Capture Conversationoutline/outline41k—~474Automated safety check: PassCustom licence

Similar skills

  • Baoyu URL To Markdown

    sdyckjq-lab/llm-wiki-skill

    Fetch any URL and convert to markdown using Chrome CDP. An agent skill from sdyckjq-lab/llm-wiki-skill.

    2.5k GitHub starsUsed in 3 repos~3.2k tokens
    Knowledge ManagementAuto-check passed
  • Compare two revisions of the Logseq logseq-review-workflow skill by running the same review prompt against isolated before and after skill snapshots, collecting both outputs, and producing a…

    45k GitHub stars~1k tokensUpdated yesterday
    Knowledge ManagementAuto-check passed
  • Obsidian CLI

    Atmosphere/atmosphere

    Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more.

    3.8k GitHub starsUsed in 13 repos~795 tokens
    Knowledge ManagementAuto-check passed
  • Esm Cjs Risk Scan

    logseq/logseq

    Scan Logseq ClojureScript Node/Electron targets for npm module loading risks, especially ESM-only packages that may fail when loaded through js/require or shadow-cljs require-based shims.

    45k GitHub stars~3.3k tokensUpdated yesterday
    Knowledge ManagementAuto-check passed
  • Capture Conversation

    outline/outline

    Save the current conversation, a decision, or a set of notes as a document in an Outline collection; use when the user wants to keep what was discussed in their knowledge base.

    41k GitHub stars~474 tokensUpdated yesterday
    Knowledge ManagementAuto-check passed
  • Karpathy LLM Wiki

    Astro-Han/karpathy-llm-wiki

    A skill your agent uses when building or maintaining a personal LLM-powered knowledge base.

    2.4k GitHub stars~3.6k tokensUpdated 2 mo ago
    Knowledge ManagementAuto-check passed

More from CatChen/knowledge-wiki-template

  • Knowledge Wiki Concept

    CatChen/knowledge-wiki-template

    Create or update wiki concept files from knowledge base summaries.

    106 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Knowledge Wiki Summary

    CatChen/knowledge-wiki-template

    Generate or refresh wiki summaries for knowledge base markdown files.

    106 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Knowledge Wiki Synthesis

    CatChen/knowledge-wiki-template

    Scan the wiki for cross-cutting connections, implicit relationships, contradictions, and gaps across concepts and summaries, then write synthesis concept files.

    106 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • Knowledge Wiki Cluster

    CatChen/knowledge-wiki-template

    Find groups of concepts that share an implied parent slug and handle them: if the parent does not exist, create it; if it already exists, link unconnected children to it.

    106 GitHub stars~5k tokensUpdated 3 mo ago
    Auto-check passed
  • Knowledge Wiki Enrich

    CatChen/knowledge-wiki-template

    Expand thin concept articles in the knowledge wiki using web search.

    106 GitHub stars~636 tokensUpdated 3 mo ago
    Auto-check passed
  • Knowledge Wiki Lint

    CatChen/knowledge-wiki-template

    Audit and repair the knowledge wiki. An agent skill from CatChen/knowledge-wiki-template.

    106 GitHub stars~3.5k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Knowledge Wiki Merge

What does Knowledge Wiki Merge do?

Interactively find and merge duplicate concept files in the knowledge wiki. Knowledge Wiki Merge is an agent skill from CatChen/knowledge-wiki-template. Interactively find and merge duplicate concept files in the knowledge wiki.

When should I use Knowledge Wiki Merge?

Knowledge Wiki Merge fits situations like: knowledge Management work in your project.

How do I install Knowledge Wiki Merge in Claude Code?

Run `npx skills add CatChen/knowledge-wiki-template --skill knowledge-wiki-merge -a claude-code`. Or copy the skill folder (.claude/skills/knowledge-wiki-merge in CatChen/knowledge-wiki-template) into .claude/skills/knowledge-wiki-merge in your project. Claude Code loads it when a task matches its description.

How do I install Knowledge Wiki Merge in Codex?

Run `npx skills add CatChen/knowledge-wiki-template --skill knowledge-wiki-merge -a codex`. Or copy the skill folder (.claude/skills/knowledge-wiki-merge in CatChen/knowledge-wiki-template) into .agents/skills/knowledge-wiki-merge in your project. Codex loads it when a task matches its description.

Can I use Knowledge Wiki Merge in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add CatChen/knowledge-wiki-template --skill knowledge-wiki-merge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/knowledge-wiki-merge, .gemini/skills/knowledge-wiki-merge, .github/skills/knowledge-wiki-merge and .opencode/skills/knowledge-wiki-merge in your project.

What does Knowledge Wiki Merge need to run?

Going by SKILL.md and its folder, Knowledge Wiki Merge needs the command-line tools its instructions call (node and git).

Does Knowledge Wiki Merge access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Knowledge Wiki Merge safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Knowledge Wiki Merge use?

Knowledge Wiki Merge is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Knowledge Wiki Merge use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Knowledge Wiki Merge?

Skills that share tags, products or a category with Knowledge Wiki Merge: Baoyu URL To Markdown (sdyckjq-lab/llm-wiki-skill, 2.5k stars), Logseq Review Workflow Eval (logseq/logseq, 45k stars), Obsidian CLI (Atmosphere/atmosphere, 3.8k stars) and Esm Cjs Risk Scan (logseq/logseq, 45k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Knowledge Wiki Merge?

CatChen (a GitHub user) maintains it in CatChen/knowledge-wiki-template, which has 106 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on June 24, 2026.

Source: CatChen/knowledge-wiki-template on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.