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

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.

Shared Collaboration Contract

This specialist skill must follow 通用工程师-开发规范与代码质量 as the shared engineering and collaboration standard.

Before and during work:

  • Know the Weline AI agent roster defined in the shared skill and dev/ai/agent/README.md.
  • Keep work inside this specialist's ownership boundary.
  • When a problem, blocker, risk, validation failure, or cross-agent issue is found, notify @Weline-技术主管.
  • Do not silently expand scope to fix another agent's area.
  • Include collaboration status in the final report.

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

崖州区企业服务

崖州区企业服务技能,用于查询企业基本情况、推荐针对性优惠政策、监管企业安全生产、结合崖州区产业发展情况提供企业发展建议等。支持同时为多家企业生成服务报告。触发词:崖州企业、企业服务、优惠政策、安全生产、企业查询、政策推荐、企业监管、发展建议、产业分析。

Registry SourceRecently Updated
General

REDCap CRF Generator

开发者:邹和建、刘从进 REDCap 数据字典生成器 - 将 Word 文档(CRF/方案)转换为 CSV 格式的 REDCap 数据字典。 适用场景: - 用户上传临床试验 CRF/方案 Word 文档,要求生成数据字典 - 将问卷/调查表转换为 REDCap 可导入的 CSV 格式 功能特点: - 智能识别表...

Registry SourceRecently Updated
General

EcoCompute — LLM Energy Efficiency Advisor

Evidence-first, stateless consulting skill for LLM inference energy optimization using measured benchmark priors and anti-pattern detection.

Registry SourceRecently Updated
General

ccf-events

查询 CCF 近期活动、会议和通知。当用户询问 CCF 近期活动、会议通知、即将举办的研讨会、一个月内将举办的会议、刚刚结束的会议等信息时使用此 skill。

Registry SourceRecently Updated