AgentSkillsCN

git-conventions

本项目 Git 提交、分支、PR 与发布规范。每当进行提交、创建分支、开启 PR,或进行发布时,都应主动使用此技能。可通过“commit”、“PR”、“pull request”、“release”、“merge”、“branch”等短语进行触发。

SKILL.md
--- frontmatter
name: git-conventions
description: "Git commit, branch, PR, and release conventions for this project. This skill should be used proactively whenever committing, creating branches, opening PRs, or making releases. Triggers on 'commit', 'PR', 'pull request', 'release', 'merge', 'branch'."

Git Conventions

Commit Message Format

code
<type>(<scope>): <subject>

Types

TypeWhen to use
featNew feature or capability
fixBug fix
coreInfrastructure, dependencies, config, build system
refactorCode restructuring without behavior change
styleFormatting, whitespace, missing semicolons (no logic change)
docsDocumentation only
testAdding or updating tests
perfPerformance improvement
choreMaintenance tasks (cleanup, tooling, CI)

Scope

The scope indicates the area of the codebase affected. Use lowercase.

Common scopes for this project:

ScopeArea
uiComponents, styling, layout
sanityCMS schema, queries, Studio, actions
i18nInternationalization, translations, locale routing
seoMetadata, sitemap, Open Graph, structured data
confignext.config, tsconfig, eslint, prettier
depsDependency upgrades
dxDeveloper experience, tooling, skills, hooks

Subject

  • Use imperative mood: "add feature" not "added feature"
  • Lowercase first letter
  • No period at the end
  • Concise (under 72 characters total)

Examples

code
feat(ui): add dark mode toggle to navbar
fix(sanity): correct GROQ query for project descriptions
core(deps): upgrade Next.js 14 to 16 with React 19
refactor(ui): harmonize dropdown styles between menu and language toggle
docs(readme): update tech stack versions for v2.0.0
style(ui): fix indentation in LazyYoutube component
chore(dx): add upgrade-nextjs skill

Multi-line Commits

For complex changes, add a blank line after the subject and include a body:

code
core(deps): upgrade Next.js 14 to 16 with React 19

- Migrate to React 19 (ref as prop, stricter hydration)
- Migrate ESLint 8 to 9 (flat config)
- Migrate framer-motion 11 to 12 (motion.create API)
- Migrate Sanity 3 to 5 (createImageUrlBuilder)
- Rename middleware.ts to proxy.ts (Next.js 16)

Co-Authored-By

When Claude generates the commit, always append:

code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Branch Naming

code
<type>/<description>
TypeWhen to useExample
feature/New featurefeature/dark-mode
fix/Bug fixfix/navbar-scroll
core/Infrastructure/depscore/update-nextjs
refactor/Code restructuringrefactor/component-architecture
docs/Documentationdocs/api-guide

Pull Requests

Title Format

Same as commit format:

code
<type>(<scope>): <subject>

Body Format

markdown
## Summary
<1-3 bullet points describing changes>

## Test plan
- [ ] Verification step 1
- [ ] Verification step 2

Merge Strategy

  • Feature/fix branches → merge into develop (via PR)
  • developmerge into main (for releases)

Releases

Tag Format

code
release v<major>.<minor>.<patch>

Determining the Version Bump

Before bumping, analyze the changes and ask the user which version type applies if ambiguous. Use this decision guide:

VersionWhen to useSignal
Major (X.0.0)Public API breaking changes, complete rewritesUser explicitly says "breaking change" or "major"
Minor (x.Y.0)New features, dependency upgrades, non-breaking additionsNew capability, framework migration, new skill/tool
Patch (x.y.Z)Bug fixes, typo corrections, small tweaksFix, correction, minor adjustment

Rules:

  • Dependency upgrades (even major ones like Next.js 14→16) are minor unless they break the public-facing site behavior
  • New features (i18n, dark mode, new section) are minor
  • Bug fixes and style corrections are patch
  • When in doubt, ask the user with AskUserQuestion before bumping

Release Workflow

  1. Ensure all changes are merged into develop
  2. Merge develop into main
  3. Update package.json version
  4. Create git tag: git tag -a "v<version>" -m "release v<version>"
  5. Push tag: git push origin --tags
  6. Create GitHub release from the tag using gh release create

Release Title

code
release v<version>