Agent skill
python-peewee
Use when working with Peewee ORM patterns, especially DatabaseProxy setup, scoped connection/transaction handling, and SQLite-based tests.
Install this agent skill to your Project
npx add-skill https://github.com/narumiruna/agent-skills/tree/main/skills/python-peewee
SKILL.md
Python Peewee
Use Peewee with DatabaseProxy and scoped connection/transaction patterns.
Set up
DatabaseProxy & BaseModel
from peewee import DatabaseProxy, Model
db_proxy = DatabaseProxy()
class BaseModel(Model):
class Meta:
database = db_proxy
Initialize DB
from peewee import SqliteDatabase
db = SqliteDatabase("app.db", pragmas={"foreign_keys": 1})
db_proxy.initialize(db)
Use connections and transactions
Read (no transaction)
with db_proxy.obj.connection_context():
rows = MyModel.select().limit(100)
Write (atomic)
with db_proxy.obj.atomic():
a.save()
b.save()
Combined
db = db_proxy.obj
with db.connection_context():
with db.atomic():
...
Use connection_context() for scoped connections (open/close).
Use atomic() for atomic writes (BEGIN/COMMIT/ROLLBACK).
Test with SQLite
import pytest
from peewee import SqliteDatabase
@pytest.fixture
def test_db(tmp_path):
db = SqliteDatabase(str(tmp_path / "test.db"))
db_proxy.initialize(db)
with db.connection_context():
db.create_tables([MyModel])
yield db
db.close()
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
slide-creator
Use when creating slide decks with Marp/Marpit Markdown (marp), including authoring slide content, designing slide color schemes, and building SVG diagrams or illustrations for the deck.
slide-color-design
Use when you only need slide color systems, palette selection, or palette generation workflows and want direct pointers to the color design references.
mermaid-creator
Use when creating or converting Mermaid diagrams (for example flowcharts, sequence diagrams, ER diagrams, and Gantt charts), including exporting to SVG for docs or slides.
test-driven-development
Use when implementing non-trivial code changes that should follow TDD (write a failing test first, make the smallest passing change, then refactor safely).
svg-illustration
Use when you need SVG diagram rules, layout patterns, or embedding guidance for slide decks and want the minimal SVG-focused reading path.
python-cli-typer
Use when building or structuring Python CLI commands with Typer, including commands, options, and multi-command apps.
Didn't find tool you were looking for?