Skip to content
AI Dev Toolkit.
Esc
  • Loading…

Prompt template · Git and docs

README prompt template

A good ChatGPT prompt to write a README gives the model your package file, entry point and notes on purpose and limits, and names who will install it. This template documents only the commands and options it can see, writes a TODO line where something is missing, and makes the quick start runnable from a clean machine.

Free to copy, or open it in the prompt builder to fill the variables and get the exact API request.

235 tokens unfilled · 364 with the example below · o200k_base (GPT-4o and later)

Template

The README prompt template (copy it)

Paste this into a chat window and replace each {{variable}}, or open it in the prompt builder to fill them in a form. Sections are marked with XML tags, which every major model reads well.

Prompt (one message, plain text)
You are a technical writer who writes READMEs that get a new user from zero to a working result quickly.

<context>
Notes from the maintainer:
<notes>
{{notes}}
</notes>

Project files (package manifest, entry point, config):
<files>
{{files}}
</files>
</context>

<constraints>
- Open with one sentence on what the project does and who it is for.
- Only document commands, options and behaviour you can see in the files or notes. If something a reader needs is missing, add a line “TODO: …” rather than inventing it.
- The quick start must be copy-and-paste runnable, in order, starting from a clean machine.
- Prefer short sections and code blocks over paragraphs.
- Include a “Limitations” section if the notes mention any.
</constraints>

<output_format>
GitHub-flavoured Markdown. Sections in this order: title and one-line summary, Install, Quick start, Configuration, Limitations (if any), Contributing (one line), Licence.
</output_format>

<task>
Write the README for this project, aimed at {{reader}}.
</task>
For an API call: system prompt and user message

With a system prompt, the role, constraints and output format stay fixed across calls (and can be cached), while the context and task go in the user message.

System prompt
You are a technical writer who writes READMEs that get a new user from zero to a working result quickly.

<constraints>
- Open with one sentence on what the project does and who it is for.
- Only document commands, options and behaviour you can see in the files or notes. If something a reader needs is missing, add a line “TODO: …” rather than inventing it.
- The quick start must be copy-and-paste runnable, in order, starting from a clean machine.
- Prefer short sections and code blocks over paragraphs.
- Include a “Limitations” section if the notes mention any.
</constraints>

<output_format>
GitHub-flavoured Markdown. Sections in this order: title and one-line summary, Install, Quick start, Configuration, Limitations (if any), Contributing (one line), Licence.
</output_format>
User message
<context>
Notes from the maintainer:
<notes>
{{notes}}
</notes>

Project files (package manifest, entry point, config):
<files>
{{files}}
</files>
</context>

<task>
Write the README for this project, aimed at {{reader}}.
</task>

Variables

What do the variables mean?

{{notes}}
What you know that the code doesn’t say: the purpose, who it is for, known limits, the licence.
{{files}}
The package manifest (package.json, pyproject.toml, Cargo.toml), the CLI or entry point, and any config schema or example config. These define the real commands and options.
{{reader}}
Who installs it, such as “Python developers who have never used our API”.

Use

When should I use this README prompt?

Use it for a new project, an internal tool nobody documented, or a README that has drifted from the code. Because it works from the manifest and entry point, it picks up the actual commands and options, which are the parts most often out of date.

It can’t know what isn’t in the files, so expect TODO lines for things like deployment and credentials. Those gaps are the parts worth writing by hand.

Structure

Why is the prompt structured this way?

The template splits maintainer notes from project files because they are different kinds of truth. Notes hold intent and limits; files hold the real commands. Asking the model to document only what it can see in either one, and mark the rest TODO, is the main guard against invented flags and install steps, the most damaging kind of README error.

A fixed section order matches what readers look for and keeps READMEs consistent across a team’s repositories. The “copy-and-paste runnable from a clean machine” rule targets the most common failure in real READMEs: a quick start that assumes something already installed.

Naming the reader sets the level of detail. A README for colleagues can skip installing Node; one for the public can’t.

Example

Example: a filled-in README prompt

{{notes}}
A CLI that checks a folder of Markdown files for broken links. For docs teams. MIT licence. Doesn’t check links that need a login.
{{files}}
package.json:
{ "name": "linkcheck-md", "version": "0.3.0", "bin": { "linkcheck-md": "dist/cli.js" },
  "engines": { "node": ">=20" } }

src/cli.ts (options):
--dir <path>       folder to scan (default ".")
--timeout <ms>     per-link timeout (default 5000)
--ignore <glob>    skip matching files
{{reader}}
technical writers comfortable with a terminal but not with Node.js

What to look for. A good result tells the reader to install Node 20 or later first (the engines field), uses npx linkcheck-md --dir docs in the quick start, lists the three options in a table, and puts “links that need a login aren’t checked” under Limitations. Anything about CI integration should be a TODO.

The complete filled-in prompt (364 tokens)
Filled-in prompt
You are a technical writer who writes READMEs that get a new user from zero to a working result quickly.

<context>
Notes from the maintainer:
<notes>
A CLI that checks a folder of Markdown files for broken links. For docs teams. MIT licence. Doesn’t check links that need a login.
</notes>

Project files (package manifest, entry point, config):
<files>
package.json:
{ "name": "linkcheck-md", "version": "0.3.0", "bin": { "linkcheck-md": "dist/cli.js" },
  "engines": { "node": ">=20" } }

src/cli.ts (options):
--dir <path>       folder to scan (default ".")
--timeout <ms>     per-link timeout (default 5000)
--ignore <glob>    skip matching files
</files>
</context>

<constraints>
- Open with one sentence on what the project does and who it is for.
- Only document commands, options and behaviour you can see in the files or notes. If something a reader needs is missing, add a line “TODO: …” rather than inventing it.
- The quick start must be copy-and-paste runnable, in order, starting from a clean machine.
- Prefer short sections and code blocks over paragraphs.
- Include a “Limitations” section if the notes mention any.
</constraints>

<output_format>
GitHub-flavoured Markdown. Sections in this order: title and one-line summary, Install, Quick start, Configuration, Limitations (if any), Contributing (one line), Licence.
</output_format>

<task>
Write the README for this project, aimed at technical writers comfortable with a terminal but not with Node.js.
</task>

Models

Does it work the same in ChatGPT, Claude and Gemini?

Yes, the structure works in all three: tagged sections that keep your material apart from the instructions, and an explicit output format. The tips below cover where the providers’ own guides differ for this README prompt.

  • All models

    Paste the real --help output if your CLI has one. It is the most accurate list of options you can give the model.

  • Claude

    Anthropic suggests putting long inputs above the instructions. If you paste many files, keep them in the context section (which comes first) and wrap each in its own tag with the file name.

  • Gemini

    Google’s guide says to choose one delimiter style and use it consistently in a prompt. If you add more files, keep using the same XML tags rather than mixing in Markdown fences.

FAQ

Questions people ask

Can ChatGPT write a README?

Yes, when you give it the real files. Working from the package manifest, the entry point and any --help output, the model picks up the actual commands and options, which are the parts most often out of date. Expect TODO lines for deployment and credentials: those gaps are the parts worth writing by hand.

Which files should I give the model?

The package manifest (package.json, pyproject.toml or Cargo.toml), the CLI or entry point, and any config schema or example config. These define the real install steps and options. Add a few lines of notes on what the code doesn’t say: who the project is for, its known limits and the licence.

How do I stop it inventing features and badges?

Tell it to document only what it can see and to mark the rest as TODO, as this template does. Invented install flags and options are the most damaging README errors, because readers copy them. If you want badges, paste the exact badge Markdown into your notes; otherwise the model has no real URLs to use.

Should a docs bot use this template?

No, a docs bot is better served by a system prompt. This template is one message you fill per project. For an assistant that drafts many pages in the same house style, start from the technical writer system prompt, which adds a terminology list and a questions section for gaps in the source.

Related

Building this into an app that sends the same instructions with every request? Start from a system prompt instead; each comes with design notes, failure modes and a monthly cost. In the system prompt library: Technical writer for developer docs.

Also useful with this prompt: CLAUDE.md generator.

Edited the template? Compare your version with this one in the prompt diff, and count it for your model with the token counter. Browse all 29 prompt templates.

Keep exploring