agentleFS
issue-orchestratorissue-orchestrator/issue-orchestrator/.claude/skills/sqlite-ops/SKILL.md

sqlite-ops

Skill10 starsChanged 2 months agoApache-2.0View on GitHub

SQLite usage, backup/care, WAL mode, and corruption handling in issue-orchestrator. Use when answering questions about SQLite configuration, persistence, backup/recovery, or when modifying sqlite3 usage in this repo.

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 DB may be open: use VACUUM INTO or sqlite3 .backup (avoid raw file copy).

    line 18
  2. Very specific:

    If DB can be closed: stop app, then copy the DB file (and -wal/-shm if WAL) or still use VACUUM INTO for a clean snapshot.

    line 19
  3. Very specific:

    Run PRAGMA quick_check on startup.

    line 25
  4. Distinctive:

    Stop orchestrator, replace DB file with backup, restart.

    line 29
  5. Very specific:

    Add new persistent SQLite DBs to sqlite_registry.py so doctor checks, startup pragmas, and backups can see them.

    line 34
  6. Very specific:

    Use references/issue-orchestrator-sqlite.md for DB locations, connection settings, and current corruption handling.

    line 43

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

Sqlite Ops

Overview

Locate SQLite usage in issue-orchestrator and provide practical, low-maintenance backup and corruption-handling guidance tailored to the repo's databases.

Workflow

  1. Identify which SQLite DB(s) are in scope.
    • Load references/issue-orchestrator-sqlite.md for paths and owners.
  2. Confirm the runtime context (local desktop vs server, DB size, write frequency, WAL or not).
  3. Recommend a safe backup method:
    • If DB may be open: use VACUUM INTO or sqlite3 .backup (avoid raw file copy).
    • If DB can be closed: stop app, then copy the DB file (and -wal/-shm if WAL) or still use VACUUM INTO for a clean snapshot.
  4. Suggest durability settings:
    • Repo code should normally use infra/sqlite_connection.py::open_sqlite().
    • The shared helper applies foreign keys, busy timeout, WAL mode, and PRAGMA synchronous=FULL.
    • Periodic checkpoints may still be needed if WAL files grow unexpectedly.
  5. Corruption response:
    • Run PRAGMA quick_check on startup.
    • On failure: move DB to *.corrupt, restore latest backup, and surface a clear alert.
  6. Recovery guidance:
    • Identify latest backup in .issue-orchestrator/backups/sqlite/<db_key>/daily/ (or weekly).
    • Stop orchestrator, replace DB file with backup, restart.

Repo Notes

  • Registered DBs are listed in src/issue_orchestrator/infra/sqlite_registry.py.
  • Add new persistent SQLite DBs to sqlite_registry.py so doctor checks, startup pragmas, and backups can see them.
  • Startup maintenance applies WAL/FULL pragmas to existing registered DBs and backs them up when sqlite_backup is enabled.
  • Most runtime DB owners use open_sqlite(); ad hoc sqlite3.connect() usage should be intentional and checked.
  • Subprocess registry includes auto-corruption handling; the other DB owners generally surface exceptions and rely on doctor/backup recovery.

Resources

references/

Use references/issue-orchestrator-sqlite.md for DB locations, connection settings, and current corruption handling.

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.