Token导航 LogoToken导航

Agent Skill · 前端设计

refactoring-workflow(重构工作流程)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

refactoring-workflow 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证为 MIT,第三方扫描有未通过项,按安装量在前端设计类的 10,216 个 Skill 里排第 519。

总安装 20,401周安装 812GitHub Stars 8下载 8,878核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:refactoring-workflow(重构工作流程)
来源仓库:https://github.com/kaakati/rails-enterprise-dev
仓库路径:skills/refactoring-workflow
安装命令:
npx skills add https://github.com/kaakati/rails-enterprise-dev --skill 'Refactoring Workflow'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/kaakati/rails-enterprise-dev --skill 'Refactoring Workflow'

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。适用于 React、Next.js、Vue 等项目的前端重构,包括组件拆分、状态管理优化或样式统一。可生成新组件骨架、审查现有结构并提供 Tailwind/CSS 最佳实践建议。

安装命令:npx skills add https://github.com/kaakati/rails-enterprise-dev --skill 'Refactoring Workflow'。改动前应在本地预览效果,避免仅凭描述产生视觉偏差。

来源仓库内路径:skills/refactoring-workflow

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/kaakati/rails-enterprise-dev --skill 'Refactor…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

refactoring-workflow 怎么安装?

在终端执行 npx skills add https://github.com/kaakati/rails-enterprise-dev --skill 'Refactoring Workfl…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

refactoring-workflow 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

refactoring-workflow 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

refactoring-workflow 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

refactoring-workflow 用的人多吗?

公开数据是累计安装 20,401 次,近一周安装 812 次,下载 8,878 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

refactoring-workflow 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
refactoring-workflow

重构工作流程 · 本页

20,4018调用外部服务MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Refactoring Workflow Skill

Systematic refactoring with tracking, validation, and completeness verification.

Quick Start

# 1. Record what you're refactoring
record_refactoring "Payment" "Transaction" "class_rename"

# 2. Update files, track progress
update_refactoring_progress "Payment" "app/models/transaction.rb"

# 3. Validate no old references remain
validate_refactoring "Payment" "Transaction"

1. Refactoring Log Functions

record_refactoring()

Start refactoring by recording what's being changed:

record_refactoring() {
  local old_name=$1
  local new_name=$2
  local refactor_type=$3  # class_rename, attribute_rename, method_rename, table_rename

  if [ -n "$TASK_ID" ] && command -v bd &> /dev/null; then
    bd comment $TASK_ID "🔄 Refactoring Log: $old_name → $new_name

**Type**: $refactor_type
**Started**: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
**Status**: ⏳ In Progress

### Changes Planned

1. **$(echo $refactor_type | sed 's/_/ /g')**: \`$old_name\` → \`$new_name\`

### Affected Files (Auto-detected)

\`\`\`bash
# Ruby files referencing old name
$(rg --files-with-matches \"\\b$old_name\\b\" --type ruby 2>/dev/null | head -20 || echo "None detected")
\`\`\`

### Validation Checklist

- [ ] No references to \`$old_name\` in Ruby files
- [ ] No references in view templates
- [ ] No references in routes
- [ ] No references in specs
- [ ] No references in factories
- [ ] Migration files checked (if applicable)"
  fi
}

# Examples:
# record_refactoring "Payment" "Transaction" "class_rename"
# record_refactoring "user_id" "account_id" "attribute_rename"
# record_refactoring "payments" "transactions" "table_rename"

update_refactoring_progress()

Track progress as files are updated:

update_refactoring_progress() {
  local old_name=$1
  local file_updated=$2

  if [ -n "$TASK_ID" ] && command -v bd &> /dev/null; then
    bd comment $TASK_ID "✅ Refactoring Progress: Updated \`$file_updated\`

Old references to \`$old_name\` in this file have been updated.

Remaining files: $(rg --files-with-matches \"\\b$old_name\\b\" --type ruby 2>/dev/null | wc -l || echo "?")"
  fi
}

validate_refactoring()

Validate all references have been updated:

validate_refactoring() {
  local old_name=$1
  local new_name=$2

  echo "🔍 Validating refactoring: $old_name → $new_name"

  # Check for remaining references
  local remaining=$(rg --count "\\b$old_name\\b" --type ruby --type erb 2>/dev/null | wc -l)

  if [ "$remaining" -gt 0 ]; then
    echo "❌ Refactoring validation failed"
    echo "Found $remaining files still referencing '$old_name':"
    rg --files-with-matches "\\b$old_name\\b" --type ruby --type erb 2>/dev/null

    if [ -n "$TASK_ID" ] && command -v bd &> /dev/null; then
      bd update $TASK_ID --status blocked
    fi

    return 1
  else
    echo "✅ Refactoring validation passed"
    echo "All references to '$old_name' successfully updated."
    return 0
  fi
}

2. Complete Refactoring Workflow

Workflow Steps

  1. Start: Record refactoring with record_refactoring()
  2. Update: Update files incrementally, track with update_refactoring_progress()
  3. Validate: Before phase completion, run validate_refactoring()
  4. Fix: If validation fails, update remaining references
  5. Re-validate: Run validation again until it passes
  6. Complete: Only close task after validation passes

Example: Class Rename Workflow

# Phase starts: Renaming Payment to Transaction

# Step 1: Record refactoring
record_refactoring "Payment" "Transaction" "class_rename"

# Step 2: Update model file
mv app/models/payment.rb app/models/transaction.rb
# Update class name in file
sed -i 's/class Payment/class Transaction/g' app/models/transaction.rb
update_refactoring_progress "Payment" "app/models/transaction.rb"

# Step 3: Update associations in other models
# ... update files ...
update_refactoring_progress "Payment" "app/models/account.rb"

# Step 4: Update controller
mv app/controllers/payments_controller.rb app/controllers/transactions_controller.rb
# ... update class name and references ...
update_refactoring_progress "Payment" "app/controllers/transactions_controller.rb"

# Step 5: Update views, specs, factories, routes
# ... update all remaining files ...

# Step 6: Validate completeness
validate_refactoring "Payment" "Transaction"

if [ $? -eq 0 ]; then
  echo "✅ Refactoring complete"
else
  echo "❌ Refactoring incomplete, fix remaining references"
fi

3. Cross-Layer Impact Checklists

Class Rename Checklist

When renaming Payment → Transaction:

Ruby Layer:

  • Model class definition
  • Associations in other models (has_many:payments)
  • Controller class name
  • Controller instance variables (@payment)
  • Service class references
  • Job class references
  • Serializer references
  • String references (polymorphic: "Payment")

View Layer:

  • View template paths (app/views/payments/)
  • View helpers and form objects
  • Partials and layouts

Routes:

  • Route resources (resources:payments)
  • Named routes and path helpers

Tests:

  • Spec describe blocks
  • Factory definitions (:payment, :payments)
  • Fixtures (if used)

JavaScript/Frontend:

  • Stimulus controllers (payment_controller.js)
  • Stimulus class names (PaymentController)
  • data-controller attributes (data-controller="payment")
  • data-action attributes (data-action="payment#submit")
  • JavaScript imports and references
  • Event names (payment:updated)
  • Turbo frame IDs (#payment-form)
  • Importmap pins

I18n:

  • Locale keys (activerecord.models.payment)

Configuration:

  • Initializer references
  • Environment configs

Attribute Rename Checklist

When renaming user_id → account_id:

Database:

  • Migration (column rename)
  • Run migration: rails db:migrate
  • Verify in schema.rb

Model:

  • Attribute references
  • Validations
  • Associations (:foreign_key option)
  • Scopes and queries

Controller:

  • Strong params

Views:

  • Form fields
  • Display references

Tests:

  • Spec let statements
  • Factory attributes

API:

  • Serializer attributes
  • API documentation

JavaScript:

  • data-{controller}-{attr}-value attributes
  • Stimulus value definitions

I18n:

  • Attribute keys (activerecord.attributes.model.user_id)

Table Rename Checklist

When renaming payments → transactions:

  • Migration (table rename)
  • Run migration: rails db:migrate
  • Verify in schema.rb
  • Model table_name declaration (if explicit)
  • Foreign key constraints
  • Indexes
  • Raw SQL queries
  • Database views (if any)

JavaScript/Stimulus Refactoring Checklist

When renaming payment → transaction in frontend:

  • Controller file rename (payment_controller.js → transaction_controller.js)
  • Controller class name (PaymentController → TransactionController)
  • data-controller attributes in views
  • data-{controller}-target attributes
  • data-action attributes
  • JavaScript imports
  • Event names and dispatching
  • CSS class names that reference the controller
  • Turbo frame IDs
  • Importmap pins

Namespace/Module Move Checklist

When moving Services::Payment → Billing::Transaction:

  • File path (app/services/payment.rb → app/billing/transaction.rb)
  • Module/namespace declaration
  • All references to the old namespace
  • Autoload paths (if custom)
  • Spec file path
  • Factory namespace
  • Route namespace (if applicable)

4. Intentional Legacy References

Create .refactorignore to exclude files from validation:

# .refactorignore - Files to exclude from refactoring validation

# Legacy compatibility layer
lib/legacy_api_adapter.rb

# Historical documentation
CHANGELOG.md
docs/migration_guide.md

# Rename migrations (reference old names by design)
db/migrate/*_rename_*.rb

# External API contracts (can't change)
app/serializers/api/v1/*_serializer.rb

5. Integration with Beads

Refactoring workflow integrates with beads for:

  1. Task Tracking: Creates comments for start, progress, completion
  2. Status Updates: Sets task to blocked if validation fails
  3. Audit Trail: Full history of what was changed and when
# Set TASK_ID before starting refactoring
export TASK_ID="PROJ-123"

# All functions will automatically log to beads
record_refactoring "Payment" "Transaction" "class_rename"
update_refactoring_progress "Payment" "app/models/transaction.rb"
validate_refactoring "Payment" "Transaction"

6. Quick Reference

FunctionPurposeExample
record_refactoringStart trackingrecord_refactoring "Old" "New" "class_rename"
update_refactoring_progressTrack file updateupdate_refactoring_progress "Old" "path/file.rb"
validate_refactoringCheck completenessvalidate_refactoring "Old" "New"
Refactor TypeKey Layers to Check
class_renameModel, Controller, Views, Routes, Specs, JS
attribute_renameModel, Controller params, Views, Specs, JS values
table_renameMigration, Schema, Raw SQL
method_renameAll call sites, Specs
namespace_moveFile paths, Autoloading, All references

平台分布

Claude Code

27.37%
按下载量换算2,430

windsurf

23.25%
按下载量换算2,064

OpenCode

17.42%
按下载量换算1,547

Codex

10.79%
按下载量换算958

Antigravity

6.65%
按下载量换算590

Gemini CLI

2.98%
按下载量换算265

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills