/testing-guide
GenAI-first testing with structural assertions, congruence validation, and tier-based test structure. Use when writing tests, setting up test infrastructure, or validating coverage. TRIGGER when: test, pytest, coverage, TDD, test patterns, congruence, validation. DO NOT TRIGGER
$ npx -y skills add akaszubski/autonomous-dev --skill testing-guide --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/testing-guide
Context preview
The summary Claude sees to decide when to auto-load this skill.
GenAI-first testing with structural assertions, congruence validation, and tier-based test structure. Use when writing tests, setting up test infrastructure, or validating coverage. TRIGGER when: test, pytest, coverage, TDD, test patterns, congruence, validation. DO NOT TRIGGER
SKILL.md
testing-guide.SKILL.mdname: testing-guide
description: "GenAI-first testing with structural assertions, congruence validation, and tier-based test structure. Use when writing tests, setting up test infrastructure, or validating coverage. TRIGGER when: test, pytest, coverage, TDD, test patterns, congruence, validation. DO NOT TRIGGER when: production code implementation, documentation, config-only changes."
allowed-tools: [Read, Grep, Glob, Bash]
Testing Guide
What to test, how to test it, and what NOT to test — for a plugin made of prompt files, Python glue, and configuration.
Philosophy: GenAI-First Testing
Traditional unit tests work for deterministic logic. But most bugs in this project are **drift** — docs diverge from code, agents contradict commands, component counts go stale. GenAI congruence tests catch these. Unit tests don't.
**Decision rule**: Can you write `assert x == y` and it won't break next week? → Unit test. Otherwise → GenAI test or structural test.
---
Three Test Patterns
1. Judge Pattern (single artifact evaluation)
An LLM evaluates one artifact against criteria. Use for: doc completeness, security posture, architectural intent.
pytestmark = [pytest.mark.genai]
def test_agents_documented_in_claude_md(self, genai):
agents_on_disk = list_agents()
claude_md = Path("CLAUDE.md").read_text()
result = genai.judge(
question="Does CLAUDE.md document all active agents?",
context=f"Agents on disk: {agents_on_disk}\nCLAUDE.md:\n{claude_md[:3000]}",
criteria="All active agents should be referenced. Score by coverage %."
)
assert result["score"] >= 5, f"Gap: {result['reasoning']}"2. Congruence Pattern (two-source cross-reference)
The most valuable pattern. An LLM checks two files that should agree. Use for: command↔agent alignment, FORBIDDEN lists, config↔reality.
def test_implement_and_implementer_share_forbidden_list(self, genai):
implement = Path("commands/implement.md").read_text()
implementer = Path("agents/implementer.md").read_text()
result = genai.judge(
question="Do these files have matching FORBIDDEN behavior lists?",
context=f"implement.md:\n{implement[:5000]}\nimplementer.md:\n{implementer[:5000]}",
criteria="Both should define same enforcement gates. Score 10=identical, 0=contradictory."
)
assert result["score"] >= 5Analytic Rubric Pattern (decomposed per-criterion evaluation)
More reliable than holistic scoring. Each criterion is evaluated independently with a binary MET/UNMET judgment. Use for: security posture, enforcement quality, multi-faceted assessments.
def test_security_posture_analytic(self, genai):
result = genai.judge_analytic(
question="Evaluate the security posture of this codebase",
context=f"Hook samples:\n{hook_content[:5000]}",
criteria=[
{"name": "No hardcoded secrets", "description": "No real API keys or tokens in source", "max_points": 1},
{"name": "Named exit codes", "description": "Hooks use named constants, not bare numbers", "max_points": 1},
{"name": "Path validation", "description": "File operations validate paths", "max_points": 1},
],
)
assert result["total_score"] >= 2, f"{result['total_score']}/{result['max_score']}: {result['reasoning']}"**Return value**: `{"criteria_results": [...], "total_score": N, "max_score": N, "pass": bool, "band": str, "reasoning": str}`
**When to use**: Multi-faceted evaluations where you need to know which specific criteria passed or failed. Each criterion gets its own LLM call for independent judgment.
Consistency Check Pattern (multi-round agreement)
For high-stakes judgments where a single LLM evaluation might be unreliable. Runs multiple rounds and checks for agreement. Uses median score as the final result.
def test_pipeline_completeness_consistent(self, genai):
result = genai.judge_consistent(
question="Does implement.md define a complete SDLC pipeline?",
context=f"implement.md:\n{content[:6000]}",
criteria="Pipeline should have research, plan, test, implement, review, security, docs steps.",
rounds=3,
)
assert result["final_score"] >= 7, f"median={result['final_score']}, agreement={result['agreement']}"**Return value**: `{"rounds": [...], "agreement": bool, "scores": [...], "final_score": median, "pass": bool, "band": str, "reasoning": str}`
**When to use**: Critical assessments where false positives/negatives are costly. Agreement=False signals the evaluation needs human review.
Temperature Guidance
All `ask()` calls default to `temperature=0` for deterministic, reproducible judging. Override only when you need creative/diverse outputs:
# Default: temperature=0 (deterministic judging)
response = genai.ask("Evaluate this code", temperature=0)
# Override for creative tasks like edge case generation
response = genai.ask("Generate unusual test inputs", temperature=0.7)3. Cross-Validation Pattern (two sources that must match)
No LLM needed. When two configs/files must stay in sync, read both and compare directly. Catches the #1 recurring bug class: adding something to one place but not the other.
def test_policy_and_hook_in_sync(self):
"""Policy always_allowed and hook NATIVE_TOOLS must be identical."""
policy_tools = set(json.load(open(POLICY_FILE))["tools"]["always_allowed"])
hook_tools = hook.NATIVE_TOOLS
# Check BOTH directions
assert policy_tools - hook_tools == set(), f"In policy not hook: {policy_tools - hook_tools}"
assert hook_tools - policy_tools == set(), f"In hook not policy: {hook_tools - policy_tools}"**When to use**: Any time two files define overlapping data — permissions↔hook, manifest↔disk, config↔worktree copy, command frontmatter↔policy. **Key principle**: Read both sources dynamically. Never hardcode expected values i
Read more
name: testing-guide description: "GenAI-first testing with structural assertions, congruence validation, and tier-based test structure. Use when writing tests, setting up test infrastructure, or validating coverage. TRIGGER when: test, pytest, coverage, TDD, test patterns, congruence, validation. DO NOT TRIGGER when: production code implementation, documentation, config-only changes." allowed-tools: [Read, Grep, Glob, Bash]
Testing Guide
What to test, how to test it, and what NOT to test — for a plugin made of prompt files, Python glue, and configuration.
Philosophy: GenAI-First Testing
Traditional unit tests work for deterministic logic. But most bugs in this project are **drift** — docs diverge from code, agents contradict commands, component counts go stale. GenAI congruence tests catch these. Unit tests don't.
**Decision rule**: Can you write `assert x == y` and it won't break next week? → Unit test. Otherwise → GenAI test or structural test.
---
Three Test Patterns
1. Judge Pattern (single artifact evaluation)
An LLM evaluates one artifact against criteria. Use for: doc completeness, security posture, architectural intent.
pytestmark = [pytest.mark.genai]
def test_agents_documented_in_claude_md(self, genai):
agents_on_disk = list_agents()
claude_md = Path("CLAUDE.md").read_text()
result = genai.judge(
question="Does CLAUDE.md document all active agents?",
context=f"Agents on disk: {agents_on_disk}\nCLAUDE.md:\n{claude_md[:3000]}",
criteria="All active agents should be referenced. Score by coverage %."
)
assert result["score"] >= 5, f"Gap: {result['reasoning']}"2. Congruence Pattern (two-source cross-reference)
The most valuable pattern. An LLM checks two files that should agree. Use for: command↔agent alignment, FORBIDDEN lists, config↔reality.
def test_implement_and_implementer_share_forbidden_list(self, genai):
implement = Path("commands/implement.md").read_text()
implementer = Path("agents/implementer.md").read_text()
result = genai.judge(
question="Do these files have matching FORBIDDEN behavior lists?",
context=f"implement.md:\n{implement[:5000]}\nimplementer.md:\n{implementer[:5000]}",
criteria="Both should define same enforcement gates. Score 10=identical, 0=contradictory."
)
assert result["score"] >= 5Analytic Rubric Pattern (decomposed per-criterion evaluation)
More reliable than holistic scoring. Each criterion is evaluated independently with a binary MET/UNMET judgment. Use for: security posture, enforcement quality, multi-faceted assessments.
def test_security_posture_analytic(self, genai):
result = genai.judge_analytic(
question="Evaluate the security posture of this codebase",
context=f"Hook samples:\n{hook_content[:5000]}",
criteria=[
{"name": "No hardcoded secrets", "description": "No real API keys or tokens in source", "max_points": 1},
{"name": "Named exit codes", "description": "Hooks use named constants, not bare numbers", "max_points": 1},
{"name": "Path validation", "description": "File operations validate paths", "max_points": 1},
],
)
assert result["total_score"] >= 2, f"{result['total_score']}/{result['max_score']}: {result['reasoning']}"**Return value**: `{"criteria_results": [...], "total_score": N, "max_score": N, "pass": bool, "band": str, "reasoning": str}`
**When to use**: Multi-faceted evaluations where you need to know which specific criteria passed or failed. Each criterion gets its own LLM call for independent judgment.
Consistency Check Pattern (multi-round agreement)
For high-stakes judgments where a single LLM evaluation might be unreliable. Runs multiple rounds and checks for agreement. Uses median score as the final result.
def test_pipeline_completeness_consistent(self, genai):
result = genai.judge_consistent(
question="Does implement.md define a complete SDLC pipeline?",
context=f"implement.md:\n{content[:6000]}",
criteria="Pipeline should have research, plan, test, implement, review, security, docs steps.",
rounds=3,
)
assert result["final_score"] >= 7, f"median={result['final_score']}, agreement={result['agreement']}"**Return value**: `{"rounds": [...], "agreement": bool, "scores": [...], "final_score": median, "pass": bool, "band": str, "reasoning": str}`
**When to use**: Critical assessments where false positives/negatives are costly. Agreement=False signals the evaluation needs human review.
Temperature Guidance
All `ask()` calls default to `temperature=0` for deterministic, reproducible judging. Override only when you need creative/diverse outputs:
# Default: temperature=0 (deterministic judging)
response = genai.ask("Evaluate this code", temperature=0)
# Override for creative tasks like edge case generation
response = genai.ask("Generate unusual test inputs", temperature=0.7)3. Cross-Validation Pattern (two sources that must match)
No LLM needed. When two configs/files must stay in sync, read both and compare directly. Catches the #1 recurring bug class: adding something to one place but not the other.
def test_policy_and_hook_in_sync(self):
"""Policy always_allowed and hook NATIVE_TOOLS must be identical."""
policy_tools = set(json.load(open(POLICY_FILE))["tools"]["always_allowed"])
hook_tools = hook.NATIVE_TOOLS
# Check BOTH directions
assert policy_tools - hook_tools == set(), f"In policy not hook: {policy_tools - hook_tools}"
assert hook_tools - policy_tools == set(), f"In hook not policy: {hook_tools - policy_tools}"**When to use**: Any time two files define overlapping data — permissions↔hook, manifest↔disk, config↔worktree copy, command frontmatter↔policy. **Key principle**: Read both sources dynamically. Never hardcode expected values i
Showing the first part of this file.
A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.
Repo: akaszubski/autonomous-dev
Other skills on autonomous-dev.
- /api-design
REST API design best practices covering versioning, error handling, pagination, and OpenAPI documentation. Use when designing or implementing REST APIs or HTTP endpoints. TRIGGER when: API design, REST endpoint, HTTP route, OpenAPI, swagger, pagination. DO NOT TRIGGER when:
Open skill - /api-integration-patterns
Subprocess safety, GitHub CLI integration, retry logic, authentication, rate limiting, and timeout handling. Use when integrating external APIs or CLI tools. TRIGGER when: subprocess, gh cli, API call, retry logic, rate limiting, authentication. DO NOT TRIGGER when: internal
Open skill - /architecture-patterns
File-by-file architecture planning with ADR format, dependency ordering, and testability gates. Use when designing system architecture or creating ADRs. TRIGGER when: architecture plan, system design, ADR, file breakdown, component design. DO NOT TRIGGER when: simple config
Open skill - /code-review
10-point code review checklist covering correctness, tests, error handling, type hints, naming, security, and performance. Use when reviewing PRs or evaluating code quality. TRIGGER when: code review, PR review, review checklist, code quality check. DO NOT TRIGGER when: writing
Open skill - /content-allocation
One topic, one home. Routes content to its canonical store (CLAUDE.md, PROJECT.md, MEMORY.md, docs/, memory/) and audits for duplication. TRIGGER when: auditing CLAUDE.md/PROJECT.md/MEMORY.md sizes, deduplicating docs, applying the content-allocation pattern to a new repo,
Open skill - /debugging-workflow
Systematic debugging methodology — reproduce, isolate, bisect, fix, verify. Use when diagnosing failures, tracing errors, or investigating unexpected behavior. TRIGGER when: debug, error, traceback, stack trace, bisect, breakpoint, failing test, unexpected behavior. DO NOT
Open skill

