laravel:constants-and-configuration

laravel:constants-and-configuration is a skill for Claude Code from jpcaparas/superpowers-laravel. It costs 34 tokens per session (3,751 once invoked), scanned A, original, MIT.

A Laravel coding guide for moving repeated or unexplained values into named constants, configuration files, or PHP enums. Laravel is a PHP framework for building web applications.

In plain words
What is it for?
Use it when replacing scattered hardcoded numbers and strings, defining allowed values, or making application settings configurable.
Why use it?
It makes code easier to understand and change by keeping values such as roles, statuses, and time limits in clearly named places.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the superpowers-laravel plugin — 12 skills, 44 commands, 1 agent, 1 hook shipped together

Good fit Use it when replacing scattered hardcoded numbers and strings, defining allowed values, or making application settings configurable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jpcaparas/superpowers-laravel/constants-and-configuration
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 jpcaparas/superpowers-laravel --skill constants-and-configuration
Clone the repo
git clone --depth 1 https://github.com/jpcaparas/superpowers-laravel

Made for: Claude Code.

Or install superpowers-laravel, the plugin that ships this one along with the rest of its 12 skills, 44 commands, 1 agent, 1 hook.

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 laravel:constants-and-configuration

README.md
[![agentmods](https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/constants-and-configuration/github.svg)](https://agentmods.dev/skills/jpcaparas/superpowers-laravel/constants-and-configuration)
Your own site
<a href="https://agentmods.dev/skills/jpcaparas/superpowers-laravel/constants-and-configuration"><img src="https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/constants-and-configuration/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 laravel:constants-and-configuration

Your own site · 80×15
<a href="https://agentmods.dev/skills/jpcaparas/superpowers-laravel/constants-and-configuration"><img src="https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/constants-and-configuration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,751 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00034 $0.03751
Opus 5 $0.00017 $0.01876
Sonnet 5 $0.00007 $0.00750
Haiku 4.5 $0.00003 $0.00375

Measured 11d ago against content hash 610697b1234a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

laravel:constants-and-configuration 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 11d 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/constants-and-configuration/SKILL.md · 605 lines

How it starts

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

Constants and Configuration Values

Avoid hardcoded values throughout your codebase. Use constants, configuration files, and enums to make your application more maintainable, refactorable, and debuggable.

The Problem with Hardcoded Values

// BAD: Magic numbers and strings scattered everywhere
if ($user->role === 'admin') { // What other roles exist?
    $cacheTime = 3600; // What does 3600 mean?
}

if ($order->status === 1) { // What does 1 represent?
    $discount = 0.15; // Why 15%?
}

Cache::remember('users_list', 600, fn() => ...); // 600 what?

Solution 1: PHP Constants and Enums

Class Constants

// app/Constants/UserRole.php
class UserRole
{
    public const ADMIN = 'admin';
    public const EDITOR = 'editor';
    public const VIEWER = 'viewer';
    public const GUEST = 'guest';

    public const ALL = [
        self::ADMIN,
        self::EDITOR,
        self::VIEWER,
        self::GUEST,
    ];

    public static function hasPermission(string $role, string $action): bool
    {
        return match($role) {
            self::ADMIN => true,
            self::EDITOR => in_array($action, ['read', 'write', 'edit']),
            self::VIEWER => $action === 'read',
            self::GUEST => false,
            default => false,
        };
    }
}

// Usage
if ($user->role === UserRole::ADMIN) {
    // Clear intent
}

PHP 8.1+ Enums

// app/Enums/OrderStatus.php
enum OrderStatus: string
{
    case PENDING = 'pending';
    case PROCESSING = 'processing';
    case SHIPPED = 'shipped';
    case DELIVERED = 'delivered';
    case CANCELLED = 'cancelled';
    case REFUNDED = 'refunded';

    public function label(): string
    {
        return match($this) {
            self::PENDING => 'Pending Payment',
            self::PROCESSING => 'Processing',
            self::SHIPPED => 'Shipped',
            self::DELIVERED => 'Delivered',
            self::CANCELLED => 'Cancelled',
            self::REFUNDED => 'Refunded',
        };
    }

    public function color(): string
    {
        return match($this) {
            self::PENDING => 'yellow',
            self::PROCESSING => 'blue',
            self::SHIPPED => 'indigo',
            self::DELIVERED => 'green',
            self::CANCELLED => 'red',
            self::REFUNDED => 'gray',
        };
    }

    public function canTransitionTo(self $newStatus): bool
    {
        return match($this) {
            self::PENDING => in_array($newStatus, [
                self::PROCESSING,
                self::CANCELLED,
            ]),
            self::PROCESSING => in_array($newStatus, [
                self::SHIPPED,
                self::CANCELLED,
            ]),
            self::SHIPPED => $newStatus === self::DELIVERED,
            self::DELIVERED => $newStatus === self::REFUNDED,
            default => false,
        };
    }
}

// Model with enum casting
class Order extends Model
{
    protected $casts = [
        'status' => OrderStatus::class,
    ];

    public function transitionTo(OrderStatus $newStatus): void
    {
        if (!$this->status->canTransitionTo($newStatus)) {
            throw new InvalidStateTransition(
                "Cannot transition from {$this->status->value} to {$newStatus->value}"
            );
        }

        $this->update(['status' => $newStatus]);
    }
}

// Usage
$order->transitionTo(OrderStatus::PROCESSING);

Read the full file on GitHub · 605 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. 11d ago First seen · 605 lines · 34 tokens per session scan A 610697b1234a

Subscribe to this mod's changes

laravel:constants-and-configuration is a skill published in the GitHub repository jpcaparas/superpowers-laravel (153 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 3,751 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

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-security

Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.

hashgraph-online/awesome-codex-plugins · 34 tokens

integration-fixture

Create or validate a .test integration fixture under tests/php/Integration/Fixtures.

phel-lang/phel-lang · 16 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

llamaindex-development

Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.

Mindrally/skills · 32 tokens

Behat BDD Testing

PHP BDD testing with Behat framework using Gherkin feature files, Mink browser extension, context classes, and Symfony integration for behavior-driven acceptance testing.

PramodDutta/qaskills · 37 tokens