Updates, generates, and validates tests using git-workspace context and TDD/BDD methodology. Use when code changes require new or updated test coverage.
npx skills add https://github.com/athola/claude-night-market --skill test-updates
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:
test suites - use pensive:test-review
test suites - use pensive:test-review
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:
never the reverse)
without versioning)
test the properties that justify that choice)
zones)
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} — "
f"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.
modules/tdd-workflow.mdSee 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):
"""
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 updatesare applied to the target files
pytest --cov
the BDD pattern from modules/bdd-patterns.md
quality_checker.py --validate <test_file> --output-jsonreturns quality_score ≥ 80 for each updated test file
review with the three options (preserve/layer/revise) before
any assertion is modified
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Take athola/test-updates from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.