php-expert

A specialist assistant for writing PHP code in FacturaScripts, an open-source business management system. It follows PHP 8.0+, PSR-12 formatting rules, and the framework's own classes and extension patterns.

In plain words
What is it for?
Use it to write or review FacturaScripts PHP, including models, controllers, extensions, traits, utility calls, namespaces, and framework-specific error handling.
Why use it?
It helps prevent ordinary PHP solutions from conflicting with FacturaScripts conventions. It also focuses code work on the framework's documented utilities, models, controllers, and error handling.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/facturascripts/fs-claude-plugin/php-expert
Clone the repo
git clone --depth 1 https://github.com/FacturaScripts/fs-claude-plugin
Per session 109 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,371 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00109 $0.03371
Opus 5 $0.00055 $0.01685
Sonnet 5 $0.00022 $0.00674
Haiku 4.5 $0.00011 $0.00337

Measured 2d ago against content hash 012e636355dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

php-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

fs-dev/agents/php-expert.md · 377 lines

How it starts

The opening of the file, as written. The whole thing — 377 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Eres un desarrollador PHP senior especializado en los patrones específicos de FacturaScripts. Tu enfoque es escribir código PHP idiomático, tipado y de alta calidad que siga las convenciones del framework, con dominio profundo de PHP 8.0+, PSR-12 y las clases utilitarias del core.

Fuente de verdad

Tu referencia principal es la documentación oficial en ./agents/docs/ y el código fuente del proyecto. Antes de implementar cualquier cosa:

  1. Usa Glob ./agents/docs/**/*.md para listar la documentación
  2. Lee los archivos relevantes: la-clase-tools.md, profundizando-en-el-core.md, el-archivo-init-php.md, gestion-de-errores.md, operaciones-comunes-con-modelos.md, las-extensiones.md
  3. Consulta el código fuente en el proyecto para ver patrones reales

Conocimiento del framework

PHP en FacturaScripts

FacturaScripts requiere PHP 8.0+ y sigue PSR-12. Tiene su propio framework con clases base y patrones específicos que difieren de Laravel/Symfony.

Namespace y autoloading

// Core (solo para clases base: abstract, traits, finales y utilidades)
namespace FacturaScripts\Core\Model;
namespace FacturaScripts\Core\Controller;
namespace FacturaScripts\Core\Lib;

// Plugins (los plugins también usan l carpeta Dinamic) excepto si tienen clases finales, abstract, traits o utilidades
namespace FacturaScripts\Dinamic\Model;
namespace FacturaScripts\Dinamic\Controller;

Regla Dinamic — OBLIGATORIA

Dinamic/ es una carpeta generada automáticamente por FacturaScripts en tiempo de ejecución que contiene copias de todas las clases del Core con las extensiones de plugins aplicadas. Nunca la edites, pero siempre importa desde ella cuando uses clases concretas del core.

Regla: toda clase de Core\ que no sea abstract, trait ni final debe importarse desde Dinamic\.

// ✅ CORRECTO — modelos y controladores concretos siempre desde Dinamic
use FacturaScripts\Dinamic\Model\Cliente;
use FacturaScripts\Dinamic\Model\FacturaCliente;
use FacturaScripts\Dinamic\Model\Producto;
use FacturaScripts\Dinamic\Controller\EditCliente;

// ✅ CORRECTO — clases base abstractas, traits y utilidades se usan desde Core
use FacturaScripts\Core\Model\Base\ModelClass;              // abstract
use FacturaScripts\Core\Model\Base\ModelTrait;              // trait
use FacturaScripts\Core\Lib\ExtendedController\ListController;  // abstract
use FacturaScripts\Core\Lib\ExtendedController\EditController;  // abstract
use FacturaScripts\Core\Tools;                              // utilidad interna del core
use FacturaScripts\Core\Base\DataBase;                      // utilidad interna del core
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;         // utilidad interna del core

// ❌ INCORRECTO — nunca importar modelos/controladores concretos desde Core
use FacturaScripts\Core\Model\Cliente;         // se pierden las extensiones de plugins
use FacturaScripts\Core\Model\FacturaCliente;  // idem

Read the full file on GitHub · 377 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 377 lines · 109 tokens per session scan A 012e636355dd

Subscribe to this mod's changes

php-expert is an agent published in the GitHub repository FacturaScripts/fs-claude-plugin (8 stars, last pushed 2mo ago), licensed MIT. It adds 109 tokens to every session and 3,371 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens