본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

Code style

Carbon 툴체인의 Bazel, C++, Carbon, Markdown, Python 파일 서식 기준을 안내합니다. 주석, 문서, 이름, 설계 원칙과 변경 내용을 설명하는 커밋 메시지 작성법도 다룹니다.

원문원문 설명 보기

Instructions for code formatting and style guidelines in the Carbon toolchain.

carbon-language/carbon-lang스타 33,929(GitHub 33,929 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Carbon 코드와 관련 파일 서식 정리
  • 주석과 문서 검토
  • 이름이 실제 의미에 맞는지 확인
  • 변경 내용에 맞는 커밋 설명 작성

한국어 소개

할 수 있는 일

이 스킬은 Carbon 툴체인 코드와 문서를 작성할 때 따르는 기준을 설명합니다. Bazel, C++, Markdown, Python 파일별로 사용할 서식 도구와 검사 방법을 안내합니다. Carbon의 format 명령은 현재 제대로 작동하지 않으므로 기존 Carbon 코드와 C++ 스타일을 참고하도록 안내합니다. 주석은 현재 코드의 동작이나 이유를 설명하고, 문서 설명은 핵심을 먼저 말하며, 이름은 실제 역할과 의미에 맞게 정하는 원칙도 포함합니다. 코드 변경과 문서를 일치시키고, 출력 결과를 보기 좋게 만들기 위해 데이터 모델을 왜곡하지 않으며, 커밋 설명에 변경 결과를 구체적으로 쓰는 방법도 다룹니다.

이럴 때 유용합니다

Carbon 툴체인 코드를 새로 작성하거나 기존 코드를 수정할 때 유용합니다. 주석, 이름, 문서, 커밋 설명이 프로젝트 기준에 맞는지 검토할 때도 참고할 수 있습니다.

사용 예시

  • “이 C++ 파일에는 어떤 서식 도구를 사용해야 하나요?”
  • “이 주석과 변수 이름이 기준에 맞는지 확인해 주세요.”
  • “변경 내용을 잘 설명하도록 커밋 설명을 다듬어 주세요.”

주의 사항

파일 종류마다 도구가 다릅니다. C++은 Carbon C++ Project Style Guide, Markdown은 Google developer documentation style guide, Python은 PEP 8을 따릅니다. Carbon용 format 명령은 현재 잘 작동하지 않는다고 안내되어 있습니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호서식 정리와 검토가 중심이며 외부 전송이나 삭제 작업은 없습니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족`pre-commit`과 서식 도구를 사용하지만 설치 절차는 안내하지 않습니다.

점수에는 넣지 않았습니다. 2026년 10월 26일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md6.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Code style

<!-- Part of the Carbon Language project, under the Apache License v2.0 with LLVM Exceptions. See /LICENSE for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -->

License

Formatting

  • Bazel: Use pre-commit run buildifier --files <file.bzl> to format Bazel files.
  • C++: Use pre-commit run clang-format --files <file.cpp> to format C++ files.
  • Carbon: The toolchain's format command doesn't work well right now. Instead, try to format Carbon code based on other Carbon files and the C++ style.
  • Markdown: Use pre-commit run prettier --files <file.md> to format markdown files.
  • Python: Use pre-commit run black --files <file.py> to format Python files.

Comments

  • Describe the code that is there. A comment should explain what the current code does or why it is the way it is, not narrate what the code used to be. Do not add a comment to justify a deletion or explain that something is no longer necessary; a reader of the new code has no idea what is being contrasted against, and the comment rots as soon as the old shape is forgotten. Put that reasoning in the commit message instead.
  • Do not introduce a local variable just to host a comment. If a call argument reads clearly on its own, inline it rather than naming it so that a comment has somewhere to attach.
  • Lead with a plain summary. Start a doc comment with a direct statement of what the function does or returns, such as "Returns true if the InstKind is a singleton." Put nuance in a following sentence rather than qualifying the summary into something harder to read.
  • Re-read a comment before updating it. When a symbol is renamed or changes meaning, a comment that mentions it is not automatically stale. Work out what the comment actually asserts first: it may be describing what the code uses, which is still true, and rewriting it loses information.

Documentation

This covers standalone prose: /docs, README.md files, and the skill files under .agents/skills.

  • Be true of the tree it lands in. Documentation shipping in the same commit as the code it describes should name that code freely. Documentation that lands separately must not: a reader who greps for an identifier from an unlanded change finds nothing, and a claim that only holds after that change is false until it lands. This is easy to get wrong when writing up a lesson while the change that taught it is still in flight.
  • Use placeholders for illustrations. When an example only needs to show a shape, name it Foo rather than reaching for a real symbol. Save real identifiers for documenting that identifier, where going stale is at least detectable.
  • Make each point stand alone. A reader has none of the discussion that produced it. State the rule, and enough of the reason to apply it, without assuming knowledge of the change that motivated it.

Naming

  • A name is a claim, so keep it true. When a change invalidates the invariant a name describes, rename it in the same change. A factory called MakeSingletonFooId has to be renamed once Foo is no longer a singleton, even though nothing forces you to.
  • Types in a signature are part of the claim. A function returning the id of a namespace should return InstId, not TypeInstId, because a namespace is not a type. Do not let a convenient wider or narrower id type imply something false.
  • Delete a predicate whose name stops distinguishing anything. If a change widens a test so that it no longer says what its name implies, remove it and let callers use the underlying test, rather than keeping a wrapper that sounds meaningful. What callers actually want is often the inverse, and is worth adding under its own name.
  • Name a variable for its role, not its representation. If the role a value plays is unchanged, keep its name even when a change means it is now held or spelled differently.

Commit descriptions

  • Say what the change is, not how you made it. Describe the resulting code. Only describe process when the process is more interesting than the change, as with a large mechanical transformation.
  • Do not narrate your own work. Statements like "each such site was audited" or "we investigated every caller" describe effort, not the change.
  • Omit routine mechanical steps. Do not mention running the testdata autoupdater or the formatter. Every change is expected to include those.
  • Do not enumerate each edit. Describe the change as a whole rather than listing every function or file touched; the diff already lists them.
  • Use the project's terms precisely. Reach for the term of art the codebase uses. Calling something a "type alias" or a "namespace" when it is a named scope misleads, and is worse than a vaguer but accurate word.
  • Scope claims to what changed. Say the specific thing that is now true, rather than a broader statement that happens to contain it.

Design

  • Do not distort the data model to improve output. If printed or golden output is undesirable, change the printer, not the data structures that feed it.

Style Guides

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Accessing GitHub issues

무료요약 있음

명령줄의 `gh`로 GitHub 이슈 본문과 댓글을 읽기 전용으로 확인하는 방법을 안내합니다. 번호나 URL로 이슈를 찾고 다른 저장소를 지정하는 방법, 댓글이 많은 경우 JSON과 `jq`로 내용을 추출하는 방법을 다룹니다.

  • 이슈 본문과 댓글 읽기
  • URL로 이슈 내용 확인
  • 다른 저장소의 이슈 조회
carbon-language/carbon-lang3.4만2026년 10월 26일 업데이트

Agent tools

무료요약 있음

Carbon 저장소에서 일하는 AI 도우미가 전용 환경 도구로 파일을 읽고 검색하고 편집하는 규칙을 안내합니다. 임시 파일을 둘 위치와 삭제 시점, 사용자 지정 프로그램을 허용하는 경우도 설명합니다.

  • 정해진 도구로 Carbon 파일 검색
  • 파일 변경에 맞는 전용 도구 선택
  • 임시 파일 위치와 삭제 규칙 확인
carbon-language/carbon-lang3.4만2026년 10월 26일 업데이트

Bazel usage

무료요약 있음

Carbon 프로젝트에서 Bazelisk로 빌드, 테스트, 실행하는 기본 절차를 안내합니다. 대상을 지정한 검증, ASan 활성화, 시스템 의존성 변경 후 캐시 재생성도 다룹니다.

  • Carbon 코드 빌드
  • 변경 사항과 관련된 테스트 실행
  • Bazel로 빌드한 프로그램 실행
carbon-language/carbon-lang3.4만2026년 10월 26일 업데이트

Builtin functions

무료요약 있음

Carbon 컴파일러에 내장 함수를 추가하는 절차를 안내합니다. 함수 등록과 시그니처 검증부터 상수 평가, 런타임 호출의 LLVM IR 생성, Prelude 연결, 최소 Prelude를 이용한 개별 테스트까지 다룹니다.

  • 내장 함수 등록
  • 상수 평가 구현
  • LLVM IR 생성 추가
carbon-language/carbon-lang3.4만2026년 10월 26일 업데이트

Diagnostics

무료요약 있음

Carbon 도구 체인에서 오류와 경고 진단을 추가하거나 수정하는 방법을 안내합니다. 진단 종류 등록, 형식이 지정된 인수로 메시지 구성, 소스 위치에 라벨과 문맥 연결, 문구 규칙 및 테스트 범위 확인을 다룹니다.

  • 진단 메시지 추가
  • 소스 위치에 라벨 지정
  • 진단 문구 통일
carbon-language/carbon-lang3.4만2026년 10월 26일 업데이트

GitHub CLI usage

무료요약 있음

`gh`로 GitHub 이슈, 풀 리퀘스트, 저장소와 코드를 읽기 전용으로 검색하고 확인하는 방법을 안내합니다. REST·GraphQL API 조회, 페이지별 결과 수집, 출력 필터링과 형식 지정도 다룹니다.

  • 이슈의 내용과 상태 확인
  • 풀 리퀘스트의 변경 사항과 검사 상태 확인
  • GitHub 코드나 저장소 검색
carbon-language/carbon-lang3.4만2026년 10월 26일 업데이트

carbon-language의 스킬 모두 보기

이 스킬의 문제 신고