一键导入
pgsandbox-testing
Use when running Django checks, migrations, pytest, or database debugging against a disposable local Postgres database created by PGSandbox MCP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when running Django checks, migrations, pytest, or database debugging against a disposable local Postgres database created by PGSandbox MCP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), structured output, streaming, testing, and multi-agent patterns. Use when the user mentions Pydantic AI, imports pydantic_ai, or asks to build an AI agent, add tools/capabilities, defer capability loading, stream output, define agents from YAML, or test agent behavior.
Extend Pydantic AI agents with batteries-included capabilities from pydantic-ai-harness — currently Code Mode, which collapses many tool calls into one sandboxed Python execution. Use when the user mentions pydantic-ai-harness, CodeMode, Monty, code mode, or tool sandboxing, when they want an agent to run agent-written Python, or when a Pydantic AI agent would benefit from orchestrating multiple tool calls in a single sandboxed script.
Use when planning, implementing, testing, reviewing, or evaluating agent-driven changes in this generated Django SaaS app, especially changes that cross Django apps, API surfaces, background jobs, frontend templates, docs, CI, or optional integrations.
Use when adding, changing, testing, or debugging Django Q2 background tasks, scheduled jobs, qcluster workers, Redis broker configuration, or ORM broker fallback in this generated Django SaaS app.
Use when running, testing, or debugging the generated Django SaaS app from host terminal commands, optionally with Docker Compose backing services.
Use when changing Django templates, Tailwind CSS, frontend components, layout, responsive behavior, themes, forms, empty states, motion, or UI copy in this generated Django SaaS app.
| name | pgsandbox-testing |
| description | Use when running Django checks, migrations, pytest, or database debugging against a disposable local Postgres database created by PGSandbox MCP. |
Use this skill when this project needs a real, disposable Postgres database for tests, migration checks, SQL debugging, or reproducing database-specific bugs.
PGSandbox MCP is a local stdio MCP server for disposable Postgres databases. It is installed outside this repository and is not a Python dependency of the app. The project lives at https://github.com/lvtd-llc/pgsandbox-mcp.
Install it with Homebrew:
brew install lvtd-llc/tap/pgsandbox-mcp
Or use the GitHub install script:
curl -fsSL https://raw.githubusercontent.com/lvtd-llc/pgsandbox-mcp/main/scripts/install.sh | sh
After installation, run pgsandbox-mcp setup for the MCP client and restart the
client so the pgsandbox server is available.
pgsandbox server.create_database MCP tool.
nameHint, for example django-tests.ttlMinutes, for example 120.project=<repository-name> and purpose=tests
when the MCP client supports labels.connectionString field returned
by create_database, or call get_connection_string.DATABASE_URL="<pgsandbox connection string>" make test-local-postgres
delete_database when the checks finish. If cleanup
fails, report the databaseId or databaseName so a human can remove it.The Make target runs migration drift checks, fakes the extension-only
core.0001_enable_extensions migration, applies the remaining migrations to
the disposable database, runs Django checks, and then loads the project's
guarded conftest.py database settings hook with pytest --reuse-db so
pytest-django uses the existing sandbox database instead of trying to create a
second test_* database.
The extension migration is faked only for this target because PGSandbox roles
are intentionally least-privilege and cannot create superuser-only extensions
such as pg_stat_statements. The Make target fails fast if the expected
extension migration file is missing; override PGSANDBOX_EXTENSION_MIGRATION
and PGSANDBOX_EXTENSION_MIGRATION_FILE if the migration is renamed. Use Docker
Compose or CI when you need to verify extension creation itself.
When DJANGO_TEST_USE_EXISTING_DATABASE=1 is set, Django settings also switch
the default cache to local memory and Django Q2 to the ORM broker so this
database-focused target does not require Redis.
.env changes,
or MCP client config files.Run only Django's system checks:
DATABASE_URL="<pgsandbox connection string>" \
ENVIRONMENT=test DEBUG=0 SECRET_KEY=test-secret-key SITE_URL=http://localhost:8000 \
uv run python manage.py check
Run only pytest:
DATABASE_URL="<pgsandbox connection string>" \
DJANGO_TEST_USE_EXISTING_DATABASE=1 \
PYTHONPATH=. \
uv run pytest --reuse-db -q
Inspect the configured database from Django:
DATABASE_URL="<pgsandbox connection string>" \
ENVIRONMENT=test DEBUG=0 SECRET_KEY=test-secret-key SITE_URL=http://localhost:8000 \
uv run python manage.py dbshell