Agent skill

Spatie Guidelines

by freekmurze in freekmurze/dotfiles

Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions.

MITAuto-check passedBackend & APIs

Install Spatie Guidelines

skills CLI
$ npx skills add freekmurze/dotfiles --skill spatie-guidelines -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install freekmurze/dotfiles spatie-guidelines --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/freekmurze/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/config/claude/skills/spatie-guidelines .claude/skills/spatie-guidelines && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spatie-guidelines
GitHub stars
1k
Token cost
~2.7k tokens
SKILL.md length
1,012 words
Files
7 (incl. references)
Skills in repo
52
Repo updated
First seen
Licence
MIT

At a glance

Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions.

  • Vue code for Spatie projects
  • SKILL.md covers PHP Style, Laravel Conventions, Common Mistakes to Avoid and Detailed references
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Include follow Spatie guidelines

What it does

Spatie Guidelines is an agent skill from freekmurze/dotfiles. Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions. Use when writing or reviewing PHP, Laravel, JavaScript, or Vue code for Spatie projects or packages. Covers code style, type declarations, docblocks, control flow, naming, routing, controllers, Blade, validation, comments, testing (Pest), package structure, service providers, and Git workflow. Triggers include "follow Spatie guidelines", "Spatie style", "Spatie package", or any code review for Spatie packages and projects.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/javascript.md`, `references/laravel-php.md` and `references/new-project-setup.md`).

It sits in Backend & APIs, covering Backend development and Git workflow. It works with Laravel, PHP, Vue.js and JavaScript. The licence is MIT.

When your agent uses it

  • Vue code for Spatie projects
  • Include follow Spatie guidelines
  • Any code review for Spatie packages and projects

Example prompts

  • “follow Spatie guidelines”
  • “Spatie style”
  • “Spatie package”
  • “/spatie-guidelines”

What it can do on your machine

Read from SKILL.md and the folder at commit 8874280. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are php).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spatie Guidelines loads about 2.7k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 130 tokens; SKILL.md has 1,012 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~130
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from freekmurze/dotfiles at commit 8874280, republished under its MIT licence (© freekmurze). 1,012 words, ~2,685 tokens.

Download SKILL.mdSave it as .claude/skills/spatie-guidelines/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
spatie-guidelines
description
Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions. Use when writing or reviewing PHP, Laravel, JavaScript, or Vue code for Spatie projects or packages. Covers code style, type declarations, docblocks, control flow, naming, routing, controllers, Blade, validation, comments, testing (Pest), package structure, service providers, and Git workflow. Triggers include "follow Spatie guidelines", "Spatie style", "Spatie package", or any code review for Spatie packages and projects.
license
MIT
metadata.author
Spatie
metadata.tags
php, laravel, javascript, best practices, coding standards

Spatie Guidelines

Apply these guidelines when writing code for Spatie projects or contributing to Spatie packages.

Core principle: write things the way Laravel intended. If Laravel has a documented way to do something, use it. Deviate only with a clear justification.


PHP Style

Type System
  • Type properties, parameters, and return types. Skip docblocks for fully typed methods.
  • Use ?Type (short nullable), not Type|null.
  • Always use the void return type when a method returns nothing.
  • Use constructor property promotion when all properties can be promoted. One per line, trailing comma:
php
class MyClass {
    public function __construct(
        protected string $firstArgument,
        protected string $secondArgument,
    ) {}
}
Docblocks
  • Skip docblocks for fully type-hinted methods unless you need a description.
  • Use full sentences with a period for descriptions.
  • Always import classnames, then reference the short name in the docblock. Never write a fully qualified name inside a docblock:
php
use Spatie\Url\Url;

/** @return Url */
  • Use one-line docblocks when possible: /** @var string */
  • Always add types for iterables, specifying both key and value:
php
/**
 * @param array<int, MyObject> $myArray
 * @param int $typedArgument
 */
function someFunction(array $myArray, int $typedArgument) {}
  • Put the most common type first in a multi-type docblock:
php
/** @var Collection|SomeWeirdVendor\Collection */
  • Use array shape notation for fixed keys, with each key on its own line:
php
/** @return array{
    first: SomeClass,
    second: SomeClass
} */
  • If one parameter needs a docblock, add docblocks for all the other parameters too.
Code Style
  • Follow PSR-1, PSR-2, and PSR-12.
  • Use camelCase for non-public-facing strings.
  • Don't use final by default.
  • Prefer string interpolation over concatenation: "Hi, I am {$name}."
  • Enum values use PascalCase: case Diamonds;
  • Each trait on its own line with its own use:
php
class MyClass
{
    use TraitA;
    use TraitB;
}
  • Always import namespaces with use statements. Never use inline fully qualified class names such as \Exception or \Illuminate\Support\Facades\Http.
  • Never use single-letter variable names. Write $exception instead of $e, $request instead of $r.
Avoid private const

Don't introduce private const. Replace each one:

  • Used once: inline it. When a raw literal would obscure the meaning the name carried, assign it to a descriptively named local variable instead.
  • Used more than once: turn it into a private property. Use private static when the methods using it are static.
  • Referenced from a default parameter value or a PHP attribute, where no property can be used: inline the literal there.
Control Flow
  • Happy path last. Handle failure conditions first and return early.
  • Avoid else. Refactor to early returns or ternaries.
  • Separate compound ifs. Prefer nested if statements over && chains.
  • Always use curly brackets, even for a single statement.
  • Ternary operators: keep each part on its own line unless the expression is very short.
  • Add blank lines between statements so the code can breathe. The exception is a sequence of equivalent single-line operations.
  • No extra empty lines between {} brackets.
php
// Happy path last
if (! $user) {
    return null;
}

if (! $user->isActive()) {
    return null;
}

// Process active user...

// Short ternary
$name = $isFoo ? 'foo' : 'bar';

// Multi-line ternary
$result = $object instanceof Model ?
    $object->name :
    'A default value';

// Ternary instead of else
$condition
    ? $this->doSomething()
    : $this->doSomethingElse();

// Bad: compound condition with &&
if ($user->isActive() && $user->hasPermission('edit')) {
    $user->edit();
}

// Good: nested ifs
if ($user->isActive()) {
    if ($user->hasPermission('edit')) {
        $user->edit();
    }
}
Comments

Be very critical about adding comments. They often become outdated and mislead over time. Code should be self-documenting through descriptive variable and function names. Adding a comment should never be the first tactic for making code readable.

Instead of this:

php
// Get the failed checks for this site
$checks = $site->checks()->where('status', 'failed')->get();

Do this:

php
$failedChecks = $site->checks()->where('status', 'failed')->get();
  • Don't add comments that describe what the code does. Make the code describe itself.
  • Short, readable code doesn't need comments explaining it.
  • Use descriptive variable names instead of generic names plus a comment.
  • Only add a comment to explain why something non-obvious is done, never what is being done.
  • Refactor explanatory comments into descriptively named methods.
  • Never add comments to tests. Test names should be descriptive enough.

Laravel Conventions

Configuration
  • Config filenames: kebab-case (media-library.php, pdf-generator.php)
  • Config keys: snake_case ('chrome_path' => env('CHROME_PATH'))
  • Never use env() outside config files. Use the config() helper.
  • Service-specific config goes in config/services.php, not a new file.
Routing
  • URLs: kebab-case (/open-source, /front-end-developer)
  • Route names: camelCase (->name('openSource'))
  • Route parameters: camelCase ({newsItem}, {userId})
  • HTTP verb first: Route::get('open-source', [OpenSourceController::class, 'index'])
  • Use tuple notation [Controller::class, 'method'], not the string 'Controller@method'
  • Don't prefix URLs with /, except the root /
API Routing
  • Plural resource names: /errors, /error-occurrences
  • Kebab-case resources
  • Limit deep nesting. Prefer /error-occurrences/1 over /projects/1/errors/1/error-occurrences/1
  • Nest only when the context is necessary: /errors/1/occurrences
Show full SKILL.md (400 more words)Show less
Controllers
  • Plural resource name plus a Controller suffix: PostsController
  • Stick to the CRUD keywords: index, create, store, show, edit, update, destroy
  • Extract new controllers for non-CRUD actions (for example FavoritePostsController with store and destroy)
  • Use invokable controllers for single actions: PerformCleanupController
Views & Blade
  • View files: camelCase (openSource.blade.php)
  • Indent with 4 spaces.
  • No spaces after directives: @if($condition)
  • Use __() for translations, not @lang
Validation
  • Always use array notation: ['required', 'email'], never the pipe form 'required|email'. Array notation is easier to combine with custom rule classes.
php
public function rules() {
    return [
        'email' => ['required', 'email'],
    ];
}
  • Custom rules use snake_case:
php
Validator::extend('organisation_type', function ($attribute, $value) {
    return OrganisationType::isValid($value);
});
Authorization
  • Policies use camelCase: Gate::define('editPost', ...)
  • Use CRUD words, but replace show with view
Migrations
  • Only write up methods in migrations. Don't write down methods.
Artisan Commands
  • Command names: kebab-case (delete-old-records)
  • Always output feedback. At minimum, a $this->comment('All ok!') at the end.
  • For batch processing, output progress per item and a summary at the end.
  • Put the output before processing the item, which makes debugging a failure easier:
php
$items->each(function(Item $item) {
    $this->info("Processing item id `{$item->id}`...");
    $this->processItem($item);
});

$this->comment("Processed {$items->count()} items.");
Naming Classes
TypeConventionExample
ControllerPlural + ControllerPostsController
Invokable ControllerAction + ControllerPerformCleanupController
ModelSingularPost
JobAction descriptionCreateUser, SendEmailNotification
EventTense indicates timingUserRegistering / UserRegistered
ListenerAction + ListenerSendInvitationMailListener
CommandAction + CommandPublishScheduledPostsCommand
MailableEvent/action + MailAccountActivatedMail
ResourcePlural + ResourceUsersResource
EnumDescriptive, no prefixOrderStatus, BookingType

Common Mistakes to Avoid

  • Using env() outside config files
  • Using pipe notation for validation rules ('required|email')
  • Using $fillable instead of $guarded = [] in package models
  • Adding spaces after Blade directives (@if ($condition))
  • Putting extra empty lines inside {} brackets
  • Using final on classes (Spatie doesn't by default)
  • Docblocks on fully type-hinted methods without descriptions
  • Fully qualified class names inside docblocks instead of an imported short name
  • Inline fully qualified class names in code instead of a use statement
  • Single-letter variable names such as $e
  • String controller references ('Controller@method') instead of tuple notation
  • Using else where early returns work
  • Deep API route nesting when a flat route suffices
  • Creating new config files for service credentials (use services.php)
  • Forgetting the void return type on methods that return nothing
  • Writing down methods in migrations
  • Introducing a private const instead of inlining it or using a private property

Detailed references

Load these as needed:

  • Package architecture: references/package-architecture.md. Structure, service providers, contracts, model and config patterns.
  • Testing with Pest: references/testing-pest.md. Testbench setup, test style, what to test, helpers, composer stack.
  • Git workflow: references/version-control.md. Branch naming, PR workflow, commit conventions.
  • Laravel and PHP style, in depth: references/laravel-php.md.
  • JavaScript style: references/javascript.md.
  • New project setup: references/new-project-setup.md.

© freekmurze, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in config/claude/skills/spatie-guidelines of freekmurze/dotfiles.

  • SKILL.md
  • references/javascript.md
  • references/laravel-php.md
  • references/new-project-setup.md
  • references/package-architecture.md
  • references/testing-pest.md
  • references/version-control.md

Open the folder on GitHubat commit 8874280

Compare with similar skills

Spatie Guidelines next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spatie Guidelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spatie Guidelines this skillfreekmurze/dotfiles1k—~2.7kAutomated safety check: PassMIT
Livewire Developmentcoollabsio/coolify63k—~964Automated safety check: PassMIT
Livewire Developmentyungifez/skuul4091 repos~1.9kAutomated safety check: PassMIT
Configure Nightwatchtrypostit/trypost692—~2.7kAutomated safety check: PassMIT
Passport Developmenttrypostit/trypost692—~1.9kAutomated safety check: PassMIT
Spa Auth Developmentgdarko/laravel-vue-starter145—~668Automated safety check: NotesMIT

Similar skills

  • Livewire Development

    coollabsio/coolify

    A skill your agent uses for any task or question involving Livewire.

    63k GitHub stars~964 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Livewire Development

    yungifez/skuul

    A skill your agent uses for any task or question involving Livewire.

    409 GitHub starsUsed in 1 repo~1.9k tokens
    Backend & APIsAuto-check passed
  • Configure Nightwatch

    trypostit/trypost

    Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies.

    692 GitHub stars~2.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Passport Development

    trypostit/trypost

    Develops OAuth2 API authentication with Laravel Passport. An agent skill from trypostit/trypost.

    692 GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Spa Auth Development

    gdarko/laravel-vue-starter

    Activate when working on SPA authentication flow, Sanctum cookie-based auth, Vue Router guards, auth store, login/register/password reset pages, or CORS/session configuration.

    145 GitHub stars~668 tokensUpdated 6 mo ago
    Backend & APIsAuto-check: notes
  • Laravel

    ericrisco/rsc-harness

    A skill your agent uses when building or extending a Laravel 11/12 app — Eloquent models, migrations and relationships, routing with controllers and Form Requests, queues and background jobs…

    180 GitHub stars~3.5k tokensUpdated yesterday
    Backend & APIsAuto-check: notes

More from freekmurze/dotfiles

All 52 skills in this repo
  • Social Content

    freekmurze/dotfiles

    When the user wants help creating, scheduling, or optimizing social media content for LinkedIn, Twitter/X, Instagram, TikTok, Facebook, or other platforms.

    1k GitHub starsUsed in 23 repos~2.1k tokens
    Auto-check passed
  • Email Sequence

    freekmurze/dotfiles

    When the user wants to create or optimize an email sequence, drip campaign, automated email flow, or lifecycle email program.

    1k GitHub starsUsed in 19 repos~2k tokens
    Auto-check passed
  • Referral Program

    freekmurze/dotfiles

    When the user wants to create, optimize, or analyze a referral program, affiliate program, or word-of-mouth strategy.

    1k GitHub starsUsed in 17 repos~1.8k tokens
    Auto-check passed
  • Onboarding Cro

    freekmurze/dotfiles

    When the user wants to optimize post-signup onboarding, user activation, first-run experience, or time-to-value.

    1k GitHub starsUsed in 16 repos~1.6k tokens
    Auto-check passed
  • Typefully

    freekmurze/dotfiles

    Create, schedule, and manage social media posts via Typefully.

    1k GitHub starsUsed in 1 repo~3.4k tokens
    Auto-check: notes
  • Paywall Upgrade Cro

    freekmurze/dotfiles

    When the user wants to create or optimize in-app paywalls, upgrade screens, upsell modals, or feature gates.

    1k GitHub starsUsed in 15 repos~1.4k tokens
    Auto-check passed

Questions about Spatie Guidelines

What does Spatie Guidelines do?

Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions. Spatie Guidelines is an agent skill from freekmurze/dotfiles. Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions.

When should I use Spatie Guidelines?

Spatie Guidelines fits situations like: vue code for Spatie projects; include follow Spatie guidelines; any code review for Spatie packages and projects.

How do I install Spatie Guidelines in Claude Code?

Run `npx skills add freekmurze/dotfiles --skill spatie-guidelines -a claude-code`. Or copy the skill folder (config/claude/skills/spatie-guidelines in freekmurze/dotfiles) into .claude/skills/spatie-guidelines in your project. Claude Code loads it when a task matches its description.

How do I install Spatie Guidelines in Codex?

Run `npx skills add freekmurze/dotfiles --skill spatie-guidelines -a codex`. Or copy the skill folder (config/claude/skills/spatie-guidelines in freekmurze/dotfiles) into .agents/skills/spatie-guidelines in your project. Codex loads it when a task matches its description.

Can I use Spatie Guidelines in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add freekmurze/dotfiles --skill spatie-guidelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spatie-guidelines, .gemini/skills/spatie-guidelines, .github/skills/spatie-guidelines and .opencode/skills/spatie-guidelines in your project.

What does Spatie Guidelines need to run?

SKILL.md names no scripts, command-line tools or credentials: Spatie Guidelines is instructions for the agent only.

Does Spatie Guidelines access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Spatie Guidelines safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spatie Guidelines use?

Spatie Guidelines is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spatie Guidelines use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.5k tokens, read only when the agent opens those files.

What are the alternatives to Spatie Guidelines?

Skills that share tags, products or a category with Spatie Guidelines: Livewire Development (coollabsio/coolify, 63k stars), Livewire Development (yungifez/skuul, 409 stars), Configure Nightwatch (trypostit/trypost, 692 stars) and Passport Development (trypostit/trypost, 692 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spatie Guidelines?

freekmurze (a GitHub user) maintains it in freekmurze/dotfiles, which has 1,013 GitHub stars. The repository holds 52 skills in this directory. The repository was last updated on October 8, 2026.

Source: freekmurze/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.