Skip to content
Development
Command

/update-tests

Review and update test coverage using TDD/BDD methodology with quality validation. Generates tests for changed code.

From plugin
claude-night-market
325163 skills59 agents163 commands1 MCP
Install
$ npx -y skills add athola/claude-night-market --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/update-tests

Context preview

What this command does when you run it.

Review and update test coverage using TDD/BDD methodology with quality validation. Generates tests for changed code.

Command definition

update-tests.md
name: update-tests
description: Review and update test coverage using TDD/BDD methodology with quality validation. Generates tests for changed code.
usage: /update-tests [paths...]

Update Tests

To update tests following TDD/BDD principles with meta dogfooding, load skills in order:

1. Run `Skill(sanctum:git-workspace-review)` to capture change context and complete its `TodoWrite` items. 2. Run `Skill(test-updates)` and follow the detailed workflow:

  • **Discovery**: Analyze codebase for test gaps and changes
  • **Generation**: Create new tests using TDD principles
  • **Enhancement**: Apply BDD patterns to existing tests
  • **Validation**: Run quality assurance checks

When To Use

Use this command when you need to:

  • Tests need updates after code changes
  • Improving test coverage with TDD/BDD patterns

When NOT To Use

  • Simple changes that don't need the full workflow
  • Work already completed through another sanctum command

Workflow

Discovery Phase

  • detailed scan of codebase for test coverage gaps
  • Git-based change detection for recent modifications
  • Targeted analysis when specific paths provided
  • Priority scoring based on impact and risk

Test Generation

  • Write failing tests first (RED phase)
  • Generate scaffolding for new code
  • Apply TDD discipline strictly
  • Follow meta dogfooding principles

Enhancement

  • Transform basic tests to BDD style
  • Add edge cases and error scenarios
  • Improve test organization and clarity
  • Apply consistent patterns

Quality Validation

  • Static analysis for code quality
  • Dynamic test execution verification
  • Coverage and mutation metrics
  • Peer review checklist generation

Usage Examples

Full Test Suite Update

# Update entire test suite
Skill(test-updates)

# With git context
Skill(sanctum:git-workspace-review)
Skill(test-updates) --detailed

Targeted Updates

# Update tests for specific module
Skill(test-updates) --target src/sanctum/agents

# Update specific test file
Skill(test-updates) --target tests/test_commit_messages.py

# Update for recent changes only
Skill(test-updates) --changes-only

TDD for New Features

# Apply TDD to new code
Skill(test-updates) --tdd-only --target new_feature.py

# Generate test scaffolding
Skill(test-updates) --scaffold-only --target src/new_module/

Quality Gates

Before completing, validate:

  • [ ] All tests follow BDD patterns
  • [ ] Coverage meets minimum standards (85% line, 80% branch)
  • [ ] Mutation score is acceptable (>80%)
  • [ ] Tests are independent and fast
  • [ ] Documentation is clear and detailed

Manual Execution

If skills cannot be loaded, follow these steps:

1. **Analyze Changes**

   git status
   git diff --name-only HEAD~1
   find src -name "*.py" -exec wc -l {} \;

2. **Run Coverage Analysis**

   uv run pytest --cov=src --cov-report=term-missing

3. **Apply TDD**

  • Write failing test first
  • Implement minimal code to pass
  • Refactor for clarity

4. **Add BDD Patterns**

  • Use Given/When/Then structure
  • Add descriptive test names
  • Include edge cases

5. **Validate Quality**

   uv run ruff check tests/
   uv run mypy tests/
   uv run pytest -v

Integration with CI/CD

The command integrates with CI/CD pipelines:

  • Pre-commit validation
  • Pull request checks
  • Coverage reporting
  • Quality gate enforcement

Meta Dogfooding

This command practices what it preaches:

  • Its own tests follow strict TDD
  • Uses BDD patterns for behavior clarity
  • Validates quality continuously
  • Serves as a living example of best practices
Read more
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

Get the whole plugin, auto-invoked
Stats
325
Stars
0
Views
35
Forks
Active
Maintenance
Python
Language
MIT
License
1d ago
Last commit
8mo ago
Created

Repo: athola/claude-night-market