agentleFS
markmhendricksonmarkmhendrickson/neotoma/.claude/skills/recover_sqlite_database/SKILL.md

recover_sqlite_database

Skill38 starsChanged 2 months agoMITView on GitHub

Recover Neotoma SQLite Database

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Prefer NEOTOMA_DATA_DIR outside iCloud-synced folders (e.g.

    line 40
  2. Very specific:

    Run --recover while Neotoma still holds the database open.

    line 44

≈ “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
<!-- Source: .cursor/skills/recover-sqlite-database/SKILL.md -->

Recover Neotoma SQLite Database

When to use

Neotoma errors such as database disk image is malformed, failed PRAGMA integrity_check, or btreeInitPage / SQLITE_CORRUPT on the local SQLite file (neotoma.db or neotoma.prod.db under NEOTOMA_DATA_DIR).

Preconditions

  • sqlite3 CLI on PATH (macOS usually has it).
  • Stop Neotoma (MCP stdio processes, neotoma api, anything using the DB) before --recover or before swapping files.

Script (primary)

From the Neotoma repo root:

# Check only (exit 0 = ok, 2 = corrupt)
node scripts/recover_sqlite_database.js
node scripts/recover_sqlite_database.js --env production

# Write recovered copy (does not replace live DB)
node scripts/recover_sqlite_database.js --env production --recover

Or: npm run recover:db and npm run recover:db:prod -- --recover (see package.json).

Output is a sibling file like neotoma.prod.recovered-<timestamp>.db. Verify it reports PRAGMA integrity_check: ok, then manually archive the live .db/-wal/-shm and cp the recovered file to the live name.

After swap

  • Inspect lost_and_found in the recovered file if present; re-ingest important rows via POST /store / MCP store using normal schemas (see prior recovery notes: note, issue, etc.).
  • Prefer NEOTOMA_DATA_DIR outside iCloud-synced folders (e.g. not only under ~/Documents if Documents syncs) to reduce recurrence.

Do not

  • Run --recover while Neotoma still holds the database open.
  • Auto-delete the corrupt file until a good recovered copy is verified and backed up.

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.