AGENT SKILL

cap-measure-and-vertical-rhythm

Use when prose runs edge to edge or line spacing is arbitrary. Sets a 45–75 character measure with ch units, a base line-height, and a rhythm unit so text blocks scan cleanly.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 81
Forks
17

01 前言 Front Matter

name
cap-measure-and-vertical-rhythm
description
Use when prose runs edge to edge or line spacing is arbitrary. Sets a 45–75 character measure with ch units, a base line-height, and a rhythm unit so text blocks scan cleanly.

02 资源文件 3

03 SKILL.md 正文

Cap measure and set vertical rhythm

Text that spans a 1440 px window returns the eye to the wrong line on wrap; the ideal measure is 45–75 characters, roughly 66. Set it with ch and the layout follows the font.

Procedure

  1. Constrain prose with max-width in ch, which scales with the font: max-width: 66ch for body, 45–60ch for captions and sidebars, 75ch as the hard ceiling for reading text.
  2. Never cap measure on a full-bleed container — apply it to the text element, or use max-inline-size on the paragraph itself so cards and grids are unaffected. .prose p { max-inline-size: 66ch; }
  3. Set a body line-height of 1.5 (0.5 leading). Anything under 1.3 for multi-line body text is hard to track; over 1.7 and lines stop reading as a paragraph.
  4. Establish a rhythm unit the whole layout shares — take the body line-height in px (24 px at a 16/1.5 body) and space block elements by multiples of it via margin-block-start.
  5. Trim the extra space at the ends of a text block with the lobotomised-owl selector: .prose > * + * { margin-block-start: var(--space-4); } so the first and last children carry no stray margin against the container.
  6. Keep headings closer to the text they introduce than to the block above: h2 { margin-block: 2.5rem 0.5rem }. A visually equal gap above and below makes a heading float.
  7. Use text-wrap: balance on headings (short, 1–3 lines) and text-wrap: pretty on body to avoid orphans, where supported — never balance on long body copy, which is capped by the browser.
  8. Apply measure per-language: a CJK or Arabic locale needs a shorter or different cap; do not assume a Latin 66ch fits translated copy.
  9. Give long-form content a wider gutter instead of a wider measure: pull the column to 66ch and let the surrounding margins absorb the extra viewport width, rather than stretching the text.
  10. Keep a smaller measure for UI labels and table cells (about 30–40ch) so a single column does not dominate and force horizontal scanning.

Worked example

A doc page at 16 px/1.5 has a 24 px line box. Setting --space-4: 1rem gives a 16 px gap between paragraphs and --space-8: 2rem a 32 px gap before an h2. Both are multiples of the 24 px rhythm unit's half, so headings and paragraphs sit in a consistent two-line cadence. The paragraph itself is capped at 66ch, roughly 700 px at this size — well under the 75-character ceiling.

Pitfalls

  • Fixing measure in px, so raising the font size past the cap pushes text past 75 characters again.
  • One measure for everything, so a two-column card grid inherits a 66ch cap and leaves a ragged column.
  • Line-height set in em on a large heading, compounding to huge leading as the size grows — use a unitless value.
  • Vertical rhythm that ignores the line box: a 24 px gap under 40 px line boxes reads as tight because the leading is inside the box, not between blocks.

Verification

# Report the character measure of each paragraph (approx via ch):
node -e "const{chromium}=require('playwright');(async()=>{const b=await chromium.launch();const p=await b.newPage();await p.goto(process.argv[1]);const m=await p.\$\$eval('p',els=>els.slice(0,20).map(e=>({ch:Math.round(e.getBoundingClientRect().width/(parseFloat(getComputedStyle(e).fontSize)*0.5)),lh:getComputedStyle(e).lineHeight})));console.log(m);await b.close();})()" http://localhost:3000

Every prose paragraph should measure roughly 45–75 characters and share one line-height. Report the measure token, the rhythm unit, and any paragraph outside the range.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81