Patterns I’ve noticed in my prompts. Eternally a work in progress.
Table of contents
Open Table of contents
Antipattern:Copy an existing page and make some changes
create a clone of @DashboardPageDemo.stories.tsx and corresponding @DashboardPageDemo.stories.tsx called DashboardMetricsPatterns.
Keep the SideHeader, Date, and Range Selector, but remove the new metric.
I would like you to change the list of mock data to something I will provide. Additionally, I want you to add an overview page, which will be the top element of the left panel now.
This can be a bad pattern if the change is so small. The probability of issues in an LLM copying code is high.
Abstracting out a component to an existing one
In general, LLM coding has largely healed me of a bad habit of abstracting too early, but then I end up realizing its time for consistency.
Make a change but respect the type system
Prescribing doing things in a sequence
Usually triggers the Cursor composer planner to break it into 2 distinct steps and has higher chances of success.