Skip to content

Commit d77bae6

Browse files
committed
add more evals guidance
1 parent 5e07adb commit d77bae6

4 files changed

Lines changed: 122 additions & 37 deletions

File tree

.changeset/clear-pages-compose.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Improves guidance and examples delivered through the Primer Brand MCP tools:
66

77
- Improves guidance delivered through the `primer_brand_review` tool.
88
- Cleaner output from the `primer_brand_examples` tool.
9+
- Add new page design guidance advising that `River` descriptions are limited to 160 characters and the default `50:50` image-to-text ratio is preferred.

apps/next-docs/content/components/River/index.mdx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import dontVisuals from './images/dont-visuals-size.png'
1919

2020
Use rivers to showcase features and introduce topics. Rivers are composed of images or videos paired alongside text content like headings, paragraphs, and links.
2121

22-
A river’s content should be short and concise, no longer than 3 or 4 sentences and in a single paragraph when possible.
22+
A river’s content should be short and concise, no longer than 160 characters, and contained in a single paragraph when possible.
2323

2424
<DoDontContainer>
2525
<Do>
@@ -34,20 +34,9 @@ A river’s content should be short and concise, no longer than 3 or 4 sentences
3434

3535
### Stacked
3636

37-
Two or more rivers can be stacked to guide the user through a set of features. When stacking rivers, alternate between left and right alignments to create a more dynamic reading flow. When alternating alignments, use a `40:60` image to text ratio, otherwise keep the ratio to `50:50`.
37+
Two or more rivers can be stacked to guide the user through a set of features. Keep rivers in a stack consistently aligned to create a predictable reading flow. For gridline rivers, always use start alignment. Don't use zig-zag layouts.
3838

39-
It is possible to use 2 or more following left or right river to create a simple alignment promoting easy scroll scan.
40-
41-
<DoDontContainer>
42-
<Do>
43-
<img alt="" src="https://github.com/primer/brand/assets/912236/a7f8bca8-78e6-4e29-a44b-5a305ffeeeae" />
44-
<Caption>Alternate rivers with left and right alignments.</Caption>
45-
</Do>
46-
<Dont>
47-
<img alt="" src="https://github.com/primer/brand/assets/6951037/169d5c19-67f4-4f15-8e3b-80c877b34af1" />
48-
<Caption>Don't break the flow in a stack of rivers that would otherwise stay aligned.</Caption>
49-
</Dont>
50-
</DoDontContainer>
39+
Prefer the default 50:50 image-to-text ratio where possible. Use 60:40 only when the visual needs more space or emphasis.
5140

5241
Note that too many rivers can make the design feel repetitive. In that situation, consider introducing a breakout section or break the content with a different component, such as [pillar](/components/Pillar) or [card](/components/Card) to provide a better visual hierarchy and experience. For example, use the river for the top features you want to highlight and then use pillars to showcase the rest.
5342

@@ -179,7 +168,7 @@ The image is automatically styled to fit the width of the parent container. If y
179168

180169
- We recommend using a river left as the first river of the flow to start with a visual and avoid stacking text with above section on mobile
181170
- River components stacks create a unit, the set should be considered to be the main parent section. The parent section should be spaced as a regular section with the largest spacing while internal elements should use smaller spacing
182-
- If the image is critical for the user to understand the message, default to right aligned. If the text is critical for the user to understand the image, choose left aligned.
171+
- For a standalone river, choose its alignment based on whether the visual or text needs emphasis. Keep every river in a stack consistently aligned.
183172

184173
### Link
185174

packages/mcp/content/page-design.md

Lines changed: 109 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,123 @@ Resolve exact sizes and weights with `primer_brand_tokens`.
6565

6666
## Component & element patterns
6767

68-
### Do
69-
70-
- **Heroes** — include relevant media and a label. Prefer a real product shot via `Hero.Image` / `Hero.Video`; use Asset Generator `create_product_landscape` when generating one, or `create_wallpaper` when a product shot does not fit. Keep decorative or illustrative media inside the shared grid with a stable aspect ratio and a token-backed maximum height so it cannot dominate the page or bleed full-width. If needed, place custom media after `Hero`; use `trailingComponent` only when it must live inside the Hero composition.
71-
- **Rivers** — use `<River variant="gridline" align="start">` throughout a page; omitting `align` also means start.
72-
- **Repeated panels** — place `Card`, `Pillar`, `Box`, or custom items in a square frame using `<Grid columnGap="none" rowGap="none" enableGutters={false}>`. Draw shared dividers on custom frame/cell wrappers and use `border-radius: 0` there; do not override `Card` or `Pillar` internals. `Pillar` has no grid variant.
73-
- **CTAs without media** — use the default `CTABanner` with `align="center"` and `hasGridLines`.
74-
- **CTAs with media** — use `<CTABanner variant="balanced" hasGridLines>` with a direct `CTABanner.Image`. Use Octovisuals for artwork; reserve `CTABanner.Logo` for genuine logos.
75-
- **Forms** — use a square, zero-gap `Grid` with connected benefits beside a subtle form surface. Use responsive token gutters, Primer Brand form controls, and an enabled `<Button variant="primary" type="submit">`.
76-
- **FAQs** — use `FAQGroup` navigation for multiple meaningful categories and one `FAQ` directly for a single category.
77-
- **Section backgrounds** — keep one default background across sections. Use `backgroundColor="subtle"` only to clarify a functional region.
78-
- **Labels** — use `Hero.Label`, `SectionIntro.Label`, or `EyebrowText`; keep labels intrinsic-width and aligned with their section.
79-
- **Lists** — use dot bullets without decorative dividers between items.
80-
- **Buttons** — show enabled controls with a clear primary/secondary hierarchy.
81-
- **Icons** — keep Octicons at the default green in `Card.Icon`, `Pillar.Icon`, and `Icon` unless there is a deliberate exception.
82-
83-
### Don't
68+
### Hero
69+
70+
**Do**
71+
72+
- Include relevant media and a label. Prefer a real product shot via `Hero.Image` / `Hero.Video`; use Asset Generator `create_product_landscape` when generating one, or `create_wallpaper` when a product shot does not fit.
73+
- Keep decorative or illustrative media inside the shared grid with a stable aspect ratio and a token-backed maximum height so it cannot dominate the page or bleed full-width.
74+
- If needed, place custom media after `Hero`; use `trailingComponent` only when it must live inside the Hero composition.
75+
76+
**Don't**
8477

8578
- Add irrelevant hero media or use social templates such as `create_social_square` or `create_landscape` for hero media.
8679
- Let decorative or illustrative Hero media grow arbitrarily tall or bleed outside the shared grid.
80+
81+
### River
82+
83+
**Do**
84+
85+
- Use `<River variant="gridline" align="start">` throughout a page; omitting `align` also means start.
86+
- Keep River descriptions to a maximum of 160 characters.
87+
- Prefer the default `50:50` image-to-text ratio where possible; set `imageTextRatio="60:40"` only when the visual needs more space or emphasis.
88+
89+
**Don't**
90+
8791
- Zigzag gridline Rivers with `align="end"`.
88-
- Render repeated panels as separate rounded cards, double their shared borders, override `Card` / `Pillar` radius, or invent a grid variant for `Pillar`.
92+
93+
### Repeated panels
94+
95+
**Do**
96+
97+
- Place `Card`, `Pillar`, `Box`, or custom items in a square frame using `<Grid columnGap="none" rowGap="none" enableGutters={false}>`.
98+
- Draw shared dividers on custom frame/cell wrappers and use `border-radius: 0` there.
99+
100+
**Don't**
101+
102+
- Render repeated panels as separate rounded cards, double their shared borders, or override `Card` / `Pillar` internals.
103+
- `Pillar` has no grid variant; don't invent one.
104+
105+
### CTABanner
106+
107+
**Do**
108+
109+
- Without media, use the default `CTABanner` with `align="center"` and `hasGridLines`.
110+
- With media, use `<CTABanner variant="balanced" hasGridLines>` with a direct `CTABanner.Image`. Use Octovisuals for artwork; reserve `CTABanner.Logo` for genuine logos.
111+
112+
**Don't**
113+
89114
- Use `CTABanner variant="balanced"` without a direct `CTABanner.Image`, or use `CTABanner.Logo` for decorative artwork.
115+
116+
### Forms
117+
118+
**Do**
119+
120+
- Use a square, zero-gap `Grid` with connected benefits beside a subtle form surface. Use responsive token gutters, Primer Brand form controls, and an enabled `<Button variant="primary" type="submit">`.
121+
122+
**Don't**
123+
90124
- Use raw form controls or put the form section in a floating rounded panel.
125+
126+
### FAQs
127+
128+
**Do**
129+
130+
- Use `FAQGroup` navigation for multiple meaningful categories and one `FAQ` directly for a single category.
131+
132+
**Don't**
133+
91134
- Show `FAQGroup` navigation for a single category.
135+
136+
### Section backgrounds
137+
138+
**Do**
139+
140+
- Keep one default background across sections. Use `backgroundColor="subtle"` only to clarify a functional region.
141+
142+
**Don't**
143+
92144
- Alternate section background colors merely for decoration.
93-
- Stretch Label components full-width or hand-style replacements for the label components. Labels should preserve their auto width, don't let the parent stretch them.
94-
- Use dashes as bullets, make normal controls look disabled, or tint default-green Octicons without a deliberate reason. `Pillar.Icon` has no `color` prop.
145+
146+
### Labels
147+
148+
**Do**
149+
150+
- Use `Hero.Label`, `SectionIntro.Label`, or `EyebrowText`; keep labels intrinsic-width and aligned with their section.
151+
152+
**Don't**
153+
154+
- Stretch Label components full-width or hand-style replacements for the label components. Labels should preserve their auto width; don't let the parent stretch them.
155+
156+
### Lists
157+
158+
**Do**
159+
160+
- Use dot bullets without decorative dividers between items.
161+
162+
**Don't**
163+
164+
- Use dashes as bullets.
165+
166+
### Buttons
167+
168+
**Do**
169+
170+
- Show enabled controls with a clear primary/secondary hierarchy.
171+
172+
**Don't**
173+
174+
- Make normal controls look disabled.
175+
176+
### Icons
177+
178+
**Do**
179+
180+
- Keep Octicons at the default green in `Card.Icon`, `Pillar.Icon`, and `Icon` unless there is a deliberate exception.
181+
182+
**Don't**
183+
184+
- Tint default-green Octicons without a deliberate reason. `Pillar.Icon` has no `color` prop.
95185

96186
## Visual verification
97187

packages/mcp/src/tools/primer-brand-page-design/primer-brand-page-design.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ describe('primer_brand_page_design', () => {
99
expect(result.text).toContain('gridline')
1010
expect(result.text).toContain('FlexSuiteAIOverview')
1111
expect(result.text).toContain('<River variant="gridline" align="start">')
12+
expect(result.text).toContain('Keep River descriptions to a maximum of 160 characters')
13+
expect(result.text).toContain('Prefer the default `50:50` image-to-text ratio')
14+
expect(result.text).toContain('imageTextRatio="60:40"')
1215
expect(result.text).toContain('`Pillar` has no grid variant')
13-
expect(result.text).toContain('### Do')
14-
expect(result.text).toContain("### Don't")
15-
expect(result.text).toContain('**Repeated panels**')
16+
expect(result.text).toContain('### Hero')
17+
expect(result.text).toContain('### River')
18+
expect(result.text).toContain('**Do**')
19+
expect(result.text).toContain("**Don't**")
20+
expect(result.text).toContain('### Repeated panels')
1621
expect(result.text).toContain('`Card`, `Pillar`, `Box`, or custom items')
1722
expect(result.text).toContain('border-radius: 0')
1823
expect(result.text).toContain('<CTABanner variant="balanced" hasGridLines>')

0 commit comments

Comments
 (0)