Build, Test, and Verify (TTA.dev)
Validate code changes to ensure they meet quality standards before committing.
Process
Execute the following steps in order. Do not skip steps.
Orient (before writing any code): query CGC for the target.
mcp__codegraphcontext__find_code — search for the target function/class
mcp__codegraphcontext__analyze_code_relationships — callers, dependencies
mcp__codegraphcontext__calculate_cyclomatic_complexity — risk level
If CGC is unavailable, note it and proceed. Do not block on CGC absence.
Format: Apply Ruff formatting (100-char line length).
uv run ruff format .
Lint: Run Ruff linter with auto-fix.
uv run ruff check . --fix
Type Check: Run Pyright in basic mode.
uvx pyright ttadev/
Run Tests: Execute the pytest suite (100% coverage required for new code).
uv run pytest -v --tb=short -m "not integration and not slow and not external"
Full coverage (when adding new code):
uv run pytest --cov=ttadev --cov-report=html
Validate in E2B (when adding or changing Python code): run the tests
identified in the Orient step inside a clean E2B sandbox.
from ttadev.primitives.integrations.e2b_primitive import CodeExecutionPrimitive
from ttadev.primitives.core.base import WorkflowContext
async with CodeExecutionPrimitive() as executor:
result = await executor.execute({
"code": "import subprocess; r = subprocess.run(['python', '-m', 'pytest', '<test_file>', '-v', '--tb=short'], capture_output=True, text=True); print(r.stdout); print(r.stderr)"
}, WorkflowContext(workflow_id="validate"))
# Check result["success"] and result["output"] for PASSED/FAILED
If E2B is unavailable, fall back to local pytest and note the deviation.
Retain: after a successful commit, call mcp__hindsight__retain with bank_id
tta-dev documenting any decision, pattern, or failure from this task.
Common Issues
- Type errors: Ensure all new functions have strict type annotations (
str | None, not Optional[str]).
- Test failures: Fix the implementation, never comment out tests. Follow the AAA pattern (Arrange-Act-Assert).
- Import errors: All primitives imports must use
from ttadev.primitives.X — never from primitives.X.
- Quarantined tests: Tests marked
@pytest.mark.quarantine are auto-skipped unless selected with -m quarantine.
Deep Reference
For full testing patterns, markers, CI pipeline details, and MockPrimitive API, see
docs/agent-guides/testing-architecture.md.
1---2name: build-test-verify3description: Use this skill when asked to build the project, run tests, lint the code, or verify that the TTA.dev platform is stable before committing.4---56### Build, Test, and Verify (TTA.dev)78Validate code changes to ensure they meet quality standards before committing.910#### Process1112Execute the following steps in order. Do not skip steps.13140. **Orient** (before writing any code): query CGC for the target.15 ```16 mcp__codegraphcontext__find_code — search for the target function/class17 mcp__codegraphcontext__analyze_code_relationships — callers, dependencies18 mcp__codegraphcontext__calculate_cyclomatic_complexity — risk level19 ```20 If CGC is unavailable, note it and proceed. Do not block on CGC absence.21221. **Format**: Apply Ruff formatting (100-char line length).23 ```bash24 uv run ruff format .25 ```26272. **Lint**: Run Ruff linter with auto-fix.28 ```bash29 uv run ruff check . --fix30 ```31323. **Type Check**: Run Pyright in basic mode.33 ```bash34 uvx pyright ttadev/35 ```36374. **Run Tests**: Execute the pytest suite (100% coverage required for new code).38 ```bash39 uv run pytest -v --tb=short -m "not integration and not slow and not external"40 ```41425. **Full coverage** (when adding new code):43 ```bash44 uv run pytest --cov=ttadev --cov-report=html45 ```46476. **Validate in E2B** (when adding or changing Python code): run the tests48 identified in the Orient step inside a clean E2B sandbox.49 ```python50 from ttadev.primitives.integrations.e2b_primitive import CodeExecutionPrimitive51 from ttadev.primitives.core.base import WorkflowContext5253 async with CodeExecutionPrimitive() as executor:54 result = await executor.execute({55 "code": "import subprocess; r = subprocess.run(['python', '-m', 'pytest', '<test_file>', '-v', '--tb=short'], capture_output=True, text=True); print(r.stdout); print(r.stderr)"56 }, WorkflowContext(workflow_id="validate"))57 # Check result["success"] and result["output"] for PASSED/FAILED58 ```59 If E2B is unavailable, fall back to local pytest and note the deviation.60617. **Retain**: after a successful commit, call `mcp__hindsight__retain` with bank_id62 `tta-dev` documenting any decision, pattern, or failure from this task.6364#### Common Issues6566- **Type errors**: Ensure all new functions have strict type annotations (`str | None`, not `Optional[str]`).67- **Test failures**: Fix the implementation, never comment out tests. Follow the AAA pattern (Arrange-Act-Assert).68- **Import errors**: All primitives imports must use `from ttadev.primitives.X` — never `from primitives.X`.69- **Quarantined tests**: Tests marked `@pytest.mark.quarantine` are auto-skipped unless selected with `-m quarantine`.7071#### Deep Reference7273For full testing patterns, markers, CI pipeline details, and MockPrimitive API, see74[`docs/agent-guides/testing-architecture.md`](../../docs/agent-guides/testing-architecture.md).