Agent skill

Test Case Documentation

by ArabelaTso in ArabelaTso/Skills-4-SE

Generate comprehensive test case documentation from test code, test framework output, existing test docs, and source code context.

Apache-2.0Auto-check passedTesting & QA

Install Test Case Documentation

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill test-case-documentation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE test-case-documentation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/test-case-documentation .claude/skills/test-case-documentation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-case-documentation
GitHub stars
253
Token cost
~3.3k tokens
SKILL.md length
509 words
Files
3 (incl. scripts, references)
Skills in repo
151
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate comprehensive test case documentation from test code, test framework output, existing test docs, and source code context.

  • Works in 5 steps: Understand Documentation Needs → Extract Test Information → Organize Test Information → …
  • Documenting test suites
  • SKILL.md covers Overview, Workflow, Automation Opportunities and Reference
  • Runs Python scripts from its folder; calls pytest and python

What it does

Test Case Documentation is an agent skill from ArabelaTso/Skills-4-SE. Generate comprehensive test case documentation from test code, test framework output, existing test docs, and source code context. Use when documenting test suites, creating test specifications, generating test coverage reports, onboarding developers to testing practices, or preparing QA documentation. Analyzes test functions (pytest, unittest) to extract test names, docstrings, assertions, and organization, then produces structured markdown with both overview-level summaries and detailed test case specifications…

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/documentation-templates.md` and `scripts/extract_tests.py`).

It sits in Testing & QA, covering Test generation and Test coverage. It works with pytest. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Documenting test suites
  • Creating test specifications
  • Generating test coverage reports
  • Onboarding developers to testing practices

Example prompts

  • “/test-case-documentation”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Understand Documentation Needs
  2. Extract Test Information
  3. Organize Test Information
  4. Generate Documentation
  5. Document Test Execution

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pytest
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Case Documentation loads about 3.3k tokens when it runs, and up to ~5.8k if it reads all its reference files. Until then it costs about 190 tokens; SKILL.md has 509 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~190
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 509 words, ~3,312 tokens.

Download SKILL.mdSave it as .claude/skills/test-case-documentation/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
test-case-documentation
description
Generate comprehensive test case documentation from test code, test framework output, existing test docs, and source code context. Use when documenting test suites, creating test specifications, generating test coverage reports, onboarding developers to testing practices, or preparing QA documentation. Analyzes test functions (pytest, unittest) to extract test names, docstrings, assertions, and organization, then produces structured markdown with both overview-level summaries and detailed test case specifications including purpose, preconditions, steps, expected results, and test data. Triggers when users ask to document tests, generate test specifications, create test reports, summarize test coverage, or explain what tests do.

Test Case Documentation

Overview

Generate comprehensive, structured documentation for test suites by analyzing test code, framework output, and source context to produce both overview summaries and detailed test case specifications.

Workflow

1. Understand Documentation Needs

Determine what documentation is needed:

Questions to ask:

  • What test suites need documentation?
  • Is this for developers, QA, or stakeholders?
  • Focus on overview or detailed specifications?
  • Include coverage analysis?

Identify test location:

bash
# Find test files
find . -name "test_*.py" -o -name "*_test.py"

# Count test files
find . -name "test_*.py" | wc -l

# Check test framework
grep -r "import pytest\|import unittest" tests/
2. Extract Test Information

Gather test data from multiple sources.

Source 1: Test Code Analysis

Use the bundled script to extract test metadata:

bash
# Extract tests from directory
python scripts/extract_tests.py /path/to/tests

# Exclude specific directories
python scripts/extract_tests.py /path/to/tests venv,.venv,__pycache__

What it extracts:

  • Test function names
  • Test classes and organization
  • Docstrings
  • Test types (unit, integration, e2e)
  • Pytest markers/tags
  • File locations and line numbers

Manual extraction:

Read test files to understand:

python
def test_user_registration_with_valid_data():
    """
    Test successful user registration with valid input.

    Given: Valid email, username, and password
    When: User submits registration form
    Then: User account is created and welcome email sent
    """
    # Extract: purpose, preconditions, expected behavior
    user_data = {"email": "test@example.com", ...}  # Extract: test data
    result = service.register(user_data)  # Extract: operation
    assert result.success  # Extract: assertions/expected results
    assert result.user_id > 0

Key information to extract:

  • Test purpose (from name and docstring)
  • Test data (sample inputs)
  • Operations performed
  • Assertions (expected outcomes)
  • Setup and teardown (fixtures)
Source 2: Test Framework Output

Capture test execution results:

bash
# Run tests with verbose output
pytest tests/ -v > test_output.txt

# Run with detailed output
pytest tests/ -v --tb=short > test_results.txt

# Generate coverage report
pytest tests/ --cov=src --cov-report=term-missing > coverage.txt

Extract from output:

  • Which tests passed/failed
  • Execution time
  • Coverage percentages
  • Missing coverage areas
Source 3: Existing Test Documentation

Check for existing docs:

bash
# Look for test documentation
find . -name "*test*.md" -o -name "TEST*.md"

# Check for test plans
find . -name "*test*plan*.md"

# Look for docstrings in conftest.py
cat tests/conftest.py
Source 4: Source Code Context

Understand what's being tested:

bash
# Find source files related to tests
# test_user_service.py -> user_service.py
ls src/user_service.py

# Read source to understand functionality
cat src/user_service.py
3. Organize Test Information

Structure tests hierarchically.

See documentation-templates.md for detailed templates.

Organization structure:

Test Suite Overview
├── Summary Statistics
├── Test Organization (directory structure)
├── Coverage Summary
└── Test Files
    ├── File 1: test_user_service.py
    │   ├── TestUserRegistration (class)
    │   │   ├── test_valid_registration (unit)
    │   │   ├── test_duplicate_email (unit)
    │   │   └── test_weak_password (unit)
    │   └── TestUserAuthentication (class)
    │       ├── test_login_success (unit)
    │       └── test_login_failure (unit)
    └── File 2: test_api.py
        └── test_full_workflow (integration)

Categorize by:

  • Test type (unit, integration, e2e)
  • Module/feature tested
  • Priority/criticality
  • Test status (passing, failing, skipped)
4. Generate Documentation

Create structured markdown documentation.

Level 1: Overview Documentation

High-level summary for project understanding:

markdown
# Test Suite: User Management

**Last Updated:** 2026-02-15
**Total Tests:** 42
**Coverage:** 87%
**Status:** ✅ 40 passing, ❌ 2 failing

## Summary

Comprehensive test suite for user management functionality including registration,
authentication, profile management, and user data export.

## Test Statistics

- **Unit Tests:** 28 (67%)
- **Integration Tests:** 12 (28%)
- **End-to-End Tests:** 2 (5%)

## Test Organization

tests/ ├── unit/ │ ├── test_user_service.py (15 tests) │ ├── test_auth_service.py (8 tests) │ └── test_validators.py (5 tests) ├── integration/ │ ├── test_api.py (10 tests) │ └── test_workflows.py (2 tests) └── e2e/ └── test_complete_flows.py (2 tests)


## Coverage by Module

| Module | Coverage | Tests | Priority |
|--------|----------|-------|----------|
| user_service.py | 95% | 15 | High |
| auth_service.py | 88% | 8 | High |
| validators.py | 94% | 5 | Medium |

## Quick Start

```bash
# Run all tests
pytest tests/

# Run unit tests only
pytest tests/unit/

# Run with coverage
pytest --cov=src tests/

#### Level 2: Detailed Test Documentation

Detailed specifications for each test:

```markdown
## Test File: test_user_service.py

**Path:** `tests/unit/test_user_service.py`
**Tests:** 15
**Coverage:** 95%

---

### Class: TestUserRegistration

Tests for user registration functionality.

---

#### Test: test_user_registration_with_valid_data

**Type:** Unit Test
**Line:** 45
**Status:** ✅ Passing
**Tags:** user, authentication

**Purpose:**
Verify that a new user can successfully register with valid email, username, and password.

**Preconditions:**
- Database is empty (no existing users)
- Email validation service is mocked

**Test Data:**
```python
user_data = {
    "email": "test@example.com",
    "username": "testuser",
    "password": "SecurePass123!"
}

Test Steps:

  1. Create user data dictionary with valid fields
  2. Call UserService.register(user_data)
  3. Verify user record is created in database
  4. Verify user ID is returned
  5. Verify password is hashed (not plain text)

Assertions:

  • assert result.success == True
  • assert result.user_id > 0
  • assert User.query.count() == 1
  • assert created_user.password != "SecurePass123!"

Expected Result:

  • User created with status "active"
  • User ID returned (positive integer)
  • Password stored as hash
  • No errors raised

Actual Result: ✅ Pass (0.12s)

Related Tests:

  • test_user_registration_with_duplicate_email - Tests duplicate handling
  • test_user_registration_with_weak_password - Tests password validation

Source Code Tested: src/user_service.py:67-89 - UserService.register()


Show full SKILL.md (173 more words)Show less
Test: test_user_registration_with_duplicate_email

Type: Unit Test Line: 78 Status: ✅ Passing

Purpose: Verify that registration fails when email already exists.

Preconditions:

Test Data:

python
existing_user = User(email="test@example.com", username="existing")
duplicate_data = {
    "email": "test@example.com",  # Duplicate
    "username": "newuser",
    "password": "ValidPass123"
}

Expected Result:

  • DuplicateEmailError exception raised
  • Error message: "Email already registered"
  • No new user record created

Actual Result: ✅ Pass (0.08s)


Class: TestUserAuthentication

Tests for user login and authentication.

[Continue with more tests...]


### 5. Include Coverage Analysis

Identify tested and untested areas.

```markdown
## Test Coverage Analysis

**Overall Coverage:** 87%

### High Coverage Areas

**user_service.py** - 95% coverage
- ✅ User registration (all paths tested)
- ✅ User update (all paths tested)
- ✅ User deletion (all paths tested)
- ⚠️ Uncovered: External API error handling (lines 145-150)

**Recommendation:** Add test case `test_user_registration_with_api_failure`

### Medium Coverage Areas

**payment_service.py** - 85% coverage
- ✅ Payment processing (happy path tested)
- ✅ Payment validation (tested)
- ⚠️ Uncovered: Timeout handling (lines 67-72)
- ⚠️ Uncovered: Retry logic (lines 89-95)

**Recommendations:**
- Add `test_payment_processing_timeout`
- Add `test_payment_retry_on_failure`

### Low Coverage Areas

**export_service.py** - 78% coverage
- ✅ Basic export (tested)
- ❌ Large dataset handling (not tested)
- ❌ Memory overflow scenarios (not tested)

**Recommendations:**
- Add `test_export_large_dataset`
- Add `test_export_memory_limit`
6. Document Test Execution

Include how to run tests:

markdown
## Test Execution Guide

### Running All Tests

```bash
# Run entire test suite
pytest tests/

# Run with coverage report
pytest --cov=src --cov-report=html tests/

# Run with detailed output
pytest tests/ -v
Running Specific Tests
bash
# Run tests in specific file
pytest tests/unit/test_user_service.py

# Run specific test class
pytest tests/unit/test_user_service.py::TestUserRegistration

# Run specific test
pytest tests/unit/test_user_service.py::TestUserRegistration::test_valid_registration

# Run tests with specific marker
pytest -m "unit" tests/
pytest -m "integration" tests/
Test Configuration

pytest.ini:

ini
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
markers =
    unit: Unit tests
    integration: Integration tests
    slow: Slow running tests
Continuous Integration

Tests run automatically on:

  • Pull requests to main branch
  • Daily at 2am UTC
  • Before deployment

CI Command:

bash
pytest tests/ --cov=src --cov-report=xml --junitxml=test-results.xml

### 7. Present Documentation

Finalize and share the documentation.

**Documentation structure:**

docs/testing/ ├── README.md (overview + quick start) ├── test-suite-overview.md (high-level summary) ├── test-specifications/ │ ├── user-management-tests.md │ ├── payment-tests.md │ └── api-tests.md ├── test-coverage-report.md └── test-execution-guide.md


**Present to stakeholders:**
- Developers: Detailed specs + coverage
- QA: Test execution + expected results
- Management: Overview + statistics
- New team members: Overview + execution guide

## Tips for Effective Test Documentation

**Focus on clarity:**
- Use clear, descriptive test names
- Document the "why" not just the "what"
- Include expected vs actual behavior
- Show test data examples

**Keep it current:**
- Update docs when tests change
- Include last updated date
- Link to source code line numbers
- Note test status (passing/failing)

**Make it actionable:**
- Include reproduction steps
- Provide test execution commands
- Show configuration requirements
- Link related tests

**Organize logically:**
- Group by feature/module
- Order by priority or type
- Use consistent formatting
- Include table of contents for long docs

**Include context:**
- Explain preconditions
- Document test data
- Note dependencies
- Link to requirements or tickets

## Common Documentation Patterns

**Given-When-Then format:**
```python
def test_user_registration():
    """
    Given: A new user with valid email and password
    When: They submit the registration form
    Then: Their account is created and activated
    """

Arrange-Act-Assert pattern:

python
def test_calculate_total():
    """Test order total calculation with tax."""
    # Arrange
    order = Order(items=[Item(price=100)])

    # Act
    total = order.calculate_total(tax_rate=0.1)

    # Assert
    assert total == 110

Test matrices for combinatorial tests:

Input AInput BExpected
ValidValidSuccess
ValidInvalidError A
InvalidValidError B
InvalidInvalidError C

Automation Opportunities

Auto-generate from CI:

bash
# Run tests and generate documentation
pytest tests/ --json-report --json-report-file=test-report.json

# Parse JSON and generate markdown
python generate_test_docs.py test-report.json > docs/test-report.md

Keep docs in sync:

  • Git hooks to update docs when tests change
  • CI checks for undocumented tests
  • Automated coverage reports
  • Test status badges in README

Reference

For documentation templates and examples, see documentation-templates.md.

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in skills/test-case-documentation of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • references/documentation-templates.md
  • scripts/extract_tests.py

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Test Case Documentation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Case Documentation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Case Documentation this skillArabelaTso/Skills-4-SE253—~3.3kAutomated safety check: PassApache-2.0
Test Coverage Reviewareed1192/finance-news-aggregator149—~2.6kAutomated safety check: PassMIT
Mutation Test Strength Auditbuildfastwithai/gen-ai-experiments785—~641Automated safety check: PassMIT
TDD Guidealirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
TDD GuideLeoYeAI/openclaw-master-skills2.2k—~1.4kAutomated safety check: PassMIT
Pytest Patternscohen-liel/hivemind110—~806Automated safety check: PassApache-2.0

Similar skills

  • Test Coverage Review

    areed1192/finance-news-aggregator

    Audit, plan, write, and verify unit tests for Python projects using pytest.

    149 GitHub stars~2.6k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Mutation Test Strength Audit

    buildfastwithai/gen-ai-experiments

    Measures how well a Python pytest suite catches behavior changes through diff-scoped mutation testing, then proposes and verifies tests for surviving mutants.

    785 GitHub stars~641 tokensUpdated 15 days ago
    Testing & QAAuto-check passed
  • TDD Guide

    alirezarezvani/claude-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    LeoYeAI/openclaw-master-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    2.2k GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Pytest Patterns

    cohen-liel/hivemind

    pytest best practices for writing comprehensive test suites.

    110 GitHub stars~806 tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Generate Tests

    coco-research/coco

    A skill your agent uses when asked to generate tests for a file, module or component, to raise coverage, or to bootstrap a suite for untested code.

    473 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed

More from ArabelaTso/Skills-4-SE

All 151 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Test Case Documentation

What does Test Case Documentation do?

Generate comprehensive test case documentation from test code, test framework output, existing test docs, and source code context. Test Case Documentation is an agent skill from ArabelaTso/Skills-4-SE. Generate comprehensive test case documentation from test code, test framework output, existing test docs, and source code context.

When should I use Test Case Documentation?

Test Case Documentation fits situations like: documenting test suites; creating test specifications; generating test coverage reports; onboarding developers to testing practices.

How do I install Test Case Documentation in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill test-case-documentation -a claude-code`. Or copy the skill folder (skills/test-case-documentation in ArabelaTso/Skills-4-SE) into .claude/skills/test-case-documentation in your project. Claude Code loads it when a task matches its description.

How do I install Test Case Documentation in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill test-case-documentation -a codex`. Or copy the skill folder (skills/test-case-documentation in ArabelaTso/Skills-4-SE) into .agents/skills/test-case-documentation in your project. Codex loads it when a task matches its description.

Can I use Test Case Documentation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill test-case-documentation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-case-documentation, .gemini/skills/test-case-documentation, .github/skills/test-case-documentation and .opencode/skills/test-case-documentation in your project.

What does Test Case Documentation need to run?

Going by SKILL.md and its folder, Test Case Documentation needs Python for the scripts in its folder and the command-line tools its instructions call (pytest and python). Our summary lists: Python 3.

Does Test Case Documentation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Case Documentation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Test Case Documentation use?

Test Case Documentation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Case Documentation use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Test Case Documentation?

Skills that share tags, products or a category with Test Case Documentation: Test Coverage Review (areed1192/finance-news-aggregator, 149 stars), Mutation Test Strength Audit (buildfastwithai/gen-ai-experiments, 785 stars), TDD Guide (alirezarezvani/claude-skills, 28k stars) and TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Case Documentation?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 151 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.