behavior-safe-code-repair
Repair ESLint errors and TypeScript build failures using a behavior-safe, risk-aware workflow that preserves business logic and chooses appropriate test strategies based on impact.
适合你,如果经常修复 ESLint 或 TypeScript 错误且担心改坏业务逻辑
/ 通过 npx 安装 校验哈希
npx oh-my-skill add quanxiaoxiao/quan-skills/behavior-safe-code-repair/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- quanxiaoxiao/quan-skills/behavior-safe-code-repair/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify quanxiaoxiao/quan-skills/behavior-safe-code-repair安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
0GitHub stars
~646最小装载
~1.2K含声明引用
~1.3K文本包总量
索引托管
怎么用
技能原文 SKILL.md
Behavior-Safe Code Repair
Repair lint, typecheck, and build failures without silently changing business behavior.
Use This Skill
Use this skill when the task involves:
- ESLint failures
- TypeScript typecheck or build failures
- strictness upgrades that surface latent defects
- refactors required only to satisfy lint or types
- repairs where green checks are necessary but not sufficient
When NOT to use
Do not use this skill when:
- the task is pure formatting or a safe lint autofix
- the user is asking for a feature or behavior change
- generated code should be fixed at the generator instead
- the work is really an architectural refactor rather than a scoped repair
Pre-Read Order
Read the target repository first:
README.mdpackage.json- the failing scripts and current error output
- existing tests that cover the affected area
Then load bundled guidance from this skill pack:
../../prompts/lint-build-repair.md../../checklists/lint-build-repair-checklist.mdreferences/risk-and-test-matrix.md
Workflow
- Classify the failure before editing. State whether the root cause is mechanical, behavior-preserving, or behavior-sensitive.
- Choose a test policy from the matrix. Pick between no new tests, fix-then-test, test-before-fix, or higher-level coverage. Explain why.
- Repair the root cause with the smallest justified diff. Fix upstream type or contract mismatches before downstream symptoms. Separate mechanical cleanup from logic edits when possible.
- Preserve runtime truth. Do not distort working behavior just to satisfy TypeScript. Avoid
any,as any, blind non-null assertions, swallowed errors, or weakened validation unless explicitly justified.
- Add or update protection only where it buys safety. Reuse meaningful existing tests first. Add targeted regression coverage when the repair touches branching, validation, lifecycle rules, or caller-visible behavior.
- Verify with repository scripts. Prefer the repository's own
lint,typecheck,build,test, integration, or Hurl commands over ad hoc substitutes.
Reference Guide
Load these only when needed:
references/risk-and-test-matrix.mdfor risk levels, test policies, heuristics, and stop conditions../../prompts/lint-build-repair-with-tests.mdwhen the task explicitly includes test authoring
Verification
Run the relevant repository scripts for the affected scope:
npm run lintnpm run typechecknpm run build- relevant test, integration, or Hurl commands when the repair is not purely mechanical
If a script does not exist or cannot run, report that explicitly and state the residual risk.
Output Contract
Return results in this order:
Issue SummaryRisk LevelTest DecisionChanges MadeValidation ResultsResidual Risk
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…