skills/requirements/requirement-enhancer/SKILL.md
Rewrites vague or incomplete requirements into precise, testable statements — filling in quantities, actors, conditions, and error behavior while preserving intent. Use after ambiguity-detector flags problems, when a requirement can't be turned into a test, or when engineers keep asking the same clarification questions.
npx skillsauth add santosomar/general-secure-coding-agent-skills requirement-enhancerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A good requirement is testable: you can write a test, run it, and get a definitive pass/fail. Enhancement is rewriting until that's true.
Input: a vague requirement + the answers to → ambiguity-detector's questions. Output: a testable requirement.
A requirement is testable when it specifies:
| Component | Question it answers | If missing | | ------------- | ----------------------------------------- | ----------------------------------- | | Actor | Who/what does this? | "Input will be validated" — by whom? | | Action | What exactly happens? | "Handle errors" — how? | | Object | On what? | "Validate data" — which data? | | Condition | When does this apply? | Always? Only on POST? | | Criterion | How do we know it worked? | "Respond quickly" — measured how? | | Exception | What if it fails / doesn't apply? | Silent fail? Error? Degrade? |
Every enhanced requirement should answer all six, explicitly or by obvious default.
| Vague input | Enhancement pattern | | ---------------------------------- | ------------------------------------------------------------- | | "should be fast" | "p{N} latency MUST be under {T} ms at {L} RPS" | | "handle errors gracefully" | "On {error type}, {actor} MUST {log + return HTTP {code} + body {schema}}" | | "validate input" | "{Actor} MUST reject requests where {field} does not match {regex/range/enum}, responding {code}" | | "support large files" | "MUST accept files up to {N} MB; files exceeding {N} MB MUST be rejected with {code}" | | "be secure" | Decompose into specific controls — this is 20 requirements, not one | | "eventually consistent" | "Writes MUST be visible to all readers within {T} seconds under {conditions}" | | "retry on failure" | "On {error types}, retry up to {N} times with {backoff strategy}; after {N} failures, {final action}" |
Input (after ambiguity-detector pass, with stakeholder answers in brackets):
The search should return relevant results quickly. [Stakeholder: "quickly" = 95th percentile under 300ms at 100 RPS. "relevant" = by our existing ranking score, top 20, no threshold cutoff.]
Enhancement:
REQ-SEARCH-1 (latency): The
/searchendpoint MUST return a response with p95 latency ≤ 300 ms when serving up to 100 requests per second.REQ-SEARCH-2 (result set): The
/searchendpoint MUST return the top 20 results byranking_score(descending) for the given query. If fewer than 20 documents match, all matching documents MUST be returned.REQ-SEARCH-3 (error handling): If the search index is unavailable, the endpoint MUST return HTTP 503 with body
{"error": "search_unavailable", "retry_after": <seconds>}.
What was added:
"The system MUST authenticate users and authorize access and log all attempts" is three requirements. Split them:
Don't change what the requirement means — only how precisely it's stated. Red flags that you've drifted:
Every number, every choice, every added clause should trace to a stakeholder answer or an explicit documented assumption.
{PLACEHOLDER} and note the open question.## Original
<verbatim>
## Stakeholder inputs
<Q&A — every number and choice in the enhanced version traces to one of these>
## Enhanced
### REQ-<ID>-<N>
<text — MUST/SHOULD/MAY, actor, action, object, condition, criterion>
### REQ-<ID>-<N+1>
...
## Decomposition rationale
<why the original became N requirements>
## Open questions (placeholders remaining)
<anything still {UNFILLED} — blocks finalization>
## Testability check
| Req | Can write a test? | Test sketch |
| --- | ----------------- | ----------- |
development
Extracts human-readable pseudocode from a verified formal artifact (Dafny, Lean, TLA+) while preserving the verified properties as annotations, so the proof-carrying logic can be reimplemented in a production language. Use when porting verified code to an unverified target, when documenting what a formal spec actually does, or when handing a verified algorithm to an implementer.
development
Translates natural-language or pseudocode descriptions of concurrent and distributed systems into TLA+ specifications ready for the TLC model checker. Identifies state variables, actions, type invariants, safety properties, and liveness properties from the description. Use when formalizing a protocol, when the user describes a distributed algorithm to verify, when designing a consensus or locking scheme, or when starting formal verification of a concurrent system.
testing
Reduces a TLA+ model so TLC can actually check it — shrinks constants, adds state constraints, abstracts data, or applies symmetry — when the state space is too large to enumerate. Use when TLC runs out of memory, when checking takes hours, or when a spec works at N=2 and you need confidence at larger scale.
development
TLA+-specific instance of model-guided repair — reads a TLC error trace, identifies the enabling condition that should have been false, strengthens the corresponding action, and maps the fix to source code. Use when TLC reports an invariant violation or deadlock and you have the code-to-TLA+ mapping from extraction.