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.
curl -O https://raw.githubusercontent.com/macromania/agentop/main/.github/skills/database-drizzle/SKILL.mdgit clone --depth 1 https://github.com/macromania/agentopWrote 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.
[](https://agentmods.dev/skills/macromania/agentop/database-drizzle)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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(),
});
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.
- 2mo ago First seen · 543 lines · 78 tokens per session scan A 9561b2b056df
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.
database-drizzle compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-drizzlemacromania/agentop | Skill | 11 | 7mo ago | MIT | A | 78 | Claude Code, Codex |
| golang-databasesamber/cc-skills-golang | Skill | 3.8k | 5d ago | MIT | A | 99 | Claude Code |
| ontology-databasex-cmd/x-cmd | Skill | 4.7k | 7d ago | Apache-2.0 | A | 45 | Claude Code, Codex |
| golang-samber-hotsamber/cc-skills-golang | Skill | 3.8k | 5d ago | MIT | A | 122 | Claude Code |
| laravel-eloquentFoysal50x/skills | Skill | 12 | 8d ago | MIT | A | 93 | Claude Code |
| biopythonai4protein/VenusFactory2 | Skill | 253 | 2d ago | none | A | 81 | Claude Code, Codex |
| optimizing-ef-core-queriesHarmeet10000/skills | Skill | 7 | 6mo ago | MIT | A | 53 | Claude Code, Codex |