agentleFS
nexuslabs-ainexuslabs-ai/nxds/.agents/skills/docs-writing/SKILL.md

docs-writing

Skill4 starsChanged 15 days agoMITView on GitHub

Write or rewrite nxds docs prose in the plain nxds voice. Use when adding or editing a docs page (apps/docs/content/**/*.mdx or apps/docs/app/_pages/**), a component or story description in *.stories.tsx, or prop JSDoc that feeds the Props table. Triggers on "write a docs page", "document X", "rewrite this page", "simplify the docs", "add a story description".

19 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every code block starts with a path comment (// app/layout.tsx).

    line 75
  2. Distinctive:

    When a later step edits an earlier file, show the whole file again.

    line 76
  3. Distinctive:

    Put the table a reader uses before the explanation of how it was made.

    line 94
  4. Distinctive:

    Write figures (APCA targets, opacity ranges) in tables, not sentences.

    line 95
  5. Very specific:

    Component description: Use at most three sentences.

    line 123
  6. Distinctive:

    When a component has several rules, give it a short bullet list (one rule per bullet) instead of one long sentence joined by semicolons.

    line 134
  7. Very specific:

    Story description: Write one sentence that names the scenario and the outcome.

    line 137
  8. Distinctive:

    Prop JSDoc: Write a fragment that starts with a verb or a noun.

    line 142
  9. Distinctive:

    Make each code block runnable once its imports are copied: Keep imports in the block.

    line 157
  10. Very specific:

    Put data-md-skip on a live preview or specimen that means nothing as text.

    line 165
  11. Distinctive:

    Run this on an MDX page. It prints sentences over 25 words:

    line 207

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Docs Writing

Purpose

Turn what a reader needs to do into the shortest page that does it. The voice rules live in docs-voice.md. This skill adds the page templates, a self-check, and worked rewrites.

The voice is modelled on shadcn/ui and Base UI, plus Ant Design's fixed page skeleton. Every page should read like those: one sentence, then code.

Steps

  1. Pick the page type from the table below. Its template sets the headings.
  2. List what the reader does, in order. Each action becomes a step or an example. Anything the reader doesn't act on is a candidate to cut.
  3. Sort the rest. Engine internals go to a Foundations page. Release history goes to the changelog. A rule with many exceptions keeps the rule plus the one exception a reader will hit.
  4. Write the code first, then one or two sentences around each block.
  5. Run the self-check at the end of this file and fix every miss.

Page types

TypeLives inAnswers
Guidecontent/getting-started/, content/theming/How do I set this up or change it?
Foundationapp/_pages/foundations/How does this part of the system work?
Patternapp/_pages/patterns/How do I build this screen?
Componentgenerated from *.stories.tsx and JSDocWhat is it, and how do I use it?

Guide

# {Task as a noun phrase: "Install", "Theme setup"}

{One sentence: what the reader has when they finish.}

{Optional: one sentence on who this is for, or what to read first.}

## {Verb phrase: "Install Tailwind 4"}

{One sentence saying what to do.}

```bash
{the command or file}
```

{Optional: one sentence on what it does, or one "If …, …" caveat.}

## Check your setup

- [ ] {Something the reader can see}

## Next steps

- **[Page](/link)**: {what they get there, under 10 words}
  • Number steps only when order matters.
  • Mark optional steps in the heading: "(Optional) Add lint rules".
  • Every code block starts with a path comment (// app/layout.tsx).
  • When a later step edits an earlier file, show the whole file again.

Foundation

This is where "how it works" lives. The voice rules still apply.

# {Noun: "Color"}

{One sentence: what this part of the system controls.}

## {What you use} ← tokens or utilities, as a table

## How it works ← the engine, in short steps or a numbered pipeline

## {Reference} ← scales, thresholds, mappings as tables
  • Put the table a reader uses before the explanation of how it was made.
  • Write figures (APCA targets, opacity ranges) in tables, not sentences.

Pattern

# {Screen: "Forms"}

{One sentence: what the pattern builds, and from which components.}

{Live example}

## Choose an approach ← table: if you need … | use …

## {Step per decision} ← verb headings

## What your app owns ← bullets

Component

Component pages are generated. Three sources feed them:

SourceShown asTemplate
parameters.docs.description.componentPage and Storybook summaryWhat it is, then when to use it
parameters.docs.description.storyExample captionOne sentence: the scenario and outcome
JSDoc on a prop or on the {Name}Props memberProps table descriptionA fragment of 12 words or fewer

Component description. Use at most three sentences. The page shows it under the heading. Wrap code in backticks. Lines starting with - render as a list.

{Name} {does what}. Use it for {situation}. For {other situation}, use {Other}.

Button triggers an action. Use it for short, visible labels. Icon-only buttons need an aria-label.

When a component has several rules, give it a short bullet list (one rule per bullet) instead of one long sentence joined by semicolons.

Story description. Write one sentence that names the scenario and the outcome. On a story tagged docs, it's the example's caption.

Keep the footer visible while the content scrolls.

Prop JSDoc. Write a fragment that starts with a verb or a noun. The table already shows the type and default, so don't repeat them.

BeforeAfter
Whether the button is disabledPrevents interaction.
Render as child element (for composition)Renders the child element instead.
The visual style variantVisual style.

Readable without the page around it

Agents read docs as plain text, and readers land on one section from search.

  • Don't point at things by position, like "the button above" or "the example below". Name the thing.
  • Make each code block runnable once its imports are copied. Keep imports in the block.
  • Use full paths in links and code, not "the file from earlier".
  • Repeat the noun at the start of each section, not "it".

At build time, apps/docs/scripts/write-markdown.ts turns every page into Markdown at {route}.md and lists it in /llms.txt. The page's first paragraph becomes its llms.txt summary, so make that paragraph say what the page is. Put data-md-skip on a live preview or specimen that means nothing as text.

Worked rewrites

Opening of a guide

nxds components are copy/own: you paste a component's source into your app and it is yours from that moment. Nothing installs it, and no upstream change will ever reach it — editing a pasted component means editing your own file, and picking up a later fix means pasting the new version over it.

Set up your app once, then copy in any nxds component. Copied components are your files: edit them freely, and paste a newer version to update.

Mechanism instead of instruction

Do not add an @import "tailwindcss" of your own. The nxds token CSS imports Tailwind itself, as @import 'tailwindcss' prefix(nx), and that prefix is where nx:bg-primary-background comes from. prefix() is a property of the build, not of one import, so…

Remove any @import "tailwindcss" from your CSS. nxds.css already imports Tailwind, with the nx: prefix.

Release notes in reference

Preset names are inferred from brandColor, so existing saved colors keep working without a storage migration.

{Delete. Put it in the changelog if anyone needs it.}

Exception list

Some components render Button with their own radius class… InputGroupButton at sizes xs, icon-xs (rounded-sm) and sm (rounded-md)… Carousel… DatePicker selected days: rounded-md at a range start and end…

The override reaches every element that uses nx:rounded-base. A component that sets its own radius, such as Carousel's arrows, keeps it.

Self-check

Run this on an MDX page. It prints sentences over 25 words:

python3 - apps/docs/content/{section}/{page}.mdx <<'EOF'
import re, sys
t = open(sys.argv[1]).read()
t = re.sub(r'```.*?```', '', t, flags=re.S)
t = re.sub(r'^\s*[|#<].*$', '', t, flags=re.M)
for s in re.split(r'(?<=[.!?])\s+', ' '.join(t.split())):
    if len(s.split()) > 25: print(len(s.split()), s)
EOF

Then read the page top to bottom and check:

  • The first sentence says what the page is or does
  • No more than two sentences come before the first code block
  • No sentence goes over 25 words, and none joins clauses with a dash or a semicolon
  • No "you can", "simply", "just", "note that", "it is recommended"
  • No release history ("now", "still", "existing", "no longer", "version N")
  • No engine internals on a guide, pattern or component page
  • Every term is defined the first time it appears
  • Every heading follows its type: a verb for a step, a noun for reference, a scenario for an example
  • No "above" or "below" pointing at content
  • Every code block has a path comment and its imports

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.