Skip to content

Commit e670e40

Browse files
tudorpopamsclaude
andcommitted
style: fix Prettier formatting for AGENTS.md and skill files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2df768c commit e670e40

7 files changed

Lines changed: 57 additions & 38 deletions

File tree

.agents/skills/lint-check/SKILL.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: lint-check
33
description: Run lint on affected packages, parse errors, and auto-fix common issues (design tokens, React.FC, SSR safety, import restrictions)
44
disable-model-invocation: true
5-
argument-hint: "[package-name]"
5+
argument-hint: '[package-name]'
66
allowed-tools: Bash Read Edit Grep Glob
77
---
88

@@ -24,15 +24,16 @@ Run linting and fix common issues for Fluent UI packages.
2424

2525
2. **Parse the output** and categorize errors by the custom Fluent UI ESLint rules:
2626

27-
| Rule | What it catches | How to fix |
28-
|------|----------------|------------|
29-
| `@fluentui/ban-context-export` | Context exported from wrong layer | Move to `react-shared-contexts` package |
30-
| `@fluentui/ban-instanceof-html-element` | `instanceof HTMLElement` (breaks iframes) | Use element.tagName or feature detection |
31-
| `@fluentui/no-global-react` | `React.FC`, `React.useState` etc. | Use named imports: `import { useState } from 'react'` |
32-
| `@fluentui/no-restricted-imports` | Banned import paths | Use the allowed import path from the error message |
33-
| `@fluentui/no-context-default-value` | Context created without `undefined` default | Use `createContext(undefined)` and add a guard hook |
27+
| Rule | What it catches | How to fix |
28+
| --------------------------------------- | ------------------------------------------- | ----------------------------------------------------- |
29+
| `@fluentui/ban-context-export` | Context exported from wrong layer | Move to `react-shared-contexts` package |
30+
| `@fluentui/ban-instanceof-html-element` | `instanceof HTMLElement` (breaks iframes) | Use element.tagName or feature detection |
31+
| `@fluentui/no-global-react` | `React.FC`, `React.useState` etc. | Use named imports: `import { useState } from 'react'` |
32+
| `@fluentui/no-restricted-imports` | Banned import paths | Use the allowed import path from the error message |
33+
| `@fluentui/no-context-default-value` | Context created without `undefined` default | Use `createContext(undefined)` and add a guard hook |
3434

3535
3. **Auto-fix** any issues found by editing the source files directly. For each fix:
36+
3637
- Read the file
3738
- Apply the fix
3839
- Verify the fix by re-running lint on that specific file

.agents/skills/package-info/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@ Get a comprehensive overview of the package **$ARGUMENTS**.
1212
## Steps
1313

1414
1. **Resolve the package path.** Map the name to a filesystem path:
15+
1516
- `react-button` or `@fluentui/react-button``packages/react-components/react-button/`
1617
- Check both `library/` (source) and `stories/` (storybook) sub-packages
1718

1819
2. **Get Nx project details:**
20+
1921
```bash
2022
yarn nx show project @fluentui/$ARGUMENTS --json 2>/dev/null || yarn nx show project $ARGUMENTS --json 2>/dev/null
2123
```
2224

2325
3. **Read the package.json** for version, dependencies, and peer dependencies.
2426

2527
4. **Check ownership** by searching CODEOWNERS:
28+
2629
```bash
2730
grep -i "$ARGUMENTS" CODEOWNERS
2831
```
2932

3033
5. **Summarize the component structure** — list files under `library/src/components/`.
3134

3235
6. **Check test coverage** — does it have:
36+
3337
- Unit tests (`*.test.tsx`)
3438
- Conformance tests (`testing/isConformant.ts`)
3539
- Stories (`stories/` package)

.agents/skills/token-lookup/SKILL.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Find the correct `@fluentui/react-theme` design token for the hardcoded value **
1212
## Steps
1313

1414
1. **Identify the value category:**
15+
1516
- Hex color / rgb / named color → color tokens
1617
- px/rem spacing → spacing tokens
1718
- px/rem font size → font size tokens
@@ -22,31 +23,34 @@ Find the correct `@fluentui/react-theme` design token for the hardcoded value **
2223
- Duration (ms/s) → duration tokens
2324

2425
2. **Search the theme source** for matching values:
26+
2527
```
2628
packages/react-components/react-theme/library/src/
2729
```
30+
2831
Look in the relevant theme files (e.g., `colorPalette*.ts`, `global/`, `alias/`) to find tokens that map to the given value.
2932

3033
3. **Return the token name and usage:**
34+
3135
```tsx
3236
// Instead of: color: '#0078d4'
3337
// Use:
3438
import { tokens } from '@fluentui/react-theme';
35-
color: tokens.colorBrandBackground
39+
color: tokens.colorBrandBackground;
3640
```
3741

3842
4. **If no exact match exists**, suggest the closest semantic token and explain the difference. Refer to [docs/architecture/design-tokens.md](docs/architecture/design-tokens.md) for token categories.
3943

4044
## Common Mappings
4145

42-
| Hardcoded | Token |
43-
|-----------|-------|
44-
| `#0078d4` | `tokens.colorBrandBackground` |
45-
| `#323130` | `tokens.colorNeutralForeground1` |
46-
| `#ffffff` | `tokens.colorNeutralBackground1` |
47-
| `4px` border-radius | `tokens.borderRadiusMedium` |
48-
| `8px` padding | `tokens.spacingHorizontalS` or `tokens.spacingVerticalS` |
49-
| `14px` font-size | `tokens.fontSizeBase300` |
50-
| `600` font-weight | `tokens.fontWeightSemibold` |
46+
| Hardcoded | Token |
47+
| ------------------- | -------------------------------------------------------- |
48+
| `#0078d4` | `tokens.colorBrandBackground` |
49+
| `#323130` | `tokens.colorNeutralForeground1` |
50+
| `#ffffff` | `tokens.colorNeutralBackground1` |
51+
| `4px` border-radius | `tokens.borderRadiusMedium` |
52+
| `8px` padding | `tokens.spacingHorizontalS` or `tokens.spacingVerticalS` |
53+
| `14px` font-size | `tokens.fontSizeBase300` |
54+
| `600` font-weight | `tokens.fontWeightSemibold` |
5155

5256
These are approximate — always verify against the actual theme source.

.agents/skills/v9-component/SKILL.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ Create a new v9 component named **$ARGUMENTS** following the exact patterns in [
1515
1. **Determine the package path.** If creating inside an existing package, use that path. If creating a new package, the path is `packages/react-components/react-<lowercase-name>/library/src/`.
1616

1717
2. **Read an existing well-structured component** for reference. Good examples:
18+
1819
- `packages/react-components/react-badge/library/src/components/Badge/`
1920
- `packages/react-components/react-tag/library/src/components/Tag/`
20-
Read at least the types, hook, styles, render, and main component files from one of these.
21+
Read at least the types, hook, styles, render, and main component files from one of these.
2122

2223
3. **Generate all required files** under `components/$ARGUMENTS/`:
2324

24-
| File | Purpose |
25-
|------|---------|
26-
| `$ARGUMENTS.tsx` | `ForwardRefComponent` with `React.forwardRef`. Never use `React.FC`. |
27-
| `$ARGUMENTS.types.ts` | Props, State, Slots types |
28-
| `use$ARGUMENTS.ts` | State hook — processes props/slots into normalized state |
25+
| File | Purpose |
26+
| --------------------------------- | ---------------------------------------------------------------------------------------------------------- |
27+
| `$ARGUMENTS.tsx` | `ForwardRefComponent` with `React.forwardRef`. Never use `React.FC`. |
28+
| `$ARGUMENTS.types.ts` | Props, State, Slots types |
29+
| `use$ARGUMENTS.ts` | State hook — processes props/slots into normalized state |
2930
| `use${ARGUMENTS}Styles.styles.ts` | Griffel styling with `makeStyles` using design tokens from `@fluentui/react-theme`. Never hardcode values. |
30-
| `render$ARGUMENTS.tsx` | Pure JSX render using `assertSlots` |
31-
| `$ARGUMENTS.test.tsx` | Unit tests with React Testing Library |
32-
| `index.ts` | Barrel export for the component |
31+
| `render$ARGUMENTS.tsx` | Pure JSX render using `assertSlots` |
32+
| `$ARGUMENTS.test.tsx` | Unit tests with React Testing Library |
33+
| `index.ts` | Barrel export for the component |
3334

3435
4. **Update barrel exports** — add the component to the package's root `index.ts`.
3536

.agents/skills/visual-test/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,41 @@ Visually verify **$ARGUMENTS** by launching Storybook and capturing a screenshot
1313
## Prerequisites
1414

1515
Ensure `playwright-cli` is installed globally:
16+
1617
```bash
1718
npm ls -g @playwright/cli 2>/dev/null || npm install -g @playwright/cli@latest
1819
```
1920

2021
## Steps
2122

2223
1. **Find the component's stories package.** Each v9 component has a dedicated stories package:
24+
2325
```bash
2426
yarn nx show projects 2>/dev/null | grep "<lowercase-component-name>.*stories"
2527
```
2628

2729
2. **Start the component's Storybook dev server:**
30+
2831
```bash
2932
# Use the stories package directly — much faster than the full VR tests app
3033
yarn nx run react-<component>-stories:start &
3134
```
35+
3236
Wait for Storybook to be ready on port 6006. Check with:
37+
3338
```bash
3439
curl -s -o /dev/null -w "%{http_code}" http://localhost:6006 2>/dev/null
3540
```
3641

3742
3. **Open the page with playwright-cli:**
43+
3844
```bash
3945
playwright-cli open "http://localhost:6006"
4046
```
4147

4248
4. **Navigate to the specific story iframe** and capture a screenshot.
4349
Use the iframe URL for a clean render without Storybook chrome:
50+
4451
```bash
4552
playwright-cli goto "http://localhost:6006/iframe.html?id=components-<component>-<component>--default&viewMode=story"
4653
playwright-cli screenshot --filename=/tmp/visual-test-$ARGUMENTS.png
@@ -49,9 +56,11 @@ npm ls -g @playwright/cli 2>/dev/null || npm install -g @playwright/cli@latest
4956
5. **View the screenshot** using the Read tool to visually inspect the rendered component.
5057

5158
6. **Use `snapshot`** to get the accessibility tree and find interactive element refs:
59+
5260
```bash
5361
playwright-cli snapshot
5462
```
63+
5564
Then interact with elements by ref (e.g., click, hover) before taking more screenshots.
5665

5766
7. **If the component doesn't look right**, go back to the code, fix the issue, and repeat from step 4 (Storybook hot-reloads changes).

AGENTS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ state.root.className = mergeClasses(
9191

9292
## Skills (Slash Commands)
9393

94-
| Skill | Command | Purpose |
95-
| ---------------- | -------------------- | -------------------------------------------------------- |
96-
| `v9-component` | `/v9-component Name` | Scaffold a new v9 component with all required files |
97-
| `change` | `/change` | Create beachball change file from current diff |
98-
| `lint-check` | `/lint-check [pkg]` | Run lint, parse errors, and auto-fix common issues |
99-
| `token-lookup` | `/token-lookup val` | Find the design token for a hardcoded CSS value |
100-
| `package-info` | `/package-info pkg` | Quick lookup: path, deps, owner, tests, structure |
101-
| `visual-test` | `/visual-test Name` | Visually verify a component via Storybook + playwright-cli |
94+
| Skill | Command | Purpose |
95+
| -------------- | -------------------- | ---------------------------------------------------------- |
96+
| `v9-component` | `/v9-component Name` | Scaffold a new v9 component with all required files |
97+
| `change` | `/change` | Create beachball change file from current diff |
98+
| `lint-check` | `/lint-check [pkg]` | Run lint, parse errors, and auto-fix common issues |
99+
| `token-lookup` | `/token-lookup val` | Find the design token for a hardcoded CSS value |
100+
| `package-info` | `/package-info pkg` | Quick lookup: path, deps, owner, tests, structure |
101+
| `visual-test` | `/visual-test Name` | Visually verify a component via Storybook + playwright-cli |
102102

103103
## Package Layout
104104

docs/workflows/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Test Types
44

5-
| Type | Tool | Command | Purpose |
6-
| ----------------- | ---------------------------- | ---------------------------------------------- | -------------------------------- |
5+
| Type | Tool | Command | Purpose |
6+
| ----------------- | ---------------------------- | ----------------------------------------------- | -------------------------------- |
77
| Unit | Jest + React Testing Library | `yarn nx run <project>:test` | Component behavior, hooks, utils |
88
| Visual Regression | Storybook + StoryWright | `yarn nx run vr-tests-react-components:test-vr` | Screenshot diffs (CI only) |
99
| E2E | Cypress | `yarn nx run react-components:e2e` | Integration flows |
1010
| SSR | Custom | `yarn nx run ssr-tests-v9:test-ssr` | Server-side rendering safety |
1111
| Cross-React | Custom | `yarn nx run rit-tests-v9:test-rit` | React version compatibility |
12-
| Conformance | isConformant | Part of unit tests | Consistent component API |
12+
| Conformance | isConformant | Part of unit tests | Consistent component API |
1313

1414
## Writing Unit Tests
1515

0 commit comments

Comments
 (0)