본문으로 건너뛰기
Skillpedia
테스트260k · #622

requesting-code-review

하는 일

이 스킬은 AI가 코드 변경을 커밋하거나 푸시하기 전에 검증하도록 합니다. 작업이 프로젝트에 들어가기 전에 두 번째 시선과 자동 점검을 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Git 저장소에서 코드 변경을 커밋, 푸시, 배포하려고 할 때.
  • ✓여러 파일에 걸친 기능이나 버그 수정을 끝내고 검증하고 싶을 때.
  • ✓AI가 변경 사항에서 하드코딩된 비밀 정보나 품질 문제를 확인하기를 원할 때.

스킬 링크

https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/requesting-code-review/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/requesting-code-review/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“커밋하기 전에 스테이징된 변경 사항에 보안 문제와 품질 문제가 있는지 확인하고, 간단한 것은 고쳐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 스테이징된 diff를 읽고, 추가된 줄에서 하드코딩된 비밀 정보 같은 위험 패턴을 검사하며, 품질 게이트를 실행한 뒤 새로운 검토 에이전트에게 작업을 확인하게 합니다. 발견된 문제는 고칠 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Pre-Commit Code Verification

Automated verification pipeline before code lands. Static scans, baseline-aware quality gates, an independent reviewer subagent, and an auto-fix loop.

Core principle: No agent should verify its own work. Fresh context finds what you miss.

When to Use

  • After implementing a feature or bug fix, before git commit or git push
  • When user says "commit", "push", "ship", "done", "verify", or "review before merge"
  • After completing a task with 2+ file edits in a git repo
  • After each task in subagent-driven-development (the two-stage review)

Skip for: documentation-only changes, pure config tweaks, or when user says "skip verification".

This skill vs github: This skill verifies YOUR changes before committing. github reviews OTHER people's PRs on GitHub with inline comments.

Step 1 — Get the diff

git diff --cached

If empty, try git diff then git diff HEAD~1 HEAD.

If git diff --cached is empty but git diff shows changes, tell the user to git add <files> first. If still empty, run git status — nothing to verify.

If the diff exceeds 15,000 characters, split by file:

git diff --name-only
git diff HEAD -- specific_file.py

Step 2 — Static security scan

Scan added lines only. Any match is a security concern fed into Step 5.

# Hardcoded secrets
git diff --cached | grep "^+" | grep -iE "(api_key|secret|password|token|passwd)\s*=\s*['\"][^'\"]{6,}['\"]"

# Shell injection
git diff --cached | grep "^+" | grep -E "os\.system\(|subprocess.*shell=True"

# Dangerous eval/exec
git diff --cached | grep "^+" | grep -E "\beval\(|\bexec\("

# Unsafe deserialization
git diff --cached | grep "^+" | grep -E "pickle\.loads?\("

# SQL injection (string formatting in queries)
git diff --cached | grep "^+" | grep -E "execute\(f\"|\.format\(.*SELECT|\.format\(.*INSERT"

Step 3 — Baseline tests and linting

Detect the project language and run the appropriate tools. Capture the failure count BEFORE your changes as baseline_failures (stash changes, run, pop). Only NEW failures introduced by your changes block the commit.

Test frameworks (auto-detect by project files):

# Python (pytest)
python -m pytest --tb=no -q 2>&1 | tail -5

# Node (npm test)
npm test -- --passWithNoTests 2>&1 | tail -5

# Rust
cargo test 2>&1 | tail -5

# Go
go test ./... 2>&1 | tail -5

Linting and type checking (run only if installed):

# Python
which ruff && ruff check . 2>&1 | tail -10
which mypy && mypy . --ignore-missing-imports 2>&1 | tail -10

# Node
which npx && npx eslint . 2>&1 | tail -10
which npx && npx tsc --noEmit 2>&1 | tail -10

# Rust
cargo clippy -- -D warnings 2>&1 | tail -10

# Go
which go && go vet ./... 2>&1 | tail -10

Baseline comparison: If baseline was clean and your changes introduce failures, that's a regression. If baseline already had failures, only count NEW ones.

Step 4 — Self-review checklist

Quick scan before dispatching the reviewer:

  • No hardcoded secrets, API keys, or credentials
  • Input validation on user-provided data
  • SQL queries use parameterized statements
  • File operations validate paths (no traversal)
  • External calls have error handling (try/catch)
  • No debug print/console.log left behind
  • No commented-out code
  • New code has tests (if test suite exists)

Step 5 — Independent reviewer subagent

Interactive sessions only. In a one-shot run (hermes chat -q, --oneshot, a benchmark harness) there is no one to hand the verdict to and a fresh subagent re-pays the whole system prompt plus a repo re-read: skip Steps 5 and 7, apply the Step 4 checklist to the diff yourself, run the tests, and go to Step 8.

Call delegate_task directly — it is NOT available inside execute_code or scripts.

The reviewer gets ONLY the diff and static scan results. No shared context with the implementer. Fail-closed: unparseable response = fail.

delegate_task(
    goal="""You are an independent code reviewer. You have no context about how
these changes were made. Review the git diff and return ONLY valid JSON.

FAIL-CLOSED RULES:
- security_concerns non-empty -> passed must be false
- logic_errors non-empty -> passed must be false
- Cannot parse diff -> passed must be false
- Only set passed=true when BOTH lists are empty

SECURITY (auto-FAIL): hardcoded secrets, backdoors, data exfiltration,
shell injection, SQL injection, path traversal, eval(
자주 묻는 질문

언제 건너뛸 수 있나요?

스킬에 따르면 문서만 바꾼 경우, 간단한 설정 수정, 또는 건너뛰라고 요청한 경우에는 건너뛸 수 있습니다.

왜 별도의 검토자를 쓰나요?

스킬은 어떤 에이전트도 자기 작업을 스스로 검증하지 않아야 한다고 말합니다. 새로운 맥락이 작성자가 놓친 문제를 찾아냅니다.

다른 사람의 풀 리퀘스트도 검토하나요?

아니요. 스킬에 따르면 다른 사람의 풀 리퀘스트 검토는 github 스킬이 담당합니다.

상세 정보

작성자의 원본 설명

Pre-commit review: security scan, quality gates, auto-fix.

repo: NousResearch/hermes-agent

인기도

GitHub 스타
260k
순위
#622
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬