Back to list
tianjianjiang

smith-tests

by tianjianjiang

AGENTS.md as dotfiles: Personal coding standards that follow you everywhere, Mr. Anderson.

0🍴 0📅 Jan 10, 2026

SKILL.md


name: smith-tests description: Testing standards and TDD workflow. Use when writing tests, running test suites, implementing TDD, or organizing test files. Covers unit vs integration test separation, pytest patterns, and test-driven development methodology.

Testing Standards

  • Load if: Writing tests, running test suites, TDD
  • Prerequisites: @smith-principles/SKILL.md, @smith-standards/SKILL.md, @smith-python/SKILL.md

CRITICAL (Primacy Zone)

  • MUST mirror source structure: foo/bar/xyz.pytests/unit/foo/bar/test_xyz.py
  • MUST use pytest functions (not classes) - see @smith-python/SKILL.md
  • MUST separate unit (tests/unit/) and integration (tests/integration/) tests
  • MUST use virtual env runner for pytest (poetry run or uv run)
  • MUST write tests BEFORE implementation (TDD)
  • MUST run full test suite after changes
  • NEVER use pytest -m "not integration" if folder structure is mirrored (import conflicts)
  • NEVER write implementation before tests
  • NEVER skip running tests after changes

Test Organization

Unit:

  • Location: tests/unit/
  • Characteristics: Mock dependencies, fast

Integration:

  • Location: tests/integration/
  • Characteristics: Real services, @pytest.mark.integration

TDD Workflow

  1. Understand: Read existing test patterns
  2. Design: Write failing tests defining expected behavior
  3. Implement: Write minimal code to pass tests
  4. Verify: Run tests, validate coverage
  5. Refactor: Improve code while keeping tests green

Environment Configuration

  • tests/conftest.py disables tracking (OPIK, etc.)
  • Virtual env runners load .env automatically
  • Use .env.example as template (NEVER commit .env)

Claude Code Plugin Integration

When pr-review-toolkit is available:

  • pr-test-analyzer agent: Analyzes behavioral coverage, identifies critical gaps
  • Rates test gaps 1-10 (10 = critical, must add)
  • Trigger: "Check if the tests are thorough" or use Task tool

Ralph Loop Integration

TDD = Ralph iteration: test → implement → pytest → iterate until <promise>TESTS PASS</promise>.

See @smith-ralph/SKILL.md for full patterns.

  • @smith-python/SKILL.md - Python testing patterns (pytest functions)
  • @smith-dev/SKILL.md - Development workflow (quality gates)
  • @smith-principles/SKILL.md - Core principles

ACTION (Recency Zone)

Run tests (Poetry):

poetry run pytest tests/unit/ -v
poetry run pytest tests/integration/ -v

Run tests (uv):

uv run pytest tests/unit/ -v

Success criteria:

  • All new functionality has tests
  • Test names follow project conventions
  • Tests are isolated and deterministic
  • No regressions in existing tests

Score

Total Score

45/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon