Best for
- Gradual feature rollouts (percentage-based)
- Per-user or per-tenant feature toggling
- A/B testing with feature variants
event4u-app/agent-config/src/skills/laravel-pennant/SKILL.md
Use when working with feature flags — Laravel Pennant, gradual rollouts, A/B testing, scope-based flags — even when the user just says 'hide this behind a flag' without naming Pennant.
Decision brief
Use when working with feature flags — Laravel Pennant, gradual rollouts, A/B testing, scope-based flags — even when the user just says 'hide this behind a flag' without naming Pennant.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/laravel-pennant"Inspect the Agent Skill "laravel-pennant" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/laravel-pennant/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Install — composer require laravel/pennant, publish config, run migrations. 2. Define feature — Create feature class or use closure-based definition. 3. Check feature — Use Feature::active('feature-name') in code. 4. Verify — Confirm feature is active/inactive for correct sco…
Use this skill when working with feature flags: - Gradual feature rollouts (percentage-based) - Per-user or per-tenant feature toggling - A/B testing with feature variants - Environment-based feature gating
Review the “Installation” section in the pinned source before continuing.
Review the “Defining features” section in the pinned source before continuing.
Review the “Class-based features (recommended)” section in the pinned source before continuing.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill when working with feature flags:
composer require laravel/pennant, publish config, run migrations.Feature::active('feature-name') in code.composer require laravel/pennant
php artisan vendor:publish --provider="Laravel\Pennant\PennantServiceProvider"
php artisan migrate
php artisan pennant:feature NewDashboard
declare(strict_types=1);
namespace App\Features;
use App\Models\User;
use Illuminate\Support\Lottery;
class NewDashboard
{
/** Resolve the feature's initial value. */
public function resolve(User $user): bool
{
// Percentage rollout
return Lottery::odds(1, 10)->choose(); // 10% of users
}
}
// In a service provider
use Laravel\Pennant\Feature;
Feature::define('new-dashboard', function (User $user): bool {
return $user->getCustomer()?->isEarlyAdopter() ?? false;
});
// Rich values (A/B testing)
Feature::define('checkout-button', function (User $user): string {
return Arr::random(['blue', 'green', 'red']);
});
// Boolean check
if (Feature::active('new-dashboard')) {
// Show new dashboard
}
// Via the user model (HasFeatures trait)
if ($user->features()->active('new-dashboard')) {
// ...
}
// Rich value
$color = Feature::value('checkout-button'); // 'blue', 'green', or 'red'
// Blade directive
@feature('new-dashboard')
<x-new-dashboard />
@else
<x-legacy-dashboard />
@endfeature
// Activate for a specific user
Feature::for($user)->activate('new-dashboard');
// Deactivate
Feature::for($user)->deactivate('new-dashboard');
// Activate for everyone
Feature::activateForEveryone('new-dashboard');
// Deactivate for everyone
Feature::deactivateForEveryone('new-dashboard');
// Purge stored values (re-resolve on next check)
Feature::purge('new-dashboard');
Features can be scoped to any model, not just users:
// Per-tenant feature
Feature::for($customer)->active('advanced-reporting');
// Define with tenant scope
Feature::define('advanced-reporting', function (Customer $customer): bool {
return $customer->getPlan() === 'enterprise';
});
| Driver | Storage | Use case |
|---|---|---|
database | DB table | Production — persistent, shared across servers |
array | In-memory | Testing — no persistence |
// config/pennant.php
'default' => env('PENNANT_STORE', 'database'),
// Prevent N+1 when checking features for multiple users
Feature::for($users)->loadAll();
// Load specific features
Feature::for($users)->load(['new-dashboard', 'advanced-reporting']);
array driver in tests — prevents test pollution.php artisan pennant:purge for cleanup.Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
event4u-app/agent-config
Use BEFORE writing/changing tests, adding mocks, or test-only methods on production classes — vs mocking-the-mock, production pollution, partial mocks, and overfit/tautological assertions
event4u-app/agent-config
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
event4u-app/agent-config
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.