既存のコードやデザインシステム、再利用したい既定の規約があるはず。モデルと一緒に作業するときは、ドロップダウンメニューや他の共通コンポーネントみたいに、コードベースにすでにあるパターンを参照すると効果的だよ。大規模な Web ベースのコードベースで自分たちも作業してきて、宣言的なコードがとりわけうまく機能することがわかった。特に React と JSX でね。デザインシステムがあるなら、エージェントが見つけやすいようにルールを用意しよう。これは、可能な限りコンポーネントの再利用を促すためのルールを書いた ui-components.mdc ファイルの例だよ:
components.mdc
Copy
Ask AI
---description: Implementing designs and building UI---- reuse existing UI components from `/src/components/ui`. these are the primitives we can build with- create new components by orchestrating ui components if you can't find any existing that solves the problem- ask the human how they want to proceed when there are missing components and designs