<< All versions

Skill v1.0.0

currentAutomated scan100/100
hemang11/agent-core/commit-guidelines
──Details
PublishedNovember 17, 2026 at 02:12 PM
Content Hashsha256:0149634173e901bd...
Git SHA321e5a5ba70b
──Files
Files (1 file, 5.7 KB)
SKILL.md5.7 KBactive
SKILL.md · 203 lines · 5.7 KB

name: commit-guidelines description: > Help users write excellent git commit messages following Conventional Commits for JavaScript and TypeScript projects. Use this skill whenever a user asks to write a commit message, improve a commit, stage changes, or summarize what to commit — even if they just say "help me commit this", "what should my commit say", "write a commit for these changes", or "is this a good commit message". Also trigger when reviewing staged files or a diff and the user wants to structure their commits well. Covers message format, scope, granularity, and when to split commits. metadata: version: "1.0.0"


Commit Guidelines Skill (JavaScript / TypeScript)

Help users write clear, consistent git commit messages using Conventional Commits.


The Format

<type>(<scope>): <short summary>
[optional body]
[optional footer(s)]

Types

TypeWhen to use
featNew feature or capability
fixBug fix
docsDocumentation only
styleFormatting, whitespace (no logic change)
refactorCode change with no feature/bug change
perfPerformance improvement
testAdding or correcting tests
buildBuild system, npm scripts, dependencies
ciCI/CD configuration (GitHub Actions, etc.)
choreTooling, config, non-src changes
revertReverts a prior commit

Breaking changes: Append ! to the type:

feat(api)!: remove deprecated v1 auth endpoints

Scopes for JS/TS Projects

Use scopes that reflect your project's actual structure. Common patterns:

By layer: feat(api): fix(db): refactor(ui): fix(middleware):

By feature/domain: feat(auth): fix(checkout): perf(search): test(dashboard):

By tooling: build(webpack): ci(github-actions): chore(eslint): build(tsconfig):

By framework area: fix(hooks): refactor(components): perf(context): test(reducers):

Tip: pick a scope convention and keep it consistent across the team.

Subject Line Rules

  • 50 chars or fewer (hard limit: 72)
  • Imperative mood: "add" not "added" / "adds"
  • No period at the end
  • Capitalize first word after the colon
  • Say what changed, not that something changed

JS/TS Examples — Bad → Good

❌ Bad✅ Good
fix types`fix(auth): correct return type on getUser to User \null`
update depsbuild: upgrade TypeScript to 5.4 and fix type errors
refactor stuffrefactor(cart): extract price calculation into usePricing hook
WIPfeat(search): add debounced filtering for product list
fix bug in loginfix(auth): prevent redirect loop when session token expires
async fixfix(api): await Promise.all instead of sequential fetches
lintstyle: apply eslint --fix across src directory
add teststest(checkout): add coverage for failed payment state

Writing the Body

Add a body when the why isn't obvious. Skip it for simple, self-explanatory changes.

Wrap at 72 chars. Explain what and why — not how.

perf(table): virtualize row rendering for large datasets
The DataTable was rendering all rows on mount, causing 3–5s load times
with 10k+ rows. Switched to react-window for windowed rendering.
Reduces initial DOM nodes from ~10k to ~50 visible rows.
fix(hooks): add cleanup to useWebSocket to prevent memory leak
The previous implementation didn't close the WebSocket on unmount,
causing errors in tests and potential leaks in long-running sessions.
Added return function to useEffect to call ws.close().

Footers

feat(auth): add OAuth2 login via Google
Closes #142
Co-authored-by: Jane Smith <jane@example.com>

Breaking change footer:

refactor(api)!: rename userId to accountId across all endpoints
BREAKING CHANGE: All API consumers must update request payloads
and response handling to use `accountId` instead of `userId`.

Commit Granularity

One logical change per commit. Ask: "If I reverted just this, would it make sense?"

Split when:

  • Summary needs "and" to describe two separate things
  • A dependency bump is mixed with feature code
  • A refactor is mixed with a new feature
  • Type fixes are mixed with logic changes

JS/TS-specific splitting guidance:

# ❌ One messy commit
fix: update deps, fix login bug, and add type for UserProfile
# ✅ Three clean commits
build: upgrade axios to 1.6.8
fix(auth): handle expired token in login redirect
feat(types): add UserProfile interface to shared types

Workflow: Writing a Commit from a Diff

  1. What changed? Identify the logical unit of work.
  2. Type: Is it a fix, feat, refactor, build?
  3. Scope: Which module, hook, component, or domain?
  4. Subject: Imperative, specific, ≤50 chars.
  5. Body needed? Is the why non-obvious?
  6. Footers: Issue refs, breaking changes, co-authors.
  7. Split needed? Multiple concerns → multiple commits.

Provide the message in a code block, ready to copy:

fix(hooks): add cleanup function to useEventListener
Without cleanup, each render was adding a new listener without removing
the old one, causing duplicate handlers and memory leaks.
Closes #87

Quick Reference

feat(scope): New feature
fix(scope): Bug fix
refactor(scope): Restructure, no behavior change
perf(scope): Performance improvement
test(scope): Add or fix tests
build: Deps, npm scripts, tsconfig, webpack
ci: GitHub Actions, CI config
style: Lint/format only, no logic
docs: README, JSDoc, comments
chore: Misc tooling, config, cleanup
All versions