docs(generic): add commit conventions and autonomous-commit guidance
Document Conventional Commits as the required syntax and spell out when agentic contributors should commit without approval vs. hold off. The concern is commit-history pollution from speculative attempts, not the autonomy itself — a clean commit that ends a thread of work doesn't need an approval prompt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
10
generic.md
10
generic.md
@@ -496,6 +496,13 @@ This is the environment these apps deploy into. Claude Code should assume it.
|
||||
- Each crate has a `README.md` or top-level module doc explaining its role in the workspace.
|
||||
- The repo `README.md` covers: what the project does, how to build, how to run locally, how to deploy. Point readers to this document for architectural conventions.
|
||||
|
||||
### Commits
|
||||
- **Use [Conventional Commits](https://www.conventionalcommits.org/) syntax for every commit.** `type(scope): subject`, with types drawn from the standard set (`feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `build`, `ci`, `perf`, `style`). Scope is the crate, component, or area touched. Subject is imperative and under ~70 characters. A body may follow if the *why* isn't self-evident.
|
||||
- **Agentic contributors may commit without asking**, provided the change is a coherent, complete unit of work — the feature works, the bug is fixed, the refactor is finished. No approval prompt is needed for good commits that end a thread of work.
|
||||
- **Don't declare victory prematurely.** If there's a realistic chance that follow-up commits on the same topic will be needed to finish the job (because the implementation is speculative, the tests haven't been run, or edge cases haven't been considered), stop and think before committing. A stream of sequential commits all fixing up the same incomplete attempt pollutes history and is more annoying than an approval prompt.
|
||||
- **When in doubt, consolidate before committing** rather than landing half-done work and patching it afterwards. One commit that resolves the task cleanly beats five commits that thrash around getting there.
|
||||
- Never `--amend` a pushed commit, never `--no-verify`, and never bypass pre-commit hooks to get a commit in. If a hook fails, fix the underlying issue.
|
||||
|
||||
---
|
||||
|
||||
## 13. Conventions Summary for Claude Code
|
||||
@@ -514,4 +521,5 @@ When scaffolding or extending a project:
|
||||
10. Every listening port gets a named firewalld service per §9. No bare `--add-port` calls.
|
||||
11. SELinux stays enforcing. Work with the default policy first; ship a custom module only when necessary (§10). Never suggest `setenforce 0`.
|
||||
12. Prefer fewer dependencies. Prefer bare-metal systemd over containers unless there's a reason.
|
||||
13. When unsure, ask — these preferences are defaults, not mandates, but deviations should be deliberate.
|
||||
13. Commit in Conventional Commits syntax. Commit autonomously when the work is done; hold off when follow-ups on the same topic are likely (§12 Commits).
|
||||
14. When unsure, ask — these preferences are defaults, not mandates, but deviations should be deliberate.
|
||||
|
||||
Reference in New Issue
Block a user