Skip to content

Conversation

@LinKCoding
Copy link
Contributor

@LinKCoding LinKCoding commented Oct 27, 2025

Overview

Adds a style guide for documentation purposes

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-157
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

Don't make me tap the sign.

  1. Go to story /?path=/docs/meta-style-guide-about--docs
  2. Check that the links work
  3. Go through the pages and check that guidelines make sense
  4. ...
  5. Finish and do a celebratory dance

PR Links and Envs

N/A

@LinKCoding LinKCoding requested a review from a team as a code owner October 27, 2025 18:28
@nx-cloud
Copy link

nx-cloud bot commented Oct 27, 2025

View your CI Pipeline Execution ↗ for commit bc10713


☁️ Nx Cloud last updated this comment at 2025-10-29 15:28:45 UTC

Copy link
Contributor

@aresnik11 aresnik11 left a comment

Choose a reason for hiding this comment

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

Some initial thoughts!

Copy link
Contributor

@dreamwasp dreamwasp left a comment

Choose a reason for hiding this comment

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

lgtm, def want emily to take a look!

@codecademydev
Copy link
Collaborator

📬 Published Alpha Packages:

@codecademy/[email protected]

@github-actions
Copy link
Contributor

Copy link
Member

@sh0ji sh0ji left a comment

Choose a reason for hiding this comment

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

Finally had a chance to get my thoughts down, and there are a lot of them but I'm generally very excited about this. Great job on it!

Two other, more meta questions:

  1. Should this guide live in Storybook? If it's for people writing Gamut documentation, my inclination is that it should be part of a contribution guide rather than part of Gamut docs.
  2. How do we want to this guide to relate to Codecademy styling and grammar? Should our guide be aware of it? In deference to it? The draft you've written doesn't currently seem to acknowledge it and even conflicts with it in a few places (I only noted one).

Comment on lines +17 to +20
id: 'Meta/Style Guide',
title: 'Style Guide',
subtitle:
'Guidelines and standards for creating consistent, clear, and effective documentation.',
Copy link
Member

@sh0ji sh0ji Nov 5, 2025

Choose a reason for hiding this comment

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

I initially thought this guide was a general guide for writing documentation anywhere across Skillsoft because of the title and description. I think it's better off starting as a guide for writing documentation in Gamut. Even if we think it'll be more widely useful, it's best to start narrow and broaden based on user needs.

I might suggest something like this but I know @uxemilylee had other ideas.

Suggested change
id: 'Meta/Style Guide',
title: 'Style Guide',
subtitle:
'Guidelines and standards for creating consistent, clear, and effective documentation.',
id: 'Meta/Gamut Writing Guide',
title: 'Gamut Writing Guide',
subtitle:
'Guidelines for consistent, clear, and effective documentation in Gamut.',

Copy link
Contributor

Choose a reason for hiding this comment

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

I like these suggestions! "Gamut Documentation Writing Guide" would be the most specific to me, but I'm OK with "Gamut Writing Guide" and we could monitor just in case people misinterpret these as writing for specific components.

## Voice and Tone

- Friendly and conversational: Write as if explaining to a colleague
- Direct and action-oriented: Use "you" to address readers
Copy link
Member

@sh0ji sh0ji Nov 5, 2025

Choose a reason for hiding this comment

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

I much prefer "we" in any writing where the reader is learning from an expert because it quietly invites the reader to be the expert, whereas "you" creates a line between author and reader: "I the expert am telling you the novice what's what." Or more simply, "we" is inclusive, "you" creates separation.

My general advice here is to prefer "we" whenever possible because there will be times when "you" is the better choice. For instance, it wouldn't make sense to say "use our best judgment" if we're encouraging the reader to use their judgment, so "use your best judgment" would be fine. But those instances are surprisingly rare—we can usually use "we" for most things without much effort.

- Clearly indicate component status:
- `current`: Stable, recommended for use
- `updating`: In progress, API may change
- `deprecated`: Do not use for new work
Copy link
Member

Choose a reason for hiding this comment

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

Small quibble: "deprecated" means still actively supported but an end is planned. I mention it because a lot of people think it means "no longer supported" in my experience.

Copy link
Contributor

Choose a reason for hiding this comment

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

Quick question, are these 4 component status labels considered "props"?

<Meta title="Meta/Style Guide/General Principles" />

<AboutHeader {...parameters} />

Copy link
Member

Choose a reason for hiding this comment

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

It'd be good to have an introductory paragraph to this page especially, but we also might want that for every separate page. This page's introduction should be philosophical and inspirational, helping to answer "why" for subsequent style opinions.

For instance: "Great documentation improves understanding. Not just for our readers but for us, the authors. The act of writing forces us to articulate our mental models clearly so that our readers can share in our framing and understanding." (don't use this, it's just off the dome)

I'm also very partial to the Vue writing guide opening paragraph:

Writing documentation is an exercise in empathy. We're not describing an objective reality - the source code already does that. Our job is to help shape the relationship between users and the Vue ecosystem. This ever-evolving guide provides some rules and recommendations on how to do that consistently within the Vue ecosystem.

Aside from the clarity of their perspective on the point of documentation, I like their inclusion of "this ever-evolving guide" since it makes it immediately clear that their guidance isn't final.


## Numbers

- Spell out numbers one through nine
Copy link
Member

Choose a reason for hiding this comment

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

This is in conflict with brand guidelines:

Use numerals for all number (5 not five). Exceptions can be made for common phrases (e.g. The one thing to remember is...)

There might be other examples of this. We should find and then reconcile all of them, either by sticking to the conflict and explaining why it needs to be different in our context, or deferring to the brand guide.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was one the conflicts I noticed, and I suggest unifying this guideline to say use numerals for all numbers. => This helps with consistency for multiple people writing in systems, and there is some readability research that supports this for ease of reading on the web.


- Use bash syntax highlighting
- Don't include command prompt symbols ($, #)
- Use yarn as the default package manager
Copy link
Member

Choose a reason for hiding this comment

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

Let's not include user space technology choices in our guidelines. If anything, we should recommend documentation writers be inclusive about the technology choices of our users.

# install with your package manager of choice
npm install @codecademy/gamut-kit
pnpm add @codecademy/gamut-kit
yarn add @codecademy/gamut-kit

Or better yet, let the user choose their package manager globally and then just show commands for it.
For instance, this is what I did for the Norton Design System's getting started guide (source code).


## File Paths

- Use forward slashes: `packages/gamut/src/Button/index.tsx`
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to say this?

Comment on lines +65 to +66
- Use absolute paths from workspace root when clearer
- Format as inline code: `/packages/styleguide/src`
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you mean absolute paths here. /packages/styleguide/src doesn't exist on my computer, for instance. I keep my copy of the repo at $HOME/code/gamut, so the absolute path would be /Users/evan.yamanishi/code/gamut/packages/styleguide/src.

Comment on lines +76 to +103
## API Reference

### Props documentation:

Add [JSDoc](https://jsdoc.app/) comments to the props to provide additional clarity for what these props do — these comments is used by TypeScript when hovering over a prop, additional it also shows up in the props table of a component's story in Storybook.

```tsx
export type ButtonProps = {
/**
* The visual style variant of the button.
*/
variant: 'primary' | 'secondary';

/**
* Whether the button is disabled.
*/
disabled?: boolean;
};
```

### Guidelines:

- Full sentence descriptions
- Start boolean descriptions with "Whether"
- Document required vs. optional props
- Include type information
- Use discretion for whether a comment is needed or not
- If you're unsure, then include a comment
Copy link
Member

Choose a reason for hiding this comment

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

Could we split this into a separate section on writing documentation in code? This page is about referencing code, but I think there's a lot of benefit of having consistent comments in our code, and we probably want a style guide for that.

Copy link
Member

Choose a reason for hiding this comment

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

How would you feel about directing contributors to follow the component story format standard (CSF) or even the Storybook docs on writing stories in TypeScript? We could then have this page focus purely on Gamut style: the situations where we have an opinion about something that's flexible in CSF, or requirements that are unique to Gamut.

@sh0ji
Copy link
Member

sh0ji commented Nov 6, 2025

Another thought: a lot of this guidance would be very useful in an agent instructions/rules/skills file. I often have Cursor help me write docs, and it always seems to format things in ways I don't like, so I end up having to correct it. This guide would be a huge help with that.

For instance:

  • ./.cursor/rules/documentation-style.mdc - for Cursor
  • ./.github/instructions/documentation-style.instructions.md - for GitHub Copilot & VSCode
  • ./CLAUDE.md - for Claude, which just allows for the one file
    • I think Skills would be something like ./skills/documentation/{SKILL,STYLE}.md, where the SKILL.md "imports" the STYLE.md file, but I haven't used that yet.


## Capitalization

- Sentence case for all headings, buttons, and UI text
Copy link
Contributor

@uxemilylee uxemilylee Nov 7, 2025

Choose a reason for hiding this comment

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

It looks like we need to make all the headings in the writing guidelines section conform to sentence case...

Also a couple of copy editing items:
Language and Grammer => Language and grammar
Refencing Code => Referencing code

'Meta',
['About', 'Best Practices', 'Contributing', 'FAQs', 'Stories'],
[
'About',
Copy link
Contributor

@uxemilylee uxemilylee Nov 7, 2025

Choose a reason for hiding this comment

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

@LinKCoding What do you think of the order of the sections? Would we want descending order based on priority? It looks like it's alphabetical in the left nav, and there's a mismatch between the left nav and when I'm on the About page.

- `updating`: In progress, API may change
- `deprecated`: Do not use for new work
- `static`: Reference material, no active development
- Link to source code and design files (Figma, GitHub)
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nitpick 😅: Could we switch the order to match:

Link to source code and design files (GitHub, Figma)


- Use active voice: "The component renders..." not "The component is rendered by..."
- Use second person ("you") when addressing the reader
- Use imperative mood for instructions: "Add the component" not "You should add the component"
Copy link
Contributor

Choose a reason for hiding this comment

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

Lol thanks for using this phrase! "imperative mood"

- Use "you" for the user
- Avoid "we" unless referring to the Codecademy team
- Avoid “I/my/me” entirely
- Avoid "your/my" in button labels: prefer "Go to dashboard" over "Go to your dashboard"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this getting into the component-specific writing guidelines? Or are there parts of Storybook where contributors are writing buttons?

- Sentence case for all headings, buttons, and UI text
- PascalCase for component names: `MyComponent`, `ButtonGroup`
- camelCase for props and variables: `onClick`, `backgroundColor`
- Capitalize proper nouns: Codecademy, Storybook, Figma, GitHub
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the succinctness and clarity of the sections!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants