loom-php

loom-php is a skill for Claude Code, Codex from cosmix/loom. It costs 15 tokens per session (6,154 once invoked), scanned A, original, MIT.

PHP language guidance for PHP 8.x applications, including Composer, strict typing, modern language features, Laravel, Symfony, and PHPUnit or Pest tests. Composer manages PHP libraries and creates the project's autoloader.

In plain words
What is it for?
Use it to manage packages, install production dependencies, run tests, validate project configuration, regenerate the autoloader, and audit vulnerabilities.
Why use it?
It helps avoid loose comparisons, type coercion, reference-related loop bugs, state leaks in long-running workers, repeated database queries, and unsafe deserialization.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is yield 'traversal' => ['../etc/passwd'];.

Good fit Use it to manage packages, install production dependencies, run tests, validate project configuration, regenerate the autoloader, and audit vulnerabilities.

Compare 6 skills from other repositories ↓
View source ↗ cosmix/loom
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/cosmix/loom
agentmods
npx agentmods add skills/cosmix/loom/loom-php

Made for: Claude Code, Codex.

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 loom-php

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-php/github.svg)](https://agentmods.dev/skills/cosmix/loom/loom-php)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-php"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-php/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 loom-php

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmix/loom/loom-php"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-php.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,154 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.00015 $0.06154
Opus 5.5 $0.00006 $0.02462
Sonnet 5.5 $0.00003 $0.01231
Haiku 4.5 $0.00002 $0.00615

Measured 21d ago against content hash a6b6c140d5e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

loom-php 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 21d 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.

skills/loom-php/SKILL.md · 453 lines

How it starts

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

PHP Language Expertise

Overview

Idiomatic, production-grade PHP 8.x: Composer, strict types, enums and readonly, the Laravel and Symfony essentials, and PHPUnit/Pest. Assumes competence; the value is in what is easy to get wrong (coercive typing, loose comparison, the by-reference foreach trap, state leaking in long-running workers, N+1 queries, unsafe unserialize) and in writing tests that loom's phpunit and pest adapters can select one at a time.

Tooling

Composer manages dependencies and generates the autoloader.

Task Command
Add a dependency composer require guzzlehttp/guzzle (updates composer.json and composer.lock)
Add a dev dependency composer require --dev phpunit/phpunit
Install from the lock composer install (CI: --no-interaction --prefer-dist)
Production install composer install --no-dev --classmap-authoritative
Update one package composer update vendor/package --with-dependencies
Regenerate the autoloader composer dump-autoload (after editing autoload)
Check the manifest composer validate --strict
Known vulnerabilities composer audit
  • Commit composer.lock for applications. Add and remove packages with composer require/composer remove; the autoload, config and scripts sections are edited by hand.
  • config.platform.php pins the PHP version used for resolution, so a newer local PHP cannot lock packages the server cannot run.
  • PSR-4: one class per file, namespace prefix mapped to a directory; a class whose path does not match its namespace fails to autoload only when first used.
{
    "require": { "php": "^8.3" },
    "autoload": { "psr-4": { "App\\": "src/" } },
    "autoload-dev": { "psr-4": { "Tests\\": "tests/" } },
    "config": { "platform": { "php": "8.3.0" }, "sort-packages": true },
    "scripts": { "test": "phpunit", "analyse": "phpstan analyse" }
}

Format: PHP-CS-Fixer (vendor/bin/php-cs-fixer fix), Laravel Pint (vendor/bin/pint, PHP-CS-Fixer with Laravel presets), or PHP_CodeSniffer (phpcs/phpcbf) with PSR-12 / PER Coding Style.

Read the full file on GitHub · 453 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. 21d ago First seen · 453 lines · 15 tokens per session scan A a6b6c140d5e4

Subscribe to this mod's changes

loom-php is a skill published in the GitHub repository cosmix/loom (62 stars, last pushed yesterday), licensed MIT. It adds 15 tokens to every session and 6,154 once invoked, about $0.0001 per session on Opus 5.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-26.

Related

Other skills, from other repositories

idiomatic-go

Apply Go community idioms for API and package design, error and concurrency patterns, naming (initialisms, stutter, receivers), generics vs interfaces, and Go code review — including PR or diff review, questions about "the Go way", pointer vs value receivers, channels vs mutexes, and building Go language tooling…

TypeFox/agent-skills · 137 tokens

go-documentation

Write idiomatic Go doc comments that render correctly on pkg.go.dev — package comments, doc.go, exported-symbol comments, testable Example functions, deprecation notices — and publish or debug modules on pkg.go.dev (pkgsite, the module proxy). Use when writing or reviewing Go documentation, or when a developer used to…

TypeFox/agent-skills · 98 tokens

drupaltools-optimize

Optimize selected Drupal PHP code for the Drupal and PHP versions currently in use in the project. Use this skill whenever the user selects code and asks to optimize, modernize, refactor, or improve it for their current environment — e.g. "optimize this for my Drupal version", "update this code to use modern PHP"…

drupaltools/skills · 100 tokens

drupaltools-phpstan

Run PHPStan static analysis in a Drupal project and resolve the reported errors. Use this skill whenever the user asks to run phpstan, run static analysis, fix type errors, or says "run phpstan and fix the errors".

drupaltools/skills · 53 tokens

pw-expert

Use when working with Laravel Prompts/Symfony Console command patterns, or when determining the correct, context-safe way to access ProcessWire API variables like $page, $pages, or $user.

trk/processwire-boost · 44 tokens

pw-module-development

Use when building, structuring, or refactoring native backend modules for ProcessWire using PHP 8.4 and strict typing.

trk/processwire-boost · 30 tokens