Agent SkillsChromeDevTools/devtools-frontend › devtools-version-control

devtools-version-control

GitHub

Chrome DevTools 专用版本控制技能,规范使用 gerrit 工作流。禁止使用标准 git 命令,强制使用 git new-branch 创建分支、git cl upload 提交 CL,支持 stacked changes 管理及发布状态查询。

.agents/skills/version-control/SKILL.md ChromeDevTools/devtools-frontend

Trigger Scenarios

在 Chrome DevTools 项目中创建新分支或提交代码变更 管理基于 Gerrit 的堆叠变更(stacked CLs) 查询 DevTools 代码的发布和回滚状态

Install

npx skills add ChromeDevTools/devtools-frontend --skill devtools-version-control -g -y
More Options

Non-standard path

npx skills add https://github.com/ChromeDevTools/devtools-frontend/tree/main/.agents/skills/version-control -g -y

Use without installing

npx skills use ChromeDevTools/devtools-frontend@devtools-version-control

指定 Agent (Claude Code)

npx skills add ChromeDevTools/devtools-frontend --skill devtools-version-control -a claude-code -g -y

安装 repo 全部 skill

npx skills add ChromeDevTools/devtools-frontend --all -g -y

预览 repo 内 skill

npx skills add ChromeDevTools/devtools-frontend --list

SKILL.md

Frontmatter
{
    "name": "devtools-version-control",
    "description": "Use when starting a new task, creating a branch, switching branches, managing branches, creating and uploading CLs, handling stacked changes, or checking release and roll status in the DevTools Gerrit-based workflow. ALWAYS use this instead of running standard git checkout\/switch commands for branch creation."
}

DevTools Version Control

[!IMPORTANT] DO NOT use standard Git commands like git checkout -b or git switch -c to create branches. In Chrome DevTools, you MUST always use git new-branch <branch-name> (or git new-branch --upstream_current <branch-name> for stacked CLs). Standard commands fail to configure the correct upstream tracking branch required by depot_tools and Gerrit.

Overview

Chrome DevTools uses Gerrit for code review. The standard workflow is one branch per Change List (CL) and one commit per branch. Instead of multiple commits, you amend your single commit locally.

Core Workflow

Creating a New CL

To start a new task, create a new branch from main:

git new-branch <branch-name>

Note: This automatically sets the upstream to origin/main.

Making Changes

  1. Make your changes.
  2. Stage them: git add <files>.
  3. Create the commit: git commit -m "Your message".

Updating a CL (Amending)

To update your CL after feedback or more work:

  1. Make more changes.
  2. Stage them: git add <files>.
  3. Amend the commit: git commit --amend.

Stacked CLs

If CL B depends on CL A:

  1. While on branch A, create branch B:
    git new-branch --upstream_current <branch-B>
    
  2. Develop on branch B.
  3. When uploading B, Gerrit will show the dependency on A.

Reparenting

If you need to change the base of a branch (e.g., move CL B to be based on main instead of CL A):

git reparent-branch main

Or to make it depend on another branch C:

git reparent-branch <branch-C>

Syncing with Upstream

To update all your branches with the latest changes from main and their respective upstreams:

git rebase-update

Initial upload

When a CL is ready, upload it with:

git cl upload -f -d --commit-description="<description>"
  • Always include -f (--force) so that git cl upload runs non-interactively without opening a text editor or prompting.
  • Use the same writing style as the current committer
  • Keep line length below 72
  • Add a "Bug: " or "Bug: None" trailer on a separate line.
  • Amend formatter/linter changes and fix linter issues.

Subsequent upload

To upload an updated CL:

git cl upload -f -d -t "<one sentence patch set description>"

Release and Roll Status

To check whether a DevTools commit (devtools/devtools-frontend) has rolled into chromium/src (Roll status) and what version or channel it is deployed to (Release status), look it up via the Chromium Dash API:

https://chromiumdash.appspot.com/fetch_commit?commit=<sha>

Quick Reference

Action Command
Create new CL from main git new-branch <name>
Create stacked CL git new-branch --upstream_current <name>
Update current CL git commit --amend
Upload to Gerrit git cl upload -f
Change branch parent git reparent-branch <new-parent>
Sync all branches git rebase-update
Check release & roll status Query https://chromiumdash.appspot.com/fetch_commit?commit=<sha>

Common Mistakes

  • Multiple commits on one branch: Gerrit expects one commit per CL. Always commit --amend.
  • Using git checkout -b: Does not set up tracking information correctly for depot_tools. Use git new-branch.
  • Manual rebasing of stacked branches: Can be complex. Use git rebase-update or git reparent-branch to let depot_tools handle the tracking updates.

Version History

  • 678d19c Current 2026-08-20 15:21

Same Skill Collection

.agents/skills/devtools-ci/SKILL.md
.agents/skills/devtools-imports/SKILL.md
.agents/skills/devtools-model-management/SKILL.md
.agents/skills/devtools-setting-migration/SKILL.md
.agents/skills/devtools-source-maps/SKILL.md
.agents/skills/devtools-testing-guidance/SKILL.md
.agents/skills/devtools-unicode-escaping/SKILL.md
.agents/skills/devtools-ux-writing-refactor/SKILL.md
.agents/skills/devtools-verification/SKILL.md
.agents/skills/evaluate-ai-css-completion/SKILL.md
.agents/skills/fixing-skipped-tests/SKILL.md
.agents/skills/foundation-test-migration/SKILL.md
.agents/skills/gerrit-cli/SKILL.md
.agents/skills/merging-devtools-module/SKILL.md
.agents/skills/migrate-chromium-test/SKILL.md
.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md
.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md
.agents/skills/ui-eng-vision-orchestrator/SKILL.md
.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md
.agents/skills/ui-eng-vision-widget-promoter/SKILL.md
.agents/skills/ui-widgets/SKILL.md
.agents/skills/repro-flaky-tests/SKILL.md

Metadata

Files
0
Version
678d19c
Hash
38808803
Indexed
2026-08-20 15:21

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 09:51
浙ICP备14020137号-1 $방문자$