[NO JIRA] Add BPK token lookup rules for AI agents#4302
[NO JIRA] Add BPK token lookup rules for AI agents#4302GC Zhu (gc-skyscanner) wants to merge 5 commits intomainfrom
Conversation
|
Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser. |
There was a problem hiding this comment.
Pull request overview
Adds guard-rails for AI agents to correctly reverse-lookup and use Backpack (BPK) design tokens (SCSS vs TSX), with explicit “no fabrication” guidance and a defined lookup workflow.
Changes:
- Added a Claude rule file describing the authoritative token sources and lookup steps.
- Extended
AGENTS.mdwith a mandatory token lookup workflow and common token naming pitfalls.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| AGENTS.md | Adds a mandatory workflow and conventions for token lookup to prevent invented token names. |
| .claude/rules/bpk-token-value-lookup.md | Introduces an AI rule file documenting how to validate token names against foundations sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
07ac383 to
5d7fd93
Compare
|
Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser. |
5d7fd93 to
0be0005
Compare
|
Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser. |
Summary
.claude/rules/bpk-token-value-lookup.md— a concise rule file that instructs AI agents how to look up BPK design tokens correctly (SCSS vs TSX naming, spacing functions vs variables, border radius variables vs functions)AGENTS.mdwith a mandatory Token Lookup Workflow section, pointing agents to the reverse-lookup doc and the authoritative token source files before using any token nameMotivation
AI agents working in this codebase occasionally fabricate or approximate token names (e.g.
$bpk-color-sky-blue,spacingBase). These rules provide a clear, structured guard-rail: check the lookup doc first, thenbase.es6.d.ts/base.default.scss, and never invent a name.Test plan
.claude/rules/directory)🤖 Generated with Claude Code