steering_docs/python-tech/orchestration.md
Coordinate the modular components to generate complete AWS SDK code examples. Each component can be used independently or in sequence.
graph TD
A[Knowledge Base Consultation] --> B[Hello Example]
A --> C[Wrapper Class]
A --> D[Scenario]
C --> E[Tests - Stubber Creation]
E --> F[Tests - Unit Tests]
E --> G[Tests - Integration Tests]
E --> H[Tests - Scenario Tests]
B --> I[Metadata Generation]
C --> I
D --> I
I --> J[README Generation]
K[Service Specification] --> I
K --> C
K --> D
Complete implementation of a new AWS service:
# 1. Knowledge Base Consultation (MANDATORY FIRST)
# Use ListKnowledgeBases + QueryKnowledgeBases for standards and patterns
# 2. Create Service Stubber (MANDATORY BEFORE TESTS)
# Create python/test_tools/{service}_stubber.py
# Add to python/test_tools/stubber_factory.py
# 3. Generate Core Components
# - Hello example: {service}_hello.py
# - Wrapper class: {service}_wrapper.py
# - Scenario: scenario_{service}_basics.py
# - Requirements: requirements.txt
# 4. Generate Test Suite
# - conftest.py with ScenarioData
# - test_{service}_wrapper.py
# - test_{service}_scenario.py
# - test_{service}_integration.py
# 5. Generate Metadata
# - Read service specification for exact metadata keys
# - Create .doc_gen/metadata/{service}_metadata.yaml
# 6. Generate Documentation
# - Run writeme tool to create/update README.md
# Focus: hello.md guidance
# Files: {service}_hello.py
# Validation: Run hello example, check output
# Focus: wrapper.md guidance
# Files: {service}_wrapper.py
# Validation: Run unit tests for wrapper methods
# Focus: scenario.md guidance
# Files: scenario_{service}_basics.py
# Validation: Run scenario tests, check user interaction
# Focus: tests.md guidance
# Files: All test files in test/ directory
# Validation: Run pytest with all markers
# Focus: metadata.md guidance
# Files: .doc_gen/metadata/{service}_metadata.yaml
# Validation: Run writeme tool validation
# Focus: readme.md guidance
# Files: README.md (generated)
# Validation: Check README completeness and accuracy
Each component has specific validation requirements:
PYTHONPATH=python:python/example_code/{service} python python/example_code/{service}/{service}_hello.py
PYTHONPATH=python:python/example_code/{service} python -c "from {service}_wrapper import {Service}Wrapper; wrapper = {Service}Wrapper.from_client(); print('✅ Wrapper functions working')"
PYTHONPATH=python:python/example_code/{service} python python/example_code/{service}/scenario_{service}_basics.py
PYTHONPATH=python:python/example_code/{service} python -m pytest python/example_code/{service}/test/ -m "not integ" -v
PYTHONPATH=python:python/example_code/{service} python -m pytest python/example_code/{service}/test/ -m "integ" -v
black python/example_code/{service}/
pylint --rcfile=.github/linters/.python-lint python/example_code/{service}/
cd .tools/readmes
source .venv/bin/activate
python -m writeme --languages Python:3 --services {service}
Full integration testing across all components:
# 1. All unit tests pass
python -m pytest python/example_code/{service}/test/ -m "not integ" -v
# 2. All integration tests pass
python -m pytest python/example_code/{service}/test/ -m "integ" -v
# 3. All examples execute successfully
PYTHONPATH=python:python/example_code/{service} python python/example_code/{service}/{service}_hello.py
PYTHONPATH=python:python/example_code/{service} python python/example_code/{service}/scenario_{service}_basics.py
# 4. Code quality passes
black python/example_code/{service}/
pylint --rcfile=.github/linters/.python-lint python/example_code/{service}/
# 5. Documentation generates successfully
cd .tools/readmes && source .venv/bin/activate && python -m writeme --languages Python:3 --services {service}
If any component fails, you can:
# Fix test issues and re-run
python -m pytest python/example_code/{service}/test/ -v --tb=short
# Check metadata syntax
python -c "import yaml; yaml.safe_load(open('.doc_gen/metadata/{service}_metadata.yaml'))"
# Validate against specification
# Compare with scenarios/basics/{service}/SPECIFICATION.md
# Check for missing dependencies
cd .tools/readmes && source .venv/bin/activate && pip list
# Validate metadata first
python -m writeme --languages Python:3 --services {service} --verbose
This modular approach allows for targeted updates, easier debugging, and more maintainable code generation processes.