dev-port-allocation

dev-port-allocation is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (5,013 once invoked), scanned A, original, MIT.

A shared process for assigning development-server ports to different projects and checking that their declarations match the central registry.

In plain words
What is it for?
It is for managing local dev-server ports, tunnel forwarding, and audits across multiple projects.
Why use it?
It prevents projects from choosing the same port and makes missing or conflicting settings fail during checks.

Cursor rule for Cursor

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

Good fit It is for managing local dev-server ports, tunnel forwarding, and audits across multiple projects.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/dev-port-allocation/github.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/dev-port-allocation)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/dev-port-allocation"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/dev-port-allocation/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 dev-port-allocation

Your own site · 80×15
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/dev-port-allocation"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/dev-port-allocation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 5,013 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.05013
Opus 5 $0.00000 $0.02507
Sonnet 5 $0.00000 $0.01003
Haiku 4.5 $0.00000 $0.00501

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

Security

Grade A, and why

dev-port-allocation 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.

template/.cursor/rules/dev-port-allocation.mdc · 210 lines

How it starts

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

Dev Port 中央分配

核心命題:consumer 越來越多,dev server port 撞號是 cross-cutting concern — 不集中分配必然撞。本規約把 dev port 變成 clade 標準層治理:registry 集中分配、規約強制宣告、audit 偵測漂移與衝突。

SoT:registry/consumers.json 每個 consumer entry 的 dev_ports object。

Audit gate:scripts/dev-port-audit.ts(DRIFT / MISSING / CONFLICT → exit 1)。

Cookbook 範本:vendor/snippets/dev-port/

Preview 轉發:/__preview/<port> 在 request-time 用 previewListenerDecision 確認 listener cwd 屬於該 port 的主人。mismatch / unknown MUST 出自我頁, NEVER 把別的 consumer 的 HTML(含 Nuxt welcome)嵌進驗收畫面。

MUST

1. 顯式宣告 port

  • MUST consumer package.jsondev script 必須顯式帶 --port <registry.dev_ports.nuxt>
  • NEVERnuxt dev(吃 Nuxt default 3000)
  • NEVER 省略 --port flag
  • NEVERpnpm dev -- --port <N> 來補 flag:多出來的 -- 會讓 Nuxt 把 --port 當位置參數丟掉,又落到 default 3000。要覆寫 port 用 pnpm dev --port <N>(沒有中間那個 --),且 script 本身仍 MUST 帶 --port
  • scripts/dev-port-audit.ts 對 DRIFT / MISSING / CONFLICT MUST exit 1。NEVER 把它當 diagnostic-only 吞掉 exit code

2. Tunnel port 對齊

  • MUST consumer nuxt.config.ts 若使用 vite-plugin-cloudflare-tunnel,plugin 的 port: 必須等於 registry dev_ports.nuxt
  • 寫法可為 hard-code number 或 Number(process.env.NUXT_DEV_PORT ?? <registry-value>),audit 兩種都接受

2.5. Dev tunnel zone & token convention(vite-plugin-cloudflare-tunnel)

凡 consumer 用 vite-plugin-cloudflare-tunnel 開 dev tunnel:

  • MUST Hostname 走 <consumer-id>-dev.<maintainer-domain>(org convention;既有對齊:<consumer-i>-dev / <consumer-b>-dev / <consumer-a>-shared-dev / co-purchase-dev

  • NEVER 自由發揮挑其他 zone(如 bigbyteedu.com / 個人域名)— 即使 DNS / tunnel 建得起來,plugin 仍會因 token-zone account 不匹配 403 crash Nuxt

  • MUST .env.local 設三件套:

    TUNNEL_HOSTNAME=<consumer-id>-dev.<maintainer-domain>
    TUNNEL_NAME=<consumer-id>-dev
    CLOUDFLARE_API_KEY=<cfat_*-token>
    

Read the full file on GitHub · 210 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 Changed · +1 lines 253fcee15e77
  2. 5d ago First seen · 209 lines · 0 tokens per session scan A 9f82bb21deba

Subscribe to this mod's changes

dev-port-allocation 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 5,013 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.