Agent Skillsdyedd/lens › lens-testing

lens-testing

GitHub

规范后端 HTTP API 测试策略,仅针对高风险契约(如鉴权、路由)编写集成测试,前端采用静态检查。指导如何复用测试文件、执行本地验证及 CI 流程,避免过度测试和维护成本。

.agents/skills/lens-testing/SKILL.md dyedd/lens

Trigger Scenarios

需要为后端 HTTP API 添加或更新测试时 配置 CI/CD 中的测试运行器和前端静态检查流程时

Install

npx skills add dyedd/lens --skill lens-testing -g -y
More Options

Non-standard path

npx skills add https://github.com/dyedd/lens/tree/dev/.agents/skills/lens-testing -g -y

Use without installing

npx skills use dyedd/lens@lens-testing

指定 Agent (Claude Code)

npx skills add dyedd/lens --skill lens-testing -a claude-code -g -y

安装 repo 全部 skill

npx skills add dyedd/lens --all -g -y

预览 repo 内 skill

npx skills add dyedd/lens --list

SKILL.md

Frontmatter
{
    "name": "lens-testing",
    "description": "Apply Lens's policy for critical backend HTTP API tests and CI validation. Keep only high-risk API boundary coverage, and validate the frontend with static checks instead of frontend tests."
}

Lens Testing

Keep tests only for critical, high-risk backend HTTP contracts: authentication and authorization, data persistence or loss, gateway protocol compatibility, and routing or failover behavior. A new route or reproducible bug does not automatically require a test; add or update one only when the affected HTTP contract warrants the maintenance cost.

Do not add frontend tests or direct tests of units, services, helpers, converters, repositories, or other implementation details.

Workflow

  1. Trace the affected HTTP path and decide whether it is a high-risk contract.
  2. Reuse the nearest file and fixture under tests/api/.
  3. If coverage is justified, add the smallest request-and-response behavior test.
  4. Locally run static checks and, only when debugging, one focused API test.
  5. Let CI run the backend API suite with pytest-xdist and the frontend lint, type check, and build.

Commands

  • Backend focused check: uv run --no-sync python -m pytest tests/api/test_<area>.py -q --confcutdir=tests
  • Backend CI suite: uv run --no-sync python -m pytest tests/api -q --confcutdir=tests -n auto --dist worksteal
  • Frontend checks: pnpm lint, pnpm exec tsc --noEmit, and pnpm build

Do not add another test runner or a custom parallel harness. pytest-xdist is the backend parallel runner.

Version History

  • 5563aba Current 2026-08-16 08:02

Metadata

Files
0
Version
92d1d15
Hash
261784c8
Indexed
2026-08-16 08:02

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 12:42
浙ICP备14020137号-1 $Гость$