agents/projects/code-health/hub/references/shared_workflows.md
Use these instructions to handle generic validation and submission steps for any Code Health cleanup task.
The following operations are pre-authorized for all Code Health tasks:
rg, cs, ls, fdfind, glob, cat, and
read_file.git cl format,
git pull origin main --rebase > /dev/null 2>&1,
gclient sync -D > /dev/null 2>&1, git status, git stash, git checkout,
git log, git new-branch, git add, git commit.git cl upload --force --bypass-hooks -a -d.Before making any modifications or running discovery scripts, ensure a clean and isolated environment.
git status --porcelain -uno --ignore-submodules. If there is any output,
run git stash and inform the user: "I noticed uncommitted changes; I've
stashed them (git stash) to ensure a clean environment."main:
git checkout main && git pull origin main --rebase > /dev/null && gclient sync -D > /dev/null 2>&1git log origin/main..HEAD. If
there is any output, stop and inform the user, as we do not want to carry
these over to a new branch.CRITICAL MANDATE: You MUST execute these commands autonomously immediately after committing. Do NOT ask for permission.
git pull origin main --rebase > /dev/null 2>&1 && gclient sync -D > /dev/null 2>&1.git cl upload --force --bypass-hooks -a -d.git cl upload --force --bypass-hooks -a -d fails due to presubmit errors or
provides warnings, you MUST analyze the output, fix the issues in the code,
and re-attempt the upload. Do NOT bypass these checks.After the task is complete, congratulate the user for their contribution to the Chromium project's code health and display a brief summary of the work performed. The summary MUST include:
git cl issue | awk '{print $4}' | tr -d '()']