Skip to content

chore(copilot-instructions): add the copilot-instructions.md#7926

Draft
nineteen88 wants to merge 1 commit intomasterfrom
add-copilot-instructions
Draft

chore(copilot-instructions): add the copilot-instructions.md#7926
nineteen88 wants to merge 1 commit intomasterfrom
add-copilot-instructions

Conversation

@nineteen88
Copy link
Copy Markdown
Contributor

Proposed behaviour

Add the file with information that will be consumed by copilot agents

Current behaviour

No copilot-instructions.md file currently

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-specific Copilot agent instruction document under .github/ to guide automated changes/reviews in the carbon-react codebase.

Changes:

  • Introduces .github/copilot-instructions.md describing repo tooling, workflows, project layout, and conventions.
  • Documents local bootstrap commands and CI-equivalent validation steps.
  • Captures testing conventions (Jest/RTL + Playwright CT) and “skills sync” expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
includes information for copilot agents
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Key conventions (follow them — CI/lint will enforce most):

- Use `data-role` (NOT `data-testid`) for test queries; `data-component` is reserved for component roots, `data-element` for sub-elements. Both Jest (RTL) and Playwright are configured to read `data-role` as the test-id attribute.
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

issue: The doc says to use data-role (NOT data-testid) for test queries, but the repo still contains data-testid usage (e.g. in Storybook interaction stories). Consider clarifying this as “prefer data-role for tests (RTL/Playwright are configured for it)”, and note any exceptions (Storybook/pseudo state selectors, legacy code) to avoid confusing contributors/agents.

Suggested change
- Use `data-role` (NOT `data-testid`) for test queries; `data-component` is reserved for component roots, `data-element` for sub-elements. Both Jest (RTL) and Playwright are configured to read `data-role` as the test-id attribute.
- Prefer `data-role` for test queries; `data-component` is reserved for component roots, `data-element` for sub-elements. Both Jest (RTL) and Playwright are configured to read `data-role` as the test-id attribute. `data-testid` may still appear in Storybook-specific selectors/pseudo states or legacy code, so treat `data-role` as the default for new tests rather than an absolute ban.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +50
| Type check | `npm run type-check` | `tsc --noEmit` against [tsconfig.json](../tsconfig.json). |
| Skills sync | `npm run build:skills -- --check` | Fails if files in [skills/](../skills) are stale relative to component changes. Regenerate with `npm run build:skills` and commit the diff. |
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

issue: The validation pipeline lists npm run type-check as a standalone step, but that script does not run token generation; without a prior generate-tokens:dev run (or running lint/test first) it can fail due to missing static-tokens imports. Suggest updating this step (or §4) to mention the required token generation order, or adjusting the type-check script to run generate-tokens:dev first.

Copilot uses AI. Check for mistakes.
| Step | Command | Notes |
|---|---|---|
| Format check | `npx prettier --check './src/**/*.{js,jsx,ts,tsx}'` | Auto-fix with `npm run format`. |
| Lint | `npm run lint` | ESLint flat config in [eslint.config.mjs](../eslint.config.mjs). Uses `--max-warnings=636` and `--report-unused-disable-directives`; do not introduce new warnings or unused `eslint-disable` lines. |
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

nitpick: The lint step note implies CI prevents new warnings, but --max-warnings=636 only caps the total warnings. Consider rephrasing to “CI allows up to 636 warnings; avoid increasing the count / fix warnings rather than raising the ceiling” for accuracy.

Suggested change
| Lint | `npm run lint` | ESLint flat config in [eslint.config.mjs](../eslint.config.mjs). Uses `--max-warnings=636` and `--report-unused-disable-directives`; do not introduce new warnings or unused `eslint-disable` lines. |
| Lint | `npm run lint` | ESLint flat config in [eslint.config.mjs](../eslint.config.mjs). CI allows up to 636 warnings; avoid increasing the count, and fix warnings rather than raising the ceiling. Also uses `--report-unused-disable-directives`, so do not introduce unused `eslint-disable` lines. |

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@tomdavies73 tomdavies73 left a comment

Choose a reason for hiding this comment

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

@nineteen88 might be worth seeing if we can ignore the skills.md files as I've noticed github co-pilot commenting on these skills changes without the context or nuance around said changes

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

Development

Successfully merging this pull request may close these issues.

3 participants