Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions docs/pure_pursuit/pr-29-changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Automated Documentation Agent

## Overview

This update introduces an **automated documentation system** that generates documentation updates whenever changes are made to the pure pursuit controller. The system uses Claude AI to analyze code changes and automatically creates pull requests in the documentation repository.

## How It Works

When a pull request is opened or updated in the `ft_pure_pursuit` repository, a GitHub Actions workflow automatically:

1. **Fetches the PR diff** - Retrieves all changed files and their modifications
2. **Sends changes to Claude AI** - The diff is analyzed by Claude (claude-opus-4-5 model) to generate relevant documentation
3. **Creates a documentation PR** - A new pull request is automatically opened in the `ft_docs_2.0` repository with the suggested documentation updates

## Components

### GitHub Actions Workflow (`.github/workflows/doc-agent.yml`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix GitHub capitalization.

The official name uses a capital "H": "GitHub" not "Github". As per coding guidelines, the static analysis tool flagged this inconsistency.

✏️ Proposed fix
-### GitHub Actions Workflow (`.github/workflows/doc-agent.yml`)
+### GitHub Actions Workflow (`.github/workflows/doc-agent.yml`)

Note: The path .github is correct (lowercase), but the text "GitHub Actions" should have capital H.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~17-~17: The official name of this software platform is spelled with a capital “H”.
Context: ...omponents ### GitHub Actions Workflow (.github/workflows/doc-agent.yml) | Trigger | ...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/pure_pursuit/pr-29-changes.md` at line 17, Update the header text
"Github Actions Workflow (`.github/workflows/doc-agent.yml`)" to use the correct
official capitalization "GitHub Actions" (keep the path
`.github/workflows/doc-agent.yml` as-is); search for the header string "GitHub
Actions Workflow (`.github/workflows/doc-agent.yml`)" or any occurrences of
"Github Actions" in pr-29-changes.md and replace "Github" with "GitHub" so the
documentation uses the proper trademark capitalization.


| Trigger | Description |
|---------|-------------|
| `pull_request: opened` | Runs when a new PR is created |
| `pull_request: synchronize` | Runs when new commits are pushed to an existing PR |

### Doc Agent Script (`.github/scripts/doc_agent.py`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix GitHub capitalization.

Same issue as line 17: "GitHub" should have a capital "H". As per coding guidelines, the static analysis tool flagged this.

✏️ Proposed fix
-### Doc Agent Script (`.github/scripts/doc_agent.py`)
+### Doc Agent Script (`.github/scripts/doc_agent.py`)
🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: The official name of this software platform is spelled with a capital “H”.
Context: ...an existing PR | ### Doc Agent Script (.github/scripts/doc_agent.py) The Python scri...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/pure_pursuit/pr-29-changes.md` at line 24, The header text "### Doc
Agent Script (`.github/scripts/doc_agent.py`)" (and the similar occurrence at
line 17) uses incorrect capitalization for "GitHub"; update any instances of
"Github" or "Github" within that header and surrounding documentation to
"GitHub" to match project style and static analysis expectations, e.g., edit the
header string "Doc Agent Script (`.github/scripts/doc_agent.py`)" to ensure the
repository name is written as "GitHub".


The Python script that orchestrates the documentation generation process.

#### Required Environment Variables

| Variable | Description |
|----------|-------------|
| `ANTHROPIC_API_KEY` | API key for Claude AI authentication |
| `GH_PAT` | GitHub Personal Access Token with repo permissions |
| `PR_NUMBER` | The pull request number (set automatically) |
| `REPO_NAME` | The source repository name (set automatically) |

#### Key Behaviours

- **Branch Management**: Creates a new branch `auto-docs/pr-{PR_NUMBER}` in the docs repository. If the branch already exists, it is deleted and recreated to ensure a clean state.
- **File Creation**: Documentation is saved to `docs/pure_pursuit/pr-{PR_NUMBER}-changes.md`
- **Idempotent Updates**: If the documentation file already exists, it will be updated rather than failing

## For New Team Members

### What This Means for You

- **No manual documentation required** for pure pursuit changes - the system handles initial drafts automatically
- **Always review generated docs** - AI-generated content should be verified for accuracy before merging
- **Documentation PRs link back** to the original code PR for context

### Reviewing Auto-Generated Documentation

1. Navigate to the `ft_docs_2.0` repository
2. Find the PR titled `[Auto Docs] Update for ft_pure_pursuit PR #XXX`
3. Review the suggested changes for technical accuracy
4. Edit if necessary, then merge

## Dependencies

- `anthropic` - Python client for Claude AI
- `PyGithub` - Python client for GitHub API