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 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.

How to Write a Blog Post with Claude

Writing a quality blog post takes time, research, and a good structure. With Claude, Anthropic's AI assistant, you can speed up

How to Write a Blog Post with Midjourney

Midjourney is an AI-powered image generation tool that can radically transform the visual quality of your blog posts. Rather than searching for generic stock photos, you can create unique illustrations perfectly tailored to your content. In this tutorial, we'll explore how to use Midjourney to produce impactful visuals for each section of your article: cover image, concept illustrations, stylized infographics, and brand graphic elements. Whether you're a blogger, web writer, or content creator, mastering Midjourney will enable you to publish professionally-looking articles without a graphic designer, while maintaining a consistent visual identity across your entire blog.

How to Write a Business Proposal with Midjourney

Midjourney is an AI image generation tool that can transform your business proposals into visually striking documents.

How to Write a Business Proposal with Mistral

Writing a compelling business proposal is a strategic exercise that requires both rigor and creativity. Thanks to Mistral, the leading French AI, you can significantly accelerate this process while maintaining a high level of quality. Mistral helps you structure your pitch, customize your offer according to the prospect, and produce a professional document ready to send. In this tutorial, you will learn how to leverage Mistral step by step to create impactful business proposals that maximize your conversion chances. Whether you are a freelancer, a salesperson, or a SME manager, this method will save you valuable time while improving the quality of your business documents.

How to Write a Business Proposal with Sora

Writing a compelling business proposal is a strategic exercise that can make the difference between winning a contract or losing an opportunity. With Sora, OpenAI's video generation tool, you can now enrich your business proposals with immersive visual content that captures your prospects' attention. Imagine presenting your solution with a realistic demo video, illustrating use cases, or creating a convincing scenario — all generated by AI. In this tutorial, we guide you step by step to integrate Sora into your proposal writing process, so you can produce proposals that stand out visually and strengthen your sales pitch.

Get new prompts every week

Join our newsletter.