skills/tdd-workflow/SKILL.md
Test-Driven Development workflow. Enforces RED → GREEN → REFACTOR cycle with 80% coverage gate. Use for all new features and bug fixes.
npx skillsauth add a2mus/ecc-antigravity tdd-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use PROACTIVELY for:
┌─────────────────────────────────────────┐
│ RED → Write a FAILING test │
│ The test defines the contract │
├─────────────────────────────────────────┤
│ GREEN → Write MINIMAL code to pass it │
│ No more than what's needed │
├─────────────────────────────────────────┤
│ REFACTOR → Clean up both code & tests │
│ Keep tests GREEN │
└─────────────────────────────────────────┘
↓
Verify 80%+ coverage
# tests/test_my_feature.py
def test_feature_does_x_given_y():
# Arrange
input_data = ...
# Act
result = my_feature(input_data)
# Assert
assert result == expected_output
Run it — it MUST fail. If it passes without code, the test is wrong.
# Python / pytest
pytest --cov=. --cov-report=term-missing
# Coverage must be >= 80%
def test_converts_document_to_markdown():
# Arrange — set up inputs
doc_path = Path("fixtures/sample.docx")
# Act — call the thing under test
result = convert_to_markdown(doc_path)
# Assert — verify the outcome
assert result.startswith("# ")
assert "## Introduction" in result
Use descriptive names that explain the behaviour:
# GOOD
def test_returns_empty_list_when_no_layers_match():
def test_raises_value_error_when_crs_is_missing():
def test_converts_polygon_to_geojson_correctly():
# BAD
def test_convert():
def test_feature1():
| Type | What it covers | Tool (Python) |
|------|----------------|---------------|
| Unit | Individual functions, utilities | pytest |
| Integration | API endpoints, DB, file I/O | pytest + fixtures |
| E2E | Critical user workflows | pytest + real env |
# Use pytest-qgis for QGIS layer/project fixtures
import pytest
from qgis.core import QgsVectorLayer
@pytest.fixture
def sample_layer():
layer = QgsVectorLayer("Point?crs=EPSG:4326", "test", "memory")
assert layer.isValid()
return layer
def test_adds_feature_to_layer(sample_layer):
# Arrange
feature = QgsFeature(sample_layer.fields())
# Act
with edit(sample_layer):
sample_layer.addFeature(feature)
# Assert
assert sample_layer.featureCount() == 1
testing
Security audit checklist and workflow. Run before commits, PRs, or deploying. Covers secrets detection, input validation, OWASP Top 10, and dependency scanning.
tools
Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Use whenever adding new functionality.
development
Comprehensive Python idioms, best practices, and patterns. Covers dataclasses, type hints, async, error handling, testing, and QGIS-specific patterns.
development
React and Next.js patterns — component architecture, state management, data fetching, performance optimization, accessibility, and TypeScript conventions for web apps.