- Staging: Add modified files to the git staging area.
- Message Generation: Create a commit message following the
type(scope): descriptionformat (e.g.:feat(auth): add login page)。 - Committing: Execute
git commit。
Instructions
- Worktree Awareness: Before committing, confirm the current directory (e.g.
../momei-dev), ensuring the commit is made in the correct branch and context. - Specification Alignment: Before committing, it must be confirmed that the development specification。
- Scale Verification: Mandatory check of the number of files changed in this change. In principle, the number of files must not exceed 10; the corresponding feature point must be single.
- Task Association: Each commit should and only should be associated with Todo one atomic item.
- Pre-commit Check: Before performing any git commit operation, confirm that
@code-auditorhas passedpnpm typecheck,pnpm lintand the necessarytargeted tests。 - Verify Status: Check
git statusto see what needs to be staged. - Generate Message: Analyze the changes to determine the
type(feat, fix, docs, style, refactor, test, perf, build, ci, chore, revert),scope(optional, e.g.: component name, module) anddescription. The message description uniformly usesChinese。 - Commit: Run
git commit -m "..."。 - Verify: Ensure the message conforms to
commitlint.config.ts。
Usage Example
Input: "Commit the new user profile feature."
Action: git add ., analyze the changes, generate the message feat(user): 实现带有头像上传功能的用户个人资料页面, git commit。