wendelladriel/laravel-idempotency/idempotency
Claude Code and agent skill by wendelladriel/laravel-idempotency
- community
Checking that the SKILL.md file is still in the repository.
Install, configure, and apply the Laravel Idempotency package in Laravel applications when you need retry-safe POST, PUT, or PATCH endpoints.
Install
npx vskill@latest install wendelladriel/laravel-idempotency/idempotencySKILL.md
Idempotency
Use this skill when a Laravel application needs retry-safe write requests, idempotency keys, or controller attributes.
Primary Goal
- install and configure
wendelladriel/laravel-idempotencycorrectly - choose the smallest correct integration path for the app
- apply middleware, attributes, key inputs, and scopes using the package's public API
Workflow
1. Inspect the Laravel app context
- confirm the app is a Laravel project
- inspect the target routes or controllers that create or update data
- identify whether the endpoint is better served by route middleware or a controller attribute
- inspect the app cache driver before enabling idempotency, since it must support atomic locks and be shared by every application server
2. Install and publish configuration when needed
- install the package with
composer require wendelladriel/laravel-idempotency - publish the config with
php artisan vendor:publish --tag=idempotency-configwhen the app needs non-default behavior - use these config keys when customization is required:
idempotency.ttlidempotency.requiredidempotency.scopeidempotency.headeridempotency.inputidempotency.strict_index_locks
3. Choose the integration style
Prefer route middleware when:
- only a few endpoints need idempotency
- the behavior belongs directly on a route definition
- the app already configures most middleware in the route files
Use the controller attribute when:
- the app groups related write actions inside a controller
- class-level defaults with method-level overrides make the intent clearer
onlyorexcepttargeting is useful
4. Apply route middleware
Use the package middleware class:
When the endpoint needs overrides, use Idempotent::using(...):
The package reads the key from the configured header first. When the header does not contain a non-empty string, it falls back to the configured request input, which defaults to _idempotency_key. Use the request input for standard HTML forms that cannot set custom headers.
Use the @idempotency Blade directive to render the configured hidden input with a generated key:
Pass an existing key with @idempotency($key) when the application generates or stores the key elsewhere.
5. Apply the controller attribute
Use the package attribute on classes or methods:
Use method-level attributes to override class-level defaults:
6. Choose the correct scope
- use
userwhen authenticated users should not collide with each other; guests fall back to IP - use
ipfor guest-heavy flows where IP segmentation is enough - use
globalwhen the same key should replay across users or IPs
7. Support key generation
- generate a random key in app code with
WendellAdriel\Idempotency\Idempotency::key()when the server needs to create keys
8. Verify the integration
- verify repeated
POST,PUT, orPATCHrequests with the same key replay the original response - verify mismatched payloads return
422 - verify in-flight duplicate requests return
409withRetry-After: 1 - verify requests without a valid header or request-input key only pass through when
requiredis disabled
9. Maintain cached entries
Use the maintenance commands when debugging replay behavior, purging entries after a compromised key, or inspecting cache usage during incident response.
- inspect cached entries with
php artisan idempotency:list - filter listings by scope or identity when the cache is large:
- purge entries when replay behavior is the wrong thing to keep:
Rules, References, and Templates
Read before executing:
- no additional resource files for this skill
Examples
- add idempotency to payment or order creation endpoints
- protect retryable webhook receivers
Anti-patterns
- do not apply idempotency to read-only routes
- do not suggest unsupported scope values beyond
user,ip, andglobal - do not document package maintenance tasks here; keep the skill focused on package adoption in Laravel apps
- do not assume every cache driver supports atomic locks without checking
- do not use the
arraydriver outside tests or single-process development
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingresources/boost/skills/idempotency/SKILL.md
Popularity
- Repository stars
- 160
- Repository forks
- 9
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wendelladriel/laravel-idempotency/idempotency)