feat(mist): add a daily data digest skill for Mist app databases - #135
Open
AaronIngersoll wants to merge 1 commit into
Open
feat(mist): add a daily data digest skill for Mist app databases#135AaronIngersoll wants to merge 1 commit into
AaronIngersoll wants to merge 1 commit into
Conversation
Mist can already query a Mist app's own database, but nothing turns that into a recurring read on whether the app is healthy. This adds a schema-agnostic skill that discovers the app's tables, trends row volume over rolling 24-hour windows, flags spikes/drops/stalls against a 7-day baseline, and delivers the result as both a chat digest and a saved dashboard that overwrites itself each day. Rolling windows rather than calendar days: a cron firing mid-morning compares a partial "today" against full-day averages and invents a drop every morning. Anomaly rules carry absolute floors (>=2x baseline AND >=5 rows) so 1 -> 3 rows doesn't read as a 200% spike. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
mist/daily-data-digest— a skill that reads a Mist app's own database and reports what changed in the last 24 hours: per-table volume trends, spikes, drops, and stalls. It delivers the result twice, as a written digest in chat and as ashow_dashboarddashboard that overwrites itself each day, so there's always exactly one current view per app.Two files: the skill body and a
manifest.jsonentry alongside the othermist/skills.Why
Mist can already query a Mist app's database (
db_schema/db_queryresolve to the active project's Neon or PGlite side), but nothing turns that capability into a recurring read on whether an app is actually healthy. Answering "is this thing still getting traffic, and did anything break overnight?" means someone remembering to ask. Paired with a recurring schedule fromskill-schedules, this makes that answer arrive on its own — the run's final message becomes the schedule summary and the notification the user reads.How it works
Every Mist app has its own arbitrary schema, so the skill is schema-agnostic:
db_schemaoverview to rank tables, thentablesmode on a shortlist to read real column names and types. It never assumes a table or column exists.Design decisions worth reviewing:
>=2x baselineand>=5 rows. Without the floor, 1 → 3 rows reads as a "200% spike" and the digest becomes noise nobody opens after a week.dashboards.service.ts:221), so the skill mandates an app-specific, date-free title. A date in the title would mint a new dashboard file daily and bury the panel.timestamptzvstimestampis called out explicitly, because comparing the wrong one againstnow()silently slides the window boundaries by the server's timezone offset.human_in_the_loop, never ends a turn waiting for input, since the whole point is the unattended scheduled path.Known limitation
db_queryanddb_schemaresolve against the active project only (tools/index.ts:11968) — there is no cross-app query tool — so one run covers one Mist app, and covering five apps means five daily schedules. The skill says this plainly rather than pretending to sweep. A genuine roll-up would need a target-slug parameter ondb_query; the plumbing already exists, since the discovery service caches every app's connection asmist-db:<slug>:<side>and exposesresolveSide().How to test
python3 -m unittest discover -s scripts -p 'test_*.py'→ 16 tests pass.python3 scripts/validate_catalog.py→catalog validation passed: 42 skills, 6 workflows(was 41 skills). Both were run locally on this branch and pass; they're the same two stepsvalidate-catalog.ymlruns in CI.mist/daily-data-digest/into~/Fluid/skills/, relaunch Mist, open a Mist app project with a provisioned production database, and run the skill. Expect a digest naming real tables with real counts, plus a saved dashboard. Then add a daily recurring schedule captured against that project and confirm the headless run produces the same digest as its run summary.Step 3 has not been run — the skill is unexercised against a live database so far, and that's the review risk worth weighing: the SQL templates and the
show_dashboardcard shapes are derived from the tool contracts and the descriptor schema rather than from a real execution.Review guide
Focus on:
mist/daily-data-digest/SKILL.md— specifically the roll-up SQL template and the anomaly thresholds.Skim:
manifest.json— a mechanical nine-line catalog entry.🤖 Generated with Claude Code