agents/rules/git-cl.md
These rules enforce V8-specific workflow mandates and guardrails when working
with Chromium's git cl tool.
For general Chromium Gerrit CL workflows, commands (such as creating commits,
running try jobs, polling presubmit status, and commenting), and options, refer
to the git-cl-helper skill
(SKILL.md).
git cl format before creating a commit or uploading a
CL (as detailed in the git-cl-helper skill). Note that upload_cl.sh
enforces formatting compliance and will abort if uncommitted formatting diffs
exist.agents/scripts/upload_cl.sh <new|cur> <check|nocheck> [patchset_message] [additional flags...].
This script enforces formatting checks, performs non-interactive uploads, runs
release test checks, and validates commit description line lengths.
agents/scripts/upload_cl.sh new check.agents/scripts/upload_cl.sh cur check "Brief patchset description".--commit-description="..."
directly to upload_cl.sh so the patchset and description update atomically
in one step:
agents/scripts/upload_cl.sh cur check "Patchset title" --commit-description="New cohesive description content"agents/scripts/edit_cl_description.sh "New cohesive description content"
⚠️ CRITICAL SAFETY CONSTRAINT: Before passing --commit-description or
running edit_cl_description.sh, you must first inspect the live remote
description on Gerrit (using either git cl desc -d or the
gerrit_get_change_details MCP tool) to verify whether the user has
manually edited it. If manual user edits or refinements are detected, you
must carefully evaluate them: preserve any human-authored background
context, rationale, or formatting, while surgically updating only the
outdated technical statements resulting from the new patchset.upload_cl.sh automatically enforces this limit.git diff is not empty before uploading.git cl upload or
upload_cl.sh, you MUST verify that the diff contains a valid, working
regression test (typically under test/mjsunit/ or its component-specific
subfolders like compiler/, turboshaft/, maglev/, etc.). Uploading
code-modifying CLs without an accompanying regression test is strictly
forbidden (unless explicitly waived by the user or if it's a
process-only/documentation change).release or optdebug
mode, avoiding debug mode due to performance) before uploading.agents/scripts/create_worktree.sh <task_id> to create
an isolated workspace for each independent task or CL. Worktrees are created
at REPOSITORY_ROOT/worktrees/. NEVER upload a CL from a workspace containing
unrelated modifications. Always verify that the diff relative to upstream
contains ONLY the intended changes before uploading.git cl upload detects external
changes on Gerrit and prompts to fetch them or override, the agent MUST stop
and ask the user for guidance, unless explicitly instructed otherwise.v8-workflow skill (e.g., branch vs. worktree).git cl issue 0.git cl status to verify
the Issue Description matches your task.git show --stat) or
run git diff --name-only origin/main..HEAD to ensure no unrelated files are
included. If you see commits or files that are not part of your specific task,
reset your branch to origin/main and cherry-pick only your intended commits
instead of uploading.git cl status before proceeding, and consult the user if it seems
mismatched..cc, .h, .js, .py) are
modified using git diff --name-only origin/main.git cl status immediately after
uploading to verify branch alignment and quickly check high-level issue
status.git-cl-helper skill:
vpython3 agents/shared/skills/git-cl-helper/scripts/git_cl_helper.py poll --gerrit_url <URL>
If you identify failing checks or try jobs, proactively suggest addressing
these alerts to the user.chromium-review.googlesource.com link to the
user.git cl issue).git cl issue <cl_number>.git-cl-helper skill for fetching and replying to comments with
git cl comments.When working on a chain of dependent changes (stacked CLs):
git branch --set-upstream-to=parent-branch). The base branch
at the bottom of the stack tracks origin/main.Change-Id.
Make sure to remove Change-Id from commit messages of new CLs.git cl patch <CL_NUMBER> to fetch and checkout the latest patchset of a
CL.git cl land to land the CL after approval.git cl desc -d to view the CL description.agents/scripts/edit_cl_description.sh "New description" (or -f <file>)
to non-interactively update a CL description after validating line lengths and
code formatting.