Tool for querying, managing, and running migrations on the job management database.

Install

mkdir -p .claude/skills/database-madleon && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14908" && unzip -o skill.zip -d .claude/skills/database-madleon && rm skill.zip

Installs to .claude/skills/database-madleon

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Database interaction and schema management. Use this skill when: querying or manipulating the job management database (\\rtdnas2\OE\record.db); creating or running database migrations; checking database structure and integrity; understanding table relationships and schemas; writing SQL queries against the job management database. Trigger on requests involving: database operations, schema changes, data persistence, migration tasks, database debugging, or SQL queries. Reference the schema documentation for table structure before writing queries.
549 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Query or manipulate the job management database
  • Create and run database migrations
  • Check database structure and integrity
  • Understand table relationships and schemas
  • Back up the development database

How it works

The skill interacts with SQLite3 databases for job management, supporting operations like schema checks, migrations, and data manipulation. It uses PowerShell for scripting in a Windows environment.

Inputs & outputs

You give it
SQL queries, migration scripts, or requests for database information
You get back
Query results, updated database schema, migration status, or database backup files

When to use database

  • Running database migrations
  • Writing SQL queries for job management
  • Checking database schema integrity
  • Backing up database files

About this skill

数据库交互与架构管理

概述

  • 本项目使用 SQLite3 数据库存储工作管理、订单、零件、生产等数据。正式数据库位于 \\rtdnas2\OE\record.db,开发环境使用 data/record.db
  • 本系统运行在 Windows 环境, 如需编写相关脚本,请使用 PowerShell。

参考资源

快速开始

检查数据库结构和内容

  • 参考./reference文件夹中的文件来了解数据库表结构、记录数、样本数据
  • 如需获取最新统计信息,运行以下命令:
node ./scripts/check-db.js

迁移系统

  • 迁移系统的入口文件位于 /scripts/migrate.js

  • 记录当前迁移状态的文件为 /data/migrations.json,包含已应用迁移的列表

  • 迁移文件位于 /scripts/migrations/,命名格式 NNN_description.js

  • package.json 中定义的迁移命令:

    • "db:migrate": "node scripts/migrate.js up",
    • "db:migrate:down": "node scripts/migrate.js down",
    • "db:migrate:status": "node scripts/migrate.js status"

数据库备份与恢复

备份(开发环境)

Copy-Item data/record.db "data/record.db.backup-$(Get-Date -Format 'yyyyMMdd-HHmmss')"

最佳实践

  • 使用外键约束:在设计新表时定义适当的外键关系
  • 时间戳:使用 datetime('now', 'localtime') 记录本地时间
  • 事务安全:多条相关 SQL 语句应包装在事务中
  • 备份迁移前:始终在应用重大迁移前备份数据库

环境配置

  • 开发data/record.db (SQLite3)
  • 生产\\rtdnas2\OE\record.db (SQLite3, 网络挂载)
  • 迁移跟踪data/migrations.json (已应用迁移列表)

How it compares

This skill provides direct interaction and management for a specific SQLite3 database, including a migration system, rather than general database administration.

Compared to similar skills

database side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
database (this skill)01moReviewIntermediate
drizzle-orm322moNo flagsIntermediate
database-design66moReviewIntermediate
prisma-expert126moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry