Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计通过

backend-testing后端测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

2,299

周安装

93

GitHub Stars

11

下载量

722
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:backend-testing(后端测试)
来源仓库:https://github.com/akillness/oh-my-skills
仓库路径:skills/backend-testing
安装命令:
npx skills add https://github.com/akillness/oh-my-skills --skill backend-testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/akillness/oh-my-skills --skill backend-testing

简介

用于辅助后端测试设计、用例编写和回归验证。

  • 适合编写单元测试、端到端测试或根据日志定位问题。
  • 需明确测试框架、运行命令和数据夹具,区分本地与生产环境。
  • 安装命令:npx skills add https://github.com/akillness/oh-my-skills --skill backend-testing。
  • 避免为了通过测试而破坏真实业务逻辑。

SKILL.md

Backend Testing

Use this skill as a packet-first backend testing router.

The job is not to dump boilerplate for every framework. The job is to:

  1. classify the request into the right backend test packet,
  2. pick the smallest credible mix of test layers,
  3. make dependency realism and data control explicit,
  4. split local vs PR vs slower lanes honestly,
  5. route policy, contract-shape, and auth-implementation work away when they are the real task.

Read these when needed:

When to use this skill

  • Add or repair backend coverage for APIs, services, repositories, workers, integrations, or auth flows
  • Decide whether a backend change needs unit, integration, contract/API, or narrow smoke coverage
  • Design fixture, factory, seed/reset, auth bootstrap, or environment-control strategy
  • Decide when to use mocks, fakes, containers, or real dependencies
  • Stabilize flaky backend suites, especially CI-only failures and local-vs-CI drift
  • Review whether a backend suite is too broad, too slow, too mock-heavy, or missing a key layer

When not to use this skill

  • The main task is org-wide test policy, gate design, release evidence, or company-wide QA philosophy → use testing-strategies
  • The main task is API contract shape, versioning, or schema design before tests can be scoped honestly → use api-design
  • The main task is implementing auth/session/provider behavior rather than testing it → use authentication-setup
  • The main task is frontend/browser testing or UI workflow coverage
  • There is no concrete backend behavior or regression target yet; in that case define the missing behavior packet first instead of pretending the test plan is settled

Instructions

Step 1: Classify the request into one packet

Choose the single best entry packet before giving advice.

Packets

  • coverage-plan — which layers to add for a concrete backend change
  • fixture-and-reset-plan — how to seed, isolate, reset, or bootstrap data/auth state
  • contract-and-api-checks — how to protect response/event/schema compatibility once the interface already exists
  • flake-stabilization — how to stabilize CI-only or intermittent backend failures
  • execution-lane-split — how to divide local-fast, PR, nightly, and release-only backend checks

If the request mixes several concerns, name the primary packet and one secondary concern.

Step 2: Frame the backend surface and risk

Capture the smallest useful context:

  • surface: endpoint, service, repository, worker, queue consumer, auth flow, integration, or migration
  • highest-risk behaviors: validation, permissions, persistence, retries, idempotency, ordering, serialization, side effects, compatibility
  • existing coverage already present
  • external dependencies involved: DB, cache, queue, email, payment, third-party API, identity provider, filesystem
  • runtime/language stack
  • where the evidence must hold: local loop, PR CI, scheduled CI, release smoke

If the request is vague, choose the smallest regression slice worth protecting first.

Step 3: Choose the right test layers

Use the packet and risk to select the lightest credible layer mix.

Unit / service

Prefer when the main risk is branching logic, validation, orchestration, or pure-ish business rules.

Integration

Prefer when database behavior, framework wiring, middleware, transactions, queues, caches, or serialization matter.

Contract / API

Prefer when clients depend on response shapes, status codes, schemas, or events and the interface already exists.

Smoke / selective end-to-end

Prefer only when a narrow release-critical journey crosses several backend boundaries and lower layers would miss the core risk.

State what is in scope, what is out of scope, and why.

Step 4: Decide dependency realism on purpose

For each dependency, choose one of:

  • mock / stub — expensive, unstable, or irrelevant to the behavior under test
  • fake / simulator — behavior matters, but a lightweight substitute is enough
  • containerized real dependency — queries, migrations, message semantics, or wire behavior matter enough that drift would hurt
  • shared external environment — only when unavoidable; call out the fragility cost explicitly

Good defaults:

  • prefer real DB behavior when repository, migration, transaction, or serialization behavior is central
  • prefer mocks for outbound third-party APIs unless the integration contract itself is under test
  • prefer a narrow containerized slice over a giant all-dependencies-in-PR setup
  • do not claim fake and real dependencies are equivalent when production parity is the whole risk

Step 5: Define fixture, data, auth, and environment control

A backend suite becomes untrustworthy when state is vague.

Specify:

  • fixture/factory strategy
  • seed/reset/rollback plan
  • auth/bootstrap helpers for users, roles, tenants, tokens, or sessions
  • time/randomness/idempotency control where needed
  • isolation rule: per test, per file, per suite, or per environment
  • debugging signals to capture when failures happen

If the suite relies on ordering, leftovers, or sleeps, call that fragility out directly.

Step 6: Split the execution lanes

Treat local, PR, and slower lanes as different jobs.

Define:

  • local-fast path — what developers should run repeatedly
  • PR path — what must gate merges
  • scheduled / nightly path — heavier breadth or expensive realism
  • release / incident path — narrow confidence checks or regression ratchets when needed

If the suite is slow, split it. Do not pretend one giant authoritative path is practical everywhere.

Step 7: Produce one backend test packet

Return one concise packet, not a general essay.

Recommended packet shapes:

  • coverage-plan → coverage table + dependency strategy + exclusions
  • fixture-and-reset-plan → fixture/reset memo + auth/bootstrap notes
  • contract-and-api-checks → compatibility packet + consumer/provider scope + route-outs
  • flake-stabilization → flake memo with likely causes, isolation fixes, readiness checks, and debug signals
  • execution-lane-split → lane matrix with local/PR/scheduled/release responsibilities

Minimum packet contents:

  • change surface and primary risk
  • chosen packet and any secondary concern
  • selected layers and why
  • dependency realism decisions
  • fixture/data/auth/environment control
  • execution-lane split
  • explicit route-outs when the request is partly owned elsewhere

Step 8: Verify scope boundaries before finalizing

Check:

  • does the packet protect the real backend regression risk rather than generic coverage vanity?
  • did you keep org-wide validation policy in testing-strategies?
  • did you route contract *shape* decisions to api-design while keeping contract *protection* here only when the interface already exists?
  • did you route auth implementation work to authentication-setup?
  • will a maintainer understand why a dependency is mocked, faked, containerized, or real?

Output format

## Backend Test Packet: [Surface or Change]

### Packet choice
- Primary packet: coverage-plan | fixture-and-reset-plan | contract-and-api-checks | flake-stabilization | execution-lane-split
- Secondary concern: optional
- Confidence: high | medium | low

### Change framing
- Surface: ...
- Main risks: ...
- Runtime: ...
- Existing coverage: ...

### Layer decisions
| Layer | In scope? | What it protects | Notes |
|------|-----------|------------------|-------|
| Unit / service | yes/no | ... | ... |
| Integration | yes/no | ... | ... |
| Contract / API | yes/no | ... | ... |
| Smoke / selective E2E | yes/no | ... | ... |

### Dependency realism
| Dependency | Strategy | Why |
|------------|----------|-----|
| Database / queue / cache | ... | ... |
| External API | ... | ... |
| Auth provider | ... | ... |

### Data and environment control
- Fixtures / factories: ...
- Seed / reset: ...
- Auth bootstrap: ...
- Isolation rule: ...
- Debug signals: ...

### Execution lanes
- Local-fast: ...
- PR CI: ...
- Scheduled / nightly: ...
- Release / incident: ...

### Route-outs
- `testing-strategies`: ...
- `api-design`: ...
- `authentication-setup`: ...

Examples

Example 1: auth-heavy API change

Input: “We added refresh-token rotation and new admin-only endpoints to our Express API. I need backend tests that catch auth failures, token replay issues, and DB persistence bugs without turning CI into a giant end-to-end suite.”

Good response shape:

  • chooses coverage-plan as the primary packet
  • combines unit/service plus integration/API coverage instead of one giant E2E suite
  • keeps real DB or containerized persistence where token/session behavior matters
  • defines auth bootstrap helpers and reset strategy
  • limits smoke coverage to a narrow release-critical path

Example 2: CI-only flake in a service suite

Input: “Our FastAPI tests pass locally but fail in CI around seeded Postgres state and background jobs. Give me a stabilization plan.”

Good response shape:

  • chooses flake-stabilization as the primary packet
  • identifies seed/reset drift, readiness, async timing, or leftover state as likely causes
  • recommends stronger isolation, readiness checks, and debugging signals instead of just retries
  • separates local-fast and CI-authoritative behavior clearly

Example 3: contract protection after an API already exists

Input: “Our payment service and webhook consumers keep drifting on response fields. I do not need API redesign, I need backend tests that catch compatibility regressions.”

Good response shape:

  • chooses contract-and-api-checks as the primary packet
  • keeps contract protection here because the interface already exists
  • routes any schema redesign or versioning debate to api-design
  • recommends consumer/provider or schema-compatibility coverage rather than broader smoke inflation

Example 4: too-broad policy request

Input: “Design our overall engineering org testing strategy for frontend, backend, mobile, and QA.”

Good response shape:

  • recognizes that the primary task belongs to testing-strategies
  • keeps any backend-specific advice scoped as a handoff only
  • refuses to turn backend-testing into a universal QA-governance skill

Best practices

  1. Start from the packet, not from the framework.
  2. Protect the real backend regression risk before chasing coverage percentages.
  3. Prefer layered backend coverage over giant brittle end-to-end suites.
  4. Make fixture, seed, and auth bootstrap strategy explicit; hidden state is where trust dies.
  5. Split local-fast, PR, scheduled, and release lanes intentionally.
  6. Use real dependencies when wire behavior matters, but keep expensive realism bounded.
  7. Treat flaky tests as a trust problem, not just an annoyance.
  8. Route policy, contract-shape, and auth-implementation ownership away instead of absorbing them.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.61%
按下载量换算243

Claude

33.58%
按下载量换算242

Cursor

20.55%
按下载量换算148

Gemini CLI

9.52%
按下载量换算69

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills