Skip to content

Commit 7e8625b

Browse files
Merge branch 'main' into cdransf/clean-1st-gen-references
2 parents c02eb4c + 598039b commit 7e8625b

75 files changed

Lines changed: 3944 additions & 3092 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/README.md renamed to .ai/README.md

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
# Cursor documentation
1+
# AI and agent documentation
22

3-
This directory contains rules and skills that Cursor uses to enforce consistent formatting and structure in our codebase.
3+
Coding agents should start with [`AGENTS.md`](../AGENTS.md) at the repository root. It summarizes how to use this directory as the canonical source for rules and skills.
4+
5+
This directory contains rules, skills, and accumulated memory that coding agents use to enforce consistent formatting and structure in our codebase.
6+
7+
## Why `.ai/`
8+
9+
All rules and skills now live in **`.ai/`** — a tool-agnostic, plain-markdown directory that any agent or tool can read. IDE-specific directories (`.cursor/`, `.claude/`) become thin adapters that point back to `.ai/` via symlinks:
10+
11+
- Edit once in `.ai/` → all tools see the update automatically
12+
- No sync step, no duplication, no drift between tools
13+
- New contributors or tools start from `AGENTS.md` at the repo root, which bootstraps everything
414

515
## Rules
616

@@ -21,7 +31,7 @@ Rules defined in the `config.json` follow this structure:
2131
}
2232
```
2333

24-
Additional, more specific rules can be found in the `rules` directory in either a `json` or `mdc` format.
34+
Additional, more specific rules can be found in the `rules` directory in either a `json` or `md` format.
2535

2636
### Available rules
2737

@@ -39,7 +49,7 @@ Additional, more specific rules can be found in the `rules` directory in either
3949
- **required_sections**: Ensures required sections are present
4050
- **templates**: Enforces template structure for different ticket types
4151
- **labels**: Validates that only allowed labels are used
42-
- **issue_types**: Ensures correct issue type selectionc
52+
- **issue_types**: Ensures correct issue type selection
4353

4454
#### Styles
4555

@@ -55,7 +65,7 @@ Additional, more specific rules can be found in the `rules` directory in either
5565

5666
- **branch_format**: Recommends `username/type-description[-swc-XXX]` format
5767
- Uses conventional commit types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
58-
- Commit type list and validation pattern: `.cursor/config.json` (`git.types`, `validationPattern`). When adding or removing a type, update both `types` and `validationPattern` together.
68+
- Commit type list and validation pattern: `.ai/config.json` (`git.types`, `validationPattern`). When adding or removing a type, update both `types` and `validationPattern` together.
5969
- Lowercase letters and numbers only, words separated by dashes
6070
- Severity: Warning (recommended, not required)
6171

@@ -104,14 +114,14 @@ These two rules share the same glob (`2nd-gen/**/stories/**`) and work as a pair
104114
#### Deep understanding
105115

106116
- **apply_intelligently**: Use for non-trivial work (multiple files, new area, complex behavior); do not use for simple, self-contained requests (e.g. creating a regex, one-line fix, single known file) to avoid wasting tokens and overloading context. Before writing non-trivial code, do deep research on the relevant part of the codebase first.
107-
- **action** (when the rule applies): Scope → deep read → write persistent report (e.g. research.md at repo root) → pause for user review → proceed only after validation. Full workflow in `.cursor/skills/deep-understanding/SKILL.md`
117+
- **action** (when the rule applies): Scope → deep read → write persistent report (e.g. research.md at repo root) → pause for user review → proceed only after validation. Full workflow in `.ai/skills/deep-understanding/SKILL.md`
108118
- **rationale**: The written report is the review surface; wrong research leads to wrong plan and wrong code (garbage in, garbage out)
109119

110120
### When rules are activated
111121

112122
**Always-applied rules:** Rules use `alwaysApply: true` to activate automatically, or `globs` to activate when matching files are edited.
113123
**On-demand rules:** Rules with `alwaysApply: false` and no globs are on-demand only (activated by `@` mentioning them in chat).
114-
**Config-based rules:** The `config.json` also defines structured validation for Cursor (or other tooling) to verify branch names, Jira ticket drafts, text-formatting, etc.:
124+
**Config-based rules:** The `config.json` also defines structured validation for editors and other tooling to verify branch names, Jira ticket drafts, text-formatting, etc.:
115125

116126
- **text_formatting.headings**: Sentence case enforcement with technical term exceptions
117127
- **text_formatting.patterns**: File patterns for text formatting (`**/*.md`, `**/*.txt`, `**/*.mdx`)
@@ -152,7 +162,7 @@ These two rules share the same glob (`2nd-gen/**/stories/**`) and work as a pair
152162

153163
### Usage
154164

155-
1. Cursor will automatically enforce these rules while editing relevant files; however, if you wish to enable a rule that is not triggered by default, you can do so by `@` mentioning it in the chat.
165+
1. Rules are automatically enforced by your coding agent while editing relevant files; however, if you wish to enable a rule that is not triggered by default, you can do so by mentioning it in the chat (e.g. `@` in Cursor, or by name in Claude Code).
156166
2. Rules can be toggled using the `enabled` flag
157167
3. Custom error messages will be shown when rules are violated
158168
4. Exceptions are handled through the `exceptions` field in relevant rules
@@ -173,6 +183,14 @@ Skills are used on-demand. When a task matches a skill’s purpose, the agent re
173183

174184
### Available skills
175185

186+
#### Accessibility migration analysis
187+
188+
- **purpose**: Create accessibility migration analysis docs for the "analyze accessibility" step of 2nd-gen component migration
189+
- **How to invoke**: Say "create accessibility analysis for [component]", "analyze accessibility for [component]", or "accessibility migration for [component]". Also invoked when you refer to the "analyze accessibility" step in the 2nd-gen component migration workstream.
190+
- Use when: On the analyze-accessibility step for one or more components; creating one markdown file per component at `CONTRIBUTOR-DOCS/03_project-planning/03_components/[component-name]/accessibility-migration-analysis.md`
191+
- Applies to: `CONTRIBUTOR-DOCS/**/accessibility-migration-analysis.md`
192+
- Provides: Required section order, ARIA recommendations structure, Shadow DOM guidance, keyboard and focus conventions, testing table format, reference examples
193+
176194
#### Accessibility compliance
177195

178196
- **purpose**: Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support
@@ -192,7 +210,7 @@ Skills are used on-demand. When a task matches a skill’s purpose, the agent re
192210
- **purpose**: Run the CONTRIBUTOR-DOCS nav script to update breadcrumbs and TOCs, and handle link verification
193211
- **How to invoke**: Say “update contributor docs nav”, “regenerate TOC”, “fix broken links in CONTRIBUTOR-DOCS”, or “run the nav script”. Also invoked when you add, remove, rename, or move files under `CONTRIBUTOR-DOCS/` or change H1/H2/H3 headings (the contributor-doc-update rule may trigger; the skill holds the full workflow).
194212
- Use when: Updating contributor docs structure, regenerating navigation, or fixing reported broken links
195-
- Provides: Operator workflow (run script, verify, fix links), Maintainer workflow (when to update script). Full instructions in `.cursor/skills/contributor-docs-nav/references/ai-agent-instructions.md`
213+
- Provides: Operator workflow (run script, verify, fix links), Maintainer workflow (when to update script). Full instructions in `.ai/skills/contributor-docs-nav/references/ai-agent-instructions.md`
196214

197215
#### Component migration (rendering and styling)
198216

@@ -249,20 +267,59 @@ Skills are used on-demand. When a task matches a skill’s purpose, the agent re
249267
- Use when: Implementing any feature or bugfix, before writing implementation code
250268
- Provides: TDD cycle, verification checklist, good/bad test examples, anti-patterns to avoid
251269

252-
## Using rules and skills in other IDEs
270+
## Using rules and skills across tools and IDEs
271+
272+
Canonical content lives in **`.ai/`** (this directory). Tool-specific directories (`.cursor/`, `.claude/`) are thin adapters that point back here via symlinks — edit files in `.ai/`, never in the adapter directories.
273+
274+
### Current symlink structure
275+
276+
```text
277+
.ai/rules/
278+
└── *.md ← canonical, tool-agnostic source of truth
279+
280+
.ai/skills/
281+
└── <skill-name>/SKILL.md ← canonical, tool-agnostic source of truth
282+
283+
.cursor/rules/
284+
└── *.mdc → ../../.ai/rules/*.md (per-file symlinks; Cursor expects .mdc)
285+
.cursor/skills/ → ../.ai/skills/ (directory symlink)
286+
287+
.claude/rules/ → ../.ai/rules/ (directory symlink; Claude Code reads .md)
288+
.claude/skills/ → ../.ai/skills/ (directory symlink)
289+
```
290+
291+
Editing any `.ai/rules/*.md` file immediately updates what both Cursor and Claude Code see — no sync step required.
292+
293+
### Adding a new rule
294+
295+
1. Create `rule-name.md` in `.ai/rules/` with YAML frontmatter (`globs`, `alwaysApply`).
296+
2. Add one per-file symlink for Cursor (required — Cursor needs `.mdc` extension):
297+
298+
```sh
299+
ln -s “../../.ai/rules/rule-name.md” “.cursor/rules/rule-name.mdc”
300+
```
301+
302+
`.claude/rules/` is a directory symlink pointing at `.ai/rules/`, so it picks up the new file automatically — no extra step needed.
303+
304+
3. Register it in the tables in this README (rules catalog) and in [`AGENTS.md`](../AGENTS.md).
305+
306+
### Adding a new skill
253307

254-
The rules and skills in this directory are set up for **Cursor** and are applied automatically when you use Cursor in this repo. If you use a different AI-enabled IDE (e.g. Windsurf, Zed, or another editor with built-in AI), that tool will not automatically read `.cursor/` — each IDE has its own config locations and formats.
308+
1. Create `.ai/skills/<skill-name>/SKILL.md`.
309+
2. Register it in the skills catalog below and in [`AGENTS.md`](../AGENTS.md).
310+
3. Both `.cursor/skills/` and `.claude/skills/` pick it up automatically via directory symlinks.
255311

256-
You can still get the same guidance in another IDE:
312+
### Using rules and skills in other environments
257313

258-
- **Copy or adapt the contents** of `rules/` and `skills/` into your IDE’s equivalent config (e.g. your IDE’s project rules, instructions, or “AI context” directory). The content is markdown and JSON, so it’s portable; you may need to adjust paths or format to match your IDE’s schema.
259-
- **Reference the files when prompting** — e.g. “Follow the rules in `.cursor/README.md` and the rules in `.cursor/rules/` when relevant” or “Use the workflow in `.cursor/skills/contributor-docs-nav/SKILL.md` for this task.”
314+
If you use a tool that does not read `.cursor/` or `.claude/`, point it at `.ai/` directly:
260315

261-
Keeping rules and skills in this repo means everyone can use the same standards; Cursor users get them automatically, and non-Cursor users can copy or point their IDE at the same content.
316+
- **Start from [`AGENTS.md`](../AGENTS.md)** at the repository root.
317+
- **Reference files when prompting** — for example: “Follow the rules in `.ai/rules/` and load `.ai/skills/deep-understanding/SKILL.md` for this task.”
318+
- **Copy or adapt** the markdown and JSON content into your tool’s own config format as needed.
262319

263320
## MCPs
264321

265-
When developing for the SWC project, there may be instances where Cursor needs context from external sources. Contributors and maintainers can configure [MCP (Model Context Protocol) servers](https://modelcontextprotocol.io/docs/getting-started/intro) via [Easy MCP](https://wiki.corp.adobe.com/display/assetscollab/Cursor+integration+with+Easy+MCP). Some recommended MCP servers might include:
322+
When developing for the SWC project, there may be instances where your coding agent needs context from external sources. Contributors and maintainers can configure [MCP (Model Context Protocol) servers](https://modelcontextprotocol.io/docs/getting-started/intro) via [Easy MCP](https://wiki.corp.adobe.com/display/assetscollab/Cursor+integration+with+Easy+MCP). Some recommended MCP servers might include:
266323

267324
- Figma
268325
- Corp Jira
File renamed without changes.

.ai/rules/branch-naming.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
description: Suggests the preferred branch naming format for Spectrum Web Components contributions — lowercase, dash-separated, with a conventional commit type and optional issue number.
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# Branch naming format
8+
9+
Suggests the ideal branch naming format for Spectrum Web Components contributions.
10+
11+
## Pattern
12+
13+
```
14+
^[a-z0-9]+\/(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)-[a-z0-9-]+(-swc-[0-9]+)?$
15+
```
16+
17+
The canonical list of types and the validation pattern are defined in `.ai/config.json` under `git.types` and `validationPattern`.
18+
19+
## Message
20+
21+
Consider following the preferred branch naming format: `<username>/<type>-<description>[-swc-<issue>]`
22+
23+
Username will be automatically pulled from your git config settings.
24+
25+
### Guidelines
26+
27+
- Use lowercase letters and numbers only
28+
- Separate words with dashes (not camelCase)
29+
- Use conventional commit types from `.ai/config.json` (`git.types`). Descriptions below are for quick reference:
30+
**feat**: New feature
31+
**fix**: Bug fix
32+
**docs**: Documentation only
33+
**style**: Code style/formatting
34+
**refactor**: Code change that neither fixes a bug nor adds a feature
35+
**perf**: Code change that improves performance
36+
**test**: Adding missing tests or correcting existing tests
37+
**build**: Changes that affect the build system or external dependencies
38+
**ci**: Changes to CI configuration files and scripts
39+
**chore**: Other changes that don't modify src or test files, dependency updates
40+
**revert**: Reverts a previous commit
41+
- Optional issue number format: `-swc-XXX`
42+
43+
### Good examples
44+
45+
- `johndoe/feat-add-new-button-swc-123`
46+
- `janedoe/fix-dropdown-alignment`
47+
- `alice/refactor-component-structure`
48+
- `bob/perf-optimize-rendering`
49+
50+
### Avoid
51+
52+
- `johnDoe/feat-addNewButton` (no camelCase)
53+
- `jane/fix-Dropdown-Bug` (no uppercase)
54+
55+
This is a recommended format to maintain consistency, but not required.
56+
57+
## Severity
58+
59+
warning
60+
61+
## Scope
62+
63+
git_branch

0 commit comments

Comments
 (0)