Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 22 additions & 29 deletions .cursor/skills/pest-testing/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: pest-testing
description: >-
Tests applications using the Pest 4 PHP framework. Activates when writing tests, creating unit or feature
tests, adding assertions, testing Livewire components, browser testing, debugging test failures,
working with datasets or mocking; or when the user mentions test, spec, TDD, expects, assertion,
coverage, or needs to verify functionality works.
description: "Tests applications using the Pest 4 PHP framework. Activates when writing tests, creating unit or feature tests, adding assertions, testing Livewire components, browser testing, debugging test failures, working with datasets or mocking; or when the user mentions test, spec, TDD, expects, assertion, coverage, or needs to verify functionality works."
license: MIT
metadata:
author: laravel
---

# Pest Testing 4
Expand Down Expand Up @@ -37,13 +36,12 @@ All tests must be written using Pest. Use `php artisan make:test --pest {name}`.

### Basic Test Structure

<code-snippet name="Basic Pest Test Example" lang="php">

<!-- Basic Pest Test Example -->
```php
it('is true', function () {
expect(true)->toBeTrue();
});

</code-snippet>
```

### Running Tests

Expand All @@ -55,13 +53,12 @@ it('is true', function () {

Use specific assertions (`assertSuccessful()`, `assertNotFound()`) instead of `assertStatus()`:

<code-snippet name="Pest Response Assertion" lang="php">

<!-- Pest Response Assertion -->
```php
it('returns all', function () {
$this->postJson('/api/docs', [])->assertSuccessful();
});

</code-snippet>
```

| Use | Instead of |
|-----|------------|
Expand All @@ -77,16 +74,15 @@ Import mock function before use: `use function Pest\Laravel\mock;`

Use datasets for repetitive tests (validation rules, etc.):

<code-snippet name="Pest Dataset Example" lang="php">

<!-- Pest Dataset Example -->
```php
it('has emails', function (string $email) {
expect($email)->not->toBeEmpty();
})->with([
'james' => 'james@laravel.com',
'taylor' => 'taylor@laravel.com',
]);

</code-snippet>
```

## Pest 4 Features

Expand All @@ -111,8 +107,8 @@ Browser tests run in real browsers for full integration testing:
- Switch color schemes (light/dark mode) when appropriate.
- Take screenshots or pause tests for debugging.

<code-snippet name="Pest Browser Test Example" lang="php">

<!-- Pest Browser Test Example -->
```php
it('may reset the password', function () {
Notification::fake();

Expand All @@ -129,20 +125,18 @@ it('may reset the password', function () {

Notification::assertSent(ResetPassword::class);
});

</code-snippet>
```

### Smoke Testing

Quickly validate multiple pages have no JavaScript errors:

<code-snippet name="Pest Smoke Testing Example" lang="php">

<!-- Pest Smoke Testing Example -->
```php
$pages = visit(['/', '/about', '/contact']);

$pages->assertNoJavaScriptErrors()->assertNoConsoleLogs();

</code-snippet>
```

### Visual Regression Testing

Expand All @@ -156,14 +150,13 @@ Split tests across parallel processes for faster CI runs.

Pest 4 includes architecture testing (from Pest 3):

<code-snippet name="Architecture Test Example" lang="php">

<!-- Architecture Test Example -->
```php
arch('controllers')
->expect('App\Http\Controllers')
->toExtendNothing()
->toHaveSuffix('Controller');

</code-snippet>
```

## Common Pitfalls

Expand Down
39 changes: 22 additions & 17 deletions .cursor/skills/tailwindcss-development/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: tailwindcss-development
description: >-
Styles applications using Tailwind CSS v4 utilities. Activates when adding styles, restyling components,
working with gradients, spacing, layout, flex, grid, responsive design, dark mode, colors,
typography, or borders; or when the user mentions CSS, styling, classes, Tailwind, restyle,
hero section, cards, buttons, or any visual/UI changes.
description: "Styles applications using Tailwind CSS v4 utilities. Activates when adding styles, restyling components, working with gradients, spacing, layout, flex, grid, responsive design, dark mode, colors, typography, or borders; or when the user mentions CSS, styling, classes, Tailwind, restyle, hero section, cards, buttons, or any visual/UI changes."
license: MIT
metadata:
author: laravel
---

# Tailwind CSS Development
Expand Down Expand Up @@ -38,22 +37,24 @@ Use `search-docs` for detailed Tailwind CSS v4 patterns and documentation.

In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed:

<code-snippet name="CSS-First Config" lang="css">
<!-- CSS-First Config -->
```css
@theme {
--color-brand: oklch(0.72 0.11 178);
}
</code-snippet>
```

### Import Syntax

In Tailwind v4, import Tailwind with a regular CSS `@import` statement instead of the `@tailwind` directives used in v3:

<code-snippet name="v4 Import Syntax" lang="diff">
<!-- v4 Import Syntax -->
```diff
- @tailwind base;
- @tailwind components;
- @tailwind utilities;
+ @import "tailwindcss";
</code-snippet>
```

### Replaced Utilities

Expand All @@ -77,43 +78,47 @@ Tailwind v4 removed deprecated utilities. Use the replacements shown below. Opac

Use `gap` utilities instead of margins for spacing between siblings:

<code-snippet name="Gap Utilities" lang="html">
<!-- Gap Utilities -->
```html
<div class="flex gap-8">
<div>Item 1</div>
<div>Item 2</div>
</div>
</code-snippet>
```

## Dark Mode

If existing pages and components support dark mode, new pages and components must support it the same way, typically using the `dark:` variant:

<code-snippet name="Dark Mode" lang="html">
<!-- Dark Mode -->
```html
<div class="bg-white dark:bg-gray-900 text-gray-900 dark:text-white">
Content adapts to color scheme
</div>
</code-snippet>
```

## Common Patterns

### Flexbox Layout

<code-snippet name="Flexbox Layout" lang="html">
<!-- Flexbox Layout -->
```html
<div class="flex items-center justify-between gap-4">
<div>Left content</div>
<div>Right content</div>
</div>
</code-snippet>
```

### Grid Layout

<code-snippet name="Grid Layout" lang="html">
<!-- Grid Layout -->
```html
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div>Card 1</div>
<div>Card 2</div>
<div>Card 3</div>
</div>
</code-snippet>
```

## Common Pitfalls

Expand Down
Loading