diff --git a/core/AGENTS.md b/core/AGENTS.md index 3cd213c..fd3468a 100644 --- a/core/AGENTS.md +++ b/core/AGENTS.md @@ -24,4 +24,4 @@ Read these files on demand: - **Coding conventions** (`~/.claude/core/instructions/coding.md`) — when writing, editing, or reviewing code - **Git conventions** (`~/.claude/core/instructions/git.md`) — when doing git operations - **Testing conventions** (`~/.claude/core/instructions/testing.md`) — when writing or running tests -- **Workflows / agents / prompts** (`~/.claude/core/`) — read from here when invoked +- **Git Commit conventions** (`~/.claude/core/commits.md`) — when commiting changes diff --git a/core/instructions/commits.md b/core/instructions/commits.md new file mode 100644 index 0000000..0669413 --- /dev/null +++ b/core/instructions/commits.md @@ -0,0 +1,79 @@ +```markdown +# (): +# Required. +# +# Purpose: +# - Quickly communicates the intent when scanning `git log`. +# - Follow Conventional Commits for consistency and tooling. +# - Describe the intended outcome, not the implementation. +# +# Examples: +# feat(auth): support OAuth device flow +# fix(cache): prevent stale session reuse +# refactor(api): simplify request validation + +## Why + + +## Implementation Notes + + +## Impact + + +--- +# References (Git Trailers) +# Structured metadata for traceability and tooling. +# Use only the trailers that apply. + +Fixes: +Refs: +ADR: +RFC: +Design: +Co-authored-by: +Reviewed-by: +Signed-off-by: +BREAKING CHANGE: +``` diff --git a/core/instructions/git.md b/core/instructions/git.md index a162a70..4087d4f 100644 --- a/core/instructions/git.md +++ b/core/instructions/git.md @@ -1,10 +1,13 @@ # Git conventions - Never skip hooks with `--no-verify`. Hooks are the automated QA gate; bypassing them breaks the pipeline. -- Never force-push main or master. -- Commit messages explain why, not what. Written for both humans and changelog generators. +- Never force-push `main` or `master`. +- Keep commits atomic. Each commit should represent one logical, independently reviewable and reversible change. +- Ensure every commit leaves the repository in a working state (buildable/testable where practical). +- Commit messages explain **why**, not **what**. The diff already documents what changed. - Never commit secrets, credentials, or environment-specific config. -- Use conventional commits: `feat:`, `fix:`, `docs:`, `chore:`, `refactor:`, `test:` +- Use Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, `refactor:`, `test:`, etc.). +- Reference related issues, ADRs or design documents using Git trailers when applicable. ## Submodules