darkmatter/skills

test-driven-development

Use when the user asks for TDD, test-first, red-green-refactor, or an end-to-end happy-path test of a public contract.

Voir la source
Document Skill original

Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.

Test-Driven Development

A few end-to-end happy-path tests of the public contract beat a pile of unit tests. This skill is opt-in: only when the user asked for TDD or a contract test.

When to use

  • The user asked for TDD, test-first, or red-green-refactor
  • A public contract (HTTP, store API, migration of live rows) is new or changed and nothing covers the happy path

When not to use

  • Ordinary implementation, refactors, helpers, comment or docs edits
  • "Every new function/method"
  • Edges an advisory invented that are not the contract
  • Existing tests already cover the public behavior

Default is no new test. Smoke the changed path. See when-to-write-tests.

What to write

One (or a few) tests that walk the real path: input at the public boundary → through the system → observable result.

Good: seed the old inbound tables, apply the migration, list events, assert facts and metadata survived.

Bad: a test per helper, encoder, or bind-list rewrite.

Prefer real collaborators over mocks. Prefer the route/store/UI path over isolated functions. Supporting notes: tests.md, mocking.md.

Where tests live

Next to the source: foo.test.ts beside foo.ts. Do not create a separate top-level test/ or tests/ directory in a package for these.

Exception: an end-to-end test that spawns the real server or CLI, or spans packages, lives in the repo-root tests/ (for example tests/smoke.test.ts).

Cycle (only when this skill applies)

  1. Name the happy path in one sentence.
  2. Write that one failing E2E test.
  3. Write the thinnest code that makes it pass.
  4. Stop. Do not add unit tests for the internals you just wrote.

Do not delete working code to restart TDD. Do not require a failing test before every production change.

Conflicts

User instructions and when-to-write-tests beat this skill. If both fire, write no unit tests and at most a few E2E happy-path tests.

du même dépôt

Autres Skills

Tous les Skills
darkmatter
Communauté

codebase-cleanup

Multi-pass refactor / code-quality cleanup designed to be dispatched as 8 specialist subagents (one per cleanup concern), each running a research → critical-assessment → high-confidence-implementation cycle. Triggers on "clean up the codebase", "tech-debt pass", "refactor for quality", "find dead code", "remove AI slop", or any explicit request for a comprehensive quality sweep. Do NOT trigger for narrow targeted fixes ("remove this one function") or for net-new feature work.

installations
1
GitHub Stars
0
Mis à jour
18 sept.
darkmatter
Communauté

darkmatter-repo-setup

- Use when setting up a new repo, onboarding an existing repo to darkmatter standards, running a compliance check, or when the user says "set up this repo", "bring repo up to standards", "apply template", or "audit repo". Checks and installs the org TypeScript toolchain (Bun, tsgo, oxlint/oxfmt, Vitest), Nix flake-parts devshell, ops/ surface, CI pipeline, and AGENTS.md conventions.

installations
1
GitHub Stars
0
Mis à jour
18 sept.
darkmatter
Communauté

darkmatter-ts-toolchain

The darkmatter TypeScript toolchain contract: Bun, tsgo, Vitest, oxlint/biome, changesets, Effect I/O, Alchemy deploys, and required checks. Use when writing, fixing, building, or shipping TypeScript in a darkmatter repo. Use codebase-design for module boundaries and effect-typescript for deep Effect patterns.

installations
1
GitHub Stars
0
Mis à jour
18 sept.
darkmatter
Communauté

run-ui-registry-variations

Manual-invocation skill — run only when the user explicitly asks for "run-ui-registry-variations" or invokes it as a slash command. Do not auto-trigger on adjacent topics. Force UI work through shadcnblocks, Aceternity, or https://shadcn.darkmatter.io; validate private registry access before use; build exactly three user-reviewable variations.

installations
1
GitHub Stars
0
Mis à jour
10 sept.