Skip to content

[NO JIRA] Add BPK token lookup rules for AI agents#4302

Open
GC Zhu (gc-skyscanner) wants to merge 5 commits intomainfrom
foundation-sdd
Open

[NO JIRA] Add BPK token lookup rules for AI agents#4302
GC Zhu (gc-skyscanner) wants to merge 5 commits intomainfrom
foundation-sdd

Conversation

@gc-skyscanner
Copy link
Contributor

Summary

  • Adds .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)
  • Extends AGENTS.md with a mandatory Token Lookup Workflow section, pointing agents to the reverse-lookup doc and the authoritative token source files before using any token name

Motivation

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, then base.es6.d.ts / base.default.scss, and never invent a name.

Test plan

  • Rule file is loadable by Claude Code (.claude/rules/ directory)
  • AGENTS.md renders correctly in GitHub
  • No existing tests broken (docs-only change)

🤖 Generated with Claude Code

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.md with 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.

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser.

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser.

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser.

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4302 to see this build running in a browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants