agentleFS
haruharu/redmine_ai_helper/.claude/skills/recreate-test-db/SKILL.md

recreate-test-db

Skill107 starsChanged 9 months agoMITView on GitHub

Recreate the Redmine test database from scratch (delete db/schema.rb and db/redmine.sqlite3_test, then run core and plugin migrations with RAILS_ENV=test). Use when the test DB is out of sync, migrations changed, or the user asks to rebuild/reset the test database.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is 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.

  • 1

    Very specific

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

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

    Do NOT touch db/redmine.sqlite3 (the development DB).

    line 30

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

Recreate Test Database

Rebuild the SQLite test database of the Redmine instance at /usr/local/redmine.

IMPORTANT: Never run rails test. Only run the steps below, and only when the user asks to rebuild the test DB. Never migrate the test DB on your own initiative.

Workflow

Run from /usr/local/redmine.

Step 1: Delete the generated schema

db/schema.rb is git-ignored and regenerated by migrations. It may be absent; that is fine.

rm -f /usr/local/redmine/db/schema.rb

Step 2: Delete the test database

rm -f /usr/local/redmine/db/redmine.sqlite3_test

Do NOT touch db/redmine.sqlite3 (the development DB).

Step 3: Run core migrations

cd /usr/local/redmine && bundle exec rake db:migrate RAILS_ENV=test 2>&1 | tail -30

Step 4: Run plugin migrations

Core db:migrate does not run plugin migrations.

cd /usr/local/redmine && bundle exec rake redmine:plugins:migrate RAILS_ENV=test 2>&1 | tail -30

Step 5: Report

State whether both migrations finished without errors and name the last migration applied in each. Do not run tests unless asked.

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.