|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +> Project map for AI agents. Keep this file up-to-date as the project evolves. |
| 4 | +
|
| 5 | +## Project Overview |
| 6 | +Filament v4 plugin for Laravel that provides a `JsonColumn` table column for displaying JSON data as tree or table views in drawers, modals, or inline containers. |
| 7 | + |
| 8 | +## Tech Stack |
| 9 | +- **Language:** PHP 8.2+ |
| 10 | +- **Framework:** Laravel (package via spatie/laravel-package-tools) |
| 11 | +- **UI Framework:** Filament v4 |
| 12 | +- **DTO Base:** pepperfm/ssd-for-laravel |
| 13 | +- **Testing:** Pest v3 with Livewire plugin, Orchestra Testbench |
| 14 | +- **Static Analysis:** PHPStan / Larastan |
| 15 | +- **Code Style:** Laravel Pint + PHP CS Fixer |
| 16 | + |
| 17 | +## Project Structure |
| 18 | +``` |
| 19 | +src/ |
| 20 | + Columns/ |
| 21 | + JsonColumn.php # Main column component (extends Filament Column) |
| 22 | + Commands/ |
| 23 | + FilamentJsonCommand.php # Artisan command |
| 24 | + Concerns/ |
| 25 | + HasContainerPresentation.php # Trait: modal/drawer/inline container logic |
| 26 | + HasRenderMode.php # Trait: tree/table render mode logic |
| 27 | + Dto/ |
| 28 | + ButtonConfigDto.php # Button appearance config (extends ssd BaseDto) |
| 29 | + ModalConfigDto.php # Modal behavior config (extends ssd BaseDto) |
| 30 | + Enums/ |
| 31 | + ContainerModeEnum.php # inline | modal | drawer |
| 32 | + RenderModeEnum.php # table | tree |
| 33 | + Facades/ |
| 34 | + FilamentJson.php # Laravel facade |
| 35 | + Testing/ |
| 36 | + TestsFilamentJson.php # Testing helpers trait |
| 37 | + FilamentJson.php # Core service class |
| 38 | + FilamentJsonPlugin.php # Filament panel plugin registration |
| 39 | + FilamentJsonServiceProvider.php # Package bootstrap |
| 40 | +config/ |
| 41 | + json.php # Publishable configuration |
| 42 | +resources/ |
| 43 | + css/ # Source CSS (filament-json.css, index.css) |
| 44 | + dist/ # Compiled CSS assets |
| 45 | + lang/en/ # English translations |
| 46 | + views/ |
| 47 | + json.blade.php # Main column view |
| 48 | + _partials/ |
| 49 | + tree.blade.php # Recursive tree rendering |
| 50 | + nested.blade.php # Nested node rendering |
| 51 | +tests/ |
| 52 | + src/ |
| 53 | + ColumnTest.php # JsonColumn feature tests |
| 54 | + Fixtures/ # Test fixtures (BaseTable, ListUsers, etc.) |
| 55 | + Models/ |
| 56 | + User.php # Test model |
| 57 | + database/ |
| 58 | + factories/ # Test factories |
| 59 | + migrations/ # Test migrations |
| 60 | + resources/views/ # Test blade fixtures |
| 61 | + ArchTest.php # Architecture constraint tests |
| 62 | + Pest.php # Pest configuration |
| 63 | + TestCase.php # Base test case (Orchestra Testbench) |
| 64 | +``` |
| 65 | + |
| 66 | +## Key Entry Points |
| 67 | +| File | Purpose | |
| 68 | +|------|---------| |
| 69 | +| `src/Columns/JsonColumn.php` | Main component — the plugin's primary feature | |
| 70 | +| `src/FilamentJsonServiceProvider.php` | Package boot — registers views, config, assets | |
| 71 | +| `src/FilamentJsonPlugin.php` | Filament panel plugin registration | |
| 72 | +| `config/json.php` | Package configuration defaults | |
| 73 | +| `composer.json` | Package metadata, dependencies, scripts | |
| 74 | + |
| 75 | +## Scripts |
| 76 | +| Command | Purpose | |
| 77 | +|---------|---------| |
| 78 | +| `composer test` | Run Pest tests | |
| 79 | +| `composer analyse` | Run PHPStan static analysis | |
| 80 | +| `composer lint` | Check code style (Pint + CS Fixer) | |
| 81 | +| `composer lint-hard` | Fix code style | |
| 82 | + |
| 83 | +## AI Context Files |
| 84 | +| File | Purpose | |
| 85 | +|------|---------| |
| 86 | +| AGENTS.md | This file — project structure map | |
| 87 | +| .ai-factory/DESCRIPTION.md | Project specification and tech stack | |
| 88 | +| .ai-factory/ARCHITECTURE.md | Architecture decisions and guidelines | |
| 89 | + |
| 90 | +## Agent Rules |
| 91 | +- Never combine shell commands with `&&`, `||`, or `;` — execute each command as a separate Bash tool call. This applies even when a skill, plan, or instruction provides a combined command — always decompose it into individual calls. |
0 commit comments