AGENT SKILL

review

에이전트 팀을 활용한 다관점 코드 리뷰

License 许可
MIT
所属仓库
Nharu/cc-cmds
最近更新
2026-11-15
Stars
★ 3
Forks
1

01 前言 Front Matter

name
review
usage
/cc-cmds:review [<target>] [--base-sha <sha>] [--declared-files <csv>] [--expand <분야>[,<분야>]] [<directive>]
options
[ { "kind": "positional", "name": "<target>", "summary": "리뷰 대상. 입력 형태에 따라 PR/브랜치/파일 모드로 자동 분기.", "required": false, "variants": [ { "label": "PR URL", "example": "https://github.com/owner/repo/pull/42", "behavior": "PR 번호 추출 후 `gh pr view`로 메타데이터 수집" }, { "label": "PR 번호", "example": "42", "behavior": "숫자만일 때 PR 번호로 해석" }, { "label": "브랜치 이름", "example": "feat/auth-flow", "behavior": "하이픈·영문 포함 시 브랜치로 해석, `gh pr list --head`로 연관 PR 조회" }, { "label": "파일/디렉토리 경로", "example": "src/auth/", "behavior": "파일 리뷰 모드; `gh` 명령 사용 안 함" }, { "label": "혼합 (타겟 + 지시문)", "example": "PR #42 보안 중심으로", "behavior": "타겟 추출 후 지시문을 팀 구성·컨텍스트 패키지·보고서에 전파.\n**지시문은 깊이/커버리지에만 영향**; severity는 기술 기준으로 독립 평가.\n" }, { "label": "(생략)", "behavior": "빈 입력 시 현재 브랜치/PR 자동 감지 체인 실행" } ], "parse_note": "숫자만 포함된 토큰(`42`)은 PR 번호, 하이픈·영문 포함 토큰(`42-fix-bug`)은 브랜치로 해석.\n순수 숫자 + 브랜치 동시 존재 시 PR 번호 우선. 어느 형태에도 해당되지 않으면 `AskUserQuestion`으로 명확화.\n" }, { "kind": "flag", "name": "--base-sha <sha>", "default": "off (`gh pr view … baseRefName` 또는 기본 브랜치에서 base 를 스스로 유도)", "summary": "diff 의 base 를 호출자가 지정. 이미 base 를 아는 호출자(파이프라인 드라이버 등)가 리뷰의 재유도를 없애기 위해 넘긴다. 넘겨받은 값은 신뢰하지 않고 `git merge-base --is-ancestor` 로 검증하며, 검증에 실패하면 기존 유도로 폴백하고 그 사실을 리포트 개요에 남긴다.", "parse_note": "`--base-sha` 다음 토큰을 값으로 취한다. 값이 없으면 플래그를 무시하고 기존 유도를 쓴다. 이 토큰과 값은 `<directive>` 추출 전에 인자열에서 제거된다." }, { "kind": "flag", "name": "--declared-files <csv>", "default": "off (변경 파일 집합을 diff 에서만 유도)", "summary": "이 변경이 건드리기로 **선언된** 파일 집합(쉼표 구분). diff 는 무엇이 바뀌었는지만 말하고 무엇이 바뀌기로 되어 있었는지는 말하지 않으므로, 선언 밖 파일이 리뷰 범위 안에 있을 때 그것을 지목할 수 있게 한다.", "parse_note": "`--declared-files` 다음 토큰을 값으로 취한다. 쉼표·공백을 포함할 수 있으므로 인용 부호로 감싸 넘긴다. 이 토큰과 값은 `<directive>` 추출 전에 인자열에서 제거된다." }, { "kind": "flag", "name": "--expand <분야>[,<분야>]", "default": "off (기술 분야만 리뷰 — 기획서 없이 추정한 요구 지적과 문서 표현 다듬기는 등급 없이 `## 범위 밖 관찰` 절에만 남는다)", "summary": "기본에서 빠진 리뷰 분야를 연다. 값은 `요구`(적힌 근거 없이 추정한 제품·기획 요구 판단)와 `문서표현`(사람이 읽는 문서의 문장 다듬기·구성·설명 보강·뜻을 바꾸지 않는 오탈자) 둘이다. 열린 분야의 발견은 같은 심각도 기준으로 등급을 받는다.", "parse_note": "`--expand` 다음 토큰을 값으로 취해 쉼표로 나눈다. 두 번 주면 합집합이고, 모르는 값은 경고 한 줄과 함께 버리며, 남은 값이 없으면 플래그를 주지 않은 것과 같다. 이 토큰과 값은 `<directive>` 추출 전에 인자열에서 제거된다. 분야는 이 플래그로만 열린다 — 지시문은 분야를 열지 않는다." }, { "kind": "positional", "name": "<directive>", "summary": "리뷰 관점 지시문. `<target>` 뒤에 자연어로 부가 (예: \"보안 중심으로\").", "required": false, "parse_note": "지시문은 severity 기준을 변경하지 않음 — 리뷰 팀 구성과 컨텍스트 가중치에만 영향. 인식된 플래그와 그 값을 뺀 나머지가 지시문이며, 인식되지 않는 `--` 토큰은 지시문으로 흡수하지 않고 경고 후 폐기한다." } ]
description
에이전트 팀을 활용한 다관점 코드 리뷰
when_to_use
사용자가 PR/로컬 diff/파일 경로에 대한 다관점 코드 리뷰(보안/성능/품질 등)를 요청할 때
disable-model-invocation
true

02 资源文件 3

03 SKILL.md 正文

Conduct a multi-perspective code review using an agent team for the given task. All team discussions and inter-agent communication should be in English to optimize token usage. User-facing communication and saved documentation should be in Korean.

Input

Consistency Note: README의 user-facing 요약은 frontmatter options[]에서 자동 생성됨. 본 섹션은 runtime-agent 작동 규약이며, 변경 시 frontmatter도 함께 갱신.

$ARGUMENTS can be: a PR URL (https://github.com/.../pull/N), a PR number, a branch name, a file/directory path, a mixed input (target + directive, e.g., "PR #42 보안 중심으로"), or empty (auto-detect from current branch). See Step 1a for detailed parsing logic.

Design document (optional, directive-supplied). A directive may name a design document the change was built from — e.g. "PR #42, 설계는 docs/auth-flow.md". When one is given, it becomes context-package item 17 and unlocks the design-conformance tag. It is supplied explicitly rather than inferred: a design document is user-local and typically untracked, so branch-name guessing or reverse-lookup through a sidecar would work only on your own work — the same case where saying so outright costs nothing. Absence is the normal path and is never an error. A directive naming a spec the other way — "기획서는 docs/spec.md" — makes the same item 17. A review given no such document has no source for a requirement judgement: an expectation nothing written states belongs to the closed 요구 field (item 14's Field scope of references/01-reviewer-context-package.md), not to a finding.

Workflow

Step 0: Tool Loading

Load deferred tools via ToolSearch before any other step (Agent is built-in — do not load it):

  • ToolSearch("select:AskUserQuestion,mcp__cc-cmds__question_form") — MUST load before Step 1 (the form's schema missing from the result means the form is unavailable)
  • ToolSearch("select:SendMessage")
  • ToolSearch("select:TaskStop")

Before calling AskUserQuestion, Read ${CLAUDE_SKILL_DIR}/../_common/askuserquestion.md. Apply the hard constraints from that file to every AskUserQuestion call in this skill.

Read ${CLAUDE_SKILL_DIR}/../_common/team-model-tier.md here too. It owns the seat class table, the promotion triggers and the record syntax, and Step 3 is where a seat's model is chosen — so it is read in the same place and for the same reason as the dispatch contract below.

Read ${CLAUDE_SKILL_DIR}/../_common/agent-team-protocol.md here, not at Step 4. It carries the spawn / ledger / dispatch+convergence / escalation contract, the task-assignment header, and the ### Team size budget ceiling. The ceiling is what makes the placement wrong where it was: Step 3 reads that budget to decide how many reviewers to propose, and Step 4 is two steps later — so the shipped text had a step depending on a file a later step was told to open. Reading the dispatch contract in the same place as the tools it governs removes that inversion. This is a placement change and not a scope change: nothing about what the file says or when it binds is different.


Step 1: PR Detection & Scope Confirmation (Korean)

Pre-validation: gh CLI status check

When $ARGUMENTS is not a file path, verify gh CLI before auto-detect:

  1. command -v gh — if not installed, install gh and ask user to run gh auth login
  2. gh auth status — if not authenticated, ask user to run gh auth login
  3. gh api repos/{owner}/{repo} — if no access, ask user to switch to the correct account

Proceed to 1a after pre-validation passes.

1a: Input parsing & target detection

Parse $ARGUMENTS:

  • PR URL (https://github.com/.../pull/N) → extract PR number → gh pr view {number}
  • Number → treat as PR number → gh pr view {number}
  • Branch name pattern → gh pr list --head {branch} --json number,title --jq '.[0]'
  • File path → scoped file review (inform user: "파일 경로 기반 리뷰입니다. PR 기반 리뷰 시 추가 컨텍스트(PR 댓글, CI 상태 등)를 활용할 수 있습니다.")
  • --base-sha <sha> and --declared-files <csv> → scope hints from a caller that already knows both. Each takes the next token as its value, and both the flag and its value are removed from the argument string before the directive is extracted. --base-sha names the commit the change branched from — verify it in 1b rather than trusting it. --declared-files is the comma-separated set the change was supposed to touch; quote it, since it contains commas and may contain spaces. Both are optional and a human invocation normally supplies neither. A flag whose value is missing is dropped along with the flag: consuming the following token would silently swallow the next flag or the directive.
  • --expand <분야>[,<분야>] → opens fields the default leaves closed (item 14's Field scope of references/01-reviewer-context-package.md). It takes the next token as its value, and both the flag and its value are removed from the argument string before the directive is extracted. Split the value on commas; the known values are 요구 and 문서표현. Given twice, the open fields are the union of both values. An unknown value is discarded with one Korean warning naming it; when nothing is left, it is as if the flag were not given. A flag whose value is missing is dropped along with the flag, without consuming the next token. Without this bullet the flag would fall to the next bullet and be discarded.
  • A directive does not open a field. Fields open only through --expand. When the directive reads as asking for a field outside the default — an inferred product requirement, polishing the wording of a document — leave the field closed and emit one Korean line: 분야는 지시문으로 열리지 않습니다 — 요청한 분야를 보려면 --expand <요구|문서표현> 을 붙여 다시 호출하세요.
  • Any other token beginning with -- → not a directive. Emit one Korean warning naming the token, discard it, and do not propagate it to team composition, the context package, or the report. Absorbing an unrecognized flag into the directive is the failure this bullet exists to prevent: the directive reaches the reviewers as a review-perspective instruction, so a mistyped or newly-added flag arrives as a weighting hint nobody wrote and nothing reports.
  • Mixed input (target + directive, e.g., "PR #42 보안 중심으로") → extract target + propagate directive to:
    • Step 3: prioritize directive in team composition (e.g., "보안 중심" → the tier file's directive promotion trigger fires on the security seat, and extra security focus may be added)
    • Step 4: add "User directive: [directive]" to reviewer context package. Directive influences review depth and coverage; severity is assessed independently on technical criteria.
    • Step 5: add "Review focus: [directive]" field to report overview
  • 등급 2 Ambiguous input → clarify with AskUserQuestion

When $ARGUMENTS is empty, run auto-detect chain:

  1. gh pr view --json number,title,url,state,isDraft,baseRefName,additions,deletions,changedFiles → success: PR review
  2. Failure: gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' → git diff {DEFAULT_BRANCH}...HEAD --stat → if diff exists: local diff review
  3. 등급 2 No diff: AskUserQuestion to request review target

If target is a non-PR (local diff or file path), Read ${CLAUDE_SKILL_DIR}/references/03-non-pr-mode.md to apply adaptations to Steps 2-5 (context package items 2/5, document header, checklist focus).

1b: Context collection

For PR targets:

# Repository slug (used in subsequent gh api calls)
REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')

# PR metadata (latestReviews = current state snapshot per reviewer; full history via gh api .../reviews below)
gh pr view $PR_NUMBER --json number,title,body,state,isDraft,labels,milestone,\
  assignees,reviewRequests,latestReviews,headRefName,baseRefName,url,createdAt,\
  additions,deletions,changedFiles

# Changed files with per-file statistics (path, additions, deletions; '.[] | .path' for path-only)
gh pr view $PR_NUMBER --json files --jq '[.files[] | {path,additions,deletions}]'

# Full diff
gh pr diff $PR_NUMBER
# For scope narrowing (gh pr diff does not support path filters):
# Extract baseRefName, headRefName from PR metadata, then:
# git fetch origin {baseRefName} {headRefName}
# git diff origin/{baseRefName}...origin/{headRefName} -- path/to/dir/
# For fork PRs where headRefName is not on origin:
# gh pr checkout {PR_NUMBER} then git diff origin/{baseRefName}...HEAD -- path/to/dir/
# Or fall back to filtering gh pr diff full output

# When 1a parsed --base-sha, VERIFY it before using it:
# git merge-base --is-ancestor <supplied base> <target head>


# Existing inline review comments (--paginate for full collection, jq post-processing)
gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/comments" | \
  jq '[.[] | {author: .user.login, file: .path, line: .line, body: .body, \
  created_at: .created_at, resolved: (.resolved // false)}]' | \
  jq -s 'add'

# Review decisions (--paginate for full collection, jq post-processing)
gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/reviews" | \
  jq '[.[] | {author: .user.login, state: .state, body: .body, \
  submitted_at: .submitted_at}]' | \
  jq -s 'add'

# General PR comments
gh pr view $PR_NUMBER --json comments \
  --jq '[.comments[] | {author: .author.login, body: .body, createdAt: .createdAt}]'

# CI check status
gh pr checks $PR_NUMBER --json name,state,bucket 2>/dev/null || echo "[]"

For local diff targets:

git diff {DEFAULT_BRANCH}...HEAD        # full diff
git log {DEFAULT_BRANCH}..HEAD --oneline  # commit history

A supplied --base-sha is verified, never trusted. Run git merge-base --is-ancestor <supplied base> <target head>. <target head> is this review's target named explicitly — the branch, or the PR's head — and never the bare HEAD of whatever directory the command runs in; binding to the ambient head makes the guard depend on the caller's working directory, which is the same class of failure the flag exists to close. The substitution replaces the base derivation only; a PR target still collects its metadata and comments as before. On success, take the diff against that base in both modes — git diff <base>...<target head> — which is the point of accepting the flag at all: the caller already resolved the base and the derivation here would only re-answer a settled question. On failure, fall back to the derivation this step already has (gh pr view … baseRefName for a PR, {DEFAULT_BRANCH} for a local diff) and record one line in the report overview naming the rejected value and the base actually used. A base that is not an ancestor of <target head> produces a diff of a tree nobody wrote — findings that are real about the wrong change — and that failure is silent, because the report reads exactly as it would have. Falling back costs one command; trusting the value costs the whole review.

1c: Scope confirmation (with large PR gate)

A supplied --declared-files is compared against what actually changed. List the changed paths for the diff just resolved and set them against the declared set. Name in the report's overview any changed path that is outside the declaration, and any declared path with no change. Neither is an error and neither narrows the review — the whole diff is reviewed either way — but the two lists are the only place the run says whether the change that landed is the change that was declared. Git can say which files moved; only the declaration says which ones were meant to. With no flag, skip this and say nothing.

Present to user (in Korean):

  • Review target type (PR / local diff / user-specified)
  • PR title/number/URL (if PR)
  • Change statistics (file count, additions, deletions)
  • Key changed files/modules
  • Existing PR review comment summary (if any)
  • CI status (highlight failed checks if any)

Large PR gate (>50 changed files):

  • Determine file count from PR metadata changedFiles field
  • Inform user of the scale
  • 등급 2 Offer options via AskUserQuestion (header chip 리뷰 범위; each option carries a description):
    • label "전체 리뷰 진행" — description: Proceed with a full review of all changed files.
    • label "특정 경로만" — description: Focus the review on a specific directory or module.
    • label "리뷰 분할" — description: Split the review into multiple smaller passes.
  • Adjust team composition if scope is narrowed

Proceed after user confirmation.

1d: Edge case handling

Case Handling
Draft PR Proceed with review, mark draft status in report header
Closed/Merged PR 등급 2 AskUserQuestion to confirm whether to continue
Multiple PRs on same branch List all, let user choose
Fork PR gh pr view handles normally
No GitHub remote Skip all gh commands, switch to local diff mode
gh CLI not installed Install gh, then ask user to run gh auth login. gh is required
gh auth failure Ask user to run gh auth login. Retry after authentication

Step 2: Codebase Survey & Exploration

2a: Source tree survey

  1. Run ls at project root to survey structure.
  2. Read CLAUDE.md and .gitignore for project-specific conventions and skip targets.
  3. Note directories to skip when searching: node_modules, .next, build, dist, __pycache__, .git, coverage, .turbo, .cache, out, .vercel, .output, vendor, target.
  4. Use Glob/Read to orient on the changed files' neighbourhood before assigning reviewers.

2b: Codebase context exploration

Explore based on changed file list:

  • Related modules and dependencies (callers, importers)
  • Related test files
  • Existing patterns and conventions in the affected area
  • Architectural context (overall structure understanding)

This exploration output is the key input for Step 3 team composition.


Step 3: Team Composition Proposal (Korean)

Propose team composition based on PR characteristics and codebase exploration results.

How many reviewers: bounded by _common/agent-team-protocol.md's ### Team size budget. Read the ceiling and its coordinator-class carve-out there — this step states no number of its own, so the budget cannot drift into two values.

Small-work gate (evaluated once on entering this step)

A small, single-concern change does not need a full review team. Evaluate this before composing, against the scope Step 1c confirmed — never the raw target, since a "특정 경로만" / "리뷰 분할" narrowing is exactly the case where the two differ most.

Gate input — measure the narrowed scope, and read it per mode. Step 1a's three target types keep their change size in different places, and the local-diff mode has no gh metadata at all:

  • PR mode — take the per-file {path,additions,deletions} array already collected in 1b, drop the entries Step 1c excluded, and sum additions + deletions over what remains. The file count is the length of that same filtered array — do not reuse the unfiltered changedFiles, which is the pre-narrowing number.
  • Local diff mode (empty $ARGUMENTS) — the source is the same git diff {DEFAULT_BRANCH}...HEAD the auto-detect chain established; aggregate it with git diff {DEFAULT_BRANCH}...HEAD --numstat, apply the Step-1c path filter to the rows, and sum the added and deleted columns.
  • File path mode — there is no diff input, so there is no change size to measure. Declare that the gate does not apply and compose normally; do not substitute an estimate.

Risk indicators outrank the size row. If any indicator in the next subsection fires — auth/authorization, DB schema or query, public API surface, external service integration, async/concurrency — compose for that risk no matter how small the diff is, and this gate does not narrow the team. Size is the one signal here that could otherwise quietly overrule a risk signal, and a security-relevant change is very often a small patch.

When it fires: no risk indicator fired and the narrowed scope is inside the small-patch threshold of the type table below. Compose from that row instead of a larger default row, and state the narrowing in one line of the Korean proposal so the user sees it rather than discovering a thinner team.

Floor. This gate selects among the composed rows below, every one of which carries at least two reviewers, so it cannot yield an empty roster — and an empty roster would not be a saving anyway but a hard stop, since the report stub is created at spawn time and every resume path fail-closes on a missing or unparseable ledger. That floor belongs to the roster contract in _common/agent-team-protocol.md, alongside the team-size ceiling; do not write a second floor rule into this gate.

PR characteristic analysis → risk indicators

  • Auth/authorization logic changes → security reviewer needed
  • DB schema/query changes → performance/DB reviewer needed
  • Public API surface changes → API contract reviewer needed
  • External service integration → security + integration review needed
  • Async/concurrency code changes → concurrency reviewer needed

PR type-based default compositions

PR Type Team Composition (Roles)
Security-sensitive (auth, sessions, payments, permissions) Security reviewer + Logic reviewer + Code quality reviewer
Data-centric (migrations, schema, ORM) DB/query expert + Security reviewer + Code quality reviewer
API contract changes (endpoints, response formats) API contract reviewer + Security reviewer + Code quality reviewer
General feature (business logic, UI) Security reviewer + Performance reviewer + Code quality reviewer
Small patch (<30 lines, single concern) Logic reviewer + Code quality reviewer
Large refactoring (many files, no new features) Code quality reviewer + Performance reviewer + Security reviewer

Each reviewer's model comes from ${CLAUDE_SKILL_DIR}/../_common/team-model-tier.md, read in Step 0: assign the seat exactly one class id and pass that class's model as the Agent() call's model. Evaluate that file's promotion triggers here too — once per seat, from what Steps 1–2 already collected — and the rules for classes, promotion, demotion and the limit-error exception stay in the tier file rather than being restated here.

The table above is the default composition. Roles can be added/changed based on PR characteristics. For example, a "data-centric" PR with concurrency issues should add a concurrency reviewer. Team composition is dynamically adjusted based on risk indicator analysis, with rationale presented during user approval.

Large PR additional strategy

When >50 files are in review scope (after Step 1c narrowing), consider adding a Scope Coordinator role. It is meta/orchestration rather than a domain perspective, so it is not counted against the ceiling — the coordinator-class carve-out in _common/agent-team-protocol.md's ### Team size budget. The coordinator operates as a persistent participant:

  • Round 0 (pre-analysis): Classify changed files by risk level and assign focus areas to each reviewer
  • Per-round coverage audit: After each round's results, identify high-risk areas not yet reviewed and request additional review from relevant reviewers
  • Cross-cutting issue identification during cross-validation: Synthesize findings from multiple reviewers to discover inter-module interaction issues individual reviewers might miss

Team proposal format

Present to user in Korean:

**PR 특성 분석:**
- 변경 규모: 파일 X개, +Y줄 / -Z줄
- 영향 영역: [identified domains]
- 위험 신호: [detected risk indicators]

**제안 팀 구성:**
- 리뷰 분야: 기술(기본)
- 기획서: 없음

| 역할 | 모델 | 담당 범위 |
|------|------|-----------|
| ... | ... | ... |

**팀 구성 근거:**
[1-2 sentences on why this composition fits this PR's characteristics]

이 팀 구성으로 진행할까요?

The 리뷰 분야 line takes the shape of the report's overview line — 기술(기본), or 기술 + followed by the open fields in the order 「요구, 문서표현」 — and the 기획서 line the path of the item-17 document or 없음 (02-review-report-template.md ## Document Structure). An open field adds no seat; it joins an existing seat's 담당 범위. 요구 joins the Logic reviewer when the roster has one and the Code quality reviewer otherwise; 문서표현 joins the Code quality reviewer. A re-proposal after a modification request carries the same two lines.

The 모델 column holds the value the tier file's table (promotion included) chose for that seat, as a bare lowercase alias. A user who lowers a seat's model when approving overrides the table — follow it, and record that seat with 출처=사용자 in Step 5.

Branch on user response:

  • Approve → create team, proceed to Step 4
  • Modification request → reflect feedback, re-propose (repeat)
  • Reject/abort → end review

Step 4: Parallel Review (English, team internal)

The spawn / ledger / dispatch+convergence / escalation contract and the task-assignment header come from ${CLAUDE_SKILL_DIR}/../_common/agent-team-protocol.md, read in Step 0. Reviewers are nameless background tasks (Agent with subagent_type:"claude", run_in_background:true, no name), one fresh dispatch per (role, round/phase) key and resumed by agentId only inside that key, self-terminating on return — each reviewer's result is delivered by its witness file, and the return text is only an early-wake hint (see the protocol's witness contract and witness_present completion predicate). There is no TeamCreate/named-teammate/DM machinery.

Before building each reviewer's context package, Read ${CLAUDE_SKILL_DIR}/references/01-reviewer-context-package.md for the 17-item package contents, role-specific checklists, review protocol rounds, and review-specific facilitator additions.

Write the field line into every package. Item 14's Field scope asks the lead for one line naming the fields open for this review (the approved 리뷰 분야 line) and whether a spec document was supplied (item 17). A reviewer told nothing reads only the technical field open.

  • Derive the review slug from the target (this names the review-report doc + keys the ledger; it is no longer a harness team name):
    • PR review: review-pr{NUMBER} (e.g., review-pr42)
    • Local diff: review-{branch-name} (e.g., review-feat-auth)
    • File path: review-{short-slug} (e.g., review-auth-module)
  • Early-stub the review-report doc at spawn time (the report doc does not exist until Step 5, so pre-create the stub so the ledger has a home — no TMPDIR fallback). Write docs/reviews/{slug}.md as: an H1 title, then a <!-- cc-design-ledger v3 … --> HTML-comment block (after the H1, before the first ##). Entry schema — the column list, the state domain, the per-row transient set and its terminal-strip rule (including the epoch exemption) — is defined once in _common/agent-team-protocol.md's Role↔agentId ledger v3 and is not restated here. scratchDir = the reviewer's out-of-tree witness dir, recorded at spawn.
  • Spawn each approved reviewer as a nameless background task. Embed the task-assignment header (from the protocol) verbatim atop each spawn prompt, followed by the reviewer's self-contained context package. Record each returned agentId in the ledger immediately (state=running, round 1). Stamp epoch (max(disk epoch, 0)+1, re-derived from the on-disk docs/reviews/{slug}.md ledger — never an in-context counter; this Step-4 review team is the first team → epoch 1) and the round-1 witnessNonce on every one of its rows in the same at-spawn recording window as agentId/scratchDir, per the protocol Spawn section. Write each row's role/scope so that it begins with that seat's {role-slug} — the same slug the witness filenames use — followed by a space and then the prose. The after-the-fact join from the report's 모델 티어 row to the ledger row of the same seat reads that leading slug and has nothing else to read: a row written in any other shape leaves the requested model with no ledger row to pair it with. Update the ledger on every state change.
  • Witness scratch dir (parameters for _common/agent-team-protocol.md): before the first spawn, run the protocol's ## Spawn command — <plugin root>/orchestrator/cc-team-witness-init.sh <this review's slug> (no bash in front — see the protocol's note) — and record the printed path, literally (not $WITNESS_DIR) as each reviewer's scratchDir (same immediacy as agentId). Every Step-4 review round is witnessed ({role-slug}.round-N.md, sentinel/nonce per the protocol); a Step-6 follow-up fresh team gets its own nested run of that command. The witness dir is out-of-tree under either root, leaving the two-command boundary gate untouched.
  • Progress checkpoint — this skill opts in. Append the protocol's checkpoint clause verbatim after the task-assignment header in every reviewer dispatch and resume prompt (## Per-skill parameter seam → Parameter — progress checkpoint), substituting the same four tokens the header already substitutes. Reviewers publish to ${scratchDir}/partial/; the lead reads no checkpoint in a live run.
  • Re-entry notes — this skill opts in. Append the protocol's re-entry notes clause (## Per-skill parameter seam → Parameter — re-entry notes) verbatim after the task-assignment header in every reviewer prompt:

Re-entry notes (MUST): directly above your peer-read: lines (directly above your sentinel when you have none), put a section that starts with the heading ## Re-entry notes, at most 20 lines and 2,000 bytes, one entry per line — path:line — why for a place you would open first if you came back to this work, or one command you would re-run. No findings and no verdicts in it. The next dispatch of your role reads it as the starting point of its re-exploration.

  • All inter-reviewer discussion in English
  • NO code modifications allowed. Review only
  • The lead acts as a facilitator, actively driving the rounds (produce → cross-review → convergence), each a fresh dispatch per reviewer
  • Convergence (witness collection): after cross-review, dispatch each reviewer's role once afresh with a convergence prompt (current consensus + open conflicts, peer witnesses by path); a reviewer's round is converged-and-collected only when its round witness is witness_present and the witness body says "no further input". Round count follows _common/agent-team-protocol.md's ### Round budget (Round 1 = produce; Round 2+ = cross-review of peer witnesses handed over by path per that file's ## Multi-round). This is a full review — what separates it from review-lite is roster breadth and review scope, not a larger round allowance.
  • Escalation (per the protocol's reconcile ladder + failure phenotypes): Case 1 — thin/empty witness (counter) → re-scope + resume once; 2nd consecutive → AskUserQuestion (proceed without this reviewer / re-scope once more / abort); route an excluded reviewer through the protocol's Case-1 terminal disposition (_common/agent-team-protocol.md §Escalation Case 1 — the SOT for the ledger state=aborted stamp and the report-metadata exclusion mark) rather than re-specifying it here. Case 2 — never-returns → the protocol's reconcile-ladder death verdict fires → TaskStop + same-round respawn (new agentId, with the ledger row's agentId / outputFile updated and its stallMark reset per the protocol); if the respawn also dies → AskUserQuestion. Case 3 — non-conforming witness (routing rule) → re-assign once; a recurrence feeds the Case 1 counter.

Step 5: Result Synthesis & Documentation (Korean)

Before synthesizing review results, Read ${CLAUDE_SKILL_DIR}/references/02-review-report-template.md for the severity system (P0~P3), merge rules, document structure template, file naming/version conventions, and paste-ready comment generation (its "Paste-Ready Comment Blockquote" section).

The lead synthesizes all review results into a Korean document at docs/reviews/{slug}.md (the early stub created at spawn time) following the template. Leave the <!-- cc-design-ledger v3 … --> block in place (it renders invisibly and carries the agentId ledger). Re-read the ledger from disk before any later phase.

Fill the report's model record. Write each seat's 리뷰 팀 구성 parenthesis as one bare lowercase alias, and fill the 모델 티어 block directly after it with one row per seat. The row syntax belongs to ${CLAUDE_SKILL_DIR}/../_common/team-model-tier.md and is not restated here.

Fill every P0 and P1 item's **좌석** line. At synthesis, give each P0 and P1 item its - **좌석**: 낸=… | 동의=… first sub-bullet, spelling every seat with the same role-slug its 모델 티어 row starts with. 낸 names the seats whose own witness raised the defect; read 동의 from the cross-verification record — a seat that confirmed the item at its final severity or above. The template (02-review-report-template.md, beside the 모델 티어 block description) owns the grammar and which items carry the line.

Write the field lines and the out-of-scope section. The overview carries - **리뷰 분야**: and - **기획서**: directly after 변경 규모, as the approved Step 3 proposal read. Carry every reviewer's [범위 밖:<분야>] line into ## 범위 밖 관찰, merging the same observation at the same 파일:라인 into one line; with no such line, the section is not written. The template's "Out-of-scope observations section" owns the position and the line shape.

P1 classification (lead-authored)

Write the report's P1 classification exactly as the template's ### P1 분류 기준 and "P1 Classification Grammar" sections spell it — they own the grammar, so it is not restated here:

  • the - **P1 분류**: 차단 N건 | 이월 가능 N건 line directly after 발견 요약, always present — 차단 0건 | 이월 가능 0건 when there is no P1;
  • on every P1 item, exactly one **[차단]** or **[이월 가능]** tag and a 분류 근거 sub-bullet, and on every **[이월 가능]** item an 이월 제목 and an 이월 본문;
  • the overview line - **슬라이스 범위**: 적용 안 됨 — 인자 없음, because this skill takes no --slice and so never applies a slice scope; there is no 다른 슬라이스 몫 line and no ## 다른 슬라이스 몫 (집계 제외) section.

This skill registers no issue. Whether a report reading "이월 후 머지 가능" sends its carryable items to follow-up issues and merges is the person's decision.

Paste-ready comments (lead-authored)

Below each P0~P2 finding's analysis (근거 / ? 수정 제안), the lead writes a self-contained, paste-ready GitHub comment as a ? 붙여넣기용 코멘트 blockquote, following the "Paste-Ready Comment Blockquote" section of 02-review-report-template.md. The label sits outside the blockquote; the blockquote holds only the comment body so the user can copy it straight into a GitHub inline comment.

  • Tone duality: the analysis body is assertive (단정체); the comment is polite (정중체) — facts as ~됩니다 / ~입니다 (no hedging on a confirmed bug), requests as ~하시면 될 것 같습니다 / ~해주시면 좋겠습니다 (~해야 합니다 only for P0 merge-block intent; never ~하세요). The comment reads standalone, with no "위 분석 참조" cross-reference.
  • P3 = the item line is the comment: write each P3 line itself in polite, self-contained form from the start (no separate blockquote / [근거] / [제안]); the trailing — {리뷰어명} attribution is excluded when copied.
  • dedup exception: when a finding only confirms an existing PR comment (carries ? 관련 PR 코멘트), do NOT add a paste-ready blockquote — leave a single plain-text note (이미 PR 코멘트 #N에서 제기된 사항입니다 …) instead. The absence of a blockquote signals "nothing new to post".
  • Non-PR mode: comments are still generated (they are portable to a future PR, commit message, or issue); the dedup exception does not apply since there are no existing PR comments.

Step 6: Review Discussion & Follow-up (Korean)

After presenting the review report, discuss with the user.

Lead direct handling (no team needed)

  • Detailed explanation of specific findings
  • Code section re-check (using grep + Read)
  • Severity re-assessment when user provides new context (e.g., "이 코드 경로는 내부 전용입니다")
  • Explanation of why a specific finding was not included

Team re-creation proposal

Propose team re-creation when:

  • User requests comprehensive analysis of areas not covered in the review
  • Severity dispute requires independent re-evaluation
  • Findings connect to broader architectural issues requiring multi-perspective analysis
  • User discovers blind spots that need the same depth as the original review

Team re-creation proposal format builds on Step 3's format with additional fields:

  • Re-creation reason: blind spot, additional analysis needed, severity dispute, etc.
  • Previous review coverage: areas covered vs. uncovered in previous review
  • Additional analysis scope: specific targets and expected outcomes
  • Include previous review findings in the new reviewers' context packages
  • Requires user approval
  • The session's 리뷰 분야 line carries over unchanged. Step 6 reads no arguments, so a re-creation never opens a field this session did not open. When the user needs such a field, say so in one Korean line and point them to a new /cc-cmds:review call with --expand <값>.

Leftover detection: before re-spawning, re-read the ledger from disk and scan for residual state=running rows (a leftover signal — this replaces the removed team-directory filesystem scan). The previous reviewers self-terminated on return, so ledger hygiene before the next spawn is all that is needed: set returned rows to done, and TaskStop any genuinely-running leftover before marking it aborted. Re-spawn fresh nameless tasks and record their new agentIds in the ledger (stamp epoch = max(disk epoch, 0)+1, re-derived from the on-disk ledger — never an in-context counter; this fresh follow-up team → epoch 2 in the normal sequence — and the round-1 witnessNonce on every row in the at-spawn recording window, per the protocol Spawn section).

Document update rules

Refer to ${CLAUDE_SKILL_DIR}/references/02-review-report-template.md "Document Update Rules (Step 6)" section for the 개정 이력 / 철회된 항목 update conventions.

Repeat until user is satisfied.

Before Step 6 begins (after Step 5 documentation is complete), Read ${CLAUDE_SKILL_DIR}/../_common/team-cleanup.md and follow it in full — its four bullets are the process side (returned tasks already self-terminated; TaskStop only a wedged one), ledger hygiene, and removal of the team's witness directory. Do not summarize it here: the summary that used to sit on this line carried only the first two and the witness directory was never removed. If additional reviewer clarification is needed during Step 5 document writing, do so first by resuming that reviewer's last dispatch by its agentId — a re-request inside that dispatch's key, not a new round. When Step 6 triggers re-spawn, apply ledger hygiene before the next spawn.


Constraints

  • No code modifications. Review only.
  • Inter-agent communication must be in English. User-facing communication and saved documents in Korean.
  • Nameless background sub-agents required: reviewers MUST be spawned as nameless Agent background tasks (subagent_type:"claude", run_in_background:true, no name) and driven through lead-mediated cross-review through the witnesses on disk — each round, cross-review and convergence included, is a fresh dispatch of the role that reads its own past witnesses and its peers' by path, and a re-request inside one key resumes the same agentId. A dispatch that reads no peer witness breaks cross-review. There is no TeamCreate/named-teammate model; the cross-review through witnesses is what makes this a team.
  • Deferred tool loading: Before using AskUserQuestion, SendMessage, or TaskStop, you MUST first load them via ToolSearch (Agent is built-in and needs no loading). Run ToolSearch with query "select:AskUserQuestion,mcp__cc-cmds__question_form", "select:SendMessage", and "select:TaskStop" to load each tool. These are deferred tools and will NOT work unless loaded first. AskUserQuestion MUST be loaded before Step 1 (scope confirmation with user).
  • Source files are read once per review stage. Within one stage, a source file already read is not read again. A turn yield is not an invalidation point — nothing about the file changed because the model stopped and resumed, and treating a yield as one is what turns a long review into repeated reads of the same unchanged bytes. There are exactly three invalidation points: this session wrote to that path with Edit/Write; a git operation moved HEAD or the working tree (checkout, rebase, merge, stash, pull); or a new stage was entered. Four things this cache never covers, and each for its own reason — the run ledger, whose contract deliberately produces an under-claim that a stale read inverts into an over-claim; witness files, where there is no invalidation event the lead can observe at all, so the cache has nothing to key on; the reviewer output_file, which a cached read reports as byte-stable and therefore as WEDGED when it is being written normally; and the gate snapshot, whose whole purpose is to be re-derived. Those four are re-read every time they are consulted.
  • Codebase grounding required: Reviewers must ground findings in the source — use grep/Glob/Read to locate definitions, callers, and related modules independently. The lead surveys the source tree in Step 2 but does not proxy searches; each reviewer searches its own scope. One second grounding surface exists: when a design document was supplied (context-package item 17), a design-conformance finding grounds in that document and in the source, because its claim is a mismatch between the two. Every other tag stays source-only, and no finding is ever grounded in the design document alone — a document saying something the code does not do is a finding about the code, and the code location is what makes it actionable.
  • PR comment dedup required: When existing PR comments/reviews exist, always provide them as context to reviewers. Filter or flag findings that duplicate existing comments.
  • Fix suggestion inclusion: Include fix direction when clear. This is judgment-based, not mandatory for all issues — decide based on issue type and complexity.
  • CI failure routing: When CI has failed checks, mention in Step 1c. Analyze failure type (test/lint/build/type check) and add "CI failure priority check area: [failed check name and related files]" as a separate item in the relevant reviewer's context package.

Task: $ARGUMENTS

04 同仓库更多 Skills