README Read better: Automating Repo Summaries with Amazon Q Developer



This content originally appeared on DEV Community and was authored by Amudha Balamurugan

Learning through practical application is currently my preferred approach for acquiring new technological skills. GitHub hosts a significant number of repositories to explore, spanning from basic to complex projects. Some are accompanied by a straightforward methodology and comprehensive documentation in the README, although this is not universally the case.

I always dedicate additional time to comprehending the procedures employed during the review of their projects. There is a significant need for concise documentation within project repositories to enhance efficiency. Accordingly, I am here to introduce my automatic document generator, which can scan any public GitHub repository and produce a summary of its contents within seconds.

How it Works?

Project Work Flow diagram

Project Structure

q-docgen/
├── scripts/
│   └── generate-summary.js   # Main script using Q CLI
├── generated/
│   └── PROJECT_SUMMARY.md    # Output goes here
├── package.json              # Includes npm scripts
└── README.md                 # Project readme

npm Script

You can generate documentation using a simple command:

npm run docgen -- https://github.com/GitHub-Username/repo-name

How Amazon Q CLI Is Used

We employ the q chat command programmatically via Node.js to input structured repository data and procure a natural language project summary.
An example prompt sent to Amazon Q is provided as follows.
"Based on this repo structure and the latest 5 Git commits, generate a README-style summary."

Role of Amazon Q Developer

Q Developer uses Claude-4-sonnet and other options (including Claude-3.7-sonnet and Claude-3.5-sonnet) to generate context-aware documentation, such as:

  • Repo description
  • Features
  • File architecture
  • Recent changes
  • Usage hints

Sample Output

Sample Output generated from this app

Use Case

  • CI/CD integration with GitHub Actions
  • Automatically generate README files for hackathon projects
  • Sync documentation for internal tools or research repositories
  • Ideal for developers who move quickly and need to document efficiently

What I Learned

  • How to call Amazon Q CLI programmatically
  • Using child_process in Node.js to run terminal commands
  • Handling errors in Git and shell environments (like macOS’s keychain prompt)
  • Creating an npm package from scratch and planning CI integrations

Problems I faced

The Claude-4 sonnet model employed for text summarization was frequently occupied. Transitioning to a lower-tier model is not as straightforward as it is in a command-line interface environment. However, it resulted in another interesting project utilizing Amazon Bedrock, which I will soon share here.

Problems I faced while doing this project

Do It Yourself

  • Install Amazon Q CLI
Docs
  • Clone this repo Q-DocGen
git clone https://github.com/DevABM/q-docgen.git
cd q-docgen
  • Run it
npm install
npm run docgen -- https://github.com/GitHub-Username/repo-name

Conclusion

This project demonstrated the significant capabilities of integrating GitHub, Amazon Q, and Node.js for automation purposes. With minimal coding effort, we transformed tedious manual documentation into an intelligent, repeatable workflow.

Developers should not be compelled to choose between rapid deployment and thorough documentation.

Utilizing Amazon Q eliminates this dilemma.

Thank you for your time. If you find this work interesting, please consider liking and sharing it. Follow me on LinkedIn, GitHub, Medium, or Dev


This content originally appeared on DEV Community and was authored by Amudha Balamurugan