Install
openclaw skills install ghost-catalogScan, tag, validate, and catalog files using the Ghost Catalog semantic file header system (SOM-XXX-NNNN-vX.X.X). Use when: discovering untagged files, onboa...
openclaw skills install ghost-catalogManage semantic file headers and maintain the Ghost Catalog database for any workspace.
Every cataloged file gets a semantic header in the first 20 lines:
# file_id: SOM-XXX-NNNN-vX.X.X
# name: filename.ext
# description: What this file does
# project_id: PROJECT-NAME
# category: script | doc | config | schema | component | test | data | style
# tags: [tag1, tag2, tag3]
# created: YYYY-MM-DD
# modified: YYYY-MM-DD
# version: X.X.X
# agent_id: AGENT-DROID-001
Comment style adapts to file type:
# prefix// prefix inside /* ... */ block<!-- ... --> block<!-- ... --> HTML comment block/* ... */ block-- prefixSOM-XXX-NNNN-vX.X.X| Segment | Meaning | Examples |
|---|---|---|
SOM | Somacosf namespace (constant) | SOM |
XXX | 3-letter category code | SCR (script), DOC (doc), CFG (config), SCH (schema), CMP (component), TST (test), DAT (data), STY (style), LIB (library), API (api route), UTL (utility), HKS (hooks) |
NNNN | 4-digit sequential number | 0001, 0042, 0338 |
vX.X.X | Semantic version | v1.0.0, v2.1.3 |
| Code | Category | File Types |
|---|---|---|
SCR | Script | .py, .sh, .ps1, .bat |
DOC | Document | .md, .txt, .rst |
CFG | Config | .json, .yaml, .yml, .toml, .env, .ini |
SCH | Schema | .prisma, .graphql, .sql |
CMP | Component | .tsx, .jsx, .vue, .svelte |
TST | Test | *.test.*, *.spec.* |
DAT | Data | .csv, .json (data files), .db |
STY | Style | .css, .scss, .less |
LIB | Library | .ts, .js (lib modules) |
API | API Route | route.ts, route.js (Next.js API routes) |
UTL | Utility | Helper/utility modules |
HKS | Hooks | React hooks, git hooks |
The catalog lives at data/ghost-catalog.db (SQLite). Schema:
CREATE TABLE IF NOT EXISTS file_catalog (
file_id TEXT PRIMARY KEY,
name TEXT NOT NULL,
description TEXT,
path TEXT NOT NULL,
project_id TEXT,
category TEXT,
version TEXT,
created TEXT,
modified TEXT,
agent_id TEXT,
execution TEXT,
checksum TEXT,
last_synced TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS file_tags (
file_id TEXT,
tag TEXT,
PRIMARY KEY (file_id, tag),
FOREIGN KEY (file_id) REFERENCES file_catalog(file_id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS agent_registry (
id TEXT PRIMARY KEY,
name TEXT,
model TEXT,
first_seen TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
last_active TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_category ON file_catalog(category);
CREATE INDEX IF NOT EXISTS idx_project ON file_catalog(project_id);
CREATE INDEX IF NOT EXISTS idx_agent ON file_catalog(agent_id);
CREATE INDEX IF NOT EXISTS idx_tags ON file_tags(tag);
When the user invokes /ghost-catalog, determine which operation to perform based on their request. Default to scan if no specific command is given.
scan (default)Scan the workspace for all source files. For each file:
file_id: SOM- in first 20 lines)Output a summary table:
Scanned: 150 files
Tagged: 42 files (28%)
Untagged: 108 files
Errors: 0
Ignore system (layered, merged at scan time):
.ghost_ignore (primary) -- Ghost Catalog's own ignore file, lives at project root. Follows .gitignore syntax. This is the canonical source of what to skip..gitignore (inherited) -- automatically merged; anything git ignores, Ghost Catalog ignores too..git/, node_modules/, .next/, .vercel/, __pycache__/, .venv/, dist/, build/, .factory/When scanning, parse .ghost_ignore and .gitignore into a combined exclusion set. Only scan files that survive both filters. The goal: catalog project files only -- no dependencies, no build artifacts, no binaries, no secrets, no lock files.
tag <path|pattern>Apply a Ghost Catalog header to one or more files:
When tagging multiple files, show a preview table first and ask for confirmation before applying.
validateCheck all tagged files for header compliance:
file_id, name, description, category, version, created, modifiedSOM-XXX-NNNN-vX.X.XOutput a validation report with pass/warn/fail for each file.
search <query>Search the catalog by any field:
search proxy - fuzzy match on name/descriptionsearch --category script - filter by categorysearch --tag opentelemetry - filter by tagsearch --agent AGENT-CLAUDE-002 - filter by agentDisplay results as a formatted table with file_id, name, category, and path.
info <file_id>Show detailed metadata for a specific file from the catalog DB.
statsShow catalog statistics:
reportGenerate a full compliance report in markdown format, saved to docs/ghost-catalog-report.md.
sqlite3 stdlib for database operationsdata/ghost-catalog.db if it doesn't existAGENT-DROID-001 as the agent_id when this skill applies headersv1.0.0 for new filesmodified date is always today's date when applying or updating headerscreated date is preserved if already set, otherwise today's dateAfter any write operation (tag, validate --fix), re-read the modified files to confirm headers were applied correctly. Report any failures.
This skill should be considered when: