test-safety-agent

Validates test database isolation and enforces safety checks before running ndestates-io tests.

Updated Jun 17, 2026
One-click install
npx skills add https://github.com/ndestates/ndestates-website --skill test-safety-agent-ndestates
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-safety-agent
Source: https://github.com/ndestates/ndestates-website/tree/main/.copilot/skills/test-safety-agent
Command: npx skills add https://github.com/ndestates/ndestates-website --skill test-safety-agent-ndestates

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running automated tests against a live or production database risks destructive data loss. This Skill enforces a pre-flight safety check that confirms tests target an isolated test database before any test suite executes. ## Core Features & Use Cases - Database Isolation Verification: Confirms DB_DATABASE is set to test or :memory: via DDEV before tests run. - Pre/Post Risk Assessment: Snapshots record counts when needed and halts execution on any safety violation. - Project Convention Loading: Loads TESTING.md, CONVENTIONS, and CONCERNS cache plus the full test-safety-agent instructions for context-aware checks. - Use Case: Before running the ndestates-io test suite through DDEV, invoke this Skill to verify the environment points at a disposable test database and receive a safety report with cache citations. ## Quick Start Ask the agent to run a test safety check on the current DDEV environment before executing the ndestates-io test suite.

Frequently Asked Questions about test-safety-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent tests from running against a production database?▼

Verify the DB_DATABASE environment variable is set to test or :memory: before executing any test suite. This Skill performs that check through DDEV and halts execution if the environment points at a live database.

How to run tests safely with DDEV?▼

Run all tests through DDEV so they execute inside the containerized environment, and confirm the database configuration targets a disposable test database first. Snapshot record counts before and after to detect unintended data changes.

What is a pre-test risk assessment for database tests?▼

A pre-test risk assessment verifies environment isolation, loads project testing conventions, and snapshots table counts before tests run. It ensures destructive operations cannot affect live data and reports violations immediately.

Why do tests fail when DB_DATABASE is not set to test?▼

Tests fail or are halted because running against a non-test database risks destructive changes to real data. The safety check blocks execution until the environment is reconfigured to use a test or in-memory database.

Can this safety check be bypassed for local development?▼

No, the agent is designed to halt on violations rather than bypass them. The correct approach is to configure DDEV to use a test or :memory: database so the safety verification passes legitimately.