This document outlines the architectural guidelines for AI agents working with PowerGrid 7.x.
The 7.x version prioritizes simplicity, an adaptable native skeleton, and independent test components, discarding legacy dependencies.
- PHP: 8.3+
- Livewire: 4.0+
- Tailwind CSS: 4.x+
- Removed Legacy Dependencies: Bootstrap, third-party select integrations, Lazy components, and Pulse files.
- New Required Package:
power-components/partials(imported locally).
- Theme classes (
src/Themes): Tailwind (root), DaisyUI and Flux extend it viaparentTheme. - Section-based authoring: A theme exposes per-section methods (
layout(),header(),table(),footer(),cols(),tabs(), plusfilter()/editable()/toggleable()), each returning a token slice; they are auto-merged bythemeTokenMethods().struct()only setsbaseView(). Write a slice as a plain nested array (6.x style) or with the fluent builder via thesection()helper.ArrayThemebuilds a whole theme from an array. - Selection & registry:
config('livewire-powergrid.theme')accepts a registered name ('tailwind'|'daisyui'|'flux') or an FQCN, resolved throughPowerGridManager::$themes/registerTheme(). - No-code overrides:
config('livewire-powergrid.theme_overrides')merges token overrides at the highest precedence — restyle any token without a Theme class. - Absolute Separation: HTML structure is separated from visual styles; classes live in tokens read by the
theme()helper.
- No Theme Conditionals: Do not use logic like
@if($theme == 'bootstrap')in Blade files. - Micro-files Strategy: Table views are single-purpose micro-files under
resources/views/components/structure/(e.g.table.blade.php,partials/tbody.blade.php,table/row.blade.php). - Token-driven, minimal overrides: A theme ships a blade only when the HTML structure genuinely differs; class-only differences live in tokens. DaisyUI ships zero blades (fully token-driven, inheriting Tailwind's views); Flux keeps blades that use
<flux:*>components. - Helpers: Read tokens with
theme('key')(or@theme('key')) and resolve views withtheme_view('alias').
- No Cache or JS processing for Actions: Action logic and buttons are no longer processed via JavaScript or cached.
- Full Blade Rendering: Actions are fully rendered as server-side Blade components/fragments via
renderActions().
- Livewire DOM Isolation: Use the
power-components/partialsfragments to isolate DOM updates and boost performance. - Hot Zones: Demarcated partial zones for isolated updates (each suffixed with
-{tableName}):pg-theadpg-tbodypg-paginationpg-filter-fields/pg-enabled-filters/pg-filter-triggerpg-tabs
- Self-sufficient Tests: Tests must be independent and immune to themes.
- Core Focus: Focus testing strictly on core engine capabilities: Search, Filters, Order, and Pagination.
- No Global Fixtures: Build mini-components at runtime within the test files instead of using global fixtures.
PowerGrid 7.x provides specialized Agent Skills for common tasks, distributed via Laravel Boost. In this repository they live in resources/boost/skills/. Consumer apps install them into their AI agents by running php artisan boost:install (or php artisan boost:update --discover).
| Skill | Use When |
|---|---|
powergrid-theme |
Creating a new theme OR updating an existing theme |
upgrade-theme-v6-to-v7 |
Migrating a v6 Theme class to v7 architecture |
create-powergrid-plugin |
Creating a new PowerGrid plugin (Column behavior with Blade/JS/events) |
Use this skill when the user asks to "create a theme", "add a new theme", "update theme X", "modify theme classes".
Examples:
- "Create a new PrimeReact theme"
- "Update the Tailwind theme to add dark mode support"
- "I need a custom theme for Vuetify"
Use this skill when the user mentions "migrate", "upgrade from v6", "convert v6 theme", "update old theme".
Examples:
- "Migrate my Bootstrap theme from v6 to v7"
- "Upgrade the old Tailwind theme class to the new struct() format"
- "Convert this v6 theme to v7"
Use this skill when the user asks to "create a plugin", "add a new column behavior", "make a selectable/colorpicker/rating column", "build a plugin".
Examples:
- "Create a selectable plugin for Column::add()->selectable([...])"
- "I need a rating stars plugin for PowerGrid"
- "Build a colorpicker plugin that saves on change"
- Recognize the trigger: Identify if the user's request matches a skill scenario
- Load the skill: Read the corresponding
resources/boost/skills/<skill-name>/SKILL.mdfile - Follow the workflow: Skills contain detailed step-by-step instructions -- follow them precisely
- Use provided resources: Skills may reference additional files (e.g.,
REFERENCE.md) in the same directory - Complete all steps: Ensure all checklist items in the skill are completed before marking the task done