Test Scaffolding Skill
Generate test file scaffolds for source files, enabling TDD workflows. Scaffolds contain TODO stubs that the test-engineer agent fills during lane execution.
Variables
| Variable |
Default |
Description |
| SOURCE_FILES |
[] |
List of source files to scaffold tests for |
| TEST_FRAMEWORK |
auto |
Framework to use (auto-detects from manifest) |
| OUTPUT_DIR |
tests/ |
Where to place generated test files |
| NAMING_CONVENTION |
language-default |
Test file naming pattern |
| INCLUDE_FIXTURES |
true |
Generate fixture stubs |
| STUB_STYLE |
todo |
todo (TODO comments) or skip (skip markers) |
Workflow (Mandatory)
- Detect stack: Read package manifest (
pyproject.toml, package.json, go.mod, Cargo.toml)
- Identify framework: Match test dependencies (pytest, vitest, jest, testing, cargo test)
- Analyze sources: Extract public functions, classes, methods from each source file
- Map to tests: Apply naming convention to determine test file paths
- Generate scaffolds: Use language template, insert TODO stubs for each testable unit
- Return manifest: JSON with generated files, skipped files, and unit counts
Supported Frameworks
| Language |
Frameworks |
Detection |
| Python |
pytest, unittest |
pyproject.toml → [tool.pytest] or pytest in deps |
| TypeScript |
vitest, jest |
package.json → vitest or jest in devDeps |
| JavaScript |
vitest, jest |
package.json → vitest or jest in devDeps |
| Go |
testing |
go.mod → built-in testing package |
| Rust |
cargo test |
Cargo.toml → built-in test harness |
| Dart |
flutter_test, test |
pubspec.yaml → flutter_test or test in dev_deps |
Naming Conventions
| Language |
Source |
Test File |
| Python |
src/auth/login.py |
tests/auth/test_login.py |
| TypeScript |
src/auth/login.ts |
src/auth/login.test.ts or tests/auth/login.test.ts |
| Go |
pkg/auth/login.go |
pkg/auth/login_test.go |
| Rust |
src/auth/login.rs |
inline #[cfg(test)] module |
| Dart |
lib/auth/login.dart |
test/auth/login_test.dart |
Source Analysis Heuristics
Python
- Detect
def function_name( where name doesn't start with _
- Detect
class ClassName: for public classes
- Extract method signatures within classes
- Skip
__init__, __str__, etc. (dunder methods)
TypeScript/JavaScript
- Detect
export function, export const, export class
- Detect
export default function/class
- Parse JSDoc/TSDoc for parameter types
Go
- Detect exported functions (capitalized names)
- Detect exported methods on structs
- Detect exported types
Rust
- Detect
pub fn, pub struct, pub enum
- Detect
impl blocks with public methods
Output Schema
{
"format": "scaffold-manifest/v1",
"generated_at": "<ISO-8601 UTC>",
"framework": "pytest",
"generated": [
{
"source": "src/auth/login.py",
"test": "tests/auth/test_login.py",
"units": ["login", "logout", "refresh_token"],
"unit_count": 3
}
],
"skipped": [
{
"source": "src/auth/utils.py",
"reason": "test file exists"
}
],
"total_units": 12
}
Red Flags (Stop & Verify)
- No package manifest found → prompt user for framework
- Source file has no public functions → skip with warning
- Test file already exists → skip unless
--force specified
- Unable to parse source file → log warning, continue with others
Integration Points
With /ai-dev-kit:plan-phase
- Called to auto-populate
Tests Owned Files column
- Uses
Owned Artifacts from impl tasks as source files
With /ai-dev-kit:execute-lane
- Called before test-engineer agent runs
- Scaffolds committed with
chore(P{n}-{lane}): scaffold test files
With test-engineer agent
- Agent detects TODO markers in scaffolds
- Fills in test implementations
- Removes TODO markers when complete
Provider Notes
- Use this skill when
/ai-dev-kit:scaffold-tests is invoked
- Prefer TODO-style stubs over skip markers for visibility
- Preserve source file structure in test organization
- Include proper imports based on detected framework
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: test-scaffolding3description: Generate test file scaffolds from source analysis with language-appropriate templates. Use when this capability is needed.4---56# Test Scaffolding Skill78Generate test file scaffolds for source files, enabling TDD workflows. Scaffolds contain TODO stubs that the test-engineer agent fills during lane execution.910## Variables1112| Variable | Default | Description |13|----------|---------|-------------|14| SOURCE_FILES | [] | List of source files to scaffold tests for |15| TEST_FRAMEWORK | auto | Framework to use (auto-detects from manifest) |16| OUTPUT_DIR | tests/ | Where to place generated test files |17| NAMING_CONVENTION | language-default | Test file naming pattern |18| INCLUDE_FIXTURES | true | Generate fixture stubs |19| STUB_STYLE | todo | `todo` (TODO comments) or `skip` (skip markers) |2021## Workflow (Mandatory)22231. **Detect stack**: Read package manifest (`pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`)242. **Identify framework**: Match test dependencies (pytest, vitest, jest, testing, cargo test)253. **Analyze sources**: Extract public functions, classes, methods from each source file264. **Map to tests**: Apply naming convention to determine test file paths275. **Generate scaffolds**: Use language template, insert TODO stubs for each testable unit286. **Return manifest**: JSON with generated files, skipped files, and unit counts2930## Supported Frameworks3132| Language | Frameworks | Detection |33|----------|------------|-----------|34| Python | pytest, unittest | `pyproject.toml` → `[tool.pytest]` or `pytest` in deps |35| TypeScript | vitest, jest | `package.json` → `vitest` or `jest` in devDeps |36| JavaScript | vitest, jest | `package.json` → `vitest` or `jest` in devDeps |37| Go | testing | `go.mod` → built-in testing package |38| Rust | cargo test | `Cargo.toml` → built-in test harness |39| Dart | flutter_test, test | `pubspec.yaml` → `flutter_test` or `test` in dev_deps |4041## Naming Conventions4243| Language | Source | Test File |44|----------|--------|-----------|45| Python | `src/auth/login.py` | `tests/auth/test_login.py` |46| TypeScript | `src/auth/login.ts` | `src/auth/login.test.ts` or `tests/auth/login.test.ts` |47| Go | `pkg/auth/login.go` | `pkg/auth/login_test.go` |48| Rust | `src/auth/login.rs` | inline `#[cfg(test)]` module |49| Dart | `lib/auth/login.dart` | `test/auth/login_test.dart` |5051## Source Analysis Heuristics5253### Python54- Detect `def function_name(` where name doesn't start with `_`55- Detect `class ClassName:` for public classes56- Extract method signatures within classes57- Skip `__init__`, `__str__`, etc. (dunder methods)5859### TypeScript/JavaScript60- Detect `export function`, `export const`, `export class`61- Detect `export default function/class`62- Parse JSDoc/TSDoc for parameter types6364### Go65- Detect exported functions (capitalized names)66- Detect exported methods on structs67- Detect exported types6869### Rust70- Detect `pub fn`, `pub struct`, `pub enum`71- Detect `impl` blocks with public methods7273## Output Schema7475```json76{77 "format": "scaffold-manifest/v1",78 "generated_at": "<ISO-8601 UTC>",79 "framework": "pytest",80 "generated": [81 {82 "source": "src/auth/login.py",83 "test": "tests/auth/test_login.py",84 "units": ["login", "logout", "refresh_token"],85 "unit_count": 386 }87 ],88 "skipped": [89 {90 "source": "src/auth/utils.py",91 "reason": "test file exists"92 }93 ],94 "total_units": 1295}96```9798## Red Flags (Stop & Verify)99100- No package manifest found → prompt user for framework101- Source file has no public functions → skip with warning102- Test file already exists → skip unless `--force` specified103- Unable to parse source file → log warning, continue with others104105## Integration Points106107### With `/ai-dev-kit:plan-phase`108- Called to auto-populate `Tests Owned Files` column109- Uses `Owned Artifacts` from impl tasks as source files110111### With `/ai-dev-kit:execute-lane`112- Called before test-engineer agent runs113- Scaffolds committed with `chore(P{n}-{lane}): scaffold test files`114115### With `test-engineer` agent116- Agent detects TODO markers in scaffolds117- Fills in test implementations118- Removes TODO markers when complete119120## Provider Notes121122- Use this skill when `/ai-dev-kit:scaffold-tests` is invoked123- Prefer TODO-style stubs over skip markers for visibility124- Preserve source file structure in test organization125- Include proper imports based on detected framework126127---128> Converted and distributed by [TomeVault](https://tomevault.io/claim/consiliency) — claim your Tome and manage your conversions.129<!-- tomevault:4.0:skill_md:2026-04-13 -->