Skip to content

Conversation

@cgwalters
Copy link
Contributor

@cgwalters cgwalters commented Dec 19, 2025

Depends on #64


name: diff-quiz
description: Generate a quiz to verify human understanding of code changes. Use when reviewing PRs or commits to ensure the submitter understands what they're proposing.

Diff Quiz

This task generates a quiz based on a git diff to help verify that a human
submitter has meaningful understanding of code they're proposing — particularly
relevant when agentic AI tools assisted in generating the code.

Purpose

When developers use AI tools to generate code, there's a risk of submitting
changes without fully understanding them. This quiz helps:

  • Verify baseline competency in the relevant programming language(s)
  • Confirm understanding of the specific changes being proposed
  • Ensure the submitter could maintain and debug the code in the future

The quiz is designed to be educational, not adversarial.

Add a tasks directory designed primarily for AI agents to execute.
These are called "skills" in Claude Code and "commands" in OpenCode,
but they're simply structured markdown files.

The first task is perform-forge-review.md, which defines an AI-augmented
human-approved code review workflow. The key design principle is that
the AI builds a review in a local JSONL file, which the human can
inspect and edit before submission. The review is submitted as a
pending/draft review, allowing the human to make final edits in the
forge UI before publishing.

Assisted-by: OpenCode (Claude Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
Add a new diff-quiz task that generates quizzes to verify human
understanding of code changes. This is particularly relevant when
AI tools assist in generating code, helping ensure developers
understand what they're submitting.

Features:
- Three difficulty levels (easy, medium, hard)
- Markdown or interactive bash script output formats
- Separate grading step with constructive feedback
- Early exit support for efficient verification

Assisted-by: OpenCode (claude-sonnet-4-20250514)
Signed-off-by: Colin Walters <walters@verbum.org>
@gemini-code-assist
Copy link

Summary of Changes

Hello @cgwalters, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the capabilities for AI agents by introducing a mechanism to assess human comprehension of code changes and streamlining the process of AI-assisted code reviews across various Git platforms. The core idea is to ensure that developers using AI tools maintain a deep understanding of the code they are contributing, thereby improving code quality and maintainability. It also provides a structured approach for AI agents to interact with and manage pull/merge request reviews.

Highlights

  • New Diff Quiz Task: Introduced a new diff-quiz task designed to generate quizzes for verifying human understanding of code changes, particularly useful when AI tools are involved in code generation. This task supports easy, medium, and hard difficulty levels.
  • Agent Task Documentation: Updated AGENTS.md to include a new section on 'Tasks' and added a README.md in the agents/tasks/ directory to list available reusable task definitions for AI agents.
  • Forge Review Scripts: Added a suite of bash scripts (forge-review-append-comment.sh, forge-review-submit-forgejo.sh, forge-review-submit-github.sh, forge-review-submit-gitlab.sh) to facilitate AI-assisted code reviews across GitHub, GitLab, and Forgejo, including functionality for building and submitting review comments.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two new agent tasks: diff-quiz for verifying code understanding and perform-forge-review for AI-assisted code reviews. The changes include detailed documentation for both tasks and a suite of shell scripts to support the review workflow on GitHub, GitLab, and Forgejo. While the PR title only mentions diff-quiz, the perform-forge-review task and its scripts are also a significant and valuable addition.

The documentation is thorough and well-structured. The scripts are robust, using set -euo pipefail and including good validation.

My main feedback is about the default filenames used in the scripts, which are not unique and could cause issues with concurrent reviews. I've left specific suggestions on each of the affected scripts to make the defaults safer. This change would significantly improve the robustness of the review workflow.

Comment on lines +137 to +139
if [[ -z "$REVIEW_FILE" ]]; then
REVIEW_FILE=".git/review.jsonl"
fi

Choose a reason for hiding this comment

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

high

The default review file path .git/review.jsonl is not unique. As documented in perform-forge-review.md, using a non-unique filename can lead to comments from different reviews being mixed up if multiple reviews are performed concurrently. This could lead to incorrect reviews being submitted.

To prevent this, it's safer to make the --review-file argument mandatory. Please add a validation check for it in the Validate required arguments section (lines 90-106) and remove this default assignment.

OWNER="$1"
REPO="$2"
PR_INDEX="$3"
REVIEW_FILE="${4:-.git/.forge-review.jsonl}"

Choose a reason for hiding this comment

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

high

The default review file path .git/.forge-review.jsonl is not unique. This can lead to comments from different reviews being mixed up if multiple reviews are performed concurrently.

Since this script knows the pull request index, a safer default would be to include it in the filename.

Suggested change
REVIEW_FILE="${4:-.git/.forge-review.jsonl}"
REVIEW_FILE="${4:-.git/.forge-review-$PR_INDEX.jsonl}"

OWNER="$1"
REPO="$2"
PR_NUMBER="$3"
REVIEW_FILE="${4:-.git/.forge-review.jsonl}"

Choose a reason for hiding this comment

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

high

The default review file path .git/.forge-review.jsonl is not unique. This can lead to comments from different reviews being mixed up if multiple reviews are performed concurrently.

Since this script knows the pull request number, a safer default would be to include it in the filename.

Suggested change
REVIEW_FILE="${4:-.git/.forge-review.jsonl}"
REVIEW_FILE="${4:-.git/.forge-review-$PR_NUMBER.jsonl}"


PROJECT_ID="$1"
MR_IID="$2"
REVIEW_FILE="${3:-.git/.forge-review.jsonl}"

Choose a reason for hiding this comment

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

high

The default review file path .git/.forge-review.jsonl is not unique. This can lead to comments from different reviews being mixed up if multiple reviews are performed concurrently.

Since this script knows the merge request IID, a safer default would be to include it in the filename.

Suggested change
REVIEW_FILE="${3:-.git/.forge-review.jsonl}"
REVIEW_FILE="${3:-.git/.forge-review-$MR_IID.jsonl}"

@cgwalters
Copy link
Contributor Author

image

➡️

image

Gotta say, medium difficulty is definitely making sure you know things...

@AdamWill
Copy link

This is evil and I love it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants