contract-impact-test-design
Skill0 starsChanged 2 months agoMITView on GitHub
Convert a source-backed patch or requirement impact analysis into contract-level test viewpoints, provenance-aware expected behavior, and spreadsheet-style Check ID matrices. Use when external operations, request/input dimensions, downstream data availability, field/data mapping, validation combinations, and observable results must be tested after a change.
In this repository33 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- adversarial-baseline-auditSkill
- architecture-drift-detectionSkill
- architecture-reconstruction-and-diagramsSkill
- artifact-detailed-designSkill
- baseline-source-of-truth-maintenanceSkill
- claim-verification-and-promotionSkill
- configuration-source-traceSkill
- current-state-tdd-synthesisSkill
- design-artifact-decompositionSkill
- design-artifact-decomposition-verificationSkill
- detailed-design-verificationSkill
- full-reverse-engineeringSkill
- implementation-readiness-certificationSkill
- incident-root-cause-analysisSkill
- integration-selection-analysisSkill
- observability-traceability-analysisSkill
- patch-impact-reviewSkill
- persistence-schema-reverse-engineeringSkill
- post-readiness-adversarial-auditSkill
- regression-test-designSkill
- requirement-compliance-reviewSkill
- resolve-high-impact-unknownsSkill
- resume-reverse-engineeringSkill
- reverse-engineering-bootstrapSkill
- reverse-engineering-coverage-auditSkill
- run-engineering-workflowSkill
- runtime-binding-verificationSkill
- runtime-flow-analysisSkill
- technical-design-proposalSkill
- technical-design-verificationSkill
- wbs-generationSkill
- wbs-verificationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 25 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈25
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Use the strongest available evidence in this order:
- Distinctive: line 45
Do not invent missing contracts or expected results.
- Distinctive: line 50
When an explicit requirement/specification exists, normalize it before deriving tests.
- Very specific: line 60
Do not transfer conditions from one endpoint/operation/surface to another.
- Very specific: line 63
If scope cannot be proven, mark it SCOPE_UNRESOLVED.
- Distinctive: line 64
Use this matrix as the authoritative scope for later test derivation.
- Distinctive: line 86
If no external operation is reachable, classify and prove:
- Distinctive: line 92
Do not stop at class/method names.
- Distinctive: line 132
Do not restrict inventory to newly added fields.
- Distinctive: line 137
When the interface accepts named parameters or structured inputs, keep these classes distinct:
- Distinctive: line 146
Do not conflate them.
- Distinctive: line 148
If the specification defines case sensitivity, unsupported-input behavior, defaults, or ignore rules, preserve those semantics exactly.
- Distinctive: line 151
Do not infer an error oracle merely because an input is unknown or malformed.
- Distinctive: line 167
Create equivalence classes rather than arbitrary examples.
- Distinctive: line 188
call ordering when relevant
- Distinctive: line 199
If the expected oracle cannot be proven, use:
- Distinctive: line 232
Do not require an explicit serializer/output-layer condition when upstream retrieval and mapping already guarantee the required observable …
- Very specific: line 235
If provenance cannot be proven, use EXPECTED_BEHAVIOR_UNRESOLVED.
- Distinctive: line 264
Do not create a viewpoint when source proves it irrelevant.
- Distinctive: line 280
Do not derive expected behavior solely from current implementation.
- Distinctive: line 281
Do not create a serializer-level expectation when the observable condition is enforced earlier in the data flow.
- Distinctive: line 284
If any material link is unproven, mark the case:
- Distinctive: line 292
Do not blindly generate the Cartesian product.
- Distinctive: line 326
Do not combine materially different request variants under one Check ID.
- Very specific: line 349
Use O to mark a condition applicable to a Check ID.
- Distinctive: line 398
When requested by the calling prompt, create a spreadsheet-friendly CSV with one row per Check ID.
- Distinctive: line 425
Every material requirement/impact must map to at least one Check ID or an explicit justified no-test classification.
- Distinctive: line 465
If a completion item cannot pass because evidence is missing, report the blocker rather than guessing.
- Distinctive: line 469
Do NOT produce only:
≈ “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
Contract Impact Test Design — 4.0
Purpose
Turn verified impact surfaces into an executable QA-oriented test design.
This skill exists because:
FUNCTION IMPACT != API CONTRACT IMPACT != TEST DESIGNA list of impacted methods is not a test plan. A list of impacted endpoints is not a test matrix.
The skill must connect:
change / requirement
→ external operation
→ request contract
→ runtime selection
→ integration / state behavior
→ observable result
→ test viewpoint
→ Check IDInputs
Use the strongest available evidence in this order:
- explicit requirement/specification
- current source
- promoted verified reverse-engineering baseline
- source-backed patch impact report
- patch/diff as candidate future behavior
- existing tests as behavioral evidence, not unquestioned truth
Do not invent missing contracts or expected results.
Step 0 — Canonical Requirement / Scope Matrix
When an explicit requirement/specification exists, normalize it before deriving tests.
Create:
| Rule | External Operation / Surface | Applies? | Condition | Expected Observable Behavior |
Rules:
- Evaluate each row independently.
- Do not transfer conditions from one endpoint/operation/surface to another.
- A condition applies only where the requirement explicitly assigns it.
- Preserve explicit exclusions and non-applicable surfaces.
- If scope cannot be proven, mark it
SCOPE_UNRESOLVED. - Use this matrix as the authoritative scope for later test derivation.
This prevents a condition from one operation from leaking into another operation's test oracle.
Step 1 — Impacted External Operation Inventory
For every material impact, identify all externally reachable operations that can observe it.
Possible entry types include:
- REST API
- CLI
- scheduled job
- message/event consumer
- file/config import
- other source-confirmed public interfaces
For REST, record:
| API ID | Method | Exact Path | API Version | Handler | Why Impacted | Evidence |
If no external operation is reachable, classify and prove:
NO_DIRECT_EXTERNAL_INTERFACE_IMPACTDo not stop at class/method names.
Step 2 — Request Contract Inventory
For every impacted REST operation enumerate the request dimensions needed to reach and distinguish affected behavior.
GET / DELETE
Inspect:
- path params
- query params
- headers
- required/optional
- omitted behavior
- empty/null where representable
- defaults
- enum/range/format
- selector rules
- parameter combinations
POST / PUT / PATCH
Inspect all of the above plus:
- content type
- body DTO/model
- body required/optional
- top-level fields
- relevant nested fields
- arrays/collections where relevant
- null/empty/default
- enum/range/format
- cross-field combinations
Create:
| API ID | Input Location | Field/Parameter | Type | Required? | Valid Classes | Invalid/Boundary Classes | Default/Omitted Behavior | Combination Rules | Impact Relevance | Evidence |
Do not restrict inventory to newly added fields. Include existing selectors/fields needed to reach the impacted runtime path.
Step 2A — Input / Parameter Semantics Gate
When the interface accepts named parameters or structured inputs, keep these classes distinct:
- valid supported parameter/input
- unsupported parameter/input name
- wrong-case parameter/input name
- invalid value of a supported parameter/input
- invalid combination of supported parameters/inputs
- omitted / null / empty / default, when applicable
Do not conflate them.
If the specification defines case sensitivity, unsupported-input behavior, defaults, or ignore rules, preserve those semantics exactly.
Do not infer an error oracle merely because an input is unknown or malformed. The expected result must come from requirement/specification or verified source behavior.
Step 3 — Preconditions and Environment Dimensions
Identify source/requirement-backed conditions such as:
- storage/product/model
- upgraded/non-upgraded state
- feature flags
- authentication/authorization role
- existing resource state
- real/virtual classification
- integration availability
- persisted/configured state
Create equivalence classes rather than arbitrary examples.
Step 4 — Observable Behavior Inventory
For every impacted path identify applicable expected observables:
API
- HTTP status
- domain/product error code
- response field/value
- field presence/absence
- null/default behavior
- headers if relevant
Integration / command
- command type
- command parameters
- downstream identifier/serial
- call/no-call
- call ordering when relevant
- response parser/normalization behavior
Data / state
- persisted value
- config output
- cache/map identity
- classification outcome
- created/updated/deleted state
If the expected oracle cannot be proven, use:
EXPECTED_BEHAVIOR_UNRESOLVEDand identify exactly what is missing.
Step 4A — Field / Data Provenance Inventory
For every response/output/state value affected by the change, prove the value lifecycle before using it as a test oracle.
Create:
| Operation | Field/Data | Request/Trigger Condition | Downstream Retrieval | Source Field/Data | Transform/Normalize | Mapping/Storage | Serialization/Output | Final Observable Behavior | Evidence |
Determine independently:
- under what condition the source/downstream data is obtained
- which command/query/call/branch makes it available
- where it is parsed or decoded
- where it is transformed or normalized
- where it is mapped/stored
- what happens when it is absent or not retrieved
- how it is serialized/emitted/consumed
- what externally observable result follows
Important:
- Conditional output behavior may be implemented indirectly by conditional retrieval.
- Do not require an explicit serializer/output-layer condition when upstream retrieval and mapping already guarantee the required observable behavior.
- Current implementation shape is not itself the expected test oracle.
- If provenance cannot be proven, use
EXPECTED_BEHAVIOR_UNRESOLVED.
Step 5 — Derive Test Viewpoints
Derive viewpoints from contract and impact dimensions, not methods.
Applicable viewpoints may include:
- existing-request backward compatibility
- new behavior positive path
- feature/condition absent path
- required parameter/body field omitted
- optional parameter/body field omitted
- null/empty/default
- enum/range/format boundary
- valid selector combinations
- invalid selector combinations
- cross-field combinations
- upgraded/non-upgraded or version/model variants
- legacy/unaffected regression
- correct downstream command/argument
- downstream call must not occur on validation failure
- downstream response normalization
- response field/value/presence
- HTTP status/domain error mapping
- persisted/configured/state effect
- real/virtual or equivalent classification outcome
- integration error handling when source defines it
Do not create a viewpoint when source proves it irrelevant.
Step 5A — Test Oracle Chain
For every Check ID involving changed output/data, the expected result must be traceable as:
requirement / verified expected rule
→ trigger / request condition
→ expected source/downstream data availability
→ expected transform/mapping/state
→ expected serialization/output
→ externally observable resultDo not derive expected behavior solely from current implementation. Do not create a serializer-level expectation when the observable condition is enforced earlier in the data flow.
If any material link is unproven, mark the case:
BLOCKED_MISSING_ORACLE
and name the missing evidence.
Step 6 — Combination Strategy
Do not blindly generate the Cartesian product.
Use, in order:
- explicit requirement combinations
- source validation branches
- equivalence partitioning
- boundary-value analysis
- decision-table combinations
- pairwise/risk-based combinations for independent dimensions
- regression cases for unchanged behavior
HIGH/CRITICAL impacts require direct coverage of each material branch.
Step 7 — Assign Check IDs
Assign stable IDs:
001
002
003
...Each Check ID must represent one coherent scenario with:
- precondition
- operation
- concrete request setup
- expected runtime/integration behavior
- expected API/domain result
- expected response/state
Do not combine materially different request variants under one Check ID.
Step 8 — Spreadsheet-Style Cross Matrix
Generate a cross matrix where columns are Check IDs and rows are conditions/confirmation items.
Required row groups when applicable:
Precondition
API
Method + endpoint
Path parameters
Query parameters
Headers
Body / payload
Command / downstream interaction
Expected results
HTTP status
Domain error
Response fields/stateUse O to mark a condition applicable to a Check ID.
Example shape:
Check conditions / confirmation items | 001 | 002 | 003
Precondition
upgraded storage | O | O |
non-upgraded storage | | | O
API
GET /4.0/items | O | O |
query: detail=true | O | |
query: detail absent | | O |
POST /4.0/items | | | O
body.mode=valid | | | O
Expected results
HTTP 200 | O | O | OThis matrix is mandatory when two or more scenarios exist.
Step 9 — Detailed Test Case Table
Mandatory table:
| Check ID | Level | Precondition | Method | Endpoint / Entry Point | Path Params | Query Params | Headers | Body/Payload | Expected Downstream / Runtime | Expected Data Provenance / State | Expected HTTP Status | Expected Domain Error | Expected Response / State | Regression Purpose | Evidence |
Levels:
UNIT
COMPONENT
API_CONTRACT
INTEGRATION
END_TO_END
REGRESSIONRules:
- API-visible impact cannot be covered only by UNIT tests.
- GET rows must include concrete query/path/header setup when relevant.
- POST/PUT/PATCH rows must include concrete payload setup when relevant.
- Validation cases must specify expected downstream call/no-call where provable.
- Expected values must be evidence-backed.
Step 10 — CSV Export
When requested by the calling prompt, create a spreadsheet-friendly CSV with one row per Check ID.
Minimum columns:
CheckID
Level
Precondition
HttpMethod
Endpoint
PathParams
QueryParams
Headers
BodyPayload
ExpectedRuntimeBehavior
ExpectedDataProvenanceOrState
ExpectedHttpStatus
ExpectedDomainError
ExpectedResponseOrState
RegressionPurpose
EvidenceQuote values correctly when they contain commas/newlines.
Traceability Gate
Every material requirement/impact must map to at least one Check ID or an explicit justified no-test classification.
Create:
| Requirement / Impact | API / Entry Point | Contract Dimension | Check IDs | Coverage Status | Evidence |
Coverage statuses:
COVERED
PARTIALLY_COVERED
NOT_COVERED
NOT_APPLICABLE
BLOCKED_MISSING_ORACLECompletion Gate
The skill MUST NOT complete until all applicable items pass:
[ ] canonical requirement/scope matrix created when an explicit requirement exists
[ ] external operations identified or non-exposure proven
[ ] exact REST method/path captured
[ ] GET path/query/header parameters enumerated
[ ] POST/PUT/PATCH body fields enumerated
[ ] validation, case-sensitivity, unsupported-input, and combination semantics considered
[ ] precondition/environment dimensions considered
[ ] field/data provenance proven for changed output/state or unresolved explicitly
[ ] expected downstream behavior defined or unresolved explicitly
[ ] HTTP/domain/response/state oracle is tied to a requirement + provenance chain or unresolved explicitly
[ ] no condition was transferred from another endpoint/operation without evidence
[ ] Check IDs assigned to concrete scenarios
[ ] cross matrix generated
[ ] detailed testcase table generated
[ ] API-visible impacts have API_CONTRACT-or-higher coverage where feasible
[ ] traceability from impact/requirement to Check IDs existsIf a completion item cannot pass because evidence is missing, report the blocker rather than guessing.
Anti-Patterns
Do NOT produce only:
- changed classes/functions
- impacted methods
- endpoint names without request dimensions
- generic "positive/negative" test bullets
- unit-test method suggestions without API contract cases
- expected behavior inferred from intuitionThe target artifact is a contract-level test design, not a code coverage list.
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.

