testing

Generate unit, Playwright E2E, or Electron E2E tests for AgentOS projects.

Updated Apr 19, 2025
One-click install
npx skills add https://github.com/kys0213/agentos --skill testing-kys0213
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/kys0213/agentos/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/kys0213/agentos --skill testing-kys0213

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual test writing is time-consuming, error-prone, and often inconsistent across a large project. This Skill automates the generation of tests, ensuring they adhere to project conventions and best practices, freeing developers from repetitive work and ensuring high code quality.

Core Features & Use Cases

  • Intelligent Test Generation: Automatically determines the correct test type (Unit, Playwright E2E, Electron E2E) based on code location within the AgentOS project.
  • Convention Enforcement: Generates tests following the project's Given-When-Then structure, mock/fixture guidelines, and type safety rules, ensuring consistency.
  • Use Case: After implementing a new feature in packages/core/src/service.ts, simply ask the AI to "write tests for service.ts". The Skill will generate a compliant unit test, including necessary mocks, saving you hours of manual setup and review.

Quick Start

The skill is activated by natural language prompts.

Example: Requesting a test for a specific file

"Write tests for src/tool/mcp/service.ts"

Example: General test request

"Generate tests for my recent changes"

Frequently Asked Questions about testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate unit test generation for my AgentOS project?

This Skill automates unit test generation by analyzing your code location and project structure, then generates tests following your project's Given-When-Then conventions, mock guidelines, and type safety rules. Simply request tests for a specific file like `src/tool/mcp/service.ts` and receive a compliant test with proper fixtures and assertions.

What test types does the Skill generate for AgentOS code?

The Skill generates three test types based on code location: unit tests for packages/, Playwright E2E tests for web apps/, and Electron E2E tests for desktop apps/. It intelligently selects the appropriate test type and applies project-specific conventions including async/await, no-any type enforcement, and explicit verifiable assertions.

Can I use this to generate E2E tests with Playwright or Electron?

Yes, the Skill generates Playwright E2E tests for web-based code and Electron E2E tests for desktop applications within AgentOS projects. It automatically determines which type to generate based on whether your code lives in packages/ or apps/, ensuring tests integrate with your pnpm test and typecheck workflows.

Do generated tests follow project conventions and best practices?

Yes, tests are generated with Given-When-Then structure, mocks initialized in beforeEach, strict type safety without any types, async/await patterns, and explicit verifiable assertions. The Skill enforces consistency across your project and integrates with existing pnpm test and typecheck pipelines.

How does the Skill reduce manual test writing effort?

Manual test writing is time-consuming and error-prone; this Skill automates test generation for AgentOS projects, eliminating repetitive setup, ensuring convention compliance, and maintaining consistency. After implementing a feature, request tests for the file and receive production-ready tests with proper mocks and assertions.

What if my code spans multiple packages or apps directories?

The Skill analyzes whether code resides in packages/ or apps/ to determine the correct test type. For packages/, it generates unit tests; for apps/, it generates Playwright E2E or Electron E2E tests based on context, ensuring the right test strategy for each code location within your AgentOS project.