budge
millionco/skills · Agent Skill
使用於Next.js App Router中修改個別CSS屬性或Tailwind視覺化變化的專案。是一個浮動的控制小工具,提供即時預覽功能,在儲存前進行設定。
前往安裝 ↓總覽
| 發布者 | |
|---|---|
| 儲存庫 | millionco/skills ↗ |
| 技能資料夾 | budge |
| 星 | 34 |
| 分支 | 2 |
| 附帶檔案 | 2 |
| 授權 | MIT |
| 最近更新 | 2026年6月30日 |
| 連結 | 技能原始碼 ↗ · 儲存庫 ↗ |
Mozgi 檢查
我們在技能檔案中發現的內容。詳細資訊需訂閱。
安裝
技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。
把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。
Install the “budge” skill from mozgi.io (https://mozgi.io/skills/millionco-budge/) for me. 1. Download the archive: https://mozgi.io/skills/millionco-budge/download If it fails, take the skill folder from the source: https://github.com/millionco/skills/tree/main/skills/budge 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “budge” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/budge/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .claude/skills cp -r /tmp/skills/skills/budge .claude/skills/budge
重新啟動 Claude Code — 技能就會出現在清單中,手動呼叫:/budge。要套用到所有專案,請放在 ~/.claude/skills。
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .agents/skills cp -r /tmp/skills/skills/budge .agents/skills/budge
Codex 會從目前資料夾往上到儲存庫根目錄,在 .agents/skills 中尋找技能;用 /skills 或 $budge 呼叫。所有專案:~/.agents/skills。
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .cursor/skills cp -r /tmp/skills/skills/budge .cursor/skills/budge
Cursor 啟動時會載入技能;在 Agent 聊天輸入「/」呼叫。Cursor 也會讀取 .claude/skills 與 .agents/skills。所有專案:~/.cursor/skills。
git clone --depth 1 --branch main https://github.com/millionco/skills.git /tmp/skills mkdir -p .gemini/skills cp -r /tmp/skills/skills/budge .gemini/skills/budge
任務符合時,Gemini CLI 會提議啟用技能,由你確認。所有專案:~/.gemini/skills。
安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。
SKILL.md 內容
作者原文 · 唯讀Budge
Proactive skill. Next.js App Router only. If a task results in a single CSS property or Tailwind class change, follow this skill automatically. The user should never need to say "use budge."
You present a floating bar on the page after making an atomic visual change. The user fine-tunes the value with arrow keys (↑↓), swipes between related properties with arrow keys (←→). With the current runtime, complete your turn immediately after making the visual change — no browser interaction, no waiting, and no manual config unless the fallback below is needed.
The runtime is a self-contained IIFE loaded from https://www.budge.design/budge.iife.js via next/script. On local/dev hosts it stays on the page, watches HMR-driven class/style DOM changes, infers the latest numeric visual property change, marks the changed element, and mounts Budge automatically. It also uses React Grab primitives for manual selection: press Cmd+E, select an element, and Budge opens. It still supports the explicit data-budge config element as a fallback. Everything is handled client-side: live preview on [data-budge-target] elements, arrow key stepping, slide navigation, audio feedback, submit (Enter — copies an edit prompt to clipboard), and cancel (Escape — reverts).
In scope: Raw CSS property values, inline styles, Tailwind utility class changes, SVG presentation attributes (fill, stroke, etc.).
Out of scope: Sass/Less variables, CSS custom property definitions (--spacing), CSS-in-JS theme tokens. Proceed normally for these.
Installation
Grep for budge.iife.js in app/layout.tsx. If found, make the requested visual change and stop. Otherwise, read references/INSTALL.md and follow its instructions.
Default Flow
For a single raw CSS value or Tailwind class token change, just make the source edit. The always-on runtime should attach Budge to the resulting DOM change after HMR. Tell the user: "I've changed X to Y. Use ↑↓ to fine-tune, ←→ to switch properties."
Use the manual steps below only if the bar does not appear or the change cannot be inferred from one numeric class/style DOM mutation.
---
Troubleshooting — bar does not appear
1. Script missing: Confirm <Script src="https://www.budge.design/budge.iife.js" strategy="afterInteractive" /> is in app/layout.tsx.
2. Auto-detect disabled: Auto-detect runs by default on local/dev hosts. Force it with data-budge-autodetect="true" on the script tag, or disable it with "false".
3. No inferable DOM change: The fallback bar only appears when a <div data-budge="..." hidden /> element with a non-empty slides array is in the DOM.
4. Target not found: The element with data-budge-target must be in the DOM after hydration.
---
Manual Fallback — Trigger Test
After making a change, apply this mechanical test. Do NOT use subjective judgment.
> The last StrReplace call touched exactly one CSS value literal OR exactly one Tailwind utility class token, in exactly one file. The change is not a variable, mixin, or theme token.
Pass: padding: 8px → padding: 16px | className="p-2 m-4" → className="p-4 m-4"
Fail: two values changed, token added/removed, Sass variable, multiple StrReplace calls, structural change.
Fail → skip budge, proceed normally. Pass → continue to Step 2. The mechanical test is the only gate.
Step 2 — Build Slides
Build a slides array. The first slide is the property you changed. Additional slides are related properties the user might want to tweak.
Each slide has this shape:
{
label: string; // display name shown above bar
property: string; // CSS property to apply to [data-budge-target]
min: number; // minimum numeric value
max: number; // maximum numeric value
value: number; // current value (the one you set)
original: number; // value before your change
unit: string; // "px", "%", "em", etc.
type?: "color"; // only set for color properties
}
Slide generation rules
1. Primary slide (index 0): the property you changed. value = new value, original = old value.
2. Related slides (index 1+): pick 2–3 related properties from the same element. Read their current computed/declared values. Use sensible min/max ranges.
Example — agent changed padding-top: 8px → padding-top: 16px:
[
{ label: "padding-top", property: "padding-top", min: 0, max: 64, value: 16, original: 8, unit: "px" },
{ label: "padding-bottom", property: "padding-bottom", min: 0, max: 64, value: 8, original: 8, unit: "px" },
{ label: "padding-left", property: "padding-left", min: 0, max: 64, value: 12, original: 12, unit: "px" },
{ label: "padding-right", property: "padding-right", min: 0, max: 64, value: 12, original: 12, unit: "px" },
]
Example — agent changed font-size: 14px → font-size: 16px:
[
{ label: "font-size", property: "font-size", min: 8, max: 72, value: 16, original: 14, unit: "px" },
{ label: "line-height", property: "line-height", min: 12, max: 80, value: 24, original: 22, unit: "px" },
{ label: "letter-spacing", property: "letter-spacing", min: -2, max: 10, value: 0, original: 0, unit: "px" },
]
Example — agent changed color: #333 → color: #1a1a1a:
Use the type: "color" slide with hue degrees:
[
{ label: "color", property: "color", min: 0, max: 360, value: 0, original: 0, unit: "°", type: "color" },
]
Related property suggestions
| Changed property | Related slides |
|---|---|
| padding-top | padding-bottom, padding-left, padding-right |
| padding | padding-top, padding-bottom |
| margin-top | margin-bottom, margin-left, margin-right |
| font-size | line-height, letter-spacing |
| gap | padding, margin-top |
| width | height, max-width |
| border-radius | padding, border-width |
| opacity | font-size |
Tailwind resolution
Resolve Tailwind classes to CSS properties and pixel values (multiply spacing scale × 4):
| Tailwind class | Primary slide property | Value |
|---|---|---|
| p-4 | padding | 16px |
| px-4 | padding-left (also set padding-right) | 16px |
| py-4 | padding-top (also set padding-bottom) | 16px |
| pt-4 | padding-top | 16px |
| mt-4 | margin-top | 16px |
| gap-4 | gap | 16px |
| text-[14px] | font-size | 14 |
| rounded-lg | border-radius | 8px |
For axis shorthands (px-*, py-*, mx-*, my-*), set the primary slide to one axis property but include both as slides.
For Tailwind classes, also add an inline style override on the target element so the runtime can manipulate the value directly:
<div data-budge-target className="py-4" style={{ paddingTop: '16px', paddingBottom: '16px' }}>
Design token snapping
If the project defines design tokens as CSS custom properties on :root or @theme (Tailwind v4, Shadcn, plain CSS vars), the runtime automatically snaps ↑/↓ stepping through them by matching property to scale:
| Property match | Discovered prefix |
|---|---|
| padding*, margin*, gap | --spacing-* |
| font-size | --text-* |
| border-radius* | --radius-* |
| color, *-color | --color-* (no snap yet — palette cycling is a follow-up) |
When a token matches the current value, the widget shows its name (e.g. 16px · md) and Enter emits Set \padding\ to \var(--spacing-md)\`` instead of a raw px value. Users can still type digits to escape to arbitrary px.
You don't need to specify scale on slides — it's auto-detected from property. Pass scale: null to disable snapping for a slide, or scale: "spacing" | "text" | "radius" | "color" to override. Pass tokens: [{ name, value, numeric }] to override discovery entirely. Use unit: "px" when relying on token snapping (the runtime applies the token's raw value so rem/em tokens resolve correctly regardless).
Step 3 — Mark Target Element
Add data-budge-target to the changed element in source:
<div data-budge-target style={{ paddingTop: '16px' }}>
Step 4 — Activate
Use StrReplace to add a config element to app/layout.tsx inside <body>, passing the slides as JSON:
<div data-budge={JSON.stringify({ slides: [
{ label: "padding-top", property: "padding-top", min: 0, max: 64, value: 16, original: 8, unit: "px" },
{ label: "padding-bottom", property: "padding-bottom", min: 0, max: 64, value: 8, original: 8, unit: "px" },
{ label: "padding-left", property: "padding-left", min: 0, max: 64, value: 12, original: 12, unit: "px" },
] })} hidden />
Step 5 — Complete
Your turn is done. Do NOT open a browser, verify the panel, or wait for the user. Next.js HMR delivers the change.
Tell the user: "I've changed X to Y. Use ↑↓ to fine-tune, ←→ to switch properties."
When the user pastes the submitted prompt, it reads as a normal edit instruction — make the edit and remove the data-budge config element.
常見問題
budge 技能有什麼用途?
使用於Next.js App Router中修改個別CSS屬性或Tailwind視覺化變化的專案。是一個浮動的控制小工具,提供即時預覽功能,在儲存前進行設定。
如何安裝 budge?
打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。
budge 適用哪些 AI 模型?
技能是純 Markdown 指示(Agent Skills 格式),因此 budge 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。
budge 是免費的嗎?
此技能由 millionco 公開發布,採用 MIT 授權。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。
安裝技能安全嗎?
技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。
技能和 MCP 伺服器或外掛有何不同?
MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。