单元测试工程师-单元测试覆盖

Unit test engineer skill for PHPUnit or Pest coverage, service-level assertions, and focused regression protection.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "单元测试工程师-单元测试覆盖" with this command: npx skills add aiweline/unit-test-coverage

Role

This skill creates or updates unit tests for WelineFramework code. It focuses on service-level behavior, model or helper logic, and deterministic regression protection that can run quickly and prove the changed logic directly.

When To Use

  • Use for PHPUnit, Pest, service tests, unit-level regression tests, and focused logic verification.
  • Use for keywords such as unit test, PHPUnit, Pest, service test, helper test, and coverage.
  • Use when changed logic can and should be proven without a full browser or runtime stack.

Source Material

  • AI-ENTRY.md
  • CLAUDE.md
  • dev/ai/skills/testing/SKILL.md
  • dev/ai/skills/service-development/SKILL.md
  • dev/ai/skills/code-generation-standards/SKILL.md
  • dev/ai/skills/community-module/SKILLS-CONSOLIDATED.md

Responsibilities

  • Create targeted unit tests around changed logic.
  • Extract logic into testable seams when direct testing is otherwise impossible.
  • Keep assertions precise enough to protect against regression.
  • Provide fast-running evidence that complements, rather than replaces, route or UI checks.

Workflow

  1. Read the task scope and identify the narrowest reliable unit boundary.
  2. Confirm whether the behavior belongs in a service, helper, model, or collaborator test.
  3. Add failing or missing test coverage that reproduces the expected behavior.
  4. Update implementation only as needed to make the behavior testable and correct.
  5. Run focused unit-test commands for the affected module or class.
  6. Review for assertion quality, readability, and regression value.
  7. Report the executed command and what behavior the test now protects.

Weline Rules

  • Prefer small, isolated, testable changes.
  • Provide unit test evidence where relevant.
  • Keep business logic in services instead of controllers or templates when testability matters.
  • Do not hardcode user-facing text.

Inputs Required

  • The changed logic and its owning module.
  • Expected behavior, edge cases, and regression risks.
  • Existing tests or target test directory.
  • The preferred focused test command.

Expected Output

  • New or updated unit tests that directly cover the changed logic.
  • A focused test command and pass result.
  • A note describing the protected regression case.

Validation

  • Run php bin/w phpunit:run --module=... or an equivalently focused test command.
  • Confirm the test fails before the fix or clearly covers the corrected branch after the change.
  • Confirm assertions are behavior-based rather than superficial snapshots.
  • Confirm the test scope stays unit-level and deterministic.

Constraints

  • Do not substitute E2E-only evidence for unit-testable logic.
  • Do not write broad brittle tests when one focused regression test is enough.
  • Do not bury critical assertions in indirect helper chains.
  • Do not let unit tests depend on unrelated runtime state if isolation is possible.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Webinar Funnel Coach

Coach for designing, running, and optimizing high-converting webinar funnels (live, evergreen, on-demand) used by course creators, B2B SaaS, agencies, and in...

Registry SourceRecently Updated
General

Consulting Rate Strategist

Strategist for independent consultants and boutique agencies pricing their services. Use when someone asks how to set or raise rates, switch from hourly to v...

Registry SourceRecently Updated
General

Gibson Guitars

Gibson Guitars is a heritage brand known for iconic electric models like the Les Paul and SG, combining classic rock tone with American-made craftsmanship.

Registry SourceRecently Updated
General

Kelloggs Brand

American breakfast cereal pioneer Kellogg split in 2023 into Kellanova (snacks like Pringles, Cheez-It) and WK Kellogg (North American cereals).

Registry SourceRecently Updated