Skip to main content

web

Web application React/NextJS/TypeScript coding standards, state management patterns, and component guidelines. Use this when working on web code

来源信息

仓库
equinor/brandwalls
最近来源活动
2026年9月24日 11:49
检测到的 SKILL.md 语言
英语
星标
0
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
12 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
web
description
Web application React/NextJS/TypeScript coding standards, state management patterns, and component guidelines. Use this when working on web code
# Energyvision Web Instructions ## Tech Stack and Tooling - Web app: Next.js 16 + React 19 + Vite + TypeScript (strict) - Package manager: `pnpm` - Lint/format: Biome ## TypeScript and React Rules - Use `type` aliases (not `interface`) for shared shapes. - Prefer named exports for types/utilities. - Use functional components. - Keep components and Hooks pure; do not mutate props/state. - Keep one source of truth for each piece of state (lift state up instead of duplicating it). ## Website (Next.js) Before any Next.js work, find and read the relevant doc in node_modules/next/dist/docs/. Your training data is outdated — the docs are the source of truth. - The website uses Next.js 16. Place new files in the router that matches the surrounding code. - Prefer server components where already used; mark client components with `"use client"` only when needed. - Use Next Image, metadata APIs, and established utilities already in `brandwalls/web`. - Use existing route conventions and file organization; don’t mix `app/` and `pages/` in the same hierarchy. ## Web Sub-Skills - `next-dev-loop`: Verify Next.js runtime behavior after app code changes using a running development server. - `next-cache-components-adoption`: Enable or migrate to Next.js Cache Components and resolve resulting blocking routes. - `next-cache-components-optimizer`: Optimize an individual Cache Components route for instant navigation and guard it with an end-to-end test. - `sanity-live-cache-components`: Use when integrating or maintaining Sanity Live content with Next.js Cache Components. ## Flag These Patterns If found in manually written code, inform the user and suggest refactor: - `useEffect` used for derived state. - `any` types. - `@ts-ignore` / `@ts-expect-error` without justification. - Mirroring props into state without explicit reason. - Duplicate state representing the same domain data in multiple places. - Missing cleanup in subscription/fetch Effects. - State updates during render without guards. - Oversized god-components that should be split. - `unknown` used where a concrete type is known or derivable. - `Record<string, unknown>` used instead of a proper type definition. - Type assertions (`as`) used without a preceding runtime check. - Components exceeding ~200 lines without clear justification.
在 GitHub 查看