mini-taiwan-pulse: Command for Claude Code

.claude/commands/new-layer.md

new-layer is a command for Claude Code from ianlkl11234s/mini-taiwan-pulse. It costs 30 tokens per session (3,010 once invoked), scanned A, original, MIT.

A command that creates the starting files for a new map layer in the Mini Taiwan Pulse project.

In plain words
What is it for?
It is for scaffolding static or animated layers, choosing their data source, and prompting the follow-up checks for design, data, and repository alignment.
Why use it?
It reduces the number of project-specific files and registration points you must create by hand when adding a layer.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md; mentions subagents; positional $N argument.

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is 完整 20 項觸點表(含每項的守門機制)→ [`docs/development-rules.md` §4](../../docs/development-rules.md).

Reuse

Borrowing it

Nothing to install: this file belongs to ianlkl11234s/mini-taiwan-pulse. 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/ianlkl11234s/mini-taiwan-pulse/master/.claude/commands/new-layer.md
Clone the repo
git clone --depth 1 https://github.com/ianlkl11234s/mini-taiwan-pulse

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 new-layer

README.md
[![agentmods](https://agentmods.dev/badge/commands/ianlkl11234s/mini-taiwan-pulse/new-layer/github.svg)](https://agentmods.dev/commands/ianlkl11234s/mini-taiwan-pulse/new-layer)
Your own site
<a href="https://agentmods.dev/commands/ianlkl11234s/mini-taiwan-pulse/new-layer"><img src="https://agentmods.dev/badge/commands/ianlkl11234s/mini-taiwan-pulse/new-layer/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 new-layer

Your own site · 80×15
<a href="https://agentmods.dev/commands/ianlkl11234s/mini-taiwan-pulse/new-layer"><img src="https://agentmods.dev/badge/commands/ianlkl11234s/mini-taiwan-pulse/new-layer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,010 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.00030 $0.03010
Opus 5 $0.00015 $0.01505
Sonnet 5 $0.00006 $0.00602
Haiku 4.5 $0.00003 $0.00301

Measured 11d ago against content hash 91242cea8be8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

new-layer 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 11d 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.

.claude/commands/new-layer.md · 191 lines

How it starts

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

/new-layer

為 Mini Taiwan Pulse 新增一個地圖圖層。

本 command 只負責產骨架。UX 決策 / 資料驗收 / 跨 repo 對齊 → 走 layer-onboarding skill(本 command 執行完會自動提示)。

⚠️ 2026-08-12(AR-22 Phase 4)改版:舊版的「7 步強制順序」裡有 5 個接觸點是 登記簿LAYER_COLORS / LAYER_ICONS / THEMES 的 label / UPSTREAM_REGISTRY / useTransportParamscase),現在全部由 layerManifest.tslayerParamsSpec.ts 兩筆宣告派生。新流程是 manifest 一筆 + spec 一筆 + 實質邏輯檔

舊版還要求手動改 useLayerVisibility.tsDEFAULT_ON —— 那張表的 key 全集已由 LAYER_COLORS 派生且現為空集合,預設關的層完全不用碰

參數

  • $1 (必填): layer key,camelCase,例如 busRoutes / floodZones
  • --static / --dynamic (擇一):
    • static = Mapbox overlayRegistry(GeoJSON / PMTiles,fill/line/circle)
    • dynamic = Custom WebGL layer 或 Three.js scene(時序動畫)
  • --source=supabase|geojson|pmtiles:資料來源

Step 0 — 開跑前必做(⚠️ 不可跳)

跑本 command 前先確認:

  1. Feature slug 已定(kebab-case,例如 flood-zones
  2. 開分支git checkout -b feat/<slug>
  3. 建 feature 資料夾
    cp -r docs/features/_TEMPLATE docs/features/<slug>
    
  4. 若涉新資料 / 資料契約:先開 upstream handoff
    cp taipei-gis-analytics/docs/handoff/_TEMPLATE.md \
       taipei-gis-analytics/docs/handoff/<slug>.md
    

Step 1 — 產骨架

使用 layer-creator subagent 處理樣板產生。委派時傳入:

  1. Layer key(從 $1)
  2. Layer 類型(static/dynamic)
  3. 資料來源
  4. 現有類似 layer 參考(若 static → earthquakes / disasterAlerts;若 dynamic → freewayCongestion / cwaImagery

必產生 / 修改的檔案(新三步 + 條件觸點)

① 型別入口

src/types/index.tsLayerVisibility interface 加 $1: boolean。 若這層可點選 → 同檔 FeatureInfo["layerType"] union 也加一個 layerType。

🔒 tsc:下游多張 Record<keyof LayerVisibility, T> 會立刻 TS2739。

② manifest 一筆(取代舊版 5 個登記簿觸點

src/data/layerManifest.tsLAYER_MANIFEST 加一筆完整 entry:

$1: {
  key: "$1",
  section: { theme: "水資源 Water", group: "河川" },  // orphan 才寫 null
  label: "中文名 English",
  // labelMobile / expandable / gated 選填
  color: "#0284c7",
  icon: Waves,                       // lucide 元件參照,不是字串
  upstream: { status: "verified", datasets: [{ datasetId: "…", confidence: "HIGH" }] },
  dataClass: "A",                    // A 靜態 GeoJSON / B PMTiles / C Supabase / D 自行接線
  source: { kind: "geojson", sourceId: "$1-src", url: "./$1.geojson" },
  legend: null,                      // 分類 ≥ 2 色就要填圖例 id(鐵則 2)
  popup: null,                       // 可點選就填 FeatureInfo 的 layerType(鐵則 3)
  params: { count: 1, kinds: ["slider"] },   // 沒有控件寫 null(鐵則 1)
  description: "一句話說明這層在講什麼",
  topics: ["水資源", "河川"],
},

Read the full file on GitHub · 191 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. 11d ago First seen · 191 lines · 30 tokens per session scan A 91242cea8be8

Subscribe to this mod's changes

new-layer is a command published in the GitHub repository ianlkl11234s/mini-taiwan-pulse (504 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 3,010 once invoked, about $0.0002 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-30.