Interface contract validation
Skill kjuhwa/skills-hub/skills/safety/interface-contract-validation
Define and validate interface contracts for wrapper compatibility before breaking changesFrom its SKILL.md
npx -y skills add kjuhwa/skills-hub --skill interface-contract-validationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.4 KB, 222 tokens by cl100k_base, as published. Nobody here has run it
Declarative interface-contract check
Maintain an INTERFACE_CONTRACT array listing { file, exports: [...], description } for each module that external wrappers depend on. A CI script requires each file and asserts each named export exists and is a function (or matches a typeof check).
Why
Catches accidental export removals or renames that break consumers. Cheaper than a full type system, stronger than trusting commit review.
Mechanism
const CONTRACT = [
{ file: './src/gep/solidify.js',
exports: ['solidify', 'solidifyCandidate'],
description: 'Solidify workflow entry points' },
// ...
];
for (const c of CONTRACT) {
const mod = require(c.file);
for (const fn of c.exports) {
if (typeof mod[fn] !== 'function') fail(`${c.file}: missing ${fn}`);
}
}
When to reuse
Plugin systems, monorepos with external consumers, or any module surface you promise to keep stable.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.