First-Party Plugins

Statamic Plugin

The first-party Statamic plugin adds Statamic 6 source integration and correctness rules to Sheath. It understands Blade tag components, fluent tags, @tags, embedded Antlers, partials, and project-backed resources without executing application tags.

#Requirements

The plugin supports the following versions:

Dependency Supported version
PHP 8.2 or newer
Sheath 1.x
Statamic 6.x

#Installation

Install the package as a development dependency. Laravel discovers its service provider automatically:

composer require --dev fortephp/sheath-statamic

Add statamic after your Core preset in config/sheath.php:

<?php
return [
'preset' => ['recommended', 'statamic'],
];

You can also select the preset for one run:

php artisan sheath:lint --preset=statamic

#Supported Invocation Surfaces

The rules correlate the Statamic forms that can express the same tag call. The same validation applies across these surfaces:

<s:collection from="articles" />
<statamic:collection from="articles" />
{{ Statamic::tag('collection')->from('articles') }}
@tags(['articles' => ['collection' => ['from' => 'articles']]])

Embedded Antlers inside Blade is also recognized:

@antlers
{{ collection from="articles" }}
<h2>{{ title }}</h2>
{{ /collection }}
@endantlers

#Rule Reference

The statamic preset enables its rules at error severity. None offers an automatic fix because the correct replacement depends on project intent.

Search the package rules by name or behavior, or filter them by rule family. Open a rule for its examples, execution boundaries, and related checks.

#Live Statamic Catalogs

The tag catalog comes from the application's live statamic.tags registry. Add-on tags, aliases, wildcard dispatch, and registry rebindings are included without a hardcoded allowlist.

Project-aware rules consult Statamic's repositories, view finder, routes, configured search indexes and OAuth providers, asset containers, dictionaries, and registered add-ons. Changes to those project inputs invalidate the affected cached findings.

The plugin never invokes a tag, renders a view, executes generated PHP, or calls an application callback to determine a result.

#Dynamic Names and Values

For Statamic 6 core tags, the plugin checks required parameters. It does not infer required parameters for add-on tags.

The rules skip dynamic names, values, array maps, and runtime-dependent parameters when their result cannot be resolved. Repeated static parameters follow Statamic's last-write behavior. Exact lowercase string booleans such as 'false' use Statamic's parameter normalization.

Fluent analysis runs only when a literal call is fetched, converted to a string, or iterated. Merely constructing a fluent tag object does not report.

#Embedded Antlers

Sheath excludes @antlers ... @endantlers regions from Blade parsing. Antlers expressions are not mistaken for Blade, and diagnostics retain their original byte offsets and line endings.

The plugin checks each original Antlers body with Statamic's non-executing document parser. The two dedicated Antlers rules report invalid or structurally broken regions without producing follow-on diagnostics from unreliable source.

#Fluent Tag Rules

The fluent rules validate calls only once they reach an execution surface. A missing literal tag is reported here:

{{ Statamic::tag('missing_tag') }}

An unsupported method receives its own diagnostic:

{{ Statamic::tag('collection:definitely_missing_method') }}

Required parameters include direct parameter methods, param(), and static params([...]) maps:

{{ Statamic::tag('vite:asset')->fetch() }}

The rules skip calls with dynamic tag names or parameter values whenever runtime state could change the answer.

#The @tags Rules

Literal strings and fully static definition arrays are checked for unknown tags, unsupported methods, and missing required parameters:

@tags([
'posts' => 'collection:articles',
'topics' => ['taxonomy:count' => ['from' => 'topics']],
])

An array value uses its first key as the tag name and its first value as the parameter map. Dynamic names, dynamic keys, unpacked maps, and values that cannot be resolved safely are skipped.

#Debug Tags

statamic-no-debug-tags reports executable dump, dd, and ddd calls across component, fluent, @tags, and embedded Antlers surfaces:

<s:dump />
<s:dump:user />
<s:dd />
{{ Statamic::tag('ddd') }}
@tags('dump:user')
@antlers
{{ title | ddd }}
@endantlers

The rule consults the live Statamic tag and modifier registries. If an application deliberately replaces one of those handles with another implementation, the replacement is not reported.

#See Also