standalone-commits
$
npx mdskill add EpicenterHQ/epicenter/standalone-commitsEnsure each commit is self-contained and reviewable independently
- Solves the problem of commits being too broad, incomplete, or hard to revert
- Relies on Git for version control and conventional commit messages
- Evaluates commit boundaries based on dependency and reviewability criteria
- Provides guidance on splitting work and ordering commits for clarity
SKILL.md
.github/skills/standalone-commitsView on GitHub ↗
--- name: standalone-commits description: Make commits reviewable and auditable as self-contained units. Use when planning commits, splitting work into waves, staging changes, reviewing branch history, or deciding whether a commit is too broad, too tiny, incomplete, or hard to revert. metadata: author: epicenter version: '1.0' --- # Standalone Commits A standalone commit is a commit a reviewer can audit on its own, at that point in branch history. It may depend on earlier commits in the same branch, but it should not require future commits to explain, compile, test, or justify it. > **Related Skills**: See `incremental-commits` for ordering multi-commit work into waves. See `git` for conventional commit messages. ## Relationship To Incremental Commits `standalone-commits` is the philosophy and acceptance test. It answers: "Is this commit worth reviewing by itself?" `incremental-commits` is the sequencing workflow. It answers: "What order should the standalone commits happen in?" Use them together: ``` standalone-commits -> defines the review boundary for each commit incremental-commits -> orders those boundaries by dependency git -> writes the final message and PR text ``` Do not replace `incremental-commits` with this skill. Without incremental planning, "standalone" can drift into polished but poorly ordered commits. Without standalone checks, "incremental" can drift into technically ordered commits that are still hard to review. ## The Standard Each commit should answer one sentence: > This commit changes `<thing>` so that `<outcome>` because `<reason>`. If the sentence needs "and also", split the commit. If the reason only becomes true in a later commit, move the work later or combine the dependent pieces. ## Acceptance Checks Before committing, verify the staged diff against these checks: | Check | Question | | --- | --- | | Reviewable | Can a reviewer understand the purpose from this diff and message alone? | | Buildable | Does the repo still typecheck, build, or pass the relevant focused test after this commit? | | Complete | Are all call sites, exports, tests, docs, and fixtures needed for this concern included? | | Focused | Is there exactly one behavioral, structural, or documentation concern? | | Auditable | Can someone inspect the before/after and see the invariant being preserved or changed? | | Revertible | If this commit were reverted, would it remove one coherent change without dragging in unrelated work? | When a commit fails one check, fix the staged set before writing the message. ## What Standalone Means Standalone does mean: - The commit is coherent at its point in history. - The message explains why the diff exists. - New public surface has the minimum implementation, exports, and tests needed to be credible. - Refactors preserve behavior and include verification when risk is non-trivial. - Mechanical changes are separated from semantic changes when mixing them would hide behavior. Standalone does not mean: - Every commit must be useful without earlier commits in the same branch. - Every commit must be tiny. - A large generated or mechanical change must be manually split into noise. - The final branch cannot contain dependency chains. ## Wave Planning When using `incremental-commits`, plan each wave as a standalone commit: ``` Wave 1 claim: Add the type or contract, plus any tests that prove the new shape. Wave 2 claim: Add the implementation that satisfies the contract. Wave 3 claim: Move consumers onto the implementation. Wave 4 claim: Remove old paths once no consumers depend on them. ``` Do not create a "setup" commit that only makes a future commit possible unless it is independently reviewable. A foundation commit is fine when it introduces a real contract, helper, migration, or test fixture with a clear reason. Before coding a wave, write its claim. After staging it, re-read the staged diff and ask whether the claim is still honest. If not, split, combine, or move the work. ## Staging Workflow 1. Inspect the full diff. 2. Write the one-sentence commit claim. 3. Stage only files and hunks that prove that claim. 4. Re-read the staged diff with `git diff --staged`. 5. Run focused verification for that staged state when practical. 6. Commit with a message that names the outcome and explains the reason when needed. Prefer file-level staging when files cleanly map to the commit claim. Use hunk staging when one file contains multiple concerns. ## Split Or Combine Heuristics Split when: - A refactor and behavior change appear together. - A rename or move hides logic changes. - Tests cover a different concern than the implementation. - A dependency bump is mixed with feature work. - Reviewers would need to hold two mental models at once. Combine when: - A type without its only implementation would be dead surface. - A helper without its call site would be speculative. - A test without the fix would intentionally fail in the branch. - A migration without the schema or reader change would break local state. ## Anti-Patterns ### Teaser Commit ``` feat(sync): add workspace sync types ``` Problem: The types are unused, untested, and only make sense after a later implementation commit. Better: Include the smallest implementation or contract test that proves why the types exist. ### Hidden Behavior In Refactor ``` refactor(auth): reorganize session helpers ``` Problem: The diff also changes session expiry behavior. Reviewers may scan it as a move-only change. Better: Commit the move first with no behavior change, then commit the expiry behavior change with tests. ### Cleanup Hitchhiker ``` fix(settings): persist provider selection ``` Problem: The commit also renames unrelated variables and formats nearby files. Better: Keep the fix focused. Put cleanup in a separate commit only if it is worth reviewing. ## Commit Message Shape Use the `git` skill for exact conventional commit formatting. For standalone commits, make the subject name the outcome, not the implementation detail. Good: ``` fix(settings): persist selected provider across reloads ``` Weak: ``` fix(settings): update localStorage call ``` Add a body when the reason, invariant, or review boundary is not obvious from the diff.
More from EpicenterHQ/epicenter
- agent-goalWrite `/goal` prompts for long-running agent work in Codex or Claude Code. Use for slash goal, agent goal, durable objective, autonomous coding run.
- approachability-auditReview code as a new TypeScript developer. Use when code feels indirect, clever, hard to follow, or needs a pass on abstractions, names, first-read clarity.
- arktypeArktype: runtime validation, discriminated unions with .merge()/.or(), spread keys. Use when mentioning arktype, type(), union types, command/event schemas.
- attach-primitiveContract and invariants for `attach*` composition primitives in `packages/workspace` (side-effectful building blocks like attachIndexedDb, attachSqlite, attachBroadcastChannel, attachEncryption, attachTable, openCollaboration), and when to use `create*` (pure construction) instead. Use when writing or reviewing an `attach*` or `create*` function, naming a new workspace primitive, composing inside a workspace builder, or deciding whether a primitive registers listeners at call time.
- authEpicenter auth packages: `@epicenter/auth`, `@epicenter/auth-svelte`, OAuth sessions, identity state, auth-owned fetch/WebSocket, and workspace lifecycle binding. Use when editing Epicenter auth clients, session state, hosted sign-in, or auth/workspace integration.
- autumnAutumn billing in Epicenter: `autumn.config.ts`, `autumn-js` credit checks, `atmn` CLI, plan gates, and metered AI usage. Use when changing billing, pricing, credits, plan access, refunds, or usage events.
- better-auth-best-practicesBetter Auth server/client setup: `auth.ts`, generated schema, DB adapters, sessions, cookies, env vars, and plugins. Use when mentioning Better Auth, betterauth, auth handlers, OAuth, email/password, or session configuration.
- better-auth-security-best-practicesBetter Auth security hardening: rate limits, secrets, CSRF, trusted origins, cookies, sessions, OAuth tokens, and audit logging. Use when reviewing auth security, brute-force protection, token handling, or deployment safety.
- change-proposalPresent proposed code changes visually before implementing. Use when: "show me options", "compare approaches", "what should we do", or when changes need before/after comparison.
- claude-code-consultUse this skill when the user asks to consult Claude, ask Claude Code, get another model's take, run a taste check, find cleaner options, or prepare a Claude prompt. Create a bounded second-opinion prompt or run a read-only Claude Code consult, then verify Claude's claims against local files.