用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/smj-edison/zicl --skill find-repetition命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | find-repetition |
| description | Scan file(s) for repeated code patterns and suggest functions to encapsulate them |
| argument-hint | <file or glob> |
Scan $ARGUMENTS for two kinds of issues:
For each pattern found, show the locations where it appears, explain what the shared logic is doing, and suggest a function signature that would encapsulate it. Only flag repetition that is genuinely worth extracting -- three or more occurrences, or two that are complex enough that a helper would meaningfully reduce the maintenance surface. Do not suggest abstractions for simple one-liners or cases where the repetition is coincidental rather than structural.
Read .claude/helpers.md first. Then scan the target files for code that manually implements logic already covered by a helper in the index. For each instance found, cite the helper from .claude/helpers.md that should replace it and show a before/after sketch.
Common patterns to watch for in this codebase:
var new: OptionalHandle = .none; try shimmerToX(...); handle.swapIfNew(new); when an in-place wrapper like getInteger, getFloat, getBoolean, getIndex, shimmerToList, getListLength, getCodepointLength, or resolveHash already exists on Interp.dictLookupFollowRefs or dictGetTable when Interp.getDictValue, getDictValueOrError, getDictValueRecursively, getDictValueRecursivelyOrError, putDictValue, putDictValueRecursively, removeDictValue, removeDictValueRecursively, getDictValueInPlace, or putDictValueInPlace would handle the shimmer and error plumbing.createObject + manual field initialization when newList, newListWithCapacity, or listAppendAssumeCapacity would suffice.createString + setNormalString when newString, newStringFmt, newStringToFill, or setStringOwning would work.incrRefCount/decrRefCount pairs when takeReference(), dupOrRef(), reference(), or referenceTakeOwnership() express the intent more directly.ErrorDetails and passing it through multiple layers when interp.wrapError or interp.wrapShimmerFn could collapse the boilerplate.Heap.ListIndex.asAbsoluteIndex, Range.fromIndexes, getRange, or getRangeInPlace already exists.evalExpression, evalExpressionInPlace, or getBoolFromExpression should be used.captureScope or captureCurrentScope already does it.When reporting a subsumed pattern, include:
.claude/helpers.md.Be conservative: only flag cases where the replacement is clearly equivalent and actually shorter or clearer. Do not suggest replacing code that uses the helper's internals intentionally or that has subtle behavioral differences.