360 Secure SkillHub
360 安全技能中心

Refactoring Move Features

用于前端保行为重构,聚焦特性/数据归属、语句位置、循环与死代码等结构变换。内置9种标准技法及前置条件、机制、风险与 JS/TS/React/Vue 适配说明。典型场景:安全移动特性、调整归属、拆分结构并逐步验证。输入为重构目标与代码证据,输出为最小步变换、检查点与风险提示;适合需要可控、可验证前端重构时使用。

bovinphang
bovinphang
热度 7.62
最近更新 2026-09-27 11:38:23
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / 代码审查

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add fec-refactoring-move-features
Metadata
name
fec-refactoring-move-features
description
Use when behavior-preserving frontend refactoring focuses on behavior/data ownership, statement placement, loops, or dead-code knowledge, and the selected technique needs family-specific mechanics, risks, and JavaScript/TypeScript/React/Vue adaptation.

Moving Feature Refactorings

Overview

Use this family after evidence identifies a fitting structural transformation. Apply one primary technique at a time and verify immediately.

Procedure

  1. Confirm the selected technique and its preconditions in Moving Feature Refactorings.
  2. Record affected behavior and a diff budget.
  3. Apply only the selected technique's smallest viable step.
  4. Verify the step before composing another transformation.
  5. Stop and reassess when public contracts, lifecycle, state identity, or actual scope exceed expectations.

Quick Reference

The family reference contains 9 canonical techniques with intent, signals, avoid conditions, mechanics, preservation checkpoints, smell links, composition hints, JavaScript/TypeScript notes, React/Vue notes, adaptation guidance, and original frontend examples.

Common Mistakes

  • Choosing a technique by name without checking its preconditions.
  • Combining several structural intentions in one diff.
  • Assuming a classical class-based form is mandatory in modern frontend code.
  • Treating passing tests as proof when the relevant behavior is not covered.