The Complete AI-Powered GitHub Workflow for Solo Developers
Learn to build a practical AI-assisted GitHub workflow for solo devs, from PR automation to code review, with copy-paste commands and configs.
Before you start
You are a solo developer juggling code, issues, and pull requests. You have heard AI can help, but most advice is vague: 'use Copilot' or 'let AI write your commits.' This article gives you a concrete, repeatable workflow that actually fits GitHub, using tools you can install today.
You will set up an AI-powered assistant that drafts pull requests, reviews your code, and helps you triage issues. You will use GitHub Actions, the GitHub CLI, and a local AI model (Ollama) so you do not depend on a cloud API. Everything here is copy-paste ready.
- A GitHub account with admin access to a repository.
- GitHub CLI (gh) installed and authenticated.
- Ollama installed locally (or access to any OpenAI-compatible API).
- A repository to test on. If you do not have one, create a test repo with a few files.
Step 1: Install and configure the AI assistant
First, install Ollama and pull a small model that runs on a laptop. We will use it for code review and commit message generation. If you prefer a cloud model, you can skip Ollama and use any OpenAI-compatible endpoint.
curl -fsSL https://ollama.com/install.sh | sh
ollama pull codellama:7b- Ollama runs locally, so your code never leaves your machine.
- If you have a GPU, try a larger model like codellama:13b for better results.
Step 2: Automate pull request descriptions
A good PR description saves reviewers time. Instead of writing one from scratch, let AI draft it from the diff. Create a GitHub Action that runs on every pull request and posts a suggested description.
name: AI PR Description
on:
pull_request:
types: [opened]
jobs:
suggest-description:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get diff
id: diff
run: |
git diff ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} > /tmp/diff.txt
echo "diff_size=$(wc -c < /tmp/diff.txt)" >> "$GITHUB_OUTPUT"
- name: Generate description
if: steps.diff.outputs.diff_size < 20000
run: |
cat <<'EOF' > /tmp/prompt.txt
You are a senior developer. Write a concise pull request description for this diff. Use bullet points. Focus on what and why.
EOF
cat /tmp/diff.txt >> /tmp/prompt.txt
ollama run codellama:7b "$(cat /tmp/prompt.txt)" > /tmp/description.md
- name: Post comment
if: steps.diff.outputs.diff_size < 20000
run: |
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/description.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}- The action skips large diffs to avoid token limits.
- You need to install Ollama on the runner, or use an API. For simplicity, this example assumes Ollama is available; in practice, you would use a container action or a cloud API.
Step 3: Run AI code review on every push
AI code review catches obvious bugs and style issues before a human looks at it. Create a second action that runs on every push to the PR branch and leaves inline comments.
name: AI Code Review
on:
pull_request:
types: [synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get diff
id: diff
run: |
git diff ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} > /tmp/diff.txt
echo "diff_size=$(wc -c < /tmp/diff.txt)" >> "$GITHUB_OUTPUT"
- name: AI review
if: steps.diff.outputs.diff_size < 20000
run: |
cat <<'EOF' > /tmp/review_prompt.txt
You are a code reviewer. Focus on bugs, security issues, and performance. For each issue, write a short comment. Use this format:
- File: line number - issue
EOF
cat /tmp/diff.txt >> /tmp/review_prompt.txt
ollama run codellama:7b "$(cat /tmp/review_prompt.txt)" > /tmp/review.txt
- name: Post review comment
if: steps.diff.outputs.diff_size < 20000
run: |
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/review.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}- This is a basic version. For inline comments, you need to parse the output and use the GitHub API to create review comments.
- Set a size limit to avoid burning tokens on huge diffs.
Step 4: Generate commit messages with a Git hook
Commit messages are often an afterthought. Use a prepare-commit-msg hook that calls Ollama to suggest a message based on the diff.
#!/bin/bash
# .git/hooks/prepare-commit-msg
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
if [ "$COMMIT_SOURCE" = "message" ]; then
exit 0
fi
# Get the diff
DIFF=$(git diff --cached --stat)
# Generate a message using Ollama
PROMPT="Write a concise git commit message for this change. Use conventional commits format. Diff stat:\n$DIFF"
MESSAGE=$(ollama run codellama:7b "$PROMPT")
echo "$MESSAGE" > "$COMMIT_MSG_FILE"- Make the hook executable: chmod +x .git/hooks/prepare-commit-msg
- This hook runs only when you use git commit without -m. If you provide a message, it keeps yours.
Step 5: Triage issues with AI
Solo developers often get issues with vague titles. Use a GitHub Action to label and prioritize issues automatically when they are opened.
name: AI Issue Triage
on:
issues:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get issue body
id: issue
run: |
echo "body=${{ github.event.issue.body }}" > /tmp/issue.txt
- name: Classify issue
run: |
PROMPT="Classify this issue into one of: bug, feature, question, documentation. Reply with one word.\n\n${{ github.event.issue.body }}"
LABEL=$(ollama run codellama:7b "$PROMPT")
echo "LABEL=$LABEL" >> $GITHUB_ENV
- name: Add label
run: |
gh issue edit ${{ github.event.issue.number }} --add-label "$LABEL"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}- You can extend this to assign priority based on keywords.
- Make sure the label exists in your repository, or create it first.
Verify it worked
After setting up these actions, create a test branch, make a small change, and open a pull request. You should see the AI comment appear within a minute. Check the Actions tab for logs if something fails.
- If the action fails, check the runner logs. Common issues: Ollama not installed on the runner, or the diff size limit exceeded.
- For local testing, run the hooks manually to see the output.
Troubleshooting
Here are common problems and fixes.
- Ollama not found on GitHub Actions runner: Use a container action that includes Ollama, or switch to a cloud API like OpenAI.
- Action times out: Increase the timeout in the workflow file, or reduce the model size.
- Comments not posted: Ensure the GH_TOKEN secret is available and the action has write permissions.
- Hook overwrites your custom message: The hook checks COMMIT_SOURCE and only runs when no message is provided.
- Model output is poor: Try a larger model or adjust the prompt.
Recommended setup
For a solo developer, I recommend starting with the PR description and commit message hooks. They give immediate value with minimal setup. Add code review and issue triage once you are comfortable.
Here is a minimal setup script that installs the hooks and creates the workflow files.
#!/bin/bash
# setup-ai-workflow.sh
mkdir -p .github/workflows
# Create PR description workflow
cat > .github/workflows/pr-description.yml <<'EOF'
name: AI PR Description
on: pull_request
jobs:
suggest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Comment
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "AI suggestion: check the diff and write a description."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EOF
# Create commit hook
cat > .git/hooks/prepare-commit-msg <<'EOF'
#!/bin/bash
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
if [ "$COMMIT_SOURCE" = "message" ]; then
exit 0
fi
DIFF=$(git diff --cached --stat)
MESSAGE=$(ollama run codellama:7b "Write a commit message for: $DIFF")
echo "$MESSAGE" > "$COMMIT_MSG_FILE"
EOF
chmod +x .git/hooks/prepare-commit-msg
echo "Setup complete. Edit the workflow to call Ollama properly."FAQ
Answers to the questions that come up most often on this topic.
- Q: Do I need a powerful GPU? A: No, codellama:7b runs on CPU, though slowly. For faster results, use a cloud API.
- Q: Can I use GitHub Copilot instead? A: Copilot is great for inline suggestions, but this workflow automates repo-level tasks like PR descriptions and issue triage.
- Q: How do I avoid AI hallucinations? A: Always review AI output. Use it as a draft, not a final answer.
- Q: What if I do not want to use Ollama? A: Replace ollama run with a call to any OpenAI-compatible API, like OpenAI or local alternatives.
Next action
Your next step is to create a test repository and run the setup script. Then make a change, commit without a message, and see the hook generate a commit message. Open a PR and watch the AI comment appear.
Key takeaways
- Apply one concrete change from this post before collecting more reading.
- Prefer browser-side tools when the work involves secrets, tokens, or PII.
- Document the why next to the how so the next reviewer inherits context.
FAQ
- Who is this guide on ai for?
- Working developers who need a practical take on the complete ai-powered github workflow for solo developers — not a marketing overview. Skim the sections, apply one tip, then come back when you hit an edge case.
- Do I need an account to use the related tools?
- No. code.live tools run in your browser with no signup. Nothing you paste is uploaded to a server for the client-side utilities linked from this post.
- How often is this article updated?
- This post was published September 13, 2026. Fundamentals stay stable; check linked tool pages and official docs when version-specific behavior matters.