simulation
Skill14 starsChanged 3 months agoMITView on GitHub
Use this skill when fact-checking cannot provide high confidence about a specific JavaScript, TypeScript, or Node.js behavior. This happens when: - Official documentation is ambiguous or silent on the specific edge case - The js-fact-checking skill returned a verdict of INCONCLUSIVE or LOW confidence - The behavior depends on runtime version, timing, or environment-specific factors - You need to verify interaction between multiple APIs (e.g., "what happens when you removeAllListeners() on a stream and then emit an error?") - You…
- Deletes or force-pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- chipweaver/veripowertheir own version, first seen Sep 20, 2026
- robium-ai/robiumtheir own version, first seen Aug 7, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- robium-ai/robium★ 93same name
- chipweaver/veripower★ 10same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- js-fact-checkingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
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
- Very specific: line 5
Use this skill when fact-checking cannot provide high confidence about a specific JavaScript, TypeScript, or Node.js behavior.
- Distinctive: line 33
Create a temporary directory for the simulation:
- Distinctive: line 40
Use a unique timestamp or random suffix to avoid collisions with parallel runs.
- Distinctive: line 44
Write a single TypeScript or JavaScript file that:
- Distinctive: line 54
Keep it minimal — only the code needed to test the specific behavior
- Very specific: line 56
Use console.log with labeled output for clarity
- Distinctive: line 58
Add comments explaining what should happen if the assumption is correct
- Distinctive: line 137
Remove the temporary simulation directory:
- Very specific: line 181
Question: After calling stream.removeAllListeners(), does adding stream.on("error", () => {}) prevent crashes from subsequent error …
- Very specific: line 214
Question: After a generator returns { done: true }, does calling .next() again throw or return { done: true, value: undefined }?
- Distinctive: line 253
Keep simulations deterministic: Avoid timing-dependent tests unless that's exactly what you're verifying.
- Distinctive: line 255
Never leave simulation files in the repo: Always clean up.
- Distinctive: line 256
One question per simulation: Don't test multiple unrelated behaviors in one script.
≈ “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
Skill: Simulation — Empirical Behavior Verification
When to Use
Use this skill when fact-checking cannot provide high confidence about a specific JavaScript, TypeScript, or Node.js behavior. This happens when:
- Official documentation is ambiguous or silent on the specific edge case
- The
js-fact-checkingskill returned a verdict of INCONCLUSIVE or LOW confidence - The behavior depends on runtime version, timing, or environment-specific factors
- You need to verify interaction between multiple APIs (e.g., "what happens when you
removeAllListeners()on a stream and then emit an error?") - You are making a code change that assumes specific behavior you haven't personally verified in Node.js >= 22
Do NOT use this skill for:
- Behavior that is clearly documented and unambiguous
- Questions about TypeScript type system (types don't need runtime verification)
- Performance benchmarks (out of scope — requires controlled environments)
How to Execute
Step 1: Define the Question
State exactly what you are trying to verify. Be precise:
- Good: "Does
EventEmitter.removeAllListeners('error')prevent the process from crashing when a subsequentemit('error')has no listeners?" - Bad: "How do EventEmitters work?"
Step 2: Create Temporary Simulation Directory
Create a temporary directory for the simulation:
mkdir -p /tmp/dt-simulation-<timestamp>
cd /tmp/dt-simulation-<timestamp>Use a unique timestamp or random suffix to avoid collisions with parallel runs.
Step 3: Write the Minimal Reproduction Script
Write a single TypeScript or JavaScript file that:
- Sets up the exact scenario being tested
- Exercises the specific behavior in question
- Prints structured results (not just "it works")
- Handles both expected outcomes (the behavior works as assumed AND it doesn't)
- Exits with code 0 on expected behavior, 1 on unexpected
Script Guidelines
- Keep it minimal — only the code needed to test the specific behavior
- No external dependencies — use only Node.js built-in modules
- Use
console.logwith labeled output for clarity - Include a control case alongside the test case when feasible
- Add comments explaining what should happen if the assumption is correct
- Target Node.js >= 22 (can use modern syntax)
Script Template
// Simulation: <one-line description of what we're verifying>
// Question: <the specific behavioral question>
// Expected: <what we expect to happen if our assumption is correct>
const { EventEmitter } = require("events");
function main() {
console.log("=== SIMULATION START ===");
console.log("Question: <question>");
console.log("");
// --- Test Case ---
console.log("--- Test Case ---");
try {
// <code that exercises the behavior>
const result = /* ... */;
console.log(`Result: ${result}`);
console.log(`Expected: <expected>`);
console.log(`Match: ${result === expected}`);
} catch (err) {
console.log(`Exception: ${err.message}`);
console.log(`Exception expected: <yes/no>`);
}
// --- Control Case (optional) ---
console.log("");
console.log("--- Control Case ---");
// <known-good baseline for comparison>
console.log("");
console.log("=== SIMULATION END ===");
// Structured verdict
const passed = /* condition */;
console.log(JSON.stringify({
question: "<question>",
verified: passed,
result: "<observed behavior>",
node_version: process.version,
timestamp: new Date().toISOString(),
}));
process.exit(passed ? 0 : 1);
}
main();Step 4: Run the Simulation
cd /tmp/dt-simulation-<timestamp>
# Preferred: plain JavaScript (no external tooling needed)
node simulation.js
# For TypeScript files (requires Node.js >= 22.6.0):
node --experimental-strip-types simulation.tsCapture the full output.
Step 5: Interpret Results
Parse the structured JSON output from the simulation:
verified: true→ The assumed behavior is confirmed empirically. Proceed with confidence.verified: false→ The assumed behavior is wrong. The code change or documentation update must be corrected. Document the actual observed behavior.
Step 6: Clean Up
Remove the temporary simulation directory:
rm -rf /tmp/dt-simulation-<timestamp>Never commit simulation files to the repository. They are ephemeral verification artifacts.
Step 7: Report Results
Include the simulation results in your work output. Format:
## Simulation Verification
**Question:** <what was tested>
**Node.js version:** <version>
**Result:** ✅ VERIFIED / ❌ DISPROVED
**Observed behavior:** <what actually happened>
<details>
<summary>Simulation script</summary>
\`\`\`typescript
<the script>
\`\`\`
</details>
<details>
<summary>Output</summary>
\`\`\`
<full stdout/stderr>
\`\`\`
</details>Examples
Example 1: Verify EventEmitter error guard behavior
Question: After calling stream.removeAllListeners(), does adding
stream.on("error", () => {}) prevent crashes from subsequent error emissions?
Simulation script:
const { EventEmitter } = require("events");
const emitter = new EventEmitter();
// Add and then remove all listeners
emitter.on("error", () => console.log("original handler"));
emitter.removeAllListeners();
// Add no-op error guard
emitter.on("error", () => {});
// Emit error — should NOT crash
try {
emitter.emit("error", new Error("test error"));
console.log("No crash — error guard works");
console.log(JSON.stringify({ verified: true }));
process.exit(0);
} catch (err) {
console.log("Crashed:", err.message);
console.log(JSON.stringify({ verified: false }));
process.exit(1);
}Result: ✅ VERIFIED — The no-op listener prevents the default throw behavior.
Example 2: Verify generator done state behavior
Question: After a generator returns { done: true }, does calling .next() again
throw or return { done: true, value: undefined }?
Simulation script:
function* gen() {
yield 1;
return 2;
}
const g = gen();
console.log("Step 1:", JSON.stringify(g.next())); // { value: 1, done: false }
console.log("Step 2:", JSON.stringify(g.next())); // { value: 2, done: true }
console.log("Step 3:", JSON.stringify(g.next())); // { value: undefined, done: true }
console.log("Step 4:", JSON.stringify(g.next())); // { value: undefined, done: true }
const step3 = g.next();
const verified = step3.done === true && step3.value === undefined;
console.log(JSON.stringify({ question: "generator after done", verified }));
process.exit(verified ? 0 : 1);Result: ✅ VERIFIED — Calling .next() after done returns { done: true, value: undefined }.
No exception thrown.
Integration with Other Skills
- This skill is the fallback for the
js-fact-checkingskill when documentation is insufficient. - The
self-reflectionagent should invoke this skill when addingnode-js-pitfalllessons to copilot-instructions.md and fact-checking is inconclusive. - The
daily-code-reviewagent should invoke this skill when proposing fixes that depend on specific runtime behavior.
Important Notes
- Node.js >= 22 is the target runtime. Always check
process.versionin output. - CommonJS is the current module system. Use
require()in simulations unless testing ESM-specific behavior. - Keep simulations deterministic. Avoid timing-dependent tests unless that's exactly what you're verifying.
- Never leave simulation files in the repo. Always clean up.
- One question per simulation. Don't test multiple unrelated behaviors in one script.
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.

