← 返回 Skills 市场
lanyasheng

Improvement Generator

作者 _silhouette · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ⚠ suspicious
119
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install improvement-generator
功能描述
当需要为目标 skill 生成改进候选、把上次失败信息注入下一轮生成、或分析历史记忆模式来避免重复失败时使用。支持 --trace 注入失败上下文。不用于打分(用 improvement-discriminator)或评估(用 improvement-learner)。
使用说明 (SKILL.md)

Improvement Generator

Produces ranked improvement candidates from target analysis, feedback signals, and failure traces.

When to Use

  • 为目标 skill 生成结构化改进候选
  • 把上次失败的 trace 注入下一轮(trace-aware reflection)
  • 根据 trace 自动降低上次失败类别的候选优先级
  • 结合 memory 和 feedback 多源信号生成高优先级候选
  • 批量生成多个 skill 的候选列表供 discriminator 打分
  • 在 autoloop 场景下由 orchestrator 自动调用,注入历史 trace
  • 手动调试单个 skill 的改进方向时作为独立工具使用
  • 对比有/无 trace 生成结果来验证 trace 注入是否生效

When NOT to Use

  • 给候选打分 → use improvement-discriminator
  • 评估 skill 结构 → use improvement-learner
  • 全流程 → use improvement-orchestrator
  • 执行已批准的变更 → use improvement-executor
  • 门禁验证 → use improvement-gate

Why Trace-Aware Generation Matters

问题: 没有 trace 注入时,LLM 每次都从零开始生成候选。如果上一轮在 accuracy 维度失败了,下一轮很可能再次生成相同类别的候选 — 因为 LLM 不知道上次失败了。实测中无 trace 重试的重复失败率高达 60-70%。

Tradeoff: trace 注入增加了 prompt 长度(约 200-500 tokens),但大幅降低了重复失败率。Because trace 包含失败维度、失败原因、已尝试策略三个关键信号,generator 可以在生成阶段就避开已知死路,而不是等到 discriminator 打分后才发现。这比 "生成 → 打分 → 发现重复 → 重新生成" 的循环节省 1-2 轮迭代。

Trace-Aware Generation

Previous failure on "accuracy" dimension
  → deprioritize candidates of the same category as the failed one
  → prioritize other dimensions' improvements instead
  → if same category failed ≥2 times, skip entirely and try adjacent dimensions

\x3Cexample> 正确: 第一次失败后注入 trace 重试 $ python3 scripts/propose.py --target /path/to/skill --trace failure_trace.json --output candidates.json → 生成的候选会自动避开上次失败的 accuracy 维度策略 \x3C/example>

\x3Canti-example> 错误: 失败后不注入 trace 直接重试 → 没有 trace 信息,generator 无法降低失败类别的优先级,容易重复生成同类候选 → 失败 ≥3 次的自动跳过逻辑在 improvement-learner 中,不在 generator \x3C/anti-example>

Trace JSON Structure

trace 文件记录上一轮失败的完整上下文,generator 解析后调整候选优先级:

{
  "iteration": 2,
  "failed_dimension": "accuracy",
  "failed_category": "add_code_examples",
  "failure_reason": "code example added but not syntactically valid",
  "attempted_strategies": ["append_bash_example", "append_python_snippet"],
  "scores_before": {"accuracy": 0.67, "coverage": 0.85},
  "scores_after": {"accuracy": 0.63, "coverage": 0.85}
}

generator 收到这个 trace 后会:(1) 把 add_code_examples 类别的优先级降到最低,(2) 从 coverage/trigger_quality 等未失败维度寻找候选,(3) 如果 accuracy 下的其他类别(如 add_output_artifacts)未尝试过则仍可生成。

CLI

# Basic generation
python3 scripts/propose.py --target /path/to/skill --output candidates.json

# With failure trace (retry loop)
python3 scripts/propose.py --target /path/to/skill --trace failure.json --output candidates.json

# With memory/feedback sources
python3 scripts/propose.py --target /path/to/skill --source memory.json --output candidates.json

Output Artifacts

Request Deliverable
Generate JSON array of ranked candidates with category, risk_level, execution_plan
With trace Same format, priorities adjusted based on failure analysis
With memory Candidates informed by historical patterns and past successes
With feedback Candidates prioritized by user correction hotspots

每个候选的 JSON 结构包含 category(改进类别)、risk_level(low/medium/high)、execution_plan(具体修改步骤)、priority_score(0-1 综合优先级)、trace_adjusted(是否被 trace 调整过优先级)。

Related Skills

  • improvement-discriminator: Scores the candidates this skill produces
  • improvement-orchestrator: Calls generator as stage 1
  • improvement-learner: Provides evaluation data that informs candidate selection
  • improvement-executor: Executes the top-ranked candidate approved by gate
  • session-feedback-analyzer: Generates feedback.jsonl that feeds into candidate prioritization
安全使用建议
This skill appears coherent and limited to proposing change candidates for skills/readme/reference files. It does not ask for credentials or perform network installs. Before running: (1) inspect the repo-local helpers (lib.common and lib.state_machine) that propose.py imports—those functions perform file/state I/O and determine exact file reads/writes; (2) run the script against a copy or a non-sensitive test directory (pass --target a skill folder you control) to verify behavior; (3) review generated candidates and do not pipe outputs automatically into any executor that applies changes without human review. If you plan to run it in an automated autoloop/orchestrator, ensure proper gating so proposals are reviewed before being executed.
功能分析
Type: OpenClaw Skill Name: improvement-generator Version: 1.1.1 The skill is designed to automate the improvement of other skills by using the `claude` CLI to analyze failure traces and propose modifications (scripts/propose.py). While the code appears functionally aligned with its stated purpose, it is classified as suspicious due to high-risk capabilities, specifically the use of `subprocess.run` to execute external commands and the generation of `execution_plan` objects intended for automated file edits. These mechanisms are inherently vulnerable to prompt injection if the target `SKILL.md` files being analyzed contain malicious instructions designed to manipulate the LLM's output into proposing harmful changes.
能力评估
Purpose & Capability
Name/description (generate improvement candidates, trace-aware retries) align with the delivered artifacts: SKILL.md documents trace-aware behavior and scripts/propose.py implements candidate builders and trace-based reprioritization. The skill does not request unrelated binaries or credentials.
Instruction Scope
Runtime instructions are limited to reading the target skill files, optional trace/memory/feedback JSON inputs, and producing a candidates JSON. The SKILL.md and propose.py do not instruct reading system secrets or sending data to external endpoints. They do rely on repo-local helper modules (lib.common, lib.state_machine) to read/write JSON and state.
Install Mechanism
No install spec or network downloads; this is an instruction-only skill with bundled scripts and tests. Nothing is fetched from external URLs or extracted to disk during install.
Credentials
The skill requires no environment variables or credentials. All file access is driven by CLI args (--target, --trace, --output, --state-root). No extraneous SECRET/TOKEN/PASSWORDs are requested.
Persistence & Privilege
The script writes its candidate output (e.g., --output candidates.json) and may interact with a state root via lib.state_machine (default state root is accepted via CLI). It also inserts the repository root on sys.path to import lib.* helpers. These behaviors are reasonable for a repo-local tool but mean you should run it against intended directories (not your whole home or sensitive paths).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install improvement-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /improvement-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.1
v2.0: 9-dim evaluation, category modifiers, per-dim Pareto tolerances, enriched docs
v1.1.0
v1.1.0: Fix 4 critical pipeline bugs (Ralph Wiggum/Autoloop/Evaluator verdict), scoring overhaul (base 4->2, LLM weight 50%, semantic relevance), generator LLM-first, learner/gate/executor fixes
v1.0.0
improvement-generator 1.0.0 - New skill for generating structured improvement candidates for target skills. - Supports injecting failure traces (--trace) to guide candidate generation and avoid repeating failed strategies. - Analyzes memory patterns to skip strategies that have failed ≥3 times. - Not designed for scoring candidates or evaluating skill structure—use related skills for those tasks. - Outputs ranked improvement candidates, adjusting priorities based on recent failure signals.
元数据
Slug improvement-generator
版本 1.1.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 3
常见问题

Improvement Generator 是什么?

当需要为目标 skill 生成改进候选、把上次失败信息注入下一轮生成、或分析历史记忆模式来避免重复失败时使用。支持 --trace 注入失败上下文。不用于打分(用 improvement-discriminator)或评估(用 improvement-learner)。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 119 次。

如何安装 Improvement Generator?

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

Improvement Generator 是免费的吗?

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

Improvement Generator 支持哪些平台?

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

谁开发了 Improvement Generator?

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

💬 留言讨论