Skip to content

Conversation

@fredvisser
Copy link
Contributor

🤨 Rationale

Provides GitHub Copilot and other AI coding agents with essential context about the Nimble design system architecture, workflows, and conventions to enable more productive assistance.

👩‍💻 Implementation

Added covering:

  • Multi-framework architecture (web components + Angular/Blazor/React wrappers)
  • Critical workflows (build, test, Beachball change files, Chromatic visual testing)
  • Component development patterns (FAST Foundation integration, design tokens, framework-specific patterns)
  • Project-specific conventions (attributes over CSS classes, testing requirements, common pitfalls)

🧪 Testing

N/A - Documentation only

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@rajsite rajsite marked this pull request as draft November 19, 2025 16:09
@fredvisser fredvisser requested a review from jattasNI November 25, 2025 18:16
@fredvisser fredvisser marked this pull request as ready for review December 23, 2025 15:17
Comment on lines +21 to +37
## Requirements vs Nimble

| | `nimble-components` | `spright-components` |
| ---------------------- | :-----------------: | :------------------: |
| Approved spec | 🟢 | 🟢 |
| Unit tests | 🟢 | 🟢 |
| Storybook visual tests | 🟢 | 🟢 |
| Storybook API docs | 🟢 | 🟢 |
| Storybook usage docs | 🟢 | 🟡 |
| Approved VxD\* | 🟢 | 🟡 |
| Approved IxD\* | 🟢 | 🟡 |
| Angular/Blazor support | 🟢 | 🟡 |
| Proper a11y | 🟢 | 🟡 |
| Minimal tech debt | 🟢 | 🟡 |
| Mobile support | 🟡 | 🟡 |

🟢 = required, 🟡 = optional\*By an interaction and/or visual designer
Copy link
Member

Choose a reason for hiding this comment

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

outdated and not in this library, was moved to the root contributing. it should just not be duplicated


The documentation and visual testing platform for Nimble.

- **Framework**: Storybook 7+
Copy link
Member

Choose a reason for hiding this comment

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

We are on sb 10, should just say that..

Comment on lines +12 to +14
- Ensure custom elements are registered before use.
- Use `useLayoutEffect` to attach event listeners to custom events.
- Forward refs to the underlying DOM element.
Copy link
Member

Choose a reason for hiding this comment

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

first two are incorrect, those are not how wrappers are implemented. Should just point to like banner wrapper as an example

last one really only applies to the example app, and is just a statement of React's features. Don't see why we call out that specific react feature, seems unnecessary


## Common Pitfalls
-**`useEffect` for Events**: Use `useLayoutEffect` to avoid timing issues with custom elements.
-**Missing Ref Forwarding**: Wrappers must forward refs to the underlying web component.
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 know what this means but no, our React wrappers don't forward ref explicitly. It's handled by our wrap helper.

## Common Pitfalls
-**`useEffect` for Events**: Use `useLayoutEffect` to avoid timing issues with custom elements.
-**Missing Ref Forwarding**: Wrappers must forward refs to the underlying web component.
-**ClassName Conflicts**: Ensure `className` prop is merged correctly.
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 just how React works. Don't see why we call out that specific react behavior, seems unnecessary

Comment on lines +24 to +29
| Area | Nimble | Ok |
| -------------------- | ------------------ | ------------------------------------------------- |
| Spec completeness | Required | Optional – document scope gaps in Storybook |
| Accessibility polish | Required | In-progress allowed, but note limitations |
| Framework wrappers | Required over time | Optional unless feature explicitly needs wrappers |
| Owner team | Nimble | Contributing feature team |
Copy link
Member

Choose a reason for hiding this comment

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

outdated, top-level contributing is up to date


# Storybook + tests (run from repo root)
npm run storybook
npm run tdd -w @ni/nimble-components
Copy link
Member

Choose a reason for hiding this comment

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

this command was removed, npm run test-chrome -w @ni/nimble-components will do iterative component build and run tests

Comment on lines +15 to +17
'agents.md',
'docs/',
'specs/',
Copy link
Member

@rajsite rajsite Dec 23, 2025

Choose a reason for hiding this comment

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

add this to ignore these files in beachball change checks in packages

- ❌ Styling component state via classes instead of attributes/behaviors.
- ❌ Hardcoding tag names inside templates instead of importing tag constants.
- ❌ Skipping Storybook docs/matrix updates when component APIs change.
- ❌ Not running formatter/tests before pushing (`npm run format`, `npm run tdd:watch`).
Copy link
Member

Choose a reason for hiding this comment

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

tdd:watch also removed, should probably just run the test command like above


**Goal**: Synchronize the AI coding agent instructions with the latest project documentation, patterns, and VS Code best practices (using directory-scoped `agents.md` files).

**Role**: You are an expert maintainer of the Nimble Design System. Your job is to ensure that the instructions provided to AI agents are accurate, concise, up-to-date, and structured to create effective "Agents.md" instructions.
Copy link
Member

Choose a reason for hiding this comment

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

CONTRIBUTING should be updated with more detail on how humans are supposed to trigger this action.

Also. as commented in different files this is generating lots of incorrect content in agents.md and gets out of sync quickly. What is the workflow for updating those without having it conflict with this workflow running.

@rajsite rajsite changed the title Add .github/copilot-instructions.md for AI coding agents Add prompts for AI coding agents Dec 23, 2025
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.

4 participants