Single prompt vs multiple prompts

I am using Claude 4.0 Sonnet in cursor. My task is to write prompts to automate the process of code generation. There are approximately 15 code files which need to be generated of around 300 lines in each file. So I am giving file specific prompts for the generation of each file. But my seniors are asking to do it in single prompt. But that is not giving much relevant results. Is there any modification which which I have to do or I have to change my approach for this. Or is there any article or documentation which supports that file specific prompts give more accuracy.

1 Like

I think this might be easier to follow if you give specific examples.

What I do:
I give into the vibes, i.e. I do not provide file specific prompts, but rather tell the overall target and then guide by architectural principles such as DRY, KISS, YAGNI, SOLID etc.

From my experience, I cannot recommend expecting deterministic results from a non-deterministic piece of software (=AI) – if this is what you are after. But I am happy to see what others have to say.

edit: but I am still not sure if I understood the problem you are trying to solve.

Do those files follow the same pattern, f.e. 15 files with data models? If yes, Cursor does a relatively good job with that. If not, try the following:

  1. Create 15 files with prompts, or tell Cursor to write a script that creates those files and fills them for you based on your input.
  2. Provide those file names as a list of tasks, and tell Cursor to always read the next file from the list after the previous task is complete, until all tasks are finished.

The advantage is that Cursor reads next instructions only after completing the previous task, so it doesn’t get distracted and doesn’t get its context bloated before approaching the adequate task.

EDIT: Since the limit of tool calls in one request is 25, you will have to combine some of those tasks into one (preferably the shortest ones).