Technical Documents with Generative AI 🤖
Why use AI for technical documentation? 🤔
Writing technical documentation is a bit like going to the dentist: everyone knows it’s important, but no one wants to do it. Generative AI, though, can transform this experience into something (almost) pleasant! Thanks to language models, today we can generate clear, coherent and even personalized documents, starting from simple prompts and templates.
- You save time (and headaches)
- Reduce errors and oversights
- Standardize style
- Facilitate collaboration
⚠️ Important note: Always remember to double-check documents generated by the AI: even the most advanced models can make mistakes, omissions or misunderstandings. The same prompt can produce different results: always verify correctness, consistency and adherence to your team’s standards before using or sharing documentation.
The advantages of Markdown templates 📋
Markdown is the lingua franca of technical documentation: simple, readable and perfect for being processed by both humans and machines (and developers who don’t like frills). Using Markdown templates with AI means:
- Structure information clearly
- Reduce the “fantasy novel” syndrome
- Encourage reusability and consistency across documents
- Be easily interpreted by major SaaS documentation management platforms
- Enable versioning via control systems like Git
How AI-assisted generation works 🪄
- Define the key points: what do you want to communicate? What are the essential pieces of information?
- Choose (or create) a template: preferably one already tested by the team.
- Prompt the AI: provide the key points and ask it to populate the template.
- Review and customize: the AI is good, but you’re better! Add details, correct inaccuracies and adapt the tone.
Pro tip: the more details you provide in the prompt, the more accurate and useful the documentation will be. The AI doesn’t read minds (yet).
Practical example: RFC generated with AI 🚀
Here is an example of a prompt and the result you can get with a Markdown template for RFC (Request for Comments):
|
|
By combining it with key points like in the example that follows:
|
|
By using the prompt with template and key points in ChatGPT you can get a document like the following:
|
|
From RFC template to ADR: automate architectural decisions 🏗️
You’ve produced a detailed RFC with AI, but now you need a clear, summarized architectural decision? No problem: you can ask the AI to transform the RFC into an ADR (Architectural Decision Record) using a dedicated template. This way you get a concise trace, easily consultable and ready to share with the team (or forgotten in a folder, as per tradition).
The process is simple: provide the RFC to the AI, ask it to extract the key points and adapt them to ADR format. This way, the history of architectural decisions stays documented and accessible, without having to rewrite everything from scratch.
The AI can generate the ADR starting from the RFC, extracting key points and adapting the format. Indicate the original RFC between
<rfc></rfc>tags and add a summary of the decision to the key points, as in the example below:
|
|
Specify the original RFC document by wrapping it between <rfc></rfc> tags, then add the key points of the architectural decision you want to summarize. Here’s a practical example:
|
|
The final result you can get is like the following:
|
|
Other types of technical documents that can be generated with AI 📝
The approach described is not limited to RFC and ADR: you can leverage AI and Markdown templates to produce a wide range of technical documentation, including:
- Operational guides (runbooks, how-to, troubleshooting)
- Architecture documents (diagrams, overview, decision log)
- API specifications (OpenAPI/Swagger, usage examples, parameter tables)
- Security checklists and compliance
- User manuals and technical FAQs
- Onboarding documentation for new team members
- Changelog and release notes
- Test plans and use cases
Just define a clear template, provide the key points and let the AI do the heavy lifting (but remember to always review the result!).