mobile-agent: Skill for Windsurf

.windsurf/skills/frontend-component-design/SKILL.md

frontend-component-design is a skill for Windsurf from congwa/mobile-agent. It costs 95 tokens per session (997 once invoked), scanned A, original, Apache-2.0.

Frontend design guidelines for building React or Next.js components and pages. They explain how to split code, reuse components, organize folders, and keep configuration separate.

In plain words
What is it for?
Use them when creating, changing, or refactoring frontend components, pages, hooks, forms, themes, or shared configuration.
Why use it?
They reduce duplicated, oversized, and hard-to-maintain frontend code by giving developers consistent design rules.

Skill for Windsurf

Written for Windsurf: installed under .windsurf/.

This is congwa/mobile-agent's own configuration. It tells Windsurf how to work on mobile-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mobile-agent configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { Button } from "../../components/ui/button";.

Reuse

Borrowing it

Nothing to install: this file belongs to congwa/mobile-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/congwa/mobile-agent/master/.windsurf/skills/frontend-component-design/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/congwa/mobile-agent

Made for: Windsurf.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for frontend-component-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/congwa/mobile-agent/frontend-component-design/github.svg)](https://agentmods.dev/skills/congwa/mobile-agent/frontend-component-design)
Your own site
<a href="https://agentmods.dev/skills/congwa/mobile-agent/frontend-component-design"><img src="https://agentmods.dev/badge/skills/congwa/mobile-agent/frontend-component-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-component-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/congwa/mobile-agent/frontend-component-design"><img src="https://agentmods.dev/badge/skills/congwa/mobile-agent/frontend-component-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 997 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.00997
Opus 5.5 $0.00038 $0.00399
Sonnet 5.5 $0.00019 $0.00199
Haiku 4.5 $0.00010 $0.00100

Measured 1mo ago against content hash 9bc63b7f066f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-component-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.windsurf/skills/frontend-component-design/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

前端组件设计规范

确保前端代码的复用性、封装性和可维护性。

核心原则

1. 单一职责原则

  • 每个文件只包含一个组件
  • 每个组件只负责一个业务功能
  • 组件代码不超过 500 行,超过则拆分

2. 组件拆分规则

# 拆分时机判断
if 组件 > 500 行:
    拆分为子组件
if 相同代码出现 >= 2 次:
    抽取为公共组件
if 业务逻辑复杂:
    抽取为 hooks
if 配置数据多:
    抽取为配置文件

3. 目录结构规范

frontend/
├── components/           # 公共组件
│   ├── ui/              # shadcn 基础组件
│   └── admin/           # 业务公共组件
├── app/                 # 页面
│   └── admin/
│       └── [feature]/
│           ├── page.tsx         # 主页面(协调逻辑)
│           └── components/      # 页面私有组件(可选)
├── lib/
│   ├── api/             # API 请求函数
│   ├── config/          # 配置和映射
│   └── hooks/           # 公共 hooks
├── hooks/               # 全局 hooks
└── types/               # 类型定义

4. 配置外置原则

将以下内容抽取到 lib/config/ 目录:

  • 标签映射 → labels.ts (英文→中文)
  • 枚举常量 → constants.ts
  • 表单配置 → forms.ts
  • 主题配置 → theme.ts

示例:

// lib/config/labels.ts
export const MIDDLEWARE_LABELS = {
  MemoryOrchestration: { label: "记忆编排", desc: "..." },
  // ...
};
export function getMiddlewareLabel(name: string) {
  return MIDDLEWARE_LABELS[name] || { label: name, desc: "" };
}

5. Hooks 抽取规则

抽取为 hook 的时机:

  • 状态逻辑复杂(>5 个 useState)
  • 数据获取逻辑
  • 副作用逻辑复杂
  • 相同逻辑在多处使用

命名规范:use[业务名][动作]

// lib/hooks/use-agents.ts
export function useAgentDetail({ agentId }: { agentId: string }) {
  const [agent, setAgent] = useState<Agent | null>(null);
  // ...
  return { agent, isLoading, error, refresh };
}

6. 导入路径规范

始终使用 @/ 别名,避免相对路径:

// ✅ 正确
import { Button } from "@/components/ui/button";
import { getAgentEffectiveConfig } from "@/lib/api/agents";

// ❌ 错误
import { Button } from "../../components/ui/button";

编码前规划清单

编写前端代码前,必须回答:

  1. 组件边界:这个组件的职责是什么?是否单一?
  2. 复用性:是否有已存在的类似组件可复用?
  3. 配置外置:是否有硬编码的中文/配置需要抽取?
  4. 文件大小:预估代码行数,是否需要拆分?
  5. 命名规范:组件/文件命名是否清晰表达业务含义?

代码审查要点

完成编码后,检查:

  • 单文件不超过 500 行
  • 无重复代码(相同代码不超过 2 处)
  • 所有中文标签来自配置文件
  • 使用 @/ 路径别名
  • 组件职责单一
  • 复杂逻辑已抽取为 hooks

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 121 lines · 95 tokens per session scan A 9bc63b7f066f

Subscribe to this mod's changes

frontend-component-design is a skill published in the GitHub repository congwa/mobile-agent (51 stars, last pushed 8mo ago), licensed Apache-2.0. It adds 95 tokens to every session and 997 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

material-ui-tailwind

Integrates Material UI with Tailwind CSS v4 using cascade layers (enableCssLayer, @layer order) and documents Tailwind v3 interoperability (preflight, important, injectFirst, portals). Use when combining MUI with Tailwind utilities, slotProps className, or theme token bridges.

mui/material-ui · 67 tokens

fuzzy-ranking

Rank fuzzy matches with rankItem, filter with RankingInfo.passed, compare saved ranking metadata with compareItems, and configure rankings, thresholds, accessors, min/max bounds, or diacritics. Load for @tanstack/match-sorter-utils itself or fuzzy Table filterMeta wiring.

TanStack/table · 62 tokens

r3f-best-practices

React Three Fiber (R3F) and Poimandres ecosystem best practices. Use when writing, reviewing, or optimizing R3F code. Triggers on tasks involving @react-three/fiber, @react-three/drei, zustand, @react-three/postprocessing, @react-three/rapier, or leva.

zebbern/claude-code-guide · 74 tokens

git-safety

Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git, push force, reset hard. NEVER force push or do destructive git operations.

tamagui/tamagui · 0 tokens

remotion-best-practices

Best practices and domain knowledge for building videos programmatically with Remotion (videos in React/TypeScript, rendered to MP4). Use whenever writing or editing Remotion code — scaffolding a video project, animating with interpolate/spring over useCurrentFrame(), sequencing scenes and transitions…

guanyang/open-agent-hub · 116 tokens