Git workflow for agents
This document tells how to commit in CepatEdge in a way that matches human maintainer expectations and keeps history useful for bisect, review, and release notes.
Commit message format
Follow Conventional Commits with a scope, consistent with recent history:
text
<type>(<scope>): <short imperative description>Types (common):
| Type | When |
|---|---|
feat | New user-visible behavior or API |
fix | Bug fix |
docs | Documentation only |
chore | Tooling, config, formatting, non-functional refactors |
refactor | Code change that is not a fix or feature |
test | Tests only |
Scopes (examples):
web—apps/webReact SPAworkers—apps/workerHono API on Cloudflare Workersdocs—docs/treerepo— root workspace,.gitignore, pnpm, CI
Subject line rules:
- Use imperative mood: “add”, “fix”, “remove”, not “added” or “adding”.
- ~72 characters or less for the subject when possible.
- No trailing period on the subject.
- Body (optional): explain why if the subject is not obvious; wrap at ~72 cols.
Examples:
text
feat(web): add RTL-aware language row on settings page
fix(workers): route maintenance security logs through internal logger API
docs(ai-agents): add git workflow notes for automated agentsBefore you commit
- Know what changed — Run
git statusand skimgit diff(or scopedgit diff -- path). Untracked files need explicitgit add. - Group by intent — One commit should represent one logical change (e.g. “workers maintenance fix” separate from “web settings RTL”). Avoid mixing unrelated refactors with feature work in the same commit.
- Match project patterns — Inspect recent messages:
git log --oneline -15. Align tone and scope naming with what is already there. - Verify — When the change touches TypeScript, run the relevant
pnpm exec tsc --noEmitor tests if the repo standard expects it.
Using history to understand a change
When preparing a commit (or a follow-up fix):
- Blame / log the file —
git log --oneline -5 -- path/to/fileshows how that area evolved. - See the last good shape —
git show <commit>:path/to/filecan be used to compare intent if the working tree is messy. - Split if needed — If
git diffmixes two features, stage withgit add -por path-specificgit addso each commit tells one story.
What not to do
- Do not commit secrets,
.envfiles, or large generated artifacts unless the repo already tracks them on purpose. - Do not force-push to
mainor shared branches unless project policy says otherwise (default: avoid). - Do not use vague messages like
updateorfix stuff; name the area and behavior.
All-in-one vs split commits
- One commit is fine for a tightly coupled change (e.g. one API + one consumer updated together).
- Multiple commits are better when reviewers would otherwise struggle to see: (a) a bug fix, (b) a separate refactor, (c) documentation.
Agents should default to split commits when git diff spans unrelated directories (e.g. apps/worker and apps/web) unless the team explicitly wants a single squash.