Add design-history-tracking Cursor rule#14
Add design-history-tracking Cursor rule#14JustinXHale wants to merge 1 commit intopatternfly:mainfrom
Conversation
Co-authored-by: Andy Braren <andybraren@users.noreply.github.com> Made-with: Cursor
| @@ -0,0 +1,46 @@ | |||
| --- | |||
There was a problem hiding this comment.
This needs to be a tool-agnostic agent (.md under plugins/<name>/agents/) rather than a .mdc rule - .mdc only works in Cursor, and this repo distributes to both Cursor and Claude Code. It also needs to move under a plugin directory to be discoverable by plugin users.
| @@ -0,0 +1,46 @@ | |||
| --- | |||
| description: When making design-related UI/UX changes, automatically record what changed and why so designers don't have to manually track design justification. | |||
| globs: "**/*.{ts,tsx,js,jsx,css,scss}" | |||
There was a problem hiding this comment.
alwaysApply: true on all TS/JS/CSS files means this fires on every edit, even non-design ones. Would a conditional trigger be more appropriate here?
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughA new Cursor rule file for design-history tracking is added. It enforces accountability for design-related code changes by requiring in-chat summaries and optional dated entries in project design-history documents. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.cursor/rules/design-history-tracking.mdc (2)
1-5:⚠️ Potential issue | 🟠 MajorThis rule is tool-specific and will create cross-tool behavior drift.
Placing this only under
.cursor/rules/*.mdcmeans the behavior won’t exist in non-Cursor agent flows, so teams get inconsistent review/documentation behavior depending on tool choice.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/rules/design-history-tracking.mdc around lines 1 - 5, The rule file design-history-tracking.mdc is scoped only to .cursor/rules which causes behavior to be present only for Cursor agent flows; move or duplicate this rule into the repository's global rules/config (or add equivalent entries in the shared CI/agent config) so the design-history-tracking behavior is applied across non-Cursor agent flows as well; update the rule's globs or global rules index and add a short note in the shared rules registry indicating this rule must be propagated to all agents to avoid cross-tool drift.
3-4:⚠️ Potential issue | 🟠 Major
alwaysApply: truewith broad UI file globs is too aggressive for the stated scope.This will fire on routine TS/JS/CSS edits that are not design changes, increasing prompt noise and instruction conflicts. Gate activation to explicit design-change intent instead of unconditional apply.
Suggested frontmatter adjustment
globs: "**/*.{ts,tsx,js,jsx,css,scss}" -alwaysApply: true +alwaysApply: false🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/rules/design-history-tracking.mdc around lines 3 - 4, The rule currently sets alwaysApply: true with broad globs ("**/*.{ts,tsx,js,jsx,css,scss}") which is too aggressive; change the frontmatter in design-history-tracking.mdc to stop unconditional firing by setting alwaysApply to false and add an explicit activation condition (for example require a "design" changelog label, a commit message prefix, or a narrower set of globs focused on design assets) so the rule only runs when there's explicit design-change intent; update the rule metadata (alwaysApply, globs, and add a new activation key such as requiredLabel or triggerPattern) and adjust any documentation in the same file accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.cursor/rules/design-history-tracking.mdc:
- Around line 24-33: The rule that instructs the assistant to “append a brief
dated entry” to project files (see rule 2 referencing design-history.md and
.design/design-history.md) must be changed to require an explicit safety gate:
update the text so the assistant only auto-appends when there is an explicit
user request or a repo-level policy/flag authorizing file writes; otherwise the
assistant should limit itself to producing an in-chat summary and optionally
suggesting adding a design-history.md. Make this requirement clear and
unambiguous in the rule wording and include the exact trigger phrases (“explicit
user request” or “repo policy/flag”) so callers can detect and enforce the
consent check.
---
Duplicate comments:
In @.cursor/rules/design-history-tracking.mdc:
- Around line 1-5: The rule file design-history-tracking.mdc is scoped only to
.cursor/rules which causes behavior to be present only for Cursor agent flows;
move or duplicate this rule into the repository's global rules/config (or add
equivalent entries in the shared CI/agent config) so the design-history-tracking
behavior is applied across non-Cursor agent flows as well; update the rule's
globs or global rules index and add a short note in the shared rules registry
indicating this rule must be propagated to all agents to avoid cross-tool drift.
- Around line 3-4: The rule currently sets alwaysApply: true with broad globs
("**/*.{ts,tsx,js,jsx,css,scss}") which is too aggressive; change the
frontmatter in design-history-tracking.mdc to stop unconditional firing by
setting alwaysApply to false and add an explicit activation condition (for
example require a "design" changelog label, a commit message prefix, or a
narrower set of globs focused on design assets) so the rule only runs when
there's explicit design-change intent; update the rule metadata (alwaysApply,
globs, and add a new activation key such as requiredLabel or triggerPattern) and
adjust any documentation in the same file accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c764368f-6c16-48fd-aee6-34b13e136ad0
📒 Files selected for processing (1)
.cursor/rules/design-history-tracking.mdc
| 2. **If the project has a design-history file**, append a brief dated entry there instead of or in addition to the in-chat summary. Look for: | ||
| - `design-history.md` (project root) | ||
| - `.design/design-history.md` | ||
| - Or a path documented in the project README or CONTRIBUTING. | ||
|
|
||
| Entry format (keep it short): | ||
| - Date (YYYY-MM-DD) | ||
| - One line: what changed and why (e.g. `[Update] Primary CTA moved to PageHeader actions for visibility.`) | ||
|
|
||
| 3. **If there is no design-history file**, rely on the in-chat summary. You may suggest adding a `design-history.md` if the designer wants a persistent log. |
There was a problem hiding this comment.
Auto-appending project files needs an explicit safety gate.
“Append a brief dated entry” can trigger unintended repository writes during normal assistant usage. Add an explicit condition (user request or repo policy flag) before modifying files; otherwise keep to in-chat notes only.
Suggested rule hardening
-2. **If the project has a design-history file**, append a brief dated entry there instead of or in addition to the in-chat summary.
+2. **If the project has a design-history file and the user explicitly requests file updates (or repo policy requires it)**, append a brief dated entry there. Otherwise, keep the update in-chat only.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/rules/design-history-tracking.mdc around lines 24 - 33, The rule
that instructs the assistant to “append a brief dated entry” to project files
(see rule 2 referencing design-history.md and .design/design-history.md) must be
changed to require an explicit safety gate: update the text so the assistant
only auto-appends when there is an explicit user request or a repo-level
policy/flag authorizing file writes; otherwise the assistant should limit itself
to producing an in-chat summary and optionally suggesting adding a
design-history.md. Make this requirement clear and unambiguous in the rule
wording and include the exact trigger phrases (“explicit user request” or “repo
policy/flag”) so callers can detect and enforce the consent check.
Summary
Adds a new Cursor rule (
.cursor/rules/design-history-tracking.mdc) so that when the agent makes design-related UI/UX changes, it automatically records what changed and why. Designers get a clear trail of design justification without maintaining it manually.What it does
design-history.md(or.design/design-history.mdor a path documented in README/CONTRIBUTING), the agent can append a brief dated entry there.design-history.mdif the user wants a persistent log. No feature mapping or custom folder structure is created.Scope
**/*.{ts,tsx,js,jsx,css,scss}.description,globs,alwaysApply: true.design-history-tracking.mdc.Origin
This rule is a generalized version of a workflow we use in the RHOAI UXD prototype: designers were manually tracking design history; we wanted the agent to do it by default. The upstream version is stripped down so it works in any PatternFly project with no required setup.
Summary by CodeRabbit