tercel/spec-forge/test-cases-generation
Claude Code and agent skill by tercel/spec-forge
- community
- ext:[{"type":"context","description":"Custom context provider definitions"}]
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-generationSemi-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
--formalflag - 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):
| Level | Name | Description | Baseline per unit (scale to risk) | |
|---|---|---|---|---|
| L1 | Happy Path | Basic correct behavior with valid inputs | 1 case | |
| L2 | Boundary & Error | Edge cases, invalid inputs, error handling | 2 cases | |
| L3 | Negative | Scenarios that should NOT trigger behavior | 1 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):
| Category | When to Include | Description | |
|---|---|---|---|
| Functional | Always | Correct behavior verification | |
| Data Integrity | Project has database / persistent store | Constraints, transactions, cascades | |
| Security | Project handles auth, user input, or sensitive data | Auth, injection, access control | |
| Performance | Project has latency/throughput requirements | Response time, throughput, resource usage |
Auto-Detected Dimensions
The skill analyzes the project to discover additional dimensions. Examples:
| Project Type | Auto-Detected Dimension | Values | |
|---|---|---|---|
| AI Tool Calling | Trigger Mode | Single tool / Combo tools | |
| AI Tool Calling | Conversation Turns | Single turn / Multi-turn | |
| REST API | Auth Context | Unauthenticated / User / Admin | |
| Frontend Component | Device Context | Desktop / Mobile / Tablet | |
| CLI Tool | Input Source | Args / Stdin / Config file | |
| CLI Tool | Output Format | JSON / Table / Plain text | |
| Event System | Delivery Mode | Sync / Async / Batch | |
| Function Library | Input Type | Primitive / Object / Array / Null / Undefined | |
| Data Pipeline | Data Volume | Empty / Small / Large / Malformed | |
| SDK / Client | Connection State | Connected / 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:
- Identify interaction pairs — which units call, depend on, or affect each other
- Generate combination matrix — pairwise combinations of interacting units
- Design combination cases — test the interaction, not just individual units
- 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 Provides | Mode | Behavior | |
|---|---|---|---|
Specification document (@docs/features/auth.md) | Spec Mode | Parse spec, extract testable requirements | |
Code path (@src/services/payment.ts) | Code Mode | Analyze code, extract testable units | |
| Nothing or just a name | Scan Mode | Full project scan, discover everything |
1b. Project Profile Detection
Scan the project to determine its type. Check for framework signatures and unit type distribution:
| Signal | Project Profile | |
|---|---|---|
| HTTP framework detected (Express, FastAPI, Spring Boot, Gin, NestJS, Koa, Hono, etc.) AND route/endpoint units present | Web API | |
| CLI framework detected (Click, Cobra, Commander, clap, argparse with subcommands, etc.) OR command/subcommand units present | CLI Tool | |
| Frontend framework detected (React, Vue, Svelte, Angular, etc.) AND component units present | Frontend 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 package | Function Library | |
| Client/SDK methods with connection management, API wrapper patterns | SDK / Client Library |
Detection method:
- Scan
package.jsondependencies,pyproject.toml,Cargo.toml,go.mod,build.gradlefor framework signatures - Count extracted unit types: routes vs. functions vs. components vs. commands vs. tools
- Check for database presence: ORM imports, migration files, DB config
- 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:
- List the existing files and TC IDs that overlap (with
file:linereferences) - Decide REUSE / EXTEND / NEW for each module
- Bias toward EXTEND — opening the existing test-cases file and adding/modifying entries — over NEW
- 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).
- Identify which existing TC IDs are referenced from real test code (
grepfor the ID literal in test files) — those are load-bearing and must not be deleted without coordinating the test code update - 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:
| Layer | What to Extract | Why It Matters | |
|---|---|---|---|
| Interface | Public API surface — function signatures, type contracts, trait/interface boundaries, input/output types | Defines what CAN be tested from outside | |
| Logic | Branch paths, error handling chains, state transitions, validation rules, business logic | Defines what SHOULD be tested (complexity = risk) | |
| Architecture | Module structure, layer boundaries, dependency direction, separation of concerns | Defines test STRATEGY (unit vs integration vs E2E) | |
| Relationships | Call graphs, data flow between units, event propagation, shared state, trait implementations | Defines 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.
- Glob the project tree to discover structure, source modules, and naming conventions.
- Read the README to understand the project's purpose and architecture.
- Identify the tech stack by scanning
package.json,pyproject.toml,Cargo.toml,go.mod, etc. - Detect project frameworks (not just test frameworks). The names below are illustrative, not an exhaustive list —
sf-scan.pyemits 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
- SKILL.md in the repositoryCheckingskills/test-cases-generation/SKILL.md
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
[](https://verified-skill.com/skills/tercel/spec-forge/test-cases-generation)