Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计提醒

ln-721-frontend-restructureln 721 前端重构

Agent Skill

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

总安装

6,536

周安装

267

GitHub Stars

437

下载量

2,115
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:ln-721-frontend-restructure(ln 721 前端重构)
来源仓库:https://github.com/levnikolaevich/claude-code-skills
仓库路径:skills/ln-721-frontend-restructure
安装命令:
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-721-frontend-restructure
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-721-frontend-restructure

简介

用于辅助前端页面、组件和样式开发。ln-721-frontend-restructure 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

  • 适合生成 React、Vue 或 Next.js 相关代码并整理组件结构。
  • 使用时需结合项目现有设计系统和路由方式,避免生成孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。
  • 建议优先复用项目已有样式和组件规范。

SKILL.md

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.

ln-721-frontend-restructure

Type: L3 Worker Category: 7XX Project Bootstrap

Frontend structure worker with two modes: SCAFFOLD (generate minimal React project from template) or RESTRUCTURE (migrate monolith to component-based architecture).


Mode Selection

ModeWhenInputOutput
SCAFFOLDCREATE pipeline — no existing frontendTarget stack config from ln-720Minimal React + Vite project (~7 files)
RESTRUCTURETRANSFORM pipeline — existing frontend foundMonolithic React sourceComponent-based architecture

Purpose & Scope

AspectDescription
InputTarget stack config (SCAFFOLD) or monolithic React source (RESTRUCTURE)
OutputMinimal project (SCAFFOLD) or component-based architecture (RESTRUCTURE)
FrameworkReact + TypeScript + Vite

Scope boundaries:

  • SCAFFOLD: generates minimal starter files, no business logic
  • RESTRUCTURE: restructures existing code, does not add new functionality
  • Works with React + TypeScript projects
  • Applies transformation rules from reference files

Workflow

SCAFFOLD Mode (CREATE pipeline)

PhaseNameActionsOutput
S1GenerateCreate minimal React + Vite + TypeScript project files~7 starter files
S2VerifyCheck file structure, validate configsValid project skeleton

RESTRUCTURE Mode (TRANSFORM pipeline)

PhaseNameActionsOutput
1AnalyzeScan source, detect component types, measure complexityFile inventory, complexity metrics
2PlanApply split thresholds, calculate file moves, detect conflictsMigration plan
3ExecuteCreate folders, extract content, update importsRestructured files
4VerifyRun build, check imports, validate structureBuild success report

SCAFFOLD Mode Phases

Phase S1: Generate Starter Files

Create minimal React + Vite + TypeScript project.

FilePurpose
package.jsonDependencies: react, react-dom, typescript, vite, @vitejs/plugin-react
vite.config.tsVite config with React plugin, port, proxy settings
tsconfig.jsonStrict TypeScript config with path aliases
index.htmlEntry HTML with root div
src/main.tsxReact entry point with StrictMode
src/App.tsxRoot App component with router placeholder
src/index.cssBase styles (reset, variables, layout)

Phase S2: Verify Scaffold

CheckMethodExpected
All files createdFile existence check7 files present
package.json validJSON parseNo syntax errors
tsconfig.json validJSON parseNo syntax errors
No hardcoded valuesContent scanProject name from config, not hardcoded

RESTRUCTURE Mode Phases

Phase 1: Analyze

Scan current frontend structure and classify components.

StepActionReference
1.1Scan all .tsx and .ts files in source
1.2Measure file complexity (lines, hooks, types)transformation_rules.md
1.3Classify components by categorycomponent_patterns.md
1.4Build import dependency graphimport_strategy.md

Output: Component inventory with classifications and metrics.


Phase 2: Plan

Generate migration plan based on analysis.

StepActionReference
2.1Apply split thresholds to identify files to restructuretransformation_rules.md
2.2Calculate target paths for each filereact_folder_structure.md
2.3Identify import updates neededimport_strategy.md
2.4Detect potential conflicts (name collisions, circular deps)

Output: Migration plan with Before/After mapping.


Phase 3: Execute

Apply transformations in correct order.

StepActionNotes
3.1Create directory structureAll target folders
3.2Extract types to types.tsTypes have no dependencies
3.3Extract constants to constants.tsConstants depend only on types
3.4Extract hooks to hooks.tsHooks depend on types, constants
3.5Extract sub-componentsComponents use all above
3.6Create barrel exports (index.ts)For clean imports
3.7Update all import pathsFix references

Order is critical: Execute in sequence to avoid broken imports.


Phase 4: Verify

Validate restructured project.

CheckCommandExpected
TypeScript compilationnpx tsc --noEmitNo errors
Buildnpm run buildSuccess
No orphan filesManual checkSource location empty
Imports resolveBuild successNo module not found errors

Transformation Summary

TransformationBefore StateAfter State
Component SplitSingle file >300 linesFeature folder with co-located files
Type ExtractionInline interfacesSeparate types.ts
Constant ExtractionInline magic valuesSeparate constants.ts
Hook ExtractionInline useState/useEffectSeparate hooks.ts or shared hooks
UI Component MoveScattered in featuresCentralized in components/ui/
Layout Component MoveMixed with featuresCentralized in components/layout/

Critical Rules

  • Mode Awareness: SCAFFOLD creates from template; RESTRUCTURE transforms existing — never mix
  • Single Responsibility: Handle only frontend structure, no backend changes
  • Idempotent: Can re-run without duplicate files or corruption
  • Build Verification: Must verify build passes after changes (RESTRUCTURE: npm run build)
  • Preserve Functionality: No behavioral changes, only structural (RESTRUCTURE mode)
  • Backup Strategy: Do not delete source files until verification passes (RESTRUCTURE mode)
  • Import Consistency: Use path aliases for shared, relative for co-located

Definition of Done

SCAFFOLD mode:

  • All 7 starter files generated
  • package.json and tsconfig.json valid
  • No hardcoded project names (uses config values)

RESTRUCTURE mode:

  • All source files analyzed and classified
  • Migration plan generated with Before/After mapping
  • Directory structure created per template
  • All extractions completed (types, constants, hooks, components)
  • Import paths updated throughout project
  • npm run build passes successfully
  • No orphan imports or missing files
  • Barrel exports created for shared folders

Risk Mitigation

RiskDetectionMitigation
Build failure after restructurenpm run build failsRollback: restore from source, investigate specific error
Missing importsModule not found errorsScan all imports before/after, update missed paths
Circular dependenciesBuild warning or runtime errorAnalyze dependency graph, break cycles by extracting shared code
Lost functionalityTests fail or UI brokenRun existing tests before/after transformation
Name collisionsDuplicate export namesRename with feature prefix before moving

Reference Files

FilePurpose
references/transformation_rules.mdSplit thresholds, extraction rules, transformation order
references/component_patterns.mdComponent classification by category
references/import_strategy.mdImport update rules, path aliases, barrel exports
references/react_folder_structure.mdTarget directory structure template

Version: 3.0.0 Last Updated: 2026-02-07

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.58%
按下载量换算604

Gemini CLI

22.58%
按下载量换算478

Codex

18.31%
按下载量换算387

OpenCode

12.87%
按下载量换算272

Antigravity

8.36%
按下载量换算177

windsurf

3.71%
按下载量换算78

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills