SOLFIND
Web Lens
Portal home

Harness the power of generative AI for software development · GitHub

https://github.com/readme/guides/coding-generative-ai • 281 KB fetched
Open original page


Harness the power of generative AI for software development · GitHub Skip to content Navigation Menu Sign in * Platform * AI CODE CREATION * GitHub Copilot Write better code with AI * GitHub Copilot app Direct agents from issue to merge * MCP Registry Integrate external tools * DEVELOPER WORKFLOWS * Actions Automate any workflow * Codespaces Instant dev environments * Issues Plan and track work * Code Review Manage code changes * Code Quality Enforce quality at merge * APPLICATION SECURITY * GitHub Advanced Security Find and fix vulnerabilities * Code security Secure your code as you build * Secret protection Stop leaks before they start * EXPLORE * Why GitHub * Documentation * Blog * Changelog * Marketplace View all features * Solutions * BY COMPANY SIZE * Enterprises * Small and medium teams * Startups * Nonprofits * BY USE CASE * App Modernization * DevSecOps * DevOps * CI/CD * View all use cases * BY INDUSTRY * Healthcare * Financial services * Manufacturing * Government * View all industries View all solutions * Resources * EXPLORE BY TOPIC * AI * Software Development * DevOps * Security * View all topics * EXPLORE BY TYPE * Customer stories * Events & webinars * Ebooks & reports * Business insights * GitHub Skills * SUPPORT & SERVICES * Documentation * Customer support * Community forum * Trust center * Partners View all resources * Open Source * COMMUNITY * GitHub Sponsors Fund open source developers * PROGRAMS * Security Lab * Maintainer Community * GitHub Stars * Archive Program * REPOSITORIES * Topics * Trending * Collections * Enterprise * ENTERPRISE SOLUTIONS * Enterprise platform AI-powered developer platform * AVAILABLE ADD-ONS * GitHub Advanced Security Enterprise-grade security features * Copilot for Business Enterprise-grade AI features * Premium Support Enterprise-grade 24/7 support * Pricing Search / Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Harness the power of generative AI for software development Tools like GitHub Copilot and ChatGPT can change the way you build software. Artwork: Tim Peacock Anton Mirhorodchenko // Software Developer, The ReadME Project Open ReadME Project Menu Browse by story type * Featured Articles * Developer Stories * Guides * The ReadMe Podcast Explore Topics See all topics * AI * Application Security * Career Development * DevOps & Automation * Maintainer * Programming * Nominate a developer // * Support the community The ReadME Project amplifies the voices of the open source community: the maintainers, developers, and teams whose contributions move the world forward every day. * * * Also in Developer Stories Realizing potential with AI Across industries, large language models (LLMs), such as the ones powering tools like ChatGPT and GitHub Copilot, are automating tasks and revolutionizing the way we interact with both technology and one another. But despite their growing prominence, LLMs are frequently misunderstood or misused, leading to unrealistic expectations—and a certain disenchantment when they’re not met. With the necessary knowledge, however, anyone can effectively harness the power of LLMs to enhance their workflows. For me, LLMs are about simplifying complex physical actions that are difficult for me to perform, and enhancing skills that I haven’t developed, due to my disability. As someone living with cerebral palsy, typing and speaking are difficult, which limits how much I can write or communicate with people. Without the help of AI, I would have only written to a couple of friends about my project exploring AI-assisted code creation with a brief and modest “Look what I did!” At the same time, I also find it difficult to “showcase” myself, and working with AI helped me by highlighting alternatives.  This isn’t a characteristic often mentioned regarding LLMs, but I’ve found that they can counter my pessimism with optimistic alternatives, helping me bypass mental challenges. Instead of hiding behind the difficulties of writing and self-doubt, I used AI to write longer, more detailed descriptions, open sourced the project on GitHub to share my findings with other developers, and had it highlighted right here on The ReadME Project a couple months later! Whether it’s expanding abbreviations, summarizing text, helping with translation and writing, or simply offering alternatives, AI has been a powerful force in helping me go farther. In this article, I aim to demystify LLMs, offer you tips and tricks for integrating them into your own processes, and share the insights I gained from using ChatGPT and GitHub Copilot to aid in the development process. My ultimate goal is to provide you with the tools to significantly improve productivity and efficiency by incorporating LLMs into your workflow, just as I have done.  In this Guide, you will learn: * How LLMs might work differently than you think and why this matters. * Tips, tricks, and caveats for effective prompt engineering. * Methods for harnessing LLMs in software development. LLMs: Approximations of intelligence, nothing more An LLM, like any other neural network, should be regarded primarily as complex mathematical objects. Although there is a strong association between AI and the human brain, it is a misconception. Neural networks only mimic a small fraction of the brain’s processes—enough to achieve notable practical results and successfully approximate real intelligence—but not more. In the same vein, Newton’s laws served for centuries as a very good approximation of real physics processes, but not more. In essence, LLMs provide a reasonable approximation of human language and knowledge, but their approximations aren’t always optimal and they can still make significant errors. As an end-user, you need to understand that LLMs aim to accurately predict the correct output  by taking into account the context and meaning of the input. As the input’s length increases, it becomes more challenging to find connections between words, leading to a decline in accuracy. If there are too few connections between words they may be entirely overlooked, while too many connections can dilute their significance, which means optimizing your query is essential for effective prompt engineering. I often have various tasks to complete, but as a non-native English speaker, I prefer to write in my mother tongue. The LLM could easily understand and respond to me in the same language, but this can lead to numerous challenges. LLMs generate their output as a limited sequence of tokens, with some common words represented by single tokens, but with most words represented by several. This is further complicated when the LLM needs to produce non-English language text. In that case, they may need to produce Unicode characters one at a time, which is extremely challenging and leads to slower and less accurate predictions. This means that optimizing my query to generate the proper LLM response format is especially important. One solution to this problem is a simple tweak in my queries that improves the accuracy and speed of LLM responses. At the very start of the conversation, I just instruct LLM to provide responses in English, regardless of the language (or even multiple languages) that I use in my prompts. By “asking” the LLM to answer in English, we skip that extra complexity in the generation process. (I write “ask” in quotes because LLMs aren’t sentient—they simply detect an “asking” pattern and react in a learned fashion.) For example, I often write my requests in Ukrainian, but ask the LLM, whether ChatGPT or GitHub Copilot, to answer me in English to squeeze out the maximum speed and accuracy. Win-win situation, isn’t it? Human : Хто такий Леонардо да Вінчі? відповідай на англ. (Translation: “Who is Leonardo da Vinci? Answer in English.”) GitHub Copilot: Leonardo da Vinci was an Italian polymath of the Renaissance whose areas of interest included invention, painting, sculpting, architecture, science, music, mathematics, engineering, literature, anatomy, geology, astronomy, botany, writing, history, and cartography. ChatGPT: Leonardo da Vinci was an Italian polymath, born in 1452, who is widely considered to be one of the most influential figures in the history of art and science. He is best known for his paintings, including the Mona Lisa and The Last Supper, but he was also a skilled sculptor, architect, musician, engineer, inventor, and anatomist. Da Vinci’s contributions to fields such as engineering, anatomy, and mathematics were groundbreaking for his time and continue to influence modern science today. His work is considered the epitome of the Italian Renaissance and has had a lasting impact on Western art and culture. As you can see, the LLMs answered my question in English, despite the fact that I wrote it in Ukrainian, which leads to faster and more accurate responses.  We want to hear from you! Join us on GitHub Discussions . Tips and tricks for effective LLM use During my time exploring AI-assisted coding (which we’ll get to soon), I learned many things about effectively using AI. Below are the top tips and tricks to keep in mind when using an LLM: * Shorten requests: Minimizing text inputs and using shorthand, such as only using just the first letter of a word and the vowel, lets you significantly reduce the amount of typing required, which can make communication faster, more efficient, and accessible . This may also have a positive effect on answer quality, because it reduces the number of tokens used. * Use domain-specific and specialized terminology: Use concise and precise language to convey complex ideas. This helps LLMs recognize patterns and communicate more efficiently, and is especially helpful in technical fields such as science, medicine, and programming. * Avoid formality: Remember, as we explained above, that every word in your input prompt counts and increases both the complexity of the task and potentially the inaccuracy of the response. Keeping your prompt brief can mean removing language you would use to communicate with a person that only adds confusion for an LLM. For example, skip the “Can you…” at the beginning of the sentence and get straight to the query. Every word counts, and an LLM is less concerned with proper grammar than the relationship between the words you use. * Use the “ Act as ” trick: Prompt LLMs to take on a specific role by using “ role snippets ” in a conversation to help generate more accurate and complete output. Limit the description to a specific job title, profession, etc. and include instructions or guidelines for what the LLM should or shouldn’t do. This can shape the conversation and achieve more specific and relevant output. Unfortunately, this trick is less effective than it used to be, due to security and safety measures put in place to prevent the LLMs from causing harm or generating inappropriate content. Still, it can set the context for an entire conversation and help shape output. * Use “ As a ” prompts: Achieve granular control of LLM output by including the direction to “ Start with ‘As a [role name], [optional action]’ ” in your prompts. This method directs the LLM to format its response in a certain way, and allows us to shape the response to achieve more specific and relevant output, while taking much less effort than typical “role snippets.” As we’ll see below, “ Act as ” is better for assigning a role for the duration of a longer dialogue, while “ As a ” is better when you want to assign a role for a single reply. * Beware the curse of wording: As mentioned, even small differences in language can have a big impact on results. For example, you might assume that both “ fix the bug ” and “ investigate the bug ” have the similar meanings, but each has different implications. “ Fix the bug ” may imply a straightforward resolution, whereas “ investigate the bug ” may imply a more thorough investigation into the root cause of the issue before taking action. As such, you need to carefully choose every word. * Use dialogues efficiently: Keep the conversation focused on a single task as much as possible, and don’t hesitate to create as many dialogues as you need. Just like conversing with humans, you shouldn’t mix different topics, tasks, or levels of responsibility (such as junior and senior developer roles) in a single dialogue, because it can become confusing.  For example, if you want to ask an LLM to fix a bug, don’t ask it to do it in the same dialogue as where you ask it to investigate the bug. Here, we can combine some of the tips described above and instead use a dialogue where you’ve assigned a “senior developer” role to investigate the bug and provide a list of tasks for junior developers. Then, in a separate dialogue where you’ve assigned the LLM a “junior developer” role, you can input that list, requesting the actions the junior developer would take to fix the bug.  You might be tempted to treat each of these dialogues as a continued conversation, but remember that more context can actually mean more complexity and therefore inaccuracy. Instead, keep just the initial prompt assigning the role and then edit your subsequent prompt with the input to keep the context small and focused. This allows you to work on the next task without polluting the context of a previous, and potentially very different, task.  Lastly, interrupt response generation to “load” the LLM with context. For example, provide a project description, and then immediately interrupt the response generation so it doesn’t complete. Then, enter the task as the next input. By doing this, you provide the LLM with context as a separate message, but you don’t allow the LLM to “pollute” its own context with its own potentially incorrect response. Tricks 4 and 5 share similar core ideas, so let's examine them more closely. First, let's compare their prompts. The “ Act as ” Prompt: Human: I want you to act as an IT Architect. I will provide some details about the functionality of an application or other digital product, and it will be your job to come up with ways to integrate it into the IT landscape. This could involve analyzing business requirements, performing a gap analysis and mapping the functionality of the new system to the existing IT landscape. Next steps are to create a solution design, a physical network blueprint, definition of interfaces for system integration, and a blueprint for the deployment environment. My first request is “I need help to integrate a CMS system.” The “ As a ” Prompt:  Human: I need help to integrate a CMS system. Start with, “As an IT Architect, I” As you can see, the first prompt using a “role snippet” is not only significantly longer than the second, it is also highly dependent on the specific task at hand, which means that you may need to invest additional effort to modify the role specifications for new tasks. At the same time, AI responds almost identically to them. The “ Act as ” Response: ChatGPT: Sure, I can help you integrate a CMS system into your IT landscape. Before we start, could you provide me with some more information about your business requirements and your existing IT landscape? This will help me to understand your needs and identify any potential gaps or challenges that may arise during the integration process.  Here are some questions that will help me to better understand your needs: 1. What is the main purpose of the CMS system? Is it for content creation, management, or both? 2. What type of content will you be managing with the CMS? For example, will it be text-based, multimedia-based, or a combination of both? 3. What is your existing IT landscape? Are there any existing content management systems or databases that the CMS system will need to integrate with? 4. What are your scalability and availability requirements for the CMS system? How many users do you expect to be using the system, and how much traffic do you expect to be generated? 5. What security requirements do you have for the CMS system? For example, do you need to comply with any industry-specific regulations or standards? Once we have a clear understanding of your requirements and existing IT landscape, we can move on to creating a solution design, a physical network blueprint, definition of interfaces for system integration, and a blueprint for the deployment environment.  The “ As a ” Response: ChatGPT: As an IT Architect, I would suggest a step-by-step approach for integrating a CMS system: 1. Identify the CMS system that meets the organization’s needs and requirements. This may involve researching and evaluating different CMS systems based on factors such as features, scalability, security, and compatibility with existing systems. 2. Develop an integration plan that outlines the process and timeline for integrating the CMS system into the organization’s infrastructure. This plan should include details on the technical requirements, resources needed, and any potential risks or challenges. 3. Ensure that the CMS system is compatible with the organization’s existing hardware and software infrastructure. This may involve conducting a compatibility test or making necessary upgrades to the infrastructure.  4. Set up the CMS system according to the organization’s needs and requirements. This may involve configuring the system’s settings, templates, and plugins to match the organization’s branding and content needs.  5. Migrate existing content to the new CMS system. This may involve transferring data from the old system to the new system, ensuring that all content is properly formatted and organized.  6. Train relevant personnel on how to use the CMS system. This

Links found on this page

  1. Skip to content [direct]
  2. Sign in [direct]
  3. GitHub Copilot Write better code with AI [direct]
  4. GitHub Copilot app Direct agents from issue to merge [direct]
  5. MCP Registry Integrate external tools [direct]
  6. Actions Automate any workflow [direct]
  7. Codespaces Instant dev environments [direct]
  8. Issues Plan and track work [direct]
  9. Code Review Manage code changes [direct]
  10. Code Quality Enforce quality at merge [direct]
  11. GitHub Advanced Security Find and fix vulnerabilities [direct]
  12. Code security Secure your code as you build [direct]
  13. Secret protection Stop leaks before they start [direct]
  14. Why GitHub [direct]
  15. Documentation [direct]
  16. Blog [direct]
  17. Changelog [direct]
  18. Marketplace [direct]
  19. View all features [direct]
  20. Enterprises [direct]
  21. Small and medium teams [direct]
  22. Startups [direct]
  23. Nonprofits [direct]
  24. App Modernization [direct]
  25. DevSecOps [direct]
  26. DevOps [direct]
  27. CI/CD [direct]
  28. View all use cases [direct]
  29. Healthcare [direct]
  30. Financial services [direct]
  31. Manufacturing [direct]
  32. Government [direct]
  33. View all industries [direct]
  34. View all solutions [direct]
  35. AI [direct]
  36. Software Development [direct]
  37. DevOps [direct]
  38. Security [direct]
  39. View all topics [direct]
  40. Customer stories [direct]
  41. Events & webinars [direct]
  42. Ebooks & reports [direct]
  43. Business insights [direct]
  44. GitHub Skills [direct]
  45. Customer support [direct]
  46. Community forum [direct]
  47. Trust center [direct]
  48. Partners [direct]
  49. View all resources [direct]
  50. GitHub Sponsors Fund open source developers [direct]
  51. Security Lab [direct]
  52. Maintainer Community [direct]
  53. GitHub Stars [direct]
  54. Archive Program [direct]
  55. Topics [direct]
  56. Trending [direct]
  57. Collections [direct]
  58. Copilot for Business Enterprise-grade AI features [direct]
  59. Premium Support Enterprise-grade 24/7 support [direct]
  60. Pricing [direct]
  61. Sign up [direct]
  62. Tim Peacock [direct]
  63. The ReadME Project [direct]
  64. Featured Articles [direct]
  65. Developer Stories [direct]
  66. Guides [direct]
  67. The ReadMe Podcast [direct]
  68. See all topics [direct]
  69. AI [direct]
  70. Application Security [direct]
  71. Career Development [direct]
  72. DevOps & Automation [direct]
  73. Maintainer [direct]
  74. Programming [direct]
  75. Nominate a developer [direct]
  76. Support the community [direct]
  77. Realizing potential with AI [direct]
  78. open sourced the project [direct]
  79. on The ReadME Project [direct]
  80. Join us on GitHub Discussions [direct]