本文へ移動
cccskills
無料GitHub で公開

typescript-testing-backend

Use when writing or reviewing TypeScript backend tests — Jest unit tests for services/controllers (mocked Prisma) or Supertest integration tests against a real isolated PostgreSQL test database. Triggers on edits to `*.service.test.ts`, `*.controller.test.ts`, `*.integration.test.ts`, service/controller/API test files (`.ts`, not `.tsx`) under `**/__tests__/`, or mentions of "backend test", "service test", "API test", "database test".

インストール方法を見る

含まれるファイル(6)

  • SKILL.md3.3 KB
  • references/database-testing.md1.2 KB
  • references/framework-and-structure.md2.1 KB
  • references/integration-testing.md3.0 KB
  • references/mock-policy-and-quality.md1.5 KB
  • references/unit-testing.md1.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

TypeScript Testing — Backend

You are operating as a backend test engineer. Mock at the module edge for units, hit a real Postgres for integration, and never assert on internal call shapes.

Reference stack: Jest 29 with @swc/jest, Supertest for HTTP, a custom TestServer helper that simulates Next.js route handlers, and a TestDatabase helper that provisions isolated PostgreSQL instances per run with migrations + seed. Tests live co-located in __tests__/ folders.

Unit tests mock the Prisma client at the module boundary; integration tests use the real DB plus an auth-state helper for authenticated request flows.

Universal Rules

  1. Use Jest — jest.mock() / jest.fn(), never vi.*.
  2. Co-locate tests in __tests__/ next to the source.
  3. Mock at the module boundary — not internal functions.
  4. Literal expected values — expect(total).toBe(70), never expressions.
  5. Every it() asserts observable behavior with at least one expect().
  6. beforeEach cleanup, scoped to test-created records — never truncate seed data.
  7. Clear auth/state helpers between tests so authenticated flows don't bleed across cases.
  8. Never test.skip() — fix or delete.
  9. Real DB for integration tests, mocked Prisma for unit tests.
  10. Internal utils stay real — only mock external boundaries.

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when adversarially reviewing a document that makes formal or technical claims — math derivations, physics papers, statistical analyses, benchmark reports, whitepapers. Inventories every equation and quantitative claim, verifies each AS NAMED in the text (never a paraphrase or a neighboring statement), and classifies VERIFIED / REFUTED / UNVERIFIABLE / VACUOUS. Triggers on "check this paper", "verify these claims", "is this derivation right", "review this proof", "audit this benchmark", "does the math hold up". For source-code review see code-review-and-quality; for skill/agent library audits see skill-library-review; for content quality scoring see content-ops.

日本語の概要は準備中です。原文の説明を表示しています。

LazyIsEfficient/agentic-os172026年7月17日 更新

Run Karpathy-style autoresearch optimization on any content. Generates 50+ variants, scores with a 5-expert simulated panel, evolves winners through multiple rounds, outputs optimized version + full experiment log. Use when optimizing landing pages, email sequences, ad copy, headlines, form pages, CTA text, or any conversion-focused content. Triggers on "optimize this page", "run autoresearch", "score these variants", "A/B test this copy".

日本語の概要は準備中です。原文の説明を表示しています。

LazyIsEfficient/agentic-os172026年7月17日 更新

Tests in real browsers. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data via Chrome DevTools MCP.

日本語の概要は準備中です。原文の説明を表示しています。

LazyIsEfficient/agentic-os172026年7月17日 更新

Conducts multi-axis code review across correctness, readability, architecture, security, and performance. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Triggers on "review my PR", "review this diff", "code review", "review this changeset", "is this ready to merge", "pre-merge review".

日本語の概要は準備中です。原文の説明を表示しています。

LazyIsEfficient/agentic-os172026年7月17日 更新

Estimate the full development cost of an existing codebase from lines of code, architectural complexity, and team-composition overhead. Use for 'how much would this cost to build', 'what did this codebase cost', development-cost or build-cost estimates, calendar-time estimates, and Claude/AI ROI on a delivered codebase. Estimates by measured LOC and complexity, not by ticket volume.

日本語の概要は準備中です。原文の説明を表示しています。

LazyIsEfficient/agentic-os172026年7月17日 更新

Auto-assembles a domain-specific expert panel (7–10 experts), scores any content or strategy artifact against a typed rubric, and iterates until the aggregate hits 90+ (max 3 rounds). Use as a quality gate on copy, email sequences, landing-page drafts, strategy docs, charts, titles, or recruiting evaluations — or when another skill needs a final review gate on its output. Triggers on "expert panel this", "score this", "rate these variants", "quality check this", "panel review", "expert score", "evaluate this copy/strategy/page". For variant generation and multi-round conversion optimization see autoresearch; for live-URL CRO auditing see conversion-ops; for the scripted content-production pipeline see content-pipeline.

日本語の概要は準備中です。原文の説明を表示しています。

LazyIsEfficient/agentic-os172026年7月17日 更新

LazyIsEfficient のスキルをすべて見る

このスキルの問題を報告する