bun-typescript-conventions
Skill9 starsChanged 7 days agoMITView on GitHub
Apply VibeFlow's Bun-driven, Node-targeted TypeScript conventions when adding or refactoring source, tests, protocol values, subprocesses, modules, or build configuration.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Use this skill for code changes in VibeFlow's TypeScript/Bun toolchain.
- Very specific: line 51
Keep ESM explicit: node: built-in imports, .js relative import suffixes, import type for type-only dependencies, and no implicit global …
- Very specific: line 54
Treat untrusted data as unknown.
- Very specific: line 57
Do not use TypeScript enum or const enum.
- Distinctive: line 65
Keep source modules within the 400-line gate by splitting along authority or responsibility boundaries.
- Very specific: line 75
Write descriptive bun:test cases for success, rejection, boundary, cleanup, and platform behavior.
- Very specific: line 78
Keep packageManager and bun.lock authoritative.
- Very specific: line 84
Run these in order before claiming done — this is the exact gate order CI enforces (.github/workflows/ci.yml), and every one of them has …
- Very specific: line 97
When the diff touches UI/components/DTOs: run the focused e2e (bunx playwright test e2e/conversation-home.spec.ts) — contract tests assert …
- Very specific: line 109
Keep the 400-line file gate in mind while editing: it counts split(/\r?\n/).length, so a trailing newline pushes a 399-line file to 400 and …
≈ “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
Bun TypeScript Conventions
Use this skill for code changes in VibeFlow's TypeScript/Bun toolchain. Bun drives
development, build, and tests, while the published CLI is bundled with
--target=node and must remain compatible with the declared Node runtime.
When to use
- adding or restructuring a TypeScript source or test module
- introducing a persisted, API, CLI, UI, configuration, or error vocabulary
- changing process launch, filesystem, platform, async cleanup, or native seams
- changing Bun, TypeScript, Biome, build, lockfile, or test configuration
When not to use
- copy-only or visual-only work with no TypeScript or toolchain effect
- a local one-off literal that has no shared semantic meaning
- dependency research that does not modify this repository
Steps
- Preserve the runtime boundary. Use Bun for scripts, builds, and
bun:test, but keep shipped core code Node-compatible. A Bun-only production API needs an explicit adapter/external boundary and both build and runtime evidence. - Keep ESM explicit:
node:built-in imports,.jsrelative import suffixes,import typefor type-only dependencies, and no implicit global side-effect imports. - Treat untrusted data as
unknown; validate shape, membership, bounds, and state before narrowing. Avoid newany, blind double casts, non-null assertions, and mutable public collections. - Do not use TypeScript
enumorconst enum. For a closed runtime vocabulary, declare one dependency-lightObject.freeze({ ... } as const)authority, derive its union type, and usesatisfies Record<Union, ...>for total projections. Route cross-layer work throughtyped-protocol-contracts. - Centralize semantic values, not every literal. Repeated wire values, limits, field names, exit codes, environment keys, and lifecycle states require a named authority near their domain. Prose and genuinely local one-use values stay local; never create a miscellaneous dumping-ground constants file.
- Keep source modules within the 400-line gate by splitting along authority or responsibility boundaries. A waiver must carry an issue, owner, reason, and expiry; it is not a substitute for design.
- Launch subprocesses with executable-plus-argv and
shell: falseby default. Use the existing launcher/owned-process abstractions for PID, identity, stream drain, cancellation, and orphan cleanup. Make Windows behavior explicit and use injectable native seams for non-Windows tests. - Make async ownership total: deterministic success/failure/cancel cleanup, preserved primary errors, bounded waits/reads, and no orphan handles, timers, listeners, processes, or temporary files.
- Write descriptive
bun:testcases for success, rejection, boundary, cleanup, and platform behavior. Prefer table-driven cases and specific matchers; never weaken a gate or add a retry to hide nondeterminism. - Keep
packageManagerandbun.lockauthoritative. CI installs withbun ci; tool upgrades update declarations, locks, compatibility docs, and focused contract evidence together.
Verification
Run these in order before claiming done — this is the exact gate order CI
enforces (.github/workflows/ci.yml), and every one of them has failed a
real PR when skipped:
bun run fix— Biome auto-format FIRST. CI'slintstep fails on any unformatted file ("Formatter would" error); formatting after the fact changes test preimages and forces a proof-matrix refresh (see step 5).bun run check— the full local gate: typecheck, lint, file-size, waiver, whole-repo tests, and the 100% per-file line coverage gate. This is what CI'scheckjob runs;vf verifydoes NOT substitute for it on this repo.bun run build— UI (vite) plus the node-targeted CLI bundle, and restart any local UI server with the fresh build before testing it.- When the diff touches UI/components/DTOs: run the focused e2e
(
bunx playwright test e2e/conversation-home.spec.ts) — contract tests assert markers that move between components, and e2e encodes exact draft values (e.g. a mention pick now ends with a trailing space: assert"+role@engine ", not"+role@engine"). bun run scripts/refresh-normative-proofs.tsafter ANY test or production change — the normative matrix digests test preimages and goes stale whenever tests change shape (even a Biome-only format of a test file). A stale matrix failsnormative:checkon CI.git diff --check, then before pushing, produce review evidence against the remote merge-base (see.vibeflow/skills/vf/references/pitfalls.md— pre-push hook enforces it; base is the remote tip, not main).- Keep the 400-line file gate in mind while editing: it counts
split(/\r?\n/).length, so a trailing newline pushes a 399-line file to 400 and failsfile-size:check.
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- algorithmic-artSkill
- brand-guidelinesSkill
- brandkitSkill
- industrial-brutalist-uiSkill
- canvas-designSkill
- claude-apiSkill
- claude-opus-4-5-migrationSkill
- coordinatorSkill
- deterministic-async-teardownSkill
- doc-coauthoringSkill
- docxSkill
- durable-authority-crash-replaySkill
- exact-coverage-repairSkill
- frontend-designSkill
- gpt-tasteSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- imagegen-frontend-mobileSkill
- imagegen-frontend-webSkill
- image-to-codeSkill
- internal-commsSkill
- mcp-builderSkill
- merge-when-greenSkill
- minimalist-uiSkill
- full-output-enforcementSkill
- pdfSkill
- playwright-cliSkill
- pptxSkill
- redesign-existing-projectsSkill
- runtime-portable-process-fixturesSkill
- skill-creatorSkill
- slack-gif-creatorSkill
- high-end-visual-designSkill
- stitch-design-tasteSkill
- design-taste-frontendSkill
- design-taste-frontend-v1Skill
- template-skillSkill
- theme-factorySkill
- typed-protocol-contractsSkill
- vfSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- windows-path-authority-leasesSkill
- xlsxSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

