scaffold-module
Skill0 starsChanged 4 months agoMITView on GitHub
Use when adding a new self-contained module under src/ — "scaffold a module", "new module for X", "add a src/ folder for Y". Creates the types + implementation + colocated test trio following the repo's existing worked examples.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- theyashgupta/dispatchtheir own version, first seen Nov 2, 2026
- abgmgp/simple-agentic-project-templatetheir own version, first seen Oct 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- theyashgupta/dispatch★ 3same name
- abgmgp/simple-agentic-project-template★ 0same 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 repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- commitSkill
- improve-skillSkill
- pr-descriptionSkill
- safe-rolloutSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 26
Check the target: If src/<name>/ already exists, stop and ask — don't merge into it blindly.
- Distinctive: line 36
Create a module without a test — the test is the guardrail, not an afterthought.
- Distinctive: line 37
Add a dependency to scaffold a module.
≈ “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
Scaffold Module
Overview
A module here is a folder under src/ with a single clear purpose, a typed surface, and a
colocated test. This skill scaffolds that trio consistently so a new module matches the two
existing worked examples (src/feature-flags/,
src/http/) instead of inventing its own shape. Starting points for
the three files live in templates/ — adapt them, don't copy blindly.
Input
- A module name (kebab-case folder, camelCase export) and a one-line purpose.
- Whether it's sync/pure (like
feature-flags) or async/has an I/O boundary (likehttp) — this decides the test approach.
Workflow
- Refuse generic names.
utils,helpers,common,miscname a junk drawer, not a responsibility. Ask for a name that says what the module does. - Check the target. If
src/<name>/already exists, stop and ask — don't merge into it blindly. - Create the trio:
src/<name>/types.ts— the public types (options, results, typed errors). Make illegal states unrepresentable.src/<name>/<name>.ts— the implementation. Pure where possible; inject I/O (e.g. an injectedfetch) so it's testable without globals.src/<name>/<name>.test.ts— Vitest. For sync/pure: assert inputs -> outputs directly. For async/I-O: inject a fake and usevi.useFakeTimers()instead of real waiting.
- No barrel file. Callers import from the direct path; don't add an
index.tsre-export. - Prove it green:
pnpm lint && pnpm typecheck && pnpm testbefore calling it done.
Do not
- Create a module without a test — the test is the guardrail, not an afterthought.
- Add a dependency to scaffold a module; the toolchain stays minimal.
- Reach for a class when a function and plain data will do (KISS).
Lessons
Failures this skill has absorbed (see the improve-skill skill for how entries get here;
full stories in docs/CASE_STUDY.md):
- 2026-06-19 — Fake-timer test left a rejection unhandled:
await advanceTimersByTimeAsync()ran before a handler was attached to the promise under test → attach the handler first, then race both withPromise.all([...]). - 2026-06-19 —
toMatchObject()silently skippedError.cause(non-enumerable), so the test passed without checking what it claimed → assertcauseand other non-enumerable properties directly. - 2026-06-19 — Node-context tooling scripts (
.husky/,.claude/workflows/) trippedno-undefunder the app's ESLint config → harness scripts stay scoped out of the app lint config; don't "fix" them by weakeningsrc/rules.
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.

