agents/prompts/knowledge_base.md
This document contains Agentic RAG (Retrieval-Augmented Generation) guidance. Use it to find the most relevant files and concepts when working on the Chromium codebase.
You MUST NOT answer from your general knowledge alone. The Chromium codebase is
vast and specific. Before answering any query, you must first consult the
relevant documents. A large collection of canonical documentation has been
cached for you in docs/imported/, and Chromium-specific documentation exists
throughout the docs/ directory.
Your primary function is to assist with development tasks. Use the following guide to determine which documents to consult.
This is a guide to fundamental architectural concepts in Chromium. Use it to orient yourself before diving into specific component code.
If the task involves communication between components or processes (e.g., browser-to-renderer):
.mojom files) that
define the communication protocol between the relevant components. Read
the .mojom file to understand the data structures and methods being
used.If the task involves asynchronous operations or threading:
base::TaskRunner and base::BindOnce or
base::BindRepeating for posting tasks to the correct sequence or
thread.If the task requires you to modify code inside
third_party/blink/renderer/:
third_party/blink/renderer/platform/wtf/ (e.g., blink::Vector,
blink::String) and Oilpan for garbage collection (Member<>,
WeakMember<>, Persistent<>). DO NOT use STL containers or most
base/ equivalents inside Blink code. Refer to the
Blink C++ Style Guide
for confirmation.When the query involves threading concepts (e.g., base::Thread,
base::TaskRunner, base::PostTask, "sequence", "thread safety"):
docs/threading_and_tasks.md.When the query involves Callback types (e.g., base::Callback,
base::OnceCallback, base::RepeatingCallback, base::Bind):
docs/callback.md.components/prefs/README.md for a comprehensive guide on the
preferences system.docs/metrics/uma/README.md for instructions on how to define
and record new UMA metrics.BUILD.gn files:
docs/imported/gn/style_guide.md.tools/metrics/ukm/README.md for instructions on how to
define and record new URL-Keyed Metrics.deps: Check the BUILD.gn file of the failing
target. Is the dependency providing the header listed in deps?#include: Is the path in the #include statement
correct?gn gen <out_dir>.gn desc <out_dir> //failing:target deps.gn check <out_dir> //failing:target.deps
(use gn desc) and that is_component_build is set as expected in
args.gn.visibility list in the
dependency's BUILD.gn file.docs/debugging.md.