validator-commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/validator-commit $ARGUMENTS
/validator-commit $ARGUMENTS
Commit with optional validator validation. Runs first, validates based on intent (full run, checks only, or skip), handles failures, then commits.
agent-validate detect带可选验证器验证的提交操作。首先运行,根据意图(完整运行、仅检查或跳过)执行验证,处理失败情况,然后完成提交。
agent-validate detectStep 1 - Detect Changes
步骤1 - 检测变更
Run using :
agent-validate detectBashbash
agent-validate detect 2>&1; echo "DETECT_EXIT:$?"Check the exit code from the line:
DETECT_EXIT:- Exit 0 → gates would run, continue to Step 2
- Exit 2 → no gates would run (no changes or no applicable gates), skip to Step 4 (commit directly)
- Exit 1 → error, report the error to the user and stop
- Any other exit code → treat as error, report output to the user, and stop
使用运行:
Bashagent-validate detectbash
agent-validate detect 2>&1; echo "DETECT_EXIT:$?"检查行的退出码:
DETECT_EXIT:- 退出码0 → 将运行验证规则,继续步骤2
- 退出码2 → 无验证规则需要运行(无变更或无适用规则),跳至步骤4(直接提交)
- 退出码1 → 错误,向用户报告错误并终止流程
- 其他任何退出码 → 视为错误,向用户报告输出内容并终止流程
Step 2 - Determine Validation Intent
步骤2 - 确定验证意图
Parse for a validation intent. Do not prompt the user if a clear intent is found.
$ARGUMENTS| ARGUMENTS pattern | Action |
|---|---|
| Contains "run", "full", or "all gates" | Invoke |
| Contains "check" or "checks" | Invoke |
| Contains "skip" | Run |
| Empty or no clear intent | Present the three choices below to the user, wait for selection |
When prompting the user, present these choices:
- Run all gates — full validation (checks + reviews)
- Run checks only — checks without AI reviews
- Skip validator — advance baseline without running any gates
Then proceed to the step matching the user's selection.
解析以确定验证意图。如果发现明确意图,无需提示用户。
$ARGUMENTS| 参数模式 | 操作 |
|---|---|
| 包含"run"、"full"或"all gates" | 调用 |
| 包含"check"或"checks" | 调用 |
| 包含"skip" | 运行 |
| 为空或无明确意图 | 向用户展示以下三个选项,等待用户选择 |
提示用户时,展示以下选项:
- 运行所有验证规则 — 完整验证(检查+AI评审)
- 仅运行检查 — 仅执行检查,不进行AI评审
- 跳过验证器 — 不运行任何验证规则,直接推进基线
然后根据用户选择进入对应步骤。
Step 3a - Full Validation (validator-run)
步骤3a - 完整验证(validator-run)
Invoke .
/validator-run- If it passes → go to Step 4
- If it fails → the skill handles fixing and re-running. After that skill completes, ask the user: "Ready to commit?". Proceed to Step 4 only on confirmation.
/validator-run
调用。
/validator-run- 如果验证通过 → 进入步骤4
- 如果验证失败 → 技能会处理修复和重新运行。该技能完成后,询问用户:"是否准备好提交?"。仅在用户确认后进入步骤4。
/validator-run
Step 3b - Checks-Only Validation (validator-check)
步骤3b - 仅检查验证(validator-check)
Invoke .
/validator-check- If it passes → go to Step 4
- If it fails → the skill handles fixing and re-running. After that skill completes, ask the user: "Ready to commit?". Proceed to Step 4 only on confirmation.
/validator-check
调用。
/validator-check- 如果检查通过 → 进入步骤4
- 如果检查失败 → 技能会处理修复和重新运行。该技能完成后,询问用户:"是否准备好提交?"。仅在用户确认后进入步骤4。
/validator-check
Step 3c - Skip Validation
步骤3c - 跳过验证
Run:
bash
agent-validate skip 2>&1Report the command output to the user, then go to Step 4.
运行:
bash
agent-validate skip 2>&1向用户报告命令输出,然后进入步骤4。
Step 4 - Commit
步骤4 - 提交
Check whether you have a skill for committing git changes available (excluding itself to avoid self-invocation).
validator-commit- If a commit skill is found → invoke that skill to perform the commit
- If no commit skill is found → stage all tracked changes, propose a commit message following the conventional commits format (), then run
<type>: <description>git commit -m "<message>"
检查是否有可用的Git提交技能(排除自身以避免自调用)。
validator-commit- 如果找到提交技能 → 调用该技能执行提交操作
- 如果未找到提交技能 → 暂存所有已跟踪的变更,遵循约定式提交格式()生成提交信息,然后运行
<type>: <description>git commit -m "<message>"