Testing & Validation
БесплатноЗапускает вложенные скриптыНе проверенTest and validation workflow before commit
Об этом скилле
Skill: Testing & Validation
When to use this skill
- BEFORE any commit (mandatory)
- After implementing a feature
- To validate a refactoring
- When in doubt about code quality
Automated script
# Full validation (format + clippy + test)
./.agent/skills/testing/scripts/validate.sh
# With auto-fix formatting
./.agent/skills/testing/scripts/validate.sh --fix
Validation workflow
Step 1: Format
cargo fmt --all
Automatically formats all code according to Rust conventions.
Step 2: Lint
cargo clippy --all-targets -- -D warnings
Rules:
- NO warnings allowed
- Fix clippy suggestions, don't ignore them with
#[allow(...)] - If an allow is really necessary, justify it in a comment
Step 3: Tests
cargo test
Rules:
- All tests must pass
- A failing test = no commit
- New tests should cover edge cases
Async Tests (MANDATORY)
When writing #[tokio::test], preventing infinite hangs is critical:
- Always use timeouts for channel operations (
recv().await).// ❌ Potential hang let msg = rx.recv().await.unwrap(); // ✅ Safe let msg = tokio::time::timeout(std::time::Duration::from_secs(1), rx.recv()) .await .expect("Timeout waiting for message")?; - Avoid infinite loops without exit conditions or timeouts.
Step 4: Release verification (optional)
cargo build --release
Do this before a release or to verify optimizations.
Quick commands
# Full validation in one line
cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test
# Specific tests
cargo test test_name # A specific test
cargo test module_name:: # All tests in a module
cargo test --lib # Library tests only
cargo test --test integration # Integration tests
On failure
Clippy warning
- Read the error message carefully
- Apply clippy's suggestion
- If the suggestion is not applicable, justify with a comment
Test failure
- Identify the failing test
- Check if it's a bug in the code or in the test
- NEVER delete a test to make CI pass
- Fix the code or adapt the test if behavior changed intentionally
Checklist before commit
-
cargo fmtexecuted -
cargo clippywithout warnings -
cargo testall tests pass - Documentation updated (if needed)
- GLOBAL_APP_DESCRIPTION.md updated (if new feature)
- Version incremented in Cargo.toml
Установить Testing & Validation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл Testing & Validation?
Test and validation workflow before commit
Как установить скилл Testing & Validation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Testing & Validation запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic