Write a README From Your Code and Notes Without Invented Commands

You get a complete README with requirements, install, usage and config sections built only from your pasted code, plus a list of gaps to fill.

Prompt

Prompt
You are a senior developer who writes clear, accurate READMEs for open-source and internal projects.

Your job: write a README for my project. First, ask me these questions in one numbered message, and ask me to paste my code, config files and notes with my answers. Then wait.
1. Who will read this README (end users, contributors or teammates), and how experienced are they?
2. Which OS, language version and package manager does the project target?
3. Is there anything the README must not claim, such as stability, license or support?

Rules:
- Every install, run and config command must come from my pasted material. If a needed command is missing, write "GAP:" and state what is missing. Do not guess.
- Each config option gets its name, default value and a one-line purpose, all taken from the code.
- Show expected output in Usage only if it appears in my material. Otherwise mark it as a gap.
- Use short sentences. No marketing language, and no badges or links you cannot verify.

Output format:
1. Project name and one-sentence description
2. Requirements
3. Installation (numbered steps with code blocks)
4. Usage (examples with code blocks)
5. Configuration (table: Option | Default | Description | Source file)
6. Gaps to fill (bulleted list)

End with one line listing any assumptions you made about the audience or environment.

Example output

At a glanceREADME sections built for logtrimEvery section comes from the pasted code and notes, with gaps flagged
  1. RequirementsPython 3.11, pip, Linux
  2. InstallationClone, pip install -r requirements.txt, pip install -e .
  3. Usagelogtrim app.log --days 7 and folder mode with --compress
  4. Configuration4 options from cli.py and config.py
  5. Gaps to fill5 gaps: repo URL, untimestamped lines, tests, license, .env

Example for: a Python CLI called logtrim that shortens server log files. Audience: teammates on Linux using Python 3.11 and pip.

logtrim

A command-line tool that removes log lines older than a set number of days and compresses the rest.

Requirements

  • Python 3.11 (from pyproject.toml: requires-python = ">=3.11")
  • pip
  • Linux (from your notes. Untested on macOS or Windows)

Installation

  1. Clone the repository.
    GAP: repository URL not provided.
  2. Install dependencies:

    pip install -r requirements.txt
  3. Install the CLI locally:

    pip install -e .

Usage

Trim a single file, keeping the last 7 days:

logtrim app.log --days 7

Trim every .log file in a folder and gzip the output:

logtrim /var/log/myapp --days 14 --compress

Expected output (from your notes):

Processed 3 files, removed 48,210 lines, saved 112 MB

Configuration

OptionDefaultDescriptionSource file
--days30Keep lines newer than this many dayscli.py
--compressFalseGzip trimmed filescli.py
LOGTRIM_DATE_FORMAT%Y-%m-%d %H:%M:%STimestamp format used to parse each lineconfig.py
LOGTRIM_DRY_RUN0Set to 1 to report changes without writing filesconfig.py

Environment variables can also be set in a .env file in the project root, which config.py loads with python-dotenv.

Gaps to fill

  • GAP: repository URL for the clone step.
  • GAP: how logtrim handles lines with no timestamp. parse_line() returns None, but the notes do not say whether those lines are kept or removed.
  • GAP: no test command found. Add one if a test suite exists.
  • GAP: license not stated. You asked me not to claim one.
  • GAP: no example .env file was pasted.

Assumptions: readers are comfortable with a terminal and pip, and the tool runs on a standard Linux server.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Asking about audience and environment first sets the right detail level for install steps.
  • Limiting commands to pasted material and marking GAPs stops the model from inventing install or run steps.
  • The config table with a source file column lets you check every option against the code.

Use this in ChatGPT, Claude or Gemini when a project has no README or an outdated one. Have your main script, dependency file, config or .env example and any rough notes ready to paste.

Common edits

  • Add a Contributing section with branch, test and pull request steps for open-source projects.
  • Ask for a shorter quick-start version to put at the top of the README.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Coding
Coding

Architecture Decision Record for a Technology Choice

Compares realistic options against your constraints and produces a decision record. The record has a weighted comparison, risks, a reversal plan, and a recommendation the team can approve or challenge.