Skip to content

feat: rules and skills#6050

Merged
marissahuysentruyt merged 29 commits intomainfrom
marissahuysentruyt/feat-agent-skills
Mar 5, 2026
Merged

feat: rules and skills#6050
marissahuysentruyt merged 29 commits intomainfrom
marissahuysentruyt/feat-agent-skills

Conversation

@marissahuysentruyt
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt commented Feb 24, 2026

Description

This PR adds Cursor agent skills and refactors existing AI instructions into the rule/skill structure within the .cursor directory. It introduces reusable, documented skills for common workflows (accessibility, docs, commits, migration, handoff, testing) and an always-applied deep-understanding rule, and updates .cursor documentation accordingly.

NOTE: not all skills have been tested. We can continue to refine these documents, however, after we've tried to use them in realistic workflows and settings.

New skills

  • accessibility-compliance: WCAG 2.2–oriented guidance with ARIA patterns, mobile accessibility, and reference docs (aria-patterns.md, mobile-accessibility.md, wcag-guidelines.md).
  • ask-questions: When and how to clarify requirements before implementing.
  • component-migration-rendering-styling: Creating rendering-and-styling migration analysis for 2nd-gen components.
  • contributor-docs-nav: Running the CONTRIBUTOR-DOCS nav script (breadcrumbs, TOCs, link checks).
  • conventional-commits: Writing conventional commit messages.
  • deep-understanding: Scoping, deep read, persistent research.md, pause for review, then implement (used by the always-applied rule).
  • documentation: Following Adobe content writing standards when writing docs.
  • explain-code: Explaining code with diagrams and analogies.
  • session-handoff: Creating handoff docs, resume checklists, and scripts (create_handoff.py, validate_handoff.py, list_handoffs.py, check_staleness.py) plus evals and references.
  • test-driven-development: TDD workflow and testing anti-patterns reference.

☝️ Any skills linked above were externally written/created, but may have been tweaked to fit our needs more specifically (i.e. writing to a .cursor folder instead of .claude)

Rules and docs

  • Deep-understanding rule: Always applied; requires research and a written artifact before planning or code.
  • AI agent instructions moved into the rule/skill model.
  • .cursor/README.md: Updated to describe newer rules and the new skills (with brief descriptions and when to use each).

Motivation and context

  • Consistency: Centralize AI behavior in skills and rules so Cursor follows the same patterns (docs, a11y, commits, migration, handoffs, TDD).
  • Discoverability: Document skills in the README so contributors know what’s available and when to use it.
  • Quality: Deep-understanding as a rule reduces “signature-level” work and encourages research and a reviewable artifact before implementation.
  • Maintainability: Session-handoff skill and scripts improve context transfer and long-running work across sessions.

Open questions

  • Currently, our AI rules assume that everyone is using Cursor. This might mean that the rules and skills won't automatically be used if a contributor/team mate isn't using Cursor.

❓ Should we also create a small section in the .cursor/README or even the project's README to explain that non-Cursor users can copy the rules and skills contents into their own local IDE-specific directory (like .vscode) so they get the rules/skills automatically as well?

Related issue(s)

  • addresses SWC-1503 (CSS conventions)
  • addresses SWC-1505 (accessibility requirements)
  • partially addresses SWC-1498 and SWC-1506 (washing machine workflow), as well as SWC-1537 (AI-friendly documentation epic)
  • addresses SWC-1605

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features

Manual review test cases

  • Skills and rules appear in repo

    • Open the repo in Cursor with this branch.
    • Confirm .cursor/skills/* and .cursor/rules/* are present
    • Expect no broken paths or missing files
    • Reading the rules .mdc files and skills SKILL.md files still make understandable sense to humans. (i.e. does the skill make enough sense that you understand what the agent should do?)
  • Documentation is coherent

    • Read .cursor/README.md sections for rules and skills.
    • Expect clear, consistent descriptions and correct references to skill paths.

Additional validation

Feel free to test any of the new skills or rules! For instance...

  • Session-handoff skill runs & works
    • With the branch pulled down locally, open a past chat (preferably one where you ran the context window quite high).
    • If possible in that chat, @ mention the session-handoff skill or say something to the affect of "context is getting full" or "create handoff." You should see the agent working with something like this:
Screenshot 2026-02-24 at 2 15 35 PM
  • Verify a session handoff is created (named something like "2026-02-24-141544-cursor-rules-skills-docs.md") is created in a .cursor/handoffs directory. Once the agent is done, it should give you a brief summary of the handoff doc and steps for the next session/chat.
  • Start a new session or chat, and resume your work by saying something like "resume from handoff" or "load handoff." You should see something like this once the agent has gotten the context from the old session:
Screenshot 2026-02-24 at 2 22 52 PM

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

⚠️ No Changeset found

Latest commit: 36a3c47

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6050

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@marissahuysentruyt marissahuysentruyt self-assigned this Feb 24, 2026
@marissahuysentruyt marissahuysentruyt added Component:Tooling Issue or PR dealing with scripts, workflows, automation, etc. Component prefix is for Jira Status:Ready for review PR ready for review or re-review. labels Feb 24, 2026
@marissahuysentruyt marissahuysentruyt marked this pull request as ready for review February 24, 2026 19:31
@marissahuysentruyt marissahuysentruyt requested a review from a team as a code owner February 24, 2026 19:31
Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

These look really nice! As is appropriate for this day and age, I had AI do some analysis here and pointed out a few things it noticed. I wouldn't consider any of it blocking though, since AI would be able to get around any minor inconsistencies, and I think having something here is better than nothing.


For complete Operator and Maintainer workflows, debugging, link-verification handling, script behavior details, and the testing checklist, read:

**CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs/01_ai-agent-instructions.md**
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't have to be a decision we make here and now, but bringing up here the thought that I had before about where this 01_ai-agent-instructions.md should live. To me, this file is a skill that we had before we knew to call it a skill, and we could move its contents up into this file to keep things a bit clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed! I've moved it up to this directory under reference/ai-agent-instructions.md.

When I was chatting with Cursor it brought up a good point that the original directory in CONTRIBUTOR-DOCS was a little confusing/deceiving since there were both computer/AI docs alongside human docs. I think moving it makes sense.


For the exact document structure, heading levels, collapsible sections, CSS⇒SWC mapping table format (columns, status values, ordering), DOM comparison format, and output format notes, read:

**CONTRIBUTOR-DOCS/03_project-planning/02_workstreams/02_2nd-gen-component-migration/02_step-by-step/01_analyze-rendering-and-styling/cursor_prompt.md**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question for this as well as with 01_ai-agent-instructions, is there an appetite for moving the reusable prompt up and officially calling it a skill?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yyyyessss doing it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to me to put scripts here, but now I have a follow up question to my earlier question about moving the CONTRIBUTOR-DOCS agent instructions into skills, if we did that, should we move the update-nav.js script (and the other script there) into .cursor/ as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did this! We have a scripts and reference directory in contributor-docs-nav now.

Open for discussion the naming. 🤔

python scripts/create_handoff.py [task-slug]
```

Example: `python scripts/create_handoff.py implementing-user-auth`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these examples specify the full path? For instance

Suggested change
Example: `python scripts/create_handoff.py implementing-user-auth`
Example: `python .cursor/skills/session-handoff/scripts/create_handoff.py implementing-user-auth`

When I had agents (via Codex & Cursor) see if there was anything here that was problematic, they both flagged this. My understanding is that the skills would be applied from the repo root, not from where the skill is located, thus why the agents are flagging this as a potential issue.

I assumed that session handoff would still work fine because AI could figure this out - which is true. I tried a session handoff (which it kinda bungled because I was on your branch and not the branch I had done the rest of the stuff from the chat I asked it to create session-handoff from), and then I asked it some questions about how it did it, and it confirmed that it had to search for the scripts then run them from the full path from .cursor/.

FWIW it's also pointing out the Python version, it's running python3 - that feels less significant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those should be fixed in several places in the file now!

| `build` | Build system or CI changes |
| `chore` | Routine maintenance tasks |
| `ci` | Continuous integration configuration |
| `deps` | Dependency updates |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we ever use this deps type? (I feel like our team tends to use chore instead.)

We don't list deps in branch-naming.mdc or in .cursor/config.json.

I'm wondering if there should be a single source of truth for all the types as well? Like this skill and the branch-naming rule should both refer to the config.json instead of re-listing all the types again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the deps, and added some more documentation around using the config.json.


```tsx
function Tabs({ tabs }) {
const [activeIndex, setActiveIndex] = useState(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about we tweak the examples to better fit the LIT context since we’re using LIT in SWC? Right now, many examples seem to be using React.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me know what you think of the new examples! Cursor rewrote them.

@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/feat-agent-skills branch from a131d45 to 3642b55 Compare March 4, 2026 20:31
@marissahuysentruyt marissahuysentruyt added Status:Ready for re-review PR has had its feedback addressed and is once again ready for review. and removed Status:Ready for review PR ready for review or re-review. labels Mar 4, 2026
Copy link
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

This looks great! Just one question. ✨

}
```

## iOS VoiceOver
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove the iOS/Android/native section of this skill?

@blunteshwar
Copy link
Contributor

Once ci is green I think we are good to merge

@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/feat-agent-skills branch from 83cf8f2 to 5d20b9e Compare March 5, 2026 15:04
@marissahuysentruyt marissahuysentruyt merged commit 50a4816 into main Mar 5, 2026
23 checks passed
@marissahuysentruyt marissahuysentruyt deleted the marissahuysentruyt/feat-agent-skills branch March 5, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:Tooling Issue or PR dealing with scripts, workflows, automation, etc. Component prefix is for Jira Status:Ready for re-review PR has had its feedback addressed and is once again ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants