gn-deps-debugging
O que ela faz
Esta skill ajuda sua IA a encontrar e corrigir erros de dependência no build GN. Ela é indicada para desenvolvedores que veem erros sobre arquivos de include ou verificações de dependência ao compilar um projeto grande.
Quando usar
- ✓Quando seu build falha com um erro de dependência do GN ou de visibilidade de include.
- ✓Quando uma verificação gn informa que um arquivo de cabeçalho não é permitido a partir de um alvo.
- ✓Quando você precisa corrigir uma dependência circular entre alvos de build.
Link da skill
https://github.com/chromium/chromium/blob/main/agents/skills/gn-deps-debugging/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Meu build diz que um cabeçalho não está visível no meu alvo. Você pode encontrar a dependência certa para corrigir isso?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A IA lê o erro exato, encontra o alvo de build que possui o arquivo e o que possui o cabeçalho, e adiciona a menor dependência correta. Ela mantém as regras de cada plataforma.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
O que é o GN?
O GN é uma ferramenta de build usada por projetos grandes de software para decidir como os arquivos de código são compilados e ligados entre si.
Por que não adicionar uma dependência grande para fazer o erro sumir?
Uma dependência ampla pode esconder o problema real e deixar o build mais lento. Esta skill pede a correção mais estreita.
Quando eu não devo usar esta skill?
Use-a para erros de dependência e de include. Para falhas de compilação, de linkagem ou de execução, outra abordagem é melhor.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 25 mil
- Posição no ranking
- #10058
- Licença
- BSD-3-Clause
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
fuzzing
25 milAjuda seu agente a escrever testes de fuzzing que alimentam o código com muitas entradas aleatórias para encontrar falhas e bugs em código C++.
java-memory-leaks
25 milAjuda seu agente a encontrar e corrigir vazamentos de memória em Java em apps Android, lendo relatórios de vazamento do LeakCanary.
jni-type-conversion
25 milAjuda seu agente a substituir o código manual de conversão de Java para C++ por anotações @JniType mais simples em código Android.
loadline
25 milAjuda seu agente a rodar benchmarks do LoadLine que medem a velocidade de carregamento de páginas web no Android e no Chrome para desktop.
Skills parecidas
openclaw-update
394 milAjuda seu agente a atualizar um OpenClaw Gateway existente, escolhendo o método que combina com a instalação e mantendo sua sessão funcionando.
diagnose-gateway
394 milAjuda seu agente a descobrir por que seu OpenClaw Gateway está falhando, verificando configurações, canais e portas sem alterar nada.
crabbox-apps
394 milAjuda seu agente a abrir e executar um app em uma máquina temporária na nuvem e depois mostrar a visualização dele no painel lateral do seu chat.