# Write Focused Pest Tests

Teams often add tests too late or cover implementation details instead of behavior. This skill guides Claude, Codex, and Claude Code to write focused Pest tests for critical paths.

## Install

```bash
npx skillstore add devanb/testing-test-writing
```

## Metadata

- Status: approved
- Slug: devanb-testing-test-writing
- Skillstore revision: r1
- Version status: missing
- Tree hash: ce8a98e4525ebcd7db5600ce4ab65d9a9d337a7ff5e96916db5540aa60c442ef
- Author: DevanB
- GitHub username: DevanB
- License: MIT
- Repository: https://github.com/DevanB/lucidlog/tree/master/.claude/skills/testing-test-writing
- Ref: 0519034dad657fb1f7706e0550e962beeda73fdf
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, filesystem
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/devanb-testing-test-writing
- Manifest: https://skillstore.pages.dev/api/skills/devanb-testing-test-writing/manifest

## Capabilities

- Guides creation of Pest tests in tests/Feature and tests/Unit directories.
- Prioritizes core user workflows, business logic, validation rules, and API endpoints.
- Encourages descriptive test names that describe expected behavior.
- Supports mocking external dependencies such as databases, APIs, file systems, and services.
- Recommends Pest datasets for repeated scenarios and fast unit tests.

## Use Cases

- Add Feature Coverage: Create focused tests for a new user workflow before a feature is completed.
- Review Critical Paths: Identify business rules, validation behavior, and API endpoints that need reliable tests.
- Standardize Pest Style: Align generated tests around clear names, behavior assertions, mocks, and datasets.

## Prompt Templates

### Create Basic Tests

```
Write Pest tests for this small feature. Focus on the main success path and one important failure path.
```

### Cover User Workflow

```
Review this user workflow and propose focused Pest feature tests for its critical behavior.
```

### Mock External Services

```
Write Pest tests for this service interaction. Mock external dependencies and assert observable behavior.
```

### Design Completion Coverage

```
Assess this completed feature and define the minimum strategic Pest coverage before release.
```

## Limitations

- It provides testing guidance and does not run tests by itself.
- It assumes projects use Pest and a PHP or Laravel-style test structure.
- Detailed standards are linked outside the skill package, so local availability may vary.
- It does not define complete coverage requirements for every project.

## Best Practices

- Start with the highest-value user workflow before adding edge-case coverage.
- Test observable behavior and outcomes instead of private implementation details.
- Use mocks and datasets when they make tests faster and clearer.

## Anti Patterns

- Do not generate broad snapshot tests when targeted assertions would be clearer.
- Do not test private methods instead of public behavior.
- Do not skip critical business paths because they require setup.

## Security Audit

- Audited at: 2026-07-09T11:27:45.564\+00:00
- Summary: SKILL.md line 12 uses markdown code spans for directory names, so the command execution alert is a false positive. SKILL.md line 28 links outside the skill directory with a parent-directory path, creating a real filesystem boundary concern. No evidence found for prompt injection or data exfiltration intent.

## Stats

- Views: 216
- Downloads: 8
- Favorites: 0
- Popularity score: 0
