Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

frontend-ai-guide前端 AI 指南

Agent Skill

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

总安装

799

周安装

32

GitHub Stars

323

下载量

259
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/shinpr/claude-code-workflows --skill frontend-ai-guide

简介

frontend-ai-guide 辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免生成孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。
  • 暂无额外注意事项,建议参考来源仓库获取最新使用说明。

SKILL.md

AI Developer Guide - Technical Decision Criteria and Anti-pattern Collection (Frontend)

Technical Anti-patterns (Red Flag Patterns)

Immediately stop and reconsider design when detecting the following patterns:

Code Quality Anti-patterns

  1. Writing similar code 3 or more times - Violates Rule of Three
  2. Multiple responsibilities mixed in a single component - Violates Single Responsibility Principle (SRP)
  3. Defining same content in multiple components - Violates DRY principle
  4. Making changes without checking dependencies - Potential for unexpected impacts
  5. Disabling code with comments - Should use version control
  6. Error suppression - Hiding problems creates technical debt
  7. Excessive use of type assertions (as) - Abandoning type safety
  8. Prop drilling through 3+ levels - Should use Context API or state management
  9. Massive components (300+ lines) - Split into smaller components

Design Anti-patterns

  • "Make it work for now" thinking - Accumulation of technical debt
  • Patchwork implementation - Unplanned additions to existing components
  • Optimistic implementation of uncertain technology - Designing unknown elements assuming "it'll probably work"
  • Symptomatic fixes - Surface-level fixes that don't solve root causes
  • Unplanned large-scale changes - Lack of incremental approach

Fallback Design Principles

Core Principle: Fail-Fast

Design philosophy that prioritizes improving primary code reliability over fallback implementations.

Criteria for Fallback Implementation

  • Fallback rule: Implement fallbacks only when explicitly defined in Design Doc
  • Layer Responsibilities:

- Component Layer: Use Error Boundary for error handling - Hook Layer: Implement decisions based on business requirements

Detection of Excessive Fallbacks

  • Require design review when writing the 3rd catch statement in the same feature
  • Verify Design Doc definition before implementing fallbacks
  • Properly log errors and make failures explicit

Rule of Three - Criteria for Code Duplication

How to handle duplicate code based on Martin Fowler's "Refactoring":

Duplication CountActionReason
1st timeInline implementationCannot predict future changes
2nd timeConsider future consolidationPattern beginning to emerge
3rd timeImplement commonalizationPattern established

Criteria for Commonalization

Cases for Commonalization

  • Business logic duplication
  • Complex processing algorithms
  • Component patterns (form fields, cards, etc.)
  • Custom hooks
  • Validation rules

Cases to Avoid Commonalization

  • Accidental matches (coincidentally same code)
  • Possibility of evolving in different directions
  • Significant readability decrease from commonalization
  • Simple helpers in test code

Implementation Example

// Immediate commonalization on 1st duplication
function UserEmailInput() { /* ... */ }
function ContactEmailInput() { /* ... */ }

// Commonalize on 3rd occurrence
function EmailInput({ context }: { context: 'user' | 'contact' | 'admin' }) { /* ... */ }

Common Failure Patterns and Avoidance Methods

Pattern 1: Error Fix Chain

Symptom: Fixing one error causes new errors Cause: Surface-level fixes without understanding root cause Avoidance: Identify root cause with 5 Whys before fixing

Pattern 2: Abandoning Type Safety

Symptom: Excessive use of any type or as Cause: Impulse to avoid type errors Avoidance: Handle safely with unknown type and type guards

Pattern 3: Implementation Without Sufficient Testing

Symptom: Many bugs after implementation Cause: Ignoring Red-Green-Refactor process Avoidance: Always start with failing tests

Pattern 4: Ignoring Technical Uncertainty

Symptom: Frequent unexpected errors when introducing new technology Cause: Assuming "it should work according to official documentation" without prior investigation Avoidance:

  • Record certainty evaluation at the beginning of task files Certainty: low (Reason: new experimental feature with limited production examples) Exploratory implementation: true Fallback: use established patterns
  • For low certainty cases, create minimal verification code first

Pattern 5: Insufficient Existing Code Investigation

Symptom: Duplicate implementations, architecture inconsistency, integration failures Cause: Insufficient understanding of existing code before implementation Avoidance Methods:

  • Before implementation, always search for similar functionality (using domain, responsibility, component patterns as keywords)
  • Similar functionality found → Use that implementation (do not create new implementation)
  • Similar functionality is technical debt → Create ADR improvement proposal before implementation
  • No similar functionality exists → Implement new functionality following existing design philosophy
  • Record all decisions and rationale in "Existing Codebase Analysis" section of Design Doc

Debugging Techniques

1. Error Analysis Procedure

  1. Read error message (first line) accurately
  2. Focus on first and last of stack trace
  3. Identify first line where your code appears
  4. Check React DevTools for component hierarchy

2. 5 Whys - Root Cause Analysis

Symptom: Component not rendering
Why1: Props are undefined → Why2: Parent component didn't pass props
Why3: Parent using old prop names → Why4: Component interface was updated
Why5: No update to parent after refactoring
Root cause: Incomplete refactoring, missing call-site updates

3. Minimal Reproduction Code

To isolate problems, attempt reproduction with minimal code:

  • Remove unrelated components
  • Replace API calls with mocks
  • Create minimal configuration that reproduces problem
  • Use React DevTools to inspect component tree

4. Debug Log Output

console.log('DEBUG:', {
  context: 'user-form-submission',
  props: { email, name },
  state: currentState,
  timestamp: new Date().toISOString()
})

Quality Check Workflow

Use the appropriate run command based on the packageManager field in package.json.

Build Commands

  • dev - Development server
  • build - Production build
  • preview - Preview production build
  • type-check - Type check (no emit)

Quality Check Phases

Phase 1-3: Basic Checks

  • check - Biome (lint + format)
  • build - TypeScript build

Phase 4-5: Tests and Final Confirmation

  • test - Test execution
  • test:coverage:fresh - Coverage measurement (fresh cache)
  • check:all - Overall integrated check

Auxiliary Commands

  • test:coverage - Run tests with coverage
  • test:safe - Safe test execution (with auto cleanup)
  • cleanup:processes - Cleanup Vitest processes
  • format - Format fixes
  • lint:fix - Lint fixes
  • open coverage/index.html - Check coverage report

Troubleshooting

  • Port in use error: Run cleanup:processes script
  • Cache issues: Run test:coverage:fresh script
  • Dependency errors: Clean reinstall dependencies
  • Vite preview not starting: Check port 4173 availability

Situations Requiring Technical Decisions

Timing of Abstraction

  • Extract patterns after writing concrete implementation 3 times
  • Be conscious of YAGNI, implement only currently needed features
  • Prioritize current simplicity over future extensibility

Performance vs Readability

  • Prioritize readability unless React DevTools Profiler identifies a measurable bottleneck (e.g., render time exceeding 16ms, unnecessary re-renders)
  • Measure before optimizing with React DevTools Profiler
  • Document reason with comments when optimizing

Granularity of Component/Type Definitions

  • Overly detailed components/types reduce maintainability
  • Design components that appropriately express UI patterns
  • Use composition over inheritance

Implementation Completeness Assurance

Required Procedure for Impact Analysis

Completion Criteria: Complete all 3 stages

1. Discovery

Grep -n "ComponentName\|hookName" -o content
Grep -n "importedFunction" -o content
Grep -n "propsType\|StateType" -o content

2. Understanding

Mandatory: Read all discovered files and include necessary parts in context:

  • Caller's purpose and context
  • Component hierarchy
  • Data flow: Props → State → Event handlers → Callbacks

3. Identification

Structured impact report (mandatory):

## Impact Analysis
### Direct Impact: ComponentA, ComponentB (with reasons)
### Indirect Impact: FeatureX, PageY (with integration paths)
### Processing Flow: Props → Render → Events → Callbacks

Important: Execute all 3 stages to completion

Unused Code Deletion Rule

When unused code is detected → Will it be used?

  • Yes → Implement immediately (no deferral allowed)
  • No → Delete immediately (remains in Git history)

Target: Components, hooks, utilities, documentation, configuration files

Existing Code Deletion Decision Flow

In use? No → Delete immediately (remains in Git history)
       Yes → Working? No → Delete + Reimplement
                     Yes → Fix

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.47%
按下载量换算94

Claude

33.42%
按下载量换算87

Cursor

18.24%
按下载量换算47

Gemini CLI

9.4%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills