agentleFS
JacobinwweyJacobinwwey/notemdpro/skills/link-analyzer/SKILL.md

link-analyzer

Skill2 starsChanged 38 days agoMITView on GitHub

Use when markdown notes need automatic wiki-link insertion for core concepts to build an interconnected knowledge graph

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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
  1. Distinctive:

    Build knowledge graph: Create interconnected notes for better navigation

    line 15
  2. Distinctive:

    After LLM processing, the following fixes are automatically applied:

    line 159
  3. Very specific:

    Boxed content removal: Remove \boxed{ wrappers

    line 163

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

NoteMD Pro - Add Wiki-Links

Overview

This feature processes markdown files to add wiki-links ([[concept]]) between related concepts using an LLM. It analyzes the content and identifies core knowledge points, then adds appropriate backlinks.

When to Use

  • Organize notes: Connect related concepts in your vault
  • Build knowledge graph: Create interconnected notes for better navigation
  • Enhance linking: Automatically add links that might be missed manually

Function Call Chain

processFile (fileUtils.ts)
├── read_file(inputPath)
├── splitContent(content, settings)
├── getProviderForTask('addLinks', settings)
├── call[Provider]API(prompt, chunk)
├── createConceptNotes(settings, concepts, filename)
│   ├── normalizeNameForFilePath(concept)
│   └── write_file(notePath, content)
├── handleDuplicates(content, settings)
├── cleanupLatexDelimiters(content)
├── refineMermaidBlocks(content)  ← AUTO-FIX
└── saveOrMoveProcessedFile(settings, inputPath, content)
    └── write_file(outputPath, content)

Key Functions (from fileUtils.ts)

processFile

Processes a single file: reads content, calls LLM, adds links, applies fixes, and saves.

export async function processFile(
  settings: NotemdSettings,
  inputPath: string,
  progressReporter: ProgressReporter,
  currentProcessingFileBasename: { value: string | null },
);

splitContent

Splits content into chunks based on word count for LLM processing.

export function splitContent(
  content: string,
  settings: NotemdSettings,
): string[];
// Returns: Array of content chunks

saveOrMoveProcessedFile

Handles saving or moving the processed file based on settings.

async function saveOrMoveProcessedFile(
  settings: NotemdSettings,
  inputPath: string,
  processedContent: string,
  progressReporter: ProgressReporter,
);

Settings

Core Settings

SettingDescription
chunkWordCountWords per chunk (default: 2000)
maxTokensMax tokens for LLM response
moveOriginalFileOnProcessMove original file after processing

Output Settings

SettingDescription
useCustomProcessedFileFolderUse custom output folder
processedFileFolderCustom output folder path
useCustomAddLinksSuffixUse custom filename suffix
addLinksCustomSuffixCustom suffix (e.g., "_linked")

Mermaid/LaTeX Settings

SettingDescription
removeCodeFencesOnAddLinksRemove code fences after processing
autoMermaidFixAfterGenerateAuto-fix Mermaid syntax

Duplicate Detection

SettingDescription
enableDuplicateDetectionEnable duplicate word detection

Prompt Template (addLinks)

From promptUtils.ts:

Completely decompose and structure the knowledge points in this markdown document,
outputting them in markdown format supported by Obsidian. Core knowledge points
should be labelled with Obsidian's backlink format [[]]. Do not output anything
other than the original text and the requested "Obsidian's backlink format [[]]".

Rules:
1. Only add Obsidian backlinks [[like this]] to core concepts. Do not modify the
   original text content or formatting otherwise.
2. Skip conventional names (common products, company names, dates, times, individual
   names) unless they represent a core technical or scientific concept within the
   text's context.
3. Output the *entire* original content of the chunk, preserving all formatting
   (headers, lists, code blocks, etc.), with only the added backlinks.
4. Handle duplicate concepts carefully:
   a. If both singular and plural forms of a word/concept appear (e.g., "model" and
      "models"), only add the backlink to the *first occurrence* of the *singular* form.
   b. If a single-word concept also appears as part of a multi-word concept, only
      add the backlink to the multi-word concept.
   c. Do not add duplicate backlinks for the exact same concept within this chunk.
5. Ignore any "References", "Bibliography", or similar sections.

Error Handling

Common Errors

  1. No valid LLM provider
    • Error: "No valid LLM provider configured for 'Add Links' task"
    • Solution: Configure a provider in settings
  2. API rate limiting
    • Error: Rate limit exceeded
    • Solution: Adjust apiCallInterval in settings
  3. File permission errors
    • Error: Cannot modify/create file
    • Solution: Check folder permissions

Cancellation

  • User can cancel processing via progress reporter
  • Already processed chunks are preserved
  • Progress saved in log

Auto-fix Integration

After LLM processing, the following fixes are automatically applied:

  1. cleanupLatexDelimiters: Fix LaTeX math delimiters
  2. refineMermaidBlocks: Fix Mermaid diagram syntax
  3. Boxed content removal: Remove \boxed{ wrappers

See mermaid-healer for full Mermaid fixing code.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.