agentleFS
soden46soden46/syarif-laravel-ai-skills/skills/testing/SKILL.md

testing

Skill4 starsChanged 5 months agoMITView on GitHub

Choose focused Laravel tests and quality checks that prove behavior without mirroring implementation details.

123 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oss-pr, pr-automation and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CES-LtdSkill

    oss-pr

    Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.

    Also in 3 projects that use this

  • CES-LtdSkill

    pr-automation

    PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    networking

    Practical application and coding skills for Networking

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 9 projects that use this

  • Cogni-AI-OUSkill

    dotfiles

    Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.

    Also in 3 projects that use this

  • +2 more from CES-Ltd
  • +1 more from ffsshhttiikk

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 105 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use feature tests for:

    line 15
  2. Distinctive:

    Use unit tests for:

    line 25
  3. Distinctive:

    Use browser E2E tests for:

    line 32
  4. Very specific:

    Use ui-agent-browser while a frontend workflow is still being explored or implemented.

    line 39
  5. Distinctive:

    Use Laravel fakes for external or filesystem side effects.

    line 43
  6. Distinctive:

    When rebuilding or porting an app, add feature parity tests for critical happy paths.

    line 83
  7. Distinctive:

    Use this only when persistence, middleware, authorization, route model binding, database constraints, queries, and events are not part of …

    line 89
  8. Distinctive:

    Avoid broad snapshots unless the project intentionally uses snapshot or visual-regression testing.

    line 111
  9. Distinctive:

    prefer role and label locators.

    line 117
  10. Distinctive:

    use deterministic auth setup when appropriate.

    line 120
  11. Distinctive:

    keep E2E focused on high-value browser behavior.

    line 121
  12. Distinctive:

    Before work is complete, run the relevant checks:

    line 127
  13. Distinctive:

    If a check cannot run, report the command and reason.

    line 137

“Common” is measured: kept by at least 6 in 10 of the 105 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Testing

Tests should prove behavior, not mirror implementation. Prefer the smallest test type that catches the risk.

Test Selection

Use feature tests for:

  • routes and controllers;
  • authorization and middleware;
  • validation;
  • redirects;
  • sessions;
  • database writes;
  • user-facing workflows.

Use unit tests for:

  • pure helpers;
  • value objects;
  • complex Actions/Services without HTTP behavior;
  • parsing and normalization rules.

Use browser E2E tests for:

  • JavaScript-dependent behavior;
  • Livewire/SPA interactions;
  • modals, uploads, previews, drag/drop, and browser state;
  • critical accessibility-sensitive flows.

Use ui-agent-browser while a frontend workflow is still being explored or implemented. Use e2e-playwright when that workflow should become repeatable Playwright coverage.

Framework Fakes

Use Laravel fakes for external or filesystem side effects.

Http::fake([
    'api.example.test/*' => Http::response(['ok' => true]),
]);

$this->post(route('records.send', $record))
    ->assertRedirect()
    ->assertSessionHasNoErrors();

Http::assertSent(fn ($request) => $request->method() === 'POST');

Common fakes:

  • Http::fake();
  • Storage::fake();
  • Mail::fake();
  • Notification::fake();
  • Queue::fake() or Bus::fake();
  • Event::fake().

Workflow Tests

For important user-facing workflows, cover the full route behavior.

$this->actingAs($user)
    ->post(route('records.store'), [
        'name' => 'Example',
    ])
    ->assertRedirect(route('records.index'))
    ->assertSessionHasNoErrors();

$this->assertDatabaseHas('records', [
    'name' => 'Example',
]);

When rebuilding or porting an app, add feature parity tests for critical happy paths. Parity tests are a regression net, not a replacement for focused tests.

Render And Document Tests

For pure Blade/report rendering, unsaved Eloquent graphs may be built with forceFill() and setRelation().

Use this only when persistence, middleware, authorization, route model binding, database constraints, queries, and events are not part of the behavior.

$owner = (new User)->forceFill(['name' => 'Example User']);
$record = (new Record)->forceFill(['number' => 'DOC-001']);
$record->setRelation('owner', $owner);

$html = view('reports.record', ['record' => $record])->render();

$this->assertStringContainsString('DOC-001', $html);

For generated documents, assert both stable source content and artifact validity.

$html = view('reports.record', $viewData)->render();
$output = Pdf::loadView('reports.record', $viewData)->output();

$this->assertStringContainsString('Document Number', $html);
$this->assertStringStartsWith('%PDF-', $output);

Avoid broad snapshots unless the project intentionally uses snapshot or visual-regression testing.

Browser E2E

For Playwright or similar tools:

  • prefer role and label locators;
  • use web-first assertions;
  • avoid fixed sleeps;
  • use deterministic auth setup when appropriate;
  • keep E2E focused on high-value browser behavior.

For Laravel Playwright details, load e2e-playwright instead of re-deriving setup, auth state, locator, trace, and screenshot rules.

Handoff Verification

Before work is complete, run the relevant checks:

  • targeted PHP tests;
  • affected browser tests;
  • Pint/style check;
  • static analysis;
  • frontend build/lint;
  • route checks;
  • queue/job smoke tests.

If a check cannot run, report the command and reason.

Context Efficiency

Layer: 4 (Verification)

Load this skill only when writing or reviewing tests. Do not load with unrelated skills. Keep tests behavior-focused: smallest test type that catches the risk, no per-function suites unless asked, no frameworks/fixtures for trivial logic.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.