docs: add feature branch scenario guidance to pre-edit workflow#148
docs: add feature branch scenario guidance to pre-edit workflow#148marcusquinn merged 1 commit intomainfrom
Conversation
- Add exit code 3 for 'on feature branch in main repo' scenario - Update AGENTS.md with table of exit codes and required actions - Add guidance for when already on a feature branch (not just main → feature) - Document why feature branches in main repo are problematic - Add small tasks exception for quick fixes on current branch - Update loop mode to handle feature branch scenarios Addresses agent review finding that workflow didn't clearly address: - What to do when already on a feature branch - Whether personal dev branches should be treated differently - Whether small tasks warrant their own worktree/branch
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughEnhanced pre-edit-check workflow with expanded exit code semantics and interactive prompts. The documentation clarifies a four-code system (0, 1, 2, 3) with explicit handling rules; the script implements multi-mode logic for feature branches and worktrees with conditional user prompts and state-based decisions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the pre-edit check workflow by adding specific handling for scenarios where development is happening on a feature branch within the main repository, rather than a dedicated worktree. The introduction of exit code 3 and the detailed updates to AGENTS.md provide clear guidance for both automated agents and interactive users, which is a great enhancement. The script changes correctly implement this new logic. I have one minor suggestion to improve code maintainability in the shell script.
| if [[ "$LOOP_MODE" == "true" ]]; then | ||
| if is_docs_only "$TASK_DESC"; then | ||
| echo -e "${YELLOW}LOOP-AUTO${NC}: Docs-only task on feature branch, continuing" | ||
| echo "LOOP_DECISION=continue" | ||
| exit 0 | ||
| else | ||
| # For code tasks, warn but continue (already on feature branch) | ||
| echo -e "${YELLOW}LOOP-AUTO${NC}: On feature branch in main repo (not ideal but continuing)" | ||
| echo "LOOP_DECISION=continue_warning" | ||
| exit 0 | ||
| fi | ||
| fi |
There was a problem hiding this comment.
For better maintainability, you can refactor this block to avoid duplicating the exit 0 call. Since both branches of the if is_docs_only conditional lead to an exit 0, you can move the exit statement outside and after the conditional.
| if [[ "$LOOP_MODE" == "true" ]]; then | |
| if is_docs_only "$TASK_DESC"; then | |
| echo -e "${YELLOW}LOOP-AUTO${NC}: Docs-only task on feature branch, continuing" | |
| echo "LOOP_DECISION=continue" | |
| exit 0 | |
| else | |
| # For code tasks, warn but continue (already on feature branch) | |
| echo -e "${YELLOW}LOOP-AUTO${NC}: On feature branch in main repo (not ideal but continuing)" | |
| echo "LOOP_DECISION=continue_warning" | |
| exit 0 | |
| fi | |
| fi | |
| if [[ "$LOOP_MODE" == "true" ]]; then | |
| if is_docs_only "$TASK_DESC"; then | |
| echo -e "${YELLOW}LOOP-AUTO${NC}: Docs-only task on feature branch, continuing" | |
| echo "LOOP_DECISION=continue" | |
| else | |
| # For code tasks, warn but continue (already on feature branch) | |
| echo -e "${YELLOW}LOOP-AUTO${NC}: On feature branch in main repo (not ideal but continuing)" | |
| echo "LOOP_DECISION=continue_warning" | |
| fi | |
| exit 0 | |
| fi |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Jan 21 23:00:37 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
🤖 Augment PR SummarySummary: This PR clarifies and extends the “pre-edit” git-branch workflow, especially when the main repo is already on a feature branch. Changes:
Technical Notes: Interactive mode exposes 🤖 Was this summary useful? React with 👍 or 👎 |
| | `0` | OK to proceed | Continue with edits | | ||
| | `1` | On protected branch (main/master) | STOP - present branch creation options | | ||
| | `2` | Loop mode: worktree needed | Auto-create worktree for code task | | ||
| | `3` | On feature branch in main repo | Present options to user (see below) | |
There was a problem hiding this comment.
Exit code 3 is documented as the generic “feature branch in main repo” case, but pre-edit-check.sh --loop-mode currently exits 0 (with LOOP_DECISION=continue_warning) for that same scenario. Consider clarifying in the docs that exit 3 only occurs in interactive mode, so loop agents don’t incorrectly key off exit code alone.
Other Locations
.agent/AGENTS.md:76
🤖 Was this useful? React with 👍 or 👎
| # Exit codes: | ||
| # 0 - OK to proceed (on feature branch, or docs-only on main in loop mode) | ||
| # 1 - STOP (on protected branch, interactive mode) | ||
| # 0 - OK to proceed (on feature branch in worktree, or docs-only on main) |
There was a problem hiding this comment.
The exit-code comment for 0 (“OK to proceed …”) doesn’t include the loop-mode case where you’re on a feature branch in the main repo and still exit 0 (via LOOP_DECISION=continue_warning). Consider updating the header comment to reflect that 0 can also mean “continue with warning” in loop mode.
🤖 Was this useful? React with 👍 or 👎



Summary
Problem
The agent review identified that the workflow documentation didn't clearly address:
Solution
Testing
Summary by CodeRabbit
Release Notes
Documentation
Enhancement
✏️ Tip: You can customize this high-level summary in your review settings.