← 返回 Skills 市场
lanyasheng

Improvement Gate

作者 _silhouette · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
125
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install auto-improvement-gate
功能描述
当执行完变更需要验证是否应保留、候选被标记 pending 需要人工审批、或想查看待审队列时使用。7 层机械门禁: Schema→Compile→Lint→Regression→Review→Doubt→HumanReview,任一 required 层失败即拒绝。不用于打分(用 improvement-disc...
使用说明 (SKILL.md)

Improvement Gate

7-layer mechanical quality gate: any required layer fail = reject/revert.

When to Use

  • 验证已执行的候选是否应保留(gate.py)
  • 管理人工审核队列(review.py --list)
  • 完成待审批项(review.py --complete)

When NOT to Use

  • 给候选打分 → use improvement-discriminator
  • 执行文件变更 → use improvement-executor
  • 评估 skill 结构 → use improvement-learner

7-Layer Gate

Layer Gate Required Pass Condition
0 SchemaGate Yes Candidate has id, category, risk_level, execution_plan
1 CompileGate Yes Modified .py files pass py_compile; non-Python files auto-pass
2 LintGate No (advisory) No lines >120 chars, no mixed tabs/spaces in diff
3 RegressionGate Yes Evaluator verdict != "reject" (checks evaluator_evidence)
4 ReviewGate Yes Discriminator recommendation=accept AND panel not DISPUTED AND LLM judge != reject
5 DoubtGate Yes Candidate text has \x3C threshold hedging words (threshold varies by category: docs=2, prompt=4, code=3)
6 HumanReviewGate No (advisory) Flags needs_human=true for medium/high risk or prompt/workflow/tests/code categories

Gate execution: layers run sequentially. First required-layer failure stops execution and triggers revert (if file was modified) or reject.

CLI — gate.py

python3 scripts/gate.py \
  --ranking ranking.json \         # REQUIRED: ranking artifact from discriminator
  --execution execution.json \     # REQUIRED: execution artifact from executor
  --state-root /path/to/state \    # default: lib/state_machine.DEFAULT_STATE_ROOT
  --evaluation eval.json \         # optional: evaluator artifact (forwarded by orchestrator)
  --layers schema,compile,review \ # optional: run only these layers (default: all 7)
  --output receipt.json            # default: auto-generated path
Param Default When to change
--layers all 7 Use schema,compile for fast structural checks only
--evaluation None Orchestrator passes this automatically when evaluator ran

CLI — review.py (Human Review Queue)

# List pending human reviews
python3 scripts/review.py --state-root /path/to/state --list

# Complete a review
python3 scripts/review.py --state-root /path/to/state \
  --complete review-cand-01-docs \
  --decision approve \             # approve | reject
  --reason "低风险文档变更,LGTM" \
  --reviewer engineer-name         # default: cli-user

4-Way Decision Logic (after all required layers pass)

Condition Decision Action
accept_for_execution + low-risk docs/reference/guardrail + success keep File stays modified
recommendation=reject revert Restore backup, append to veto log
recommendation=hold OR non-auto-keep-eligible pending_promote Restore backup, create review request
execution.status=unsupported reject No file change, log reason

如果 HumanReviewGate 标记 needs_human=true,即使 keep eligible 也会升级为 pending_promote

\x3Cexample> 正确: gate 返回 pending_promote → 查审批队列 → 人工批准 $ python3 scripts/review.py --state-root ./state --list → ID: review-cand-01-docs Category: docs Risk: low Since: 2025-01-15T10:00:00Z $ python3 scripts/review.py --state-root ./state --complete review-cand-01-docs --decision approve --reason "confirmed safe" → Review review-cand-01-docs completed: approve \x3C/example>

\x3Canti-example> 错误: gate 返回 revert 后仍然保留文件变更 → revert 时 gate 自动调用 restore_backup(),原文件已恢复。不要手动跳过。 \x3C/anti-example>

Output — Gate Receipt

{"decision": "keep", "reason": "low-risk docs candidate executed successfully",
 "gate_layers": {"all_passed": true, "layers_run": 7, "layer_results": [...]},
 "rollback": {"attempted": false}, "next_step": "propose_candidates", "next_owner": "proposer"}

Related Skills

  • improvement-discriminator: ReviewGate checks its panel consensus + LLM verdict
  • improvement-executor: Gate validates executor output; reverts via rollback_pointer
  • improvement-evaluator: RegressionGate checks evaluator verdict when --evaluation provided
  • improvement-orchestrator: Calls gate as stage 5, forwards evaluator artifact
  • benchmark-store: Pareto front data consumed by RegressionGate
安全使用建议
This skill appears coherent for enforcing a multi-layer quality gate. Before installing or running it: 1) Verify the implementation of the repo-local helpers (lib.state_machine, lib.common) since gate.py calls restore_backup(), update_state(), and writes review/receipt JSON files — those functions control what gets changed on disk. 2) When invoking the gate, point --state-root at a controlled directory and ensure execution/ranking/evaluation artifacts come from trusted orchestrator components; the gate trusts those artifacts (including a rollback_pointer.target_path) and may operate on the target path. 3) Review restore_backup() / rollback behavior to confirm it cannot be abused to overwrite sensitive files if given a crafted artifact. 4) Run the included tests locally to confirm behavior in your environment. Overall the skill does not request unrelated credentials or network installs and is consistent with its stated purpose.
功能分析
Type: OpenClaw Skill Name: auto-improvement-gate Version: 1.0.0 The skill bundle implements a multi-layered quality gate system designed to validate automated improvements to code and documentation. The core logic in `scripts/gate.py` includes structural checks, syntax validation via `py_compile`, and a 'DoubtGate' that scans for non-committal language. The `scripts/review.py` file provides a standard CLI for managing human approval workflows. All behaviors, including file restoration and state management, are consistent with the stated purpose of a quality control mechanism and do not exhibit signs of data exfiltration, malicious execution, or harmful prompt injection.
能力评估
Purpose & Capability
Name/description describe a multi-layer quality gate and the provided scripts (gate.py, review.py) implement schema/compile/lint/regression/review/doubt/human-review layers and a human-review CLI; required inputs (ranking, execution, evaluation artifacts and a state directory) match the stated purpose.
Instruction Scope
SKILL.md instructs the agent to run local Python scripts with artifacts and a state root. The runtime steps reference only local files, review queue state, and orchestrator-provided artifacts. There are no instructions to read unrelated system secrets or send data to third-party endpoints.
Install Mechanism
No install spec — instruction-only with bundled scripts and tests. No downloads, package installs, or external executables are required.
Credentials
The skill declares no required environment variables, credentials, or external config paths. The code operates on artifact JSON and a user-provided state directory, which is proportionate to a gate/review workflow.
Persistence & Privilege
always is false and the skill does not demand permanent platform-level privileges. It reads/writes review files under the provided state-root and may call restore_backup/update_state — file I/O is expected for a gate but means callers should choose a safe state-root.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install auto-improvement-gate
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /auto-improvement-gate 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: closed-loop skill improvement pipeline
元数据
Slug auto-improvement-gate
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Improvement Gate 是什么?

当执行完变更需要验证是否应保留、候选被标记 pending 需要人工审批、或想查看待审队列时使用。7 层机械门禁: Schema→Compile→Lint→Regression→Review→Doubt→HumanReview,任一 required 层失败即拒绝。不用于打分(用 improvement-disc... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 125 次。

如何安装 Improvement Gate?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install auto-improvement-gate」即可一键安装,无需额外配置。

Improvement Gate 是免费的吗?

是的,Improvement Gate 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Improvement Gate 支持哪些平台?

Improvement Gate 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Improvement Gate?

由 _silhouette(@lanyasheng)开发并维护,当前版本 v1.0.0。

💬 留言讨论