This adds recommendations for Gemini to help it understand the correct was to update or add new code. This section may be expanded in the future for other features. Bug: webrtc:465491622 Change-Id: Ic1c927aedd844e3ab8901ba1733e2d60533989e6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/434585 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Auto-Submit: Evan Shrubsole <eshr@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#46515}
2.5 KiB
2.5 KiB
WebRTC Development Assistant - Meta Prompt
This document contains Agentic RAG (Retrieval-Augmented Generation) guidance. Use it to find the most relevant files and concepts when working on the WebRTC codebase.
Core Principle: Consult, then Answer
You MUST NOT answer from your general knowledge alone. The WebRTC codebase is
vast and specific. Before answering any query, you must first consult the
relevant documents. A collection of canonical documentation has been
cached for you in the docs/ and g3doc/ directories.
Task-Oriented Guidance
Your primary function is to assist with development tasks. Use the following guide to determine which documents to consult.
Topic: Core Programming Patterns
C++ Namespaces
WebRTC types and functions live in the webrtc namespace. Do not use any old
namespaces that may be referenced in comments or earlier revisions of the code.
Modernization
- Use Strong Time Types: Prefer
webrtc::Timestampandwebrtc::TimeDeltaover raw arithmetic types for time values. See issue 42223979. - Avoid AutoThread: Do not use
AutoThread. In tests, usewebrtc::test::RunLoop. See issue 469327588. - Use std::optional instead of sentinel values: Use
std::optionalrather than sentinel values like -1 or 0.
Topic: Modifying BUILD.gn files
- For best practices and style in
BUILD.gnfiles:- Run
gn formatto ensure consistent style.
- Run
Topic: Debugging
- For a "header file not found" error:
- Consult the "Debugging Workflow for 'Header Not Found'":
- Verify
deps: Check theBUILD.gnfile of the failing target. Is the dependency providing the header listed indeps? - Verify
#include: Is the path in the#includestatement correct? - Regenerate build files: Suggest running
gn gen <out_dir>. - Confirm GN sees the dependency: Suggest
gn desc <out_dir> //failing:target deps. - Check for issues: Suggest running
gn check <out_dir> //failing:target.
- Verify
- Consult the "Debugging Workflow for 'Header Not Found'":
- For a linker error ("undefined symbol"):
- Suggest checking that the target providing the symbol is in
deps(usegn desc).
- Suggest checking that the target providing the symbol is in
- For a visibility error:
- Suggest adding the depending target to the
visibilitylist in the dependency'sBUILD.gnfile.
- Suggest adding the depending target to the