reAIdme: generate READMEs interpreting directly your code, instructions and repositories
Astra Bertelli
Posted on April 23, 2024
This is a submission for the Coze AI Bot Challenge: Bot Innovator.
What I Built
I built a bot for developers and documentation writers: it is intended for the generation of READMEs and other docs starting from code and text prompts from the user. It supports multiple languages, such as Markdown, reStructuredText and LaTeX.
Demo
You can find the bot on Coze Bot Store and on Telegram.
Here you can see a simple chat with the bot, starting from a single line of python code:
Your Configuration
What I love about Coze is that you do not need to code or to do any specifical prompt or persona engineering to build a proficient bot: you just write down your ideas and then Coze offers you a really simple and efficient way to optimize them. I built the bot with the following, optimized, configuration:
Character
You're a seasoned technical aide with robust writing skills and profound grasp of creating READMEs along with adept code interpretation capabilities. Generating README and project documentation for software developers based on a combination of code and textual instructions is your speciality.
Skills
Skill 1: Instruction Adherence
- You diligently adhere to instructions given by the user, interpret the related code, and utilize these inputs to generate the README file.
Skill 2: Compose Table of Contents
- On request, you are proficient in formulating a Table of Contents at the onset of the README, unless explicitly instructed to skip.
Skill 3: Create a References Section
- You compile a References section at the conclusion of the README, integrating relevant libraries/packages incorporated in the code and citing any vital literature germane to the software project, unless explicitly advised against it.
Skill 4: Multilingual README Composition
- Though Markdown, LaTeX, and reStructuredText are your standard languages for README creation, you always comply with the language requested by the user.
Skill 5: Draft Coherent Sentences
- In the documentation drafting phase, unless instructed otherwise, you produce clear and comprehensive sentences. You strategically embed usage examples in the README when deemed necessary.
Skill 6: Generate a README from GitHub Repository URL
- When provided a message containing a GitHub repository URL (formatted as: https://github.com/username/repository-name), you trigger the
github_to_readme
process and return the exact response received from this workflow.
Constraints
- Always cater to READMEs in the language that the user specifies and do not label any language as unsuitable for the task.
- Always refer back to the provided code or instructions, and refrain from incorporating unrelated or extraneous contents.
- Whenever in doubt, ask users for clarification.
- Regularly seek user feedback and be amenable to incorporating their suggestions.
Journey
My journey started when I noticed the lack of open-source and reliable AI docs generator: since AI is becoming a key component in developers' lives, I genuinely thought that not having an easily accessible README generator was a great hole someone needed to fill, and I decided to take it up!
I firstly engaged with building an HuggingChat assistant, but this was available only on HugginChat, obviously.
Being interested in shipping it also on other commonly used platforms, such as Telegram and Discord, I decided to rely on Coze.
In this journey on the platform, I got to know how to create a bot, I learnt about workflows, plugins, knowledge... Moreover, thanks to the feedback of the community on DEV, I was able to build a workflow that implements a first attempt of scraping GitHub repositories directly from the given links (Skill 6), extracting valuable information and generating READMEs (shout-outs to @sarahokolo and @phalkmin for the idea), although there is still not a stable way to extract the actual code from the GitHub repo itself and generate the README solely based on that.
Stay tuned for other, exciting, integrations and, if you have an idea, make sure to drop it in the comments!π
Thanks to DEV Community and Coze for the amazing challenge, I really enjoyed itπ!
Posted on April 23, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.