# Generate Multi-Language Test Scaffolds

Creating consistent test skeletons across mixed-language repositories takes time. This skill analyzes public symbols and generates framework-specific scaffolds with fixtures, mocks, and TODO markers.

## Install

```bash
npx skillstore add consiliency/test-scaffolding
```

## Metadata

- Status: approved
- Slug: consiliency-test-scaffolding
- Skillstore revision: r1
- Version status: missing
- Tree hash: 491f1ee18c5e535ad6cec2c6fdf1b350fa2b8d847e22eca372de856566ecf17f
- Author: Consiliency
- GitHub username: Consiliency
- License: MIT
- Repository: https://github.com/Consiliency/treesitter-chunker/tree/main/.ai-dev-kit/skills/test-scaffolding
- Ref: 635f69fb8d2f4e6330ba47a4e5a0fb239c04d110
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, scripts, filesystem
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/consiliency-test-scaffolding
- Manifest: https://skillstore.pages.dev/api/skills/consiliency-test-scaffolding/manifest

## Capabilities

- Detects test frameworks from pyproject.toml, package.json, go.mod, Cargo.toml, and pubspec.yaml.
- Extracts public functions, classes, methods, types, and exports with language-specific heuristics.
- Maps source files to conventional test locations for each supported language.
- Generates fixture, mock, async, error-case, parameterized, and benchmark stubs when supported by the selected template.
- Skips existing test files unless the force option is explicitly requested.
- Returns a manifest of generated files, skipped files, discovered units, and counts.

## Use Cases

- Start feature development: Generate a conventional test file before implementing a new Python, TypeScript, Go, Rust, or Dart feature.
- Expand test coverage: Create fixtures, mocks, async cases, and error-case stubs for public APIs that need broader coverage.
- Standardize repository tests: Apply consistent naming and structure across repositories that use different languages and test frameworks.

## Prompt Templates

### Scaffold one source file

```
Scaffold tests for {source_file}. Detect the framework, preserve existing files, and use TODO-style stubs.
```

### Choose framework and location

```
Generate {framework} scaffolds for {source_files}. Include fixture stubs and mirror the source directory under {output_dir}.
```

### Analyze public APIs

```
Analyze {source_files} for public APIs, then scaffold tests with {framework}. Report generated files, skipped files, symbols, and unit counts.
```

### Build comprehensive scaffolds

```
Scaffold tests for {source_files} with {framework} and {naming_convention}. Include fixtures, async cases, error cases, and mocks. Do not overwrite existing tests.
```

## Limitations

- Regex-based analysis may miss decorated, generated, macro-based, or unusually formatted symbols.
- Scaffolds contain placeholders and do not infer complete assertions or business expectations.
- Framework detection requires a recognized package manifest or an explicit framework choice.
- Using the force option can replace an existing test file and requires careful review.

## Best Practices

- Confirm the detected framework and output directory before generating files.
- Keep existing tests protected, and enable the force option only after reviewing target files.
- Run the formatter and test command after generation to catch import or syntax issues.

## Anti Patterns

- Do not treat generated TODO stubs as finished test coverage.
- Do not force overwrites when test files contain maintained logic.
- Do not rely on regex heuristics for complex macros, decorators, generated exports, or unusual formatting.

## Security Audit

- Audited at: 2026-07-13T17:34:53.343\+00:00
- Summary: All 40 static alerts are false positives caused by Markdown formatting or ordinary language-specific test syntax. No shell execution, dynamic loading, reconnaissance, path traversal operation, or prompt injection was found; relative import examples only document generated test imports.

## Stats

- Views: 514
- Downloads: 9
- Favorites: 0
- Popularity score: 0
