necessity-gate
Skill15 starsChanged 6 months agoApache-2.0View on GitHub
Task-justification gate for new tasks, skills, files, audit cycles, or follow-ups. Compares problem evidence, regression risk, and recovery benefit; decides approve, reject, or modify. Blocks speculative work.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-verificationSkill
- agent-security-scanSkill
- boundary-contractSkill
- compact-handoffSkill
- jailbreak-detectorSkill
- merge-companionSkill
- session-intent-analyzerSkill
- skill-evolutionSkill
- task-routerSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
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 9
If this agent was dispatched to perform only a specific subtask, skip this skill.
- Distinctive: line 13
Do not bypass this gate by expert judgment.
- Distinctive: line 40
Run this gate when you are about to:
- Distinctive: line 43
start a new audit or verification cycle
- Distinctive: line 45
add a "follow-up", "open issues", or "improvements" section to a report
- Distinctive: line 47
create a new tool, script, or reference file
- Distinctive: line 58
No silent pass is allowed.
- Distinctive: line 64
Write one concrete sentence for the proposed work.
- Distinctive: line 80
Use one of these harm shapes:
- Distinctive: line 90
Consider whether the work touches a working system, is relied on by other skills or runtime paths, is hard to recover, or creates more …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
<SUBAGENT-STOP>
If this agent was dispatched to perform only a specific subtask, skip this skill.
</SUBAGENT-STOP><EXTREMELY-IMPORTANT>
Do not bypass this gate by expert judgment. If the work "obviously" seems needed, still run the gate. This friction protects novice-day and bad-day agent behavior.Starting a new task without this gate is a rule violation.
</EXTREMELY-IMPORTANT>
necessity-gate
necessity-gate checks whether a new task, file, audit cycle, skill change, or follow-up is justified by real evidence and recovery value. It blocks padding, speculative cleanup, manufactured follow-ups, and scope creep.
Contents
- Triggers
- Escape Hatch
- Procedure
- 1. State The Work
- 2. Classify The Problem
- 3. Assess Harm If Skipped
- 4. Assess Regression Risk
- 5. Decide
- Output Format
- Habitual Failure Patterns
- Relationship To Verification
- What This Gate Does Not Block
- References
Triggers
Run this gate when you are about to:
- define a new task, skill, or file
- start a new audit or verification cycle
- edit frontmatter, body, or
callsfor a production skill - add a "follow-up", "open issues", or "improvements" section to a report
- register new tasks with TodoWrite/update_plan
- create a new tool, script, or reference file
- promote an emergent subtask into real work
Escape Hatch
The gate is considered passed only when a reason is recorded:
user-directed: <quote>for explicit user instructions- reference to a previously approved task and substep
- retry inside an already approved loop, where verification-before-completion absorbs the check
No silent pass is allowed.
Procedure
1. State The Work
Write one concrete sentence for the proposed work. Do not use vague phrasing.
2. Classify The Problem
Choose exactly one:
reproducible: a test fails, a command errors, or the user repeatedly reports the same symptomevidenced: logs, files, schemas, or dependencies show a mismatchspeculative: the reason is "maybe", "cleaner", "could be useful", or expert preference
speculative defaults to reject unless later evaluation is exceptionally strong.
Separate evaluation means from runtime adoption. Benchmarking or A/B comparison can serve an explicitly requested evaluation deliverable, but evaluation usefulness alone does not justify adding runtime features. For runtime adoption or improvement, name the observed runtime behavior gap and the expected correction; assess the harm and regression risk of that correction. Do not substitute a new evaluation tool or product when the authorized objective is to improve current runtime behavior. Genuine user-directed evaluation work and evidenced runtime improvements remain permitted within their authorized scope.
3. Assess Harm If Skipped
Use one of these harm shapes:
- system breakage
- explicit user request unmet
- future work cost accumulation, which is always suspect and is treated together with speculative
"The output would look cleaner" is not harm.
4. Assess Regression Risk
Consider whether the work touches a working system, is relied on by other skills or runtime paths, is hard to recover, or creates more scope expansion. If risk is written as zero, re-evaluate; true zero is rare.
5. Decide
APPROVE: harm is clearly larger than regression riskMODIFY: harm is real but the proposed scope is too broad or too narrowREJECT: harm is speculative, smaller than risk, or the work is padding
Record the decision and reasoning.
Output Format
[necessity-gate] <one-sentence task>
- classification: reproducible | evidenced | speculative
- harm: <one line>
- regression-risk: <one line>
- decision: APPROVE | MODIFY | REJECT
- reason: <one or two sentences>
- escape-hatch: <reason, if used>Habitual Failure Patterns
| Thought | Classification | Default |
| "This is worth checking too" | speculative | reject |
| "It works, but cleanup would be nicer" | speculative cleanup | reject |
| "There are TODOs, so create a cycle" | manufactured cycle | reject (unless the TODO itself is evidence-backed) |
| "Add follow-ups to make the report complete" | padding | reject |
| "Apply the same pattern everywhere" | scope creep | reject |
| "Check everything just in case" | premature audit | reject |
| "Clean up other places at once" | batch creep | reject |
| "Make the docs look richer" | aesthetic padding | reject |
This table is not exhaustive. The threshold is that work without clear evidence or a user directive defaults to reject.
Relationship To Verification
necessity-gate is an initialization-event gate. It runs when work is first defined or when a loop discovers a new subtask. Inside an already approved loop, verification-before-completion handles the "did this step actually work" question.
What This Gate Does Not Block
- explicit user-directed work
- execution of a substep under already approved work
- the next step after verification passes
- improving the quality of an already approved artifact
References
AGENTS.mdtask-router/SKILL.mdcoding-convention/verification-before-completion/SKILL.md
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.

