跳到正文
cccskills
免费在 GitHub 公开

ls-test-driven-development

Use when following a test-driven development workflow with test generation, coverage analysis, and multi-framework support.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(21)

  • SKILL.md5.8 KB
  • assets/expected_output.json2.3 KB
  • assets/sample_input_python.json1.4 KB
  • assets/sample_input_typescript.json1.4 KB
  • references/ci-integration.md4.2 KB
  • references/framework-guide.md5.4 KB
  • references/how-to-use.md7.5 KB
  • references/overview.md3.6 KB
  • references/tdd-best-practices.md3.5 KB
  • scripts/cli_support.py1.5 KB
  • scripts/coverage_analyzer.py21.9 KB
  • scripts/fixture_generator.py16.4 KB
  • scripts/format_detector.py14.1 KB
  • scripts/framework_adapter.py18.2 KB
  • scripts/metrics_calculator.py14.4 KB
  • scripts/metrics_complexity.py2.1 KB
  • scripts/output_formatter.py14.4 KB
  • scripts/tdd_quality.py3.9 KB
  • scripts/tdd_workflow.py18.4 KB
  • scripts/test_cli_contract.py9.5 KB
  • scripts/test_generator.py19.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

TDD Guide

Test-driven development skill for generating unit, integration, and E2E scaffolds; analyzing coverage; and guiding evidence-backed red-green-refactor workflows across Jest, Vitest, Pytest, JUnit, Mocha, and Jasmine adapters.

Table of Contents


Capabilities

CapabilityDescription
Test GenerationConvert requirements into distinct unit, integration, or E2E scenarios and templates
Coverage AnalysisParse LCOV, Istanbul JSON, Cobertura XML, and JaCoCo XML; identify applicable gaps
TDD WorkflowGuide red-green-refactor cycles with phase-specific execution evidence
Framework AdaptersGenerate imports, tests, assertions, suites, and setup for every CLI choice
Quality ScoringCount tests without overlap and score assertions, isolation, naming, and smells on 100 points
Fixture GenerationCreate realistic test data, mocks, and factories

Workflows

Generate Tests from Code

  1. Provide requirements as user stories, acceptance criteria, or API specifications.
  2. Select --test-type unit, integration, or e2e; each choice changes scenarios, execution scope, and template guidance.
  3. Select a compatible target framework and language.
  4. Review and replace every generated placeholder assertion.
  5. Validation: Compile and run the generated scaffold in the selected project.

Analyze Coverage Gaps

  1. Generate LCOV, Istanbul JSON, Cobertura XML, or JaCoCo XML from the project test runner.
  2. Run coverage_analyzer.py with a threshold from 0 through 100.
  3. Treat null branch coverage as not applicable for branchless files.
  4. Review prioritized, file-specific uncovered lines and branches.
  5. Validation: Confirm each applicable coverage dimension meets the target.

TDD New Feature

  1. Write the test first (RED) and run it.
  2. Supply status: failed, failure_kind: assertion or expectation, and a non-empty failure_message.
  3. Implement minimal code and supply a passing execution result (GREEN).
  4. Refactor while keeping tests green; an unchanged optional refactor is valid.
  5. Validation: Advance only when the current phase's structured evidence passes.

Tools

Scripts are both importable Python modules and command-line tools. Run examples from the skill root (ls/skills/ls-test-driven-development) or adjust paths for your checkout.

ToolPurposeUsage
test_generator.pyGenerate test cases from requirements JSONpython scripts/test_generator.py --input requirements.json --framework pytest --module auth
coverage_analyzer.pyParse and analyze coverage reportspython scripts/coverage_analyzer.py --report lcov.info --threshold 80
tdd_workflow.pyGuide red-green-refactor cyclespython scripts/tdd_workflow.py --phase red --requirement "user can sign in"
framework_adapter.pyGenerate framework-specific snippetspython scripts/framework_adapter.py --framework pytest --action imports
fixture_generator.pyGenerate test data and mockspython scripts/fixture_generator.py mock-data --schema-file schema.json --count 5
metrics_calculator.pyCalculate test quality metricspython scripts/metrics_calculator.py --source app.py --tests test_app.py
format_detector.pyDetect language and frameworkpython scripts/format_detector.py --file source.ts
output_formatter.pyFormat JSON output for CLI/desktop/APIpython scripts/output_formatter.py --kind coverage --input summary.json

Input Requirements

For Test Generation:

  • Source code (file path or pasted content)
  • Compatible framework/language pair (see the authoritative compatibility matrix)
  • Test scope: unit, integration, or e2e

For Coverage Analysis:

  • Coverage report file in LCOV, Istanbul JSON, Cobertura XML, or JaCoCo XML
  • Optional source context
  • Threshold from 0 through 100

For TDD Workflow:

  • Feature requirements or user story
  • Current phase (RED, GREEN, REFACTOR)
  • Test code and implementation status

Compatibility

Use the single authoritative compatibility matrix and upstream sources. Do not copy version floors into secondary references.


Limitations

ScopeDetails
Generated scopeUnit, integration, and E2E outputs are scaffolds; replace placeholders and supply project-specific setup
Static analysisScripts do not execute tests; callers supply structured execution evidence
Language supportBest for TypeScript, JavaScript, Python, and Java
Report formatsNative support is LCOV, Istanbul JSON, Cobertura XML, and JaCoCo XML
Generated testsRequire human review for domain assertions and complex orchestration

When to use other tools:

  • E2E testing: Playwright, Cypress, Selenium
  • Performance testing: k6, JMeter, Locust
  • Security testing: OWASP ZAP, Burp Suite

2026-07 Refresh Note

Refresh classification: existing LocalSetup-native TDD coverage remains the target for TDD imports. Do not create a duplicate ls-tdd-skill; route TDD requests here and use ls-write-run-tests for framework-specific commands.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Guide accessibility reviews for UI, documents, and workflows. Use for WCAG-oriented audits, keyboard review, semantics, contrast, and remediation planning.

中文简介正在准备中。当前显示原文说明。

CruxExperts/LocalSetup62026年10月21日 更新

Use when choosing a LocalSetup Agent-* lane for exploration, research, bounded implementation, or review. Consult the static capability matrix; do not probe account or network availability.

中文简介正在准备中。当前显示原文说明。

CruxExperts/LocalSetup62026年10月21日 更新

Guide agent email inbox workflows with prompt-injection defenses. Use for inbound email processing, webhooks, routing, and safety review.

中文简介正在准备中。当前显示原文说明。

CruxExperts/LocalSetup62026年10月21日 更新

Navigate and understand codebases using agentlens hierarchical documentation. Use when exploring new projects, finding modules, locating symbols in large files, finding TODOs/warnings, or understanding code structure.

中文简介正在准备中。当前显示原文说明。

CruxExperts/LocalSetup62026年10月21日 更新

Use for Agent Q signed encrypted file-drop or mail ship and ingest, private registry v2 setup, queue status, and transport maintenance.

中文简介正在准备中。当前显示原文说明。

CruxExperts/LocalSetup62026年10月21日 更新

Inventory wrapper for the alirezarezvani Claude skills bundle. Use when triaging its broad skill catalog and large script surface before any targeted import.

中文简介正在准备中。当前显示原文说明。

CruxExperts/LocalSetup62026年10月21日 更新

查看 CruxExperts 的全部技能

报告此技能的问题