Generate documentation PRs from source PR comments using Claude. Comment @docNerd, doc for core/v7.1 on a PR and docNerd uses Claude to generate or update docs, then opens a PR on the specified branch in your MkDocs + Mike docs repository.
- You comment on a source PR:
@docNerd, doc for core/v7.1 - docNerd validates the branch exists in the docs repo
- docNerd replies "yes, working on it" or "I couldn't find that branch"
- Claude analyzes the PR and generates/edits documentation
- docNerd opens a PR in the docs repo targeting the specified branch
- docNerd replies with "Here is the link to the Doc changes" + PR link
Create .github/workflows/docnerd.yml in your source repository:
name: docNerd
on:
issue_comment:
types: [created]
jobs:
docnerd:
if: github.event.issue.pull_request != null && contains(github.event.comment.body, '@docNerd')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: beamable/docnerd@v1
with:
target-owner: ${{ secrets.DOCNERD_TARGET_OWNER }}
target-name: ${{ secrets.DOCNERD_TARGET_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}
target-repo-token: ${{ secrets.DOCNERD_TARGET_REPO_TOKEN }}
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
bot-token: ${{ secrets.DOCNERD_BOT_TOKEN }} # Optional: comments appear as docNerd account (otherwise github-actions; all say "I am docNerd")Replace beamable/docnerd with your repo path if different.
In your source repo: Settings → Secrets and variables → Actions
| Secret | Required | Description |
|---|---|---|
DOCNERD_TARGET_OWNER |
Yes | Docs repo owner (e.g. your-org) |
DOCNERD_TARGET_NAME |
Yes | Docs repo name (e.g. your-docs-repo) |
GITHUB_TOKEN |
Yes | Auto-provided; pass to action for API access |
DOCNERD_TARGET_REPO_TOKEN |
Yes | PAT with write access to docs repo (GITHUB_TOKEN cannot write to other repos) |
ANTHROPIC_API_KEY |
Yes | Your Anthropic API key for Claude |
DOCNERD_BOT_TOKEN |
No | PAT from a "docNerd" account so comments appear as docNerd (otherwise shows github-actions; all comments include "I am docNerd") |
→ See docs/SECRETS_SETUP.md for detailed instructions on obtaining and configuring each secret.
Add to your source repo root:
config.yaml— Override defaults. Setallow_new_files: falseto only edit existing docs.rules/— YAML files for doc style and generation behavior. Seerules/doc_generation.yamlto control when docNerd creates vs edits.
→ See docs/DOC_GENERATION.md for controlling doc output (invalidation, edits vs new files).
- Open a PR in your source repo
- Comment:
@docNerd, doc for core/v7.1(use your Mike version branch name) - docNerd validates the branch, generates docs, and opens a PR in your docs repo
| Input | Required | Description |
|---|---|---|
target-owner |
Yes | Docs repository owner |
target-name |
Yes | Docs repository name |
github-token |
Yes | Pass secrets.GITHUB_TOKEN |
target-repo-token |
No | Token for docs repo (if different) |
anthropic-api-key |
Yes | Anthropic API key |
Run tests locally:
pip install -e ".[dev]"
pytest tests/ -v- Source repo with PRs
- Target MkDocs + Mike docs repo with version branches
- Anthropic API key