external-dependency-simulation
Skill2 starsChanged 22 days agoMITView on GitHub
Design and verify local synthetic stubs for external HTTP, SDK or messaging calls, covering contract, state, failure and recovery. For isolated development and testing; does not prove end-to-end compatibility with real cloud or external services.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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 14
Use the dependency matrix to list the real contract, stub capability, independent expectation, unsimulated items and evidence.
- Distinctive: line 15
Read Stub selection and use a narrow transport fake, protocol stub or isolated service as needed.
- Distinctive: line 16
Read Contract and state to define strict request matching, response semantics, state changes, repeated requests and reset.
- Distinctive: line 17
Read Failure injection to cover success/empty set, rejection, malformed data, pagination, rate limiting, timeout, disconnect and recovery …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
External dependency simulation
Make the stub realistic enough on the defined call surface while being able to state its differences. First obtain the public protocol version, the operations the caller actually uses, the authentication and error contracts, synthetic data rules, clock/random sources and the allowed execution environment. Without the protocol you can list differences and assumptions pending proof, but do not reverse-engineer the current implementation into the correct contract.
Routing and steps
- Use the dependency matrix to list the real contract, stub capability, independent expectation, unsimulated items and evidence. Cover only this task's call surface; do not rebuild a complete cloud platform.
- Read Stub selection and use a narrow transport fake, protocol stub or isolated service as needed. Choose the smallest tool that reaches the failure layer under test; avoid always-containers or always-in-memory mocks.
- Read Contract and state to define strict request matching, response semantics, state changes, repeated requests and reset. Unknown requests must fail visibly and never go out.
- Read Failure injection to cover success/empty set, rejection, malformed data, pagination, rate limiting, timeout, disconnect and recovery as the caller actually handles them. Mark separately whether a server-side side effect has happened; do not treat every failure as retryable.
- Cross-check the stub with the caller's or SDK's contract tests. Expectations are obtained independently from the public contract/approved requirements; do not just make the stub return data the implementation under test likes. Execution logs record only synthetic allowed fields; pin the seed, virtual clock, node and scenario identity.
- Deliver the configuration/fixtures, run and reset method, actual results, differences and unverified external boundaries. After interruption keep state and in-flight identities, confirm the old execution has stopped before resuming, and never silently reset globally.
The HTTP declaration example is a neutral contract fixture, not a format any specific tool can import directly. When implementing the adapter, verify the semantics of every field; do not claim the stub has run just because the JSON parses.
Quality and boundaries
Normal requests should observe output and call count; negative cases should observe that nothing was called or an explicit rejection. Resetting two nodes independently must not delete each other's data; malformed JSON, missing required fields and unknown requests must actually trigger failure. Internal pure functions need not all be mocked; keep the necessary real serialisation/transport boundaries.
A passing simulation supports only the synthetic paths tested. List differences such as real load, vendor authentication policies, real webhook delivery and actual traffic switching separately; they cannot sign off on production verification. Never record samples from real business traffic; when replay is needed, record only local synthetic traffic and still verify its format/timing against the independent contract.
Resource guidance: organising known fixtures uses low/low, stub implementation uses normal/medium, protocol/concurrency/partial-success semantics use normal/high. Grade words map to actual execution configuration through the project resource mapping; concurrency is provided by the current project configuration. Prefer the minimal call surface and a bounded failure matrix; when over budget, close out with uncovered items listed rather than cutting costs by deleting failure cases.
Wrap-up cleanup: stub service processes or containers started this run, occupied ports and generated recording files are reclaimed after verification ends. Follow the local resource cleanup rule of task-implementation: register identity on creation, reclaim only objects registered this run at wrap-up, write evidence to keep and failed cleanup items into the receipt, and use no global cleanup commands.
Sources
- Pinned sources: EC09 docker-patterns, EC11 api-connector-builder.
- EC09 provides the isolated environment reference; EC11 provides the narrow call surface and transport layering. Stub selection, the state machine, independent contracts, unknown-request rejection and the difference table are own-authored for this package. Nothing is attributed to unread appendix pages. Dropped the real API examples and uniform coverage requirements.
- License: shipped with the package as LICENSE-EC.txt (EC, MIT); library-wide third-party summary in the root THIRD_PARTY_NOTICES.md. Copy the license file along when copying this package alone.
In this repository39 other files it gives its agents.
- ai-trace-auditSkill
- ai-workspace-governanceSkill
- archive-maintenanceSkill
- change-reviewSkill
- cloud-api-integrationSkill
- coding-conventionsSkill
- container-image-managementSkill
- context-handoffSkill
- deployment-patternsSkill
- docker-local-environmentSkill
- documentation-authoringSkill
- estimationSkill
- gitlab-webhook-local-gitSkill
- go-patternsSkill
- go-testingSkill
- grpc-proto-contractSkill
- guided-evidence-collectionSkill
- http-api-designSkill
- jenkins-pipeline-jjbSkill
- ldap-rbacSkill
- mysql-migration-safetySkill
- plan-designSkill
- plan-reviewSkill
- playwright-e2eSkill
- project-contextSkill
- pytest-patternsSkill
- readonly-ops-diagnosticsSkill
- redis-patternsSkill
- release-readinessSkill
- role-bootstrapSkill
- security-reviewSkill
- skill-maintenanceSkill
- subtask-dispatchSkill
- systematic-diagnosisSkill
- task-implementationSkill
- test-strategySkill
- verification-gateSkill
- vue3-developmentSkill
- vue-testingSkill
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.

