Best for
- Update tests after code changes
- Generate tests for new features
- Improve existing test quality
athola/claude-night-market/plugins/sanctum/skills/test-updates/SKILL.md
Updates, generates, and validates tests using git-workspace context and TDD/BDD methodology. Use when code changes require new or updated test coverage.
Decision brief
Updates, generates, and validates tests using git-workspace context and TDD/BDD methodology.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/athola/claude-night-market --skill "plugins/sanctum/skills/test-updates"Inspect the Agent Skill "test-updates" from https://github.com/athola/claude-night-market/blob/6720bb5cdeadeea6de6e4786a449126b3d417536/plugins/sanctum/skills/test-updates/SKILL.md at commit 6720bb5cdeadeea6de6e4786a449126b3d417536. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
[ ] validate pytest is installed (pip install pytest)
Skill(test-updates) bash
1. Scan codebase for test gaps 2. Analyze recent changes 3. Identify broken or outdated tests
1. Scan codebase for test gaps 2. Analyze recent changes 3. Identify broken or outdated tests
1. Choose appropriate BDD style (see modules/bdd-patterns.md) 2. Plan test structure 3. Define quality criteria 4. Identify design invariants to encode as tests
Permission review
The documentation asks the agent to create, modify, or delete local files.
[ ] Create a `tests/` directory if it doesn't existThe documentation asks the agent to run terminal commands or scripts.
python plugins/sanctum/scripts/test_analyzer.py --scan src/The documentation asks the agent to run terminal commands or scripts.
python plugins/sanctum/scripts/test_generator.py \The documentation asks the agent to read local files, directories, or repositories.
Scan codebase for test gapsEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 331 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
detailed test management system that applies TDD/BDD principles to maintain, generate, and enhance tests across codebases. This skill practices what it preaches - it uses TDD principles for its own development and serves as a living example of best practices.
A modular test management system that:
pip install pytest)src/ or similar directorytests/ directory if it doesn't existSkill(sanctum:git-workspace-review) first to understand changesSkill(test-updates) --target <specific-module> for focused updates# Run full test update workflow
Skill(test-updates)
Verification: Run pytest -v to verify tests pass.
# Update tests for specific paths
Skill(test-updates) --target src/sanctum/agents
Skill(test-updates) --target tests/test_commit_messages.py
Verification: Run pytest -v to verify tests pass.
# Apply TDD to new code
Skill(test-updates) --tdd-only --target new_feature.py
Verification: Run pytest -v to verify tests pass.
Human-Readable Output:
# Analyze test coverage gaps
python plugins/sanctum/scripts/test_analyzer.py --scan src/
# Generate test scaffolding
python plugins/sanctum/scripts/test_generator.py \
--source src/my_module.py --style pytest_bdd
# Check test quality
python plugins/sanctum/scripts/quality_checker.py \
--validate tests/test_my_module.py
Verification: Run pytest -v to verify tests pass.
Programmatic Output (for Claude Code):
# Get JSON output for programmatic parsing - test_analyzer
python plugins/sanctum/scripts/test_analyzer.py \
--scan src/ --output-json
# Returns:
# {
# "success": true,
# "data": {
# "source_files": ["src/module.py", ...],
# "test_files": ["tests/test_module.py", ...],
# "uncovered_files": ["module_without_tests", ...],
# "coverage_gaps": [{"file": "...", "reason": "..."}]
# }
# }
# Get JSON output - test_generator
python plugins/sanctum/scripts/test_generator.py \
--source src/my_module.py --output-json
# Returns:
# {
# "success": true,
# "data": {
# "test_file": "path/to/test_my_module.py",
# "source_file": "src/my_module.py",
# "style": "pytest_bdd",
# "fixtures_included": true,
# "edge_cases_included": true,
# "error_cases_included": true
# }
# }
# Get JSON output - quality_checker
python plugins/sanctum/scripts/quality_checker.py \
--validate tests/test_my_module.py --output-json
# Returns:
# {
# "success": true,
# "data": {
# "static_analysis": {...},
# "dynamic_validation": {...},
# "metrics": {...},
# "quality_score": 85,
# "quality_level": "QualityLevel.GOOD",
# "recommendations": [...]
# }
# }
Verification: Run pytest -v to verify tests pass.
Use this skill when you need to:
Perfect for:
See modules/test-discovery.md for detection patterns.
modules/bdd-patterns.md)Before writing behavioral tests, identify the design invariants that the code relies on and write tests that would break if those invariants were violated.
What to encode:
Example:
def test_plugins_never_import_from_other_plugins():
"""Encode the invariant: plugins are independent modules.
If this test breaks, someone is coupling plugins
directly. Present the 3 options to a human:
1. Preserve: revert the import, keep plugins independent
2. Layer: add a shared interface in leyline instead
3. Revise: merge the plugins (requires ADR)
"""
for plugin_dir in plugin_dirs:
imports = extract_imports(plugin_dir)
for imp in imports:
assert not imp.startswith("plugins."), (
f"{plugin_dir} imports {imp} — violates plugin independence invariant"
)
Why this matters: Tests that encode invariants are load-bearing. When an agent later encounters a feature that clashes with the invariant, the test failure forces a conscious decision rather than a silent drift. Without these tests, bad invariant decisions compound until the codebase is unsalvageable.
When updating existing tests:
If an invariant-encoding test needs to change, do NOT silently update the assertion. Flag it for human review with the three options: preserve the invariant, layer on top, or revise the invariant. This is a judgment call that requires human wisdom: models default to the "average" of training data and get these wrong far too often.
Skill(superpowers:test-driven-development)
for the cycle; modules/tdd-workflow.md for what is localSee modules/test-generation.md for generation templates.
See modules/quality-validation.md for validation criteria.
The skill applies multiple quality checks:
See modules/bdd-patterns.md for additional patterns.
class TestGitWorkflow:
"""BDD-style tests for Git workflow operations."""
def test_commit_workflow_with_staged_changes(self):
"""Committing with staged changes produces a formatted commit.
GIVEN a Git repository with staged changes
WHEN the user runs the commit workflow
THEN it should create a commit with proper message format
AND all tests should pass
"""
# Test implementation following TDD principles
pass
Verification: Run pytest -v to verify tests pass.
See modules/test-enhancement.md for enhancement strategies.
Q: Tests are failing after generation A: This is expected! The skill follows TDD principles - generated tests are designed to fail first. Follow the RED-GREEN-REFACTOR cycle:
Q: Quality score is low despite having tests A: Check for these common issues:
assert result is not NoneQ: Generated tests don't match my code structure A: The scripts analyze AST patterns and may need guidance:
--style flag to match your preferred BDD styleQ: Mutation testing takes too long A: Mutation testing is resource-intensive:
--quick-mutation flag for subset testingQ: Can't find tests for my file A: The analyzer uses naming conventions:
my_module.py → Test: test_my_module.py--target to focus on specific directories--verbose flag for more informationpytest -v passes with zero failures after all test updates
are applied to the target filespytest --covmodules/bdd-patterns.mdquality_checker.py --validate <test_file> --output-json
returns quality_score ≥ 80 for each updated test fileFrequently asked questions
Updates, generates, and validates tests using git-workspace context and TDD/BDD methodology.
The source record exposes this install command: npx skills add https://github.com/athola/claude-night-market --skill "plugins/sanctum/skills/test-updates". Inspect the command and pinned source before running it.
Static rules flagged write-files, exec-script, read-files in the source; the page lists the matching lines and excerpts.
Alternatives
trailofbits/skills
Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before/after mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving t
travisjneuman/.claude
This skill should be used when writing test cases, fixing bugs, analyzing code for potential issues, or improving test coverage for JavaScript/TypeScript applications. Use this for unit tests, integration tests, end-to-end tests, debugging runtime errors, logic bugs, performance issues, security vulnerabilities, and systematic code analysis.
K-Dense-AI/scientific-agent-skills
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.
dotnet/skills
MANDATORY for static source-to-test pairing: find or list source files/modules without corresponding tests, or suggest test locations from repository structure. Invoke even for a tiny package; do not substitute manual globbing. Uses Roslyn for C#/.NET and tree-sitter for Python, TS/JS, Go, Java, Rust, and Ruby. DO NOT USE FOR: real line/branch/Cobertura data, coverage-backed test priorities, CRAP risk, or grading existing tests.