spec-gap-detector
Skill0 starsChanged 7 months agoMITView on GitHub
Stress-test any agent prompt or specification for ambiguity, missing constraints, and edge cases that would cause random behavior at scale.
In this repository24 other files it gives its agents.
- aarSkill
- agent-cost-modelSkill
- banana-makerSkill
- bitter-lesson-scorecardSkill
- boot-tax-monitorSkill
- compensating-complexity-auditorSkill
- context-fork-guideSkill
- context-hygieneSkill
- counterargument-stress-testSkill
- dark-code-auditSkill
- executive-briefingSkill
- failure-asymmetrySkill
- failure-postmortemSkill
- file-intelSkill
- geopolitical-signal-enricherSkill
- get-api-docsSkill
- gh-reviewSkill
- model-routerSkill
- optimize-descriptionSkill
- prompt-rewriterSkill
- skill-auditSkill
- skill-maintenanceSkill
- token-burn-auditorSkill
- what-am-i-forgettingSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 12
Use when the user says "check this spec", "review this prompt", "stress test this", "is this spec tight enough", "spec review", or provides …
- Distinctive: line 23
If the user points to a file, read it.
≈ “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
Specification Gap Detector
Takes any prompt, spec, or instruction set written for an AI agent and stress-tests it for gaps that would cause unpredictable behavior at scale.
Trigger
Use when the user says "check this spec", "review this prompt", "stress test this", "is this spec tight enough", "spec review", or provides a prompt/instruction set and asks if it's ready for production.
Phase 1: Intake
Accept the specification. This can be:
- A prompt or system prompt for an agent
- A SKILL.md file
- A CLAUDE.md section
- A task description for a mission/scheduled task
- Any structured instruction set
If the user points to a file, read it. If they paste it, use it directly.
Phase 2: Gap Analysis
Analyze the spec across 7 dimensions. For each, identify specific gaps:
1. Ambiguous Edge Cases
- Where could two reasonable interpretations exist?
- What inputs would make the agent guess?
- Flag any "use your judgment" without bounds
2. Missing Success Criteria
- How does the agent know it succeeded?
- Are there measurable outputs defined?
- Is "done" clearly defined?
3. Unclear Hard vs. Soft Constraints
- Which rules are absolute (MUST/NEVER) vs. preferences (SHOULD/prefer)?
- Are there implicit constraints that aren't stated?
- Could the agent reasonably violate an unstated rule?
4. Missing Error Handling
- What should happen when the agent can't complete a step?
- Are fallback behaviors defined?
- Is escalation to human specified for uncertain cases?
5. Context Dependencies
- Does the spec assume context that may not be present?
- Are external dependencies (APIs, files, services) explicitly listed?
- What happens if a dependency is unavailable?
6. Scale Behavior
- Would this produce consistent results across 100 runs?
- Are there non-deterministic paths that should be constrained?
- Could token/context limits cause mid-task degradation?
7. Security & Trust Boundaries
- Can the agent access more than it needs?
- Are destructive operations gated?
- Is there PII/credential exposure risk?
Phase 3: Scoring
Score the spec:
| Dimension | Score (1-5) | Critical Gaps |
| Edge Cases | X | [list] |
| Success Criteria | X | [list] |
| Constraints | X | [list] |
| Error Handling | X | [list] |
| Context Deps | X | [list] |
| Scale Behavior | X | [list] |
| Trust Boundaries | X | [list] |
| Overall | X/5 |
Rating scale: 1 = will break immediately, 2 = breaks at scale, 3 = works but fragile, 4 = production-ready with minor gaps, 5 = bulletproof
Phase 4: Tightening Suggestions
For each gap scored 3 or below, provide a specific rewrite or addition:
GAP: [description]
RISK: [what goes wrong without this]
FIX: [exact text to add/change in the spec]Limit to the top 5 most impactful fixes. Prioritize gaps that would cause the worst outcomes at scale.
Phase 5: Output
Present the full analysis, then offer:
- "Want me to apply the fixes directly?" (if editing a file)
- "Want the tightened spec as a new file?"
- "Want just the fixes as a checklist?"
Source
Extracted from Nate Kadlac newsletter (2026-03-26) -- "The K-Shaped AI Labor Market" -- specification precision as a core AI-native skill.
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.

