gn-deps-debugging
하는 일
이 스킬은 AI가 GN 빌드 의존성 오류를 찾아 고치도록 돕습니다. 큰 프로젝트를 빌드할 때 포함 파일이나 의존성 검사 오류를 보는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓빌드가 GN 의존성 또는 포함 가시성 오류로 실패할 때.
- ✓gn check가 특정 대상에서 헤더 파일을 허용하지 않는다고 보고할 때.
- ✓빌드 대상 사이의 순환 의존성을 고쳐야 할 때.
스킬 링크
https://github.com/chromium/chromium/blob/main/agents/skills/gn-deps-debugging/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“빌드에서 제 대상에 헤더가 보이지 않는다고 나옵니다. 올바른 의존성을 찾아 고쳐 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 정확한 오류를 읽고, 파일을 소유한 빌드 대상과 헤더를 소유한 대상을 찾은 뒤, 가장 작은 올바른 의존성을 추가합니다. 플랫폼 규칙은 그대로 지킵니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
GN Dependency Debugging
Fix Chromium GN dependency metadata, include visibility, and DEPS rule failures by correcting the dependency graph accurately, not by adding broad dependencies that only make errors disappear.
Core principles
- Read the exact error first. Identify the including source file, the included header, the failing target, and the diagnostic category before editing.
- Find both owning targets. Determine which GN target owns the including file and which GN target owns the included header.
- Prefer the narrowest dependency. Add the dependency to the smallest target that needs it, not a parent or aggregate target.
- Preserve platform conditions. If the failing include is in a
platform-specific file such as
*_win.cc, add the dependency inside the matching platform block such asif (is_win). - Use
depsfor implementation-only dependencies. If a symbol is used only in.ccfiles, keep the dependency private. - Use
public_depsonly for public API exposure. If a public header exposes a type from another target in its declarations or inline code, downstream consumers may need that dependency transitively. - Prefer forward declarations in headers. If a header only needs a pointer,
reference, or return type declaration, forward declare and move the include
to the
.ccfile when possible. - Do not paper over architecture issues. Circular dependencies usually indicate the need to split an interface target, move shared abstractions, or invert dependencies.
- Avoid
// nogncheck. Use it only for known GN limitations with conditional includes, and include the required bug reference if the local codebase already documents one.
Workflow
Capture the failing command and output.
- If the user provided a truncated error, ask for or rerun the relevant
gn checkor build command when an output directory and target are known. - Do not start a broad build just to reproduce unless the output directory and target are established.
- If the user provided a truncated error, ask for or rerun the relevant
Classify the failure.
- Read common-errors.md and map the diagnostic to one of the supported categories.
- Extract the including file, included header, and target names from the diagnostic.
Find the target that owns the including file.
- Inspect nearby
BUILD.gnfiles first. - Use GN queries when an output directory is known:
gn refs out/Default //path/to/file.cc --all - Prefer the most specific non-aggregate target that directly lists the file or owns the source set containing it.
- Check whether the file is platform-specific, such as
*_win.cc,*_mac.mm,*_linux.cc,*_android.cc, or*_ios.mm. Platform-specific files usually require platform-specific dependencies.
- Inspect nearby
Find the target that owns the included header.
- Search for the header in
BUILD.gnsources lists. - If several targets list it, prefer the public/interface target intended for consumers.
- Check whether the header belongs to a generated target, a
publicvariable, or a private implementation target.
- Search for the header in
Choose the correct fix.
- Read dependency-patterns.md for
depsvspublic_deps, forward declaration, DEPS, and cycle handling rules. - If the include appears only in
.cc, add a privatedepsentry. - If the include appears only in a platform-specific source file, add the
private
depsentry inside the matching platform condition, for exampleif (is_win). - If the include appears in a public header, first try to remove the include
using a forward declaration. If the header must expose the dependency, add
or promote the dependency to
public_deps. - If a
DEPSfile blocks the include, verify whether the dependency direction is allowed by the architecture before adding include rules. - If adding the dependency creates a cycle, stop and redesign the dependency
boundary instead of adding broader deps. When an output directory is known,
use
gn path <out_dir> //target_a //target_bto inspect the dependency chain that connects the targets.
- Read dependency-patterns.md for
Validate the narrow change.
- Run
git cl formatifBUILD.gnorDEPSfiles were edited. - Re-run the smallest relevant
gn checkor build command that reproduced the issue. - If
- Run
자주 묻는 질문
GN이란 무엇인가요?
큰 소프트웨어 프로젝트에서 코드 파일을 어떻게 컴파일하고 링크할지 정하는 빌드 도구입니다.
왜 큰 의존성을 추가해서 오류를 없애면 안 되나요?
넓은 의존성은 실제 문제를 가리고 빌드를 느리게 만들 수 있습니다. 이 스킬은 가장 좁은 수정을 요청합니다.
언제 이 스킬을 쓰지 말아야 하나요?
의존성과 포함 오류에 사용하세요. 컴파일, 링크, 실행 중 실패에는 다른 접근이 더 좋습니다.
상세 정보
작성자의 원본 설명
Diagnose Chromium GN dependency and include-visibility failures, including BUILD.gn deps/public_deps, DEPS include rules, private headers, and circular dependencies. Use for build or gn check dependency errors, not C++/link/runtime/test failures.
repo: chromium/chromium
인기도
- GitHub 스타
- 25k
- 순위
- #10058
- 라이선스
- BSD-3-Clause
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
fuzzing
25k에이전트가 많은 무작위 입력을 코드에 넣어 충돌과 버그를 찾는 퍼즈 테스트를 C++ 코드용으로 작성하도록 돕습니다.
java-memory-leaks
25k에이전트가 LeakCanary의 누수 보고서를 읽어 Android 앱의 Java 메모리 누수를 찾고 고치도록 돕습니다.
jni-type-conversion
25k에이전트가 Android 코드에서 수동으로 작성한 Java와 C++ 간 변환 코드를 더 간단한 @JniType 주석으로 바꾸도록 돕습니다.
loadline
25k에이전트가 Android와 데스크톱 Chrome에서 웹 페이지가 얼마나 빨리 로드되는지 측정하는 LoadLine 벤치마크를 실행하도록 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.