db-health
Skill5 starsChanged 6 months agoApache-2.0View on GitHub
Quick database health audit: integrity, MemPalace tiers, FTS sync, backlog, failure patterns
2 other projects use a version of this.
Adopted by
Most recently taken up by
- shim369/Python-Smart-Health-Intelligence-Platformtheir own version, first seen Sep 23, 2026
- 3akat-system/nexus-startertheir own version, first seen May 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- 3akat-system/nexus-starter★ 0same name
- shim369/Python-Smart-Health-Intelligence-Platform★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- dreamSkill
- forum-pulseSkill
- genesisSkill
- grill-meSkill
- handoffSkill
- hireSkill
- inbox-processSkill
- kaizenSkill
- quality-gateSkill
- quarterly-reviewSkill
- session-endSkill
- session-startSkill
- sync-upstreamSkill
- twin-updateSkill
- voice-gateSkill
- weekly-reviewSkill
- write-a-skillSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run all checks and produce a summary report.
- Very specific: line 63
If you also run a vector index, check it in the same breath — the AFTER DELETE trigger keeps the FTS index honest but nothing keeps a …
- Very specific: line 76
If you query the description column with json_extract, filter on json_valid(description) = 1 first — early rows tend to hold plain text, …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.
Files
Database Health Audit
Run all checks and produce a summary report.
The checks below run against the MemPalace schema (drawers and friends). If your
install still carries the older knowledge_entries layer, migrate first — do not
audit both, because two answers to "how many memories are there" is worse than one
wrong answer.
Check 1 — Integrity
PRAGMA integrity_check;
PRAGMA foreign_key_check;Check 2 — MemPalace stats
SELECT
(SELECT COUNT(*) FROM drawers) AS drawers_total,
(SELECT COUNT(*) FROM drawers WHERE tier = 'hot') AS hot,
(SELECT COUNT(*) FROM drawers WHERE tier = 'warm') AS warm,
(SELECT COUNT(*) FROM drawers WHERE tier = 'cold') AS cold,
(SELECT COUNT(DISTINCT wing) FROM drawers) AS wings,
(SELECT COUNT(DISTINCT room) FROM drawers) AS rooms,
(SELECT COUNT(*) FROM kg_triples WHERE valid_to IS NULL) AS active_kg_facts,
(SELECT COUNT(*) FROM diary_entries) AS diary_entries;Check 3 — Tier distribution
python3 scripts/memory_tiers.py --reportNon-destructive, safe to run any time. Flag if the hot tier grows out of proportion (more than ~10% of the total): everything hot is loaded on every session, so hot-tier growth is a direct tax on every conversation.
Check 4 — FTS index sync
SELECT
(SELECT COUNT(*) FROM drawers_fts) AS fts_indexed,
(SELECT COUNT(*) FROM drawers) AS drawers_rows;The two should match. On drift, rebuild:
INSERT INTO drawers_fts(drawers_fts) VALUES('rebuild');
INSERT INTO drawers_fts(drawers_fts, rank) VALUES('integrity-check', 1);If you also run a vector index, check it in the same breath — the AFTER DELETE
trigger keeps the FTS index honest but nothing keeps a vector table in sync
automatically.
Check 5 — Task backlog
SELECT
(SELECT COUNT(*) FROM tasks WHERE status='pending') AS pending_tasks,
(SELECT COUNT(*) FROM tasks WHERE status='pending' AND title LIKE '[Kaizen]%') AS kaizen_backlog,
(SELECT COUNT(*) FROM tasks WHERE status='in_progress' AND updated_at < datetime('now','-7 days')) AS stale_in_progress;If you query the description column with json_extract, filter on
json_valid(description) = 1 first — early rows tend to hold plain text, and
json_extract returns NULL for those without complaining.
Check 6 — Knowledge graph health
SELECT
(SELECT COUNT(*) FROM kg_triples WHERE valid_to IS NULL) AS active_facts,
(SELECT COUNT(*) FROM kg_entities) AS entities;Check 7 — Agent failure patterns (24h)
SELECT json_extract(metadata, '$.agent') AS agent,
COUNT(*) AS failures
FROM activity_history
WHERE action = 'agent_failure'
AND occurred_at > datetime('now', '-24 hours')
GROUP BY agent
HAVING COUNT(*) >= 2;Check 8 — Cost telemetry
-- Recent rows with no computed cost: either the model is missing from
-- model_pricing, or the logging path is broken.
SELECT model, COUNT(*) AS rows_no_cost
FROM llm_calls
WHERE (cost_usd IS NULL OR cost_usd = 0)
AND created_at > datetime('now', '-7 days')
GROUP BY model;Any model appearing here with real volume needs a row in model_pricing.
Check 9 — Procedural memory
SELECT COUNT(*) AS total_patterns,
SUM(CASE WHEN success_rate >= 0.8 AND success_count >= 3 THEN 1 ELSE 0 END) AS reliable,
SUM(CASE WHEN success_count <= 1 THEN 1 ELSE 0 END) AS never_reused,
SUM(CASE WHEN dedup_key IS NULL THEN 1 ELSE 0 END) AS unreachable_orphans
FROM procedural_memory;never_reused staying high while patterns keep being added means the capture side
works and the increment side does not. unreachable_orphans counts rows that
proc-record can never match again — every one of those is a pattern that can
never be promoted.
Scoring
Start at 100. Deduct:
- -20:
integrity_checkfails - -10:
foreign_key_checkfails - -10: FTS out of sync with
drawers - -10: kaizen backlog over 30 pending (triage is behind)
- -5: stale
in_progresstasks (older than 7 days) - -5 per agent with 2+ failures in 24h
- -5: models with recent volume missing from
model_pricing
Report format
DB Health Score: XX/100
- Integrity: OK/FAIL
- Drawers: N (hot/warm/cold: N/N/N)
- FTS sync: OK/MISMATCH
- Backlog: N pending (N kaizen)
- KG: N active facts
- Agent failures (24h): N agents flagged
- Cost telemetry: OK / N models unpriced
- Procedural memory: N patterns (N reliable, N never reused, N orphans)Flag to the user only if the score is below 80.
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
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.

