fec-refactoring SKILL.md skillA
fec-refactoring from bovinphang/frontend-craft is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add bovinphang/frontend-craft/fec-refactoring@git:20260901.387d97aPins git:20260901.387d97a in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- bovinphang/frontend-craft
- Path
localized/zh-CN/skills/fec-refactoring/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260901.387d97a, committed Sep 1, 2026
- Size
- 4,521 bytes
- Repository stars
- 22
- License
- MIT
用于在不改变可观察行为的前提下重组既有前端代码,包括职责提炼、模块搬移、条件逻辑简化、API 整理和数据组织。不要用于新增功能、改变行为的缺陷修复、依赖或框架迁移,以及已经证实的死代码清理。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 技能:保持行为的重构 ## 用途 以小步、可验证、可回滚的方式重组仍在使用的前端代码,同时保持用户、调用方、测试、路由和集成能够观察到的行为不变。 ## 核心契约 每次执行都遵守以下规则: 1. **行为保持**:纯重构只改变内部结构,不主动改变可观察行为。 2. **修改前基线**:编辑前先记录当前可用验证结果。 3. **一次只做一个主要重构**:每一步只有一个主要结构意图。 4. **每一步都验证**:完成一步后立即运行最小但有效的验证。 5. **先回滚当前步骤,再讨论修复**:若当前步骤引入回归,先恢复到上一步,再缩小或重排方案。 6. **重构与功能修改分离**:新增行为或改变行为的缺陷修复不属于纯重构。 7. **优先最小安全重构**:有局部、可逆方案时,不直接扩大为架构重写。 8. **遵守差异预算**:实际修改范围明显超出计划时必须停止并重新评估。 纯重构采用 **GREEN → REFACTOR → GREEN**,不为了形式上的 TDD 人为制造失败行为测试。 ## 流程 1. 分类请求,确认目标是结构调整且要求行为保持。 2. 读取项目配置、受影响模块、公开导出、路由、状态边界、测试和当前 diff。 3. 记录相关可观察契约:输入、输出、异常、副作用、UI 状态、事件、网络请求、状态迁移、路由和公开 API。 4. 建立修改前基线;既有失败要单独记录,不能算到后续重构头上。 5. 基于证据诊断结构问题,并检查可能的误判。 6. 建立安全网:优先复用已有测试,风险较高且覆盖不足时再补当前行为的特征测试。 7. 把方案拆成有顺序的小步,每步记录手法、原因、前置条件、风险、差异预算、验证和回滚边界。 8. 每次只执行一个主要结构变换,不夹带无关清理、格式化和重新设计。 9. 立即验证,并比较实际修改范围与差异预算。 10. 若出现新回归,先回滚当前步骤,确认基线恢复,再缩小或调整顺序。 11. 最后按需要运行类型检查、测试、构建、E2E、无障碍或其他专项门禁。 12. 根据证据给出 PASS、PARTIAL 或 NOT PROVEN,不夸大验证强度。 ## 风险分级 | 风险 | 常见范围 | 默认动作 | | --- | --- | --- | | `SAFE` | 局部私有代码、契约稳定、容易回滚 | 可执行,并逐步验证 | | `CAUTION` | 跨模块、共享状态、导入、Hook/Composable、生命周期 | 安全证据充分时执行,否则先规划 | | `DANGER` | 公开 API、路由、持久化、网络契约、认证、SSR/水合、大范围状态或继承改造 | 默认先规划并停止等待明确授权 | 风险由上下文决定,不能只凭手法名称判定安全级别。 ## 差异预算 每个可执行步骤先写清: ```text …
Read the whole file at its exact version.
How to install
mdr add bovinphang/frontend-craft/fec-refactoring@sha256:1c7bf92a42ce14aeThe line at the top of this page pins the label git:20260901.387d97a, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_6g37wkvr5upxz562)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Sep 1, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (4521 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
bovinphang/frontend-craft · 22 stars · license MIT · pushed 2026-09-26 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_6g37wkvr5upxz562 GET https://markdownregistry.com/api/v1/resolve?ref=bovinphang/frontend-craft/fec-refactoring GET https://markdownregistry.com/api/v1/blob/1c7bf92a42ce14aebbeeb3f67fb9a0961d935af3da6a82c3c95cd4d223f2d0eb
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from bovinphang/frontend-craft
Every file in bovinphang/frontend-craft