Git Commit Operator (/git-commit)
Output language: All output mirrors the language of the invoking prompt. Vietnamese prompt → Vietnamese output; English prompt → English output. Status tokens (READY, BLOCKED, NO-OP), Git output, and code identifiers are language-invariant.
Dùng để tạo commit an toàn. Không chạy git commit trước khi /git-validate --scope=commit trả READY. Cả solo và team mode, Agent chỉ commit khi Human yêu cầu; Agent không git push. Human thực hiện delivery remote theo Project Ownership sau commit/validation.
Project ownership detection
Đọc # Project Ownership: team|solo và # Agent Execution: direct|orchestrated trong .sdd/shared_context.md. --project-ownership=solo|team override explicit cho invocation hiện tại. Chỉ dùng canonical khi mỗi header tồn tại đúng một lần và hợp lệ. Khi cả hai canonical header đều vắng mặt, chỉ dùng đúng một legacy source hợp lệ: đúng một # Collaboration Mode: solo|team hoặc đúng một --team-size=solo|team; source duplicate, malformed hoặc coexist là BLOCKED. Source hợp lệ map solo thành solo/direct và team thành team/orchestrated; báo migration warning, không tự rewrite governance. Thiếu, trùng hoặc malformed canonical header là BLOCKED, không fallback legacy. Khi có một trong hai canonical header, --team-size là BLOCKED; alias chỉ hợp lệ khi cả hai canonical header đều vắng mặt. --team-size cũng không được kết hợp --project-ownership hoặc --agent-execution; conflict là BLOCKED. Legacy header tồn tại cùng canonical headers không dùng để resolve và phải ghi migration cleanup.
Solo ownership bỏ PR overhead; Agent Execution không ảnh hưởng Git delivery, không nới outbound safety gate và không ủy quyền Agent push.
Tham số
--message=<message>: Commit message; thiếu thì đề xuất từ diff và yêu cầu user xác nhận.
--type=<feat|fix|perf|docs|test|refactor|chore|build|ci>: Tùy chọn.
--scope=<scope>: Tùy chọn.
--feature=<feature-slug>: Tùy chọn, truyền tiếp cho validator.
--files=<path,...>: Tùy chọn; chỉ stage path này. Không có thì hiển thị danh sách và yêu cầu xác nhận trước khi stage intended changes.
--project-ownership=solo|team: Tùy chọn; override delivery ownership.
--team-size=solo|team: Deprecated composite alias trong một transition release; báo migration warning.
Quy trình
Đọc AGENTS.md, CONSTITUTION.md, CLAUDE.md và skill reference liên quan.
Kiểm tra worktree:
git status --short
git diff --stat
git diff --name-only
Không stage forbidden file: .env, private key, credential, secret, node_modules/, dist/; không stage thay đổi ngoài scope user yêu cầu.
Stage path đã xác nhận:
git add -- <path>...
git diff --cached --stat
git diff --cached --name-only
Tách thay đổi khác type/scope; tách code, test, docs, dependency/config khi không cùng intent. Hơn mười file không liên quan thì chia nhiều commit. File .claude/ chỉ dùng prefix feat, fix hoặc perf.
Commit message theo type(scope): description, dưới 72 ký tự, imperative/present tense, không dấu chấm cuối và không AI attribution. Feature SDD thêm feature/spec version khi add-execute yêu cầu.
Chạy gate ngay trước commit:
/git-validate --scope=commit --feature=<feature-slug>
Gate phải trả GIT VALIDATION: READY; BLOCKED thì dừng, không tự sửa, reset, amend hoặc bypass check.
Sau READY và user xác nhận commit message, chạy:
git commit -m "type(scope): description"
git rev-parse --short HEAD
git log -1 --format=%s
Báo commit hash, branch và Human delivery command đề xuất; không chạy git push:
git push -u origin <head>
Safety gates
- Không có thay đổi: báo
NO-OP, không commit.
- Có secret/forbidden file: block, chỉ hiện path/pattern đã mask.
- Validation/commit hook fail: block, báo lỗi nguyên văn và giữ nguyên worktree; không retry vô hạn.
main, master, production, prod, release/*: không force-push hoặc bypass protection.
- Destructive operation như
reset, checkout, clean, amend cần explicit confirmation.
Output
✓ staged: N files (+X/-Y lines)
✓ validation: READY
✓ commit: HASH type(scope): description
✓ delivery: Human must run git push after reviewing remote target
1---2name: git-commit3description: Stage và commit thay đổi sau validation; Agent dừng trước remote delivery4---56# Git Commit Operator (`/git-commit`)78**Output language:** All output mirrors the language of the invoking prompt. Vietnamese prompt → Vietnamese output; English prompt → English output. Status tokens (`READY`, `BLOCKED`, `NO-OP`), Git output, and code identifiers are language-invariant.910Dùng để tạo commit an toàn. Không chạy `git commit` trước khi `/git-validate --scope=commit` trả `READY`. Cả solo và team mode, Agent chỉ commit khi Human yêu cầu; Agent không `git push`. Human thực hiện delivery remote theo `Project Ownership` sau commit/validation.1112## Project ownership detection1314Đọc `# Project Ownership: team|solo` và `# Agent Execution: direct|orchestrated` trong `.sdd/shared_context.md`. `--project-ownership=solo|team` override explicit cho invocation hiện tại. Chỉ dùng canonical khi mỗi header tồn tại đúng một lần và hợp lệ. Khi cả hai canonical header đều vắng mặt, chỉ dùng đúng một legacy source hợp lệ: đúng một `# Collaboration Mode: solo|team` hoặc đúng một `--team-size=solo|team`; source duplicate, malformed hoặc coexist là `BLOCKED`. Source hợp lệ map `solo` thành solo/direct và `team` thành team/orchestrated; báo migration warning, không tự rewrite governance. Thiếu, trùng hoặc malformed canonical header là `BLOCKED`, không fallback legacy. Khi có một trong hai canonical header, `--team-size` là `BLOCKED`; alias chỉ hợp lệ khi cả hai canonical header đều vắng mặt. `--team-size` cũng không được kết hợp `--project-ownership` hoặc `--agent-execution`; conflict là `BLOCKED`. Legacy header tồn tại cùng canonical headers không dùng để resolve và phải ghi migration cleanup.1516Solo ownership bỏ PR overhead; Agent Execution không ảnh hưởng Git delivery, không nới outbound safety gate và không ủy quyền Agent push.1718## Tham số1920- `--message=<message>`: Commit message; thiếu thì đề xuất từ diff và yêu cầu user xác nhận.21- `--type=<feat|fix|perf|docs|test|refactor|chore|build|ci>`: Tùy chọn.22- `--scope=<scope>`: Tùy chọn.23- `--feature=<feature-slug>`: Tùy chọn, truyền tiếp cho validator.24- `--files=<path,...>`: Tùy chọn; chỉ stage path này. Không có thì hiển thị danh sách và yêu cầu xác nhận trước khi stage intended changes.25- `--project-ownership=solo|team`: Tùy chọn; override delivery ownership.26- `--team-size=solo|team`: Deprecated composite alias trong một transition release; báo migration warning.2728## Quy trình29301. Đọc `AGENTS.md`, `CONSTITUTION.md`, `CLAUDE.md` và skill reference liên quan.312. Kiểm tra worktree:3233 ```bash34 git status --short35 git diff --stat36 git diff --name-only37 ```38393. Không stage forbidden file: `.env`, private key, credential, secret, `node_modules/`, `dist/`; không stage thay đổi ngoài scope user yêu cầu.404. Stage path đã xác nhận:4142 ```bash43 git add -- <path>...44 git diff --cached --stat45 git diff --cached --name-only46 ```47485. Tách thay đổi khác type/scope; tách code, test, docs, dependency/config khi không cùng intent. Hơn mười file không liên quan thì chia nhiều commit. File `.claude/` chỉ dùng prefix `feat`, `fix` hoặc `perf`.496. Commit message theo `type(scope): description`, dưới 72 ký tự, imperative/present tense, không dấu chấm cuối và không AI attribution. Feature SDD thêm feature/spec version khi `add-execute` yêu cầu.507. Chạy gate ngay trước commit:5152 ```text53 /git-validate --scope=commit --feature=<feature-slug>54 ```5556 Gate phải trả `GIT VALIDATION: READY`; `BLOCKED` thì dừng, không tự sửa, reset, amend hoặc bypass check.578. Sau `READY` và user xác nhận commit message, chạy:5859 ```bash60 git commit -m "type(scope): description"61 git rev-parse --short HEAD62 git log -1 --format=%s63 ```64659. Báo commit hash, branch và Human delivery command đề xuất; không chạy `git push`:6667 ```bash68 git push -u origin <head>69 ```7071## Safety gates7273- Không có thay đổi: báo `NO-OP`, không commit.74- Có secret/forbidden file: block, chỉ hiện path/pattern đã mask.75- Validation/commit hook fail: block, báo lỗi nguyên văn và giữ nguyên worktree; không retry vô hạn.76- `main`, `master`, `production`, `prod`, `release/*`: không force-push hoặc bypass protection.77- Destructive operation như `reset`, `checkout`, `clean`, `amend` cần explicit confirmation.7879## Output8081```text82✓ staged: N files (+X/-Y lines)83✓ validation: READY84✓ commit: HASH type(scope): description85✓ delivery: Human must run git push after reviewing remote target86```