superpowers icon indicating copy to clipboard operation
superpowers copied to clipboard

Proposal: parameterized code-review dispatch to reduce prompt duplication

Open yulong-ge opened this issue 7 months ago • 1 comments

Hi , I would like to ask for your advice on a possible improvement to requesting-code-review.

Current Pattern

  • The main agent reads the review template and fills placeholders.
  • The subagent then receives the fully expanded template content again.

Potential Issue

  • This duplicates prompt/context payload across both main agent and subagent.
  • It may increase token usage unnecessarily.

Proposal

Use a lightweight parameterized dispatch contract from the main agent, passing only:

  • what_was_implemented
  • plan_reference
  • base_sha
  • head_sha
  • description

Then add one explicit instruction for the subagent:

  • Read code-reviewer.md
  • Replace placeholders with provided values
  • Fail fast if any required placeholder remains unresolved

Related Consistency Note

There is naming drift between:

Unifying names would make this contract safer.

yulong-ge avatar Apr 23 '26 15:04 yulong-ge

Thanks for this. The naming drift is fixed — both SKILL.md and code-reviewer.md have used PLAN_OR_REQUIREMENTS since v5.1.0. We're not planning to change this skill's dispatch contract: the template is small and sent once per review, and single-dispatch prompt duplication hasn't shown up as a meaningful cost in our token profiling — broader token-efficiency work is tracked in #1152.

arittr avatar Aug 19 '26 01:08 arittr