← ClaudeAtlas

test-coverage-advisorlisted

This skill should be used when the user asks to "write tests", "generate tests", "check coverage", "add test cases", or when completing features and saying "done", "finished", "ready for review". Suggests tests for 90%+ coverage.
smicolon/ai-kit · ★ 3 · AI & Automation · score 64
Install: claude install-skill smicolon/ai-kit
# Test Coverage Advisor Auto-suggests comprehensive test cases to achieve Smicolon's 90%+ coverage target. ## Activation Triggers This skill activates when: - Completing feature implementation - Mentioning "done", "finished", "ready", "complete" - Saying "review this code" - Creating models, services, views, or APIs - Asking about testing - Before code is marked as complete ## Coverage Target (MANDATORY) **90%+ test coverage required for ALL code.** Test categories: 1. **Unit Tests** - Models, services, utilities (80%+ of tests) 2. **Integration Tests** - API endpoints, workflows (15%+ of tests) 3. **Edge Cases** - Error handling, validation (5%+ of tests) ## Auto-Analysis Process ### Step 1: Identify Untested Code When feature implementation is complete, scan for: ```python # models.py - Has tests? ❓ class User(models.Model): def activate(self): # Needs test self.is_active = True self.save() # services.py - Has tests? ❓ class UserService: @staticmethod def create_user(data): # Needs test # ...business logic # views.py - Has tests? ❓ class UserViewSet(viewsets.ModelViewSet): def create(self, request): # Needs test # ... ``` ### Step 2: Calculate Coverage Gap ``` Current coverage: X% Target coverage: 90% Gap: Y% Missing: Z test cases ``` ### Step 3: Generate Missing Test Cases **For Model:** ```python # users/tests/test_models.py import pytest import users.models as _users_models @pytest.mark.django_db class T