5 prompt engineering techniques to get the best out of a legacy project A developer outlines five prompt engineering techniques—zero-shot, few-shot, chain-of-thought, and instruction prompting—to help engineers understand and maintain legacy projects with minimal documentation. The techniques are drawn from scientific research and include CLI-based examples for tasks like translating string files and debugging authentication issues. Have you ever been at a situation where you have been recently hired to maintain a legacy project, an important project at your company, but the previous team has long retired, and when you start, there is no documentation? When that happens, the old adage of "The code is the documentation" sounds true, but what happen when the code is also very old, hard to understand, and make use of libraries from when your parents were dating? In that case, using an AI Tool to help you understand how this project was created and maintained could be an option. Below are five prompt engineering techniques taken from a scientific article, with CLI based examples, to help you get the best out working with a legacy project. A zero-shot prompt is when you make a prompt to request the model to execute a task without giving it any extra information or practical example in the input prompt. A classic example would be to ask a coding model to translate a "string.xml" file containing commonly used text strings in a natural language for example, English into another for example, Spanish . Those are the easiest prompts to create and to feed to the model, but their results can be more unpredictable, since they usually lack the constraints of larger prompts. I want you to translate the contents of "string.xml" from English into Spanish and output it to me. Check this project files and directories, and provide me a list containing the current node version being used on this project and its libraries. In contrast to a zero-shot prompt, a few-shot prompt is a prompt including one or more pairs of the desired input and output, so the model can infer or mimic the desired output when you input the next value. A classic example would be asking a model for predictions based on a set of constraints. Those prompts tend to be longer and more complicated, and you must check the answer, because there is always a chance the model may infer incorrectly your desired answer. I'm busy on my calendar thursday and friday nights for this week and the next. Starting two weeks from now, I'll be busy tuesday and wednesday nights for three weeks. Based on my schedule, propose a day of the week in the next four weeks for me to meet with my friends which does not conflict with my schedule. The chain-of-though prompting is where you use the model own linguistic skills to induce a correct answer. It is like guiding a child in a school homework, you provide the right questions, so the chain of thought of the model will find the answer. This project has an issue with the login page. Some users are unable to login correctly despite providing their user and correct password. Let's solve this step-by-step. What is the login authentication method used here? Please explain your analysis on the answer.