test-ambiguity-detector
БесплатноБез исполняемых скриптовНе проверенAnalyze test cases against specifications to find ambiguous assumptions. Use when tests might be making assumptions not explicitly defined in the spec. Invoke…
Об этом скилле
Test Ambiguity Detector
Compare a test file against its specification to identify where tests assume behavior that the spec doesn't explicitly define.
Usage: /test-ambiguity-detector file_backup checkpoint_1
Purpose
Tests should verify spec-defined behavior, not invent requirements. This skill finds cases where:
- Tests assert specific behavior the spec is silent about
- Tests assume implementation details not mandated by spec
- Tests expect particular error messages/codes not specified
- Tests require specific ordering/formatting beyond spec requirements
Step 1: Gather Context
Read the spec and test files for the specified problem/checkpoint:
problems/{problem}/checkpoint_N.md
problems/{problem}/tests/test_checkpoint_N.py
problems/{problem}/tests/conftest.py # Fixtures and test setup
Also check for test data:
problems/{problem}/tests/data/checkpoint_N/ # Test case data (if present)
Step 2: Catalog Spec Requirements
For each section of the spec, extract:
- Explicit requirements - "MUST", "SHALL", specific values, exact formats
- Implicit requirements - Reasonable inferences from context
- Undefined behaviors - What the spec does NOT address
Create a mental checklist:
- Input validation rules (if any specified)
- Output format requirements (exact vs flexible)
- Error handling expectations (if any specified)
- Edge cases addressed (explicitly or by example)
- Processing order requirements
- Default values specified
Step 3: Analyze Each Test
For each test function or test case:
A. Identify the Assertion
What specific behavior does this test check?
- Return values
- Output format/content
- Side effects
- Error conditions
- State changes
B. Find Spec Support
Can you point to a specific spec line that mandates this behavior?
SUPPORTED: Spec says "must return error code 1" → test checks returncode == 1
UNSUPPORTED: Spec says "must return non-zero on error" → test checks returncode == 1
C. Classify the Assumption
| Category | Example | Risk Level |
|---|---|---|
| Explicit | Spec says X, test checks X | None |
| Reasonable Inference | Spec implies X, test checks X | Low |
| Implementation Choice | Spec silent, test assumes X | HIGH |
| Contradiction | Spec says X, test checks Y | CRITICAL |
Step 4: Report Findings
Generate a report in this format:
# Ambiguity Report: {problem} {checkpoint}
## Summary
- Total tests analyzed: N
- Potentially ambiguous: N
- Likely spec issues: N
## Ambiguous Test Assumptions
### 1. `test_function_name` (line X)
**Assertion**: [What the test checks]
**Spec says**: [Quote or "NOTHING - spec is silent"]
**Risk**: [HIGH/MEDIUM/LOW]
**Analysis**: [Why this is problematic]
**Recommendation**:
- [ ] Clarify in spec: [suggested text]
- [ ] OR relax test: [how to make less specific]
- [ ] OR remove test: [if testing undefined behavior]
---
### 2. `test_another_function` (line Y)
...
## Spec Gaps Identified
List behaviors tested but not defined in spec:
1. [Behavior] - should spec define this?
2. ...
## Recommendations
### For Spec Authors
- [Suggested clarifications]
### For Test Authors
- [Suggested test modifications]
Common Ambiguity Patterns
Error Handling
- Ambiguous: Spec says "return error" but test expects specific code/message
- Check: Does spec define error codes? Error message format?
Ordering
- Ambiguous: Spec says "process items" but test expects specific order
- Check: Does spec mandate sorting? Stable ordering?
Whitespace/Formatting
- Ambiguous: Spec shows example output, test requires exact formatting
- Check: Does spec say "must match exactly" or just "must contain"?
Empty/Null Inputs
- Ambiguous: Test expects specific behavior for empty input
- Check: Does spec address empty/null cases?
Boundary Values
- Ambiguous: Test checks behavior at 0, max, or edge values
- Check: Does spec define boundary behavior?
Field Ordering in JSON/YAML
- Ambiguous: Test expects fields in specific order
- Check: Does spec mandate field ordering?
Case Sensitivity
- Ambiguous: Test expects case-sensitive/insensitive matching
- Check: Does spec specify case handling?
Red Flags in Tests
Watch for these patterns that often indicate ambiguity:
# Specific error code not in spec
assert result.returncode == 42
# Exact error message not in spec
assert "invalid format" in result.stderr
# Specific field ordering
assert json.dumps(output) == '{"a":1,"b":2}'
# Implicit sorting expectations
assert results == sorted(results)
# Default value assumptions
assert config.get("timeout") == 30
# Specific exception types
with pytest.raises(ValueError):
Example Analysis
Given spec text:
Return non-zero exit code on invalid input.
And test:
def test_invalid_input():
re
Установить test-ambiguity-detector в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-ambiguity-detector?
Analyze test cases against specifications to find ambiguous assumptions. Use when tests might be making assumptions not explicitly defined in the spec. Invoke with /test-ambiguity-detector <problem> <checkpoint>.
Как установить скилл test-ambiguity-detector?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-ambiguity-detector запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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