Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rails-consultant",
"description": "A collection of skills for Rails development and consulting, with an emphasis on learning, communication, and client success",
"version": "2.0.0",
"version": "2.1.0",
"author": {
"name": "thoughtbot"
},
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## [Unreleased]

## [2.1.0] - 2026-11-06

- `/diff-explainer` pages use thoughtbot's brand colors and type, per
[#61](https://github.com/thoughtbot/rails-consultant/issues/61). Cosmica and
PP Mori aren't on Google Fonts, so most readers get the same Helvetica
fallback thoughtbot.com uses. Note kinds keep their blue, amber, and purple so
they stay easy to tell apart.
- `/diff-explainer`'s "Start here" watch list is callouts now, matching the
file notes, and the first file gets its gap back.

## [2.0.0] - 2026-11-06

- Replace every skill with the stack-agnostic set from
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: regex
target: { source: file, path: scratchpad/walkthrough.html }
pattern: "--brand: #e03131"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: regex
target: { source: file, path: scratchpad/walkthrough.html }
pattern: '<article>(?:(?!</article>)[\s\S])*<aside data-note="risk"'
---
5 changes: 3 additions & 2 deletions skills/diff-explainer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ choose: pick the element that describes the content — `<ins>` and `<del>` for
`<aside data-note>` for an annotation — and leave the `<style>` block alone, so every
walkthrough reads the same way. Everything inside `<main>` is a worked example —
replace it. Three calls the comment doesn't make: the `<hgroup>` carries the change's
_name_, two to four words, not a summary; the watch list `<dl>` holds the two to four
things a reviewer would regret missing; and the `data-note` kinds are color-coded, so
_name_, two to four words, not a summary; the watch list holds the two to four
things a reviewer would regret missing, one `<aside data-note>` each inside "Start
here"; and the `data-note` kinds are color-coded, so
pick the one that's true. Four things reliably spoil the page: unescaped `&`, `<`, `>`
in diff lines; raw typographic characters (write `&mdash;`, `&minus;`, `&hellip;` —
these pages get saved locally, where raw multi-byte characters turn into mojibake);
Expand Down
63 changes: 36 additions & 27 deletions skills/diff-explainer/assets/walkthrough-template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<title>Session Store Swap</title>
<meta name="claude:viewport-fit-sides" content="cover">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap">

<!--
DIFF WALKTHROUGH TEMPLATE
Expand All @@ -9,15 +9,17 @@
purpose: pick the element that describes the content and the stylesheet styles
it. Every colour is a token on :root with a dark-mode copy, so the page follows
the reader's theme. Don't rewrite it - every walkthrough is supposed to look the
same so a reviewer learns the page once.
same so a reviewer learns the page once. It follows thoughtbot's brand
(thoughtbot.com/playbook/the-thoughtbot-way/brand).

Everything inside <main> is a WORKED EXAMPLE (an Express app moving sessions to
Redis, with no reader background named). Replace it with the real change.

The elements and what they mean here:
<header> + <hgroup> title and one-line thesis; the <dl> under it is branch/churn
<article> "Start here" - the problem and its everyday analogy,
then the summary card and the watch list
then the summary card and the watch list, one
<aside data-note> per item
<ol> / <li> the walkthrough, one item per file or tight group of files
<pre><code> the diff. <ins> a added line, <del> a removed line,
bare text a context line, <small> a hunk header,
Expand Down Expand Up @@ -45,26 +47,27 @@
<style>
/* One reading column; diffs scroll sideways inside their own box. */
:root {
--bg: #f7f8fa; --surface: #eceff4; --fg: #1c2230; --muted: #5a6376; --line: #d3d9e3;
--why: #2a5bd7; --risk: #c0362c; --ins: #1d7a3c; --tradeoff: #8a5800; --alternative: #6a4cbb;
--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
--mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
--bg: #ffffff; --surface: #faf9f9; --fg: #201313; --muted: #7b6e68; --line: #eae6e4;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: In light mode --surface (#faf9f9) is barely different
from --bg (#ffffff), about 1.05:1, and code blocks and notes have no
border, so they nearly blend into the page. We might want a darker
surface, though the playbook's next gray (#eae6e4) drops muted text to
3.96:1, under AA.

On a light screen, the gray boxes around code and notes are so pale
they're hard to see. It's like writing on a sticky note that's almost
the same white as the paper it's stuck to: the words are fine, but you
can't tell where the note starts and stops.

Claude Opus 5.5 (claude-opus-5-5)

--brand: #e03131; --why: #2a5bd7; --risk: #e03131; --ins: #1d7a3c; --tradeoff: #8a5800; --alternative: #6a4cbb;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tradeoff: We keep blue, amber, purple, and green for the note
kinds and added lines, since the brand palette is only red and grays.
A strict red-and-grays version made tradeoff and alternative look the
same; note labels are body-colored now too, so the left border carries
the color alone.

The page marks each note as a why, a risk, a tradeoff, or an
alternative, with a colored stripe down its side. With only red and
gray to pick from, two of those kinds would look identical. It's like
color-coded file folders: if two piles share a color, you have to read
every label to tell them apart.

Claude Opus 5.5 (claude-opus-5-5)

--heading: Cosmica, "Helvetica Neue", Helvetica, Arial, sans-serif;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tradeoff: We list Cosmica and PP Mori first, but nothing loads
them, since they're paid and Artifacts only load stylesheets from
Google Fonts. Readers get Helvetica Neue on Apple devices and Arial on
most others, the same fallback thoughtbot.com declares.

Unless someone has our brand fonts installed on their own computer,
the page shows its headings and text in a stand-in font. It's like a
recipe that calls for a specialty flour: if your pantry doesn't have
it, you bake with the regular kind.

Claude Opus 5.5 (claude-opus-5-5)

--sans: PPMori, "PP Mori", "Helvetica Neue", Helvetica, Arial, sans-serif;
--mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
--space: 1rem;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #12151b; --surface: #1b2029; --fg: #e3e7ee; --muted: #98a1b3; --line: #2c3341;
--why: #7ea4ff; --risk: #ff7b72; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2;
--bg: #201313; --surface: #2f1c1c; --fg: #faf9f9; --muted: #c1bab7; --line: #7b6e68;
--brand: #f74239; --why: #7ea4ff; --risk: #f74239; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2;
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--bg: #12151b; --surface: #1b2029; --fg: #e3e7ee; --muted: #98a1b3; --line: #2c3341;
--why: #7ea4ff; --risk: #ff7b72; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2;
--bg: #201313; --surface: #2f1c1c; --fg: #faf9f9; --muted: #c1bab7; --line: #7b6e68;
--brand: #f74239; --why: #7ea4ff; --risk: #f74239; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2;
color-scheme: dark;
}

body { background: var(--bg); color: var(--fg); font: 1rem/1.6 var(--sans); }
body { background: var(--bg); color: var(--fg); font: 1rem/1.6 var(--sans); border-top: 0.25rem solid var(--brand); }
main {
max-width: 52rem; margin: 0 auto;
padding-block: calc(var(--space) * 2.5);
Expand All @@ -73,8 +76,8 @@
}
main > * + * { margin-top: calc(var(--space) * 2.5); }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; text-wrap: balance; }
h1 { font-size: 2rem; }
h1, h2, h3 { margin: 0; font-family: var(--heading); line-height: 1.25; font-weight: 600; text-wrap: balance; }
h1 { font-size: 2rem; font-weight: 500; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 var(--space); max-width: 65ch; }
hgroup { margin-bottom: var(--space); }
Expand All @@ -87,18 +90,19 @@

article { padding: calc(var(--space) * 1.5); border: 1px solid var(--line); border-radius: 6px; }
article > header { margin-bottom: var(--space); }
article p { max-width: none; }

ol { margin: 0; padding: 0; list-style: none; }
ol { margin-bottom: 0; padding: 0; list-style: none; }
ol > li + li { margin-top: calc(var(--space) * 3); padding-top: calc(var(--space) * 3); border-top: 1px solid var(--line); }
li h2 { font-size: 1.15rem; overflow-wrap: anywhere; }

code, pre { font-family: var(--mono); font-size: 0.875rem; }
code, pre { font-family: var(--mono); font-size: 0.875rem; font-variant-ligatures: none; }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: Ligatures are off because JetBrains Mono drew => and
--> as single arrows, which misreports a diff and bent the ASCII
figures. No grader checks for it, so a model that rewrites this rule
would still pass; we might want a regex grader next to brand-kept.

The code font on its own merges some character pairs into one symbol,
so two typed characters showed up as one arrow. We turned that off,
but nothing would catch it if it got turned back on. It's like a
typewriter that sometimes stamps a fancy symbol for two keys you
pressed: the page no longer matches what was typed.

Claude Opus 5.5 (claude-opus-5-5)

code { padding: 0.1em 0.3em; border-radius: 3px; background: var(--surface); }
h2 > code, h3 > code, pre code { padding: 0; background: none; font-size: inherit; }
pre { margin: 0 0 var(--space); padding: var(--space); overflow-x: auto; line-height: 1.5; border-radius: 6px; background: var(--surface); }
ins, del { text-decoration: none; }
ins { color: var(--ins); background: color-mix(in srgb, var(--ins) 12%, transparent); }
del { color: var(--risk); background: color-mix(in srgb, var(--risk) 12%, transparent); }
ins { background: color-mix(in srgb, var(--ins) 15%, transparent); }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tradeoff: Added and removed lines keep the body text color and
only get a tinted background, because the playbook says thoughtbot red
is never text. The +/- and the tint are what mark them now.

Lines that were added or removed used to be written in green or red.
Now the words stay the normal color and only the highlight behind them
changes. It's like marking up a printout with a highlighter instead of
rewriting the lines in red pen.

Claude Opus 5.5 (claude-opus-5-5)

del { background: color-mix(in srgb, var(--risk) 15%, transparent); }
pre small, pre em { color: var(--muted); font-size: inherit; }

figure {
Expand All @@ -122,8 +126,9 @@
aside pre { background: var(--bg); }
aside h3 {
margin-bottom: 0.35rem;
color: var(--note);
font-family: var(--mono);
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
}
Expand Down Expand Up @@ -172,14 +177,18 @@ <h1>Session Store Swap</h1>
<figcaption>Sessions move out of each process and into one shared store.</figcaption>
</figure>
<p>The change is small on purpose. Nothing about how login works changed; only where the session is kept. Not in this branch: no migration of existing sessions, and no Redis in the test suite &mdash; tests still use the in-memory store.</p>
<dl>
<dt>Risk</dt>
<dd>Deploying this logs everyone out once. Existing sessions live in the old store and nothing copies them over.</dd>
<dt>Tradeoff</dt>
<dd>Redis is now required to boot, so <code>REDIS_URL</code> has to be set before the release goes out, or the new release crashes on boot.</dd>
<dt>Alternative</dt>
<dd>Signed cookies would have needed no Redis at all, since the session rides along in the cookie itself. Our payload is over the 4KB limit, so that was out.</dd>
</dl>
<aside data-note="risk">
<h3>Risk</h3>
<p>Deploying this logs everyone out once. Existing sessions live in the old store and nothing copies them over.</p>
</aside>
<aside data-note="tradeoff">
<h3>Tradeoff</h3>
<p>Redis is now required to boot, so <code>REDIS_URL</code> has to be set before the release goes out, or the new release crashes on boot.</p>
</aside>
<aside data-note="alternative">
<h3>Alternative</h3>
<p>Signed cookies would have needed no Redis at all, since the session rides along in the cookie itself. Our payload is over the 4KB limit, so that was out.</p>
</aside>
</article>

<ol>
Expand Down
Loading