Table of Contents - Quick Start - When to Use - Required TodoWrite Items - Progressive Loading - Workflow - Step 1: Detect Languages ( )) - Step 2: Inventory Coverage ( )) - Step 3: Assess Scenario Quality ( )) - Step 4: Plan Remediation ( )) - Step 5: Log Evidence ( )) - Test Quality Checklist (Condensed)) - Output Format - Summary - Framework Detection - Coverage Analysis - Quality Issues - Remediation Plan - Recommendation - Integration Notes - Exit Criteria Test Review Workflow Evaluate and improve test suites with TDD/BDD rigor. Quick Start Verification: Run to verify tests pass. When To…

\n```\n\n4. **Version constraints**:\n- Extract MSRV, Python version, Node version\n- Note if constraints affect tooling (e.g., async/await)\n- Document CI/CD version requirements\n\n## Output Format\n\n```markdown\n## Framework Detection\n- **Languages**: Rust, Python\n- **Frameworks**: cargo test, pytest\n- **Versions**:\n - Rust MSRV: 1.70\n - Python: >=3.8\n- **Config files**: Cargo.toml, pyproject.toml\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2315,"content_sha256":"359725cc1d2258f8a436e67d9308c54d57312c9f46d361a954bddc231bcc8eb3"},{"filename":"modules/remediation-planning.md","content":"---\nparent_skill: pensive:test-review\nname: remediation-planning\ndescription: Test improvement strategies and phased remediation\ncategory: testing\ntags: [remediation, test-improvement, refactoring]\nload_priority: 4\nestimated_tokens: 300\n---\n\n# Remediation Planning\n\nConcrete strategies for test improvement.\n\n## Test Improvement Patterns\n\n### 1. Add Missing Coverage\nTie tests to specific behaviors using Given/When/Then:\n\n```markdown\n### Gap: Authentication edge cases\n**Behavior**: Given missing auth token, When hitting /v1/resource, Then HTTP 401 returned\n**Test**: `tests/test_auth.py::test_missing_token_returns_401`\n**Priority**: High (security boundary)\n```\n\n### 2. Refactor Test Helpers\n\n**Before** (repeated setup):\n```python\ndef test_user_creation():\n db = setup_database()\n config = load_test_config()\n user_data = {\"email\": \"[email protected]\", \"role\": \"user\"}\n ...\n\ndef test_user_deletion():\n db = setup_database()\n config = load_test_config()\n user_data = {\"email\": \"[email protected]\", \"role\": \"admin\"}\n ...\n```\n\n**After** (fixtures):\n```python\[email protected]\ndef test_db():\n db = setup_database()\n yield db\n db.teardown()\n\[email protected]\ndef test_config():\n return load_test_config()\n\ndef test_user_creation(test_db, test_config):\n user_data = user_factory(email=\"[email protected]\")\n ...\n```\n\n### 3. Data Builders and Factories\n\n**Factory pattern**:\n```python\n# conftest.py\ndef user_factory(**overrides):\n defaults = {\n \"email\": \"[email protected]\",\n \"role\": \"user\",\n \"verified\": True,\n \"created_at\": datetime.now()\n }\n return User(**{**defaults, **overrides})\n\n# test file\ndef test_admin_access():\n admin = user_factory(role=\"admin\")\n assert admin.can_access_dashboard()\n```\n\n**Builder pattern** (Rust):\n```rust\nstruct UserBuilder {\n email: String,\n role: Role,\n verified: bool,\n}\n\nimpl UserBuilder {\n fn new() -> Self {\n Self {\n email: \"[email protected]\".to_string(),\n role: Role::User,\n verified: true,\n }\n }\n\n fn with_role(mut self, role: Role) -> Self {\n self.role = role;\n self\n }\n\n fn build(self) -> User {\n User { /* ... */ }\n }\n}\n\n#[test]\nfn test_admin_permissions() {\n let admin = UserBuilder::new().with_role(Role::Admin).build();\n assert!(admin.can_delete_users());\n}\n```\n\n### 4. Improve Assertions\n\n**Replace magic values**:\n```python\n# Before\nassert response.status == 200\n\n# After\nfrom http import HTTPStatus\nassert response.status == HTTPStatus.OK\n```\n\n**Add context**:\n```python\n# Before\nassert result\n\n# After\nassert result.success, f\"Expected success, got error: {result.error}\"\n```\n\n### 5. Remove Brittle Patterns\n\n**Dead waits** → **Explicit conditions**:\n```python\n# Before\ntime.sleep(3)\nassert element.visible\n\n# After\nwait_for(element.to_be_visible, timeout=5)\n```\n\n**Mocking internals** → **Mock boundaries**:\n```python\n# Before: mocking private implementation\n@patch('service._internal_helper')\ndef test_service(mock):\n ...\n\n# After: mock external dependency\n@patch('requests.post')\ndef test_service(mock_requests):\n ...\n```\n\n## Phased Remediation\n\nFor major test suite rewrites:\n\n### Phase 1: Stabilize (Week 1-2)\n1. Fix flaky tests (eliminate dead waits, order dependencies)\n2. Remove duplicate tests\n3. Add missing critical path tests\n4. **Metric**: Flaky test rate \u003c 1%, critical paths 100%\n\n### Phase 2: Acceptance Specs (Week 3-4)\n1. Add BDD scenarios for user-facing features\n2. Create feature-to-test mapping\n3. Document test strategy per component\n4. **Metric**: All features have acceptance tests\n\n### Phase 3: Enforce Quality (Week 5+)\n1. Set coverage budgets (80% standard, 100% critical)\n2. Add pre-commit hooks for coverage checks\n3. Integrate mutation testing for critical code\n4. **Metric**: Coverage trends upward, no regressions\n\n## Recommendation Template\n\n```markdown\n## Remediation Plan\n\n### Immediate Actions (This Sprint)\n1. **Fix flaky test**: `test_user_login_retries` - Replace sleep with explicit wait\n - Owner: @alice\n - Due: 2025-12-10\n\n2. **Add missing coverage**: Password reset flow (currently 0%)\n - Tests needed: valid token, expired token, invalid token\n - Owner: @bob\n - Due: 2025-12-12\n\n### Short-term (Next Sprint)\n3. **Refactor fixtures**: Extract common setup in `tests/test_api.py`\n - Pattern: Use pytest fixtures for DB, config\n - Owner: @charlie\n - Due: 2025-12-20\n\n### Long-term (Next Month)\n4. **BDD acceptance tests**: User registration feature\n - Tool: Behave/Gherkin\n - Owner: @diana\n - Due: 2025-01-15\n```\n\n## Exit Criteria\n\n- [ ] All critical gaps have assigned owners and due dates\n- [ ] Recommendations tied to specific behaviors\n- [ ] Phased approach for large refactorings\n- [ ] Success metrics defined (coverage %, flaky rate, etc.)\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4849,"content_sha256":"26d64bc3cfd5f5c0c62bfc76e76d786c286cf70bcc89bcdfd1701e371a796149"},{"filename":"modules/scenario-quality.md","content":"---\nparent_skill: pensive:test-review\nname: scenario-quality\ndescription: Test scenario quality assessment with BDD patterns\ncategory: testing\ntags: [bdd, scenario-quality, assertions, anti-patterns]\nload_priority: 3\nestimated_tokens: 350\n---\n\n# Scenario Quality Assessment\n\nEvaluate test quality using BDD principles and assertion patterns.\n\n## Given/When/Then Clarity\n\n### Good Examples\n\n**Rust:**\n```rust\n#[test]\nfn test_authenticated_user_can_access_profile() {\n // Given: authenticated user\n let user = create_authenticated_user(\"[email protected]\");\n let token = generate_token(&user);\n\n // When: accessing profile endpoint\n let response = get(\"/profile\", &token);\n\n // Then: profile data returned\n assert_eq!(response.status, 200);\n assert_eq!(response.body[\"email\"], \"[email protected]\");\n}\n```\n\n**Python:**\n```python\ndef test_invalid_credentials_rejected():\n # Given: user with wrong password\n user = User(email=\"[email protected]\")\n wrong_password = \"incorrect\"\n\n # When: attempting authentication\n result = authenticate(user.email, wrong_password)\n\n # Then: authentication fails with 401\n assert result.status_code == 401\n assert \"invalid credentials\" in result.error_message\n```\n\n**Gherkin (BDD):**\n```gherkin\nScenario: Registered user logs in successfully\n Given a registered user with email \"[email protected]\"\n When they submit valid credentials\n Then they receive an authentication token\n And the token expires in 24 hours\n```\n\n## Assertion Quality\n\n### Bad Assertions (vague, brittle)\n```python\n# Too vague\nassert result\n\n# Multiple unrelated assertions\nassert len(users) > 0 and users[0].active and config.debug\n\n# Magic numbers without context\nassert response.status == 200\n```\n\n### Good Assertions (specific, meaningful)\n```python\n# Specific outcome\nassert result.status_code == 200, \"Expected successful login\"\n\n# Named constants\nassert response.status == HTTP_OK\nassert user.role == UserRole.ADMIN\n\n# Structured assertions\nassert response.json() == {\n \"user\": {\"email\": expected_email, \"verified\": True},\n \"token\": {\"expires_at\": ANY_DATETIME}\n}\n```\n\n## Anti-Patterns to Flag\n\n### 1. Dead Waits\n```python\n# BAD: arbitrary sleep\ntime.sleep(5)\nassert element.is_visible()\n\n# GOOD: explicit wait with condition\nwait_until(lambda: element.is_visible(), timeout=5)\n```\n\n### 2. Mocking Internals\n```python\n# BAD: mocking implementation details\n@patch('module.internal._private_helper')\ndef test_feature(mock_helper):\n ...\n\n# GOOD: mock external dependencies only\n@patch('requests.get')\ndef test_api_call(mock_get):\n ...\n```\n\n### 3. Repeated Boilerplate\n```python\n# BAD: copy-pasted setup\ndef test_user_creation():\n db = Database(\"test.db\")\n db.connect()\n user = User(\"alice\")\n ...\n\ndef test_user_deletion():\n db = Database(\"test.db\")\n db.connect()\n user = User(\"bob\")\n ...\n\n# GOOD: fixture/helper\[email protected]\ndef db_session():\n db = Database(\"test.db\")\n db.connect()\n yield db\n db.close()\n```\n\n### 4. Order Dependencies\n```python\n# BAD: tests depend on execution order\ndef test_01_create_user():\n global user_id\n user_id = create_user()\n\ndef test_02_delete_user():\n delete_user(user_id) # Depends on test_01!\n\n# GOOD: isolated tests\ndef test_delete_user():\n user_id = create_user() # Self-contained\n delete_user(user_id)\n assert not user_exists(user_id)\n```\n\n### 5. Multiple Assertions Without Context\n```python\n# BAD: unclear which assertion failed\nassert user.active\nassert user.verified\nassert user.role == \"admin\"\n\n# GOOD: grouped with context or separate tests\nassert user.active, \"User should be active\"\nassert user.verified, \"User should be verified\"\nassert user.role == \"admin\", \"User should have admin role\"\n```\n\n## BDD Suite Quality\n\n### Reusable Step Definitions\n```python\n# Good: parameterized, reusable\n@given('a user with email \"{email}\"')\ndef create_user(context, email):\n context.user = User(email=email)\n\n@when('they submit credentials with password \"{password}\"')\ndef submit_credentials(context, password):\n context.response = authenticate(context.user.email, password)\n```\n\n### Background Context Sharing\n```gherkin\nFeature: User authentication\n\n Background:\n Given a clean database\n And the authentication service is running\n\n Scenario: Valid login\n Given a registered user\n ...\n```\n\n### Scenario Outlines for Edge Cases\n```gherkin\nScenario Outline: Password validation\n Given a user registering with password \"\u003cpassword>\"\n When they submit the registration form\n Then they receive response \"\u003coutcome>\"\n\n Examples:\n | password | outcome |\n | abc | too_short |\n | password123 | no_special_chars |\n | P@ssw0rd! | success |\n```\n\n## Quality Scoring\n\nScore each test file 1-5 on:\n- **Clarity**: Given/When/Then structure evident\n- **Assertions**: Specific, meaningful checks\n- **Isolation**: No shared state or order dependencies\n- **Maintainability**: DRY, uses fixtures/helpers\n- **Coverage**: Tests behavior, not implementation\n\n**Overall quality**:\n- 4-5: Excellent, minimal changes needed\n- 3: Good, some improvements recommended\n- 1-2: Poor, significant refactoring required\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":5212,"content_sha256":"d9a445b63916a7cf968235ee4d59f2297cfc80d1036ed692e037b6665aeaa81f"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":2},"content":[{"text":"Table of Contents","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quick Start","type":"text","marks":[{"type":"link","attrs":{"href":"#quick-start","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"When to Use","type":"text","marks":[{"type":"link","attrs":{"href":"#when-to-use","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Required TodoWrite Items","type":"text","marks":[{"type":"link","attrs":{"href":"#required-todowrite-items","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Progressive Loading","type":"text","marks":[{"type":"link","attrs":{"href":"#progressive-loading","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Workflow","type":"text","marks":[{"type":"link","attrs":{"href":"#workflow","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Step 1: Detect Languages (","type":"text","marks":[{"type":"link","attrs":{"href":"#step-1:-detect-languages-(test-review:languages-detected)","title":null}}]},{"text":"test-review:languages-detected","type":"text","marks":[{"type":"link","attrs":{"href":"#step-1:-detect-languages-(test-review:languages-detected)","title":null}},{"type":"code_inline"}]},{"text":")","type":"text","marks":[{"type":"link","attrs":{"href":"#step-1:-detect-languages-(test-review:languages-detected)","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Step 2: Inventory Coverage (","type":"text","marks":[{"type":"link","attrs":{"href":"#step-2:-inventory-coverage-(test-review:coverage-inventoried)","title":null}}]},{"text":"test-review:coverage-inventoried","type":"text","marks":[{"type":"link","attrs":{"href":"#step-2:-inventory-coverage-(test-review:coverage-inventoried)","title":null}},{"type":"code_inline"}]},{"text":")","type":"text","marks":[{"type":"link","attrs":{"href":"#step-2:-inventory-coverage-(test-review:coverage-inventoried)","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Step 3: Assess Scenario Quality (","type":"text","marks":[{"type":"link","attrs":{"href":"#step-3:-assess-scenario-quality-(test-review:scenario-quality)","title":null}}]},{"text":"test-review:scenario-quality","type":"text","marks":[{"type":"link","attrs":{"href":"#step-3:-assess-scenario-quality-(test-review:scenario-quality)","title":null}},{"type":"code_inline"}]},{"text":")","type":"text","marks":[{"type":"link","attrs":{"href":"#step-3:-assess-scenario-quality-(test-review:scenario-quality)","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Step 4: Plan Remediation (","type":"text","marks":[{"type":"link","attrs":{"href":"#step-4:-plan-remediation-(test-review:gap-remediation)","title":null}}]},{"text":"test-review:gap-remediation","type":"text","marks":[{"type":"link","attrs":{"href":"#step-4:-plan-remediation-(test-review:gap-remediation)","title":null}},{"type":"code_inline"}]},{"text":")","type":"text","marks":[{"type":"link","attrs":{"href":"#step-4:-plan-remediation-(test-review:gap-remediation)","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Step 5: Log Evidence (","type":"text","marks":[{"type":"link","attrs":{"href":"#step-5:-log-evidence-(test-review:evidence-logged)","title":null}}]},{"text":"test-review:evidence-logged","type":"text","marks":[{"type":"link","attrs":{"href":"#step-5:-log-evidence-(test-review:evidence-logged)","title":null}},{"type":"code_inline"}]},{"text":")","type":"text","marks":[{"type":"link","attrs":{"href":"#step-5:-log-evidence-(test-review:evidence-logged)","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test Quality Checklist (Condensed)","type":"text","marks":[{"type":"link","attrs":{"href":"#test-quality-checklist-(condensed)","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output Format","type":"text","marks":[{"type":"link","attrs":{"href":"#output-format","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Summary","type":"text","marks":[{"type":"link","attrs":{"href":"#summary","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Framework Detection","type":"text","marks":[{"type":"link","attrs":{"href":"#framework-detection","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Coverage Analysis","type":"text","marks":[{"type":"link","attrs":{"href":"#coverage-analysis","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quality Issues","type":"text","marks":[{"type":"link","attrs":{"href":"#quality-issues","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Remediation Plan","type":"text","marks":[{"type":"link","attrs":{"href":"#remediation-plan","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Recommendation","type":"text","marks":[{"type":"link","attrs":{"href":"#recommendation","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Integration Notes","type":"text","marks":[{"type":"link","attrs":{"href":"#integration-notes","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Exit Criteria","type":"text","marks":[{"type":"link","attrs":{"href":"#exit-criteria","title":null}}]}]}]}]},{"type":"heading","attrs":{"level":1},"content":[{"text":"Test Review Workflow","type":"text"}]},{"type":"paragraph","content":[{"text":"Evaluate and improve test suites with TDD/BDD rigor.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Start","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"/test-review","type":"text"}]},{"type":"paragraph","content":[{"text":"Verification:","type":"text","marks":[{"type":"strong"}]},{"text":" Run ","type":"text"},{"text":"pytest -v","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify tests pass.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When To Use","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reviewing test suite quality","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Analyzing coverage gaps","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Before major releases","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After test failures","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Planning test improvements","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When NOT To Use","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Writing new tests - use parseltongue:python-testing","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Updating existing tests - use sanctum:test-updates","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Required TodoWrite Items","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test-review:languages-detected","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test-review:coverage-inventoried","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test-review:scenario-quality","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test-review:invariant-preservation","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test-review:gap-remediation","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"test-review:evidence-logged","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Progressive Loading","type":"text"}]},{"type":"paragraph","content":[{"text":"Load modules as needed based on review depth:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Basic review","type":"text","marks":[{"type":"strong"}]},{"text":": Core workflow (this file)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Framework detection","type":"text","marks":[{"type":"strong"}]},{"text":": Load ","type":"text"},{"text":"modules/framework-detection.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Coverage analysis","type":"text","marks":[{"type":"strong"}]},{"text":": Load ","type":"text"},{"text":"modules/coverage-analysis.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quality assessment","type":"text","marks":[{"type":"strong"}]},{"text":": Load ","type":"text"},{"text":"modules/scenario-quality.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Remediation planning","type":"text","marks":[{"type":"strong"}]},{"text":": Load ","type":"text"},{"text":"modules/remediation-planning.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflow","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1: Detect Languages (","type":"text"},{"text":"test-review:languages-detected","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Identify testing frameworks and version constraints. → ","type":"text"},{"text":"See","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"modules/framework-detection.md","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Quick check:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"find . -maxdepth 2 -name \"Cargo.toml\" -o -name \"pyproject.toml\" -o -name \"package.json\" -o -name \"go.mod\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Verification:","type":"text","marks":[{"type":"strong"}]},{"text":" Run the command with ","type":"text"},{"text":"--help","type":"text","marks":[{"type":"code_inline"}]},{"text":" flag to verify availability.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2: Inventory Coverage (","type":"text"},{"text":"test-review:coverage-inventoried","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Run coverage tools and identify gaps. → ","type":"text"},{"text":"See","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"modules/coverage-analysis.md","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Quick check:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"git diff --name-only | rg 'tests|spec|feature'","type":"text"}]},{"type":"paragraph","content":[{"text":"Verification:","type":"text","marks":[{"type":"strong"}]},{"text":" Run ","type":"text"},{"text":"pytest -v","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify tests pass.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3: Assess Scenario Quality (","type":"text"},{"text":"test-review:scenario-quality","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Evaluate test quality using BDD patterns and assertion checks. → ","type":"text"},{"text":"See","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"modules/scenario-quality.md","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Focus on:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Given/When/Then clarity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Assertion specificity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Anti-patterns (dead waits, mocking internals, repeated boilerplate)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 4: Plan Remediation (","type":"text"},{"text":"test-review:gap-remediation","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Create concrete improvement plan with owners and dates. → ","type":"text"},{"text":"See","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"modules/remediation-planning.md","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 5: Log Evidence (","type":"text"},{"text":"test-review:evidence-logged","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Record executed commands, outputs, and recommendations. → ","type":"text"},{"text":"See","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"imbue:proof-of-work","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Test Quality Checklist (Condensed)","type":"text"}]},{"type":"checkbox_list","attrs":{"id":null},"content":[{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Clear test structure (Arrange-Act-Assert)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Critical paths covered (auth, validation, errors)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Specific assertions with context","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"No flaky tests (dead waits, order dependencies)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Reusable fixtures/factories","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Invariant-encoding tests intact (see below)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Invariant-Encoding Tests","type":"text"}]},{"type":"paragraph","content":[{"text":"Tests do not just verify behavior — they encode design invariants. A test that asserts \"module A never imports from module B\" encodes a layer boundary. A test that asserts \"this function is pure\" encodes a concurrency model. These tests are load-bearing in ways that coverage metrics cannot capture.","type":"text"}]},{"type":"paragraph","content":[{"text":"During review, check:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Were invariant-encoding tests removed or weakened?","type":"text","marks":[{"type":"strong"}]},{"text":" A test that enforced an architectural boundary, data structure constraint, or API contract should not be deleted without naming the invariant being abandoned and escalating to human judgment.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Were test expectations changed to match a broken implementation?","type":"text","marks":[{"type":"strong"}]},{"text":" If an assertion value changed, ask: did the ","type":"text"},{"text":"requirement","type":"text","marks":[{"type":"em"}]},{"text":" change, or did the agent change the test to make its code pass? The latter is the single most dangerous form of test tampering.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Are new invariants encoded as tests?","type":"text","marks":[{"type":"strong"}]},{"text":" When a design decision is made (choice of data structure, module boundary, error strategy), there should be at least one test whose failure would signal that the invariant was violated.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Red flag patterns:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pattern","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Risk","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"@pytest.mark.skip","type":"text","marks":[{"type":"code_inline"}]},{"text":" added to a passing test","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Invariant being silently dropped","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Assertion changed from specific to broad","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Constraint being relaxed","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Test renamed to describe new behavior","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Old invariant erased from history","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Test deleted \"because it tested old code\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Invariant removed without replacement","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"When invariant erosion is detected:","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Do NOT approve. Flag as a BLOCKING quality issue and present the three options to the human:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preserve","type":"text","marks":[{"type":"strong"}]},{"text":": Revert the test change, fix the implementation to satisfy the invariant","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Layer","type":"text","marks":[{"type":"strong"}]},{"text":": Keep the invariant test, add the new behavior alongside it (accepting inelegance)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Revise","type":"text","marks":[{"type":"strong"}]},{"text":": The invariant is genuinely wrong — remove the old test AND write a new test encoding the replacement invariant","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"This is a judgment call that models get wrong far too often. Default to option 1 (preserve) when no human is available.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Format","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"## Summary\n[Brief assessment]\n\n## Framework Detection\n- Languages: [list] | Frameworks: [list] | Versions: [constraints]\n\n## Coverage Analysis\n- Overall: X% | Critical: X% | Gaps: [list]\n\n## Quality Issues\n[Q1] [Issue] - Location - Fix\n\n## Remediation Plan\n1. [Action] - Owner - Date\n\n## Recommendation\nApprove / Approve with actions / Block","type":"text"}]},{"type":"paragraph","content":[{"text":"Verification:","type":"text","marks":[{"type":"strong"}]},{"text":" Run the command with ","type":"text"},{"text":"--help","type":"text","marks":[{"type":"code_inline"}]},{"text":" flag to verify availability.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Integration Notes","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"imbue:proof-of-work","type":"text","marks":[{"type":"code_inline"}]},{"text":" for reproducible evidence capture","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reference ","type":"text"},{"text":"imbue:diff-analysis","type":"text","marks":[{"type":"code_inline"}]},{"text":" for risk assessment","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Format output using ","type":"text"},{"text":"imbue:structured-output","type":"text","marks":[{"type":"code_inline"}]},{"text":" patterns","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Exit Criteria","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Frameworks detected and documented","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Coverage analyzed and gaps identified","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scenario quality assessed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Remediation plan created with owners and dates","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Evidence logged with citations","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Troubleshooting","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Common Issues","type":"text"}]},{"type":"paragraph","content":[{"text":"Tests not discovered","type":"text","marks":[{"type":"strong"}]},{"text":" Ensure test files match pattern ","type":"text"},{"text":"test_*.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"*_test.py","type":"text","marks":[{"type":"code_inline"}]},{"text":". Run ","type":"text"},{"text":"pytest --collect-only","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify.","type":"text"}]},{"type":"paragraph","content":[{"text":"Import errors","type":"text","marks":[{"type":"strong"}]},{"text":" Check that the module being tested is in ","type":"text"},{"text":"PYTHONPATH","type":"text","marks":[{"type":"code_inline"}]},{"text":" or install with ","type":"text"},{"text":"pip install -e .","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Async tests failing","type":"text","marks":[{"type":"strong"}]},{"text":" Install pytest-asyncio and decorate test functions with ","type":"text"},{"text":"@pytest.mark.asyncio","type":"text","marks":[{"type":"code_inline"}]}]}]},"metadata":{"date":"2026-06-05","name":"test-review","tags":["testing","tdd","bdd","coverage","quality","fixtures"],"tools":[],"author":"@skillopedia","source":{"stars":298,"repo_name":"claude-night-market","origin_url":"https://github.com/athola/claude-night-market/blob/HEAD/plugins/pensive/skills/test-review/SKILL.md","repo_owner":"athola","body_sha256":"18bdb38d24c14bcf58ecd1e57bf23f055b14f559f06d81abf9810c0d3d9641bc","cluster_key":"e6b74f03c3bd2e8b98ac9b050daf4d05bbbde6bbe96787ea4c994ce21a07423b","clean_bundle":{"format":"clean-skill-bundle-v1","source":"athola/claude-night-market/plugins/pensive/skills/test-review/SKILL.md","attachments":[{"id":"9ff03d50-f4c8-5a5f-bc51-be286a160cb6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9ff03d50-f4c8-5a5f-bc51-be286a160cb6/attachment.md","path":"modules/content-assertion-quality.md","size":2534,"sha256":"65baaa35b4da544df92f7aa41069b6a7107d1417c00d5e6dfe08362a7c6985d9","contentType":"text/markdown; charset=utf-8"},{"id":"6c2c5136-7bac-5888-b9d8-505379a59f0d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6c2c5136-7bac-5888-b9d8-505379a59f0d/attachment.md","path":"modules/coverage-analysis.md","size":3330,"sha256":"6a311f499988a10d2b451959cbb0342aca7a47316f5a6fcc0660ba381f8e05c7","contentType":"text/markdown; charset=utf-8"},{"id":"4cbe8e9e-389a-5624-808e-b6df2c2cd3e8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4cbe8e9e-389a-5624-808e-b6df2c2cd3e8/attachment.md","path":"modules/framework-detection.md","size":2315,"sha256":"359725cc1d2258f8a436e67d9308c54d57312c9f46d361a954bddc231bcc8eb3","contentType":"text/markdown; charset=utf-8"},{"id":"3c9441cf-3e2f-50d1-8323-ebfb8d85557b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3c9441cf-3e2f-50d1-8323-ebfb8d85557b/attachment.md","path":"modules/remediation-planning.md","size":4849,"sha256":"26d64bc3cfd5f5c0c62bfc76e76d786c286cf70bcc89bcdfd1701e371a796149","contentType":"text/markdown; charset=utf-8"},{"id":"0b89f0d3-e719-5773-a744-61646737ebe9","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0b89f0d3-e719-5773-a744-61646737ebe9/attachment.md","path":"modules/scenario-quality.md","size":5212,"sha256":"d9a445b63916a7cf968235ee4d59f2297cfc80d1036ed692e037b6665aeaa81f","contentType":"text/markdown; charset=utf-8"}],"bundle_sha256":"177eb09f275cd361a52220338beaf6c1130e58f559df155d04ac007df63c9cdf","attachment_count":5,"text_attachments":5,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"plugins/pensive/skills/test-review/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":0},"modules":["modules/framework-detection.md","modules/coverage-analysis.md","modules/scenario-quality.md","modules/remediation-planning.md","modules/content-assertion-quality.md"],"version":"v1","category":"testing-qa","complexity":"intermediate","import_tag":"clean-skills-v1","model_hint":"standard","alwaysApply":false,"description":"Evaluates test suites for coverage gaps, TDD/BDD compliance, and anti-patterns. Use when auditing test quality or before a major release.","dependencies":["pensive:shared","imbue:proof-of-work"],"usage_patterns":["test-audit","coverage-analysis","quality-improvement","gap-remediation"],"estimated_tokens":200,"progressive_loading":true}},"renderedAt":1782987575216}

Table of Contents - Quick Start - When to Use - Required TodoWrite Items - Progressive Loading - Workflow - Step 1: Detect Languages ( )) - Step 2: Inventory Coverage ( )) - Step 3: Assess Scenario Quality ( )) - Step 4: Plan Remediation ( )) - Step 5: Log Evidence ( )) - Test Quality Checklist (Condensed)) - Output Format - Summary - Framework Detection - Coverage Analysis - Quality Issues - Remediation Plan - Recommendation - Integration Notes - Exit Criteria Test Review Workflow Evaluate and improve test suites with TDD/BDD rigor. Quick Start Verification: Run to verify tests pass. When To…