Loading...
Loading...
Reference for Chinese Commit and Changelog Configuration - Chinese Adaptation of Conventional Commits, Chinese Templates for commitlint/husky/commitizen, Chinese Configuration for conventional-changelog. Only invoke when user explicitly uses /chinese-commit-conventions, do not trigger automatically based on context.
npx skill4agent add 21307369/superpowers-zh chinese-commit-conventions| Type | Description | Example Scenarios |
|---|---|---|
| New Feature | Add user registration module |
| Bug Fix | Fix white screen issue on login page |
| Documentation Change | Update API interface docs |
| Code Format (no logic impact) | Adjust indentation, add semicolons |
| Refactoring (not new feature/fix) | Split overly long service class |
| Performance Optimization | Optimize homepage list query speed |
| Testing Related | Add unit tests for user module |
| Build/Tool/Dependency Change | Upgrade webpack to v5 |
| CI Configuration | Modify GitHub Actions workflow |
| Revert Commit | Revert login refactor in v2.1.0 |
typescopedescriptionbody<type>(<scope>): <subject>
<body>
<footer>feat(User Module): Add one-click login via phone number
- Integrated carrier one-click login SDK
- Supports China Mobile, China Unicom, China Telecom
- Automatically downgrade to SMS verification code on login failure
Closes #128fix(Order): Fix inventory oversold issue caused by concurrent orders
In high-concurrency scenarios, the original inventory deduction logic had race conditions.
Adopted dual protection of Redis distributed lock + database optimistic lock.
Affected Scope: Order Service, Inventory Service
Test Verification: Passed 500 concurrent pressure tests
Closes #256<type>(<scope>): <description>User ModuleOrderPaymentBasic Componentsfeat(Permission): Add fine-grained permission control based on RBAC
fix(Payment): Fix WeChat Pay callback signature verification failure issue
perf(List Page): Optimize virtual scrolling rendering for large-data tables
refactor(Gateway): Split monolithic gateway into independent microservices# Avoid the following
fix: Fixed a bug
feat: Updated code
chore: Changed somethingbody<Change background and reason>
Technical Solution:
- <Solution point 1>
- <Solution point 2>
Affected Scope: <Impacted modules or services>footerfeat(API): Refactor user information return structure
Changed the flat structure returned by the user API to a nested structure; front-end needs to adjust field access paths accordingly.
BREAKING CHANGE: /api/user/info return structure changed
- avatar field moved into profile object
- Removed deprecated nickname field, unified use of displayNamefeat(API)!: Refactor user information return structureCloses #128
Refs #129, #130Closes #I5ABC1
Related Requirement: https://gitee.com/org/repo/issues/I5ABC1Link Coding Defect #12345
fixed=project-2024/issues/678# Associate multiple platforms in footer
Closes #128
Jira: PROJ-456
ZenTao: #789npm install -D conventional-changelog-cli conventional-changelog-conventionalcommits{
"scripts": {
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s",
"changelog:all": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -r 0",
"release": "standard-version"
}
}module.exports = {
types: [
{ type: 'feat', section: 'New Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'perf', section: 'Performance Optimizations' },
{ type: 'refactor', section: 'Code Refactoring' },
{ type: 'docs', section: 'Documentation Updates' },
{ type: 'test', section: 'Testing' },
{ type: 'chore', section: 'Build/Tools', hidden: true },
{ type: 'ci', section: 'Continuous Integration', hidden: true },
{ type: 'style', section: 'Code Formatting', hidden: true }
],
commitUrlFormat: '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}',
compareUrlFormat: '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}'
}npm install -D @commitlint/cli @commitlint/config-conventionalmodule.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', [
'feat', 'fix', 'docs', 'style', 'refactor',
'perf', 'test', 'chore', 'ci', 'revert'
]],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'subject-empty': [2, 'never'],
'subject-max-length': [2, 'always', 100],
// Allow Chinese characters, disable subject-case restriction
'subject-case': [0],
// Disable or relax header-max-length (Chinese characters take more width)
'header-max-length': [2, 'always', 120],
'body-max-line-length': [1, 'always', 200],
'footer-max-line-length': [1, 'always', 200]
},
prompt: {
messages: {
type: 'Select commit type:',
scope: 'Enter affected scope (optional):',
subject: 'Enter brief description:',
body: 'Enter detailed description (optional, use "|" for line breaks):',
breaking: 'List incompatible changes (optional):',
footer: 'Associated Issues (optional, e.g., #123):',
confirmCommit: 'Confirm the above commit information?'
}
}
}npm install -D husky lint-staged
npx husky init# .husky/commit-msg
npx --no -- commitlint --edit "$1"# .husky/pre-commit
npx lint-staged{
"lint-staged": {
"*.{js,ts,jsx,tsx,vue}": [
"eslint --fix",
"prettier --write"
],
"*.{css,scss,less}": [
"stylelint --fix",
"prettier --write"
],
"*.md": [
"prettier --write"
]
}
}npm install -D commitizen cz-conventional-changelog
# Add to package.json
{
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"scripts": {
"commit": "cz"
}
}npm run committypescopesubjectsubjectbody.commitlintrc.husky/scope