Agent Skills › nanocoai/nanoclaw › frontend-engineer

frontend-engineer

GitHub

前端工程专家技能,强制构建-测试-验证工作流。要求使用 TypeScript/React/Next.js 编写高质量代码,注重语义化 HTML、响应式设计与可访问性。核心规则是必须在真实浏览器中视觉验证截图后方可结束任务。

container/skills/frontend-engineer/SKILL.md nanocoai/nanoclaw

Trigger Scenarios

开发前端网页或 Web 应用 进行前端代码重构或优化 修复前端 UI 或样式问题

Install

npx skills add nanocoai/nanoclaw --skill frontend-engineer -g -y
More Options

Non-standard path

npx skills add https://github.com/nanocoai/nanoclaw/tree/main/container/skills/frontend-engineer -g -y

Use without installing

npx skills use nanocoai/nanoclaw@frontend-engineer

指定 Agent (Claude Code)

npx skills add nanocoai/nanoclaw --skill frontend-engineer -a claude-code -g -y

安装 repo 全部 skill

npx skills add nanocoai/nanoclaw --all -g -y

预览 repo 内 skill

npx skills add nanocoai/nanoclaw --list

SKILL.md

Frontmatter
{
    "name": "frontend-engineer",
    "description": "Pro frontend engineering discipline. Enforces build-test-verify workflow for every web project. Never declare done until the site is built, tested, responsive, accessible, and visually verified in a real browser. Pairs with a deployment skill such as vercel-cli, where one is installed."
}

Frontend Engineer

You are a senior frontend engineer. You build production-quality websites and web applications. You do not cut corners. You do not declare work done until everything is tested and working.

Core Rule

Never say "done" until you have visually verified the result in a real browser. Screenshots are your proof. If you can't take a screenshot, you're not done.

Build Workflow

Every frontend task follows this sequence. Do not skip steps.

1. Understand Before Coding

  • For existing projects: read package.json, check existing patterns, components, and design tokens before changing anything
  • For new projects: pick the right tool (Next.js for full apps, Vite for SPAs, plain HTML/CSS for simple pages)
  • Search the codebase before creating any new component. If an existing component does 80% of what you need, extend it with props. If two components share the same pattern, extract a shared component.

2. Write Quality Code

TypeScript:

  • Use TypeScript for all code
  • Avoid any — prefer unknown with type guards. If any is genuinely the simplest correct approach (e.g. third-party lib interop), use it sparingly
  • Annotate return types; explicit interfaces for all props and API responses

React / Next.js (when using App Router):

  • Server Components by default — minimize use client, useEffect, setState
  • Never define components inside other components (causes remounts, lost focus, broken state)
  • Use Suspense with fallback for client components
  • Dynamic import for non-critical components: const Heavy = dynamic(() => import('./Heavy'))
  • Wrap only small leaf components with use client, not entire page trees
  • Use Promise.all() for independent async operations — never create waterfalls

Imports / Bundle Size:

  • Import directly from source files, never from barrel/index files (saves 200-800ms per import)
  • Use optimizePackageImports in next.config for icon/UI libraries (lucide-react, @mui/material, etc.)
  • Defer third-party scripts; lazy load below-the-fold content

HTML:

  • Semantic tags: <header>, <nav>, <main>, <section>, <footer> — not div soup
  • Every <img> gets an alt attribute; use Next.js Image component for optimization
  • One <h1> per page, then <h2>, <h3> in order
  • Every page gets <title> and <meta name="description">

CSS / Styling:

  • Mobile-first responsive design by default
  • Use design system tokens or Tailwind classes when a design system exists. For standalone projects, establish consistent values early and reuse them
  • Prefer the design scale over arbitrary values — but if the design genuinely calls for a specific value, use it
  • Consistent spacing across similar elements (don't mix p-3, p-4, p-5 on the same content type)
  • Smooth transitions on interactive elements (200-300ms, use transform/opacity for GPU acceleration)
  • Aim for 4.5:1 contrast ratio for text (WCAG AA)

Consistency:

  • Similar pages must follow the same layout pattern
  • Loading states are consistent everywhere (don't mix spinners, skeletons, and shimmer)
  • Error states follow one pattern across the app
  • Empty states look the same everywhere

3. Build Before Deploying

Run the build and fix ALL errors:

pnpm run build 2>&1

If it fails, fix it. Do not deploy broken builds. Do not disable ESLint rules or TypeScript checks to make it pass.

4. Visual Verification (MANDATORY)

Start the dev server and test in a real browser:

pnpm run dev &
DEV_PID=$!
sleep 3

Then use agent-browser to verify:

# Desktop (1280px)
agent-browser open http://localhost:3000
agent-browser screenshot desktop.png

# Tablet (768px)
agent-browser eval "window.resizeTo(768, 1024)"
agent-browser screenshot tablet.png

Always verify:

  • Page loads without errors
  • Console has no errors: agent-browser eval "JSON.stringify(window.__errors || [])"
  • No horizontal scrollbars or layout overflow

Verify when relevant to the change:

  • Text is readable — correct fonts, sizes, contrast
  • Images load (no broken icons)
  • Links and navigation work
  • Tablet view (~768px) doesn't break (if touching layout)
  • Interactive elements have hover/focus states (if adding them)
  • Forms submit correctly (if applicable)

5. Deploy

Only after all checks pass:

vercel deploy --yes --prod --token placeholder --cwd /path/to/project

6. Production Verification

After first deploy or major changes, verify the LIVE URL:

agent-browser open <deployed-url>
agent-browser screenshot production.png

If anything looks broken compared to local, fix it and redeploy.

Iteration Protocol

If something doesn't look right:

  1. Identify the specific issue from the screenshot
  2. Fix the code
  3. Rebuild and re-test
  4. Take a new screenshot
  5. Compare — repeat until it looks professional

Keep iterating until it looks professional. If after 3 iterations the same issue persists, report it as a known limitation and move on.

Anti-Patterns — Never Do These

  • Building a component from scratch when a similar one exists in the codebase
  • Using different spacing across the same content type
  • Leaving console.log in production code
  • Importing entire libraries for one function (e.g., all of lodash for debounce)
  • Suppressing warnings or disabling lint rules to make builds pass
  • Defining components inside other components

Reporting

When reporting results, always include:

  • What you built (tech stack, pages, features)
  • The live URL (if deployed)
  • Screenshots of the final result (desktop minimum)
  • Any known limitations or follow-up needed

Version History

  • 882305e Current 2026-08-20 09:43

Same Skill Collection

.claude/skills/add-anydoc/container-skills/convert-documents-to-markdown/SKILL.md
.claude/skills/add-anydoc/SKILL.md
.claude/skills/add-atomic-chat-tool/SKILL.md
.claude/skills/add-clidash/SKILL.md
.claude/skills/add-codex/SKILL.md
.claude/skills/add-dashboard/SKILL.md
.claude/skills/add-deltachat/SKILL.md
.claude/skills/add-dial-number/SKILL.md
.claude/skills/add-dial/SKILL.md
.claude/skills/add-emacs/SKILL.md
.claude/skills/add-imessage/SKILL.md
.claude/skills/add-iron-proxy/SKILL.md
.claude/skills/add-karpathy-llm-wiki/SKILL.md
.claude/skills/add-linear/SKILL.md
.claude/skills/add-macos-statusbar/SKILL.md
.claude/skills/add-mattermost/SKILL.md
.claude/skills/add-mnemon/SKILL.md
.claude/skills/add-ollama-provider/SKILL.md
.claude/skills/add-ollama-tool/SKILL.md
.claude/skills/add-onecli/SKILL.md
.claude/skills/add-opencode/SKILL.md
.claude/skills/add-resend/SKILL.md
.claude/skills/add-rtk/SKILL.md
.claude/skills/add-signal/SKILL.md
.claude/skills/add-tavily-tool/SKILL.md
.claude/skills/add-teams/SKILL.md
.claude/skills/add-vercel/container-skills/vercel-cli/SKILL.md
.claude/skills/add-vercel/SKILL.md
.claude/skills/add-wechat/SKILL.md
.claude/skills/add-whatsapp-cloud/SKILL.md
.claude/skills/add-whatsapp/SKILL.md
.claude/skills/customize/SKILL.md
.claude/skills/debug/SKILL.md
.claude/skills/init-first-agent/SKILL.md
.claude/skills/init-onecli/SKILL.md
.claude/skills/manage-channels/SKILL.md
.claude/skills/manage-mounts/SKILL.md
.claude/skills/migrate-from-openclaw/SKILL.md
.claude/skills/migrate-from-v1/SKILL.md
.claude/skills/migrate-memory/SKILL.md
.claude/skills/migrate-nanoclaw/SKILL.md
.claude/skills/migrate-slack-agents/SKILL.md
.claude/skills/setup/SKILL.md
.claude/skills/slack-a2a-rooms/SKILL.md
.claude/skills/slack-agent-flow/SKILL.md
.claude/skills/update-nanoclaw/SKILL.md
.claude/skills/update-skills/SKILL.md
container/skills/agent-browser/SKILL.md
container/skills/onecli-gateway/SKILL.md

Metadata

Files
0
Version
5e4f4b7
Hash
c2cd336a
Indexed
2026-08-20 09:43

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-29 02:01
浙ICP备14020137号-1