frontend-conventions

frontend-conventions is a skill for Claude Code, Codex from VOD-Studio/violet. It costs 53 tokens per session (2,282 once invoked), scanned A, original, MIT.

A set of rules for writing and organising frontend code, such as user-interface components, hooks, and utility functions. It also defines how to write TSDoc, the standard comment format used to document TypeScript code.

In plain words
What is it for?
Use it when adding frontend files, deciding whether code belongs to one feature or a shared area, reusing existing implementations, or documenting exported TypeScript code.
Why use it?
It helps prevent duplicate code, misplaced files, unnecessary shared utilities, and comments that explain history instead of how to use the code.

Skill for Claude CodeCodex

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 skills/vod-studio/violet/frontend-conventions
Any agent
npx skills add VOD-Studio/violet --skill frontend-conventions
Clone the repo
git clone --depth 1 https://github.com/VOD-Studio/violet

Made for: Claude Code, Codex.

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 frontend-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/vod-studio/violet/frontend-conventions.svg)](https://agentmods.dev/skills/vod-studio/violet/frontend-conventions)
Your own site
<a href="https://agentmods.dev/skills/vod-studio/violet/frontend-conventions"><img src="https://agentmods.dev/badge/skills/vod-studio/violet/frontend-conventions.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,282 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00053 $0.02282
Opus 5 $0.00026 $0.01141
Sonnet 5 $0.00011 $0.00456
Haiku 4.5 $0.00005 $0.00228

Measured 5d ago against content hash ccccfe69c59e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

frontend-conventions 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 5d 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.

.agents/skills/frontend-conventions/SKILL.md · 145 lines

How it starts

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

前端编码纪律

落笔前查重

写任何新 util / hook / 通用组件前,先搜同款,命中即复用:

  1. shared 层(lib/ / ui/ 等,项目公共能力所在)。
  2. 本 feature 已有文件。
  3. 兄弟 feature——有近似实现而确实需要复用时,先把它上提到公共层(独立提交),再在新 feature 接入;两边各复制一份是最后选项。

新建前不存在同款才动笔;搜过但不确定算不算同款时,把候选列给用户。

文件落位

场景 落位
单 feature 私有工具 feature 根的 lib/utils/(与兄弟 feature 既有命名对齐,grep 确认)
单 feature 私有 hook feature 根的 hooks/
复合组件的辅件 该组件目录内 components/ hooks/ utils/ 子目录
跨 feature 复用 公共层;先上提(独立提交)再接入
  • 组件目录建 utils/ hooks/ 子目录的门槛是「多文件复合体」;一两个文件平铺在组件旁,建了空目录结构就是堆砌。
  • feature 私有内容禁止先放进公共层「备用」;公共化的触发条件是第二个消费方真实出现。

TS 注释规范

导出符号用 TSDoc 标准形态:首行一句话说明用途,@typeParam / param / returns / example 标签,example 可运行:

/**
 * 服务端分页表格 Hook,管理分页状态并组装 pagination。
 *
 * @typeParam T - 列表项数据类型
 * @param useList - 模块的列表查询 Hook
 * @param baseQuery - 业务筛选参数,省略时查全部
 * @returns 查询结果 + pagination,供 DataTable 直接消费
 */

头注释禁写(判定:删掉后调用方损失信息吗?不损失即删):

  • 动机叙述:「本 hook 消除 7 个子页重复的样板」——为什么写它,属于 PR 描述。
  • 历史论证:「原单一全量 query 有竞态,已拆为 X」——演进过程,属于 commit/ADR。
  • 被否决方案对比:「IntersectionObserver 方案在边界会丢选中」——要写就压缩成一句「为什么不用 X」。
  • @param 复读签名:类型与参数名已表达的不再用文字重述。

保留与提倡:

  • 魔法值理由:值旁一句为什么是这个数(行尾或行上)。
  • 行内陷阱注释:函数体内非显然的坑(为什么解构某个引用、为什么豁免某条 lint 依赖)——这是头注释该让位给它的部分。
  • 编排契约:签名看不出的数据流顺序(「读配置 → 回填 → 提交部分字段」),一行。

interface 字段只在非自解释时加行上注释;组件内部私有函数默认不注释,非显然时一句。

API client / query hooks 注释特例

这两类函数天然自解释:函数名 = 操作,参数类型 = 请求,返回类型 = 响应,下一行代码就是协议与路径。默认不写头注释,只补签名外的语义,且不带函数名前缀:

// ✅ 语义写首行正文;取值约束、前置状态用标签或箭头式陈述
/**
 * 审核通过。rejected 是改判,即该链接曾被拒绝。
 */
export const useApproveFriendLink = ...

/**
 * 待审核数量。
 *
 * @remarks 消费方是后台导航角标,轮询间隔 60s。
 */
export const usePendingFriendLinkCount = ...
// ❌ 复读:函数名 + 「调 GET /admin/friend-links」全在签名与实现里
/** listFriendLinks - 调 GET /admin/friend-links(按状态筛选,分页) */

标签使用约定:

  • @remarks——次要语义(消费场景、缓存行为),首行装不下的放这。
  • @default——默认值语义(@default 出现时加载),而非括号里写「默认 false」。
  • @defaultValue 同义,项目内统一用 @default
  • 状态机转换(pending → rejected)直接写箭头式陈述,这是状态描述不是括号补语。
  • @param / @returns 保持;自解释参数不写,写了就必须有签名外信息。

Read the full file on GitHub · 145 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. 5d ago First seen · 145 lines · 53 tokens per session scan A ccccfe69c59e

Subscribe to this mod's changes

frontend-conventions is a skill published in the GitHub repository VOD-Studio/violet (3 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 2,282 once invoked, about $0.0003 per session on Opus 5. 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.

Related

Other skills, from other repositories

openspec-sync-specs

Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.

cedricziel/truenas-mcp · 38 tokens

testing-the-mcp-server

Test the libtmux-go MCP server end to end — drive the real binary over raw JSON-RPC, run the exhaustive advertised-schema gate, and point installed agent CLIs (Claude, Codex, Cursor, Gemini, grok, agy, opencode) at a local build. Use when verifying the server beyond go test, checking a branch works in a real client…

libtmux/libtmux-go · 145 tokens

dark-memory

Use for governance, memory, drift detection, and audit trail via dark-memory-mcp. Covers 52 canonical + 3 red-team tools across 16 namespaces: session lifecycle, agentmemory CRUD+search, vibe-flow spec/artifact publish + drift, LLM-as-judge, delegation+mindset, research, observability, error observatory, governance…

Opita-Code/dark-memory-mcp · 353 tokens

audit-network-security

../../../.github/skills/audit-network-security/SKILL.md.

gordcurrie/unifi-mcp · 0 tokens

ddd-go-backend

Build production-ready Go backend services following DDD-layered architecture. Covers project scaffolding, config (Viper), database (GORM + MySQL/PostgreSQL), object storage (S3/MinIO), OAuth2 + JWT auth, OpenTelemetry tracing + Jaeger visualization, Zap logging, middleware patterns, and API routing. Use when creating…

LSTM-Kirigaya/jinhui-skills · 98 tokens

openspec-update-change

Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.

cedricziel/truenas-mcp · 55 tokens