fe CLAUDE.md

Claude Code instructions for n9e/fe, covering n9e 前端项目, 目录速览, 技术栈与风格, 数据与错误 and 弹窗与表单状态.

Instructions file

View the source file n9e/fe
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/n9e/fe/claude-md
Clone the repo
git clone --depth 1 https://github.com/n9e/fe
Per session 1,475 This file is loaded in full into every session.
When invoked 1,475 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod 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 $0.01475 $0.01475
Opus 5 $0.00737 $0.00737
Sonnet 5 $0.00295 $0.00295
Haiku 4.5 $0.00147 $0.00147

Measured yesterday against content hash 4315bbd1bd61, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fe CLAUDE.md 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 yesterday.

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.

Origin

This is a copy

91% identical to copilot-instructions — 14 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

CLAUDE.md · 100 lines

How it starts

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

N9E 前端项目

目录速览

src/
├── components/     # 通用 UI 与业务无关的基础组件
├── pages/          # 路由页面
├── plus/           # Plus 扩展(datasource、parcels 等,路径别名 plus:/*)
├── plugins/        # 数据源等插件化功能(含 Explorer/Dashboard 等)
├── store/          # Zustand 等状态
├── services/       # 接口与领域服务
├── utils/          # 工具函数
├── routers/        # 路由配置
├── theme/          # 主题与 CSS 变量(如 variable.css)
├── locales/        # 国际化资源
├── assets/         # 静态资源
├── types/          # 全局类型
├── App.tsx
└── main.tsx

技术栈与风格

  • TypeScript + React Hooks;优先函数组件,避免 class 组件。
  • 组件 Props 使用 interface 显式声明,避免 any
  • 遵循仓库既有格式与 Prettier 配置;改动保持最小范围,不重写无关模块。
  • 不臆测接口或业务逻辑;上下文不足时说明缺口或反问。
  • 数据转换函数必须保持幂等性(相同输入多次调用产生相同输出),如果函数会修改入参对象,首行使用 _.cloneDeep(values) 保护原始引用不被污染。
  • 同一组件中应避免多次调用同一有副作用的转换函数,优先提取变量复用计算结果。
  • 类型收窄优先使用原生接口:用 Array.isArray 代替 _.isArray,用 typeof x === 'number' 代替 _.isNumber,用 x == null 代替 _.isNil,以此类推。lodash 的类型守卫函数在缺少 @types/lodash 时不会被 TypeScript 识别为类型守卫,导致 unknown 类型无法收窄。

数据与错误

  • 异步请求须有错误处理(try/catch.catchonError 等,与现有模式一致)。

弹窗与表单状态

  • 弹窗、抽屉等临时容器组件在卸载时,必须显式清理表单数据和本地状态(如 form.resetFields()、loading、临时选择值),避免再次打开时回显旧数据。
  • 注意 form.setFieldsValue 是增量更新:未传入的字段会保留原值。需要全量覆盖场景时,先重置表单(如 form.resetFields())再设置新值。
  • antdCollapse.Panel 初始折叠时不会挂载内容。若面板内的 Form.Item / Form.List 需要参与校验、回填或提交,必须添加 forceRender,确保字段注册到 Form;纯展示内容无需添加。

样式与颜色

  • 颜色、主题相关值使用 src/theme/variable.css(及现有主题体系)中的变量,避免魔法色值。

Tailwind 与 Less 的分工

原则

  1. 能直接用 Tailwind 表达的(布局、间距、排版、圆角、常见交互态)→ 用 Tailwind。
  2. Tailwind 不划算或做不到的 → 少量 Less/CSS,选择器尽量收束在页面/模块根类名下。
  3. 同一视觉属性不要同时被 Tailwind 与 Less 争抢(避免难排查的覆盖问题)。

优先用 Tailwind

  • 容器布局:flex / grid / gap / 内外边距 / 对齐。
  • 业务界面:按钮、表单外观、文案层级、状态色(需与主题变量一致时,用已有 Tailwind 主题映射或 CSS 变量类,不硬编码色值)。
  • 局部状态:hover / focus / disabled 等。
  • 仅当前组件使用的展示类样式。

用 Less / 普通 CSS 更合适的情况

  • 覆盖第三方组件内部结构(如 antd 深层节点、复杂表格头)。
  • 全局或跨多页复用的 token、keyframes、无法用工具类清晰表达的动画。
  • 强依赖复杂选择器(深层后代、兄弟组合、兼容向 hack 等)。

Less/CSS 侧要求:

  • 选择器尽量局部化;嵌套不宜过深(≤3 层为宜)。
  • 不复制一套与 Tailwind 等价的冗长规则。

Read the full file on GitHub · 100 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. yesterday First seen · 100 lines · 1,475 tokens per session scan A 4315bbd1bd61

Subscribe to this mod's changes

fe CLAUDE.md is an instructions file published in the GitHub repository n9e/fe (302 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,475 tokens to every session, about $0.0074 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to copilot-instructions, differing in 14 lines, and is treated as a copy.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens