mirror of
https://github.com/codeflash-ai/codeflash-agent.git
synced 2026-05-04 18:25:19 +00:00
1.4 KiB
1.4 KiB
Atomic Commits
Every commit must be a single, self-contained logical change. Tests must pass at each commit.
What "atomic" means
- One purpose per commit: a bug fix, a new function, a refactor — not all three
- If you need to rename something to enable a feature, that's two commits: rename first, feature second
- A commit that adds a function also adds its tests and updates exports — that's one logical change
- Never commit broken intermediate states (syntax errors, failing tests, missing imports)
Commit sizing
- Too small: renaming a variable in one commit, updating its references in another
- Right size: adding
replace_function_sourcewith its tests,__init__export, and example update - Too large: implementing all of context extraction (stages 4a–4e) in one commit
Commit messages
- First line: imperative verb + what changed ("Add get_function_source for Jedi-based resolution")
- Keep the first line under 72 characters
- Use the body for why, not what — the diff shows what changed
- Reference the pipeline stage or roadmap item when relevant
Branch Hygiene
- Delete feature branches locally after merging into main (
git branch -d <branch>) - Don't leave stale branches around — if it's merged or abandoned, remove it
- Before starting new work, check for leftover branches with
git branchand clean up any that are already merged - Use
/clean_goneto prune local branches whose remote tracking branch has been deleted