Skip to content

feat: add commit-normalize skill - #1

Open
ohong wants to merge 1 commit into
mainfrom
feat/commit-normalize
Open

feat: add commit-normalize skill#1
ohong wants to merge 1 commit into
mainfrom
feat/commit-normalize

Conversation

@ohong

@ohong ohong commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds new commit-normalize agent skill that rewrites informal/inconsistent commit messages to Conventional Commits format
  • Covers type classification (feat/fix/refactor/chore/docs/test/ci/style/perf/build/revert), scope inference from changed files, subject line rules, body/footer formatting, and breaking change notation
  • Includes a pattern reference table mapping common informal messages (e.g. "updated README", "fixed bug", "WIP") to their conventional equivalents

Test plan

  • Install skill and verify it triggers on commit-related prompts
  • Test with informal commit messages and verify normalized output follows Conventional Commits spec
  • Verify scope inference works correctly for single-file, single-directory, and cross-cutting changes
  • Confirm existing Conventional Commits messages are left untouched
  • Confirm merge and revert commits are not rewritten

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation guide for standardizing commit messages to Conventional Commits format. Includes classification rules, subject line conventions, breaking change handling, pattern mappings, and step-by-step rewriting processes. Provides practical examples for feature commits, bug fixes, dependency updates, and refactors, along with guidance on when normalization applies.

Automated by nightshift

Adds a new agent skill that rewrites informal/inconsistent commit
messages to Conventional Commits format (type(scope): description).
Covers type classification, scope inference, subject line rules,
body/footer formatting, breaking change notation, and a pattern
reference mapping common informal messages to their conventional
equivalents.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

A new documentation file defines a Commit Message Normalizer skill that prescribes rewriting informal commit messages to Conventional Commits format, including type classifications, scope inference rules, subject line conventions, breaking change handling, pattern mappings, and practical examples.

Changes

Cohort / File(s) Summary
Commit Normalization Documentation
commit-normalize/SKILL.md
New file defining Commit Message Normalizer skill with Conventional Commits format specifications, type/scope rules, rewriting guidelines, pattern mappings from informal to formal messages, and practical examples covering feature commits, bug fixes, dependency updates, breaking changes, and multi-file refactors.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐰 Hop along with commits so clean,
Type and scope in every scene,
From messy notes to formal grace,
Conventional format sets the pace!
A skill to normalize with care,
Making git history bright and fair. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add commit-normalize skill' directly and clearly describes the main change: adding a new skill for commit message normalization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/commit-normalize

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
commit-normalize/SKILL.md (1)

17-23: Add language identifiers to fenced code blocks.

These fences trip markdownlint MD040 and make the examples render less clearly in some viewers.

Proposed doc fix
-```
+```text
 type(scope): subject

 [optional body]

 [optional footer(s)]
-```
+```

-```
+```text
 Before: Added dark mode toggle to settings page
 After:  feat(settings): add dark mode toggle
-```
+```

-```
+```text
 Before: fix the login issue that users reported
 After:  fix(auth): prevent session expiry during active use

         Users were being logged out mid-session because the token
         refresh timer was not reset on activity.

         Fixes `#892`
-```
+```

-```
+```text
 Before: updated packages
 After:  chore(deps): update react to 19.1 and next to 15.3
-```
+```

-```
+```text
 Before: changed API response format
 After:  feat(api)!: return JSON arrays instead of wrapped objects

         BREAKING CHANGE: all list endpoints now return raw arrays
         instead of { data: [], meta: {} } wrappers. Clients must
         update their response parsing.
-```
+```

-```
+```text
 Before: refactoring
 After:  refactor(payments): extract shared validation logic

         Moved duplicate card validation from checkout and billing
         into a shared validator module.
-```
+```

Also applies to: 130-133, 136-144, 147-150, 153-160, 163-169

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commit-normalize/SKILL.md` around lines 17 - 23, The fenced code blocks in
SKILL.md (the examples starting with the block that shows "type(scope): subject"
and the subsequent Before/After example blocks) lack language identifiers and
trigger markdownlint MD040; update each triple-backtick fence in those example
blocks (including the main template block and all Before/After example blocks
around lines shown in the diff) to include a language tag such as "text" (e.g.,
change ``` to ```text) so markdownlint passes and viewers render the examples
consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@commit-normalize/SKILL.md`:
- Around line 15-23: Update the canonical format in the "Rewrite commit
messages..." section of SKILL.md so it allows scope-less and breaking-change
variants instead of requiring only "type(scope): subject"; replace the single
example "type(scope): subject" with the accepted variants "type: subject",
"type(scope): subject", "type!: subject", and "type(scope)!: subject" (keeping
the optional body and footer lines unchanged) so the documented canonical format
matches the valid outputs and examples elsewhere.
- Around line 96-100: The table entry that rewrites "WIP / work in progress" to
`wip: [describe what's in progress]` conflicts with the allowed Conventional
Commit types; update the SKILL.md table so WIP is not normalized to a
non-supported `wip` type—either remove that row or change its mapping to an
allowed type (e.g., map to `chore:`) or explicitly state to keep "WIP" unchanged
and recommend squashing before merge; edit the row that currently reads `WIP /
work in progress` → `wip: [describe what's in progress]` and ensure consistency
with the allowed type list above.

---

Nitpick comments:
In `@commit-normalize/SKILL.md`:
- Around line 17-23: The fenced code blocks in SKILL.md (the examples starting
with the block that shows "type(scope): subject" and the subsequent Before/After
example blocks) lack language identifiers and trigger markdownlint MD040; update
each triple-backtick fence in those example blocks (including the main template
block and all Before/After example blocks around lines shown in the diff) to
include a language tag such as "text" (e.g., change ``` to ```text) so
markdownlint passes and viewers render the examples consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f33f2689-d109-48ca-a3dc-3e38bcab68e8

📥 Commits

Reviewing files that changed from the base of the PR and between e7fcb8c and 8d4c77f.

📒 Files selected for processing (1)
  • commit-normalize/SKILL.md

Comment thread commit-normalize/SKILL.md
Comment on lines +15 to +23
Rewrite commit messages to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Every commit message must match:

```
type(scope): subject

[optional body]

[optional footer(s)]
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Make the canonical format match the valid outputs.

This section says every normalized message must be type(scope): subject, but later rules/examples allow scope-less commits (chore: ...) and breaking-change syntax (feat(api)!: ...). As written, the skill can reject formats it later tells itself to generate.

Proposed doc fix
-Rewrite commit messages to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Every commit message must match:
+Rewrite commit messages to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Normalized commit messages should match one of these forms:

-type(scope): subject
+type: subject
+type(scope): subject
+type!: subject
+type(scope)!: subject

[optional body]

[optional footer(s)]

```
</details>


Also applies to: 50-50, 87-90

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.21.0)</summary>

[warning] 17-17: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against the current code and only fix it if needed.

In `@commit-normalize/SKILL.md` around lines 15 - 23, Update the canonical format
in the "Rewrite commit messages..." section of SKILL.md so it allows scope-less
and breaking-change variants instead of requiring only "type(scope): subject";
replace the single example "type(scope): subject" with the accepted variants
"type: subject", "type(scope): subject", "type!: subject", and "type(scope)!:
subject" (keeping the optional body and footer lines unchanged) so the
documented canonical format matches the valid outputs and examples elsewhere.
```

</details>

<!-- fingerprinting:phantom:triton:grasshopper -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment thread commit-normalize/SKILL.md
Comment on lines +96 to +100
| Informal Message | Normalized |
|-----------------|------------|
| `updated README` | `docs(readme): update README` |
| `fixed bug` / `bugfix` | `fix: resolve [describe the actual bug]` |
| `WIP` / `work in progress` | `wip: [describe what's in progress]` — or better, squash before merge |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Don't normalize WIP into a non-supported wip type.

The pattern table currently rewrites WIP to wip: ..., but wip is not in the allowed type list above and is not part of the Conventional Commits types this skill claims to enforce. That would make the normalizer produce output that violates its own rules.

Proposed doc fix
-| `WIP` / `work in progress` | `wip: [describe what's in progress]` — or better, squash before merge |
+| `WIP` / `work in progress` | Prefer not to create the commit yet; if it must exist, use the real type, e.g. `feat: ...`, `fix: ...`, or `refactor: ...` |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Informal Message | Normalized |
|-----------------|------------|
| `updated README` | `docs(readme): update README` |
| `fixed bug` / `bugfix` | `fix: resolve [describe the actual bug]` |
| `WIP` / `work in progress` | `wip: [describe what's in progress]` — or better, squash before merge |
| Informal Message | Normalized |
|-----------------|------------|
| `updated README` | `docs(readme): update README` |
| `fixed bug` / `bugfix` | `fix: resolve [describe the actual bug]` |
| `WIP` / `work in progress` | Prefer not to create the commit yet; if it must exist, use the real type, e.g. `feat: ...`, `fix: ...`, or `refactor: ...` |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commit-normalize/SKILL.md` around lines 96 - 100, The table entry that
rewrites "WIP / work in progress" to `wip: [describe what's in progress]`
conflicts with the allowed Conventional Commit types; update the SKILL.md table
so WIP is not normalized to a non-supported `wip` type—either remove that row or
change its mapping to an allowed type (e.g., map to `chore:`) or explicitly
state to keep "WIP" unchanged and recommend squashing before merge; edit the row
that currently reads `WIP / work in progress` → `wip: [describe what's in
progress]` and ensure consistency with the allowed type list above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant