feat(planning): add auto-commit for planning files#114
Conversation
Planning files can now be edited on main and auto-committed without going through the full branch/PR workflow. This is because planning files are metadata about work, not the work itself. Changes: - Add planning-commit-helper.sh for auto-commit and push - Update pre-edit-check.sh to recognize planning files as docs-only - Update plan-plus.md with auto-commit instructions - Update AGENTS.md to document the planning files exception Usage: ~/.aidevops/agents/scripts/planning-commit-helper.sh 'plan: add new task'
WalkthroughThis PR establishes automated workflow tooling for planning file management. It expands the docs-only acceptance criteria in AGENTS.md to include planning files (TODO.md, todo/), introduces a new planning-commit-helper.sh script that automates the detection and committing of planning changes with validation and error handling, and updates pattern detection in pre-edit-check.sh to recognize planning-related terminology. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
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 introduces a streamlined workflow for managing planning-related documentation. It enables users to directly commit changes to designated planning files, such as 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
|
|
🔍 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: Sat Jan 17 04:11:23 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
🤖 Augment PR SummarySummary: Enables a lightweight workflow for updating planning files (TODO.md and Changes:
Technical Notes: The helper stages only planning paths, attempts a 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Code Review
This pull request introduces a helpful auto-commit feature for planning files, which is a great way to streamline the workflow for non-code changes. The new script, planning-commit-helper.sh, is well-structured, and the documentation updates are clear and informative. My review focuses on the new Bash script, where I've identified a potential correctness issue regarding how files are staged for commit. I've also included a couple of suggestions to improve the script's conciseness. Overall, this is a solid contribution.
| git add TODO.md 2>/dev/null || true | ||
| git add todo/ 2>/dev/null || true |
There was a problem hiding this comment.
The current implementation uses git add TODO.md and git add todo/ to stage files. This is a bit too broad, as git add todo/ will stage all modified and untracked files within that directory, potentially including files not intended for this commit.
A more robust approach is to use the list_planning_changes function to get a precise list of changed planning files and stage only them. This can be done safely using mapfile to handle filenames with special characters, ensuring only intended files are part of the commit.
| git add TODO.md 2>/dev/null || true | |
| git add todo/ 2>/dev/null || true | |
| mapfile -t files_to_add < <(list_planning_changes) | |
| if ((${#files_to_add[@]} > 0)); then | |
| # Using an array with -- ensures filenames are handled safely. | |
| git add -- "${files_to_add[@]}" | |
| fi |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.agent/scripts/planning-commit-helper.sh:
- Around line 56-70: In has_planning_changes(), avoid using the failing
invocation "git diff --name-only HEAD" on repos with no commits; replace that
first check with "git diff --name-only" (working tree vs index) or guard the
HEAD call with a pre-check like "git rev-parse --verify HEAD >/dev/null 2>&1 &&
git diff --name-only HEAD ..." so the function won't error on initial commits;
update the code that currently calls "git diff --name-only HEAD" to the safer
invocation and leave the cached and ls-files checks unchanged.
🧹 Nitpick comments (1)
.agent/AGENTS.md (1)
66-73: Good addition following progressive disclosure pattern.The planning files exception is concise and universally applicable. The inline script reference keeps AGENTS.md lean while pointing to the helper for implementation details.
Fix markdown lint (MD031): Add blank lines around the fenced code block to satisfy markdown formatting rules.
📝 Markdown lint fix
**Planning files exception**: TODO.md and todo/ can be edited directly on main and auto-committed: + ```bash ~/.aidevops/agents/scripts/planning-commit-helper.sh "plan: add new task"
Planning files are metadata about work, not the work itself - they don't need PR review.
</details> </blockquote></details> </blockquote></details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| # Check if there are planning file changes | ||
| has_planning_changes() { | ||
| # Check both staged and unstaged changes | ||
| if git diff --name-only HEAD 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | ||
| return 0 | ||
| fi | ||
| if git diff --name-only --cached 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | ||
| return 0 | ||
| fi | ||
| # Also check untracked files in todo/ | ||
| if git ls-files --others --exclude-standard 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | ||
| return 0 | ||
| fi | ||
| return 1 | ||
| } |
There was a problem hiding this comment.
Edge case: git diff HEAD fails on repos with no commits.
On a brand new repository with no commits, git diff --name-only HEAD returns an error (fatal: ambiguous argument 'HEAD'). With pipefail enabled, this could cause unexpected behavior.
🔧 Suggested fix for initial-commit edge case
has_planning_changes() {
- # Check both staged and unstaged changes
- if git diff --name-only HEAD 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then
+ # Check unstaged changes (works even with no commits)
+ if git diff --name-only 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then
return 0
fi
if git diff --name-only --cached 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; thenUsing git diff --name-only (without HEAD) checks working tree vs index, which works on fresh repos.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Check if there are planning file changes | |
| has_planning_changes() { | |
| # Check both staged and unstaged changes | |
| if git diff --name-only HEAD 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | |
| return 0 | |
| fi | |
| if git diff --name-only --cached 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | |
| return 0 | |
| fi | |
| # Also check untracked files in todo/ | |
| if git ls-files --others --exclude-standard 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | |
| return 0 | |
| fi | |
| return 1 | |
| } | |
| # Check if there are planning file changes | |
| has_planning_changes() { | |
| # Check unstaged changes (works even with no commits) | |
| if git diff --name-only 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | |
| return 0 | |
| fi | |
| if git diff --name-only --cached 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | |
| return 0 | |
| fi | |
| # Also check untracked files in todo/ | |
| if git ls-files --others --exclude-standard 2>/dev/null | grep -qE "$PLANNING_PATTERNS"; then | |
| return 0 | |
| fi | |
| return 1 | |
| } |
🤖 Prompt for AI Agents
In @.agent/scripts/planning-commit-helper.sh around lines 56 - 70, In
has_planning_changes(), avoid using the failing invocation "git diff --name-only
HEAD" on repos with no commits; replace that first check with "git diff
--name-only" (working tree vs index) or guard the HEAD call with a pre-check
like "git rev-parse --verify HEAD >/dev/null 2>&1 && git diff --name-only HEAD
..." so the function won't error on initial commits; update the code that
currently calls "git diff --name-only HEAD" to the safer invocation and leave
the cached and ls-files checks unchanged.



Summary
Planning files (TODO.md, todo/) can now be edited on main and auto-committed without the full branch/PR workflow.
Why? Planning files are metadata about work, not the work itself. They don't need code review - just quick persistence to keep remote in sync.
Changes
Usage
Commit Message Conventions
plan: add {task title}plan: {task} → doneplan: add {plan name}plan: batch planning updatesSummary by CodeRabbit
New Features
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.