명령줄의 `gh`로 GitHub 이슈 본문과 댓글을 읽기 전용으로 확인하는 방법을 안내합니다. 번호나 URL로 이슈를 찾고 다른 저장소를 지정하는 방법, 댓글이 많은 경우 JSON과 `jq`로 내용을 추출하는 방법을 다룹니다.
- 이슈 본문과 댓글 읽기
- URL로 이슈 내용 확인
- 다른 저장소의 이슈 조회
Carbon 컴파일러 도구 체인의 구조와 처리 단계를 살펴보고, 빌드·테스트·디버깅을 진행하는 방법을 안내합니다. 진단과 오류 처리, 구현 관례, 테스트 기대 출력 갱신 방법도 다룹니다.
Instructions for checking, building, debugging, and understanding the Carbon toolchain.
실행 점수 미검증
설치 방법 보기이 스킬은 Carbon 컴파일러 도구 체인의 구성과 처리 흐름을 설명합니다. 어휘 분석, 구문 분석, 의미 검사, LLVM IR로의 변환 단계가 각각 어떤 역할을 하는지 살펴보고, 관련 디렉터리와 정의 파일, 처리 핸들러의 위치를 안내합니다. 코드 변경 시 따를 구현 관례와 bazelisk를 이용한 빌드 및 테스트, 실패 원인 디버깅, 진단 메시지와 오류 처리 방식도 다룹니다. 컴파일러 동작을 바꾼 뒤 테스트 기대 출력을 전용 스크립트로 갱신하는 방법도 안내합니다.
Carbon 도구 체인을 처음 수정하거나 기존 구현의 위치와 처리 단계를 파악할 때 참고할 수 있습니다. 테스트 실행 방법을 확인하거나 충돌 원인을 조사할 때, LLVM API와 기존 데이터 구조를 활용하는 방침을 살펴볼 때도 유용합니다. 언어 서버와 내장 함수처럼 별도 스킬에서 다루는 영역도 구분해 줍니다.
Carbon 도구 체인을 위한 지침입니다. 빌드와 테스트에는 bazelisk를 사용하고, 테스트 출력 갱신에는 ./toolchain/autoupdate_testdata.py를 사용합니다. 언어 서버, 진단, 내장 함수 작업에는 각각 별도의 스킬을 참고하도록 안내합니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 26일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
toolchain/:
toolchain/docs for detailed
architecture design and patterns.
ValueStore, formatting
.def files, struct reflection) used throughout the implementation."int.convert_float").toolchain/language_server/ or utils/vscode/. Neither follows the
patterns described here..def files and expanded by way of macros.Handle<StateName> in parse/handle_*.cpp.HandleParseNode in check/handle_*.cpp.HandleInst in lower/handle_*.cpp.bazelisk test //...bazelisk test //toolchain/testing:file_testbazelisk test //toolchain/testing:file_test --test_arg=--file_tests=<path_to_carbon_file>bazelisk build //toolchain/...Carbon tests often use file_test (for example,
//toolchain/testing/file_test). For detailed guidelines on authoring tests,
including file splits, naming conventions (fail_, todo_), and generating
minimal output with SemIR dumps, please refer to the Toolchain tests skill.
If you change compiler behavior, you likely need to update expected test outputs. Do not manually edit thousands of lines of expected output. Use the script:
./toolchain/autoupdate_testdata.py
# Or for a specific file:
./toolchain/autoupdate_testdata.py toolchain/check/testdata/my_test.carbon
llvm::errs() << "debug info\n";.
std::cout (it may interfere with tool output).Print method or operator<<.inst.Print(llvm::errs())--sandbox_debug if needed,
but often running the binary directly from bazel-bin/ is easier for
debugging.ErrorOr<T>: Return ErrorOr<T> for fallible operations.
if (auto result = Function(); result) { Use(*result); }llvm::Expected<T>: Similar to ErrorOr, used when interfacing with
LLVM.When declaring and emitting errors, ensure semantic wording matches the exact context:
IntLiteral or FloatLiteral. For example, use
RealLiteralTooLargeForUnsizedInt instead of a diagnostic referencing an
"integer type".MaxIntWidth) to align message structures and parameter expectations.llvm::cast<T>(obj) (checked, asserts on failure).llvm::dyn_cast<T>(obj) (returns null on failure).llvm::isa<T>(obj) (boolean check).dynamic_cast and standard RTTI.Before implementing custom algorithms for mathematical, logical, or bitwise operations, inspect target LLVM ADT class APIs:
APInt, APFloat, or
APSInt) already offer native equivalents (for example, .pow(),
ilogb(), .changeSign(), convertFromAPInt()). Avoid duplicate, naive,
or inefficient custom loops.common/ and toolchain/base/ over LLVM ADTs. For example,
use Map instead of llvm::DenseMap.llvm::SmallVector, llvm::StringRef).StringRef is a view; be careful with lifetimes.explorer references: The explorer prototype has been moved.
Ignore references to it in proposals or old docs; focus on toolchain.autoupdate_testdata.py
can do it for you.std::string unnecessarily: Prefer llvm::StringRef for
arguments.clang-format).clangd diagnostics: In-editor diagnostics are only as
good as compile_commands.json. If it predates a newly added file, clangd
falls back to a default command and reports nonsense, such as missing
standard headers or "no member named None". Regenerate it with
./scripts/create_compdb.py, which only takes a few seconds.아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
명령줄의 `gh`로 GitHub 이슈 본문과 댓글을 읽기 전용으로 확인하는 방법을 안내합니다. 번호나 URL로 이슈를 찾고 다른 저장소를 지정하는 방법, 댓글이 많은 경우 JSON과 `jq`로 내용을 추출하는 방법을 다룹니다.
Carbon 저장소에서 일하는 AI 도우미가 전용 환경 도구로 파일을 읽고 검색하고 편집하는 규칙을 안내합니다. 임시 파일을 둘 위치와 삭제 시점, 사용자 지정 프로그램을 허용하는 경우도 설명합니다.
Carbon 프로젝트에서 Bazelisk로 빌드, 테스트, 실행하는 기본 절차를 안내합니다. 대상을 지정한 검증, ASan 활성화, 시스템 의존성 변경 후 캐시 재생성도 다룹니다.
Carbon 컴파일러에 내장 함수를 추가하는 절차를 안내합니다. 함수 등록과 시그니처 검증부터 상수 평가, 런타임 호출의 LLVM IR 생성, Prelude 연결, 최소 Prelude를 이용한 개별 테스트까지 다룹니다.
Carbon 툴체인의 Bazel, C++, Carbon, Markdown, Python 파일 서식 기준을 안내합니다. 주석, 문서, 이름, 설계 원칙과 변경 내용을 설명하는 커밋 메시지 작성법도 다룹니다.
Carbon 도구 체인에서 오류와 경고 진단을 추가하거나 수정하는 방법을 안내합니다. 진단 종류 등록, 형식이 지정된 인수로 메시지 구성, 소스 위치에 라벨과 문맥 연결, 문구 규칙 및 테스트 범위 확인을 다룹니다.