simplify
Behavior-preserving cleanup pass (reuse, quality, efficiency, AI-slop removal) after review. Use when /sw-ship runs post-review deslop before gap-check. Re-verified via simplify-gate; does not skip verify.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- simplify
- description
- Behavior-preserving cleanup pass (reuse, quality, efficiency, AI-slop removal) after review. Use when /sw-ship runs post-review deslop before gap-check. Re-verified via simplify-gate; does not skip verify.
02 资源文件 1
- 参考文档references/verdict-schema.json307 B
03 SKILL.md 正文
Simplification / deslop pass (IM7)
Post-review, pre-commit cleanup on the uncommitted delta. Behavior-preserving only — no new features, no
scope expansion, no weakened tests. Complements /sw-review (findings) and gap-check (requirements); does
not replace either.
Model tier: mid — resolve via python3 scripts/sw_bootstrap.py resolve-model-tier.py -- --skill simplify. When using the Task tool for subagent dispatch, resolve concrete model IDs from models.tiers in config (never semantic tier names in subagent model: frontmatter).
When it runs
- Default-on in
/sw-shipafter/sw-review, beforegap-check. - Standalone:
/sw-simplifyanytime on uncommitted work. - Skip:
/sw-ship --fast(with gap-check) or explicit--skip-simplify.
Pass categories
Apply only when removal/simplification cannot change observable behavior:
| Category | Examples |
|---|---|
| Reuse | Inline duplicate → existing helper; collapse copy-paste branches |
| Quality | Dead code, unused imports, unreachable branches |
| Efficiency | Redundant work (double fetch, needless re-parse) without semantic change |
| AI slop | Obvious comments (// increment i), filler docstrings, over-wrapped one-liners, defensive try/catch that only rethrows |
Procedure
- Baseline evidence — copy
/tmp/sw-verify.status.json→/tmp/sw-verify.pre-simplify.jsonwhen present. - Scope —
git diff+git diff --cached; if empty, reportskippedand stop. - Simplify — edit delta only; honor
agentsFiledoctrine; no test assertion weakening. - Re-verify — run
/sw-verify(or equivalent config commands); refresh/tmp/sw-verify.status.json. - Behavior gate —
python3 scripts/simplify-gate.py:--baseline-verify /tmp/sw-verify.pre-simplify.json--post-verify /tmp/sw-verify.status.json
- Emit
/tmp/sw-simplify.status.jsonwith{verdict, baseline, post, findings}. - Hand off to
gap-check//sw-commitonpreservedorinconclusive; halt onregressed.
Verdict contract (scripts/simplify-gate.py)
| Verdict | Meaning | Exit |
|---|---|---|
preserved |
Baseline and post verify both pass | 0 |
inconclusive |
Missing baseline or pre-simplify verify was not passing | 10 |
regressed |
Baseline passed but post verify failed | 20 |
Pairs with skills/verification-gate — simplify-gate is behavior-preservation across the cleanup, not CI
truth (check-gate.py remains authoritative at merge).
Guardrails
- No commits, push, PR, or merge from this step.
- Never auto-delete tests or loosen assertions to green.
- Security-sensitive surfaces (auth, secrets, CI config) — surface for human review; do not bulk-simplify.
- Persisted summaries through
python3 scripts/sw_bootstrap.py memory-redact.py(R41). - Slots alongside future local code-review (
providers/code-review/) — does not duplicate persona review.
Refactor-vs-simplify boundary (PRD 039 R7)
/sw-simplify is post-review, phase-level deslop on the uncommitted delta. The per-task refactor step
in skills/execute-discipline runs earlier (after green, before stage-1 review) and consumes the quality
harness signal. This skill does not replace or inline refactor.
04 同仓库更多 Skills
wrong-name
Missing use when phrase and wrong directory name for critical lint failure.
demo-skill
Demo workflow pack skill fixture. Use when validating workflow-pack-sdk golden paths in CI.
good-skill
Validates Agent Skills spec conformance for fixture trees. Use when testing skills-spec-guard pass paths across core and dist mirrors. Does not ship production skills.
wrong-name
Fixture with name/dir mismatch for guard failure tests. Use when verifying skills-spec-guard rejects invalid identity. Does not ship production skills.
bad-description
Missing the required when trigger phrase in this fixture skill.
dropin-demo
暂无简介