AgentSkillsCN

review-build

当需要评审来自其他智能体(Codex、Claude Code 或任何构建工具)的构建、分支或一组提交时使用。沿用 CLAUDE.md 中的分级评审—修复—报告流程,以最大限度减少往返沟通与 Token 消耗。

SKILL.md
--- frontmatter
name: review-build
description: Use when asked to review a build, branch, or set of commits from another agent (Codex, Claude Code, or any builder). Applies the tiered review-fix-report protocol from CLAUDE.md to minimize round-trips and token waste.

Review Build

Review a build from another agent using the tiered review-fix-report protocol. Fix obvious issues in-place rather than just reporting them.

Inputs

The user will provide one or more of:

  • A branch name (e.g., build/master-plan-v1-1-canonicalization)
  • A commit range (e.g., e7d7ab8..d848d1f)
  • A build summary (pasted from the building agent)
  • A PR number

If only a branch name is given, diff against the branch's merge-base with main.

Step 1: Understand the Scope

bash
# Get the commit range
git log --oneline <base>..<head>

# Get the full diff
git diff <base>..<head> --stat

Read the changed files. Understand what was built, not just what changed.

Step 2: Run Pre-Existing Baseline

bash
# Check if failures exist BEFORE this build
git stash && git checkout <base-commit> --quiet
pytest runtime/tests -q 2>&1 | tail -5
git checkout <branch> --quiet && git stash pop 2>/dev/null

This establishes which test failures are pre-existing vs introduced.

Step 3: Review Each Change

For each file changed, assess:

  1. Correctness - Does the code do what it claims?
  2. Completeness - Are there missing cases, uncovered paths?
  3. Consistency - Does it follow existing codebase patterns?
  4. Safety - Error handling, validation, security concerns?
  5. Tests - Are new behaviors tested? Are edge cases covered?

Step 4: Classify Findings by Tier

TierCriteriaAction
CriticalBroken logic, security holes, dead code, contract violationsFix immediately
ModerateMissing error handling, coverage gaps, pattern inconsistenciesFix if straightforward, otherwise propose
LowStyle, naming, documentation, minor improvementsReport only

Decision Rules

Fix it yourself if ALL of these are true:

  • The fix follows an existing pattern in the codebase
  • The fix is under ~20 lines of code
  • The fix doesn't change any public API or contract
  • You can write a test for it (or the fix IS a test)

Propose options if ANY of these are true:

  • Multiple valid approaches exist
  • The fix changes a public interface or data contract
  • The fix touches protected paths (docs/00_foundations/, docs/01_governance/)
  • The fix requires a design decision the builder should make

Escalate if:

  • The issue requires architectural changes across multiple modules
  • The issue affects governance or constitution
  • You're unsure whether the fix is correct

Step 5: Fix and Verify

For each fix applied:

  1. Make the change
  2. Run targeted tests for the affected module
  3. Run pytest runtime/tests -q to check for regressions
  4. Commit with a clear message: Fix review findings: <summary>

Step 6: Report

Structure your report as:

code
Branch: <branch-name>
Commits: <start-sha>..<end-sha>
Test Results:
- Targeted: <result>
- Full/expanded: <result>
What Was Done:
- <concise bullet list>
What Remains:
- <open items or "None">

If needed, include a short Verdict line above this block, but keep the five core sections in this exact order for inter-agent consistency.

Quick Reference

bash
# Typical review flow
git log --oneline main..<branch>
git diff main..<branch> --stat
git diff main..<branch> -- <file>       # Deep-read specific files
pytest runtime/tests -q                  # Verify current state
# Fix issues, commit, re-run tests
pytest runtime/tests -q && git status    # Final verification