Maintaining high-quality, consistent, and well-written GitHub documentation is essential for any software project. However, manually reviewing, editing, and improving grammar, tone, and style can be both time-consuming and tedious.
What if you could automate this process using an AI agent?
AgenticFirst provides a powerful solution that enables you to create and deploy AI agents at scale—making it easy to streamline and improve your GitHub documentation automatically.
Let’s explore a practical example: improving GitHub documentation hosted on Docusaurus using AgenticFirst. The goal is to enhance grammar, tone, and overall readability with minimal manual effort.
1. To begin with, create your free account on AgenticFirst.
In this case here is the agent instruction we used;
You are an AI agent for improving Docusaurus based documentation from a Github repo.
Github access key: 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
You will be provided a GitHub URL path of a `.md` file (Markdown) from a Docusaurus project.
Your responsibilities:
1. **Create a new branch** from the `master` branch.
- Add a timestamp to the branch name to make it unique.
- Use the GitHub REST API to first fetch the SHA of `refs/heads/master`, then use that SHA to create the new branch.
- Use `https://api.github.com/repos/{owner}/{repo}/git/ref/heads/master` to get the SHA.
2. **Fetch the content of the .md file** using the GitHub REST API.
- Use the `/contents/{path}` endpoint to retrieve the file's base64 content and its SHA.
3. **Improve the documentation**:
- Follow the instruction provided by the user, if there are no specific instruction provided then treat the task as improve documentation.
- Call openai with instructions: "You are a documentation writer. Improve the following Docusaurus documentation—enhancing writing style, spelling, grammar, clarity, tone, consistency, and overall readability—while following standard documentation guidelines. [CONTENT]"
- Replace `[CONTENT]` with the decoded file content.
- Do full write, do not skip content
4. **Commit the improved file** to the new branch using the GitHub REST API:
- Use the PUT method on the same `/contents/{path}` endpoint.
- Include:
- `message`: a commit message
- `content`: the improved content as base64
- `branch`: the newly created branch
- `sha`: the original file’s SHA
5. **Create a Pull Request (PR)**:
- Use the `/pulls` endpoint to create a PR from the new branch to `master`.
6. **Add human-readable `console.log` statements** after each major step (branch creation, file fetching, content update, PR creation) to show progress clearly.
7. **Use only `node-fetch` for HTTP requests. Do not use Octokit or any other libraries.**
8. **Use `Buffer.from(...).toString('base64')` instead of `atob`.**
9. **Return the final PR URL at the end.**
4. And that's all it takes to create your agent for Github that can automatically improve your PR.
5. You can review the PR generated by the agent and apply the changes.
The process starts by configuring an AI agent with a few specific inputs:
Here’s what the instructions looked like for this example:
With these instructions in place, the user simply triggers the agent via an intuitive interface—and the rest is fully automated.
Once activated, the agent follows the outlined steps precisely. The result? A Pull Request automatically generated in the target GitHub repository.
Upon reviewing the PR, users can see that the AI agent has:
After a human review and approval, the polished documentation can be merged and published—demonstrating how an AI agent can handle the first draft of documentation edits entirely on its own.
While improving GitHub documentation is a powerful and immediate use case, the capabilities of AgenticFirst go far beyond that.
Users can connect knowledge sources, define workflows, and even write their own custom code. This makes it possible to integrate with tools like:
With advanced customization, users can either write instructions from scratch or modify system-generated code to fine-tune the agent’s behavior to fit their unique needs.
AgenticFirst AI Agents present a compelling opportunity to:
By leveraging the power of AI, your GitHub documentation can remain accurate, professional, and up-to-date—without the grind.
Explore what’s possible at https://agenticfirst.ai