build-test-verify
npx machina-cli add skill theinterneti/TTA.dev/build-test-verify --openclawBuild, Test, and Verify (TTA.dev)
Validate code changes to ensure they meet quality standards before committing.
Process
Execute the following commands in order. Do not skip steps.
-
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 platform/ -
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=src --cov-report=html
Common Issues
- Type errors: Ensure all new functions have strict type annotations (
str | None, notOptional[str]). - Test failures: Fix the implementation, never comment out tests. Follow the AAA pattern (Arrange-Act-Assert).
- Import errors: Check import order β stdlib, third-party, local.
- Quarantined tests: Tests marked
@pytest.mark.quarantineare auto-skipped unless explicitly selected with-m quarantine.
Deep Reference
For full testing patterns, markers, CI pipeline details, and MockPrimitive API, see docs/agent-guides/testing-architecture.md.
Source
git clone https://github.com/theinterneti/TTA.dev/blob/main/.claude/skills/build-test-verify/SKILL.mdView on GitHub Overview
This skill enforces a quality gate on TTA.dev by formatting, linting, type checking, and testing your changes before committing. It emphasizes strict typing, proper test coverage for new code, and a clear sequence to prevent regressions.
How This Skill Works
It runs the exact sequence: format with Ruff, lint with Ruff fix, type-check with Pyright in basic mode, then execute the pytest suite with restrictions to skip long-running tests. If youβre adding new code, a full coverage report can be generated.
When to Use It
- Before committing any code changes to the repo.
- When code changes require automatic formatting, linting, and type checks.
- When adding new features and you need 100% test coverage for new code.
- When local verification is needed to mirror CI failures or delays.
- When preparing a pull request to demonstrate a clean, validated baseline.
Quick Start
- Step 1: Format and lint: uv run ruff format . && uv run ruff check . --fix
- Step 2: Type check: uvx pyright platform/
- Step 3: Run tests (full coverage if adding code): uv run pytest -v --tb=short -m \"not integration and not slow and not external\" && uv run pytest --cov=src --cov-report=html
Best Practices
- Always run the full sequence in a clean environment.
- Format before lint to avoid style-related failures.
- Use strict type annotations like str | None; avoid Optional[str].
- Do not skip steps; treat tests as the truth of code quality.
- Review failing tests and fix with AAA (Arrange-Act-Assert).
Example Use Cases
- A contributor validates a bug fix locally before opening a PR.
- A feature rewrite passes lint, type checks, and 100% new-test coverage.
- CI reported a type error; a maintainer runs local checks to fix it.
- Refactoring imports revealed a stdlib/third-party/local import order issue.
- A quarantine-marked test is rerun with -m quarantine when needed.