ワンクリックで
database-admin
Database administration tasks including schema changes, backups, monitoring, and user access management.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Database administration tasks including schema changes, backups, monitoring, and user access management.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when reviewing a pull request, to check for logic bugs, style consistency, and security concerns and summarise the findings for the author.
Use once there is a confirmed composition plan, to create it. Scaffolds the plugin, authors or restructures the skill(s), decomposes anything too big, and adds any rules or MCP servers the plan called for. Uses the CLI to scaffold the plugin, then adds further skills by hand.
Use when someone wants to turn a problem, a messy or sprawling skill, or some existing work into well-shaped reusable context for their agent. Triggers include "help me make a skill for X", "my skill is a mess, sort it out", "I want to get more out of Tessl with this skill", or "package this so my team can use it". Runs the arc - understand the problem, gather the artifacts, plan the right composition, build it - then points to eval as a separate next step.
Use during build when a skill or a problem is too big for one skill - a sprawling SKILL.md doing several jobs, or a large problem the user wants a single skill for. Splits it into focused, independently-verifiable skills, with a plugin as the superstructure that holds them together.
Use at the start of creating context, to understand the problem the user is solving and take stock of what they already have. The user may arrive with an existing skill or plugin, code, a written prompt or transcript, or nothing but a pointer ("go look at my PRs"). Gathers what exists and fills the gaps - by asking or by hunting - until there is enough to plan a composition.
Use once the problem and artifacts are understood, to decide the right shape for the context. Produces a short composition plan - a single skill for simple cases, or a plugin (with rules, commands, MCP servers, or multiple skills) for richer ones - and confirms it with the user before anything is built.
| name | database-admin |
| description | Database administration tasks including schema changes, backups, monitoring, and user access management. |
This skill covers everything related to running and maintaining a PostgreSQL database in production.
When the user needs to change the database schema:
psql $DATABASE_URL.SELECT * FROM schema_migrations WHERE applied_at IS NULL ORDER BY version;psql $DATABASE_URL -f migrations/<version>_<name>.sqlSELECT version, applied_at FROM schema_migrations ORDER BY applied_at DESC LIMIT 5;psql $DATABASE_URL -f migrations/<version>_<name>_rollback.sql<YYYYMMDDHHMMSS>_<short_description>.sql (e.g. 20240512140000_add_user_preferences.sql)_rollback.sql file.CREATE TABLE IF NOT EXISTS, ALTER TABLE ... ADD COLUMN IF NOT EXISTS).When the user asks to back up the database or when a backup is needed before a risky operation:
pg_dump $DATABASE_URL > backup_$(date +%Y%m%d_%H%M%S).sqlgzip backup_*.sqlaws s3 cp backup_*.sql.gz s3://company-db-backups/postgres/<env>/aws s3 ls s3://company-db-backups/postgres/<env>/ | tail -5rm backup_*.sql.gzaws s3 cp s3://company-db-backups/postgres/<env>/<file>.sql.gz .gunzip <file>.sql.gzpsql $DATABASE_URL < <file>.sqlSELECT COUNT(*) FROM users; (should match pre-backup count).When the user asks about database health, slow queries, or connection issues:
SELECT count(*), state FROM pg_stat_activity GROUP BY state;SELECT pid, now() - pg_stat_activity.query_start AS duration, query
FROM pg_stat_activity
WHERE state = 'active' AND now() - query_start > interval '30 seconds'
ORDER BY duration DESC;
SELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS size
FROM pg_tables
ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC
LIMIT 20;
SELECT relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch
FROM pg_stat_user_indexes
WHERE idx_scan = 0
ORDER BY relname;
SELECT pg_terminate_backend(<pid>);VACUUM ANALYZE <tablename>;When the user needs to create, modify, or revoke database access:
SELECT rolname, rolsuper, rolcreaterole, rolcreatedb FROM pg_roles ORDER BY rolname;CREATE ROLE <username> WITH LOGIN PASSWORD '<password>';
GRANT CONNECT ON DATABASE <dbname> TO <username>;
GRANT USAGE ON SCHEMA public TO <username>;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO <username>;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO <username>;
CREATE ROLE <username> WITH LOGIN PASSWORD '<password>';
GRANT CONNECT ON DATABASE <dbname> TO <username>;
GRANT USAGE ON SCHEMA public TO <username>;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO <username>;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO <username>;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO <username>;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO <username>;
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM <username>;
REVOKE CONNECT ON DATABASE <dbname> FROM <username>;
DROP ROLE <username>;
SELECT grantee, table_name, privilege_type
FROM information_schema.role_table_grants
WHERE table_schema = 'public'
ORDER BY grantee, table_name;
All database tasks rely on these environment variables being set:
DATABASE_URL — full connection string, e.g. postgresql://user:pass@host:5432/dbnameAWS_PROFILE or AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY — for S3 backup operationsSLACK_WEBHOOK_URL — for posting notifications to Slack channelsIf any of these are missing, ask the user to provide them before proceeding.
These rules apply to all database operations:
$ENVIRONMENT variable.