make-voter
Skill4 starsChanged 2 months agoMITView on GitHub
Use when access to an object depends on who is asking — ownership, state, or role combined with data.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cli-conventionsSkill
- componentsSkill
- configurationSkill
- discoverSkill
- make-ciSkill
- make-commandSkill
- make-controllerSkill
- make-crudSkill
- make-decoratorSkill
- make-entitySkill
- make-formSkill
- make-listenerSkill
- make-migrationSkill
- make-registration-formSkill
- make-reset-passwordSkill
- make-security-customSkill
- make-security-form-loginSkill
- make-testSkill
- make-twig-extensionSkill
- make-userSkill
- make-webhookSkill
- servicesSkill
- templatesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Call it through the framework:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security voter
symfony console make:voter PostVoterThe maker takes the class name as an argument and asks nothing further. Install it first if
it is missing: symfony composer require --dev symfony/maker-bundle.
When a voter is the right answer
A role answers "who is this user". A voter answers "may this user do this to that object".
Ownership, workflow state, or a rule combining a role with data belongs in a voter — not in
an if inside a controller, where it cannot be reused and cannot be tested on its own.
What to keep
The generated class implements supports() and voteOnAttribute(). Declare the supported
attributes as class constants (PostVoter::EDIT) so callers cannot typo a string.
Call it through the framework:
#[IsGranted(PostVoter::EDIT, subject: 'post')]or $this->denyAccessUnlessGranted(PostVoter::EDIT, $post) when the decision happens mid-action.
A voter is an ordinary service — inject what it needs through the constructor, and unit-test it directly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

