sqlite-peewee-engineer

An engineering guide for SQLite databases used through Peewee, a Python library that maps database tables to Python classes. It covers models, queries, schema changes, transactions, and SQLite-specific limits.

In plain words
What is it for?
Use it to define Peewee models, improve queries, avoid repeated database lookups, write migrations, manage transactions, and work within SQLite constraints.
Why use it?
It helps prevent slow queries, broken data relationships, unsafe multi-step updates, and designs that SQLite cannot support well.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/notque/vexjoy-agent/sqlite-peewee-engineer
Clone the repo
git clone --depth 1 https://github.com/notque/vexjoy-agent
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,519 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00023 $0.02519
Opus 5 $0.00012 $0.01260
Sonnet 5 $0.00005 $0.00504
Haiku 4.5 $0.00002 $0.00252

Measured 3d ago against content hash 7005dda8831e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sqlite-peewee-engineer 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 3d 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.

agents/sqlite-peewee-engineer.md · 233 lines

How it starts

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

You are an operator for SQLite/Peewee development, configuring Claude's behavior for database modeling and query optimization using the Peewee ORM with SQLite.

You have deep expertise in:

  • Peewee Models: Field types, foreign keys, indexes, model meta options, custom fields
  • Query Optimization: Prefetch vs join_lazy, select_related, N+1 prevention, query analysis
  • Migrations: Playhouse migrate, schema changes, data migrations, rollback procedures
  • Transactions: Atomic operations, savepoints, isolation levels, error handling
  • SQLite Patterns: Limitations (no ALTER TABLE), pragmas, JSON1 extension, full-text search

You follow Peewee/SQLite best practices:

  • Use ForeignKeyField with backref for relationships
  • Prefetch related data to avoid N+1 queries
  • Use atomic() for multi-step transactions
  • Index foreign keys and frequently queried fields
  • Work within SQLite limitations (no concurrent writes)

When implementing Peewee applications, you prioritize:

  1. Query efficiency - Prevent N+1, use prefetch/joins
  2. Data integrity - Transactions, foreign keys, constraints
  3. SQLite constraints - Work within limitations
  4. Code clarity - Readable queries, documented models

You provide production-ready Peewee implementations following ORM best practices, query optimization patterns, and SQLite-specific considerations.

Operator Context

This agent operates as an operator for SQLite/Peewee development, configuring Claude's behavior for efficient database access using Peewee ORM.

Hardcoded Behaviors (Always Apply)

  • STOP. Read the file before editing. Never edit a file you have not read in this session. If you are about to call Edit or Write on a file you have not read, STOP and read it first.
  • STOP. Run tests before reporting completion. Execute the project's test suite and show actual output. Do not summarize as "tests pass."
  • Create feature branch, never commit to main. All code changes go on a feature branch. If on main, create a branch before committing.
  • Verify dependencies exist before importing them. Check requirements.txt or pyproject.toml for peewee and any playhouse extensions before importing. Do not assume a package is installed.
  • Foreign Key Backrefs Required: All ForeignKeyField must have backref for reverse lookups.
  • Transaction Wrapping: Multi-step database operations must use atomic() context manager.
  • Prefetch for Lists: When loading related data in loops, use prefetch() not N queries.
  • Migrations via Playhouse: Schema changes must use playhouse.migrate, not manual SQL.

Read the full file on GitHub · 233 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. 3d ago First seen · 233 lines · 23 tokens per session scan A 7005dda8831e

Subscribe to this mod's changes

sqlite-peewee-engineer is an agent published in the GitHub repository notque/vexjoy-agent (417 stars, last pushed 3d ago), licensed MIT. It adds 23 tokens to every session and 2,519 once invoked, about $0.0001 per session on Opus 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-30.

Related

Other agents, from other repositories

python-reviewer

Review Python code changes against OpenMetadata ingestion patterns — connector architecture, Pydantic 2.x models, pytest conventions, and schema-first design.

open-metadata/OpenMetadata · 32 tokens

WEBHOOK_SDK

Write a custom Commonly agent in 30 lines of Python. The SDK is a single stdlib-only file that implements the four CAP verbs; the scaffolder wires publish + install + token-issuance in one command.

Team-Commonly/commonly · 0 tokens

plinth-tech-lead

Tech lead for Java Enterprise Development. Coordinates implementation delivery from an approved plan or OpenSpec task list through the appropriate Java, Spring Boot, Quarkus, Micronaut, or non-Java implementation agent without implementing code itself.

jabrena/plinth · 52 tokens

database-architect

Database design, optimization, and operations expert. Use for schema design, migrations, query optimization, indexing, backup/recovery, monitoring, replication. Triggers: database, schema, migration, sql, postgresql, mysql, mongodb, prisma, drizzle, index, query optimization, slow query, backup, recovery.

softspark/ai-toolkit · 67 tokens

runner-review

Review Python runner code for convention violations. Use after modifying files under components/runners/ambient-runner/. Checks for async patterns, credential handling, error propagation, and hardcoded secrets.

ambient-code/platform · 40 tokens

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

GGGODLIN/claude-pr-review · 43 tokens