← Back to Skills Marketplace
lanyasheng

Improvement Gate

by _silhouette · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
125
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install auto-improvement-gate
Description
当执行完变更需要验证是否应保留、候选被标记 pending 需要人工审批、或想查看待审队列时使用。7 层机械门禁: Schema→Compile→Lint→Regression→Review→Doubt→HumanReview,任一 required 层失败即拒绝。不用于打分(用 improvement-disc...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install auto-improvement-gate
  3. After installation, invoke the skill by name or use /auto-improvement-gate
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: closed-loop skill improvement pipeline
Metadata
Slug auto-improvement-gate
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Improvement Gate?

当执行完变更需要验证是否应保留、候选被标记 pending 需要人工审批、或想查看待审队列时使用。7 层机械门禁: Schema→Compile→Lint→Regression→Review→Doubt→HumanReview,任一 required 层失败即拒绝。不用于打分(用 improvement-disc... It is an AI Agent Skill for Claude Code / OpenClaw, with 125 downloads so far.

How do I install Improvement Gate?

Run "/install auto-improvement-gate" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Improvement Gate free?

Yes, Improvement Gate is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Improvement Gate support?

Improvement Gate is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Improvement Gate?

It is built and maintained by _silhouette (@lanyasheng); the current version is v1.0.0.

💬 Comments