Skip to content

AI Product Dev Tips - Patterns of prompts

February 20, 2024 at 03:22 PM

Note: This is not a blog, it's a semi-private digital garden with mostly first drafts that are often co-written with an LLM. Unless I shared this link with you directly, you might be missing important context or reading an outdated perspective.


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.

image

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.

sequence

YOLO something complex and hope to be surprised

Non agentic one-shot CSS change

Other relevant posts: