Skip to content

Instantly share code, notes, and snippets.

@pkellner
Last active August 10, 2026 13:51
Show Gist options
  • Select an option

  • Save pkellner/e8a3211ced72810a5bf15bc407060c4f to your computer and use it in GitHub Desktop.

Select an option

Save pkellner/e8a3211ced72810a5bf15bc407060c4f to your computer and use it in GitHub Desktop.
Agentic Guidance for Code Review Based on Guillermo Rauch X Post

Presenting your own code changes

How to answer when the operator asks to see, explain, review, or understand changes you made. This complements "Code reviews are specific" in AGENTS.md, which governs reviews of code handed to you; this doc governs walkthroughs of your own work.

Treat "what changed?" as agentic code inquiry

When the operator asks anything like:

  • "Show me the code changes you made." / "What did you change?"
  • "Walk me through the changes." / "Show me the diff."
  • "Explain your implementation." / "How does this work now?"
  • "What files did you modify?"

do not merely summarize the task or report that the changes were completed. Give the operator enough information to understand and review the implementation without having to manually hunt through every modified file. The goal is not to report that code was changed — the goal is to let the operator inspect, question, and reason about the implementation through the conversation.

What to include

Include the following sections when relevant. Keep the response proportional to the size of the change (see below) — not every section applies to every change.

Summary

Briefly explain what changed and why.

Files changed

List each modified file and describe its purpose in the change. Example:

  • frontend/pages/People.tsx — added the filter UI and its state handling.
  • src/routes/api.v1.people.ts — passed the new filter parameter to the domain function.
  • backend/airtable/getPeople.ts — applied server-side filtering with zod-validated input.

Important code changes

Show the important before/after changes as focused diffs containing the meaningful hunks — never dump entire files. Explain why each notable change was made, not just what it is.

- const people = await getPeople();
+ const people = await getPeople({ searchQuery });

Execution flow

When the change spans multiple functions, components, routes, or services, show the call flow. Example for this repo's layering:

Operator types a search
    ↓
People page component
    ↓
typed REST client → GET /api/v1/people?search=...
    ↓
route handler (zod validation)
    ↓
backend/airtable/getPeople()
    ↓
Airtable

Use a diagram like this whenever it makes the implementation easier to understand.

Call stack / dependency path

When useful, show which functions call which:

PeoplePage.handleSearch()
  → usePeopleQuery()
    → GET /api/v1/people
      → getPeople()
        → listRecords()

Behavior changes

Explain observable behavior that changed. Explicitly cover: new behavior, behavior that remains unchanged, edge cases affected, error-handling changes, and API or data behavior changes.

Testing

Explain how the changes were verified: the relevant tests, commands, or scenarios, and whether they passed. This restates evidence from the "Prove it" rule in AGENTS.md — a committed test that fails without the change and passes with it, not an invitation to eyeball the app.

Risks and things to review

Call out anything the operator should pay particular attention to: assumptions, possible regressions, performance implications, security implications, data or schema changes, error-handling behavior, and code that was intentionally left unchanged.

React component refactors

When a refactor touches React components, include before/after line counts for each touched component and explicitly state whether any existing functionality was removed — or confirm that none was. This makes incremental-refactor review concrete instead of trusting "behavior unchanged".

Proportionality

For a small fix, a short diff and a sentence or two of explanation may be sufficient. For a larger feature or refactor, provide a more complete walkthrough with diagrams, call flows, and the full section set above. Scale the response to what the operator would need to review the change — no more, no less.

See also: frontend.md, testing.md.

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