code-style

code-style is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (6,156 once invoked), scanned A, original, MIT.

A set of coding rules for TypeScript and Vue files, including file extensions, imports, naming, comments, and syntax that Node cannot automatically transform.

In plain words
What is it for?
It guides developers writing TypeScript, Vue components, and Node scripts, and tells them how to verify the result.
Why use it?
It prevents code from failing because of unsupported syntax, incorrect module settings, or inconsistent source conventions.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Codex.

Good fit It guides developers writing TypeScript, Vue components, and Node scripts, and tells them how to verify the result.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/code-style
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.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Cursor.

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 code-style

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/code-style.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/code-style)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/code-style"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/code-style.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 6,156 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.06156
Opus 5 $0.00000 $0.03078
Sonnet 5 $0.00000 $0.01231
Haiku 4.5 $0.00000 $0.00616

Measured today against content hash 8f29c8b416f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

code-style 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 today.

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.

template/.cursor/rules/code-style.mdc · 315 lines

How it starts

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

工具鏈治理已拆到 [[code-style.toolchain]](動 vite.config.* / package.json / tsconfig*.json / .github/workflows/** / .husky/** / 任何 rc 或 ignore 檔時適用): preset 是唯一設定入口、eslint / prettier 全面禁令、vite.config.ts 必備欄位、CI 與 pre-commit 的命令邊界、ignore patterns 雙軌制。

要改工具鏈設定卻沒看到那份規約時 MUST 先開它——本檔不重複那些條文,看不到不等於沒有。

Code Style — 寫 code 當下

風格本身(single quote / no semicolons / printWidth 等)由 vp fmt 機械保證,不需要記; 本檔只收機器擋不住、要寫的人自己遵守的部分。

適用範圍含 .vue SFC 的 <script setup lang="ts"> 區塊——下面三條語法限制在 SFC 內 一樣成立,Node 的 type stripping 與 erasableSyntaxOnly 對它們一視同仁。

新增腳本一律 TypeScript

每一個新增的 Node 腳本都 MUST 用 TypeScript 寫,不是只有「看起來比較複雜的那幾支」。既有 .mjs / .js 不強制回頭改寫——動到它的時候順手遷移,不動就留著。

副檔名一律用 .ts不要.mts

.mts 看起來更安全(它永遠是 ESM,而 .ts 的模組系統由最近的 package.json type 決定),但實測下來那個保證換不到東西、還會壞掉:Vite 的 config loader 無法 resolve .mts。consumer 的 vite.config.ts 一 import 散播進去的 .mtsvp check / build 就整個掛掉(UNRESOLVED_IMPORT,檔案明明存在)。2026-07-31 全 fleet 實測,10 個 consumer 同時中。

.ts 的前提是散播落點所在目錄的最近 package.json 必須是 "type": "module"。這個前提由 scripts/audit-governance-drift.ts 的 consumer-module-type check 機械驗,不是靠「現在剛好都是」。

三條語法限制

Node 的 type stripping 只抹除型別,不做語法轉換:

  • NEVERenumnamespace、constructor parameter properties、legacy decorators
  • type-only import MUST 寫成 import type { X } from '...'
  • import specifier MUST真實副檔名(import './foo.ts')。stripping 不做副檔名改寫,寫 .mjs 指向 .ts 檔會在 runtime 炸 ERR_MODULE_NOT_FOUND
    • 例外:nuxt.config.ts 的相對 import 一律 extensionlessfrom './vendor/doctor-shared/preset')。判準是誰載這個檔,不是風格偏好:nuxt.config.ts 由 Nuxt 的 config loader 載(解析得了 extensionless)nuxi typecheck 的 program 內,而 TS 只有在 allowImportingTsExtensions: true 時才允許 .ts 結尾的 import——那個 flag Nuxt 4.5.x 的生成 tsconfig 有、4.4.x 沒有。帶副檔名在 4.4.x 上就是 TS5097,pre-push 的 typecheck gate 直接擋死所有 push
    • vite.config.ts 反過來,MUST 保留 .tsvp 走 Node 原生 ESM loader 載它,extensionless 會 ERR_MODULE_NOT_FOUND;而它不在 nuxi typecheck 的 program 內,所以不觸發 TS5097
    • 兩個 config 檔寫法不同不是不一致,是各自的載入器決定的。改任何一邊之前先問「誰載它、它在不在 typecheck program 內」,NEVER 為了看起來整齊把兩邊統一

Read the full file on GitHub · 315 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. today Changed · +1 lines 8f29c8b416f2
  2. 5d ago First seen · 314 lines · 0 tokens per session scan A 74706119a925

Subscribe to this mod's changes

code-style is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,156 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-09-03.