agentleFS
filamentphpfilamentphp/filament/.agents/skills/capturing-filament-screenshots/SKILL.md

capturing-filament-screenshots

Skill32k starsChanged 3 days agoMITView on GitHub

Creates and regenerates Filament documentation screenshots using the docs demo app and screenshot schema. Use when adding screenshot examples, changing screenshot definitions, or capturing images under docs-assets/screenshots/.

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add component examples to the appropriate Livewire component in docs-assets/app/app/Livewire/ (e.g., Schemas/LayoutDemo.php).

    line 12
  2. Distinctive:

    Use natural, realistic content, not test-like examples.

    line 23
  3. Very specific:

    Add screenshot definitions to docs-assets/screenshots/schema.js:

    line 25
  4. Very specific:

    If you also changed the Livewire demo or Blade views, run php artisan optimize:clear from docs-assets/app afterwards.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

Capturing Filament Screenshots

Screenshots are in docs-assets/screenshots/. All paths below are relative to the repository root unless stated otherwise.

Adding examples

Add component examples to the appropriate Livewire component in docs-assets/app/app/Livewire/ (e.g., Schemas/LayoutDemo.php). Give each example a unique ->id() for the selector:

Group::make()
    ->id('myComponent')
    ->extraAttributes(['class' => 'p-16 max-w-2xl'])
    ->schema([
        // Your component here
    ]),

Use natural, realistic content, not test-like examples.

Add screenshot definitions to docs-assets/screenshots/schema.js:

'schemas/layout/my-component/simple': {
    url: 'schemas/layout',
    selector: '#myComponent',
    viewport: { width: 1920, height: 640, deviceScaleFactor: 3 },
},

Building assets

If you changed any CSS or JS files, run both builds in order. The repo root compiles each package's dist output, and the docs app has its own Vite build that bundles those outputs into docs-assets/app/public/build/. Skipping the second step leaves the docs app serving stale CSS, and screenshots will render against pre-change styles.

# From the repository root: compile package dist output
npm run build

# From docs-assets/app: bundle the docs app's CSS from the package output
npm run build

If you also changed the Livewire demo or Blade views, run php artisan optimize:clear from docs-assets/app afterwards.

Preparing the app

Set up the disposable docs app database first. Run php artisan migrate:fresh --seed && php artisan storage:link from docs-assets/app. This resets that app's database; do not point it at a database containing non-disposable data. Seeding also copies the file upload demos' sample images from database/seed-images/ to the public disk.

Generating screenshots

Run from docs-assets/screenshots:

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=$(which chromium)
node script.js --parallel "tables/*" # Add =N to --parallel for a specific worker count

--parallel starts its own servers on ports 8001+ (no php artisan serve needed), each with its own copy of the seeded database, because many demos mutate the database on mount and would corrupt each other's screenshots if they shared one. The pristine database is restored before every page load, so each screenshot always sees freshly seeded data. This makes parallel mode the most reliable way to run large batches. Screenshots using the configure option run serially after the parallel pool because they mutate a PHP file shared by every server.

For serial capture, start the app server from docs-assets/app on the default port 8000. In Amp orbs, use a supervised service:

amp orb service start filament-docs --port 8000 --command 'php artisan serve --host=0.0.0.0 --port=8000'

Then run from docs-assets/screenshots, with the same Puppeteer environment variables:

node script.js "schemas/layout/my-component/*"

The serial script expects http://127.0.0.1:8000. Don't use a custom port. In serial mode, a demo that truncates tables can cause later entries, e.g. tenancy or resource pages, to return 404 until you reseed.

Schema entries without a before callback that share the same URL, viewport, and theme are captured from a single page load, and one browser process is shared across the whole run. If an entry needs an isolated page load (e.g. its demo mutates state when rendered), give it a before callback.

Pages are captured with prefers-reduced-motion: reduce and with CSS animations, transitions, and the input caret disabled, so screenshots never depend on which animation frame they caught (e.g. spinning loading indicators, modal fade-ins, caret blinking).

Using screenshots in docs

Screenshots are generated in images/light/ and images/dark/ under docs-assets/screenshots/. Inspect the generated images in both themes before using them.

<AutoScreenshot name="schemas/layout/my-component/simple" alt="Description" />

Download now (ZIP)

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 3 mentionsApr 2026: 10 mentionsMay 2026: 2 mentionsJun 2026: 0 mentionsJul 2026: 2 mentionsAug 2026: 1 mentionSep 2026: 8 mentionsOct 2026: 11 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the filamentphp/filament repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about filamentphp/filament

The biggest 5 of 97 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 97

Talked about on GitHub, YouTube, Stack Overflow, Bluesky, Hacker News and the web (97 times).

On GitHub · 50

45 more on GitHub

On YouTube · 24

19 more on YouTube

On Stack Overflow · 16

11 more on Stack Overflow

On Bluesky · 5

On Hacker News · 1

On the web · 1

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.