You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .ai/README.md
+73-16Lines changed: 73 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,16 @@
1
-
# Cursor documentation
1
+
# AI and agent documentation
2
2
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
4
14
5
15
## Rules
6
16
@@ -21,7 +31,7 @@ Rules defined in the `config.json` follow this structure:
21
31
}
22
32
```
23
33
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.
25
35
26
36
### Available rules
27
37
@@ -39,7 +49,7 @@ Additional, more specific rules can be found in the `rules` directory in either
39
49
-**required_sections**: Ensures required sections are present
40
50
-**templates**: Enforces template structure for different ticket types
41
51
-**labels**: Validates that only allowed labels are used
42
-
-**issue_types**: Ensures correct issue type selectionc
52
+
-**issue_types**: Ensures correct issue type selection
43
53
44
54
#### Styles
45
55
@@ -55,7 +65,7 @@ Additional, more specific rules can be found in the `rules` directory in either
55
65
56
66
-**branch_format**: Recommends `username/type-description[-swc-XXX]` format
- 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.
59
69
- Lowercase letters and numbers only, words separated by dashes
60
70
- Severity: Warning (recommended, not required)
61
71
@@ -104,14 +114,14 @@ These two rules share the same glob (`2nd-gen/**/stories/**`) and work as a pair
104
114
#### Deep understanding
105
115
106
116
-**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`
108
118
-**rationale**: The written report is the review surface; wrong research leads to wrong plan and wrong code (garbage in, garbage out)
109
119
110
120
### When rules are activated
111
121
112
122
**Always-applied rules:** Rules use `alwaysApply: true` to activate automatically, or `globs` to activate when matching files are edited.
113
123
**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.:
115
125
116
126
-**text_formatting.headings**: Sentence case enforcement with technical term exceptions
117
127
-**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
152
162
153
163
### Usage
154
164
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).
156
166
2. Rules can be toggled using the `enabled` flag
157
167
3. Custom error messages will be shown when rules are violated
158
168
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
173
183
174
184
### Available skills
175
185
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
+
176
194
#### Accessibility compliance
177
195
178
196
-**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
192
210
-**purpose**: Run the CONTRIBUTOR-DOCS nav script to update breadcrumbs and TOCs, and handle link verification
193
211
-**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).
194
212
- 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`
196
214
197
215
#### Component migration (rendering and styling)
198
216
@@ -249,20 +267,59 @@ Skills are used on-demand. When a task matches a skill’s purpose, the agent re
249
267
- Use when: Implementing any feature or bugfix, before writing implementation code
250
268
- Provides: TDD cycle, verification checklist, good/bad test examples, anti-patterns to avoid
251
269
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
`.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
253
307
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.
255
311
256
-
You can still get the same guidance in another IDE:
312
+
### Using rules and skills in other environments
257
313
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:
260
315
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.
262
319
263
320
## MCPs
264
321
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:
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.
0 commit comments