360 Secure SkillHub
360 安全技能中心

Refactoring Api

面向前端行为保持重构的指导型 Skill,聚焦函数 API 形状、标志、依赖、可变性与构造等议题;要求先在参考文件中确认技术及前置条件,再以最小步骤应用并逐次验证,附 10 项技术与 JavaScript/TypeScript、React/Vue 适配说明。

分类:开发
bovinphang
bovinphang
热度 8.75
最近更新 2026-09-26 23:17:52

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add bovinphang/fec-refactoring-api
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
fec-refactoring-api
description
Use when behavior-preserving frontend refactoring focuses on function API shape, flags, dependencies, mutability, construction, or command/function trade-offs, and the selected technique needs family-specific mechanics, risks, and JavaScript/TypeScript/React/Vue adaptation.

API 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 API 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 10 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.