一键导入
campusforge-git-commit
Generate and review Git commits for CampusForge. Use when preparing, splitting, naming, or validating commits in this repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate and review Git commits for CampusForge. Use when preparing, splitting, naming, or validating commits in this repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | campusforge-git-commit |
| description | Generate and review Git commits for CampusForge. Use when preparing, splitting, naming, or validating commits in this repository. |
Use this skill to create small, auditable commits for the CampusForge monorepo. The goal is to keep history useful for review, release notes, rollback, and incident analysis.
Every commit MUST satisfy all of the following:
commitlint.config.js.<type>(<scope>): <subject>
[body]
[footer]
The scope is optional only when no project area is clearly dominant.
Use exactly one type:
| Type | Use for |
|---|---|
feat | User-visible product capability or API behavior. |
fix | Bug fix, broken behavior, regression, data correctness issue. |
docs | Documentation-only change. |
style | Formatting-only change with no runtime or type behavior change. |
refactor | Internal code change that does not add behavior or fix a bug. |
perf | Measurable performance improvement. |
test | Test-only change or test infrastructure. |
chore | Tooling, dependency, repository maintenance. |
ci | GitHub Actions, release automation, CI configuration. |
revert | Revert of a previous commit. |
If a change both fixes a bug and refactors code, use fix when the user-visible behavior changes. If it only improves structure, use refactor.
Prefer these repository scopes because they match commitlint.config.js:
| Scope | Use for |
|---|---|
web | Next.js frontend app, routing, pages, client/server components. |
ui | Reusable UI components, CSS tokens, layout primitives, visual system. |
api | Fastify backend, REST endpoints, request lifecycle. |
db | Prisma schema, migrations, seed data, database client. |
shared | Shared DTOs, Zod schemas, cross-package constants. |
auth | Authentication, identity integration, session handling. |
rbac | Roles, permissions, access-control decisions. |
core | Cross-cutting business logic not owned by one app/package. |
config | TypeScript, ESLint, Prettier, Turbo, package configuration. |
deps | Dependency updates and lockfile-only dependency maintenance. |
ci | Workflows and CI-only scripts. |
docs | Documentation files. |
For mature frontend work, split large UI changes by stable review boundary:
feat(web) for new route-level capability.feat(ui) for new reusable component behavior.fix(ui) for visual or interaction defects in shared components.style(ui) only when output behavior is unchanged.perf(web) only when the commit directly improves rendering, loading, or bundle behavior.The subject MUST:
add, prevent, normalize; not added, adds, updated.Good subjects:
feat(web): add invitation review dashboard
fix(ui): preserve focus when closing command menu
refactor(shared): centralize invitation status schema
perf(web): defer loading member graph visualization
Bad subjects:
fix: fixed stuff
chore: update
feat(web): Add New Page.
refactor: changed files
Add a body when the subject alone cannot explain risk or intent. The body SHOULD explain what changed and why; avoid narrating obvious code mechanics.
Use a body for:
Wrap body lines at 100 characters to match repository commitlint warnings.
Example:
fix(web): keep invitation filters in sync with URL state
Store the selected status in search params so shared links preserve the same
review queue and browser navigation does not reset the filter.
Use footers for issue links, breaking changes, and revert metadata.
Closes #42
Fixes #89
Refs #104
BREAKING CHANGE: invitation status values now use shared enum names.
Breaking changes MUST use BREAKING CHANGE: in the footer and describe the migration impact.
Before committing, split changes until each commit can be reviewed and reverted independently.
Keep together:
Split apart:
For frontend commits, verify the affected behavior before committing:
docs/04-design-system.md tokens, spacing, states, and visual tone.Local hooks run through Husky:
pre-commit: pnpm lint and pnpm typecheckcommit-msg: npx --no -- commitlint --edit <message-file>Useful manual checks:
pnpm lint
pnpm typecheck
printf '%s\n' 'feat(web): add invitation status tracking' | pnpm exec commitlint
Do not bypass hooks with --no-verify unless an emergency process explicitly allows it.
git add -p when needed.Before accepting a commit message, confirm: