360 Secure SkillHub
360 安全技能中心

Refactoring Data

面向前端的数据重构技能,依据参考选择变量含义、字段命名、派生状态或引用/值身份等行为保持变换;强调前置条件、差异预算、单步应用与即时验证,并给出 JavaScript/TypeScript、React/Vue 适配提示;存在缺失引用 reference/value。

bovinphang
bovinphang
热度 7.65
最近更新 2026-09-27 11:34:58
分类:开发依赖:纯提示词应用场景:代码生成

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add fec-refactoring-data
Metadata
name
fec-refactoring-data
description
Use when behavior-preserving frontend refactoring focuses on variable meaning, field naming, derived state, or reference/value identity, and the selected technique needs family-specific mechanics, risks, and JavaScript/TypeScript/React/Vue adaptation.

Data 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 Data 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 5 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.