From 4fa0543e8eb71c34a6cca50fac049fdac40c496b Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 13:18:17 -0800 Subject: [PATCH 01/14] Fix path for review agent script in workflow --- .github/workflows/ai_review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ai_review.yml b/.github/workflows/ai_review.yml index ad06827..8399605 100644 --- a/.github/workflows/ai_review.yml +++ b/.github/workflows/ai_review.yml @@ -49,4 +49,4 @@ jobs: run: | # Use the input PR number if triggered manually, otherwise use the event context PR_NUM=${{ github.event.inputs.pr_number || github.event.pull_request.number }} - python scripts/ai_reviewer/review_agent.py $PR_NUM + python scripts/ai_reviewer/review-agent.py $PR_NUM From 26688b41200bf5e914612c3054e346a2e95b64db Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 13:25:56 -0800 Subject: [PATCH 02/14] Upgrade AI model from Gemini 1.5 to 3 --- scripts/ai_reviewer/review-agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index 4b0de3e..8b2cadd 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -68,7 +68,7 @@ def get_line_specific_review(): """ print("🤖 Sending request to Gemini...") - model = genai.GenerativeModel('gemini-1.5-pro') + model = genai.GenerativeModel('gemini-3-pro') response = model.generate_content(prompt) print("✨ Received response from Gemini.") return response.text, latest_commit From b296a1005cb509ddc534ed50c0abf5566f3a92cd Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:13:18 -0800 Subject: [PATCH 03/14] Change model from gemini-3-pro to gemini-2.5-flash --- scripts/ai_reviewer/review-agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index 8b2cadd..730347f 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -68,7 +68,7 @@ def get_line_specific_review(): """ print("🤖 Sending request to Gemini...") - model = genai.GenerativeModel('gemini-3-pro') + model = genai.GenerativeModel('gemini-2.5-flash') response = model.generate_content(prompt) print("✨ Received response from Gemini.") return response.text, latest_commit From b622d4079087375d4fd4ababd6242e8897d5049d Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:20:35 -0800 Subject: [PATCH 04/14] Update GitHub repo path and standards file logic --- scripts/ai_reviewer/review-agent.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index 730347f..6fbb822 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -22,8 +22,7 @@ try: genai.configure(api_key=GEMINI_API_KEY) gh = Github(GITHUB_TOKEN) - # Update this string to your actual repo path (e.g., "flutter/flutter-intellij") - repo = gh.get_repo("flutter/flutter-intellij") + # Update this string to your actual repo path repo = gh.get_repo("cj-radcliff/SimpleFlutterFlashcards") pr = repo.get_pull(PR_NUMBER) print(f"✅ Connected to Repo: {repo.full_name}") except Exception as e: @@ -36,7 +35,7 @@ def get_line_specific_review(): comparison = repo.compare(pr.base.sha, pr.head.sha) is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) - standards_path = "docs/ai-flutter-standards.md" if is_flutter else "docs/ai-standards.md" + standards_path = "docs/ai-standards.md" print(f"📖 Loading standards from: {standards_path}") with open(standards_path, "r") as f: From 024462dae086ca4bd706279d7fe2c6186c91fe07 Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:21:20 -0800 Subject: [PATCH 05/14] Update AI PR Reviewer workflow permissions Added permissions for issues and pull requests. --- .github/workflows/ai_review.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ai_review.yml b/.github/workflows/ai_review.yml index 68b3903..3908c1d 100644 --- a/.github/workflows/ai_review.yml +++ b/.github/workflows/ai_review.yml @@ -1,5 +1,8 @@ name: AI PR Reviewer - +permissions: + issues: write + pull-requests: write + contents: read on: pull_request: # Restricts the agent to specific testing branches or main From ea620a7e25d3f8cbd415aee28ad29a9c0001de5d Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:29:09 -0800 Subject: [PATCH 06/14] Refactor AI Review Agent for GitHub and Gemini integration --- scripts/ai_reviewer/review-agent.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index 6fbb822..fe487bc 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -1,8 +1,8 @@ import os import json import sys -from github import Github -import google.generativeai as genai +from github import Auth, Github +from google import genai # --- 1. Initialization & Environment Check --- print("🚀 Starting AI Review Agent...") @@ -20,9 +20,9 @@ # --- 2. GitHub & AI Setup --- try: - genai.configure(api_key=GEMINI_API_KEY) - gh = Github(GITHUB_TOKEN) - # Update this string to your actual repo path repo = gh.get_repo("cj-radcliff/SimpleFlutterFlashcards") + client = genai.Client(api_key=GEMINI_API_KEY) + gh = Github(auth=Auth.Token(GITHUB_TOKEN)) + repo = gh.get_repo("cj-radcliff/SimpleFlutterFlashcards") pr = repo.get_pull(PR_NUMBER) print(f"✅ Connected to Repo: {repo.full_name}") except Exception as e: @@ -34,8 +34,8 @@ def get_line_specific_review(): print("🔍 Analyzing files to select standards...") comparison = repo.compare(pr.base.sha, pr.head.sha) - is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) - standards_path = "docs/ai-standards.md" +is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) + standards_path = "docs/ai-flutter-standards.md" if is_flutter else "docs/ai-standards.md" print(f"📖 Loading standards from: {standards_path}") with open(standards_path, "r") as f: @@ -67,8 +67,10 @@ def get_line_specific_review(): """ print("🤖 Sending request to Gemini...") - model = genai.GenerativeModel('gemini-2.5-flash') - response = model.generate_content(prompt) + response = client.models.generate_content( + model='gemini-2.5-flash', + contents=prompt, + ) print("✨ Received response from Gemini.") return response.text, latest_commit @@ -101,7 +103,7 @@ def apply_feedback(raw_response, commit): if "READY_FOR_HUMAN_REVIEW" in raw_response: print("👤 Triggering handoff: Reassigning to human...") # REPLACE WITH YOUR ACTUAL GITHUB USERNAME - MY_USERNAME = "your-github-username" + MY_USERNAME = "cj-radcliff" pr.add_to_assignees(MY_USERNAME) pr.create_issue_comment(f"✅ AI Review complete. Reassigning to @{MY_USERNAME} for final review.") From c232747276a130e2fd3f99f1cd4e53e849a5c348 Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:31:40 -0800 Subject: [PATCH 07/14] Fix standards path assignment for non-Flutter projects --- scripts/ai_reviewer/review-agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index fe487bc..e743d47 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -35,7 +35,7 @@ def get_line_specific_review(): comparison = repo.compare(pr.base.sha, pr.head.sha) is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) - standards_path = "docs/ai-flutter-standards.md" if is_flutter else "docs/ai-standards.md" + standards_path = "docs/ai-standards.md" print(f"📖 Loading standards from: {standards_path}") with open(standards_path, "r") as f: From 3e89b7f061863582df453446c27432fab02b17eb Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:34:29 -0800 Subject: [PATCH 08/14] Fix indentation for is_flutter assignment --- scripts/ai_reviewer/review-agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index e743d47..449ed6b 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -34,7 +34,7 @@ def get_line_specific_review(): print("🔍 Analyzing files to select standards...") comparison = repo.compare(pr.base.sha, pr.head.sha) -is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) + is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) standards_path = "docs/ai-standards.md" print(f"📖 Loading standards from: {standards_path}") From 06f93870bf522dcbb8a625d02dc9f49596f62cc7 Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:40:38 -0800 Subject: [PATCH 09/14] Refactor AI Review Agent initialization and client usage Updated AI Review Agent to use the new Client from google.genai and improved initialization comments. --- scripts/ai_reviewer/review-agent.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index 449ed6b..5e0864e 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -4,6 +4,9 @@ from github import Auth, Github from google import genai +from google.genai import Client + + # --- 1. Initialization & Environment Check --- print("🚀 Starting AI Review Agent...") @@ -20,7 +23,17 @@ # --- 2. GitHub & AI Setup --- try: - client = genai.Client(api_key=GEMINI_API_KEY) + + # The client automatically picks up the API key from the environment variable. + # Ensure you have set GEMINI_API_KEY or GOOGLE_API_KEY + # If using Vertex AI, you can initialize with client = Client(vertexai=True) + client = Client() + + + for model in client.models.list(): + print(f"Name: {model.name}") + print(f"Description: {model.description}\n") + gh = Github(auth=Auth.Token(GITHUB_TOKEN)) repo = gh.get_repo("cj-radcliff/SimpleFlutterFlashcards") pr = repo.get_pull(PR_NUMBER) From c0d6f13656b401f1f115c79be803906285911114 Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 14:42:40 -0800 Subject: [PATCH 10/14] Remove unused import of genai from review-agent.py --- scripts/ai_reviewer/review-agent.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ai_reviewer/review-agent.py b/scripts/ai_reviewer/review-agent.py index 5e0864e..67fbd96 100644 --- a/scripts/ai_reviewer/review-agent.py +++ b/scripts/ai_reviewer/review-agent.py @@ -2,7 +2,6 @@ import json import sys from github import Auth, Github -from google import genai from google.genai import Client From a20d746443461fdc56aec3f88252da833ebde7ba Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 15:26:08 -0800 Subject: [PATCH 11/14] Update ai_review.yml --- .github/workflows/ai_review.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ai_review.yml b/.github/workflows/ai_review.yml index 3908c1d..dfb3194 100644 --- a/.github/workflows/ai_review.yml +++ b/.github/workflows/ai_review.yml @@ -42,7 +42,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install PyGithub google-generativeai + pip install PyGithub google-genai + - name: Run Review Agent env: From 5aba193622a2b7a5f57357c84b81b68b104b3303 Mon Sep 17 00:00:00 2001 From: Cory R Date: Wed, 18 Feb 2026 15:35:37 -0800 Subject: [PATCH 12/14] Add 'Nit Picking' section to AI standards Added a new section on 'Nit Picking' to address the use of keywords. --- docs/ai-standards.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/ai-standards.md b/docs/ai-standards.md index 7ea72b6..ad037d9 100644 --- a/docs/ai-standards.md +++ b/docs/ai-standards.md @@ -35,4 +35,7 @@ You are a Senior Flutter Architect. Your mission is to ensure that all Dart code * **Resource Resilience:** Ensure that CLI or native tool interactions (via `Process.run`) handle timeouts and provide meaningful error messages for missing SDKs. ## 6. Testing & Quality Assurance -* ** \ No newline at end of file +* ** + +## 6. Nit Picking +* **Foo:** Use of foo or Bar as keywords is offensive to the FooBar people and should be avoided at all costs. From 5377afad8b482af6164e6f6f6151d3eabe6a5c53 Mon Sep 17 00:00:00 2001 From: Cory R Date: Thu, 19 Feb 2026 14:40:03 -0800 Subject: [PATCH 13/14] Clean up comments in TestView class Removed unnecessary comments from TestView class. --- lib/test_view.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/test_view.dart b/lib/test_view.dart index 2d269a7..6e5f9c6 100644 --- a/lib/test_view.dart +++ b/lib/test_view.dart @@ -4,6 +4,10 @@ class TestView extends StatefulWidget { // Violation 1: Missing 'const' on constructor for a stateless-style widget TestView({Key? key}) : super(key: key); + // stupid comment. okease delete + // todo + + @override // ignore: library_private_types_in_public_api _TestViewState createState() => _TestViewState(); From 6ff18c9fe97080f2449ce47f38ebbe069a2ec779 Mon Sep 17 00:00:00 2001 From: Cory R Date: Thu, 19 Feb 2026 14:40:53 -0800 Subject: [PATCH 14/14] Update test_view.dart /gemini --- lib/test_view.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/test_view.dart b/lib/test_view.dart index 6e5f9c6..0ef8525 100644 --- a/lib/test_view.dart +++ b/lib/test_view.dart @@ -7,6 +7,7 @@ class TestView extends StatefulWidget { // stupid comment. okease delete // todo + // some other commit @override // ignore: library_private_types_in_public_api