agentop: Skill for Claude Code

.github/skills/database-drizzle/SKILL.md

database-drizzle is a skill for Claude Code, Codex from macromania/agentop. It costs 78 tokens per session (3,898 once invoked), scanned A, original, MIT.

A SQLite database setup for Electron desktop applications, using better-sqlite3 and Drizzle to define data and write type-checked queries. It also covers migrations, connections, and hierarchical data structures.

In plain words
What is it for?
Use it to design SQLite schemas, create queries, manage database connections, run migrations, enable write-ahead logging, and represent tree-like data.
Why use it?
It provides a consistent way to store application data locally while reducing mistakes in database queries and schema changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is macromania/agentop's own configuration. It tells Claude Code and Codex how to work on agentop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agentop configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { getDatabase } from '../connection';.

Reuse

Borrowing it

Nothing to install: this file belongs to macromania/agentop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/macromania/agentop/main/.github/skills/database-drizzle/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/macromania/agentop

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-drizzle

README.md
[![agentmods](https://agentmods.dev/badge/skills/macromania/agentop/database-drizzle/github.svg)](https://agentmods.dev/skills/macromania/agentop/database-drizzle)
Your own site
<a href="https://agentmods.dev/skills/macromania/agentop/database-drizzle"><img src="https://agentmods.dev/badge/skills/macromania/agentop/database-drizzle/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for database-drizzle

Your own site · 80×15
<a href="https://agentmods.dev/skills/macromania/agentop/database-drizzle"><img src="https://agentmods.dev/badge/skills/macromania/agentop/database-drizzle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,898 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.03898
Opus 5.5 $0.00031 $0.01559
Sonnet 5.5 $0.00016 $0.00780
Haiku 4.5 $0.00008 $0.00390

Measured 2mo ago against content hash 9561b2b056df, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

database-drizzle scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/database-drizzle/SKILL.md · 543 lines

How it starts

The opening of the file, as written. The whole thing — 543 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SQLite + Drizzle ORM Database Layer

Type-safe database operations with better-sqlite3 and Drizzle ORM, optimized for Electron desktop applications.

When to Use This Skill

  • Designing SQLite database schemas
  • Implementing type-safe database queries
  • Setting up database connections with WAL mode
  • Creating and running migrations
  • Implementing closure tables for hierarchical data
  • Managing database lifecycle in Electron

Database Setup

Connection Manager

// packages/shared/src/database/connection.ts
import Database from 'better-sqlite3';
import { drizzle } from 'drizzle-orm/better-sqlite3';
import * as schema from './schema';
import path from 'path';
import { app } from 'electron';

let db: ReturnType<typeof drizzle> | null = null;
let sqlite: Database.Database | null = null;

export function initDatabase() {
  const dbPath = path.join(app.getPath('userData'), 'agentop.db');
  
  sqlite = new Database(dbPath);
  
  // Enable WAL mode for better concurrency
  sqlite.pragma('journal_mode = WAL');
  sqlite.pragma('synchronous = NORMAL');
  sqlite.pragma('foreign_keys = ON');
  sqlite.pragma('busy_timeout = 5000');
  
  db = drizzle(sqlite, { schema });
  
  return db;
}

export function getDatabase() {
  if (!db) {
    throw new Error('Database not initialized. Call initDatabase() first.');
  }
  return db;
}

export function closeDatabase() {
  if (sqlite) {
    sqlite.close();
    sqlite = null;
    db = null;
  }
}

Schema Definition

Tables with Drizzle

// packages/shared/src/database/schema.ts
import { sqliteTable, text, integer, real } from 'drizzle-orm/sqlite-core';
import { relations } from 'drizzle-orm';

// Tasks table
export const tasks = sqliteTable('tasks', {
  id: text('id').primaryKey(),
  title: text('title').notNull(),
  description: text('description'),
  status: text('status', { 
    enum: ['pending', 'active', 'completed', 'failed'] 
  }).default('pending'),
  parentId: text('parent_id').references(() => tasks.id),
  attentionType: text('attention_type', {
    enum: ['supervised', 'delegated', 'sensitive']
  }).default('supervised'),
  orderIndex: real('order_index').notNull().default(0.5),
  createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
  updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

// Closure table for efficient hierarchy queries
export const taskClosure = sqliteTable('task_closure', {
  ancestorId: text('ancestor_id').notNull().references(() => tasks.id),
  descendantId: text('descendant_id').notNull().references(() => tasks.id),
  depth: integer('depth').notNull(),
}, (table) => ({
  pk: primaryKey({ columns: [table.ancestorId, table.descendantId] }),
}));

// Outcomes table
export const outcomes = sqliteTable('outcomes', {
  id: text('id').primaryKey(),
  taskId: text('task_id').notNull().references(() => tasks.id),
  title: text('title').notNull(),
  summary: text('summary'),
  status: text('status', {
    enum: ['pending', 'running', 'completed', 'failed']
  }).default('pending'),
  createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
  updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

// Agent sessions table
export const agentSessions = sqliteTable('agent_sessions', {
  id: text('id').primaryKey(),
  outcomeId: text('outcome_id').notNull().references(() => outcomes.id),
  provider: text('provider', {
    enum: ['copilot', 'anthropic', 'openai']
  }).notNull(),
  status: text('status', {
    enum: ['idle', 'running', 'paused', 'completed', 'error']
  }).default('idle'),
  startedAt: integer('started_at', { mode: 'timestamp' }),
  completedAt: integer('completed_at', { mode: 'timestamp' }),
});

// Agent steps (mind map nodes)
export const agentSteps = sqliteTable('agent_steps', {
  id: text('id').primaryKey(),
  sessionId: text('session_id').notNull().references(() => agentSessions.id),
  parentStepId: text('parent_step_id').references(() => agentSteps.id),
  type: text('type', {
    enum: ['thinking', 'tool_call', 'tool_result', 'decision_point', 'output']
  }).notNull(),
  content: text('content', { mode: 'json' }).notNull(),
  status: text('status', {
    enum: ['pending', 'running', 'completed', 'error']
  }).default('pending'),
  positionX: real('position_x'),
  positionY: real('position_y'),
  createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
});

// Decision points
export const decisionPoints = sqliteTable('decision_points', {
  id: text('id').primaryKey(),
  stepId: text('step_id').notNull().references(() => agentSteps.id).unique(),
  confidence: text('confidence', {
    enum: ['high', 'medium', 'low']
  }).notNull(),
  options: text('options', { mode: 'json' }).notNull(),
  tradeOffs: text('trade_offs', { mode: 'json' }),
  suggestedQuestions: text('suggested_questions', { mode: 'json' }),
  resolution: text('resolution', {
    enum: ['approved', 'rejected', 'cancelled']
  }),
  resolvedOption: text('resolved_option'),
  resolvedAt: integer('resolved_at', { mode: 'timestamp' }),
});

// Event log for replay
export const eventLog = sqliteTable('event_log', {
  id: integer('id').primaryKey({ autoIncrement: true }),
  sessionId: text('session_id').references(() => agentSessions.id),
  eventType: text('event_type').notNull(),
  payload: text('payload', { mode: 'json' }).notNull(),
  timestamp: integer('timestamp', { mode: 'timestamp' }).notNull(),
});

Read the full file on GitHub · 543 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 543 lines · 78 tokens per session scan A 9561b2b056df

Subscribe to this mod's changes

database-drizzle is a skill published in the GitHub repository macromania/agentop (11 stars, last pushed 7mo ago), licensed MIT. It adds 78 tokens to every session and 3,898 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

database-drizzle compared with skills from other repositories

database-drizzle next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
database-drizzlemacromania/agentopSkill117mo agoMITA78Claude Code, Codex
golang-databasesamber/cc-skills-golangSkill3.8k5d agoMITA99Claude Code
ontology-databasex-cmd/x-cmdSkill4.7k7d agoApache-2.0A45Claude Code, Codex
golang-samber-hotsamber/cc-skills-golangSkill3.8k5d agoMITA122Claude Code
laravel-eloquentFoysal50x/skillsSkill128d agoMITA93Claude Code
biopythonai4protein/VenusFactory2Skill2532d agononeA81Claude Code, Codex
optimizing-ef-core-queriesHarmeet10000/skillsSkill76mo agoMITA53Claude Code, Codex