agentleFS
flisk-shflisk-sh/flisk-skills/skills/flisk-data/SKILL.md

flisk-data

Skill4 starsChanged 33 days agoMITView on GitHub

Reset, seed, snapshot and restore the data in a Flisk project's shared local Postgres - wipe everything, drop one stack's database, run a seed job, or pg_dump and pg_restore a database. Use when the user needs a clean database, reproducible seed data, or to keep state across experiments. To add a database to a service or set up migrations, use flisk-databases.

  • Reads credentials
  • Deletes or force-pushes

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
  • could be automatic: a setting could enforce it
  1. Very specific:

    Seed: run the seed as a one-shot bring-your-own job (flisk resource seed --type bring-your-own --dockerfile ./Dockerfile --restart no …

    line 41
  2. Very specific:

    Never commit dumps, local data or .env.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Local data: reset, seed, snapshot

Flisk runs one Postgres container per project. Each stack has its own database in it, shared by that stack's services.

Find the names

ThingName (<project> and <stack> with - replaced by _)
Container<project>_postgres
Superuser<project> (password: DB_PASSWORD in the project .env)
Database<project>_<stack>
Volumedatabase-management_<project>_postgres_data
Host port15432, or FLISK_POSTGRES_PORT

<project> is project.name in .flisk/project.json. Confirm on the machine: docker volume ls | grep postgres_data, and docker exec <project>_postgres psql -U <project> -d postgres -c '\l'.

Workflow

  • Everything from scratch (all stacks lose their data):
    flisk down
    docker volume rm database-management_<project>_postgres_data
    flisk up
  • One stack's database (Postgres must be running):
    docker exec <project>_postgres psql -U <project> -d postgres -c "DROP DATABASE <project>_<stack> WITH (FORCE)"
    docker exec <project>_postgres createdb -U <project> -O <project> <project>_<stack>
    It comes back empty; migrations run again only when the migrator runs again (flisk up, or flisk restart <name>-migrator).
  • Seed: run the seed as a one-shot bring-your-own job (flisk resource seed --type bring-your-own --dockerfile ./Dockerfile --restart no --stack <stack> --yes) that depends on the migrator, and make it idempotent.
  • Snapshot and restore:
    docker exec <project>_postgres pg_dump -U <project> -Fc <project>_<stack> > <stack>.dump
    docker exec -i <project>_postgres pg_restore -U <project> -d <project>_<stack> --clean --if-exists --no-owner < <stack>.dump

Guardrails

  • Volumes survive flisk down by design; flisk down --prune-networks removes networks, not volumes. Ask before removing a volume.
  • Flisk has no db reset or db seed command; use the steps above.
  • Never commit dumps, local data or .env. Anonymise any dump that comes from production.
  • Details and a worked seed example: docs/data.md.

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.