code-review
Comprehensive code review with actionable feedback using extended thinking
Develop features using strict Test-Driven Development with parallel test specialists
> /plugin marketplace add aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrockHow it fires
How this command gets triggered: by you, by Claude, or both.
/tdd-featureContext preview
What this command does when you run it.
Develop features using strict Test-Driven Development with parallel test specialists
name: tdd-feature description: Develop features using strict Test-Driven Development with parallel test specialists version: 1.0.0 argument-hint: "[feature-description]"
You are a TDD expert. When developing features, ALWAYS write tests first, verify they fail, then implement minimal code to pass.
$ARGUMENTS
If no feature description was provided above, ask the user: "What feature would you like to implement using TDD?"
Before writing any tests, establish proper test placement:
1. **Detect existing structure**:
# Look for test directories and configuration find . -type d -name "test*" -maxdepth 3 grep -r "testpaths\|test_suite" pyproject.toml setup.py pytest.ini 2>/dev/null || true
2. **Create centralized test structure**:
tests/ ├── unit/ # Fast isolated tests │ ├── test_models.py # Database models │ ├── test_services.py # Business logic │ └── test_utils.py # Utility functions ├── integration/ # Component interaction tests │ ├── test_api_endpoints.py │ └── test_database_operations.py ├── e2e/ # End-to-end system tests │ └── test_user_workflows.py ├── fixtures/ # Test data and fixtures │ ├── sample_data.json │ └── mock_responses.py └── conftest.py # Shared test configuration
3. **Feature test placement guidelines**:
Deploy concurrent test specialists: @test-generator @qa-engineer @performance-profiler @security-reviewer
All subagents work in parallel to create comprehensive test coverage BEFORE implementation:
# ALWAYS start with tests that fail
def test_feature_core_functionality():
"""Test the main happy path"""
# This MUST fail initially
result = new_feature(valid_input)
assert result == expected_output
def test_feature_handles_invalid_input():
"""Test error handling"""
with pytest.raises(ValueError):
new_feature(invalid_input)
def test_feature_edge_cases():
"""Test boundary conditions"""
assert new_feature(edge_case_1) == expected_1
assert new_feature(edge_case_2) == expected_2# Run tests to confirm they fail - use proper test path pytest tests/unit/test_new_feature.py -v # Expected output: # tests/unit/test_new_feature.py::test_feature_core_functionality FAILED # tests/unit/test_new_feature.py::test_feature_handles_invalid_input FAILED # tests/unit/test_new_feature.py::test_feature_edge_cases FAILED
# Write ONLY enough code to pass tests
def new_feature(input_data):
"""Minimal implementation to pass tests"""
if not is_valid(input_data):
raise ValueError("Invalid input")
# Just enough logic to pass
return process(input_data)# After tests pass, improve code quality
class FeatureHandler:
"""Refactored with better design"""
def __init__(self):
self.validator = InputValidator()
self.processor = DataProcessor()
def execute(self, input_data):
"""Clean, maintainable implementation"""
self.validator.validate(input_data)
return self.processor.process(input_data)def test_feature_produces_correct_output():
"""Core functionality works correctly"""
pass
def test_feature_handles_various_inputs():
"""Works with different input types"""
passdef test_feature_handles_null_input():
"""Gracefully handles None"""
pass
def test_feature_handles_malformed_data():
"""Handles bad data gracefully"""
passdef test_feature_with_empty_input():
"""Handles empty collections"""
pass
def test_feature_with_maximum_values():
"""Handles boundary conditions"""
passdef test_feature_performance():
"""Completes within acceptable time"""
import time
start = time.time()
new_feature(large_dataset)
assert time.time() - start < 1.0 # Under 1 seconddef test_feature_integrates_with_system():
"""Works with rest of system"""
pass1. **Analyze Project Structure**
# Detect existing test organization find . -name "conftest.py" -o -name "pytest.ini" -o -name "pyproject.toml" ls -la tests/ test/ src/tests/ 2>/dev/null || echo "No existing test dirs found"
This guidance enables enterprise deployment of Claude Code and Claude Cowork on Amazon Bedrock across command-line (CLI) and desktop surfaces — with secure single sign-on (SSO), usage monitoring, and cost controls.
Comprehensive code review with actionable feedback using extended thinking
Complete architecture design and documentation workflow using simple-architect and simple-architecture-documenter agents in…
Intelligent refactoring with strategic thinking and parallel analysis
Create comprehensive documentation with intelligent type detection and orchestration
Create in-depth explanations that build conceptual understanding of complex topics
Create practical how-to guides for solving specific problems and accomplishing tasks