Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计提醒

nm-sanctum-test-updatesnm sainttum 测试更新

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

3,394

周安装

140

GitHub Stars

公开资料未说明

下载量

1,109
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nm-sanctum-test-updates(nm sainttum 测试更新)
来源仓库:https://github.com/athola/nm-sanctum-test-updates
安装命令:
openclaw skills install nm-sanctum-test-updates
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install nm-sanctum-test-updates

简介

根据代码变更自动更新相关测试用例。

  • 适合测试驱动开发的持续演进。nm-sanctum-test-updates 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 集成 git-workspace-review 进行上下文感知。
  • 需配置测试框架和夹具数据路径。
  • 注意保持测试与实现的双向同步。

SKILL.md

name
test-updates
description
|
version
1.8.2
triggers
metadata
{"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/sanctum", "emoji": "\�\�", "requires": {"config": ["night-market.test-driven-development", "night-market.git-workspace-review", "night-market.file-analysis"]}}}
source
claude-night-market
source_plugin
sanctum
Night Market Skill — ported from claude-night-market/sanctum. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Table of Contents

Test Updates and Maintenance

Overview

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.

Core Philosophy

  • RED-GREEN-REFACTOR: Strict adherence to TDD cycle
  • Behavior-First: BDD patterns that describe what code should do
  • Meta Dogfooding: The skill's own tests demonstrate the principles it teaches
  • Quality Gates: detailed validation before considering tests complete

What It Is

A modular test management system that:

  • Discovers what needs testing or updating
  • Generates tests following TDD principles
  • Enhances existing tests with BDD patterns
  • Validate test quality through multiple lenses

Quick Start

Quick Checklist for First Time Use

  • [ ] validate pytest is installed (pip install pytest)
  • [ ] Have your source code in src/ or similar directory
  • [ ] Create a tests/ directory if it doesn't exist
  • [ ] Run Skill(sanctum:git-workspace-review) first to understand changes
  • [ ] Start with Skill(test-updates) --target <specific-module> for focused updates

detailed Test Update

# Run full test update workflow
Skill(test-updates)

Verification: Run pytest -v to verify tests pass.

Targeted Test Updates

# 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.

TDD for New Features

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

Verification: Run pytest -v to verify tests pass.

Using the Scripts Directly

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.

When To Use It

Use this skill when you need to:

  • Update tests after code changes
  • Generate tests for new features
  • Improve existing test quality
  • validate detailed test coverage

Perfect for:

  • Pre-commit test validation
  • CI/CD pipeline integration
  • Refactoring with test safety
  • Onboarding new developers

When NOT To Use

  • Auditing

test suites - use pensive:test-review

  • Writing production code

- focus on implementation first

  • Auditing

test suites - use pensive:test-review

  • Writing production code

- focus on implementation first

Workflow Integration

Phase 1: Discovery

  1. Scan codebase for test gaps
  2. Analyze recent changes
  3. Identify broken or outdated tests

See modules/test-discovery.md for detection patterns.

Phase 2: Strategy

  1. Choose appropriate BDD style (see modules/bdd-patterns.md)
  2. Plan test structure
  3. Define quality criteria

Phase 3: Implementation

  1. Write failing tests (RED) - see modules/tdd-workflow.md
  2. Implement minimal passing code (GREEN)
  3. Refactor for clarity (REFACTOR)

See modules/test-generation.md for generation templates.

Phase 4: Validation

  1. Static analysis and linting
  2. Dynamic test execution
  3. Coverage and quality metrics

See modules/quality-validation.md for validation criteria.

Quality Assurance

The skill applies multiple quality checks:

  • Static: Linting, type checking, pattern validation
  • Dynamic: Test execution in sandboxed environments
  • Metrics: Coverage, mutation score, complexity analysis
  • Review: Structured checklists for peer validation

Examples

BDD-Style Test Generation

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.

Test Enhancement

  • Add edge cases and error scenarios
  • Include performance benchmarks
  • Add mutation testing for robustness

See modules/test-enhancement.md for enhancement strategies.

Integration with Existing Skills

  1. git-workspace-review: Get context of changes
  2. file-analysis: Understand code structure
  3. test-driven-development: Apply strict TDD discipline
  4. skills-eval: Validate quality and compliance

Success Metrics

  • Test coverage > 85%
  • All tests follow BDD patterns
  • Zero broken tests in CI
  • Mutation score > 80%

Troubleshooting FAQ

Common Issues

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:

  1. Run the test and confirm it fails for the right reason
  2. Implement minimal code to make it pass
  3. Refactor for clarity

Q: Quality score is low despite having tests A: Check for these common issues:

  • Missing BDD patterns (Given/When/Then)
  • Vague assertions like assert result is not None
  • Tests without documentation
  • Long, complex tests (>50 lines)

Q: Generated tests don't match my code structure A: The scripts analyze AST patterns and may need guidance:

  • Use --style flag to match your preferred BDD style
  • Check that source files have proper function/class definitions
  • Review the generated scaffolding and customize as needed

Q: Mutation testing takes too long A: Mutation testing is resource-intensive:

  • Use --quick-mutation flag for subset testing
  • Focus on critical modules first
  • Run overnight for detailed analysis

Q: Can't find tests for my file A: The analyzer uses naming conventions:

  • Source: my_module.py → Test: test_my_module.py
  • Check that test files follow pytest naming patterns
  • validate test directory structure is standard

Performance Tips

  • Large codebases: Use --target to focus on specific directories
  • CI integration: Run validation in parallel with other checks
  • Memory usage: Process files in batches for very large projects

Getting Help

  1. Check script outputs for detailed error messages
  2. Use --verbose flag for more information
  3. Review the validation report for specific recommendations
  4. Start with small modules to understand patterns before scaling

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

87.09%
按下载量换算966

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills