P

How to Draft a Contract with GitHub Copilot

GitHub Copilot, Microsoft's AI assistant integrated into Visual Studio Code, is not limited to code generation. Thanks to its advanced natural language processing capabilities, it can help you draft structured legal documents like contracts. Whether you are a freelancer, entrepreneur, or project manager, Copilot allows you to quickly create a first draft of a contract while respecting essential clauses. In this tutorial, you will learn how to use GitHub Copilot to generate a professional contract step by step, customizing each section to your needs. Note: the result must always be reviewed by a legal professional before signing.

Prerequisites

  • 1.Have a GitHub account with an active Copilot subscription (Individual, Business, or Enterprise)
  • 2.Have Visual Studio Code installed with the GitHub Copilot and GitHub Copilot Chat extensions enabled
  • 3.Know the key contract information: involved parties, purpose, duration, and general conditions
  • 4.Have a basic understanding of legal elements of a contract (or refer to a reference model)

Steps

1

Define the general contract structure

Open a new Markdown (.md) or text (.txt) file in VS Code. Use Copilot Chat to generate the complete contract skeleton with all standard sections: identification of parties, purpose of the contract, duration, obligations, financial conditions, confidentiality, termination, and signatures. This gives you a solid foundation to customize.

Generate the complete structure of a service contract between a freelancer and a company. Include the following sections: identification of parties, preamble, purpose of the contract, duration and schedule, obligations of the service provider, obligations of the client, financial conditions and payment terms, intellectual property, confidentiality, termination, liability, force majeure, disputes and applicable law, signatures. Format in Markdown with numbered headings.

Tip: Specify the type of contract from the start (service, NDA, license, partnership) to get a structure tailored to your situation.
2

Draft identification clauses and preamble

Fill in the information of the contracting parties (names, addresses, SIRET/SIREN numbers) and draft the preamble that contextualizes the agreement. Use Copilot Chat to generate a professional preamble explaining the context of the collaboration and the intent of both parties.

Draft a preamble for a web services contract between [FREELANCER_NAME], an independent developer specializing in website creation, and [COMPANY_NAME], a company wishing to redesign its e-commerce site. The preamble should set out the context, the provider's skills, and the client's needs. Use a professional and legal tone.

Tip: Systematically replace the brackets with your actual information. Don't forget mandatory legal mentions like the SIRET number for self-employed workers in France.
3

Generate financial and payment clauses

The financial conditions are the heart of the contract. Ask Copilot to draft detailed clauses covering the amount of fees, payment schedule, late payment penalties, ancillary costs, and conditions for tariff revision. Ensure amounts are expressed excluding tax (HT) and including tax (TTC).

Draft the financial clauses of a service contract for a web development project billed at 8,000 euros excluding tax. Include: a 30% deposit upon signing, a 40% payment at mid-project, the remaining 30% upon final delivery. Specify payment deadlines (30 days), late payment penalties in accordance with French law (ECB rate + 10 points), a fixed recovery indemnity of 40 euros, and invoicing conditions.

Tip: Always verify that late payment penalties and legal mentions comply with the French Commercial Code (articles L441-10 and following). Rates change every semester.
4

Draft intellectual property and confidentiality clauses

These clauses are crucial to protect both parties. Use Copilot to generate clauses for transfer of intellectual property rights (total or partial), confidentiality (integrated NDA), and non-compete if necessary. Clearly specify the scope and duration of each clause.

Draft an intellectual property clause for a web development contract stipulating that rights to deliverables are transferred to the client after full payment, that the service provider retains the right to reuse generic components and open source libraries, and that the service provider may mention the project in their portfolio. Add a confidentiality clause with a duration of 3 years covering commercial, technical, and strategic information exchanged within the project.

Tip: The transfer of intellectual property rights must be detailed (transferred rights, media, duration, territory) to be valid under French law according to the Intellectual Property Code.
5

Finalize with termination and dispute resolution clauses

Complete your contract by adding conditions for early termination, a force majeure clause, and a dispute resolution method. Ask Copilot to generate these final sections, then review the entire document for overall consistency. Export the final file to PDF for signing.

Draft the final clauses of a service contract: 1) Early termination with 30 days' notice by registered letter, including indemnification conditions in case of breach; 2) Force majeure clause in accordance with Article 1218 of the Civil Code; 3) Dispute resolution clause providing first for an amicable mediation attempt, then jurisdiction of the Paris Commercial Court; 4) Entire agreement clause stipulating that the contract replaces all prior agreements. Add a signature block with date and mention 'Read and approved'.

Tip: Always have the final contract reviewed by a lawyer or legal expert before signing. Copilot is a drafting aid, not legal advice. Export to PDF via the Markdown PDF extension in VS Code.

Common mistakes to avoid

  • Using the contract generated by Copilot as-is without having it reviewed by a legal professional — the AI may produce legally imprecise or non-compliant clauses
  • Forgetting to customize generic information (names, amounts, dates, identification numbers) and leaving placeholders in brackets in the final document
  • Neglecting mandatory legal mentions such as late payment penalties, fixed recovery indemnity, or general conditions required by the French Commercial Code
  • Not specifying the applicable law or competent jurisdiction, which can cause problems in case of disputes, especially for international contracts
  • Copy-pasting clauses from different prompts without checking overall contract consistency (terminology, article numbering, cross-references)

FAQ

Does the contract generated by GitHub Copilot have legal validity?
No, GitHub Copilot is an aid for drafting and does not replace legal advice. The generated contract is a working draft that must be reviewed, validated, and possibly modified by a lawyer or legal expert before signing. The legal validity of the contract depends on its compliance with applicable law, not on the tool used to draft it.
Can Copilot adapt the contract specifically to French law?
Copilot can generate clauses inspired by French law if you specify it in your prompt (references to the Civil Code, Commercial Code, etc.). However, its knowledge may be incomplete or outdated. Always explicitly mention the desired legal framework and verify the cited legal references with official sources such as Légifrance.
What types of contracts can I draft with GitHub Copilot?
You can use Copilot as an assistant for any type of contract: service contract, employment contract (fixed-term/permanent), non-disclosure agreement (NDA), software license agreement, general terms and conditions of sale (GTC), business partnership agreement, professional lease, etc. The more precise you are in your prompt about the type of contract and context, the better the result.
How can I ensure the confidentiality of information entered in Copilot?
With GitHub Copilot Business or Enterprise, your data is not used to train models. For Individual accounts, consult GitHub's privacy policy. As a precaution, avoid entering sensitive personal data (social security numbers, bank details) directly in prompts. Instead, use placeholders that you will manually replace in the final document.

Related tutorials

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More tutorials

How to Draft a Contract with Midjourney

Midjourney is an AI image generation tool, not a legal text writer. However, it can effectively assist you in creating visually professional contracts. This tutorial guides you step by step to leverage Midjourney in the contract creation process: from designing a professional visual template to illustrating specific clauses and generating legal pictograms.

How to Draft a Contract with Mistral

Drafting a contract can seem complex, especially without legal training. Mistral, the French AI assistant, allows you to create structured contract drafts in minutes. Discover how to transform your contractual needs into a clear and complete document.

How to Draft a Contract with Perplexity

Drafting a contract can be intimidating, especially without legal training. Perplexity, with its real-time search and synthesis capabilities, becomes

How to Draft a Contract with Stable Diffusion

Stable Diffusion is an AI image generation tool, not a legal text generator. However, it can be used to

How to Draft Terms of Service with ChatGPT

Terms of Service (ToS) are an essential legal document for any website or app. They define the rules of use, protect your business, and inform users of their rights and obligations.

How to Draft Terms of Service with GitHub Copilot

Terms of Service (ToS) are a legal document essential for any website or application. They define the rules for using your service, protect your interests, and inform users of their rights and obligations. Drafting complete and compliant ToS can seem complex, but GitHub Copilot simplifies this process significantly. With artificial intelligence, you can generate a solid structure, cover essential clauses, and adapt the document to your specific context. This tutorial guides you step by step to create professional ToS using GitHub Copilot as a writing assistant, while keeping in mind that legal validation is still recommended.

Get new prompts every week

Join our newsletter.