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
agent-validate detect
first, validates based on intent (full run, checks only, or skip), handles failures, then commits.
带可选验证器验证的提交操作。首先运行
agent-validate detect
,根据意图(完整运行、仅检查或跳过)执行验证,处理失败情况,然后完成提交。

Step 1 - Detect Changes

步骤1 - 检测变更

Run
agent-validate detect
using
Bash
:
bash
agent-validate detect 2>&1; echo "DETECT_EXIT:$?"
Check the exit code from the
DETECT_EXIT:
line:
  • 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
使用
Bash
运行
agent-validate detect
bash
agent-validate detect 2>&1; echo "DETECT_EXIT:$?"
检查
DETECT_EXIT:
行的退出码:
  • 退出码0 → 将运行验证规则,继续步骤2
  • 退出码2 → 无验证规则需要运行(无变更或无适用规则),跳至步骤4(直接提交)
  • 退出码1 → 错误,向用户报告错误并终止流程
  • 其他任何退出码 → 视为错误,向用户报告输出内容并终止流程

Step 2 - Determine Validation Intent

步骤2 - 确定验证意图

Parse
$ARGUMENTS
for a validation intent. Do not prompt the user if a clear intent is found.
ARGUMENTS patternAction
Contains "run", "full", or "all gates"Invoke
/validator-run
(Step 3a)
Contains "check" or "checks"Invoke
/validator-check
(Step 3b)
Contains "skip"Run
agent-validate skip 2>&1
(Step 3c), then go to Step 4
Empty or no clear intentPresent the three choices below to the user, wait for selection
When prompting the user, present these choices:
  1. Run all gates — full validation (checks + reviews)
  2. Run checks only — checks without AI reviews
  3. Skip validator — advance baseline without running any gates
Then proceed to the step matching the user's selection.
解析
$ARGUMENTS
以确定验证意图。如果发现明确意图,无需提示用户。
参数模式操作
包含"run"、"full"或"all gates"调用
/validator-run
(步骤3a)
包含"check"或"checks"调用
/validator-check
(步骤3b)
包含"skip"运行
agent-validate skip 2>&1
(步骤3c),然后进入步骤4
为空或无明确意图向用户展示以下三个选项,等待用户选择
提示用户时,展示以下选项:
  1. 运行所有验证规则 — 完整验证(检查+AI评审)
  2. 仅运行检查 — 仅执行检查,不进行AI评审
  3. 跳过验证器 — 不运行任何验证规则,直接推进基线
然后根据用户选择进入对应步骤。

Step 3a - Full Validation (validator-run)

步骤3a - 完整验证(validator-run)

Invoke
/validator-run
.
  • If it passes → go to Step 4
  • If it fails → the
    /validator-run
    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
  • 如果验证通过 → 进入步骤4
  • 如果验证失败 →
    /validator-run
    技能会处理修复和重新运行。该技能完成后,询问用户:"是否准备好提交?"。仅在用户确认后进入步骤4。

Step 3b - Checks-Only Validation (validator-check)

步骤3b - 仅检查验证(validator-check)

Invoke
/validator-check
.
  • If it passes → go to Step 4
  • If it fails → the
    /validator-check
    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
  • 如果检查通过 → 进入步骤4
  • 如果检查失败 →
    /validator-check
    技能会处理修复和重新运行。该技能完成后,询问用户:"是否准备好提交?"。仅在用户确认后进入步骤4。

Step 3c - Skip Validation

步骤3c - 跳过验证

Run:
bash
agent-validate skip 2>&1
Report 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
validator-commit
itself to avoid self-invocation).
  • 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 (
    <type>: <description>
    ), then run
    git commit -m "<message>"
检查是否有可用的Git提交技能(排除
validator-commit
自身以避免自调用)。
  • 如果找到提交技能 → 调用该技能执行提交操作
  • 如果未找到提交技能 → 暂存所有已跟踪的变更,遵循约定式提交格式(
    <type>: <description>
    )生成提交信息,然后运行
    git commit -m "<message>"