Skip to content
cccskills
FreePublished on GitHubEnglish overview

Prek

Run `prek`, Carbon's pre-submit style and lint checker, across all files or selected changes. The skill explains its Jujutsu helper, how to handle hooks that rewrite files, and a `gpkg` workaround for dependency or security policy errors.

OriginalShow the original description

Instructions for running prek, the Carbon pre-submit/style/lint checker, that *MUST* be run before submitting an change.

carbon-language/carbon-lang33,929 stars(GitHub 33,929 + cccskills 0)

Run score Not tested

See how to install

Good for

  • Checking all files before submitting changes
  • Checking only selected files
  • Running checks in a Jujutsu workspace
  • Reviewing formatter changes after a failed run

Overview

What it does

This skill explains how to run prek, Carbon's pre-submit style and lint checker. It shows how to check all files or specify a list of files. In a Jujutsu workspace, direct use of prek fails because it expects a standard Git repository structure; the helper script ./scripts/jj_prek.sh checks changed files instead. Some hooks, including clang-format and rumdl, rewrite files and may still cause prek to exit with a failure code. The skill explains how to review those edits and run the check again. It also describes a gpkg command prefix for dependency resolution or security policy errors in restricted environments.

When it helps

Use it before submitting changes to Carbon to check style and lint. It is also useful when working in Jujutsu or when a check has rewritten files and reported a failure.

Example requests

  • “Run prek on only the files I changed.”
  • “Run the pre-submit checks in this Jujutsu workspace.”
  • “Review the files formatted by the check, then run it again.”

Notes

The skill says to run prek before submitting changes. The Jujutsu helper always compares against trunk, so it may include files from an underlying change based on another bookmark. In restricted environments with dependency or security policy errors, the documented workaround is to prefix the command with gpkg.

This overview was written by AI (OpenAI Codex) from the public SKILL.md. Check the original below for the exact behavior.

Document check

AI checked the SKILL.md for operations that need care and for setup requirements. The score comes only from actually running the skill (hands-on test).

SafetyAre sending data, deleting files, and running commands disclosed?
AGoodIt instructs users to review hook changes and rerun the checker.
Easy setupDoes it need few tools or API keys, and are they documented?
BPartly lackingIt requires `prek` and may require `gpkg`, but gives no installation steps.

Not counted in the score. Rated by AI (OpenAI Codex) as of Oct 26, 2026. Treat it as a guide and read the original before installing.

Disagree? Request a re-evaluation

Tell us which point is wrong and why. No login needed. We will check it against the SKILL.md, redo the evaluation, and show the result here.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

Files included (1)

  • SKILL.md1.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Prek

<!-- 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 -->

prek is the Carbon pre-submit, style, and lint checker. Running it is mandatory before submitting any changes.

Running prek

To run prek on all files:

prek run -a

To validate a specific list of files:

prek run --files <files>

Running prek in a Jujutsu (jj) workspace

If you are working in a Jujutsu workspace, running prek directly will fail because it expects a standard Git repository structure. Instead, use the helper script:

./scripts/jj_prek.sh

This script runs prek on all files that have changed between trunk and your current Jujutsu @ change.

Note that the script always compares against trunk. If your change is based on another bookmark rather than on trunk, the script also checks the files changed by that underlying change, so a reported failure may not be in your own work.

Hooks that rewrite files

Some hooks, notably clang-format and rumdl, fix problems in place rather than only reporting them. When they do, prek reports a failure and exits non-zero even though the tree is now correct.

Re-run prek after any failure that modified files, and treat the second, clean run as the result. Review what it changed: a reflow is expected, but a content change may not be what you intended.

Prek dependency errors

[!TIP] If prek fails with an error about resolving dependencies or security policy, you may be running in a restricted environment where the special-purpose gpkg tool is required. Prefix the command with gpkg, for example: gpkg prek run -a or gpkg ./scripts/jj_prek.sh.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use this skill to read GitHub issue details and comments from the command line with `gh`. It covers issues referenced by number or URL, including issues in other repositories, and keeps access read-only so issue state is not changed.

  • Reading an issue and its full comment history
  • Opening an issue referenced by URL
  • Viewing an issue from another repository
carbon-language/carbon-lang33.9KUpdated Oct 26, 2026

Agent tools

FreeSummary

Use this skill to guide an AI assistant working in the Carbon repository on viewing, searching, and editing files with specialized environment tools. It also sets rules for temporary files and when custom programs may be used.

  • Choosing approved tools to view, search, or edit files
  • Checking where temporary analysis and test files belong
  • Deciding when a custom transformation program is allowed
carbon-language/carbon-lang33.9KUpdated Oct 26, 2026

Bazel usage

FreeSummary

Follow the Carbon project's Bazel workflow through Bazelisk, a version-managing launcher. Learn commands for building targets, running tests and binaries, enabling AddressSanitizer, and refreshing cached state after system dependency changes.

  • Building a Carbon target
  • Running focused project tests
  • Launching a Bazel-built binary
carbon-language/carbon-lang33.9KUpdated Oct 26, 2026

Use this skill to implement builtin functions in the Carbon compiler, from registering a function name and checking its signature to evaluating constant calls and generating LLVM IR for runtime calls. It also covers prelude bindings and focused tests.

  • Registering a new Carbon builtin function
  • Adding compile-time evaluation behavior
  • Lowering runtime builtins to LLVM IR
carbon-language/carbon-lang33.9KUpdated Oct 26, 2026

Code style

FreeSummary

Apply Carbon toolchain conventions for formatting Bazel, C++, Carbon, Markdown, and Python files. The skill also covers clear comments and documentation, accurate names, design choices, and concise commit descriptions.

  • Formatting a changed source file
  • Writing or revising code comments
  • Choosing names that match their meaning
carbon-language/carbon-lang33.9KUpdated Oct 26, 2026

Diagnostics

FreeSummary

Use this skill to add or revise diagnostics in the Carbon toolchain. It explains how to register message kinds, format typed arguments, attach source labels and context, and verify that diagnostics follow the project’s wording and test coverage rules.

  • Adding an error or warning to the Carbon compiler
  • Attaching source locations and explanatory labels
  • Checking diagnostic wording and formatting conventions
carbon-language/carbon-lang33.9KUpdated Oct 26, 2026

See all skills by carbon-language

Report a problem with this skill