| name | moox-tree |
| description | Integrates moox/tree into Moox consumer packages (installation, Filament assets, TreeIndexConfiguration, forwardFromResource, TreeIndexListRecords, RendersAsTreeIndexInspector, Filament plugin). Use only when the user explicitly invokes moox-tree skill or asks to integrate moox/tree into a resource. |
| disable-model-invocation | true |
moox/tree Integration Skill
Skill for wiring moox/tree into consumer packages (e.g. category, menu-builder).
Out of scope (integration workflow): implementing changes inside packages/tree/** — use .cursor/rules/moox-tree-package.mdc. After such package work, sync this skill via .cursor/rules/moox-package-skill-sync.mdc (registry entry tree → moox-tree).
Invocation
Load only when the user explicitly requests it (e.g. “use moox-tree skill”, /moox-tree).
Required workflow
- Check scope — Does the task touch
packages/tree/src/**? → Stop; point the user to the package rule.
- Install package & assets — Follow installation.md: Composer dependency, service provider,
php artisan filament:assets. Skip only if already verified in this project.
- Gather context — Consumer package, model, existing table resource, migration/columns.
- Decision tree — For each branch in decisions.md: if context does not make the choice obvious, use
AskQuestion. Do not guess.
- Toolbar (mandatory before implementation) — Clarify search, filters, and language switcher in one
AskQuestion with three questions (decisions.md §6) unless the user already specified. Only then create resource/config.
- Implement integration — Apply the chosen path from integration.md.
- Verify — Run the checklist in integration.md and the install items in installation.md.
Decision branches
AskQuestion rule: One question per branch with 2 options (yes/no or 2–3 sensible variants). Implement only after answers. If multiple branches are open, use one AskQuestion with multiple questions (max. 2–3 at once) or ask sequentially.
Toolbar block (default before every new tree resource): One AskQuestion with exactly these three questions — skip only if the user explicitly stated otherwise (e.g. “without language switcher”):
- Search in the toolbar?
- Filters/tabs from the list resource?
- Language switcher?
Fixed rules (no question needed)
- No tree mechanics in the consumer — no custom Livewire for tree CRUD, no move/reorder actions, no copied Alpine stores.
- Single Livewire host — tree + inspector run on
TreeIndexListRecords only. There is no separate ResourceTreeIndex component and no Livewire aliases in TreeServiceProvider.
- No model extensions only for tree — no
getTreeLabel(), no TreeNodeContract; allowed: columns, Kalnoy NodeTrait for nested set, domain accessors → then labelColumnQueryable(false).
- Standalone inspector page (
TreeInspectorXxx): $resource = base resource (form source), not XxxTreeResource. Inline inspector on the list page resolves the form from forwardFromResource() (typically the tree resource class).
- List page
extends TreeIndexListRecords — config is registered in mount().
- Inline form actions —
TreeInlineFormResourceAdapter wraps the forwarded resource automatically; consumers do not add ProvidesInlineResourceFormActions or similar traits.
- Forwarded resource must not be
final — the adapter generates a subclass at runtime.
- Panel: register tree resource via Filament plugin.
- Domain filters only via config closures (
modifyQuery, applySearchUsing, applyLanguageUsing) or forwardFromResource() — do not push category/tenant queries into the package.
- No consumer CSS/JS for tree UI — layout and Alpine store come from
moox/tree via Filament assets; see installation.md.
References in the repo
| What | Path |
|---|
| Installation & assets | installation.md |
| Gold standard Moox | packages/category/src/Resources/CategoryTreeResource.php |
| List page + tabs | packages/category/src/Resources/CategoryResource/Pages/TreeListCategories.php |
| Inspector | packages/category/src/Resources/CategoryResource/Pages/TreeInspectorCategory.php |
| Plugin | packages/category/src/Plugins/CategoryTreePlugin.php |
| Package docs | packages/tree/README.md |
| Integration rule | .cursor/rules/moox-tree-integration.mdc |
| Package rule | .cursor/rules/moox-tree-package.mdc |
| List page + tree traits | packages/tree/src/Filament/Pages/TreeIndexListRecords.php |
| Inline inspector form | InteractsWithTreeResourceInspectorForm, TreeInlineFormResourceAdapter |
| Persist create/update | PersistTreeResourceCreateAction, PersistTreeResourceUpdateAction, TreeResourcePageExecutor |
| Test host (Pest) | packages/tree/tests/Support/TestTreeIndexHost.php |
| Service provider | packages/tree/src/TreeServiceProvider.php |
| Tree view | packages/tree/resources/views/filament/pages/tree-index-content.blade.php |
| Tree CSS | packages/tree/resources/css/tree.css |
| Alpine store | packages/tree/resources/views/scripts/alpine-tree-store.blade.php |
After integration
Run the checklist in integration.md. Add tests only if the user requests them.