simplify-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Simplify a skill

简化Skill

When to use

使用场景

Use this skill when an existing skill is harder to understand, operate, verify, or maintain than its domain requires. Do not use it for an ordinary code-only cleanup.
当现有Skill的理解、操作、验证或维护难度超出其领域需求时,可使用本技能。请勿将其用于普通的纯代码清理工作。

Outcome

预期结果

Reduce at least one declared complexity cost for a named actor and task. Preserve purpose, authority, behavior, safety, dependencies, outputs, and proof unless the user approves an exact loss.
Never accept line count alone as evidence of simplification.
为指定的actor和任务至少降低一项已声明的复杂度成本。除非用户明确批准,否则需保留Skill的用途、权限、行为、安全性、依赖关系、输出和验证依据。
切勿仅以代码行数减少作为简化的依据。

Hard boundaries

硬性约束

  • Treat the complete current package as the baseline source of truth.
  • Preserve essential domain complexity. Remove accidental complexity first.
  • Default to lossless change.
  • Keep exact commands, paths, schemas, hashes, quotes, permission gates, numeric limits, and stop rules exact.
  • Keep component status separate from whole-skill status.
  • Do not claim identical prose from every model or provider.
  • Define determinism as a closed decision contract plus machine-checked end state.
  • 将当前完整包作为基准事实来源。
  • 保留必要的领域复杂度,优先消除非必要的偶发复杂度。
  • 默认采用无损失变更。
  • 严格保留精确的命令、路径、模式、哈希值、引号、权限控制、数值限制和终止规则。
  • 区分组件状态与整个Skill的状态。
  • 不要求来自每个模型或提供商的描述完全一致。
  • 将确定性定义为封闭决策契约加上机器校验的最终状态。

Required composition

必要组合

Read the dependency reconciliation before changing a package. Use the collection's starting-point, human-behavior, agent-behavior, and meaning-preservation owners when their triggers apply.
A native host-only load is evidence, not a portable dependency. Internalize its invariant or route to an installed public peer. If neither is possible, return
BLOCKED_DEPENDENCY
.
在修改包之前,请阅读依赖协调文档。当触发条件适用时,使用集合的起点、人类行为、agent行为和含义保留相关的所有者规则。
仅原生主机加载是一种证据,而非可移植依赖。需内化其不变量或路由到已安装的公共对等依赖。若两者均不可行,则返回
BLOCKED_DEPENDENCY

Input contract

输入契约

Record
target
,
actor
,
task
,
environment
,
scope
,
invariants
,
measure
, and
allowed_loss
. Use
unknown
for missing data.
allowed_loss
is
none
unless the user approves an exact bound.
记录
target
actor
task
environment
scope
invariants
measure
allowed_loss
。缺失数据用
unknown
表示。除非用户明确批准具体限制,否则
allowed_loss
默认为
none

State machine

状态机

Use only this order:
DISCOVER -> BASELINE -> CONTRACT -> SELECT -> REWRITE -> VERIFY -> ACCEPT
A gate failure moves to
BLOCKED
. Unapproved loss moves to
NEEDS_APPROVAL
. No accepted cost reduction moves to
NO_CHANGE
.
Resolve ties by authority, safety and privacy, behavior preservation, the user's exact method, lower declared cost, then
NO_CHANGE
.
仅按以下顺序执行:
DISCOVER -> BASELINE -> CONTRACT -> SELECT -> REWRITE -> VERIFY -> ACCEPT
若关卡失败,则进入
BLOCKED
状态。若存在未获批的损失,则进入
NEEDS_APPROVAL
状态。若未实现可接受的成本降低,则进入
NO_CHANGE
状态。
按以下优先级解决冲突:权限、安全与隐私、行为保留、用户指定的精确方法、更低的已声明成本,最后是
NO_CHANGE

Procedure

操作流程

  1. Discover. Read the live target, every linked file, nearby owners, origin record, checks, and governing source. Stop on unexplained drift.
  2. Freeze. Back up and hash every file. Run existing checks and representative tasks.
  3. Contract. Give each rule and observable behavior a stable ID. Record authority, strength, conditions, protected spans, target, and evidence. Coverage must equal
    1.0
    .
  4. Select. Try
    deduplicate
    ,
    clarify
    ,
    reorder
    ,
    progressive-disclosure
    ,
    extract-child
    ,
    simplify-code
    , then
    approved-loss
    . Use the first mode that lowers the declared cost without a veto.
  5. Check claims. Define the human or agent population and target test before claiming behavior improved.
  6. Rewrite. Change the smallest owner. Use plain language, one rule per sentence, named actors, closed status words, defaults, and exact stop conditions.
  7. Handle code. Use tests first and keep code proof separate from instruction proof.
  8. Verify. Recompute hashes, ledger coverage, protected spans, links, metadata, loading, tests, package state, and end-state readback. Compare baseline and candidate in the same environment.
  9. Accept or restore. Accept only when a declared cost fell, every invariant passed, and no veto remains. Otherwise restore or return the exact blocked status.
  1. 发现:读取实时目标、所有关联文件、相关所有者、来源记录、检查项和管控源。若发现无法解释的偏差则停止。
  2. 冻结:备份并哈希所有文件。运行现有检查项和代表性任务。
  3. 契约化:为每条规则和可观测行为分配稳定ID。记录权限、优先级、条件、保护范围、目标和证据。覆盖率必须达到
    1.0
  4. 选择策略:依次尝试
    deduplicate
    (去重)、
    clarify
    (澄清)、
    reorder
    (重排)、
    progressive-disclosure
    (渐进式披露)、
    extract-child
    (提取子Skill)、
    simplify-code
    (简化代码),最后是
    approved-loss
    (获批损失)。选用首个能降低已声明成本且无否决项的模式。
  5. 验证声明:在声称行为有所改进前,定义测试针对的人类或agent群体及目标测试。
  6. 重写:修改最小范围的所有者。使用平实语言,每句一条规则,明确命名actor,使用封闭状态词、默认值和精确终止条件。
  7. 代码处理:优先使用测试,将代码验证依据与指令验证依据分开。
  8. 验证:重新计算哈希值、账本覆盖率、保护范围、链接、元数据、加载情况、测试、包状态和最终状态回读结果。在同一环境中对比基准版本和候选版本。
  9. 接受或恢复:仅当已声明成本降低、所有不变量通过且无剩余否决项时,才接受变更。否则恢复原状或返回精确的阻塞状态。

Child extraction

子Skill提取

Create a child only when it has a distinct trigger, standalone outcome, explicit interface, canonical ownership, direct tests, parent-route tests, expected reuse above coordination cost, and an acyclic load graph. Never split only to reduce line count.
仅当子Skill具备以下条件时才创建:有独立触发条件、独立预期结果、明确接口、标准所有权、直接测试、父路由测试、预期复用价值高于协调成本,且负载图无环。切勿仅为减少代码行数而拆分。

Acceptance

验收标准

ACCEPT
requires:
  • baseline and candidate packet hashes recompute;
  • ledger coverage is
    1.0
    with no unauthorized loss;
  • every protected span passes or has exact approval;
  • at least one declared cost decreases in the same environment;
  • native, task, package, link, and readback checks pass;
  • all ten native pressure cases retain their required and forbidden behavior.
Package PASS, eval enrollment, behavior-eval PASS, component status, and whole-skill PASS are separate results.
ACCEPT
状态需满足:
  • 重新计算基准版本和候选版本的包哈希值;
  • 账本覆盖率为
    1.0
    ,且无未授权损失;
  • 所有保护范围均通过检查或已获得明确批准;
  • 在同一环境中至少一项已声明成本降低;
  • 原生、任务、包、链接和回读检查均通过;
  • 全部10个原生压力测试用例均保留其要求和禁止的行为。
包通过、评估注册、行为评估通过、组件状态和整个Skill通过是各自独立的结果。

Resources

参考资源

  • Simplification model
  • Preservation contract
  • Dependency reconciliation
  • assets/
    for ledger templates
  • examples/
    for accepted and blocked outcomes
  • evals/
    for native-case lineage and portable tests
  • scripts/
    and
    scripts/tests/
    for package checks
  • 简化模型
  • 保留契约
  • 依赖协调
  • assets/
    目录包含账本模板
  • examples/
    目录包含已接受和阻塞的结果示例
  • evals/
    目录包含原生用例谱系和可移植测试
  • scripts/
    scripts/tests/
    目录包含包检查脚本