Rapyd Admin is built with and for AI agents. Three things matter: a brief the agent can read (rpd:context), a
verification loop it can run alone (tests, browser), and one AI feature in the product itself (error analysis in
the log viewer).
php artisan rpd:context # JSON: version, config, modules, routes, models, extension patterns
php artisan rpd:context --format=text # readable
php artisan rpd:context --no-routes --no-modelsPaste the output at the start of a session, or run it from Claude Code with ! php artisan rpd:context --format=text.
A minimal CLAUDE.md / AGENTS.md for an app built on Rapyd Admin:
Rapyd Admin app (Laravel + Livewire 4 + Bootstrap 5). Read `php artisan rpd:context --format=text` before changing modules.
New modules: `php artisan rpd:make Things Thing --module=Name --fields="name,active:boolean"` (no prompts); follow the structure of the existing app/Modules/*.
Fields and pages use the x-rpd:: components (docs/COMPONENTS.md). Look changes: docs/THEMES.md.
Verify: `vendor/bin/phpunit`, then open the page you touched in the browser and take a screenshot.
An agent working in an application built on Rapyd Admin gets the framework's conventions from two things shipped
with the package, in resources/boost/:
- the guideline (
guidelines/core.blade.php): short rules, always loaded (modules,x-rpd::components, workflows instead of a hand-writtenstatus, Livewire 4, how to verify); - the skills (
skills/rapyd-module,skills/rapyd-workflow): the procedures, loaded when the task needs them: creating or extending a module aroundrpd:make, designing and implementing a state machine (with reference files).
With Laravel Boost they reach your application by themselves:
composer require laravel/boost --dev
php artisan boost:install # picks the guideline and the skills of every installed package, rapyd-admin included
php artisan boost:update # after a package update; --discover looks for packages added sinceBoost writes the guideline into AGENTS.md / CLAUDE.md (and the files of the agents you chose) and the skills into
.claude/skills or the equivalent. In CI, in non-interactive mode, boost:update --discover may skip a package: add
zofe/rapyd-admin to the packages of boost.json by hand in that case.
Without Boost:
php artisan rpd:ai # skills → .claude/skills, guideline → AGENTS.md (between markers), @AGENTS.md in CLAUDE.md
php artisan rpd:ai --force # overwrite a skill your application has modifiedrpd:ai refreshes the guideline block on every run and keeps the rest of AGENTS.md; a skill you edited in
.claude/skills is left alone unless --force. Run it again after updating the package.
The same skills are used to develop the package itself (.claude/skills of the repository links to them): one source,
no copies to keep in sync.
php artisan rpd:ai:develop # exit code 0 when the agent is ready and what was built follows the conventions
php artisan rpd:ai:develop --json # for scripts and CIIt reads the files of the application, calls nothing, and reports:
- what the agent can do here: knows Rapyd Admin (guideline present and current, from Boost or
rpd:ai), builds modules and designs workflows (the skills, present, current or customised), Claude Code reads the guideline (CLAUDE.md), knows Laravel and Livewire (Boost), reads the schema, the logs and the routes (MCP). Every row that is not ok names the command that unlocks it; - the generators the agent calls instead of writing the code, and what each writes;
- the context the agent loads, estimated as characters / 4: one memory file plus the skill descriptions are resident in every session; skill bodies are read on demand;
- what was built in this project: for every module in
app/Modules, whetherrpd:makegenerated it (fromstorage/rapyd/generated.json, written at every run: module, model, files, size) or it was written by hand, and whether it follows the conventions the agent is taught: every page authorizes, permissions declared inconfig.php,Limits/, workflows, a test mentioning it. The size of the generated files, as tokens, is the boilerplate the model did not have to generate; - prompts to try (
resources/ai/prompts.json), each saying which packages it needs.
The same report is the "Develop with AI" page of the admin with ai-module
(route ai/develop, permission develop with ai), with a copy button on every prompt, plus what the AI runtime of
the application (widget, tools, provider) costs per day.
- Package tests:
vendor/bin/phpunit(PHPUnit + Orchestra Testbench, the CI suite). Livewire pages are tested withLivewire::test('module::component'), permissions withassertForbidden()/assertNotFound(). - Browser: a Playwright script that logs in and screenshots the pages you touched, in light and dark mode. Keep credentials in env variables and point it at localhost only.
- Themes:
php artisan rpd:theme:check.
Set ANTHROPIC_API_KEY (and optionally LOG_AI_MODEL, default claude-haiku-4-5-20251001) and an Analyze with AI button appears in the stack-trace modal of /log/app: probable cause and suggested fix, computed server-side, stack truncated to 3000 characters, visible to admins only. Copy for AI copies text and stack for any external assistant. Each analysis costs about $0.001 with Haiku.
Guida in italiano
Nessuna dipendenza aggiuntiva. Il modulo usa direttamente l'API di Anthropic.
Aggiungi al tuo .env:
ANTHROPIC_API_KEY=sk-ant-...Il provider e il modello sono configurabili:
# Modello usato per l'analisi (default: claude-haiku-4-5-20251001)
LOG_AI_MODEL=claude-haiku-4-5-20251001Se ANTHROPIC_API_KEY non è impostato, il pulsante "Analyze with AI" non compare — il modulo funziona normalmente senza di esso.
Vai su /log/app (o dalla voce di menu Log → App Logs).
Filtro per livello
Accanto al selettore del file di log compare un dropdown level. Seleziona error, warning, critical ecc. per filtrare le righe. I livelli disponibili sono: error, critical, alert, emergency, warning, notice, info, debug, processed, failed.
Badge colorato
Il livello di ogni riga ora appare come badge colorato invece di testo plain:
- Rosso →
error,critical,alert,emergency - Giallo →
warning,failed - Blu →
info,notice,debug,processed
Analisi AI di un errore
- Clicca sull'icona elenco (☰) nella colonna Stack di una riga con stack trace.
- Si apre il modal con il testo dell'errore e lo stack completo.
- Se
ANTHROPIC_API_KEYè configurato, compare il pulsante Analyze with AI. - Cliccalo — il pulsante mostra "Analyzing..." mentre la chiamata è in corso.
- L'analisi appare nel modal stesso, sotto lo stack trace, con:
- Causa probabile — spiegazione sintetica dell'errore
- Fix suggerito — azione specifica e applicabile
Il pulsante Copy for AI (sempre visibile) copia testo+stack nella clipboard per incollarlo in qualsiasi AI esterna.
L'analisi usa il modello configurato in
LOG_AI_MODEL. Haiku è sufficiente per la maggior parte degli errori Laravel ed è il più economico.
ANTHROPIC_API_KEYnon viene mai esposta al frontend. La chiamata API avviene server-side nella Livewire actionanalyzeError().- Lo stack trace inviato all'API è troncato a 3000 caratteri.
- Il pulsante "Analyze with AI" è visibile solo agli utenti con permesso
admin(ereditato dalla protezione diLogAppTable).
Ogni analisi di errore con claude-haiku-4-5 costa ~0.001$ (input ~500 token, output ~200 token).
Per usare un modello più potente su errori complessi, aggiorna il .env:
LOG_AI_MODEL=claude-sonnet-4-6