codeflash-agent/.claude/rules/commits.md
Kevin Turcios 33faedf427
Add Unstructured report, rewrite statusline, format evals/scripts (#20)
* Add Unstructured engagement report as uv workspace member

Three-tier Plotly Dash app (Executive Brief, Engineering Team, Full
Detail) with data in JSON, theme constants in theme.py, and Dash
production improvements (Google Fonts, clientside callbacks, meta tags).

Also: add .playwright-mcp/ to .gitignore, add reports/* ruff overrides,
remove tracked .codeflash/observability/read-tracker.

* Rewrite statusline to derive context from git state

Detects active area from changed files (reports, packages, plugin,
.codeflash, case-studies, evals), falls back to branch name convention
(perf/*, feat/*, fix/*), shows dirty indicator. Uses whoami for
cross-platform user detection.

* Add pre-push lint rule to commit guidelines

* Exclude .codeflash/ from ruff linting

Benchmark and profiling scripts in .codeflash/ are scratch work, not
package source. Excluding them prevents CI failures from ad-hoc scripts.

* Run ruff format across packages, scripts, evals, and plugin refs

* Fix github-app async test failures in CI

Add asyncio_mode = "auto" to root pytest config so async tests
are detected when running from the repo root via uv run pytest packages/.
2026-04-15 03:06:16 -05:00

1.7 KiB
Raw Permalink Blame History

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_source with its tests, __init__ export, and example update
  • Too large: implementing all of context extraction (stages 4a4e) 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

Pre-push

  • Run prek run --all-files before pushing to catch lint/format issues CI would flag
  • This catches pre-existing issues in files you didn't touch — CI lints the whole repo, not just your diff

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 branch and clean up any that are already merged
  • Use /clean_gone to prune local branches whose remote tracking branch has been deleted