AgentSkillsCN

do-setup-testing

为尚未配备测试框架的项目搭建测试基础设施。当用户希望在编写测试用例之前先完善测试基础架构时,可选用此技能。该技能能够自动识别项目类型,推荐合适的测试框架,并依据最佳实践进行配置。

SKILL.md
--- frontmatter
name: "do-setup-testing"
description: "Set up a testing framework for a project that doesn't have one. Use when user wants to add testing infrastructure before writing tests. Detects project type, recommends framework, configures with best practices."

Setup Testing Framework

Configure testing infrastructure for a project that lacks it.

When to Use

  • Project has no test framework configured
  • User wants to establish testing before TDD workflow
  • Migrating to a new test framework

Process

Step 1: Detect project type

Examine manifest files: package.json, pyproject.toml, go.mod, Cargo.toml, etc.

Step 2: Recommend framework

LanguageDefaultDetails
JavaScript/TypeScriptVitestSee references/vitest.md
PythonpytestSee references/pytest.md
Gogo testSee references/go-test.md
Rustcargo testSee references/rust-test.md
JavaJUnit 5Built-in to most IDEs
RubyRSpecgem install rspec

Step 3: Confirm with user

Use AskUserQuestion to confirm framework choice, test location, and extras (coverage, watch mode).

Step 4: Install and configure

  1. Add dev dependencies
  2. Create test directory
  3. Add test scripts to manifest
  4. Create example test file
  5. Update .gitignore if needed

Step 5: Verify

Run the example test to confirm setup works.

Output

code
═══════════════════════════════════════
Testing Framework Configured
  Framework: [name]
  Test dir: [path]
  Run: [command]
Next: /do:it test [target]
═══════════════════════════════════════