chore: move to skills only for LLMs [AR-55502]#495
Conversation
✅ Deploy Preview for drivenets-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
8b0fc60 to
6274c45
Compare
800aeac to
70f70b9
Compare
61c7255 to
3c0a755
Compare
There was a problem hiding this comment.
the AGENTS.md & CONTEXT.md have to be at the top-level?
and isn't it a duplication of the readme?
There was a problem hiding this comment.
That would be best. The root is the source/entry point of the whole map of skills for every LLM
Probably we will reduce the readme, as to reduce the noise 💯
| - [ ] Matches Figma design | ||
| - [ ] Storybook examples show all states (controlled + localized) | ||
| - [ ] No cross-component internal imports | ||
| - [ ] No unnecessary `useMemo`/`useCallback` |
There was a problem hiding this comment.
DsTable is the exclusion
| value?: string | null; | ||
| onValueChange?: (value: string | null) => void; |
There was a problem hiding this comment.
All props should have JSdocs, except maybe ref, className, style
There was a problem hiding this comment.
usually we follow a "common sense". If the prop is not so straightforward then we add the JSDocs, that's my impression. I will add this rule and we will see how it goes 👍
There was a problem hiding this comment.
It gets some praise from the devs using https://www.aihero.dev/ guidance. It can be worth adding and experimenting. The idea is, you try new skills/plugins when another one fails to debug,
If we end up not using it at all, we can remove it 💯
achieve better result How can you know without using it?
There was a problem hiding this comment.
Everything is a lie here. I think the whole skill is heavily outdated and misleading.
There was a problem hiding this comment.
Hmm, I was updating this skill with the annotation to the root_new 🤔 Good catch and I will verify other figma related skills 👍
There was a problem hiding this comment.
I'm pretty sure Figma MCP server instructios already provide this info.
There was a problem hiding this comment.
On paper if you provide direct MCP methods the LLM does not need to scrap the whole MCP and look for a proper method, tokens saving which is crucial for keeping the context for MCPs as small as possible
There was a problem hiding this comment.
I think the whole skill is heavily outdated and misleading. I would remove everything and write that Figma may use outdated tokens, components and do not use DS component's where they should have been used. This information can live in this skill or you can add it to a different place, I don't mind. But this skill as it is no - harms more than helps.
There was a problem hiding this comment.
Only tokens reference is outdated, right? The rest is what we do (naming conventions, pointing LLM to a proper MCP methods, API conventions matching figma props).
"that Figma may use outdated tokens, components and do not use" I know we are aware this can happen in the DAP, but in the DS it's a no-no, right?
There was a problem hiding this comment.
Why do we need this file? The skill is described in SKILL.md.
There was a problem hiding this comment.
Skill is one thing, this is the format file which tells LLM to follow the proper format, copied one to one from the https://www.aihero.dev/
There was a problem hiding this comment.
Why do we need this file? The skill is described in SKILL.md.
There was a problem hiding this comment.
Skill is one thing, this is the format file which tells LLM to follow the proper format, copied one to one from the https://www.aihero.dev/
There was a problem hiding this comment.
What do you mean? I remember we had problems with vi time mocks and we had to use mockdate, didn't we?
There was a problem hiding this comment.
Aa! It probably works since we have browser tests, si?
There was a problem hiding this comment.
This is specific to a single use case we had in the past. It doesn't make sense to keep this instruction in the skill.
| | Requirement | Details | | ||
| | ------------------------------------------ | -------------------------------------- | | ||
| | **No unnecessary `useMemo`/`useCallback`** | React Compiler handles most cases | | ||
| | **Justify memoization** | Only when profiling shows real benefit | | ||
|
|
||
| ```typescript | ||
| // Bad | ||
| const filteredItems = useMemo(() => items.filter((i) => i.active), [items]); | ||
| const handleClick = useCallback(() => onChange(value), [onChange, value]); | ||
|
|
||
| // Good | ||
| const filteredItems = items.filter((i) => i.active); | ||
| const handleClick = () => onChange(value); | ||
| ``` |
There was a problem hiding this comment.
Except DsTable, because we excluded it from React Compiler
| ```typescript | ||
| // Bad | ||
| const [local, setLocal] = useState(prop); | ||
| useEffect(() => setLocal(prop), [prop]); | ||
|
|
||
| // Good | ||
| const value = isControlled ? externalValue : internalValue; | ||
| ``` |
There was a problem hiding this comment.
We useControlled hook now, let's recommend it here instead
|
|
||
| | Requirement | Details | | ||
| | ------------------------------------- | -------------------------------------------- | | ||
| | **Don't spread native objects** | `{...file}` loses `File` prototype | |
There was a problem hiding this comment.
Duplicate and again it's a single use case scenario, we don't need it here.
There was a problem hiding this comment.
On the other hand, we will work with files 100% in the future so it will definitely be useful but not all the time 🤔
| ```tsx | ||
| const copy = new File([originalFile], originalFile.name, { type: originalFile.type }); | ||
| ``` |
There was a problem hiding this comment.
How come it is a common pitfall? In how many components we deal with File?
There was a problem hiding this comment.
That is the only example we have in the repo, so it's a native file pitfall, not common one
There was a problem hiding this comment.
The benefits from this skill are questionable, almost no usefull info
There was a problem hiding this comment.
Why is that? What specifically is not useful? For me most of the things are common and straightforward patterns we use in the repo
| | **No `!important`** | Refactor selectors instead | | ||
| | **Transitions** | `0.2s` standard | | ||
| | **Component-scoped variables** | In component file | | ||
| | **Avoid `overflow: hidden` band-aid** | Fix root layout cause | |
There was a problem hiding this comment.
Strange rule, to abstract, even I have no idea what it s about
There was a problem hiding this comment.
It was mentioned in the past code reviews a few times
There was a problem hiding this comment.
Integrate Storybook MCP best practises into this skill.
https://storybook.js.org/docs/ai/best-practices
There was a problem hiding this comment.
I don't see use case for this skill.
There was a problem hiding this comment.
Then you can play with it. You start with discussing the issue/feature in the agent mode with /grill-me or /grill-with-docs (to keep the new context in the repo) and after final conclusion you run /to-plan in plan mode. That way you will create a brand new file with all the instructions which you use in the brand new context window (agents enter the dumb zone around 100-120k tokens per session)
| ## Types and exports | ||
|
|
||
| | Requirement | Details | | ||
| | ---------------------------------- | ---------------------------------------------------------------------------------------------------- | | ||
| | **No redundant JSDoc** | Don't restate prop name or type; skip `@interface` / `@type` | | ||
| | **Descriptive prop JSDoc** | Non-trivial props in `*.types.ts` for AI manifest; `@default` when helpful. Reference: `DsTextInput` | | ||
| | **Full type references** | Import named types | | ||
| | **Export from `.types.ts`** | Dedicated type files for components | | ||
| | **Export variant arrays** | `as const` for Storybook `argTypes.options` — see [component-api](../component-api/SKILL.md) | | ||
| | **`Object.freeze` config exports** | Prevent mutation on mapping objects | | ||
|
|
||
| ```typescript | ||
| export const loaderVariants = ['spinner', 'pulsing'] as const; | ||
| export type LoaderVariant = (typeof loaderVariants)[number]; | ||
|
|
||
| export const circleSizeMap: Record<AvatarSize, number> = Object.freeze({ | ||
| small: 24, | ||
| medium: 32, | ||
| large: 48, | ||
| }); | ||
| ``` |
There was a problem hiding this comment.
I would move all that to skills related to component development. It's not general Typescript rules
| | Requirement | Details | | ||
| | ------------------------------ | --------------------------------- | | ||
| | **Let code breathe** | Whitespace between logical chunks | | ||
| | **Name magic numbers** | Descriptive constants | | ||
| | **Early returns** | Simplify conditionals | | ||
| | **No cross-component imports** | Extract shared logic to utils | |
There was a problem hiding this comment.
All this falls into general TS best practises, I think LLM is trained to behave like this
There was a problem hiding this comment.
I would assume nothing in the LLM world 💯 😄 it's trained on everything, it does not understand what's good or bad in any way
| ## Focus areas | ||
|
|
||
| - Cross-component internal imports (`../ds-other/...` utilities) | ||
| - Props layer exposes library internals; missing `className` / `style` / `ref` | ||
| - SCSS: hardcoded colors/spacing, `!important`, `overflow: hidden` band-aids | ||
| - Stories: inline styles, missing controlled/localized stories, leftover `play` | ||
| - Browser tests: `getByTestId` without reason, `toBeVisible()`-only tests, no behavior assertion | ||
| - `useMemo`/`useCallback` without justification | ||
| - Raw `<img>` instead of DS image components |
There was a problem hiding this comment.
why do we repeat staff mentioned in skills?
There was a problem hiding this comment.
Eh, same issue as always when working with many files with agents. It reverted the old version while making changes in another files. This skill was calling another skills with explanation. I will fix that 👍
|
|
||
| 7. All green → push and open PR | ||
| ``` | ||
| Add to `.cursor/mcp.json` (project) or your client’s global MCP config. Local dev: `pnpm --filter @drivenets/ds-storybook-mcp dev`. |
There was a problem hiding this comment.
@drivenets/design-system-mcp
| - [docs/adr/](docs/adr/) — load-bearing decisions agents must not contradict (primitive stack, props layer, interaction testing, doc layout) | ||
|
|
||
| Auto-applied contextual guidance for the AI agent. | ||
| #### Storybook MCP (`@drivenets/ds-storybook-mcp`) |
There was a problem hiding this comment.
@drivenets/design-system-mcp
| "drivenets-ds": { | ||
| "type": "stdio", | ||
| "command": "npx", | ||
| "args": ["-y", "@drivenets/ds-storybook-mcp"] |
There was a problem hiding this comment.
@drivenets/design-system-mcp
iromanchuk-dn
left a comment
There was a problem hiding this comment.
Great staff! I've left some comments
96cf73a to
c7787e4
Compare

No description provided.