Skip to content

Feature: review a folder / file set instead of only git diff #21

@JohnnyVicious

Description

@JohnnyVicious

Motivation

/opencode:review and /opencode:adversarial-review today always build context from git diff / git status / git diff --name-only in plugins/opencode/scripts/lib/prompts.mjs::buildReviewPrompt. That's right for PR-style reviews but leaves no way to run a targeted review over:

  • a specific subdirectory (src/auth/**)
  • a fixed set of files unrelated to any git diff
  • a large untracked drop of generated or imported code

Proposed UX

/opencode:review --path src/auth
/opencode:review --path src/auth --path scripts/migrate.mjs
/opencode:adversarial-review --path src/payments --focus "race conditions on refund"

When --path is present, buildReviewContext should assemble the context from the file contents at those paths (truncated per file if large) instead of calling getDiff/getStatus/getChangedFiles.

Implementation sketch

  1. Extend buildReviewPrompt to accept paths: string[].
  2. New helper collectFolderContext(cwd, paths) reads file contents with a size cap per file and a total size cap, skipping binary files, broken symlinks, and anything in .gitignore.
  3. buildReviewContext emits a <files> section instead of <diff>/<git_status> when paths is set.
  4. Commands review.md / adversarial-review.md thread --path through to the companion.

Upstream reference

Derived from openai/codex-plugin-cc#104.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions