Agent Skills
› relaticle/relaticle
› pennant-development
pennant-development
GitHub处理 Laravel Pennant 功能标志的开发技能,涵盖定义、检查、作用域设置、Blade 指令使用及测试。
Trigger Scenarios
查询提及 Pennant
涉及 Laravel 项目中的功能标志或开关
Install
npx skills add relaticle/relaticle --skill pennant-development -g -y
SKILL.md
Frontmatter
{
"name": "pennant-development",
"license": "MIT",
"metadata": {
"author": "laravel"
},
"description": "Use when working with Laravel Pennant the official Laravel feature flag package. Trigger whenever the query mentions Pennant by name or involves feature flags or feature toggles in a Laravel project. Tasks include defining feature flags checking whether features are active creating class based features in `app\/Features` using Blade `@feature` directives scoping flags to users or teams building custom Pennant storage drivers protecting routes with feature flags testing feature flags with Pest or PHPUnit and implementing A B testing or gradual rollouts with feature flags. Do not trigger for generic Laravel configuration authorization policies authentication or non Pennant feature management systems."
}
Pennant Features
Documentation
Use search-docs for detailed Pennant patterns and documentation.
Basic Usage
Defining Features
use Laravel\Pennant\Feature;
Feature::define('new-dashboard', function (User $user) {
return $user->isAdmin();
});
Checking Features
if (Feature::active('new-dashboard')) {
// Feature is active
}
// With scope
if (Feature::for($user)->active('new-dashboard')) {
// Feature is active for this user
}
Blade Directive
@feature('new-dashboard')
<x-new-dashboard />
@else
<x-old-dashboard />
@endfeature
Activating / Deactivating
Feature::activate('new-dashboard');
Feature::for($user)->activate('new-dashboard');
Verification
- Check feature flag is defined
- Test with different scopes/users
Common Pitfalls
- Forgetting to scope features for specific users/entities
- Not following existing naming conventions
Version History
- 1f433f8 Current 2026-08-20 14:43


