AgentSkillsCN

review-local-changes

针对本地未提交/暂存的更改,开展多智能体代码评审——无需 GitLab MR。适用于提交前或推送前的代码审查。智能体包括:架构(Claude)、安全(Gemini)、性能(Claude)、测试(Gemini)。

SKILL.md
--- frontmatter
name: review-local-changes
description: Multi-agent code review for local uncommitted/staged changes — no GitLab MR required. Use for pre-commit or pre-push reviews. Agents: Architecture (Claude), Security (Gemini), Performance (Claude), Testing (Gemini).

Review Local Changes

Review local changes using Claude + Gemini agents. No GitLab required.

Inputs

InputTypeDefaultPurpose
modestringstagedstaged, unstaged, all, commit, branch
commit_shastring-For mode=commit
base_branchstringmainFor mode=branch
repostring.Repo path
agentsstringarchitecture,security,performanceComma-separated
modelstringsonnetsonnet, opus, haiku
filesstring-Comma-separated files to review
run_testsboolfalseRun tests before review
run_precommitboolfalseRun pre-commit hooks

Modes

  • staged: git diff --cached
  • unstaged: git diff
  • all: git diff HEAD
  • commit: git show {sha}
  • branch: git diff {base}...HEAD

Workflow

1. Get Diff

  • Run git command based on mode
  • Limit diff to ~15k chars for LLM context
  • Get --stat for summary
  • Abort if no changes

2. Optional Quality Checks

  • If run_tests: test_run(repo)
  • If run_precommit: precommit_run(repo)

3. Parse Agents

  • Enabled: architecture, security, performance, testing, documentation, style
  • Config: architecture→claude, security→gemini, performance→claude, testing→gemini

4. Run Agents (parallel)

  • Each agent: prompt with diff, focus area
  • Prompts: architecture (SOLID, design), security (auth, injection), performance (complexity, caching), testing (coverage)
  • Output format: [CRITICAL], [WARNING], [SUGGESTION]

5. Synthesize Review

  • Combine agent outputs
  • Claude synthesis: PASS / WARN / BLOCK
  • If CRITICAL → BLOCK; if WARNING only → WARN; else PASS

6. Memory

  • memory_session_log("Local code review ({mode})", "Verdict: {verdict}, Agents: {count}")

Agent Prompts (concise)

  • Architecture: design patterns, SOLID, modularity
  • Security: input validation, auth, injection
  • Performance: complexity, resource usage, caching
  • Testing: coverage, edge cases

Output

  • Mode, lines, verdict (PASS/WARN/BLOCK)
  • Changes stat
  • Synthesized review
  • Agent results list
  • Ready to commit / Consider warnings / Fix critical

Tools

  • git diff (via shell or git tools)
  • test_run, precommit_run (if enabled)
  • Claude/Gemini CLI for agent reviews
  • memory_session_log