cjmellor/approval/approval-development
Claude Code and agent skill by cjmellor/approval
- community
Checking that the SKILL.md file is still in the repository.
Build and work with cjmellor/approval features, including approval workflows, custom states, time-based expirations, rollbacks, and event handling.
Install
npx vskill@latest install cjmellor/approval/approval-developmentSKILL.md
When to use this skill
Use this skill when working with model approval workflows, intercepting create/update operations for review, managing approval states, setting up time-based expirations, or handling approval events using cjmellor/approval.
Core Concepts
- Models use `MustBeApproved` trait — Intercepts
creatingandupdatingevents, storing dirty data in theapprovalstable instead of persisting directly. - Approvals have states —
Pending,Approved,Rejected(viaApprovalStatusenum), plus custom states defined in config. - Approve to persist — Data only reaches the model's table when explicitly approved.
- Bypass with `withoutApproval()` — Skip the approval workflow for admin actions, seeders, etc.
- Expiration support — Approvals can auto-reject, auto-postpone, or trigger custom logic after a deadline.
Setup
Add the MustBeApproved trait to any model that needs approval:
Approving, Rejecting, and Postponing
Custom Approval States
Define custom states in config/approval.php:
Time-Based Expirations
Process expired approvals via the scheduler:
Rollbacks
Requestor / Creator Tracking
Foreign Keys
Events
All events extend ApprovalEvent with Approval $approval and ?Authenticatable $user:
| Event | When | |
|---|---|---|
ApprovalCreated | Approval request created | |
ModelApproved | Approval state set to approved | |
ModelRejected | Approval state set to rejected | |
ModelSetPending | Approval state set to pending (postponed) | |
ModelRolledBack | Approved change rolled back | |
ApprovalExpired | Expired approval processed by scheduler |
Factory Support
Use the MustBeApprovedFactory trait in model factories to bypass approval in tests:
Bypassing Approval
How Data Flows
When a model with MustBeApproved is created or updated:
- The trait intercepts the
creating/updatingEloquent event - Dirty attributes are captured as
new_data, original values asoriginal_data - If
$approvalAttributesis defined, only those attributes go through approval — the rest persist immediately - The foreign key (default
user_id) is extracted and stored separately in theforeign_keycolumn - An
Approvalrecord is created withstate = pending - The original model operation is cancelled (returns
falsefrom the event) - When approved,
new_datais applied to the model viaforceFill()+withoutApproval()->save()
The new_data and original_data columns are cast to AsArrayObject, so you can access them as arrays:
Common Patterns
Building an Approval Dashboard
Approval Controller
Duplicate Detection
The package prevents duplicate pending approvals for the same model with identical data. If a user submits the same change twice, only one approval record is created.
JSON / Array Cast Attributes
Models with json or array casts work correctly. The approval system decodes JSON values when storing new_data and re-casts them when approving. Nested arrays and complex data structures are preserved.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingresources/boost/skills/approval-development/SKILL.md
Popularity
- Repository stars
- 370
- Repository forks
- 23
- 7-day trend score
- 30
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/cjmellor/approval/approval-development)