Skip to content

feat(planning): add auto-commit for planning files#114

Merged
marcusquinn merged 1 commit intomainfrom
feature/planning-auto-commit
Jan 17, 2026
Merged

feat(planning): add auto-commit for planning files#114
marcusquinn merged 1 commit intomainfrom
feature/planning-auto-commit

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

@marcusquinn marcusquinn commented Jan 17, 2026

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

  • planning-commit-helper.sh - New script for auto-commit and push
  • pre-edit-check.sh - Recognize planning files as docs-only (can stay on main)
  • plan-plus.md - Add auto-commit instructions and conventions
  • AGENTS.md - Document the planning files exception

Usage

# After modifying TODO.md or todo/
~/.aidevops/agents/scripts/planning-commit-helper.sh "plan: add new task"

# Check for changes
~/.aidevops/agents/scripts/planning-commit-helper.sh --check

# Show status
~/.aidevops/agents/scripts/planning-commit-helper.sh --status

Commit Message Conventions

Action Message
New task plan: add {task title}
Status update plan: {task} → done
New plan plan: add {plan name}
Batch updates plan: batch planning updates

Summary by CodeRabbit

  • New Features

    • Added automated workflow for committing planning file changes with customizable commit messages.
  • Chores

    • Introduced helper script for planning file persistence, supporting status checking and streamlined auto-commit operations.
  • Documentation

    • Updated guidance to clarify planning file handling, code review bypass for metadata files, and commit message conventions.

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

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'
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 17, 2026

Walkthrough

This 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

Cohort / File(s) Summary
Documentation Updates
.agent/AGENTS.md, .agent/plan-plus.md
Expanded acceptance criteria to include planning files alongside docs-only changes; added "Planning files exception" section and "Auto-Commit Planning Files" documentation with commit message conventions and rationale for bypassing code review
Planning File Automation
.agent/scripts/planning-commit-helper.sh
New Bash script automating planning-file commits with git repo validation, change detection (staged/unstaged/untracked), status reporting, automatic staging/committing/pushing, and colorized logging; includes helper functions (log_info, log_success, log_warning, log_error, check_git_repo, has_planning_changes, list_planning_changes, show_status, commit_planning_files, main); defines PLANNING_PATTERNS and color constants
Pattern Detection Enhancement
.agent/scripts/pre-edit-check.sh
Extended is_docs_only detection to include planning-related patterns (TODO.md, todo/, plans.md, planning, backlog, task keywords)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

✨ Planning files now auto-commit with grace,
Git hooks bypass for metadata's embrace,
Helper scripts validate, stage, and push with care,
DevOps workflows streamlined everywhere—
Zero debt reigns supreme in this domain! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main feature addition: a new auto-commit capability for planning files, which is the core objective of the PR.

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

✨ Finishing touches
  • 📝 Generate docstrings

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
Copy Markdown

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 introduces a streamlined workflow for managing planning-related documentation. It enables users to directly commit changes to designated planning files, such as TODO.md and files within the todo/ directory, to the main branch without requiring a full branch and pull request cycle. This is justified by treating planning files as metadata that primarily require quick persistence rather than formal code review, thereby improving efficiency for task management and planning updates.

Highlights

  • Automated Planning File Commits: Introduced a new shell script (planning-commit-helper.sh) to automate committing and pushing changes to planning files (e.g., TODO.md, todo/ directory) directly to the main branch, bypassing the standard branch/PR workflow.
  • Documentation Updates: Updated AGENTS.md and plan-plus.md to document this new auto-commit process, including usage instructions, commit message conventions, and the rationale for this exception.
  • Pre-Edit Check Integration: Modified pre-edit-check.sh to recognize planning file changes as "docs-only," allowing them to be committed directly to the main branch without triggering a full code review process.
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.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 17 04:10:40 UTC 2026: Code review monitoring started
Sat Jan 17 04:10:40 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 262
Sat Jan 17 04:10:40 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 17 04:10:42 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 262
  • VULNERABILITIES: 0

Generated on: Sat Jan 17 04:11:23 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Jan 17, 2026

🤖 Augment PR Summary

Summary: Enables a lightweight workflow for updating planning files (TODO.md and todo/) directly on main, with automatic commit/push to keep the remote in sync.

Changes:

  • Documented a “planning files” exception to the normal branch/PR workflow in .agent/AGENTS.md.
  • Expanded Plan+ documentation (.agent/plan-plus.md) with auto-commit instructions and commit message conventions.
  • Added .agent/scripts/planning-commit-helper.sh to detect planning-file changes, stage them, commit with a provided message, and push (with --check/--status helpers).
  • Updated pre-edit-check.sh to treat planning-related tasks as “docs-only” so edits can remain on main.

Technical Notes: The helper stages only planning paths, attempts a git pull --rebase before committing, and uses --no-verify to skip hooks for planning-only commits.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@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. 1 suggestions posted.

Fix All in Augment

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

fi

# Stage only planning files
git add TODO.md 2>/dev/null || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

git add TODO.md / git add todo/ typically won’t stage deletions (e.g., removing a file under todo/), so planning-file removals may be left uncommitted even though this helper detected changes.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

Copy link
Copy Markdown

@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 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.

Comment on lines +141 to +142
git add TODO.md 2>/dev/null || true
git add todo/ 2>/dev/null || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

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.

Suggested change
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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 -->

Comment on lines +56 to +70
# 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
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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"; then

Using 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.

Suggested change
# 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.

@marcusquinn marcusquinn merged commit d397294 into main Jan 17, 2026
17 of 21 checks passed
@marcusquinn marcusquinn deleted the feature/planning-auto-commit branch February 21, 2026 01:59
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