Validate WCAG 2.1 Level AA compliance and accessibility best practices. Use when performing accessibility audits and WCAG certification.
日本語の概要は準備中です。原文の説明を表示しています。
Generate test scaffolding for modules with proper structure, fixtures, and mock configurations.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
This skill provides comprehensive test scaffolding and templates for quickly setting up unit and integration tests with proper structure, fixtures, and mocking configurations. It guides the creation of well-structured, maintainable tests following best practices.
On-demand via command: /generate-tests <file-path>
Example:
/generate-tests src/tools/example/core.py
Complete pytest unit test template with:
Complete integration test template with:
test_*.py or *_test.py)/generate-tests src/tools/doc_fetcher/core.py
Provides:
tests/test_doc_fetcher_core.py structure/generate-tests src/api/endpoints.py
Provides:
tests/integration/test_endpoints.py structure/generate-tests src/components/Button.tsx
Provides:
src/components/Button.test.tsx structuredef test_function_name_condition_expected():
"""Test description."""
# Arrange - Set up test data and conditions
input_data = {"key": "value"}
expected = "result"
# Act - Execute the function under test
result = function_under_test(input_data)
# Assert - Verify the outcome
assert result == expected
class TestClassName:
"""Tests for ClassName."""
@pytest.fixture
def instance(self):
"""Create test instance."""
return ClassName()
def test_method_success(self, instance):
"""Test successful method execution."""
result = instance.method()
assert result is not None
def test_method_error_handling(self, instance):
"""Test method handles errors."""
with pytest.raises(ValueError):
instance.method(invalid_input)
@pytest.mark.parametrize("input,expected", [
("test1", "result1"),
("test2", "result2"),
("test3", "result3"),
])
def test_function_with_parameters(input, expected):
"""Test function with multiple inputs."""
result = function_under_test(input)
assert result == expected
from unittest.mock import Mock, patch
@patch('module.external_service')
def test_with_mocked_service(mock_service):
"""Test with mocked external service."""
# Configure mock
mock_service.return_value = "mocked_response"
# Test function that uses service
result = function_that_calls_service()
# Verify
assert result == "expected"
mock_service.assert_called_once()
@pytest.fixture
def mock_database():
"""Mock database connection."""
db = Mock()
db.query.return_value = [{"id": 1, "name": "test"}]
return db
def test_database_query(mock_database):
"""Test database query."""
result = get_data(mock_database)
assert len(result) == 1
mock_database.query.assert_called()
def test_api_endpoint_integration(client):
"""Test API endpoint with real client."""
# Arrange
payload = {"data": "test"}
# Act
response = client.post("/api/endpoint", json=payload)
# Assert
assert response.status_code == 200
assert response.json()["status"] == "success"
def test_database_integration(db_session):
"""Test database operations."""
# Arrange
record = Model(name="test", value=123)
# Act
db_session.add(record)
db_session.commit()
# Assert
result = db_session.query(Model).filter_by(name="test").first()
assert result is not None
assert result.value == 123
# Python with pytest-cov
pytest --cov=src --cov-report=html
# JavaScript with Jest
jest --coverage
# View coverage report
open htmlcov/index.html # Python
open coverage/lcov-report/index.html # JavaScript
test_function_condition_expectedtest_process_data_invalid_input_raises_errorまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Validate WCAG 2.1 Level AA compliance and accessibility best practices. Use when performing accessibility audits and WCAG certification.
日本語の概要は準備中です。原文の説明を表示しています。
Analyze feature requirements, dependencies, and security considerations. Use when starting feature implementation from GitHub issues to understand scope, technical feasibility, and risks.
日本語の概要は準備中です。原文の説明を表示しています。
Run SQL queries against psql, BigQuery, or MySQL from the terminal, including natural-language-to-SQL and schema exploration. Use when analyzing data, inspecting DB state, or debugging tables. Trigger on "query the database", "SQL", "show me data from", "explore table".
日本語の概要は準備中です。原文の説明を表示しています。
Design REST APIs or function contracts with clear request/response specifications, error handling patterns, authentication strategies, and comprehensive documentation.
日本語の概要は準備中です。原文の説明を表示しています。
Generate comprehensive API endpoint tests for REST and GraphQL APIs. Creates tests for all HTTP methods, status codes, authentication, and validation.
日本語の概要は準備中です。原文の説明を表示しています。
Design component architecture and module structure using established architectural patterns for clean, maintainable, and scalable systems.
日本語の概要は準備中です。原文の説明を表示しています。