CodeBreak: AI-Assisted Development – Part 3

In Part 2 of this series, we improved the prompts, which solved some of the last issues. But in Parts 1 and 2, a hidden helper was living beneath the surface, helping us along.

A screenshot of a file explorer showing a folder named '.github' with an arrow pointing to a file named 'copilot-instructions.md' highlighted in blue.

That helper is the copilot-instructions.md file. I am pre-prompting the LLM with this file to show how I want things to be generated. But if I remove all the content of this file and generate the code using the same prompt, my solution is pretty horrible. Nothing is how I want it, and everything has problems.

What did it do wrong?

  • It put files in the wrong locations
  • It created a new routing module that I didn’t want
  • Used an angular structure I didn’t want
  • Nothing was built or ran out of the box

To be honest, without the pre-prompt file, I don’t know if AI provides much value.

This means that the first iteration from my first blog post could have been better if I had used a better instructions file.

I went through and made a couple of updates.

First, I added notes on the imports.

Second, I added notes on which fields to use when generating.

When I generate using the original prompt, I now get something closer to what I want.

Things that should be in your copilot-instructions file:

  • Project structure – where do you want certain types of files
  • Any style or preference option. For example, put Angular components into a single TypeScript file instead of html/scss/ts files.
  • Testing and mocking strategy
  • Include sample code of how you want your code generated

This three-part series has gone through some of the options for generating code. Each option has brought us closer to the goal, which is to generate quality code as fast as possible. None of these options gets us to done, but if we set ourselves up for success, we can reduce how much code we have to write, which allows us to focus on the more fun and challenging problems in software development.

author avatar
Chad Michel Chief Technology Officer
Chad is a lifelong Nebraskan. He grew up in rural Nebraska and now lives in Lincoln. Chad and his wife have a son and daughter.

Related posts