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.
git clone --depth 1 https://github.com/mywand/cusrsor-do-itWrote 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.
[](https://agentmods.dev/rules/mywand/cusrsor-do-it/frontend)<a href="https://agentmods.dev/rules/mywand/cusrsor-do-it/frontend"><img src="https://agentmods.dev/badge/rules/mywand/cusrsor-do-it/frontend/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.
<a href="https://agentmods.dev/rules/mywand/cusrsor-do-it/frontend"><img src="https://agentmods.dev/badge/rules/mywand/cusrsor-do-it/frontend.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.03615 |
| Opus 5.5 | $0.00000 | $0.01446 |
| Sonnet 5.5 | $0.00000 | $0.00723 |
| Haiku 4.5 | $0.00000 | $0.00362 |
Grade A, and why
frontend 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.
How it starts
The opening of the file, as written. The whole thing — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.
最近更新: 2025-09-18
Frontend Engineering Baseline
1. 范围与定位
- 本文件提供框架无关的前端工程基线(目录、质量、可观测、部署等)。
- 具体框架专项规范:Vue →
vue.mdc(本仓库提供);React / Svelte 可另行补充。
2. 目录结构(通用示例)
src/
main.ts # 入口
app/ # 应用入口/根组件(按框架)
router/ # 路由定义与守卫(按框架)
pages/ # 路由页面 (视图容器)
components/ # 可复用基础组件(无业务)
features/ # 业务特性模块(聚合页面/组件/逻辑)
state/ # 状态模块(Pinia/Redux/Zustand 等)
composables/ # 复用逻辑(hooks/useXXX)
api/ # API / SDK / 网关调用封装
directives/ # 自定义指令
plugins/ # Vue / 第三方插件注册
tokens/ # 设计系统 Token(JSON / TS / CSS Vars)
styles/ # 全局样式入口 & 预处理(Tailwind / SCSS / PostCSS)
assets/ # 静态资源 (图标/字体/图片)
utils/ # 纯函数工具,不含框架耦合
tests/ # 测试配置或全局 setup
可选:env.d.ts (类型 shim)、mocks/ (MSW 本地 API Mock)、prototypes/ (实验性验证)。
Vue 专属实践:详见 vue.mdc(TypeScript/状态/接口错误处理/设计系统 Token 等)。
3. 状态管理原则(通用)
- 优先局部:先本地组件 / composable,后 Pinia store,最后跨域全局单例。
- Store 颗粒度:按业务垂直切分(auth/user/order),禁止“core/global”巨无霸。
- 远程数据:优先 TanStack Query(失效策略、缓存键、重试、并发去重)。
- Store 中避免直接异步副作用:放入 action 或 composable;保持可测试性。
- 仅当多个组件需要订阅同一响应式源且生命周期独立时引入 store。
- 避免“缓存即状态”混乱:服务端数据缓存交 Query;本地持久偏配置信息交 store。
4. 组件/视图设计(通用)
- 分类:Base(原子 UI,无业务) / Presentational(布局组合) / Feature(绑定具体业务) / Page(路由承载)。
- Props 精简 & 明确类型;禁止传递整块 store 或巨大对象(用解构 + 明确字段)。
- 交互拓展:优先使用 slots / scoped slots;跨层级依赖用 provide/inject 或 composable 而非深层 prop drilling。
- 避免多布尔 props 组合爆炸:改用枚举
variant/mode。 - 复用逻辑抽取 composable(
useXxx);UI + 逻辑分离(.vue 内轻逻辑)。 - 第三方组件二次封装:隔离设计系统 Token / 主题适配,避免全局直接耦合。
- 提供稳定测试选择器:
data-test="component-name"。
5. TypeScript 规范(通用)
- 禁止
any(例外需// eslint-disable-next-line @typescript-eslint/no-explicit-any+ 原因)。 - interface vs type:稳定结构接口;条件/联合/映射优先 type。
- 将 API DTO 放在
api/types.ts或分组;生成型 (OpenAPI) 代码与手写类型分隔。 - 区分 Domain Model vs View Model:转换层明确命名(
mapUserDtoToModel)。 - 适度使用
defineProps,defineEmits辅助推断;复杂组件抽出Props类型单独导出。 - 避免滥用
as断言;优先类型收窄(类型守卫、判空)。 - 运行时校验(Zod)补充 TS 静态不可信输入。
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.
- 1mo ago First seen · 241 lines · 0 tokens per session scan A b5c36b2918e0
frontend is a cursor rule published in the GitHub repository mywand/cusrsor-do-it (2 stars, last pushed 9mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,615 tokens. 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-31.
Other cursor rules, from other repositories
frontend
Cursor rule "frontend" from Luxvil/ai-coding-rules, covering windsurf rules - frontend, component structure, react patterns, typescript and performance.
skill-frontend-design
Arquitetura frontend DARE para projetos React e Vue. Detecta god components (>300 linhas), fetch inline em JSX/template, garante error boundaries, loading states e bundle size monitorado.
90-ui-components
Rules for UI component development (React, Vue, Svelte).
frontend-dev
A guided workflow for building front-end interfaces with Vue 3, React 18+, or TypeScript. It covers requirements, components, styling, tests, and builds.
frontend-dev
A frontend development workflow for Vue 3, React 18 or newer, and TypeScript projects.
frontend-dev
Frontend Developer - Component, Layout, State Management (React/Vue/Tailwind).