From 00aaba6759f8d57ac8fccb6f6bcfc682b1cf573f Mon Sep 17 00:00:00 2001 From: Christian Gunderman Date: Thu, 14 May 2026 11:50:19 -0700 Subject: [PATCH] fix(bot): ensure management files are written to and read from workspace root --- .github/workflows/gemini-cli-bot-brain.yml | 4 ++++ tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md | 14 +++++++------- tools/gemini-cli-bot/brain/interactive.md | 5 +++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gemini-cli-bot-brain.yml b/.github/workflows/gemini-cli-bot-brain.yml index e95e425ed5..6eb6a7b13b 100644 --- a/.github/workflows/gemini-cli-bot-brain.yml +++ b/.github/workflows/gemini-cli-bot-brain.yml @@ -242,6 +242,10 @@ jobs: run: | touch bot-changes.patch touch pr-description.md + touch pr-labels.txt + touch branch-name.txt + touch issue-comment.md + touch pr-comment.md if [ -f critique_result.txt ] && grep -q "\[APPROVED\]" critique_result.txt && ! grep -q "\[REJECTED\]" critique_result.txt; then git diff --staged > bot-changes.patch else diff --git a/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md b/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md index ba5dcd94de..fa67aac648 100644 --- a/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md +++ b/tools/gemini-cli-bot/.gemini/skills/prs/SKILL.md @@ -33,12 +33,12 @@ If you are proposing fixes and PR creation is enabled (per the System Directive) unrelated refactor, or a metrics script update. Metrics and fixes MUST be in separate PRs. 2. **Generate PR Description**: Use the `write_file` tool to create - `pr-description.md`. + `pr-description.md` **at the workspace root**. - **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**: Use the `write_file` tool to create `pr-labels.txt` containing one label per line. You MUST ALWAYS add the `bot-fix` label. + - **Labels**: Use the `write_file` tool to create `pr-labels.txt` **at the workspace root** containing one label per line. You MUST ALWAYS add the `bot-fix` label. 3. **Branch Naming (Optional)**: If you wish to specify a custom branch name, - use `write_file` to create `branch-name.txt`. **CRITICAL**: The branch name + use `write_file` to create `branch-name.txt` **at the workspace root**. **CRITICAL**: The branch name MUST start with the `bot/` prefix. If you do not specify a branch name, one will be generated for you. 4. **Stage Fixes**: You MUST explicitly stage your fixes using the @@ -56,14 +56,14 @@ If you are continuing work on an existing Task or responding to a comment on an existing bot PR: 1. **Target Existing Branch**: Use `write_file` to generate `branch-name.txt` - containing the current branch name. **CRITICAL**: The branch name MUST start + **at the workspace root** containing the current branch name. **CRITICAL**: The branch name MUST start with the `bot/` prefix (e.g., `bot/task-BT-01`). If it does not, your PR creation will be rejected by the safety gate. -2. **Track PR ID**: Use `write_file` to generate `pr-number.txt` containing the +2. **Track PR ID**: Use `write_file` to generate `pr-number.txt` **at the workspace root** containing the numeric PR ID. 3. **Respond to Maintainers**: - - For general responses, write your markdown comment to `issue-comment.md`. - - For specific PR feedback, write your markdown response to `pr-comment.md`. + - For general responses, write your markdown comment to `issue-comment.md` **at the workspace root**. + - For specific PR feedback, write your markdown response to `pr-comment.md` **at the workspace root**. 4. **Handle CI Failures**: Diagnose failing checks using `gh --no-pager run view` or `gh api`. Your priority must be generating a new patch and staging it with `git add` to fix the failure. diff --git a/tools/gemini-cli-bot/brain/interactive.md b/tools/gemini-cli-bot/brain/interactive.md index 481b71e15e..539c9c4274 100644 --- a/tools/gemini-cli-bot/brain/interactive.md +++ b/tools/gemini-cli-bot/brain/interactive.md @@ -74,7 +74,7 @@ If investigation confirms a change is required: user's specific request. You are STRICTLY FORBIDDEN from including any unrelated updates when operating in interactive mode. - **Acknowledgment**: Use the `write_file` tool to write a brief acknowledgement - to `issue-comment.md`. + to `issue-comment.md` **at the workspace root**. ### 3. Question & Answer (Q&A) @@ -83,7 +83,8 @@ If the user's request is purely informational: - **Evidence-Based Answers**: Delegate the information gathering to the **'worker' agent** to verify facts before answering. - **Output**: You MUST use the `write_file` tool to save your response to - `issue-comment.md`. DO NOT simply output your response to the console. + `issue-comment.md` **at the workspace root**. DO NOT simply output your + response to the console. ## Execution Constraints