Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Commit d0077bc

Browse files
committed
refactor(gitcommit): add commit complexity guide
1 parent 32d1250 commit d0077bc

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

lua/codecompanion/_extensions/gitcommit/generator.lua

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -265,33 +265,31 @@ Allowed types: feat, fix, docs, style, refactor, perf, test, chore
265265
Language: %s
266266
267267
RULES:
268-
- Output the commit message directly without any markdown formatting or code blocks
269-
- Keep Subject Line under 50 characters
270-
- Body is OPTIONAL: only include if the change needs explanation
271-
- For trivial changes (typos, simple renames, minor tweaks): subject line ONLY, no body
272-
- For small changes: 1-2 bullet points maximum
273-
- For complex changes: up to 3-5 bullet points
274-
- Each line of the body should not exceed 72 characters
275-
- If commit history is provided, follow the established patterns and style from recent commits
268+
- Keep Subject Line under 50 characters, body lines under 72 characters
269+
- DEFAULT TO MINIMAL: prefer fewer bullet points over more
270+
- Body is OPTIONAL: omit if subject line is self-explanatory
271+
- NEVER pad with redundant points - each bullet must add unique value
272+
- If commit history is provided, follow established patterns
273+
274+
COMPLEXITY GUIDE:
275+
- Single file text change, config tweak, typo fix → NO body
276+
- Single logical change (rename, add one function) → 0-1 bullet
277+
- Multiple related changes → 2-3 bullets MAX
276278
277279
EXAMPLES:
278280
279-
Trivial change (no body needed):
280-
fix(typo): correct spelling in README
281+
fix(config): update timeout value
281282
282-
Small change (1-2 points):
283-
refactor(utils): rename helper function
283+
refactor(api): rename getUserData to fetchUser
284284
285-
- Rename `getData` to `fetchUserData` for clarity
285+
- Update all call sites to use new name
286286
287-
Complex change (multiple points):
288-
feat(auth): add OAuth2 integration
287+
feat(auth): add OAuth2 support
289288
290-
- Implement OAuth2 authentication flow
291-
- Add token refresh mechanism
292-
- Update user session handling
289+
- Implement token refresh flow
290+
- Add session persistence
293291
294-
Generate ONE commit message for this diff (match body length to change complexity):
292+
Generate a CONCISE commit message:
295293
```diff
296294
%s
297295
```

0 commit comments

Comments
 (0)