fe: Instructions file for Claude Code

CLAUDE.md

fe CLAUDE.md is an instructions file for Claude Code from n9e/fe. It costs 2,346 tokens per session, scanned A, a copy of copilot-instructions, Apache-2.0.

Repository-specific instructions for an N9E frontend project built with TypeScript and React.

In plain words
What is it for?
Use them when modifying React components, services, routing, state, styling, localization, or forms in that project.
Why use it?
They explain the project structure, coding style, data and error-handling rules, and form-state practices needed for safe changes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is n9e/fe's own configuration. It tells Claude Code how to work on fe 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 fe configures →

View source ↗ n9e/fe
Reuse

Borrowing it

Nothing to install: this file belongs to n9e/fe. 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/n9e/fe/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/n9e/fe

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/n9e/fe/claude-md/github.svg)](https://agentmods.dev/instructions/n9e/fe/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/n9e/fe/claude-md"><img src="https://agentmods.dev/badge/instructions/n9e/fe/claude-md/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 fe CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/n9e/fe/claude-md"><img src="https://agentmods.dev/badge/instructions/n9e/fe/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,346 This file is loaded in full into every session.
When invoked 2,346 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02346 $0.02346
Opus 5.5 $0.00938 $0.00938
Sonnet 5.5 $0.00469 $0.00469
Haiku 4.5 $0.00235 $0.00235

Measured 9d ago against content hash 6a59562cc1bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 9d 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.

Origin

This is a copy

91% identical to copilot-instructions — 31 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 · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 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 配置;改动保持最小范围,不重写无关模块。
  • 修改源码后,必须依据根目录 .prettierrc.json 对改动文件执行 ./node_modules/.bin/prettier --write,并在交付前执行 ./node_modules/.bin/prettier --check;不得遗留仅格式问题。
  • 不臆测接口或业务逻辑;上下文不足时说明缺口或反问。
  • 数据转换函数必须保持幂等性(相同输入多次调用产生相同输出),如果函数会修改入参对象,首行使用 _.cloneDeep(values) 保护原始引用不被污染。
  • 同一组件中应避免多次调用同一有副作用的转换函数,优先提取变量复用计算结果。
  • 类型收窄优先使用原生接口:用 Array.isArray 代替 _.isArray,用 typeof x === 'number' 代替 _.isNumber,用 x == null 代替 _.isNil,以此类推。lodash 的类型守卫函数在缺少 @types/lodash 时不会被 TypeScript 识别为类型守卫,导致 unknown 类型无法收窄。

React Router 路由与部署前缀

  • 项目使用 React Router 的 basename 支持子路径部署。应用内路由路径应使用 Router 提供的路径:例如部署前缀为 /flashcat 时,useLocation().pathname 和 React Router history.location.pathname 是 /dial-analysis,而 window.location.pathname / 全局 location.pathname 是浏览器完整路径 /flashcat/dial-analysis。
  • 构造应用内跳转、调用 React Router 的 history.push / history.replace,或保留当前路由路径时,使用 Router 的相对路径(如 useLocation() 或 history.location)。不要把全局 location.pathname 直接当作 Router 路径,也不要给 Router 路径手动再拼 basename,否则可能出现 /flashcat/flashcat/polaris 这样的重复前缀。
  • useLocation() 是当前渲染对应的路由快照。异步请求等延迟回调需要读取执行时的最新路径或查询串时,使用对应 Router history 的 history.location,避免使用闭包中的旧值覆盖后来更新的路由状态。
  • 只有确实需要浏览器完整 URL(例如整页跳转、刷新或生成带部署前缀的浏览器级地址)时才使用 window.location / 全局 location;注意它们与 Router 的路由路径语义不同。window.history 的原生 History API 也不等同于 React Router 的 history。
  • 构造复制、分享、保存或自定义组件使用的 URL 时,先区分 Router 路径、应用相对 URL 和完整 URL;优先复用 src/utils/appUrl.ts 的 getAppBaseUrl / addAppBasePrefix,不要随手拼接 basePrefix。这些 helper 会避免重复前缀,并让绝对 URL 保持原样。
  • $local_url 已包含协议、域名和部署前缀;替换后不要再给结果加前缀。Vite 前缀插件只处理它识别的浏览器 URL 接收点,不会处理复制到剪贴板、显示在输入框、存入对象或经自定义组件传递的 URL;这些场景需要显式构造。

Read the full file on GitHub · 117 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. 9d ago Changed · +9 lines · +513 tokens per session 6a59562cc1bb
  2. 14d ago Changed · +7 lines · +298 tokens per session 4eacc375b654
  3. 1mo ago Changed · +1 lines · +60 tokens per session b64f1c757f34
  4. 1mo ago 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 (308 stars, last pushed today), licensed Apache-2.0. It adds 2,346 tokens to every session, about $0.0094 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 91% identical to copilot-instructions, differing in 31 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 · 9,715 tokens

next.js AGENTS.md

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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens