phpstan-phpcs-conflict-resolution

phpstan-phpcs-conflict-resolution is a skill for Claude Code, Codex from trebormc/drupal-ai-agents. It costs 204 tokens per session (1,235 once invoked), scanned A, original, Apache-2.0.

Guidance for resolving cases where Drupal coding-style checks and PHPStan, a PHP error-analysis tool, disagree about the same code. It also explains how to use PHPStan’s targeted ignore comments and settings.

In plain words
What is it for?
Use it for PHPCS-versus-PHPStan conflicts, ineffective PHPStan suppressions, hook documentation issues, and missing type information in Drupal code.
Why use it?
It prevents repeatedly changing code back and forth between two tools and helps keep both checks passing while preserving the real code contract.

Skill for Claude CodeCodex

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 skills/trebormc/drupal-ai-agents/phpstan-phpcs-conflict-resolution
Any agent
npx skills add trebormc/drupal-ai-agents --skill phpstan-phpcs-conflict-resolution
Clone the repo
git clone --depth 1 https://github.com/trebormc/drupal-ai-agents

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 phpstan-phpcs-conflict-resolution

README.md
[![agentmods](https://agentmods.dev/badge/skills/trebormc/drupal-ai-agents/phpstan-phpcs-conflict-resolution.svg)](https://agentmods.dev/skills/trebormc/drupal-ai-agents/phpstan-phpcs-conflict-resolution)
Your own site
<a href="https://agentmods.dev/skills/trebormc/drupal-ai-agents/phpstan-phpcs-conflict-resolution"><img src="https://agentmods.dev/badge/skills/trebormc/drupal-ai-agents/phpstan-phpcs-conflict-resolution.svg" alt="Measured on agentmods" height="20"></a>
Per session 204 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,235 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.00204 $0.01235
Opus 5 $0.00102 $0.00617
Sonnet 5 $0.00041 $0.00247
Haiku 4.5 $0.00020 $0.00123

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

Security

Grade A, and why

phpstan-phpcs-conflict-resolution 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 4d 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.

.claude/skills/phpstan-phpcs-conflict-resolution/SKILL.md · 102 lines

How it starts

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

PHPStan ↔ PHPCS Conflict Resolution

When both tools flag the same line they can demand OPPOSITE changes. Fixing one then re-triggers the other — an infinite alternation. This skill encodes the resolutions that survive BOTH tools at zero, plus the suppression mechanics that make @phpstan-ignore behave. All commands via ssh web.

Golden rule

Determine which tool's complaint reflects a REAL contract (read the code that calls or implements the line). Satisfy that one; suppress the OTHER as narrowly as possible with a comment stating why. Alternate-fixing without this analysis is the failure mode this skill exists to prevent.

Recipe 1 — Hook docblocks: "no @param" vs "type the array"

Coder warns "Hook implementations should not duplicate @param/@return"; PHPStan level 8 raises missingType.iterableValue on the same hooks. {@inheritdoc} does NOT satisfy PHPStan (procedural hooks inherit nothing). Core's approach wins: remove the docs, ignore the rule for hook files in phpstan.neon:

ignoreErrors:
  -
    identifier: missingType.iterableValue
    paths: ['*.module', '*.install', '*.theme']

phpstan-drupal DOES analyze .module/.install/.theme (it extends fileExtensions), so run a targeted analyse to confirm the ignore matches — do not assume they are excluded.

Recipe 2 — Native type hints vs mockability

Narrowing object $x to a concrete class (e.g. \Drupal\Core\Extension\Extension) silences PHPStan method.notFound but throws TypeError in unit tests that inject anonymous-class mocks. Keep the native object; suppress per call line with a targeted // @phpstan-ignore method.notFound. Never let a static-analysis pass change a runtime signature that tests depend on. Run the unit suite after every PHPStan batch.

Recipe 3 — By-reference docblock variance

Two methods sharing a by-ref accumulator MUST declare the identical array type, or the wider one re-widens the variable between iterations and the stricter one errors at the call site. Overriding ConfigFormBase::validateForm() with @param array<string, mixed> $form conflicts with the parent's plain array by-ref contract — array<mixed> satisfies both missingType and variance.

Read the full file on GitHub · 102 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. 4d ago First seen · 102 lines · 204 tokens per session scan A f8bdafb21304

Subscribe to this mod's changes

phpstan-phpcs-conflict-resolution is a skill published in the GitHub repository trebormc/drupal-ai-agents (10 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 204 tokens to every session and 1,235 once invoked, about $0.0010 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 skills, from other repositories

laravel-actions

Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions. Use when implementing reusable action classes (object/controller/job/listener/command), converting service classes/controllers/jobs into actions, orchestrating workflows via faked actions, or debugging action entrypoints and wiring.

coollabsio/coolify · 62 tokens

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

laravel-best-practices

Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization…

laravel/boost · 114 tokens

owl-admin-devtools-generator

Use this skill for Owl Admin development tools, code generator, dynamic API templates, relationships, visual pages, generated CRUD code, app/ApiTemplates, Support/Apis, Support/CodeGenerator, Controllers/DevTools, or questions about “代码生成器”, “动态 API”, “API 模板”, “关系管理”, “可视化页面”, and “生成 CRUD”.

slowlyo/owl-admin · 82 tokens

create-module

Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests. Use this skill whenever the user asks to create, add, or scaffold a new Marko module or package. Concrete triggers: 'create a module named payment', 'scaffold an acme/blog package', 'add a new module…

marko-php/marko · 120 tokens

examples-qa

Verify Instructor behavior through the repository's ./examples/ suite in pass, live record, or hermetic replay mode. Use when running selected examples or the corpus, capturing and reusing recorded LLM HTTP responses, diagnosing hub results, or distinguishing real errors, assertion failures, skipped examples, and…

cognesy/instructor-php · 67 tokens