php-modern

php-modern is a skill for Claude Code from OrcaQubits/agentic-commerce-skills-plugins. It costs 52 tokens per session (947 once invoked), scanned A, original, MIT.

A guide to writing modern PHP 8.x code using features such as typed properties, enums, attributes, match expressions, and constructor promotion. PHP is a programming language commonly used for web applications.

In plain words
What is it for?
Use it when writing or updating PHP 8.x applications, including Magento projects, with explicit types, immutable data, concise constructors, and modern control flow.
Why use it?
It helps you use newer language features correctly instead of relying on older, more verbose code styles.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the magento2-commerce plugin — 19 skills, 1 agent shipped together

Good fit Use it when writing or updating PHP 8.x applications, including Magento projects, with explicit types, immutable data, concise constructors, and modern control flow.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/orcaqubits/agentic-commerce-skills-plugins/php-modern
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.

Any agent
npx skills add OrcaQubits/agentic-commerce-skills-plugins --skill php-modern
Clone the repo
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins

Made for: Claude Code.

Or install magento2-commerce, the plugin that ships this one along with the rest of its 19 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for php-modern

README.md
[![agentmods](https://agentmods.dev/badge/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern/github.svg)](https://agentmods.dev/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern)
Your own site
<a href="https://agentmods.dev/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern"><img src="https://agentmods.dev/badge/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for php-modern

Your own site · 80×15
<a href="https://agentmods.dev/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern"><img src="https://agentmods.dev/badge/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 947 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00052 $0.00947
Opus 5 $0.00026 $0.00474
Sonnet 5 $0.00010 $0.00189
Haiku 4.5 $0.00005 $0.00095

Measured 3d ago against content hash 7e64aadbda3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-17, from the pricing page.

Security

Grade A, and why

php-modern 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 3d 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.

magento2-commerce/skills/php-modern/SKILL.md · 145 lines

How it starts

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

Modern PHP 8.x Development

Before writing code

Fetch live docs: Web-search site:php.net manual migration for the latest PHP migration guide and new features. Check https://www.php.net/releases/ for current supported versions.

PHP 8.0 Features

Constructor Property Promotion

Declare and assign properties directly in the constructor signature — eliminates boilerplate. Heavily used in Magento service classes.

Named Arguments

Call functions with parameter names: array_slice(array: $arr, offset: 2). Improves readability for functions with many parameters.

Match Expressions

Type-safe switch replacement that returns a value. No fall-through, strict comparison. Better than switch for value mapping.

Union Types

int|string in parameter and return types. Allows multiple type declarations.

Nullsafe Operator

$obj?->method()?->property — short-circuits to null if any part is null. Replaces nested null checks.

Attributes

Native metadata annotations: #[Route('/path')], #[Override]. Replace docblock annotations with first-class language support.

PHP 8.1 Features

Enums

First-class enumerations — backed (string/int) and unit enums. Perfect for status codes, types, categories. Use backed enums for database/API values.

Readonly Properties

public readonly string $name — can only be set once (usually in constructor). Enforces immutability.

Fibers

Lightweight concurrency primitives — PHP-level coroutines. Foundation for async frameworks. Limited direct usage in Magento.

Intersection Types

TypeA&TypeB — value must satisfy ALL types. Useful for ensuring a parameter implements multiple interfaces.

First-class Callable Syntax

strlen(...) creates a Closure from a function. Cleaner than Closure::fromCallable('strlen').

PHP 8.2 Features

Readonly Classes

readonly class Dto { ... } — all properties are implicitly readonly. Perfect for Data Transfer Objects and value objects.

Deprecated: Dynamic Properties

Read the full file on GitHub · 145 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. 3d ago First seen · 145 lines · 52 tokens per session scan A 7e64aadbda3b

Subscribe to this mod's changes

php-modern is a skill published in the GitHub repository OrcaQubits/agentic-commerce-skills-plugins (39 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 947 once invoked, about $0.0003 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-09-15.

Related

Other skills, from other repositories

archestra-dev-rust-napi

Use when editing Rust in this repo — the NAPI crates under platform/archestra-rs (app-runtime, image, and sandbox core/-rs crate pairs plus napi-loader, with their generated TypeScript bindings) or the standalone ai-labs Rust workspace (core/runner/cli/analyzer/dashboard) — including Rust build/test checks.

archestra-ai/archestra · 76 tokens

lucid-agents

Build, modify, review, debug, or deploy TypeScript services made with the Lucid Agents SDK. Use whenever a project imports @lucid-agents packages or the user asks about Lucid runtimes, entrypoints, adapters, payments, MPP, identity, wallets, A2A tasks, service UI, scaffolding, or deployment.

daydreamsai/lucid-agents · 75 tokens

near-api-js

Guide for developing with near-api-js v7 - the JavaScript/TypeScript library for NEAR blockchain interaction. Use when: (1) building apps that interact with NEAR blockchain, (2) creating/signing transactions, (3) calling smart contracts, (4) managing accounts and keys, (5) working with NEAR RPC API, (6) handling…

internet-court/internet-court-skill · 159 tokens

near-kit

TypeScript library for NEAR Protocol blockchain interaction. Use this skill when writing code that interacts with NEAR Protocol, including viewing contract data, calling contract methods, sending NEAR tokens, building transactions, creating type-safe contract wrappers, integrating wallets (Wallet Selector, HOT…

internet-court/internet-court-skill · 92 tokens

near-smart-contracts

NEAR Protocol smart contract development in Rust. Use when writing, reviewing, or deploying NEAR smart contracts. Covers contract structure, state management, cross-contract calls, testing, security, and optimization patterns. Based on near-sdk v5.x with modern macro syntax.

internet-court/internet-court-skill · 58 tokens

lucid-agents

Build, modify, review, debug, or deploy TypeScript services made with the Lucid Agents SDK. Use whenever a project imports @lucid-agents packages or the user asks about Lucid runtimes, entrypoints, adapters, payments, MPP, identity, wallets, A2A tasks, service UI, scaffolding, or deployment.

daydreamsai/lucid-agents · 75 tokens