跳到正文
FunCoding

07-refactor

Improve code across four axes (cleanup, performance, security, architecture) by scanning and fixing, or applying a pushed audit report. Use when the user wants to refactor, optimize, harden, or remove code. Not for read-only diagnosis or adding tests.

Star
593
许可证
MIT
最近提交
2026年12月1日

plugins/aidd-dev/skills/07-refactor/SKILL.md

在 GitHub 上查看

Skill: refactor

The act-side of code improvement: it changes code to make it better. Behavior-preserving for cleanup, performance, and architecture; security may change behavior on purpose to close a hole.

Actions

#ActionAxisLens
01performanceperformanceN+1, hot paths, batching, memoization, unnecessary I/O
02securitysecurityOWASP, input validation, authz, secrets: harden and fix
03cleanupcode-qualityclean code: rename, extract, DRY, dead code, complexity
04architecturearchitectureextract layers, fix coupling, enforce boundaries

Run the one axis named, or offer all applicable when the request is unscoped. Before running an action, read its file in actions/, not only the table or assets.

Transversal rules

  • Scope: run the one named axis, or for an unscoped request ask once "all applicable axes, or one?" before running. A request to delete or remove code runs cleanup directly, with no axis question. Never silently default to one axis.
  • Behavior-preserving for cleanup, performance, and architecture: public inputs and outputs stay identical, verified by tests, type checks, or a side-by-side run. Security may alter behavior to close a vulnerability, and must call that out explicitly.
  • Audit-fed, optional: when the caller pushes an audit report (a path under aidd_docs/tasks/audits/ or pasted findings), take its findings for this axis as the fix list and skip the scan. The bridge is the report artifact; this skill never loads or calls another skill. The audit code-quality pillar feeds the cleanup axis; the other axes map by name.
  • Severity uses the shared 3-level scale: 🔴 critical, 🟡 major, 🟢 minor.
  • Stay inside the axis: dependency upgrades and UI redesign are out of scope. Add tests only as a regression for a security fix, never otherwise.

相似的 Skill

rea-analysis-optimization

MOmorluto/rea485k近 7 天新增 9,215 个 star

codebase-design

MAmattpocock/skills336k近 7 天新增 5,004 个 star

精选

diagnosing-bugs

诊断困难 bug 和性能回归,用测试或脚本构建反馈循环定位问题。

MAmattpocock/skills336k近 7 天新增 5,004 个 star

setup-ts-deep-modules

MAmattpocock/skills336k近 7 天新增 5,004 个 star

code-review

MAmattpocock/skills336k近 7 天新增 5,004 个 star

implement

MAmattpocock/skills336k近 7 天新增 5,004 个 star