agentleFS
butchokoy25butchokoy25/lightrag-claude-skills/skills/rag-setup-project/SKILL.md

rag-setup-project

Skill2 starsChanged 7 months agoMITView on GitHub

Set up LightRAG persistent memory for a Cursor project with MCP configuration

  • Reads credentials
  • Sends data out

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If .cursor/mcp.json does NOT exist:

    line 26
  2. Very specific:

    If .cursor/mcp.json already exists, merge:

    line 49
  3. Distinctive:

    If the user wants to seed the project graph with existing docs:

    line 88
  4. Very specific:

    Use /rag-project-query to query project memory

    line 123
  5. Very specific:

    Use /rag-project-remember to store project-specific knowledge

    line 124
  6. Very specific:

    Use /rag-project-sync at end of session to persist learnings

    line 125

≈ “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

RAG Setup Project — Configure LightRAG for a Cursor Project

Set up a project-level LightRAG knowledge graph instance for the current Cursor project. Creates the MCP configuration so Claude Code can query and store project-specific memory.

What this does

  1. Creates .cursor/mcp.json in the project root with the LightRAG MCP server entry
  2. Merges with existing MCP config if other servers are already configured
  3. Optionally seeds the graph with project context (README, package.json, architecture docs)

Setup steps

1. Create or merge MCP config

If .cursor/mcp.json does NOT exist:

node -e "
const fs = require('fs');
const config = {
  mcpServers: {
    'lightrag-projects': {
      command: 'npx',
      args: ['-y', 'lightrag-mcp@latest'],
      env: {
        LIGHTRAG_URL: 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT',
        LIGHTRAG_API_KEY: process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY'
      }
    }
  }
};
fs.mkdirSync('.cursor', { recursive: true });
fs.writeFileSync('.cursor/mcp.json', JSON.stringify(config, null, 2));
console.log('Created .cursor/mcp.json');
"

If .cursor/mcp.json already exists, merge:

node -e "
const fs = require('fs');
const existing = JSON.parse(fs.readFileSync('.cursor/mcp.json', 'utf-8'));
existing.mcpServers = existing.mcpServers || {};
existing.mcpServers['lightrag-projects'] = {
  command: 'npx',
  args: ['-y', 'lightrag-mcp@latest'],
  env: {
    LIGHTRAG_URL: 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT',
    LIGHTRAG_API_KEY: process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY'
  }
};
fs.writeFileSync('.cursor/mcp.json', JSON.stringify(existing, null, 2));
console.log('Merged lightrag-projects into existing .cursor/mcp.json');
"

2. Update .gitignore

Suggest adding .cursor/ to .gitignore if not already present:

node -e "
const fs = require('fs');
const gitignore = fs.existsSync('.gitignore') ? fs.readFileSync('.gitignore', 'utf-8') : '';
if (!gitignore.includes('.cursor')) {
  fs.appendFileSync('.gitignore', '\n# Cursor IDE config\n.cursor/\n');
  console.log('Added .cursor/ to .gitignore');
} else {
  console.log('.cursor/ already in .gitignore');
}
"

3. Optionally seed the graph

If the user wants to seed the project graph with existing docs:

node -e "
const fs = require('fs');
const BASE = 'http://YOUR_LIGHTRAG_HOST:YOUR_PROJECT_PORT';
const API_KEY = process.env.LIGHTRAG_API_KEY || 'YOUR_API_KEY';

const files = ['README.md', 'package.json', 'ARCHITECTURE.md', 'CLAUDE.md']
  .filter(f => fs.existsSync(f));

(async () => {
  for (const file of files) {
    const text = fs.readFileSync(file, 'utf-8');
    await fetch(BASE + '/documents/text', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': API_KEY
      },
      body: JSON.stringify({
        file_source: '[SEED] ' + file + ' — project bootstrap',
        text: text.slice(0, 10000)
      })
    });
    console.log('Seeded:', file);
  }
  console.log('Done. Seeded ' + files.length + ' files.');
})();
"

After setup

  • Restart Claude Code to pick up the new MCP config
  • Use /rag-project-query to query project memory
  • Use /rag-project-remember to store project-specific knowledge
  • Use /rag-project-sync at end of session to persist learnings

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.