单元测试工程师 单元测试覆盖
Unit test engineer skill for PHPUnit or Pest coverage, service-level assertions, and focused regression protection. Disabled by default; use only when the user explicitly asks to write, update, or run unit tests.From its SKILL.md
npx -y skills add Aiweline/WelineFramework --skill 单元测试工程师-单元测试覆盖Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.9 KB, 793 tokens by cl100k_base, as published. Nobody here has run it
Role
This skill is disabled by default. Use it only when the current user request explicitly asks to write, update, or run unit tests for WelineFramework code.
When To Use
- Use only for explicit user requests mentioning unit test, PHPUnit, Pest, service test, helper test, coverage, or "补单测".
- Do not infer this skill from ordinary bug fixes, business-logic changes, or validation needs.
Source Material
AI-ENTRY.mdCLAUDE.mddev/ai/skills/testing/SKILL.mddev/ai/skills/service-development/SKILL.mddev/ai/skills/code-generation-standards/SKILL.mddev/ai/skills/community-module/SKILLS-CONSOLIDATED.md
Responsibilities
- Create targeted unit tests around changed logic only after confirming explicit user intent.
- 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
- Confirm the current user request explicitly asks for unit-test authoring or execution.
- Read the task scope and identify the narrowest reliable unit boundary.
- Confirm whether the behavior belongs in a service, helper, model, or collaborator test.
- Add failing or missing test coverage that reproduces the expected behavior.
- Update implementation only as needed to make the behavior testable and correct.
- Run focused unit-test commands for the affected module or class when execution was requested or needed for the requested unit-test work.
- Review for assertion quality, readability, and regression value.
- Report the executed command and what behavior the test now protects.
Weline Rules
- Prefer small, isolated, testable changes.
- Do not author, update, or run unit tests unless the current user request explicitly asks for unit-test work.
- 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.
- The explicit user request that authorizes unit-test work.
- 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 use this skill to bypass the repository default ban on test-case authoring.
- 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.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.