backend/testing-guide

backend/testing-guide is a skill for Claude Code from echoVic/boss-skill. It costs 30 tokens per session (4,206 once invoked), scanned A, original, MIT.

A guide for writing backend tests: small unit tests, tests that check connected parts such as an API and database, and end-to-end tests that follow a complete user flow.

In plain words
What is it for?
Use it when adding or reviewing backend tests, especially for service layers, API endpoints, database access, and full request flows.
Why use it?
It gives developers a clear testing structure and helps ensure business logic, API endpoints, database operations, and complete API flows are covered.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: agent in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { UserRepository } from '../repositories/userRepository';.

Part of the boss plugin — 28 skills, 7 commands, 9 agents, 8 hooks shipped together

Good fit Use it when adding or reviewing backend tests, especially for service layers, API endpoints, database access, and full request flows.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/echoVic/boss-skill
agentmods
npx agentmods add skills/echovic/boss-skill/testing-guide

Made for: Claude Code.

Or install boss, the plugin that ships this one along with the rest of its 28 skills, 7 commands, 9 agents, 8 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend/testing-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/boss-skill/testing-guide/github.svg)](https://agentmods.dev/skills/echovic/boss-skill/testing-guide)
Your own site
<a href="https://agentmods.dev/skills/echovic/boss-skill/testing-guide"><img src="https://agentmods.dev/badge/skills/echovic/boss-skill/testing-guide/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backend/testing-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/echovic/boss-skill/testing-guide"><img src="https://agentmods.dev/badge/skills/echovic/boss-skill/testing-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,206 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 251
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.04206
Opus 5.5 $0.00012 $0.01682
Sonnet 5.5 $0.00006 $0.00841
Haiku 4.5 $0.00003 $0.00421

Measured 17d ago against content hash e6ff5e8fa365, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

backend/testing-guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 17d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/skills/backend/testing-guide/SKILL.md · 628 lines

How it starts

The opening of the file, as written. The whole thing — 628 lines — stays where its author put it; the contents beside it link to each section on GitHub.

后端测试编写指南

测试要求(强制)

职责边界:Backend Agent 是测试的编写者,QA Agent 是测试的验证者。

测试金字塔

测试类型 占比 要求
单元测试 ~70% Service 层、业务逻辑必须有测试
集成测试 ~20% API 端点、数据库操作测试
E2E 测试 ~10% 必须编写,完整 API 流程测试

单元测试编写

Service 层测试

// services/userService.test.ts
import { UserService } from './userService';
import { UserRepository } from '../repositories/userRepository';

jest.mock('../repositories/userRepository');

describe('UserService', () => {
  let userService: UserService;
  let userRepository: jest.Mocked<UserRepository>;

  beforeEach(() => {
    userRepository = new UserRepository() as jest.Mocked<UserRepository>;
    userService = new UserService(userRepository);
  });

  describe('getById', () => {
    it('returns user when found', async () => {
      const mockUser = { id: '1', name: 'Alice', email: '[email protected]' };
      userRepository.findById.mockResolvedValue(mockUser);

      const result = await userService.getById('1');

      expect(result).toEqual(mockUser);
      expect(userRepository.findById).toHaveBeenCalledWith('1');
    });

    it('throws NotFoundError when user not found', async () => {
      userRepository.findById.mockResolvedValue(null);

      await expect(userService.getById('999')).rejects.toThrow('User not found');
    });
  });

  describe('create', () => {
    it('creates user with valid data', async () => {
      const createData = { name: 'Bob', email: '[email protected]' };
      const mockUser = { id: '2', ...createData };
      
      userRepository.findByEmail.mockResolvedValue(null);
      userRepository.create.mockResolvedValue(mockUser);

      const result = await userService.create(createData);

      expect(result).toEqual(mockUser);
      expect(userRepository.findByEmail).toHaveBeenCalledWith('[email protected]');
      expect(userRepository.create).toHaveBeenCalledWith(createData);
    });

    it('throws ConflictError when email already exists', async () => {
      const createData = { name: 'Bob', email: '[email protected]' };
      userRepository.findByEmail.mockResolvedValue({ id: '1', name: 'Existing', email: '[email protected]' });

      await expect(userService.create(createData)).rejects.toThrow('Email already exists');
    });
  });
});

Read the full file on GitHub · 628 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 17d ago Changed · +2 lines e6ff5e8fa365
  2. 1mo ago First seen · 626 lines · 30 tokens per session scan A f6683e48051e

Subscribe to this mod's changes

backend/testing-guide is a skill published in the GitHub repository echoVic/boss-skill (543 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 4,206 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.