← Back to Skills Marketplace
281
Downloads
1
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install setup-unit-test
Description
One-click initialization of an AI-driven unit testing environment for frontend projects (supports React/Vue/pure TypeScript/Next.js). Automatically detects p...
Usage Guidance
This skill appears to do what it says (set up Vitest, Testing Library, MSW, config files, and pre-commit checks) and ships readable scripts. Before installing: 1) Confirm you have Node, Git, and your package manager available — the metadata doesn't declare these but the scripts need them. 2) Inspect the exact files it will write (.husky/pre-commit, vitest.config.ts, .claude/commands/*) and back up your existing pre-commit hook; the installer will modify your git hooks. 3) Be cautious with AUTO_GEN_TEST: enabling it or invoking the injected /gen-unit-test or /fix-test commands can cause source files to be sent to the external AI for test generation/repair — only enable that if you are comfortable sending code to the AI service and have reviewed the prompt templates in .claude/commands. 4) Run the tool in a disposable branch or test repo first so you can review generated tests and any automatic changes. If you need higher assurance, ask the author for a manifest of exact file changes or for the skill to declare required binaries and the AUTO_GEN_TEST env var in metadata.
Capability Analysis
Type: OpenClaw Skill
Name: setup-unit-test
Version: 2.0.2
The skill bundle provides a legitimate utility for initializing unit testing environments (Vitest, MSW, Husky) in frontend projects. It uses scripts like `detect-framework.mjs` and `check-missing-tests.mjs` to automate configuration and Git hooks, and it injects AI prompt templates for test generation. All operations, including shell execution for package installation and file system modifications, are clearly documented and strictly aligned with the stated purpose of the tool.
Capability Assessment
Purpose & Capability
The skill's files and SKILL.md align with a unit-test automation tool: detection script, test-check script, prompts, and config generation. However, the declared metadata lists no required binaries or environment variables while the runtime instructions and shipped scripts assume node, git, and a package manager (npm/yarn/pnpm). The absence of declared required binaries is a discrepancy worth noting but not necessarily malicious.
Instruction Scope
SKILL.md instructs the agent to read package.json, write config files, run package-manager installs, and modify Husky pre-commit hooks. The injected .claude/commands include workflows that recursively scan source files, read source code, generate tests, run vitest, and attempt automatic repair — which implies the project source code may be transmitted to an external AI when those commands are invoked. Auto-generation is disabled by default, but enabling AUTO_GEN_TEST or invoking the generated commands will expose project code to the AI service; this is scope creep relative to purely local setup and is a potential data-exfiltration vector.
Install Mechanism
There is no install spec (instruction-only) and the skill ships only small local scripts and prompt templates. No remote downloads, obfuscated code, or unusual install steps are present. This limits supply-chain risk; all executed code is included in the skill bundle and runs locally.
Credentials
The skill declares no required credentials or config paths (appropriate). It does reference an environment toggle AUTO_GEN_TEST (not declared in metadata) which controls whether the pre-commit hook will invoke automatic test generation (and thereby may send code to the external AI). No secrets are requested, but enabling auto-generation can expose project contents to the agent/AI service — the user should verify that is acceptable.
Persistence & Privilege
The skill does modify project state: it writes config files under the project (vitest config, tests setup), writes .claude/commands templates, copies scripts, and updates .husky/pre-commit. Those are project-scoped changes and expected for this purpose but can be sensitive (git hooks executing code on commits). The skill is not always-enabled and does not request global/system privileges.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install setup-unit-test - After installation, invoke the skill by name or use
/setup-unit-test - Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.2
- Switched all automation and detection scripts from JavaScript (`.js`) to modern ECMAScript modules (`.mjs`) for better compatibility and future-proofing.
- Enhanced detection: environment script now collects OS info and adds Next.js support.
- Upgraded config: `vitest-tsconfig-paths` plugin is default for instant tsconfig alias resolution.
- Broader framework support: works with React, Vue, TypeScript, and detects Next.js projects.
- Dependency list updated: adds `@vitest/ui` (visual UI) and smarter test environment presets.
- Automation improvements: new test checking script (`check-missing-tests.mjs`) is more robust and cross-platform.
- Changelist includes only real modifications based on user-provided inputs.
v2.0.1
- Added a Security & Permissions section to the documentation, detailing required file system, shell, and git operations.
- Clarified that all scripts run locally and do not transmit project data externally (except via explicit Claude commands).
- No changes to functionality or code; this update is documentation only.
v2.0.0
- Updated all documentation and configuration from Chinese to English for broader accessibility.
- No file or functionality changes in this version—this is a documentation-only update.
- All workflow steps, configuration files, and usage instructions are now in English.
- Existing features and integration steps remain unchanged.
v1.0.0
setup-unit-test v1.0.0
- Initial release: one-click AI-driven unit test setup for front-end projects (React, Vue, TypeScript).
- Detects project framework and language, installs Vitest + Testing Library + MSW, generates config files.
- Adds Claude custom commands (/gen-unit-test, /fix-test) for AI-based test generation and repair.
- Configures npm scripts, Husky pre-commit hook with lint-staged, and supports optional AI auto-generation of missing tests.
- Provides demo test for quick verification and outputs a summary on completion.
Metadata
Frequently Asked Questions
What is Unit Test Automation?
One-click initialization of an AI-driven unit testing environment for frontend projects (supports React/Vue/pure TypeScript/Next.js). Automatically detects p... It is an AI Agent Skill for Claude Code / OpenClaw, with 281 downloads so far.
How do I install Unit Test Automation?
Run "/install setup-unit-test" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Unit Test Automation free?
Yes, Unit Test Automation is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Unit Test Automation support?
Unit Test Automation is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Unit Test Automation?
It is built and maintained by hibehero (@hibehero); the current version is v2.0.2.
More Skills