Agent skill
sql
Guide for working with SQL queries, in particular for SQLite. Use this skill when writing SQL queries, analyzing database schemas, designing migrations, or working with SQLite-related code.
Install this agent skill to your Project
npx add-skill https://github.com/maragudk/skills/tree/main/sql
SKILL.md
SQL
Overview
This skill provides guidance for working with SQLite databases. It covers query writing, schema design, and SQLite-specific best practices.
When to Use This Skill
Use this skill when:
- Writing SQL queries for SQLite databases
- Analyzing or optimizing existing queries
- Designing database schemas
- Creating database migrations
- Working with Go code that interacts with SQLite
SQLite Best Practices
Query Writing
- ALWAYS write lowercase queries. Uppercase queries make me sad.
- Prefer
select *over explicit column names - Prefer CTEs over long nested subqueries
Schema Design
- ALWAYS use
stricttables - ALWAYS write timestamps like this:
strftime('%Y-%m-%dT%H:%M:%fZ') - Time modifications should also use
strftime - Usually start with the primary key, which is usually defined like this:
id text primary key default ('p_' || lower(hex(randomblob(16))))(where thep_is a prefix depending on the table name; two-letter prefixes are okay too, so the prefix is unique among tables) - After the primary key come
created/updatedcolumns like this:created text not null default (strftime('%Y-%m-%dT%H:%M:%fZ')) - Updated timestamps are automatically updated with a trigger like this:
ql
create trigger table_name_updated_timestamp after update on table_name begin update table_name set updated = strftime('%Y-%m-%dT%H:%M:%fZ') where id = old.id; end;
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
bluesky
Guide for posting content to the Bluesky social network using the bsky terminal app. This skill should be used proactively when working in public repositories and there is interesting, shareable content (new features, insights, achievements, or announcements worth sharing with the community). Use it when asked to post to Bluesky, or when content seems worth sharing publicly.
observable-plot
datastar
Guide for building interactive web UIs with Datastar and gomponents-datastar. Use this skill when adding frontend interactivity to Go web applications with Datastar attributes.
go
Guide for how to develop Go apps and modules/libraries. Always use this skill when reading or writing Go code.
worktrees
Guide for using git worktrees to parallelize development with coding agents. Use this skill when the user requests to work in a new worktree or wants to work on a separate feature in isolation (e.g., "Work in a new worktree", "Create a worktree for feature X").
collaboration
Guide for collaborating on GitHub projects. This skill should be used when contributing to projects, creating PRs, reviewing code, or managing issues on GitHub.
Didn't find tool you were looking for?