diff --git a/.github/workflows/gemini-cli-bot-brain.yml b/.github/workflows/gemini-cli-bot-brain.yml index 5a2ce5b2e3..e4f86e3885 100644 --- a/.github/workflows/gemini-cli-bot-brain.yml +++ b/.github/workflows/gemini-cli-bot-brain.yml @@ -375,6 +375,14 @@ jobs: gh pr create --draft --title "🤖 Gemini Bot Productivity Optimizations" --body "Automated changes generated by Gemini CLI Bot." --head "$NEW_BRANCH_NAME" --base main fi fi + + if [ -s "${{ runner.temp }}/brain-data/pr-labels.txt" ]; then + while IFS= read -r label; do + if [ -n "$label" ]; then + gh pr edit --add-label "$label" || true + fi + done < "${{ runner.temp }}/brain-data/pr-labels.txt" + fi fi - name: 'Post PR/Issue Comment' diff --git a/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md b/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md index f68fb2977c..9369cd9777 100644 --- a/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md +++ b/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md @@ -29,4 +29,4 @@ maintain existing PRs to reduce the repository backlog. - **CRITICAL**: `gh issue list` is your ONLY source for new tasks. If `gh` fails, you MUST diagnose the environment or abort the discovery phase. You are STRICTLY FORBIDDEN from using `google_web_search` to query GitHub, as it indexes closed issues. Do NOT run local discovery commands (e.g., `npm run lint`, `npm run typecheck`) to look for "easy fixes". 3. **Select ONE Issue** and implement a fix on a new branch. 4. **Verify** via `npm run preflight`. -5. **Use the `prs` Skill** to stage changes and prepare the draft PR (label: `bot-fix`). +5. **Use the `prs` Skill** to stage changes and prepare the draft PR (labels: `bot-fix`, `issue-fixer`). diff --git a/tools/gemini-cli-bot/.gemini/skills/metrics/SKILL.md b/tools/gemini-cli-bot/.gemini/skills/metrics/SKILL.md index 3b5ddaa34f..1d92184cb0 100644 --- a/tools/gemini-cli-bot/.gemini/skills/metrics/SKILL.md +++ b/tools/gemini-cli-bot/.gemini/skills/metrics/SKILL.md @@ -21,7 +21,7 @@ maintainability. `tools/gemini-cli-bot/history/metrics-before-prev.csv` and the current run's metrics. - **Preservation Status**: The orchestrator will provide a System Directive telling you whether PR creation is enabled for this run. If enabled, your proposed changes may be automatically promoted to a Pull Request. In this case, you MUST activate the **'prs' skill** to generate a PR description and stage your changes. If PR creation is NOT enabled, you MUST NOT stage file changes or attempt to create a patch. Instead, simply report your findings. -- **Ownership Mandate**: Any PR generated by this skill MUST use the `bot-fix` label. +- **Ownership Mandate**: Any PR generated by this skill MUST use the `bot-fix` and `metrics` labels in `pr-labels.txt`. ## Repo Policy Priorities diff --git a/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md b/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md index 1c90b3fc3e..ebc4ecd2b7 100644 --- a/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md +++ b/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md @@ -30,14 +30,14 @@ If you are proposing fixes and PR creation is enabled (per the System Directive) `pr-description.md`. - **Title**: The very first line MUST be a concise, conventional title. - **Body**: Explain the change and expected impact. You MUST identify the domain expert for the affected files and mention them (cc @). - - **Labels**: Always apply the `bot-fix` label. + - **Labels**: Use the `write_file` tool to create `pr-labels.txt` containing one label per line. You MUST ALWAYS add the `bot-fix` label. 3. **Stage Fixes**: You MUST explicitly stage your fixes using the `git add ` command. 4. **Internal File Protection (CRITICAL)**: You are STRICTLY FORBIDDEN from staging internal bot management files. If they are accidentally staged, you MUST unstage them using `git reset `. - **NEVER STAGE**: `pr-description.md`, `lessons-learned.md`, - `branch-name.txt`, `pr-comment.md`, `pr-number.txt`, `issue-comment.md`, or + `branch-name.txt`, `pr-comment.md`, `pr-number.txt`, `issue-comment.md`, `pr-labels.txt`, or anything in `history/`. ## Unblocking & PR Updates (Recovery)