tercel/spec-forge/test-cases-generation

Claude Code and agent skill by tercel/spec-forge

Trust tier 3
  • community
  • ext:[{"type":"context","description":"Custom context provider definitions"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Generates structured test case sets with multi-dimensional coverage from project code analysis or specification documents. This skill activates when the user asks to write test cases, generate tests, supplement tests, create test coverage, or improve test completeness. It auto-scans the project to extract testable units (APIs, functions, components, CLI commands, tool definitions), identifies coverage gaps, designs test cases across multiple dimensions (coverage depth, input types, interaction patterns), and produces a structured test case document with coverage matrix. Includes test strategy and methodology by default. Use --formal flag to add management sections (environment, roles, schedule, defect management).

Install

npx vskill@latest install tercel/spec-forge/test-cases-generation

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as tercel/spec-forge/test-cases-generation.

Test Cases Generation Skill

What Are Test Cases?

Test cases are structured specifications that define what to test, how to test it, and what the expected outcome should be. Unlike a test plan (which focuses on strategy, schedule, roles, and process), test cases are the actionable core — each one is detailed enough for an engineer to translate directly into test code.

This skill treats test case design as a distinct discipline from test planning and test implementation:

  • Test Planning (strategy, process, roles) → optional, available via --formal flag
  • Test Design (what cases, which dimensions, what coverage) → this skill's core output
  • Test Implementation (writing code) → downstream, handled by code-forge:tdd

Core Capabilities

Auto-Scan and Extract

The skill can automatically scan a project to extract testable units without requiring the user to provide a specification document. It identifies:

  • REST API routes — endpoints, methods, parameters, response codes
  • Functions and methods — signatures, parameter types, return values, branch logic
  • React/Vue/Svelte components — props, events, state transitions
  • CLI commands — commands, subcommands, flags, arguments
  • AI tool definitions — tool names, trigger conditions, parameters, combination patterns
  • Database models — schemas, relationships, constraints
  • Event handlers — event types, payloads, side effects
  • Middleware/interceptors — conditions, transformations, error handling
Multi-Dimensional Coverage

Every test case set is organized across dimensions. The skill provides built-in dimensions and can auto-detect project-specific dimensions.

Built-in Dimensions

Coverage Depth (always applied):

LevelNameDescriptionBaseline per unit (scale to risk)
L1Happy PathBasic correct behavior with valid inputs1 case
L2Boundary & ErrorEdge cases, invalid inputs, error handling2 cases
L3NegativeScenarios that should NOT trigger behavior1 case

The baseline column is what a branching, stateful, or security-relevant unit should get. Depth is proportional to unit risk/complexity — trivial units (a pure getter, a straight formatter) may take a justified lighter set, and high-risk units go beyond the baseline. See Step 5 for the scaling rule.

Test Category (apply categories relevant to the project):

CategoryWhen to IncludeDescription
FunctionalAlwaysCorrect behavior verification
Data IntegrityProject has database / persistent storeConstraints, transactions, cascades
SecurityProject handles auth, user input, or sensitive dataAuth, injection, access control
PerformanceProject has latency/throughput requirementsResponse time, throughput, resource usage
Auto-Detected Dimensions

The skill analyzes the project to discover additional dimensions. Examples:

Project TypeAuto-Detected DimensionValues
AI Tool CallingTrigger ModeSingle tool / Combo tools
AI Tool CallingConversation TurnsSingle turn / Multi-turn
REST APIAuth ContextUnauthenticated / User / Admin
Frontend ComponentDevice ContextDesktop / Mobile / Tablet
CLI ToolInput SourceArgs / Stdin / Config file
CLI ToolOutput FormatJSON / Table / Plain text
Event SystemDelivery ModeSync / Async / Batch
Function LibraryInput TypePrimitive / Object / Array / Null / Undefined
Data PipelineData VolumeEmpty / Small / Large / Malformed
SDK / ClientConnection StateConnected / Disconnected / Reconnecting

Auto-detected dimensions are presented to the user for confirmation before generating cases.

Combination Testing

When testable units interact with each other, the skill generates combination test cases:

  1. Identify interaction pairs — which units call, depend on, or affect each other
  2. Generate combination matrix — pairwise combinations of interacting units
  3. Design combination cases — test the interaction, not just individual units
  4. Prioritize combinations — rank by risk (high coupling = high priority)

Seven-Step Workflow

Step 1 — Determine Input Mode and Project Profile

This step answers two questions: how to find testable units (input mode) and what kind of project this is (project profile).

1a. Input Mode
User ProvidesModeBehavior
Specification document (@docs/features/auth.md)Spec ModeParse spec, extract testable requirements
Code path (@src/services/payment.ts)Code ModeAnalyze code, extract testable units
Nothing or just a nameScan ModeFull project scan, discover everything
1b. Project Profile Detection

Scan the project to determine its type. Check for framework signatures and unit type distribution:

SignalProject Profile
HTTP framework detected (Express, FastAPI, Spring Boot, Gin, NestJS, Koa, Hono, etc.) AND route/endpoint units presentWeb API
CLI framework detected (Click, Cobra, Commander, clap, argparse with subcommands, etc.) OR command/subcommand units presentCLI Tool
Frontend framework detected (React, Vue, Svelte, Angular, etc.) AND component units presentFrontend App
Tool/plugin definitions with trigger conditions, LLM framework detected (LangChain, Vercel AI SDK, etc.)AI Agent
Pipeline/transform/ETL patterns, data processing frameworks (Airflow, Prefect, dbt, etc.)Data Pipeline
Exported functions/classes as primary interface, no routes/commands/components, published as packageFunction Library
Client/SDK methods with connection management, API wrapper patternsSDK / Client Library

Detection method:

  1. Scan package.json dependencies, pyproject.toml, Cargo.toml, go.mod, build.gradle for framework signatures
  2. Count extracted unit types: routes vs. functions vs. components vs. commands vs. tools
  3. Check for database presence: ORM imports, migration files, DB config
  4. Check for auth presence: auth middleware, JWT/OAuth imports, permission decorators

Output: Explicit project profile label with rationale, e.g.: "Project Profile: Web API (Express detected in package.json, 12 route handlers found, PostgreSQL via Prisma)"

Step 1.5 — Doc-First Discipline (Mandatory)

Before scanning code or extracting testable units, the doc-first discipline applies. Read the existing test documentation, identify what already exists, and decide for each test case set whether to REUSE (reference existing), EXTEND (edit existing in place), or NEW (genuinely missing). The default for any module that already has a test-cases.md file is to extend in place — never to create parallel test-cases-v2.md files, never to append ## Update blocks, never to leave deprecated cases strikethrough'd.

The full discipline, the four rules, the pre-generation checklist, and the anti-patterns to avoid:

@../shared/doc-first.md

You MUST run the pre-generation checklist (the five questions) from doc-first.md before proceeding to Step 2. If an existing test-cases.md (or equivalent) already covers any of the units this generation will discuss, you must:

  1. List the existing files and TC IDs that overlap (with file:line references)
  2. Decide REUSE / EXTEND / NEW for each module
  3. Bias toward EXTEND — opening the existing test-cases file and adding/modifying entries — over NEW
  4. Preserve existing TC IDs. Once a TC-XXX-NNN has been issued and referenced from test code, it must not be silently renumbered. New cases get new IDs; removed cases retire their IDs (not reused).
  5. Identify which existing TC IDs are referenced from real test code (grep for the ID literal in test files) — those are load-bearing and must not be deleted without coordinating the test code update
  6. Surface which test files will need updating downstream

If the project shows signs of doc drift (multiple test-cases-*.md files, TC ID collisions across files, obvious duplication of cases), warn the user and recommend /spec-forge:analyze or /spec-forge:propagate first.

If a usable existing test-cases doc already covers most of what the user is asking for, the right action is edit it in place, not generate a new file.


Step 2 — Deep Scan and Extract

Extraction must go beyond listing function signatures. For each testable unit, capture four layers:

LayerWhat to ExtractWhy It Matters
InterfacePublic API surface — function signatures, type contracts, trait/interface boundaries, input/output typesDefines what CAN be tested from outside
LogicBranch paths, error handling chains, state transitions, validation rules, business logicDefines what SHOULD be tested (complexity = risk)
ArchitectureModule structure, layer boundaries, dependency direction, separation of concernsDefines test STRATEGY (unit vs integration vs E2E)
RelationshipsCall graphs, data flow between units, event propagation, shared state, trait implementationsDefines COMBINATION tests (which units interact)
2a. Project Scan (all modes)

Fast path (preferred): resolve <sf_scripts> (see @../shared/scripts.md) and run python3 "<sf_scripts>/sf-scan.py" --root "<project_root>". Its JSON gives the tech stack, frameworks, DB/auth signals, test.framework/test.command, source_tree, and the existing-doc inventory in one pass — use those directly and skip the manual globbing below. Fall back to the manual scan (silently) only when python3 is unavailable. In every case the deep, unit-level extraction in 2b is yours to do; the script only supplies the surface facts.

  1. Glob the project tree to discover structure, source modules, and naming conventions.
  2. Read the README to understand the project's purpose and architecture.
  3. Identify the tech stack by scanning package.json, pyproject.toml, Cargo.toml, go.mod, etc.
  4. Detect project frameworks (not just test frameworks). The names below are illustrative, not an exhaustive list — sf-scan.py emits the raw dependency names; recognize the framework from those and the code's idioms even when it is unlisted or newer than this file:
  • HTTP frameworks: Express, FastAPI, Spring Boot, Gin, NestJS, Koa, Hono, etc.
  • CLI frameworks: Click, Cobra, Commander, clap, argparse, etc.
  • Frontend frameworks: React, Vue, Svelte, Angular, etc.
  • AI frameworks: LangChain, Vercel AI SDK, AutoGen, etc.
  • Test frameworks: Jest, pytest, Go test, JUnit, Vitest, etc.
2b. Language-Aware Deep Extraction

Use the language-specific strategy matching the project's tech stack. Each strategy defines how to find ALL testable units across the four layers.

Python

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
10
7-day trend score
12

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • contextCustom context provider definitions

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/tercel/spec-forge/test-cases-generation/badge)](https://verified-skill.com/skills/tercel/spec-forge/test-cases-generation)

Something wrong with this skill or its page? Tell us.