RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/danielvm-git/bigpowers

Cursor rule

.cursor/rules/align-grid.mdc

Build editorial/magazine/report webpages on a GENUINE Müller-Brockmann modular grid (International Typographic Style) — not a decorative one. Encodes the discipline (columns + modules + baseline, grotesque type, flush-left, restrained black/white/red palette) AND the hard-won front-end engineering to make the grid real, visible, and verified: one CSS-variable source of truth, an interactive grid-toggle overlay that lives in the SAME content box as the content, subgrid "bands" so every element snaps to a column line, an 8px baseline lock, and runtime OPTICAL ALIGNMENT that puts display type's ink (not its box) on the line. Ships with a scaffold generator and a Puppeteer verification harness that proves 0px adherence.

Cursor rules

Quality

65/100

Scores the file, not the repository.

Length

1,650 words

14 headings · 2 code blocks

Repository

114

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
danielvm-git/bigpowers/.cursor/rules/align-grid.mdcRawGitHub
1---
2description: "Build editorial/magazine/report webpages on a GENUINE Müller-Brockmann modular grid (International Typographic Style) — not a decorative one. Encodes the discipline (columns + modules + baseline, grotesque type, flush-left, restrained black/white/red palette) AND the hard-won front-end engineering to make the grid real, visible, and verified: one CSS-variable source of truth, an interactive grid-toggle overlay that lives in the SAME content box as the content, subgrid \"bands\" so every element snaps to a column line, an 8px baseline lock, and runtime OPTICAL ALIGNMENT that puts display type's ink (not its box) on the line. Ships with a scaffold generator and a Puppeteer verification harness that proves 0px adherence."
3alwaysApply: false
4---
5 
6# Müller-Brockmann Grid Systems — built real, visible, and verified
7 
8Josef Müller-Brockmann (1914–1996), Zurich; *Grid Systems in Graphic Design* (1981) is the corpus. The grid is treated as an ethic, not decoration: **"The grid system is an aid, not a guarantee. It permits a number of possible uses and each designer can look for a solution appropriate to his personal style. But one must learn how to use the grid; it is an art that requires practice."** This skill encodes that discipline AND — the part most attempts get wrong — the front-end engineering to make the grid genuinely load-bearing on the web, plus a harness that PROVES it.
9 
10> **HARD GATE** — Do NOT ship a grid page without running `verify_grid.js` first. A visually plausible layout is not evidence of grid adherence — the harness is. Zero failing assertions is the only passing bar.
11 
12> Two real review notes this skill exists to prevent:
13> 1. *"the grid is just slapped on top and misaligned"* → the overlay wasn't in the same content box as the content (see §2.2).
14> 2. *"the H in the headline is off the grid"* → the headline's BOX was on the grid but its INK wasn't; large glyphs carry a side-bearing (see §2.6). **Box-on-grid ≠ ink-on-grid.**
15 
16---
17 
18## PART 1 — THE DISCIPLINE (decide before drawing)
19- **Objective order.** The grid brings "constructive thought," legibility, and "objective and functional" design. Restraint is the point; the system, not the ego, organizes the page.
20- **Modular grid.** Divide the type area into a field of **modules** — columns AND rows — separated by consistent **gutters**, inside defined **margins**. Text and images occupy whole modules. Müller-Brockmann specimens common field counts (8 / 20 / 32 fields). For the web, a **12-column grid + 8px baseline** is a robust general default; a **6×6 or 4×8 modular field grid** when you want visible rows too.
21- **Baseline grid.** Vertical rhythm is sacred: **leading = a whole multiple of the baseline unit**, and every element snaps to it. This is what makes facing columns and images line up across the page.
22- **Typography.** A **grotesque sans** (Akzidenz-Grotesk / Helvetica; on the web Inter, Helvetica Now, Archivo). **Flush-left, ragged-right.** Few sizes, large jumps in **scale** for hierarchy; objective, not expressive. Big **numerals/data set large** is a signature move.
23- **Palette.** Pure white paper, near-black ink, **one accent — red is canonical**. Avoid the warm-cream "Claude look"; **never blue/purple gradients** (hard house rule).
24- **White space + asymmetry.** Generous margins; asymmetric compositions held in tension by the grid.
25 
26---
27 
28## PART 2 — MAKE THE GRID REAL ON THE WEB (the load-bearing engineering)
29`grid_tokens.py` emits this whole scaffold correctly; the rules below are why it's built the way it is.
30 
31### 2.1 One source of truth
32Put every grid parameter in `:root` CSS variables — `--cols, --gutter, --margin, --bl (baseline), --lh (leading=3×bl), --maxw`. **Content and the overlay both read these same variables.** Never hand-author the overlay separately or it will drift.
33 
34### 2.2 The overlay MUST live in the SAME content box as the content ← #1 bug
35Failure mode: content sits in a centered `max-width` container while the overlay is a **full-width sibling** of the section. On any viewport wider than `--maxw`, the centered content and the full-width overlay no longer share column positions → "slapped on top / misaligned."
36**Fix:** put `.guides` *inside* the same `.wrap`, and draw the column guides with `left/right = var(--margin)` and the **same** `repeat(var(--cols),1fr)` + `column-gap:var(--gutter)`. Then the overlay columns **are** the content columns at every width. Add left/right margin lines at `var(--margin)`.
37 
38### 2.3 Place every element by column LINE via subgrid bands
39Don't eyeball spans. Each horizontal **band** spans all columns and re-exposes them:
40```css
41.band{grid-column:1 / -1; display:grid; grid-template-columns:subgrid; column-gap:var(--gutter); align-items:start;}
42@supports not (grid-template-columns:subgrid){ .band{grid-template-columns:repeat(var(--cols),1fr);} }
43```
44Children place with `grid-column: <startline> / <endline>` (e.g. `1 / 6`, `6 / 13`). Every headline, paragraph, photo, caption now snaps to identical lines.
45 
46### 2.4 Lock vertical rhythm to the baseline
47- Leading = `--lh` (e.g. 24px = 3×8). **Every line-height a multiple of the baseline, in px (not unitless) for display type** — unitless line-heights on large type push the box off the grid.
48- Every margin/padding a multiple of the baseline. Spread top/bottom padding a multiple too, so content starts on a line.
49- **Media heights = multiples of the leading** (e.g. 240/360/432/480px) so a photo's top AND bottom both land on lines.
50- Hairline rules sit inside a baseline-height band, not free-floating.
51 
52### 2.5 The toggle (sizzle within the sizzle)
53A control (button **+ `G` key**) toggles `body.grid-on`; overlay fades 0→1. Overlay draws: translucent **numbered column fields**, the **baseline** (major line every `--lh`, faint minor every `--bl`), and **margin lines**. Showing the real grid the page is built on IS the demo.
54 
55### 2.6 OPTICAL ALIGNMENT — display ink, not its box ← the subtle bug
56A 180px headline whose layout box is exactly on line 1 still looks misaligned against body text, because the letterform's **ink** is inset by its **left side-bearing**. Cure at runtime:
57```js
58// after document.fonts.ready and on resize:
59var cvs=document.createElement('canvas'),ctx=cvs.getContext('2d');
60document.querySelectorAll('.masthead,.numeral,.shead h2,.h2b').forEach(function(el){
61 el.style.marginLeft='0px';
62 var cs=getComputedStyle(el),ch=(el.textContent||'').trim()[0]; if(!ch) return;
63 if(cs.textTransform==='uppercase') ch=ch.toUpperCase();
64 ctx.font=cs.fontStyle+' '+cs.fontWeight+' '+cs.fontSize+' '+cs.fontFamily; ctx.textAlign='left';
65 var abl=ctx.measureText(ch).actualBoundingBoxLeft; // +ve = ink overhangs left of box
66 if(isFinite(abl)) el.style.marginLeft=abl.toFixed(2)+'px'; // shift box so INK lands on the line
67});
68```
69Apply to the masthead, big numerals, and section headlines. It scales with fluid type (re-runs on resize) and uses the **actually-loaded** font, so it's correct in the user's browser.
70**CRITICAL measurement caveat:** side-bearing is **font-specific**. If you measure with the wrong font you get the wrong nudge. Headless/sandbox Chrome usually lacks the webfont, so canvas falls back to a different grotesque (measured **−16px on the fallback vs −7px on real Inter** for the same `H`). To verify optics offline you must **embed the real webfont** via `@font-face` (local TTF). In production the runtime JS measures the loaded font and is correct.
71 
72---
73 
74## PART 3 — VERIFY (don't trust, measure) → `verify_grid.js`
75Render with headless Chrome (Puppeteer) and assert, at **several widths including > and < `--maxw`** (to catch centered-container drift, e.g. 1440 / 1180 / 900):
761. **Column adherence** — every placed `.band > *` left snaps to a column START and right to a column END (~0px). **Exclude the optically-aligned display elements** from this box check (their box is intentionally side-bearing-offset; they're validated in step 4). **Gotcha:** build BOTH the column-start set and the column-end set — a grid item spanning "to line N" ends at the *far* side of the gutter, so single-edge math falsely reports a one-gutter error.
772. **Overlay match** — each `.guides .col` rect equals the computed column rect (~0px).
783. **Baseline** — text tops modulo the baseline ≈ 0 (tolerance ≈ half a baseline; the box-top is a proxy — the leading does the real work).
794. **Optical ink** — each display element's ink-left (box − `actualBoundingBoxLeft`, real font) equals **its own** column line (nearest column-start to its box), not always line 1.
80 
81Sandbox Chrome flags that work: `--headless=new --no-sandbox --disable-gpu --disable-dbus --use-gl=angle --use-angle=swiftshader`. `file://` works for non-ES-module pages; the CLI `--screenshot` can hang on tall pages — drive via Puppeteer and screenshot per viewport. Read PNGs back with the image-capable Read tool to eyeball a **zoom crop of the top-left corner** (masthead vs body vs column line) — the fastest human check.
82 
83A clean run looks like: `col=0px overlay=0px baseline≤4px ink=0px` → `GRID VERIFY: PASS`.
84 
85---
86 
87## PART 4 — CRAFT DEFAULTS (so it looks excellent, not just aligned)
88- **Palette:** white `#fff`, ink `#111`, one accent (Swiss red `#e4002b`). No warm-cream Claude look; no blue/purple gradients.
89- **Type:** a real grotesque webfont (Inter / Helvetica Now / Archivo) for display + body; a **mono** (Space Mono / IBM Plex Mono) for folios, captions, grid annotations — reinforces the technical register. Non-Latin via Noto Sans JP etc.
90- **Hierarchy** through scale + weight + white space, not color. Treat key data as **large numerals**. Kicker labels in mono caps. Per-spread folios.
91- **Real photography.** Ground real subjects in real photos (`SearchImages`). **Host each image via `PublishFilePublicly` and embed the `pub.hyperagent.com` URL** — a `PublishWebpage` artifact runs in a sandboxed iframe that can't authenticate thread-scoped `/api/files/...` URLs (broken-image trap).
92- **Type fidelity if you ever rasterize art** (cairosvg / headless screenshots / image-gen reference): a `Helvetica`/`Arial` CSS stack silently falls back to **Noto Sans** (reads like Calibri). Render in **Liberation Sans** or an embedded Helvetica/Arimo TTF before trusting it. (Same trap as the optical-measurement caveat: wrong font in → wrong result out.)
93- **Spread model:** full-width sections, each its own per-spread `.grid` + `.guides`, consistent margins/folios.
94 
95---
96 
97## PART 5 — WORKFLOW
981. Pick the subject; gather real photos; host them publicly.
992. Generate the scaffold: `python3 grid_tokens.py` (or `--scaffold` for a full page; `--cols/--baseline/--gutter/--margin/--maxw/--accent` to taste; it warns if gutter/margin aren't baseline multiples).
1003. Build spreads as **subgrid bands**; place everything by **column line**; lock spacing/line-heights/media heights to the **baseline**.
1014. Add the overlay (same content box) + toggle + optical-alignment JS (already in the scaffold; point its selector list at your display elements).
1025. Publish, then **verify**: `CHROME=… PUP=… node verify_grid.js <file-or-url> --widths=1440,1180,900`. Eyeball a top-left zoom crop. Fix, republish.
103 
104## SCRIPTS
105- **`grid_tokens.py`** — deterministic scaffold generator. Emits the `:root` tokens, `.grid`/`.band` (subgrid) scaffold, `.guides` overlay CSS, toggle JS, and the optical-alignment JS — all wired to one source of truth. `--scaffold` emits a full minimal HTML page. No network/credentials.
106- **`verify_grid.js`** — Puppeteer harness implementing all four checks above with the corrected both-edges column math, the optical-exclusion, per-element column-line ink targeting, and PASS/FAIL output at multiple widths. Env: `CHROME` (chrome binary), `PUP` (puppeteer-core module path).
107 
108## CREED
109A grid you can't toggle on and measure is a mood board, not a system. Build it from one source of truth, prove it at 0px, and align the **ink**.
110 

Commands it names

  • python3 grid_tokens.py

Sections

  • Müller-Brockmann Grid Systems — built real, visible, and verified
  • PART 1 — THE DISCIPLINE (decide before drawing)
  • PART 2 — MAKE THE GRID REAL ON THE WEB (the load-bearing engineering)
  • 2.1 One source of truth
  • 2.2 The overlay MUST live in the SAME content box as the content ← #1 bug
  • 2.3 Place every element by column LINE via subgrid bands
  • 2.4 Lock vertical rhythm to the baseline
  • 2.5 The toggle (sizzle within the sizzle)
  • 2.6 OPTICAL ALIGNMENT — display ink, not its box ← the subtle bug
  • PART 3 — VERIFY (don't trust, measure) → `verify_grid.js`
  • PART 4 — CRAFT DEFAULTS (so it looks excellent, not just aligned)
  • PART 5 — WORKFLOW
  • SCRIPTS
  • CREED

What it covers

lint-formatdo-notagent-behaviour

Stack — with the evidence

node

(0.95)

shell

(0.80)

react

(0.70)

astro

(0.70)

express

(0.70)

vitest

(0.70)

typescript

(0.60)

javascript

(0.60)

python

(0.60)

github-actions

(0.60)

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
danielvm-git
Language
—
License
—
Archived
no

All configs in this repo

Also in danielvm-git/bigpowers

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 114Cursor rulesshellnode+8testtesting-strategydeployment66/1003 days ago
danielvm-git/bigpowers.cursor/rules/audit-code.mdc · 114Cursor rulesshellnode+8setuptestlint-formatstyle+466/1003 days ago
danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 114Cursor rulesnodeshell+8buildteststylegit74/1003 days ago
danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 114Cursor rulesshellnode+8buildgit58/1003 days ago
danielvm-git/bigpowers.cursor/rules/change-request.mdc · 114Cursor rulesshellnode+8no sections48/1003 days ago
danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 114Cursor rulesshellnode+8lint-formatstyletypesgit+382/1003 days ago
danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 114Cursor rulesshellnode+8styledo-notagent-behaviour65/1003 days ago
danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 114Cursor rulesshellnode+8style54/1003 days ago
danielvm-git/bigpowers.cursor/rules/craft-skill.mdc · 114Cursor rulesshellnode+8stylearchgitdo-not69/1003 days ago
danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 114Cursor rulesshellnode+8testtesting-strategydo-not57/1003 days ago
danielvm-git/bigpowers.cursor/rules/define-language.mdc · 114Cursor rulesshellnode+8lint-formatdo-not65/1003 days ago
danielvm-git/bigpowers.cursor/rules/define-success.mdc · 114Cursor rulesshellnode+8no sections4/1003 days ago
danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 114Cursor rulesshellnode+8git62/1003 days ago
danielvm-git/bigpowers.cursor/rules/deploy.mdc · 114Cursor rulesnodeshell+8setupbuildtestdeployment77/1003 days ago
danielvm-git/bigpowers.cursor/rules/design-interface.mdc · 114Cursor rulesshellnode+8styleagent-behaviour58/1003 days ago
danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 114Cursor rulesshellnode+8teststylearchtesting-strategy+585/1003 days ago
danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 114Cursor rulesshellnode+8no sections39/1003 days ago
danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 114Cursor rulesshellnode+8no sections44/1003 days ago
danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 114Cursor rulesshellnode+8git54/1003 days ago
danielvm-git/bigpowers.cursor/rules/edit-document.mdc · 114Cursor rulesshellnode+8no sections39/1003 days ago
Diff against .cursor/rules/assess-impact.mdc Diff against .cursor/rules/audit-code.mdc Diff against .cursor/rules/audit-plan.mdc Diff against .cursor/rules/build-epic.mdc Diff against .cursor/rules/change-request.mdc Diff against .cursor/rules/commit-message.mdc Diff against .cursor/rules/compose-workflow.mdc Diff against .cursor/rules/context7-mcp.mdc Diff against .cursor/rules/craft-skill.mdc Diff against .cursor/rules/deepen-architecture.mdc Diff against .cursor/rules/define-language.mdc Diff against .cursor/rules/define-success.mdc Diff against .cursor/rules/delegate-task.mdc Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/design-interface.mdc Diff against .cursor/rules/develop-tdd.mdc Diff against .cursor/rules/diagnose-root.mdc Diff against .cursor/rules/diagnose-stall.mdc Diff against .cursor/rules/dispatch-agents.mdc Diff against .cursor/rules/edit-document.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack