agentleFS
MicrosoftKnown publishermicrosoft/griffel/.github/copilot-instructions.md

griffel

Copilot instructions1.3k starsChanged 8 months agoMITView on GitHub

Griffel is a CSS-in-JS library with near-zero runtime, SSR support, and ahead-of-time compilation. It's organized as a monorepo using Nx with 16+ packages and applications including React bindings, build-time transforms, and DevTools. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. CRITICAL: NEVER CANCEL long-running commands. Set timeouts appropriately. When using Nx affected commands in a repository that may not have a main branch…

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 4 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 5 mentionsSep 2026: 4 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/griffel repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/griffel

The biggest 5 of 35 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 35

Talked about on GitHub and Hacker News (35 times).

On GitHub · 34

29 more on GitHub

On Hacker News · 1

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …

    line 5
  2. Distinctive:

    When using Nx affected commands in a repository that may not have a main branch locally:

    line 52
  3. Distinctive:

    Core Library Changes: Test makeStyles functionality

    line 67
  4. Distinctive:

    Build Tool Changes: Test with actual build scenarios

    line 76
  5. Distinctive:

    Website Changes: Verify documentation builds and renders

    line 86
  6. Very specific:

    Manual Change Files: Create JSON files manually in change/ directory using this template:

    line 109
  7. Distinctive:

    Add/update tests in the same package

    line 147
  8. Distinctive:

    Run affected builds and tests to ensure nothing breaks

    line 148
  9. Very specific:

    Create changelog entry: yarn change

    line 149
  10. Very specific:

    Update documentation in apps/website/docs/ if needed

    line 150
  11. Very specific:

    Check package.json dependencies are correctly configured

    line 154
  12. Very specific:

    Use yarn nx graph to visualize project dependencies

    line 155
  13. Distinctive:

    Test changes using the interactive playground at /try-it-out

    line 161
  14. Distinctive:

    Check atomic CSS generation is working correctly

    line 163
  15. Distinctive:

    Test SSR scenarios don't break hydration

    line 164
  16. Distinctive:

    Use the website's /try-it-out page for interactive testing instead

    line 177

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “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
copilot-instructions.md

Griffel - CSS-in-JS with Ahead-of-time Compilation

Griffel is a CSS-in-JS library with near-zero runtime, SSR support, and ahead-of-time compilation. It's organized as a monorepo using Nx with 16+ packages and applications including React bindings, build-time transforms, and DevTools.

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

Working Effectively

Prerequisites and Setup

  • Node.js version 20+ is required (node --version should show v20.x.x)
  • Yarn 4.3.1 is the package manager (yarn --version should show 4.3.1)
  • Uses Nx monorepo for task orchestration

Bootstrap, Build, and Test

CRITICAL: NEVER CANCEL long-running commands. Set timeouts appropriately.

# Install dependencies - takes ~2 minutes
yarn install --immutable
# NEVER CANCEL: May take up to 3 minutes. Set timeout to 300+ seconds.

# Build all packages - takes ~1 minute 15 seconds
yarn nx run-many --target=build --all
# NEVER CANCEL: Build takes 1-2 minutes. Set timeout to 180+ seconds.

# Run all tests - takes ~3 minutes
yarn nx run-many --target=test --all
# NEVER CANCEL: Tests take 3-4 minutes. Set timeout to 300+ seconds.

# Type check all projects - takes ~1 minute 30 seconds
yarn nx run-many --target=type-check --all
# NEVER CANCEL: Type checking takes 1-2 minutes. Set timeout to 180+ seconds.

# Lint all projects - takes ~17 seconds
yarn nx run-many --target=lint --all
# NEVER CANCEL: Linting takes 15-30 seconds. Set timeout to 60+ seconds.

Development Servers

# Start documentation website (Docusaurus)
yarn start
# Serves on http://localhost:3000
# NEVER CANCEL: Initial build takes 30-60 seconds. Set timeout to 120+ seconds.

Working with Affected Changes (Nx)

When using Nx affected commands in a repository that may not have a main branch locally:

# Use run-many instead of affected if git comparison fails
yarn nx run-many --target=build --all   # Instead of yarn build
yarn nx run-many --target=test --all    # Instead of yarn test
yarn nx run-many --target=lint --all    # Instead of yarn lint

Validation

Manual Testing Requirements

ALWAYS test changes by running through complete scenarios:

  1. Core Library Changes: Test makeStyles functionality

    # Start website to test interactive examples
    yarn start
    # Navigate to http://localhost:3000/try-it-out
    # Test basic makeStyles examples work correctly in the interactive playground
  2. Build Tool Changes: Test with actual build scenarios

    # Test TypeScript compatibility across versions
    yarn nx run @griffel/e2e-typescript:test
    
    # Test Rspack bundler integration
    yarn nx run @griffel/e2e-rspack:test
  3. Website Changes: Verify documentation builds and renders
    yarn nx run @griffel/website:build
    # Check build succeeds without errors (warnings about broken anchors are acceptable)

Code Quality Requirements

ALWAYS run these before submitting changes:

# Format code - required for CI
yarn prettier --write .

# Lint with automatic fixes where possible
yarn nx run-many --target=lint --all

# Type check everything
yarn nx run-many --target=type-check --all

Change Management

Manual Change Files: Create JSON files manually in change/ directory using this template:

{
  "type": "patch", // "none", "patch", "minor", "major"
  "comment": "final adjustments",
  "packageName": "@griffel/webpack-plugin", // name of affected package
  "email": "YOUR_EMAIL",
  "dependentChangeType": "patch" // "none", "patch", "minor", "major"
}

Repository Structure

Key Packages (packages/ directory)

  • @griffel/core - Core runtime and compilation logic
  • @griffel/react - React bindings and hooks
  • @griffel/webpack-loader - Webpack build-time transforms
  • @griffel/devtools - Browser extension for debugging
  • @griffel/eslint-plugin - ESLint rules for Griffel usage

Applications (apps/ directory)

  • website - Documentation site (Docusaurus) at griffel.js.org

Testing Infrastructure (e2e/ directory)

  • nextjs - Next.js integration tests
  • typescript - TypeScript compilation tests
  • rspack - Rspack bundler tests
  • utils - Common E2E testing utilities

Common Tasks

Adding New Features

  1. Make changes to relevant packages
  2. Add/update tests in the same package
  3. Run affected builds and tests to ensure nothing breaks
  4. Create changelog entry: yarn change
  5. Update documentation in apps/website/docs/ if needed

Debugging Build Issues

  • Check package.json dependencies are correctly configured
  • Use yarn nx graph to visualize project dependencies
  • Individual package builds: yarn nx run @griffel/[package]:build
  • Clear Nx cache if needed: yarn nx reset

Working with Styles

  • Test changes using the interactive playground at /try-it-out
  • Validate CSS output using browser DevTools
  • Check atomic CSS generation is working correctly
  • Test SSR scenarios don't break hydration

Known Issues and Workarounds

Build Warnings (Acceptable)

  • Some packages show rollup-plugin-typescript2 deprecation warnings - this is expected
  • Linting may show 1-2 warnings in core packages - this is acceptable
  • Prettier may flag some generated files in apps/website/.docusaurus/ - these can be ignored

Storybook Issues

  • React Storybook may have configuration issues with webpack5 dependencies
  • Use the website's /try-it-out page for interactive testing instead

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.