ghostpaw-grimoire
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ghostpaw-grimoirewhat spells do I have for deploying a service?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@ghostpaw/grimoire
A procedural knowledge engine for Node.js, built on Git, SQLite, and the filesystem.
Grimoire treats spells (learned procedures), evidence, versioning, and health
as one coherent model instead of separate systems. It ships as a single
prebundled blob with zero runtime dependencies, designed for two audiences at
once: human developers working directly in code, and LLM agents operating
through a structured soul / tools / skills runtime.
MCP server
claude mcp add ghostpaw-grimoire -- npx -y @ghostpaw/grimoire mcp
/plugin marketplace add GhostPawJS/grimoire
/plugin install ghostpaw-grimoire@ghostpaw-grimoireCodex CLI (~/.codex/config.toml):
[mcp_servers.ghostpaw-grimoire]
command = "npx"
args = ["-y", "@ghostpaw/grimoire", "mcp"]Cursor, Claude Desktop, or a project .mcp.json:
{"mcpServers":{"ghostpaw-grimoire":{"command":"npx","args":["-y","@ghostpaw/grimoire","mcp"]}}}Download server.mcpb from releases for clients supporting MCP Bundles. Build the supplied Dockerfile with docker build -t ghostpaw-grimoire . and mount /data for persistence.
Supports MCP 2026-07-28 and initialize-based protocol versions (2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05). The database defaults to ~/.ghostpaw/grimoire.db; --db overrides GHOSTPAW_GRIMOIRE_DB. Spells default to ~/.ghostpaw/grimoire/; set GHOSTPAW_GRIMOIRE_ROOT to choose another directory. No credentials are required for local tools.
Related MCP server: AAS Core MCP Server
CLI
npx -y @ghostpaw/grimoire tools
npx -y @ghostpaw/grimoire call drop_note '{"source":"practice","content":"Verify the build before release."}'
npx -y @ghostpaw/grimoire call search_grimoire '{"query":"release"}'Agent Skill: see SKILL.md or install the skills/grimoire directory with its references.
Install
npm install @ghostpaw/grimoireRequires Node.js 24+ (uses the built-in node:sqlite module).
Quick Start
import { DatabaseSync } from 'node:sqlite';
import { init, read, write } from '@ghostpaw/grimoire';
const db = new DatabaseSync(':memory:');
const root = '/path/to/my-grimoire';
// Bootstrap: filesystem + SQLite tables + bare git repo with initial commit
init(root, db);
// Inscribe a new spell (content is a spec-compliant SKILL.md string)
const { spell } = write.inscribe(root, db, {
name: 'deploy-service',
chapter: 'engineering',
content: '---\nname: deploy-service\ndescription: Deploy a service to production\n---\n\n# deploy-service\n\n## Steps\n\n1. Run `npm run build`\n2. Push to registry\n3. Apply manifests\n',
});
// Drop an observation note as evidence
write.dropNote(db, {
source: 'practice',
content: 'Build step fails if DOCKER_REGISTRY is not exported first.',
});
// Seal the improvement into a git commit, advancing rank
write.seal({ root }, db, [`engineering/${spell.name}`], 'Fix: document required env var for build step');
// Read back the enriched spell
const detail = read.getSpell(root, 'engineering/deploy-service', db);
const chapters = read.listChapters(root);The Model
Eight concepts, strict separation of concerns:
Concept | Purpose |
Spell | A learned procedure stored as |
Chapter | A folder grouping related spells into a focused collection |
Seal | A git commit marking a verified improvement — rank equals seal count |
Tier | Mastery level computed from rank: Uncheckpointed → Apprentice → Journeyman → Expert → Master |
Note | Raw evidence (observation, failure path, correction) awaiting distillation into a spell |
Resonance | Read-time signal indicating which spells have the highest return on honing effort |
Draft | A proposed new spell submitted for review before inscription |
Catalogue | A health snapshot: staleness, dormancy, oversizing, velocity, and clustering |
The model means each kind of truth has its own home:
What it looks like | What it actually is |
A how-to guide or runbook | A Spell |
Related spells grouped by domain | A Chapter |
"This procedure is proven — preserve it" | A Seal |
"We got burned by this edge case" | A Note |
"This spell hasn't been touched in months" | A Catalogue health signal |
"This spell is ready to hone next" | Resonance |
State is derived, not hand-toggled. Tier, resonance color, staleness, dormancy, and health scores are computed from evidence and commit history at read time, never stored as caller-written flags.
Tier progression at a glance
Grimoire computes tier markers on every read. They advance as spells accumulate sealed improvements:
Inscription
$\color{Gray}{\textsf{◎}}$
deploy-service
uncheckpointed · no seals yet↓   seal a validated improvement
Honing
$\color{SteelBlue}{\textsf{◎}}$
deploy-service
apprentice · rank 1–4$\color{MediumSeaGreen}{\textsf{◎}}$
deploy-service
journeyman · rank 5–14$\color{Goldenrod}{\textsf{◎}}$
deploy-service
expert · rank 15–29$\color{Orchid}{\textsf{◎}}$
deploy-service
master · rank 30+Attention signals
$\color{OrangeRed}{\textsf{●}}$
deploy-service
resonance · hone now$\color{Gray}{\textsf{●}}$
deploy-service
dormant · low return on effort
Rank is the only experience counter. Tier boundaries gate real capabilities (history, diff, rollback), not badges.
Two Audiences
Human developers
Use the read and write namespaces for direct-code access to the domain:
import { read, write } from '@ghostpaw/grimoire';
// Inscribe and evolve a spell
write.inscribe(root, db, { name: 'lint-fix', chapter: 'general', content: '---\nname: lint-fix\ndescription: Run lint with autofix\n---\n\n# lint-fix\n\nRun `npx biome check --fix .`\n' });
write.dropNote(db, { source: 'practice', content: 'Biome needs --unsafe for some rules.' });
write.seal({ root }, db, ['general/lint-fix'], 'Add note about unsafe flag');
// Read derived state
const spell = read.getSpell(root, 'general/lint-fix', db);
const resonance = read.allResonance(db);
const catalogue = read.readCatalogue(db);See HUMAN.md for the full direct-code guide with worked examples and modeling boundaries.
LLM agents
Use the tools, skills, and soul namespaces for a structured runtime
surface designed to minimize LLM cognitive load:
import { tools, skills, soul } from '@ghostpaw/grimoire';
// 10 intent-shaped tools with JSON Schema inputs and structured results
const allTools = tools.grimoireTools;
const searchTool = tools.getGrimoireToolByName('search_grimoire')!;
const result = await searchTool.handler({ root, db }, { query: 'deploy' });
// Workflow skills for common multi-step scenarios
const allSkills = skills.grimoireSkills;
// Thinking foundation for system prompts
const prompt = soul.renderGrimoireSoulPromptFoundation();Every tool returns a discriminated result with outcome: 'success' | 'no_op' | 'needs_clarification' | 'error', structured entities, next-step hints, and
actionable recovery signals.
See LLM.md for the full AI-facing guide covering soul, tools, and skills.
Tools
Eleven tools shaped around operator intent, not raw storage operations:
Tool | What it does |
| Search spells by name or description |
| Dashboard views: chapters, health, resonance, notes, drafts, validation, provenance |
| Detailed inspection of one spell: tier, resonance, validation, provenance, history |
| Create a new spell in the grimoire |
| Write new content to an existing spell, leaving it uncommitted for |
| Seal pending changes into a git commit, advancing rank; optionally distill absorbed notes |
| Shelve, unshelve, move, delete, repair, or rollback a spell |
| Drop an observation note for later cataloguing |
| Submit, approve, or dismiss proposed spells |
| Full maintenance pass: staleness, dormancy, oversizing, note routing, health |
| Scout, search, adopt, and update spells from external sources |
Each tool exports runtime metadata, JSON Schema inputs, and structured outputs so harnesses can wire them without parsing vague prose.
Key Properties
Zero runtime dependencies. Only
node:sqlite(built into Node 24+) for the SQLite layer.Single prebundled blob. One ESM + one CJS entry in
dist/. No subpath exports, no code splitting.Three storage backends. Filesystem for spell content, git for versioning and rank, SQLite for metadata. Each is optional — the package degrades gracefully without any of them.
Evidence-first progression. Rank is earned by sealing validated improvements. Speculative edits do not count as experience. Tier gates real capabilities, not badges.
Derived health signals. Resonance, staleness, dormancy, and health scores are computed at read time from evidence and commit history — never stored as flags.
Intention-shaped writes.
inscribe,seal,hone,dropNote,distill,adoptSpell: operations that say what happened, not generic CRUD.Additive AI runtime.
soulfor posture,toolsfor actions,skillsfor workflow guidance — layered over the same direct-code API.Colocated tests. Every non-type module has a colocated
.test.tsfile. The documented behavior is backed by executable coverage.
Package Surface
import {
init, // bootstrap: filesystem + SQLite setup
initGrimoireTables, // SQLite schema only
read, // all query functions
write, // all mutation functions
tools, // LLM tool definitions + registry
skills, // LLM workflow skills + registry
soul, // thinking foundation for system prompts
} from '@ghostpaw/grimoire';All domain and runtime types are also available at the root for TypeScript consumers:
import type {
GrimoireDb,
GrimoireToolDefinition,
GrimoireSkill,
GrimoireSoul,
GrimoireErrorCode,
} from '@ghostpaw/grimoire';Documentation
Document | Audience |
Human developers using the low-level | |
Agent builders wiring | |
Architecture overview: model, storage topology, and source layout | |
Per-concept manuals: spells, notes, events, health, drafts, provenance, registry |
Development
npm install
npm test # node:test runner
npm run typecheck # tsc --noEmit
npm run lint # biome check
npm run build # ESM + CJS + declarations via tsup
npm run demo:serve # build and serve the browser demoThe repo is pinned to Node 24.14.0 via .nvmrc / .node-version /
.tool-versions / mise.toml / Volta. Use whichever version manager you
prefer.
Support
If this package helps your project, consider sponsoring its maintenance:
This server cannot be deployed
Maintenance
Related MCP Connectors
Git-backed platform for skills, tools, and context for AI agents
- Skill MeOAuthdev.skillme
Agent skills for Claude, Codex and Cursor: find, install and load skills from one connector.
Search your team's shared AI-skill library, get install commands, and save skills from your agent.
Search, fetch, lint, and install Agent Skills (SKILL.md) from the SkillMD registry.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to dynamically discover and execute tools through a structured skills system. Serves as a documentation hub where skills are defined in directories, allowing progressive loading and interpretation of capabilities.MIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to search, recommend, and validate a stack of reusable skills from a local catalog, producing deterministic plans without modifying the project.5,312 npm1MIT
- AlicenseAqualityDmaintenanceIndexes installed SKILL.md files and provides deterministic search and recommendation tools to help AI agents select relevant skills without executing them.410 npm1MIT
- AlicenseBqualityBmaintenanceEnables read-only access to a local-first catalog of portable agent skills, exposing tools to discover ranked matches, inspect stored artifacts, traverse declared relationships, and view configuration.5MIT