golid / rules
Cursor rule40 starsChanged 6 months agoMITView on GitHub
Git commit and branch conventions
- Reads credentials
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository44 other files it gives its agents.
- .cursor/rules/audit-bugs.mdcCursor rule
- .cursor/rules/audit-codebase.mdcCursor rule
- .cursor/rules/ci-workflow.mdcCursor rule
- .cursor/rules/codebase-standards.mdcCursor rule
- .cursor/rules/common-commands.mdcCursor rule
- .cursor/rules/deploy-infra.mdcCursor rule
- .cursor/rules/document-module.mdcCursor rule
- .cursor/rules/dynamic-image-endpoints.mdcCursor rule
- .cursor/rules/dynamic-image-http.mdcCursor rule
- .cursor/rules/external-api.mdcCursor rule
- .cursor/rules/feature-flags.mdcCursor rule
- .cursor/rules/frontend-components-advanced.mdcCursor rule
- .cursor/rules/frontend-components.mdcCursor rule
- .cursor/rules/frontend-forms.mdcCursor rule
- .cursor/rules/frontend-lib.mdcCursor rule
- .cursor/rules/go-handler.mdcCursor rule
- .cursor/rules/go-service-errors.mdcCursor rule
- .cursor/rules/go-service.mdcCursor rule
- .cursor/rules/iteration-surface.mdcCursor rule
- .cursor/rules/job-queue.mdcCursor rule
- .cursor/rules/observability.mdcCursor rule
- .cursor/rules/openapi.mdcCursor rule
- .cursor/rules/parallel-subagents.mdcCursor rule
- .cursor/rules/plan-execution-loop.mdcCursor rule
- .cursor/rules/plan-feature-execution.mdcCursor rule
- .cursor/rules/plan-feature.mdcCursor rule
- .cursor/rules/plan-infra.mdcCursor rule
- .cursor/rules/planning-standards.mdcCursor rule
- .cursor/rules/refactor-large-files.mdcCursor rule
- .cursor/rules/rename-tool.mdcCursor rule
- .cursor/rules/seed-data.mdcCursor rule
- .cursor/rules/slice-and-ship.mdcCursor rule
- .cursor/rules/solidjs-data-fetching.mdcCursor rule
- .cursor/rules/solidjs-pages.mdcCursor rule
- .cursor/rules/solidstart-routing.mdcCursor rule
- .cursor/rules/sql-migrations.mdcCursor rule
- .cursor/rules/sse-realtime.mdcCursor rule
- .cursor/rules/workflow-routing.mdcCursor rule
- .cursor/rules/write-rules.mdcCursor rule
- .cursor/rules/write-tests-e2e.mdcCursor rule
- .cursor/rules/write-tests-frontend.mdcCursor rule
- .cursor/rules/write-tests-frontend-workflow.mdcCursor rule
- .cursor/rules/write-tests.mdcCursor rule
- .cursor/rules/write-tests-planning.mdcCursor rule
The file
We split this git-commits.mdc into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 39
No period at end of first line
- Very specific: line 42
Before committing code that touches module-owned files, run scripts/check_spec_drift.sh <base-ref> and fix any drift in the same commit.
- Very specific: line 43
Use HEREDOC for multi-line: git commit -m "$(cat <<'EOF' ...
- Very specific: line 44
Do NOT commit .env, credentials, or secret files
- Distinctive: line 45
Do NOT amend commits that have been pushed
- Very specific: line 53
If you're writing one, name it explicitly: chore: sweep-up shared-file edits from <batch-name>.
- Distinctive: line 70
When in doubt: smaller. Squashing later is trivial.
- Very specific: line 89
Use the same type prefixes as commits: feat/payment-schedule, fix/token-expiry, chore/upgrade-deps, docs/api-reference.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: Git commit and branch conventions
alwaysApply: true
---
# Git Commits
> **Thesis:** Atomic commits with consistent prefixes make history scannable,
> bisectable, and reviewable. One logical change per commit, imperative mood,
> body explains "why" not "what".
## Commit Message Format
```
type: short description (imperative, lowercase after type)
Optional body explaining the "why" — not the "what".
Keep to 1-3 sentences. Reference specific files or functions
only when it adds clarity.
```
## Types
| Type | When |
|---|---|
| `feat` | New feature or capability |
| `fix` | Bug fix |
| `refactor` | Code restructure with no behavior change |
| `perf` | Performance improvement |
| `docs` | Documentation only |
| `test` | Adding or updating tests |
| `chore` | Deps, config, CI, dead code removal |
| `style` | Formatting, whitespace, CSS-only changes |
## Rules
- First line under 72 characters
- Imperative mood: "add", "fix", "remove" — not "added", "fixes", "removing"
- No period at end of first line
- Body separated from title by blank line
- One logical change per commit — don't bundle unrelated changes
- Before committing code that touches module-owned files, run `scripts/check_spec_drift.sh <base-ref>` and fix any drift in the same commit. If the change legitimately does not affect module behavior, add the required `[skip-spec(<module>): <reason>]` marker to the commit message.
- Use HEREDOC for multi-line: `git commit -m "$(cat <<'EOF' ... EOF)"`
- Do NOT commit `.env`, credentials, or secret files
- Do NOT amend commits that have been pushed
## Parallel Shared-File Exception
The "one logical change" rule has one narrow exception: cross-cutting touches
produced by parallel subagents working on shared files. See `parallel-subagents`
before using this exception.
If you're writing one, name it explicitly:
`chore: sweep-up shared-file edits from <batch-name>`. Full checklist and
examples live in `docs/git-reference.md`.
## Change Sizing
Aim for ~100 lines of diff per logical commit. Reviewable in one sitting, bisects to a single intent. The line count is a guideline, not a hard cap — but if you're past 300 lines the commit is almost certainly bundling.
Heuristics for "this should be N commits":
- The commit body wants sub-headings (`### Backend`, `### Frontend`, `### Tests`).
- The diff touches three or more unrelated subsystems.
- The message uses "and" between non-trivial verbs ("add X **and** refactor Y **and** fix Z").
- A future bisect would want to land on a finer-grained commit ("which of these five things broke autopay?").
Real example of the failure mode: one `chore:` commit bundling five independent bug fixes across unrelated subsystems (match expiry, external API error handling, upload error surfacing, logging, TTL config). Should have been five commits. A body with four sub-sections is the tell.
When in doubt: smaller. Squashing later is trivial; splitting later requires `git rebase -i` and is error-prone.
## Anti-Rationalization
| Excuse | Counter |
|---|---|
| "These changes are related, one commit is fine" | "Related" usually means "I noticed both at the same time", not "they fail/pass as a unit". If they could be reverted independently, they're independent. |
| "Splitting takes too long" | Stage hunks (`git add -p`). 30 seconds per split. The bisect savings on a future bug pay it back instantly. |
| "It's all part of the same card/PR" | Cards group commits for review; they don't dictate commit boundaries. A 5-commit PR is fine. |
| "I'll squash before merge" | Squashing destroys exactly the granularity bisect needs. We don't squash on merge — keep commits atomic from the start. |
| "It's just a chore commit, doesn't matter" | Audit-cleanup chore commits that bundle unrelated fixes bisect-block real bugs the most. Split them. |
| "It's a sweep-up from parallel subagents, the rule allows it" | Only if it's shared-file edits and the body maps each edit to its source feature. If you're sweeping up bug fixes or unrelated chores, the exception doesn't apply — split them. |
## Branch Naming
```
type/short-description
```
Use the same type prefixes as commits: `feat/payment-schedule`, `fix/token-expiry`,
`chore/upgrade-deps`, `docs/api-reference`. Keep descriptions to 2-4 words,
hyphen-separated.
## Examples
See `docs/git-reference.md` for commit examples and detailed edge-case guidance.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

