agentleFS
soden46soden46/syarif-laravel-ai-skills/skills/module-per-menu/SKILL.md

module-per-menu

Skill4 starsChanged 5 months agoMITView on GitHub

Build Laravel projects with one menu or page per module, using small controllers, per-page views, shared layouts/components, and dynamic DB-backed data.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 19 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill whenever creating, copying, refactoring, or expanding a Laravel web application with multiple menus, pages, dashboards, …

    line 11
  2. Distinctive:

    Default to a module-per-menu structure unless the existing project already has a stronger convention.

    line 13
  3. Distinctive:

    Use this shape for Laravel apps with menus or pages:

    line 17
  4. Distinctive:

    Keep controllers small and readable.

    line 52
  5. Distinctive:

    Create one controller per menu, page group, or resource boundary.

    line 53
  6. Distinctive:

    Do not put unrelated menus into one controller just because they share a layout.

    line 57
  7. Very specific:

    Do not use one giant PageController or one giant DepoWebController for a full admin system.

    line 58
  8. Distinctive:

    Use one Blade view per page or page state.

    line 62
  9. Distinctive:

    Use a shared layout for sidebar, topbar, shell, asset loading, and page header.

    line 63
  10. Distinctive:

    Use Blade components or partials for repeated filters, tables, badges, stats, modals, and form controls.

    line 64
  11. Distinctive:

    Keep page Blade files focused on rendering one menu/page.

    line 65
  12. Very specific:

    Do not put all menus into one Blade file with large @if ($active === ...) blocks.

    line 66
  13. Distinctive:

    Keep display data dynamic from Eloquent/model-backed services.

    line 67
  14. Distinctive:

    Keep route files as mappings only.

    line 71
  15. Distinctive:

    Use route groups for middleware, prefixes, and shared names.

    line 72
  16. Distinctive:

    Place static routes before broad parameter routes.

    line 73
  17. Distinctive:

    Prefer invokable controllers for single-page modules and normal controllers for page groups.

    line 74
  18. Distinctive:

    Add route/render tests for every important menu or page.

    line 75
  19. Distinctive:

    Use Services for dashboards, financial reports, daily reports, billing quotes, sync contracts, or other reusable calculations.

    line 81
  20. Distinctive:

    Keep seeded/demo data in seeders and factories, not embedded in views.

    line 82
  21. Distinctive:

    Before handoff, run the smallest meaningful checks available:

    line 86

≈ “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

Module Per Menu

Use this skill whenever creating, copying, refactoring, or expanding a Laravel web application with multiple menus, pages, dashboards, reports, or admin screens.

Default to a module-per-menu structure unless the existing project already has a stronger convention.

Standard Pattern

Use this shape for Laravel apps with menus or pages:

Route -> Small Page/Resource Controller -> Action/Service/Query Service when needed -> Eloquent -> View/API Response

Organize UI work so one menu or page maps to one clear module:

app/Http/Controllers/<Domain>/
  AuthController.php
  DashboardController.php
  GateInController.php
  GateOutController.php
  CustomerController.php
  ReportController.php

app/Services/<Domain>/
  DashboardReportService.php
  BillingService.php
  DailyReportService.php

resources/views/<domain>/
  layouts/app.blade.php
  pages/dashboard.blade.php
  pages/gate-in/index.blade.php
  pages/gate-in/create.blade.php
  pages/gate-out/index.blade.php
  pages/gate-out/process.blade.php
  components/filters.blade.php
  components/table.blade.php

Controller Rules

  • Keep controllers small and readable.
  • Create one controller per menu, page group, or resource boundary.
  • Let controllers orchestrate HTTP only: receive request, call validation/authorization, call service/action/query, return view/redirect/JSON.
  • Move repeated query/report calculations to a Service or query object.
  • Move multi-step writes to Actions or Services with explicit transactions when needed.
  • Do not put unrelated menus into one controller just because they share a layout.
  • Do not use one giant PageController or one giant DepoWebController for a full admin system.

View Rules

  • Use one Blade view per page or page state.
  • Use a shared layout for sidebar, topbar, shell, asset loading, and page header.
  • Use Blade components or partials for repeated filters, tables, badges, stats, modals, and form controls.
  • Keep page Blade files focused on rendering one menu/page.
  • Do not put all menus into one Blade file with large @if ($active === ...) blocks.
  • Keep display data dynamic from Eloquent/model-backed services. Avoid hardcoded metrics except placeholders explicitly marked as prototype/demo.

Route Rules

  • Keep route files as mappings only.
  • Use route groups for middleware, prefixes, and shared names.
  • Place static routes before broad parameter routes.
  • Prefer invokable controllers for single-page modules and normal controllers for page groups.
  • Add route/render tests for every important menu or page.

Dynamic Data Rules

  • Build page metrics, summaries, charts, tables, and select options from database queries or model-backed services.
  • Derive counts and totals from Eloquent collections or queries instead of duplicating numbers in Blade.
  • Use Services for dashboards, financial reports, daily reports, billing quotes, sync contracts, or other reusable calculations.
  • Keep seeded/demo data in seeders and factories, not embedded in views.

Verification

Before handoff, run the smallest meaningful checks available:

  • route list for changed route groups;
  • feature tests that open each authenticated menu/page;
  • API contract tests for new endpoints;
  • php artisan test;
  • Blade compile check such as php artisan view:cache followed by php artisan view:clear;
  • frontend build when assets changed.

Report any checks that cannot run and why.

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.