Skip to content
DocsBeginnerVersion 1.0Works with any capable model

Module Documentation for New Joiners

Write onboarding documentation for a code module that explains what it is for, how it fits together and where to start, using only what the code shows.

When to use it

Use it when a module has no documentation and new team members keep asking the same questions. Give it the code and a few facts, and it drafts a guide with the purpose, the main flow, key concepts, how to run and change it safely, and a list of things only a person who knows the system can confirm.

When not to use it: Do not publish its output without a human who knows the module reading it. The assistant explains what the code does, not why it was built that way, and it can describe intent that does not exist. Do not paste proprietary code unless your organisation permits it.

Required inputs

PlaceholderWhat to provideExample
{{module_code}}The module's source files or the key parts of them, plus a file listing. Remove secrets first.The src/pricing directory: a listing and the three main files.
{{audience}}Who will read the guide and what they already know.Developers in their first month who know TypeScript but not our domain.
{{known_context}}Facts you know that the code does not show: why it exists, who owns it, related systems, known quirks. Use 'none' if empty.Owned by the checkout team. The report job also imports it. The tax rules were copied from the old system.
{{doc_format}}Where the document will live and any template or length limit.A README.md in the module directory, about two pages.

The prompt

Fill in each {{placeholder}} before you send it.

You are a technical writer who is also an engineer. Write a guide that helps a new team member understand and safely work in the module below.

<module_code>
{{module_code}}
</module_code>

<audience>
{{audience}}
</audience>

<known_context>
{{known_context}}
</known_context>

<doc_format>
{{doc_format}}
</doc_format>

Write these sections:
1. Purpose: what the module is responsible for, and what it is not responsible for, in plain language.
2. Where to start: the entry points, in the order a reader should open them.
3. How it works: the main flow from input to output, in a short numbered list, naming the functions or files involved.
4. Key concepts: domain terms and design ideas needed to read the code, each with a one-sentence definition.
5. Dependencies and data: what it calls, what calls it if visible, and what it reads or writes.
6. Making a change safely: how to run it, how to test it and the things that are easy to break, but only where the code or the context supports the statement.
7. Questions for the module owner: everything you could not determine from the material.

Rules:
- Describe only what the code and context show. Do not invent history, design reasons, setup commands, test commands or behaviour. If a section would need a fact you do not have, write "Not determined from the code" and add a question for the owner.
- Separate what the code does from why it might do it. Offer reasons only as labelled guesses ("Probably, because...") and keep them few.
- Use names exactly as they appear in the code.
- Prefer short paragraphs and lists. Do not copy large blocks of code into the document; refer to files and function names.
- Do not praise the code or comment on its quality, unless something would mislead a reader, in which case flag it plainly.

Output format: the document itself in Markdown using the headings above, followed by a separate section titled "Review notes for the author" listing the statements you are least sure of.

Expected output

A readable Markdown guide with the seven sections, using real file and function names, a numbered flow that matches the code, and honest gaps marked 'Not determined from the code' with matching questions for the owner. A separate review notes section lists the statements most in need of checking. Speculation about intent is labelled as such.

Sample response (excerpt)Illustrative — your output will differ
# Pricing module

## Purpose
Calculates the total for a basket: line prices, discounts and tax. It does not take payments or store orders.

## Where to start
1. src/pricing/index.ts exports the public functions.
2. src/pricing/calculate.ts holds calculateBasketTotal, the main entry point.

## How it works
1. calculateBasketTotal receives the basket lines.
2. It applies the discount rules in applyDiscounts.
3. It adds tax using the rates in taxRates.ts.

## Making a change safely
How to run the tests: Not determined from the code.

## Questions for the module owner
- Which command runs this module's tests?

## Review notes for the author
- "Rates are copied from the old system" came from your context, not the code; check the wording.

Limitations

  • The assistant explains what the code appears to do. Subtle behaviour, edge cases and historical reasons need a person who knows the module.
  • Long modules will be summarised unevenly. Provide the parts that matter, or document one area at a time.
  • It cannot know how to run or deploy the module unless that is in the material you provide.
  • Documentation goes stale. A generated guide has no owner until you give it one and set a review date.

How to validate the output

Do these before relying on anything the model returns.

Written by
PromptFable Editorial
Last updated 13 Nov 2026
Review
Not yet reviewed

PromptFable is independent and is not affiliated with, endorsed by or sponsored by Anthropic, Google, OpenAI or any other vendor. Claude, Gemini, Google AI Studio and other product names are trademarks of their respective owners.