agentleFS
AlizHarbAlizHarb/agent-skills/skills/filament-shield/SKILL.md

filament-shield

Skill1 starsChanged 5 months agoMITView on GitHub

Use when installing, configuring, generating, or reviewing Filament Shield authorization for Filament v5 panels.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    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 this skill when the app needs Filament panel authorization, permission generation, role seeding, super-admin handling, or policy …

    line 13
  2. Very specific:

    Ensure the auth provider model uses Spatie\Permission\Traits\HasRoles.

    line 22
  3. Distinctive:

    Run Shield setup for the panel.

    line 23
  4. Distinctive:

    Keep resource and page permissions in sync with panel entities.

    line 28
  5. Distinctive:

    Add tests for authorization, generated policy behavior, and seed content.

    line 29
  6. Distinctive:

    Prefer generated permissions and seeders over hand-maintained role wiring.

    line 52
  7. Distinctive:

    Test role assignment, permission generation, policy enforcement, and super-admin access.

    line 56
  8. Distinctive:

    Test the seeder output or the data it inserts.

    line 57
  9. Distinctive:

    Test any custom permission key composition or localization behavior.

    line 58
  10. Distinctive:

    Do not expose protected resources in Filament without Shield or equivalent policy coverage.

    line 63
  11. Distinctive:

    Keep the auth provider model and permission sync in lockstep.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Filament Shield

When To Use

Use this skill when the app needs Filament panel authorization, permission generation, role seeding, super-admin handling, or policy synchronization for Filament resources, pages, and widgets.

Inputs Needed

  • Panel ID, auth provider model, tenant support, permission naming, role strategy, super-admin strategy, seeder strategy, and tests.

Workflow

  1. Inspect the current Filament panel structure and auth provider model.
  2. Ensure the auth provider model uses Spatie\Permission\Traits\HasRoles.
  3. Run Shield setup for the panel.
  4. Generate permissions and policies for the panel entities.
  5. Publish and customize Shield config only where needed.
  6. Generate or update the Shield seeder to capture roles and permissions declaratively.
  7. Generate translation files for permission labels when localization is needed.
  8. Keep resource and page permissions in sync with panel entities.
  9. Add tests for authorization, generated policy behavior, and seed content.

Files That May Be Created

  • config/filament-shield.php
  • database/seeders/*Shield*Seeder.php
  • app/Policies/*Policy.php
  • lang/* or lang/admin/* translation files
  • app/Models/* auth provider model updates
  • Filament resource/page/widget policy or permission support classes

Files That May Be Modified

  • app/Models/User.php
  • app/Providers/Filament/*PanelProvider.php
  • Shield config, seeders, policies, tests, and translations

Architecture Rules

  • Shield is the default authorization layer for Filament panels in this app.
  • Policies and permissions must be generated and kept synchronized.
  • Panel resources, pages, and widgets should not bypass the permission model.
  • Super-admin or gate interception should be centralized and explicit.
  • Prefer generated permissions and seeders over hand-maintained role wiring.

Testing Requirements

  • Test role assignment, permission generation, policy enforcement, and super-admin access.
  • Test the seeder output or the data it inserts.
  • Test any custom permission key composition or localization behavior.

Security Requirements

  • Deny by default.
  • Do not expose protected resources in Filament without Shield or equivalent policy coverage.
  • Keep the auth provider model and permission sync in lockstep.

Review Checklist

  • Is Shield configured for the active Filament panel?
  • Does the auth provider model use HasRoles?
  • Are permissions generated and seeded, not hand-waved?
  • Is localization in app-owned translation files?
  • Are policy and permission names consistent with panel entities?

Common Mistakes

  • Leaving panel resources unprotected.
  • Relying on manual policy wiring while Shield is installed.
  • Forgetting to regenerate permissions after adding new resources or pages.

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.