Skip to content
cccskills
FreePublished on GitHub

fec-refactoring-validation

用于证明前端重构保持了既有行为、选择合适的安全网、逐步验证结构修改,或依据证据给出 PASS、PARTIAL、NOT PROVEN 的行为保持结论。

The English summary is being prepared. Showing the original description.

See how to install

Files included (3)

  • SKILL.md2.3 KB
  • references/behavior-preservation.md889 B
  • references/refactoring-test-checklist.md1.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

技能:重构验证

用途

定义可观察行为契约,并为每个结构步骤选择足够且不过度的验证证据。

流程

  1. 在重要编辑前记录相关行为契约。
  2. 将安全网分为 A、B、C 三个等级。
  3. 运行并记录修改前基线。
  4. 根据当前步骤的风险和边界选择验证方式。
  5. 每个结构步骤后立即运行最小有效检查。
  6. 新增失败出现时先回滚当前步骤,再扩大排查。
  7. 最后运行与影响面匹配的更广门禁。
  8. 只按证据给出 PASS、PARTIAL 或 NOT PROVEN。

纯结构重构使用 GREEN → REFACTOR → GREEN。

安全网等级

等级证据执行建议
A — 强既有测试直接覆盖相关行为直接作为主要安全网
B — 部分重要行为覆盖不完整高风险步骤前补当前行为的特征测试
C — 无没有有效自动化覆盖不自动安装框架;CAUTION/DANGER 默认只规划,除非已授权补最小安全网

前端行为契约清单

按实际范围检查:函数输入输出、异常和错误映射;DOM、可见状态、焦点、键盘和无障碍语义;props、emits、slots、Hook/Composable 返回值和事件顺序;请求、载荷、取消、重试、缓存键和加载/错误状态;store、持久化、对象身份、memoization、响应式和生命周期;路由、URL、guard、包导出、序列化字段和后端 DTO。

参考资料

约束

  • 无关测试通过不能证明行为保持。
  • 只在修改后新增并通过的测试,证据弱于可比较的修改前基线。
  • 不因为重构改变了行为就改测试期望值。
  • 证据不足时不能用 PASS 掩盖缺口。
  • 未经明确授权不安装新的测试框架。

预期输出

输出行为契约、基线状态、安全网等级、逐步验证、最终门禁、覆盖缺口,以及 PASS、PARTIAL 或 NOT PROVEN 结论。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

用于审查或改进前端无障碍、语义结构、键盘支持、焦点管理、ARIA 标签、屏幕阅读器行为、WCAG 2.2 问题、触控无障碍或辅助技术回归;中文触发词包括 无障碍、accessibility、a11y、WCAG、屏幕阅读器。

The English summary is being prepared. Showing the original description.

bovinphang/frontend-craft22Updated Sep 26, 2026

Use when reviewing or improving frontend accessibility, semantic structure, keyboard support, focus management, ARIA labels, screen reader behavior, WCAG 2.2 issues, touch accessibility, or assistive-technology regressions; Chinese triggers include accessibility, accessibility, a11y, WCAG, screen reader.

The English summary is being prepared. Showing the original description.

bovinphang/frontend-craft22Updated Sep 26, 2026

Use when absorbing ideas, capabilities, workflows, architecture, quality systems, ecosystem extensions, or engineering practices from any reference system into the current project through original, project-native redesign rather than copying.

The English summary is being prepared. Showing the original description.

bovinphang/frontend-craft22Updated Sep 26, 2026

用于从参考系统中吸收想法、能力、工作流、架构、质量体系、生态扩展或工程实践,并通过原创的项目内重设计转化为当前项目能力,而不是复制原实现。

The English summary is being prepared. Showing the original description.

bovinphang/frontend-craft22Updated Sep 26, 2026

Use when designing, implementing, or reviewing frontend-to-backend API integration, typed API clients, REST/tRPC/OpenAPI client choices, auth refresh, API error mapping, upload flows, SSE/WebSocket/polling choices, CORS-facing frontend behavior, or cross-boundary loading/error states. Do not use for backend-only service architecture or TanStack Query cache policy alone; Chinese triggers include API integration, front-end and back-end joint debugging, typed API client, Interface error handling, SSE, WebSocket.

The English summary is being prepared. Showing the original description.

bovinphang/frontend-craft22Updated Sep 26, 2026

用于设计、实现或审查前后端 API 集成、类型化 API client、REST/tRPC/OpenAPI 客户端选型、认证刷新、API 错误映射、上传流程、SSE/WebSocket/轮询选择、CORS 相关前端行为或跨边界 loading/error 状态。不要用于纯后端服务架构或仅 TanStack Query 缓存策略;中文触发词包括 API 集成、前后端联调、typed API client、接口错误处理、SSE、WebSocket。

The English summary is being prepared. Showing the original description.

bovinphang/frontend-craft22Updated Sep 26, 2026

See all skills by bovinphang

Report a problem with this skill