Skip to content

Commit 6f43786

Browse files
committed
Add Boost Guidelines & Skills
1 parent 589eb68 commit 6f43786

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Laravel Pennant
2+
3+
- This application uses Laravel Pennant for feature flag management, providing a flexible system for controlling feature availability across different organizations and user types.
4+
- IMPORTANT: Always use `search-docs` tool for version-specific Pennant documentation and updated code examples.
5+
- IMPORTANT: Activate `pennant-development` every time you're working with a Pennant or feature-flag-related task.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: pennant-development
3+
description: "Manages feature flags with Laravel Pennant. Activates when creating, checking, or toggling feature flags; showing or hiding features conditionally; implementing A/B testing; working with @feature directive; or when the user mentions feature flags, feature toggles, Pennant, conditional features, rollouts, or gradually enabling features."
4+
license: MIT
5+
metadata:
6+
author: laravel
7+
---
8+
# Pennant Features
9+
10+
## When to Apply
11+
12+
Activate this skill when:
13+
14+
- Creating or checking feature flags
15+
- Managing feature rollouts
16+
- Implementing A/B testing
17+
18+
## Documentation
19+
20+
Use `search-docs` for detailed Pennant patterns and documentation.
21+
22+
## Basic Usage
23+
24+
### Defining Features
25+
26+
<!-- Defining Features -->
27+
```php
28+
use Laravel\Pennant\Feature;
29+
30+
Feature::define('new-dashboard', function (User $user) {
31+
return $user->isAdmin();
32+
});
33+
```
34+
35+
### Checking Features
36+
37+
<!-- Checking Features -->
38+
```php
39+
if (Feature::active('new-dashboard')) {
40+
// Feature is active
41+
}
42+
43+
// With scope
44+
if (Feature::for($user)->active('new-dashboard')) {
45+
// Feature is active for this user
46+
}
47+
```
48+
49+
### Blade Directive
50+
51+
<!-- Blade Directive -->
52+
```blade
53+
@feature('new-dashboard')
54+
<x-new-dashboard />
55+
@else
56+
<x-old-dashboard />
57+
@endfeature
58+
```
59+
60+
### Activating / Deactivating
61+
62+
<!-- Activating Features -->
63+
```php
64+
Feature::activate('new-dashboard');
65+
Feature::for($user)->activate('new-dashboard');
66+
```
67+
68+
## Verification
69+
70+
1. Check feature flag is defined
71+
2. Test with different scopes/users
72+
73+
## Common Pitfalls
74+
75+
- Forgetting to scope features for specific users/entities
76+
- Not following existing naming conventions

0 commit comments

Comments
 (0)