/sota-skills:sota-phpfrom SOTA Engineering Skills
Provides state-of-the-art PHP engineering for building new code or auditing existing code. Covers strict_types, modern idioms, OWASP-grade security, Composer supply chain, static analysis, and runtime performance.
Ships in SOTA Engineering Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill encodes the 2026 state of the art for PHP: a supported-version baseline
(PHP 8.3+ floor; verify the supported branches at php.net/supported-versions.php, see
rules/01), strict_types everywhere, typed object-oriented design, security-by-default at
every trust boundary, a locked and audited Composer supply chain, and measured runtime
performance. It serves two modes:
The detailed rules live in rules/*.md. Read SKILL.md fully; load rules files on demand
per the index table below.
When creating or modifying PHP code:
composer.json (require.php, config.platform),
composer.lock, the framework in use, PHPStan/Psalm config, and CS ruleset. Match the
project's PHP floor — no enums on a project that still supports 8.0. For a new
project, scaffold per rules/05: PHP ≥ 8.3 floor, committed lockfile, PHPStan at max
level (baseline only for legacy), PER-CS formatting, CI gates from day one.declare(strict_types=1) in every file, full parameter/return/
property types, constructor promotion, readonly where state shouldn't mutate, enums
over class constants, match over switch, exceptions over error codes, no @
suppression. (rules/01)unserialize() on
external data, password_hash/sodium/random_bytes for anything secret.
(rules/02–rules/04)DB::raw, |raw, html()) aren't fed user input.rules/05)rules/06)Coverage: every rules/ file's Audit checklist applies in AUDIT mode. Mark one not applicable only with its reason in the report — never skip a file because the thing it checks for is absent, since that absence may be the finding.
When reviewing existing PHP code:
composer audit --locked and a grep sweep for unserialize(, eval(, shell_exec,
string-interpolated SQL, and echo $_.unserialize() of a
value the same app signed with HMAC is not CRITICAL. Note mitigations already present.| Severity | Meaning | Examples |
|---|---|---|
| CRITICAL | Exploitable now, or data loss | SQL built by interpolation from request data, unserialize($_GET…), include of user path, eval on input, uploads executed as PHP |
| HIGH | Exploitable with preconditions, or prod-breaking | XSS via unescaped output, md5() passwords, missing use_strict_mode/fixation, SSRF fetch of user URL, CURLOPT_SSL_VERIFYPEER => false, world-readable secrets |
| MEDIUM | Correctness/maintenance risk | no lockfile committed, no composer audit in CI, loose == on security decisions, rand() for tokens in non-auth context, N+1 on hot path, no static analysis |
| LOW | Deviation from SOTA, friction | missing strict_types, untyped properties, switch where match fits, dev deps in prod image |
| INFO | Worth knowing | newer-PHP features available after floor bump, tooling consolidation |
file:line | rule violated (rules/NN §S) | severity | effort | fix
This is the router's canonical row; each finding carries the sota rules/03
§2 evidence block, and the report follows its §5 order.
Effort: trivial · small · medium · large. Group by severity, CRITICAL first. Borderline severities state the deciding assumption; unconfirmed findings are marked "needs verification", never asserted. End with counts per severity, the sweep commands run, and explicit "checked and clean" areas.
| File | Read this when... |
|---|---|
rules/01-language-baseline.md | choosing/verifying PHP version floor (support/EOL table); writing any PHP: strict_types, typed properties, enums, readonly, match, fibers, 8.4/8.5 features, comparison pitfalls incl. strpos returning false where 0 is a real match, error handling (memory_limit fatals skip every catch; zend.max_allowed_stack_size and the json_decode depth), deprecations |
rules/02-injection.md | code touching SQL, shell, or HTML output: PDO prepared statements, WordPress ($wpdb->prepare, esc_*, nonces with current_user_can, REST permission_callback), command execution, XSS and context-aware escaping, template engines, eval-family bans and dynamic code evaluation (templates compiled from strings, expression engines, why an in-process sandbox is no boundary); request-chosen names (new $class, fetchObject, $_SESSION[$k], mass assignment); LDAP (ldap_escape, the empty-password bind) and XPath (DOMXPath::quote); execution after header('Location') (CWE-698); header and log injection; preg_* patterns used as controls (escape, anchor, ReDoS, check for false) |
rules/03-files-deserialization-ssrf.md | file uploads, include/require paths, stream wrappers (LFI/RFI/phar://), unserialize and Phar object injection, XXE, server-side URL fetching (SSRF); escape hatches into raw memory: FFI and ffi.enable; every PHP spelling of disabled TLS verification; SSH host keys (phpseclib, ext-ssh2) |
rules/04-sessions-auth-web-hardening.md | login/session/auth code: session cookie flags and fixation, password_hash/argon2id, sodium crypto, CSRF, security headers, production php.ini hardening; app cookies via setcookie(); base_convert tokens; secrets in stack traces (#[\SensitiveParameter]) and phpinfo(); debug mode and the dev server (APP_DEBUG, APP_ENV, php -S); the framework application key (APP_KEY, APP_SECRET, decrypt() that unserializes); the web server to FPM handoff (docroot public/, vendor/ outside it, security.limit_extensions, cgi.fix_pathinfo, nginx try_files) |
rules/05-composer-tooling.md | dependencies and CI: composer.lock discipline, composer audit, Composer's resolve-time advisory blocking (policy, --no-blocking), platform reqs, vetting a new dependency and the insecure defaults of libraries you consume (Guzzle timeout, league/commonmark html_input, Parsedown safe mode), PHPStan/Psalm levels and baseline ratcheting, suppressions that fail once stale (@phpstan-ignore <identifier>, reportIgnoresWithoutComments, findUnusedPsalmSuppress), a stale lock that composer install only warns about, Valgrind for C extensions, PER-CS, PHPUnit/Pest, CI gates; raising the PHP floor (live branch state from php.net, Rector withPhpSets() as the conversion gate) |
rules/06-performance-runtime.md | anything slow or deploy-shaped: OPcache and preloading, JIT reality check, PHP-FPM pool sizing, N+1/caching, autoloader optimization, profiling; worker mode (Octane, FrankenPHP, RoadRunner, Swoole): request state that leaks into the next request. Test strategy lives in sota-testing; DB depth in sota-databases. |
rules/01,
8.2 is security-only until 2026-12-31; verify at php.net/supported-versions.php); new code
targets 8.3+. (rules/01)declare(strict_types=1) in every file; full types on every property, parameter,
and return. Untyped is legacy, not a style choice. (rules/01)rules/02)htmlspecialchars(…, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') or the template engine's auto-escaping; raw-output escape
hatches never receive user input. (rules/02)unserialize(), eval(), or include/require data you don't fully
control. External data is JSON. Filter user paths for phar:// and friends.
(rules/03)rules/03)password_hash() (bcrypt default, or argon2id) + password_verify;
secrets via random_bytes/sodium; compare with hash_equals. Never md5/sha1/
rand()/uniqid() for anything secret. (rules/04)use_strict_mode=1, cookies Secure + HttpOnly +
SameSite, session_regenerate_id(true) on privilege change. (rules/04)composer.lock committed; CI runs composer install (never update) and
composer audit --locked; prod installs --no-dev; Composer's advisory blocking stays on
(no --no-blocking, no block: false). (rules/05)rules/05, rules/06)rules/01-language-baseline.md (opens in a new tab)rules/02-injection.md (opens in a new tab)rules/03-files-deserialization-ssrf.md (opens in a new tab)rules/04-sessions-auth-web-hardening.md (opens in a new tab)rules/05-composer-tooling.md (opens in a new tab)rules/06-performance-runtime.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub martinholovsky/sota-skills --plugin sota-skills43 skills in this plugin
/sotaMaster router for the SOTA engineering skills library. Use this skill whenever the user asks to build, design, implement, refactor, harden, optimize, review, or audit an application, service, or codebase and the request spans more than one domain — or when you are unsure which specific sota-* skill applies. Also use when working on a codebase you do not own: reviewing a pull request or diff, responding to code review, evaluating someone else's patch, or preparing an upstream contribution — including mid-session, once you are already reading source, a diff, or CI config. It maps the task (build or audit mode) to the right domain and language skills (Rust, Go, C/C++, JVM, Python, JS/TS, .NET/C#, PHP, Ruby, Swift). Trigger keywords: SOTA, best practices, audit my code, security review, compliance, hardening, prod readiness, code quality, pull request, PR review, review comment, maintainer feedback, patch, diff, upstream, contribute, merge request./sota-api-designState-of-the-art API design and audit guidance (2026) covering REST/HTTP, GraphQL, gRPC, WebSockets/SSE/realtime, webhooks, versioning/evolution, and API security/operations. Use when designing or building any API surface (endpoints, schemas, protos, realtime channels, webhook senders/receivers) AND when auditing/reviewing existing APIs for correctness, evolvability, security, and operational robustness. Not for browser UI, rendering, or client-framework concerns — use sota-web-frameworks or sota-frontend-design. Trigger keywords: API, REST, GraphQL, gRPC, endpoint, websocket, SSE, realtime, WebRTC, webhook, versioning, OpenAPI, pagination, idempotency, rate limit, problem+json, protobuf, deprecation./sota-architectureState-of-the-art software and system architecture rules (2026) for both building and auditing. Use when designing, building, refactoring, or extending system architecture — boundaries, DDD, hexagonal/clean architecture, event-driven design, CQRS, sagas, messaging, caching, sharding, multi-tenancy, resilience, scalability, 12-factor/cloud-native — AND when auditing existing architecture for quality (design review, anti-patterns like distributed monolith or shared database, reliability/scalability assessment). Trigger keywords: architecture, system design, microservices, monolith, serverless, bounded context, DDD, aggregate, hexagonal, clean architecture, event-driven, Kafka, NATS, JetStream, messaging, pub/sub, stream, consumer, queue, saga, outbox, idempotency, CQRS, resilience, circuit breaker, retry, timeout, backpressure, caching, sharding, partitioning, multi-tenant, 12-factor, cloud-native, feature flag, ADR, scalability, anti-pattern, design review, architecture audit./sota-async-concurrencyState-of-the-art rules for writing and auditing asynchronous and concurrent code across runtimes (Python asyncio, JS/Node, Go, Rust, JVM). Use when building anything with async/await, threads, processes, event loops, task groups, channels, or queues — and when auditing existing code for race conditions, deadlocks, leaked tasks, blocked event loops, missing cancellation, or backpressure failures. Not for latency/throughput profiling and optimization — use sota-performance. Trigger keywords: async, await, concurrency, parallelism, threads, race condition, deadlock, event loop, channels, queues, semaphore, mutex, cancellation, timeout, backpressure, task group, goroutine, tokio, asyncio./sota-c-cppState-of-the-art C and C++ engineering rules that Claude applies when writing or auditing C/C++. Covers modern idioms (RAII, value semantics, smart pointers, C++23), memory safety (lifetimes, bounds, sanitizers, hardening flags), undefined behavior, security (SEI CERT C/C++, MISRA, integer/buffer/format-string, injection), concurrency (C/C++ memory model, atomics, data races), build/tooling/CI (CMake, clang-tidy, cppcheck, ASan/UBSan/TSan, vcpkg/Conan, supply chain), and performance. Trigger keywords - C, C++, RAII, smart pointer, unique_ptr, shared_ptr, undefined behavior, UB, buffer overflow, use-after-free, sanitizer, ASan, UBSan, TSan, valgrind, CMake, clang-tidy, cppcheck, MISRA, CERT C, memory safety, std::thread, atomics, std::move. Use for BOTH building C/C++ libraries/systems and reviewing or auditing them. Owns firmware's LANGUAGE layer; does NOT own its SYSTEMS layer — ISRs, DMA coherency, MMIO, RTOS scheduling, priority inversion, WCET, linker scripts — unowned library-wide./sota-cli-uxState-of-the-art CLI and developer-tool UX guidance (2026) covering command and flag design, output and interaction (stdout/stderr, --json, TTY detection, exit codes, prompts), runtime behavior and lifecycle (signals, dry-run, idempotency, XDG paths, completions, telemetry), and distribution (packaging, checksums, docs). Use when designing or building any command line tool, subcommand, TUI, or developer tool — in any framework (argparse, click, typer, clap, cobra, oclif, commander) — AND when auditing an existing CLI for usability, scriptability, and compatibility. Not for shell-script correctness or security — use sota-shell-scripting. Trigger keywords: CLI, command line tool, flags, subcommands, terminal output, TUI, developer tool, argparse, clap, cobra, exit code, shell completion, man page, stdin, stdout.2 plugins ship this exact skill · first indexed Oct 28, 2026
Other plugins' skills for the same job