Skip to content

docs: improve agent instructions based on session review#31

Merged
marcusquinn merged 2 commits intomainfrom
chore/agent-review-improvements
Jan 11, 2026
Merged

docs: improve agent instructions based on session review#31
marcusquinn merged 2 commits intomainfrom
chore/agent-review-improvements

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 11, 2026

Summary

Improvements to agent instructions based on patterns observed during the postflight fixes session (#30).

Changes

AGENTS.md

  • Clarify worktree as default choice: "recommended - enables parallel work" instead of "recommended for parallel sessions"
  • Add explicit guidance: "Prefer option 1 (worktree) unless user has expressed preference for option 2"

workflows/preflight.md

  • Add "Worktree Awareness" section explaining that preflight checks worktree files, not deployed version
  • Add "Pre-existing vs New Issues" section with guidance on:
    • How to identify new vs pre-existing issues
    • When to proceed despite issues
    • When to fix vs defer issues

Context

During the postflight fixes session:

  1. AI defaulted to git checkout -b instead of worktree - user had to correct
  2. Preflight loop hit max iterations trying to fix 1488 pre-existing string literal violations
  3. No guidance existed on distinguishing pre-existing issues from new ones

These improvements address all three patterns.

Summary by CodeRabbit

  • Documentation
    • Expanded branch creation guidance with clarified workflow options for parallel development.
    • Added comprehensive preflight check documentation including runtime behavior and detailed issue identification and resolution guidance.

✏️ Tip: You can customize this high-level summary in your review settings.

- AGENTS.md: Clarify worktree as default choice for branch creation
- preflight.md: Add worktree awareness section
- preflight.md: Add pre-existing vs new issues guidance

These improvements address patterns observed during the postflight
fixes session where worktree wasn't used by default and preflight
loop couldn't distinguish pre-existing issues from new ones.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 9cc07b0 and 8b96195.

📒 Files selected for processing (3)
  • .agent/AGENTS.md
  • .agent/workflows/pr.md
  • .agent/workflows/worktree.md

Walkthrough

Documentation enhancements to branch creation guidance in AGENTS.md with clearer worktree vs checkout labeling, and new preflight.md sections explaining worktree awareness during checks and guidance for handling pre-existing versus newly-introduced issues.

Changes

Cohort / File(s) Summary
Branch Creation Guidance
​.agent/AGENTS.md
Reorders and expands user guidance for branch creation; explicitly labels worktree option for parallel workflows and checkout option as conditional for single-session workflows; adds clarifying default-choice paragraph and enhanced conditional wording.
Preflight Documentation
​.agent/workflows/preflight.md
Adds two new documentation sections: "Worktree Awareness" clarifying that preflight checks operate against worktree files, and "Pre-existing vs New Issues" providing issue identification commands and guidance for proceeding or deferring fixes based on whether issues are pre-existing or newly introduced.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

📋 Branch paths now crystal clear,

Worktree dances, checkout's sphere,

Preflight knows its humble place—

Documentation finds its grace. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: documentation improvements to AGENTS.md and workflows/preflight.md that clarify agent instructions and guidance based on observed behavior during session reviews.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 enhances the documentation for agent instructions and the preflight workflow. It provides clearer guidance on using Git worktrees for branch creation and introduces a structured approach to managing code quality issues identified during preflight checks, particularly distinguishing between new and pre-existing problems. These updates aim to streamline agent operations and improve the efficiency of code review processes by addressing common pitfalls observed in recent sessions.

Highlights

  • Agent Workflow Clarification: Updated AGENTS.md to explicitly recommend worktrees for parallel development and clarify the default choice for branch creation, emphasizing their benefit in preventing branch-switching conflicts.
  • Preflight Worktree Awareness: Added a new section to workflows/preflight.md explaining how preflight checks interact with worktrees, clarifying that checks run against worktree files and outlining the implications for issue resolution and focusing on new issues.
  • Guidance on Pre-existing Issues: Introduced a comprehensive guide in workflows/preflight.md on identifying, handling, and prioritizing pre-existing versus new issues during preflight checks, including when to proceed, fix, or defer issues.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 222 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Jan 11 02:22:06 UTC 2026: Code review monitoring started
Sun Jan 11 02:22:07 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 222
Sun Jan 11 02:22:07 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sun Jan 11 02:22:09 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 222
  • VULNERABILITIES: 0

Generated on: Sun Jan 11 02:22:44 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the agent instructions, providing much-needed clarity on branching strategies and handling pre-existing issues during preflight checks. The updates to AGENTS.md correctly emphasize worktrees as the preferred method, and the new sections in preflight.md offer excellent, practical guidance for developers. I have one minor suggestion to make a shell command example more robust. Overall, these are valuable documentation enhancements.

git diff main --name-only

# Check issues only in your changed files
shellcheck $(git diff main --name-only -- '*.sh')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The shellcheck $(...) command is not robust as it will fail for filenames containing spaces or other special characters due to shell word splitting. A more robust method is to use NUL-delimited output from git diff with the -z flag and pipe it to xargs -0, which is designed to handle all possible filenames correctly.

Suggested change
shellcheck $(git diff main --name-only -- '*.sh')
git diff main --name-only -z -- '*.sh' | xargs -0 shellcheck

@augmentcode
Copy link

augmentcode bot commented Jan 11, 2026

🤖 Augment PR Summary

Summary: This PR refines agent documentation to prevent common workflow pitfalls observed during the postflight fixes session.

Changes:

  • Updates .agent/AGENTS.md to make worktrees the default branch creation choice and clarify when a simple checkout-based branch is appropriate.
  • Adds worktree-specific guidance to .agent/workflows/preflight.md, explaining that checks run on the worktree content rather than the deployed agents directory.
  • Introduces a practical framework for distinguishing pre-existing vs newly introduced preflight issues, including guidance on when to fix vs defer.

Technical Notes: Emphasizes focusing remediation on violations introduced by the PR and documenting inherited issues for follow-up cleanup.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

.agent/scripts/version-manager.sh bump patch
```text

## Worktree Awareness
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## Worktree Awareness (and the rest of this new section) appears to follow a fenced block that’s closed with text rather than a bare , which can cause everything after to render as a code block in Markdown. Worth double-checking the fence closures in this area so the new headings/sections render correctly.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

git diff main --name-only

# Check issues only in your changed files
shellcheck $(git diff main --name-only -- '*.sh')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example shellcheck $(git diff main --name-only -- '*.sh') can behave unexpectedly if there are no matching files or if any filenames contain spaces. Consider adding a short note/caveat so readers don’t get tripped up by the command substitution.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

- Add tool-level pre-edit enforcement reminder in AGENTS.md
- Add worktree deletion recovery section in worktree.md
- Add PR loop timeout guidance in pr.md

Based on agent-review analysis of session where pre-edit check was missed.
@sonarqubecloud
Copy link

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 222 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Jan 11 02:28:38 UTC 2026: Code review monitoring started
Sun Jan 11 02:28:38 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 222
Sun Jan 11 02:28:38 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sun Jan 11 02:28:40 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 222
  • VULNERABILITIES: 0

Generated on: Sun Jan 11 02:29:15 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant