I didn't want to say it in my initial post because I feared I would be downvoted for people thinking I was just spamming AI products. (I got downvoted anyways, so I guess it didn't matter.) I just use the Cursor IDE though, it's fabulous if you already use VSCode. And yeah I have no association with Cursor.
Cursor is pretty smart about what to prompt GPT with. In the case that you described, you might prompt it with something like "check for prod" and I expect it would work. The reason it would have a better success rate is that it's usually quite good about what context to send over - it would likely pick up the type definitions (if you have those) or other files that do similar things and send those over as well.
To give a full answer to your question, I actually wouldn't prompt it with "check for prod" at all because that would be underutilizing GPT. I would probably prompt at the complexity level of something like "edit this component so that if we're in prod, we show a warning message at the top". I would expect GPT to do that accurately for a component up to 100-200 lines virtually every time.
Cursor is pretty smart about what to prompt GPT with. In the case that you described, you might prompt it with something like "check for prod" and I expect it would work. The reason it would have a better success rate is that it's usually quite good about what context to send over - it would likely pick up the type definitions (if you have those) or other files that do similar things and send those over as well.
To give a full answer to your question, I actually wouldn't prompt it with "check for prod" at all because that would be underutilizing GPT. I would probably prompt at the complexity level of something like "edit this component so that if we're in prod, we show a warning message at the top". I would expect GPT to do that accurately for a component up to 100-200 lines virtually every time.