Agent Skillsdyedd/lens › lens-testing

lens-testing

GitHub

规范后端 HTTP API 测试策略,仅针对高风险契约(如鉴权、路由)编写测试,前端采用静态检查。提供 pytest-xdist 运行及 CI 验证命令,避免过度测试。

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

Trigger Scenarios

需要为后端 HTTP API 添加或更新测试 执行后端 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
5563aba
Hash
261784c8
Indexed
2026-08-16 08:02

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-18 03:52
浙ICP备14020137号-1 $mapa de visitantes$