Agent skill

Database Analysis

by fossasia in fossasia/eventyay-interpretation

A skill your agent uses to analyse, audit, or modify database models, migrations, and CRUD helpers.

Apache-2.0Auto-check passedDatabases

Install Database Analysis

skills CLI
$ npx skills add fossasia/eventyay-interpretation --skill database-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install fossasia/eventyay-interpretation database-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/fossasia/eventyay-interpretation.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/database-analysis .claude/skills/database-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
database-analysis
GitHub stars
1.6k
Token cost
~1.2k tokens
SKILL.md length
340 words
Files
1
Skills in repo
41
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses to analyse, audit, or modify database models, migrations, and CRUD helpers.

  • Works in 5 steps: mediamtx_path is a runtime property, not… → API keys are Fernet-encrypted in the… → Unique index on (event_id,… → …
  • Modify database models
  • SKILL.md covers Quick Schema Reference, Key Design Decisions, Working with Relationships and Migration Workflow, plus 3 more sections
  • Calls uv; needs API_KEY_ENCRYPTION_KEY

What it does

Database Analysis is an agent skill from fossasia/eventyay-interpretation. Use this skill to analyse, audit, or modify database models, migrations, and CRUD helpers. Reference: portal/models.py, portal/database.py, alembic/versions/.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Database migrations. It works with SQLite. The repository describes itself as: A plugin for live interpretation of video streams. The licence is Apache-2.0.

When your agent uses it

  • Modify database models
  • Tasks that involve Database migrations

Example prompts

  • “/database-analysis”

Requirements

  • Python 3
  • A credential in API_KEY_ENCRYPTION_KEY

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. mediamtx_path is a runtime property, not a stored column on DBBooth.
  2. API keys are Fernet-encrypted in the events table.
  3. Unique index on (event_id, language_code) in booths — one booth per language per event.
  4. InviteToken.token is a 64-char hex string (32 bytes of entropy via secrets.token_hex(32)).
  5. Session pattern uses async with session.begin() — auto-commits and auto-rolls back.

What it can do on your machine

Read from SKILL.md and the folder at commit 1ca0139. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY_ENCRYPTION_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Database Analysis loads about 1.2k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 340 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from fossasia/eventyay-interpretation at commit 1ca0139, republished under its Apache-2.0 licence (© fossasia). 340 words, ~1,235 tokens.

Download SKILL.mdSave it as .claude/skills/database-analysis/SKILL.md (or your agent's skills folder).
name
database-analysis
description
Use this skill to analyse, audit, or modify database models, migrations, and CRUD helpers. Reference: `portal/models.py`, `portal/database.py`, `alembic/versions/`.

Skill: Database Analysis

Use this skill to analyse, audit, or modify database models, migrations, and CRUD helpers. Reference: portal/models.py, portal/database.py, alembic/versions/.


Quick Schema Reference

events ─────────┬─── rooms ───── booths ─── invite_tokens
                │                  │
                │                  └─── booth_memberships ─── users
                └─── booths ───────────── event_memberships ─ users

See DATABASE_MAP.md for full column details.


Key Design Decisions

  1. mediamtx_path is a runtime property, not a stored column on DBBooth.

    • Always derived via make_mediamtx_path(event.slug, language_code).
    • Requires event relationship to be loaded: use joinedload(DBBooth.event).
  2. API keys are Fernet-encrypted in the events table.

    • Use portal.crypto.encrypt_val(key) to store.
    • Use portal.crypto.decrypt_val(encrypted) to read.
    • API_KEY_ENCRYPTION_KEY env var must be set; raises RuntimeError if default.
  3. Unique index on (event_id, language_code) in booths — one booth per language per event.

  4. InviteToken.token is a 64-char hex string (32 bytes of entropy via secrets.token_hex(32)).

  5. Session pattern uses async with session.begin() — auto-commits and auto-rolls back.

    python
    async with get_session() as session:
        result = await create_event(session, slug='test', display_name='Test')
        # committed on exit

Working with Relationships

Loading event on DBBooth (for mediamtx_path)
python
from sqlalchemy.orm import joinedload
stmt = select(DBBooth).options(joinedload(DBBooth.event)).where(DBBooth.id == booth_id)
Loading booth with room and event
python
stmt = (
    select(DBBooth)
    .join(Event)
    .options(joinedload(DBBooth.room))
    .where(Event.slug == event_slug)
    .where(DBBooth.language_code == language_code)
)
Invite token with booth and event (for redemption)
python
result = await session.execute(
    select(InviteToken)
    .options(joinedload(InviteToken.booth).joinedload(DBBooth.event))
    .where(InviteToken.token == token_str)
)

Migration Workflow

  1. Edit portal/models.py.
  2. Generate migration:
bash
uv run alembic revision --autogenerate -m "short_description"
  1. Review generated file — autogenerate is not always correct:
    • SQLite requires batch_alter_table for column additions/drops. See migration 008 as the canonical example.
    • For new tables, autogenerate is usually correct.
  2. Apply:
bash
uv run alembic upgrade head
  1. Test:
bash
uv run pytest tests/test_database.py -v
Migration 008 Reference Pattern (SQLite column add)
python
def upgrade() -> None:
    with op.batch_alter_table('booths') as batch_op:
        batch_op.add_column(sa.Column('new_column', sa.String(20), server_default=sa.text("'default'"), nullable=False))

CRUD Helper Patterns

Show full SKILL.md (143 more words)Show less
Upsert pattern (event/booth memberships)

set_event_membership and set_booth_membership use an upsert-like pattern:

  • Query for existing membership → update role if found → create new if not found.
Invite token redemption

redeem_invite_token raises ValueError (not HTTP exception) on invalid token:

python
tok = await redeem_invite_token(session, token_str)
# Raises ValueError: "Token has already been used." or "Token has expired."
# Returns None if token not found

The route handler converts these to HTTP 403 / 404.

Revoke token

revoke_invite_token sets used_at = utc_now() on the token (same effect as redemption).


Testing Database Code

Use in-memory SQLite + configure() override in test fixtures:

python
from portal.database import configure, init_db, drop_db
from portal.config import settings

async def setup_test_db():
    configure('sqlite+aiosqlite:///:memory:')
    await init_db()

async def teardown_test_db():
    await drop_db()

Never use the production database URL in tests.


Common Database Issues

IssueCauseFix
mediamtx_path raises AttributeErrorevent relationship not loadedUse joinedload(DBBooth.event) in query
IntegrityError on booth createDuplicate (event_id, language_code)Catch IntegrityError and return 409
Migration fails on SQLiteColumn alter without batch_alter_tableRewrite migration with batch context
decrypt_val raises ValueErrorWrong API_KEY_ENCRYPTION_KEYKey must match the one used to encrypt
InviteToken.is_expired incorrectMissing timezone on expires_atexpires_at must be timezone-aware (UTC)

© fossasia, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/database-analysis of fossasia/eventyay-interpretation.

Open the folder on GitHubat commit 1ca0139

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders. This page covers the copy in fossasia/eventyay-interpretation, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Database Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Database Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Analysis this skillfossasia/eventyay-interpretation1.6k—~1.2kAutomated safety check: PassApache-2.0
Migration Reviewjpicklyk/task-orchestrator207—~886Automated safety check: PassMIT
Cognee Database Migrationstopoteretes/cognee32k—~2.6kAutomated safety check: NotesApache-2.0
Cursor BYOK Database Schemaleookun/cursor-byok3.2k—~1.3kAutomated safety check: PassMIT
Migrationgocronx-team/gocron808—~1.1kAutomated safety check: PassMIT
DeepChat Data Import HelperThinkInAIXYZ/deepchat6.4k—~738Automated safety check: PassApache-2.0

Similar skills

  • Migration Review

    jpicklyk/task-orchestrator

    SQLite migration assessment for items with the needs-migration-review trait.

    207 GitHub stars~886 tokensUpdated yesterday
    DatabasesAuto-check passed
  • Cognee Database Migrations

    topoteretes/cognee

    Explains how cognee's two migration chains run, how to check and repair migration state with cognee-cli, and how to write new Alembic or graph and vector migrations.

    32k GitHub stars~2.6k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • Cursor BYOK Database Schema

    leookun/cursor-byok

    Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.

    3.2k GitHub stars~1.3k tokensUpdated 9 days ago
    DatabasesAuto-check passed
  • Migration

    gocronx-team/gocron

    Create, review, or verify gocron database migrations across SQLite, MySQL, and PostgreSQL.

    808 GitHub stars~1.1k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • DeepChat Data Import Helper

    ThinkInAIXYZ/deepchat

    Guides building a third-party importer for DeepChat's local SQLite data, covering schema, encryption and safe read-only access patterns.

    6.4k GitHub stars~738 tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • Official

    Routes Prisma 8 tasks such as contracts, migrations, queries and upgrades to the right reference files for projects on the contract-first @prisma/orm packages.

    48k GitHub stars~3.7k tokensUpdated yesterday
    DatabasesAuto-check: notes

More from fossasia/eventyay-interpretation

All 41 skills in this repo
  • Git Guardrails Claude Code

    fossasia/eventyay-interpretation

    Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute.

    1.6k GitHub starsUsed in 12 repos~578 tokens
    Auto-check passed
  • Codebase Design

    fossasia/eventyay-interpretation

    Shared vocabulary for designing deep modules. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 35 repos~1.5k tokens
    Auto-check passed
  • Diagnosing Bugs

    fossasia/eventyay-interpretation

    Diagnosis loop for hard bugs and performance regressions. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 31 repos~2.1k tokens
    Auto-check passed
  • Domain Modeling

    fossasia/eventyay-interpretation

    Build and sharpen a project's domain model. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 29 repos~821 tokens
    Auto-check passed
  • TDD

    fossasia/eventyay-interpretation

    Test-driven development. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 28 repos~1.1k tokens
    Auto-check passed
  • Improve

    fossasia/eventyay-interpretation

    Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute.

    1.6k GitHub starsUsed in 10 repos~3.7k tokens
    Auto-check: warnings

Works with

Categories

Questions about Database Analysis

What does Database Analysis do?

A skill your agent uses to analyse, audit, or modify database models, migrations, and CRUD helpers. Database Analysis is an agent skill from fossasia/eventyay-interpretation. Use this skill to analyse, audit, or modify database models, migrations, and CRUD helpers.

When should I use Database Analysis?

Database Analysis fits situations like: modify database models; tasks that involve Database migrations.

How do I install Database Analysis in Claude Code?

Run `npx skills add fossasia/eventyay-interpretation --skill database-analysis -a claude-code`. Or copy the skill folder (.agents/skills/database-analysis in fossasia/eventyay-interpretation) into .claude/skills/database-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Database Analysis in Codex?

Run `npx skills add fossasia/eventyay-interpretation --skill database-analysis -a codex`. Or copy the skill folder (.agents/skills/database-analysis in fossasia/eventyay-interpretation) into .agents/skills/database-analysis in your project. Codex loads it when a task matches its description.

Can I use Database Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add fossasia/eventyay-interpretation --skill database-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-analysis, .gemini/skills/database-analysis, .github/skills/database-analysis and .opencode/skills/database-analysis in your project.

What does Database Analysis need to run?

Going by SKILL.md and its folder, Database Analysis needs the command-line tools its instructions call (uv) and credentials named API_KEY_ENCRYPTION_KEY. Our summary lists: Python 3; A credential in API_KEY_ENCRYPTION_KEY.

Does Database Analysis access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Database Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Database Analysis use?

Database Analysis is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Analysis use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Database Analysis?

Skills that share tags, products or a category with Database Analysis: Migration Review (jpicklyk/task-orchestrator, 207 stars), Cognee Database Migrations (topoteretes/cognee, 32k stars), Cursor BYOK Database Schema (leookun/cursor-byok, 3.2k stars) and Migration (gocronx-team/gocron, 808 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Analysis?

fossasia (a GitHub organization) maintains it in fossasia/eventyay-interpretation, which has 1,552 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 5, 2026.

Source: fossasia/eventyay-interpretation on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.