Skip to content

feat(t021): auto-mark tasks complete from commit messages in release#208

Merged
marcusquinn merged 1 commit intomainfrom
feature/t021-auto-mark-tasks-complete
Jan 25, 2026
Merged

feat(t021): auto-mark tasks complete from commit messages in release#208
marcusquinn merged 1 commit intomainfrom
feature/t021-auto-mark-tasks-complete

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 25, 2026

Summary

Implements automatic task completion marking during the release workflow. When running version-manager.sh release, the script now:

  1. Scans commits since the last release tag for task IDs (t001, t001.1, etc.)
  2. Updates TODO.md to mark those tasks as complete (- [ ]- [x])
  3. Adds completed: timestamp to each marked task
  4. Includes TODO.md in the release commit

Changes

  • version-manager.sh: Added extract_task_ids_from_commits() and auto_mark_tasks_complete() functions
  • release.md: Updated documentation to reflect automatic task completion behavior

New Commands

# Preview which tasks would be marked complete
.agent/scripts/version-manager.sh list-task-ids

# Manually run auto-mark (without release)
.agent/scripts/version-manager.sh auto-mark-tasks

Supported Patterns

Task IDs are extracted from commit messages matching:

  • Direct reference: chore: mark t001 as complete
  • Conventional commits: feat(t001): add user dashboard
  • Subtasks: fix: resolve t002.1 validation issue
  • Any mention: docs: update t003 documentation

Testing

  • ShellCheck passes
  • list-task-ids correctly extracts task IDs from commits
  • auto-mark-tasks correctly identifies already-complete tasks
  • Regex handles all task ID formats (t001, t001.1, t001.1.1)

Closes #t021

Summary by CodeRabbit

  • Chores
    • Automated task completion during releases: task IDs in commit messages are now automatically marked as complete in TODO.md with timestamps.
    • Added CLI commands to preview and trigger automatic task completion during the release workflow.

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

- Add extract_task_ids_from_commits() to parse task IDs (t001, t001.1, etc.)
- Add auto_mark_tasks_complete() to update TODO.md checkboxes
- Integrate into release workflow after changelog generation
- Add standalone commands: auto-mark-tasks, list-task-ids
- Update release.md documentation with new automatic behavior

Supports patterns: t001, feat(t001):, fix(t002):, closes t003, mark t004
@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 introduces a significant enhancement to the release workflow by automating the process of marking tasks as complete in the TODO.md file. By parsing commit messages for task identifiers, the system can now automatically update the status of tasks, add completion timestamps, and include these changes in the release commit. This streamlines the release preparation, reduces manual overhead, and ensures that the TODO.md accurately reflects the completed work based on recent development activity.

Highlights

  • Automated Task Completion: The release workflow now automatically marks tasks as complete in TODO.md by scanning commit messages for task IDs.
  • Task ID Extraction: A new function extract_task_ids_from_commits identifies task IDs (e.g., t001, t001.1) from commit messages since the last release tag, supporting various patterns like conventional commits and direct references.
  • TODO.md Updates: The auto_mark_tasks_complete function updates TODO.md by changing [ ] to [x] for identified tasks and adds a completed: timestamp. It also handles tasks that are already marked complete.
  • Release Integration: The automatic task completion process is integrated into the release command of version-manager.sh and ensures TODO.md is included in the release commit.
  • New CLI Commands: Two new commands are introduced: list-task-ids to preview tasks that would be marked, and auto-mark-tasks to manually trigger the auto-completion process outside of a release.
  • Documentation Update: The release.md documentation has been updated to reflect the new automatic task completion behavior, including supported commit patterns and the new manual commands.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Walkthrough

The pull request introduces automated task completion tracking for a version management system. The script now extracts task IDs from commit messages, automatically marks matching tasks as complete in TODO.md with timestamps, and integrates this automation into the release workflow.

Changes

Cohort / File(s) Summary
Task Automation Functions
.agent/scripts/version-manager.sh
Added extract_task_ids_from_commits() to parse commits since last tag/release and extract task IDs matching pattern tNNN(.N+). Added auto_mark_tasks_complete() to read TODO.md, derive task IDs from commits, and automatically convert checkboxes to completed state with timestamps. Extended CLI with auto-mark-tasks and list-task-ids commands. Updated commit_version_changes() to stage TODO.md alongside existing files.
Release Workflow Documentation
.agent/workflows/release.md
Renamed "Task Completion" to "Task Completion (Automatic)". Replaced manual task-marking steps with commit-driven automation workflow. Added support details for commit patterns (direct reference, conventional commits, general mentions). Introduced manual command previews and before/after examples demonstrating automatic task completion with timestamps.

Sequence Diagram(s)

sequenceDiagram
    participant Release as Release Process
    participant Script as version-manager.sh
    participant Git as Git Repository
    participant TODO as TODO.md
    participant Commit as Commit History

    Release->>Script: Initiate release
    Script->>Git: Query commits since last tag
    Git->>Commit: Fetch commit messages
    Commit-->>Script: Return commits
    Script->>Script: extract_task_ids_from_commits()
    Script->>TODO: Read current tasks
    TODO-->>Script: Return task entries
    Script->>Script: Parse and match task IDs
    Script->>TODO: Update checkboxes & add timestamps
    Script->>Git: Stage TODO.md
    Script->>Git: Commit version changes
    Git-->>Release: Release continues
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🤖 Commits whisper their secrets in code,

Task IDs dance through the release road,

Auto-marked and timestamped with care,

TODO.md updated—completion's in the air! ✨

🚥 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 clearly and specifically describes the main feature: automatic task completion marking from commit messages during release workflow, directly matching the core functionality added.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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.

@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, 447 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Jan 25 15:02:50 UTC 2026: Code review monitoring started
Sun Jan 25 15:02:51 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 447
Sun Jan 25 15:02:51 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sun Jan 25 15:02:53 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 447
  • VULNERABILITIES: 0

Generated on: Sun Jan 25 15:04:16 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 2c7924d into main Jan 25, 2026
8 of 9 checks passed
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 introduces a great new feature to automatically mark tasks in TODO.md as complete based on commit messages. The implementation is well-structured, adding new functions and CLI commands cleanly. My review focuses on a significant performance and portability improvement in the auto_mark_tasks_complete function. The current implementation reads and writes the TODO.md file for every task, which can be very slow with a large task file. I've suggested a refactoring that processes the file only once, making it much more efficient and robust.

Comment on lines +553 to +621
auto_mark_tasks_complete() {
local todo_file="$REPO_ROOT/TODO.md"
local today
today=$(date +%Y-%m-%dT%H:%M:%SZ)
local today_short
today_short=$(date +%Y-%m-%d)

if [[ ! -f "$todo_file" ]]; then
print_warning "TODO.md not found, skipping task auto-completion"
return 0
fi

print_info "Scanning commits for task IDs to auto-mark complete..."

local task_ids
task_ids=$(extract_task_ids_from_commits)

if [[ -z "$task_ids" ]]; then
print_info "No task IDs found in commits since last release"
return 0
fi

local count=0
local marked_tasks=""

# Process each task ID
while IFS= read -r task_id; do
[[ -z "$task_id" ]] && continue

# Build regex patterns (avoids shellcheck SC1087 false positive with [[:space:]])
local unchecked_pattern="^[[:space:]]*- \\[ \\] ${task_id}[[:space:]]"
local checked_pattern="^[[:space:]]*- \\[x\\] ${task_id}[[:space:]]"

# Check if task exists and is not already complete
# Pattern: - [ ] t001 ... (not already checked)
if grep -qE "$unchecked_pattern" "$todo_file"; then
# Mark task complete: change [ ] to [x] and add completed: timestamp
# Use sed to update the line
local escaped_id
escaped_id=$(echo "$task_id" | sed 's/\./\\./g')

# Build sed patterns
local sed_unchecked_pattern="^[[:space:]]*- \\[ \\] ${escaped_id}[[:space:]]"

# Check if line already has completed: field
if grep -E "$sed_unchecked_pattern" "$todo_file" | grep -q "completed:"; then
# Just change checkbox
sed -i '' "s/^\\([[:space:]]*\\)- \\[ \\] \\(${escaped_id}[[:space:]]\\)/\\1- [x] \\2/" "$todo_file"
else
# Change checkbox and add completed: timestamp
sed -i '' "s/^\\([[:space:]]*\\)- \\[ \\] \\(${escaped_id}[[:space:]].*\\)\$/\\1- [x] \\2 completed:$today_short/" "$todo_file"
fi

count=$((count + 1))
marked_tasks="$marked_tasks $task_id"
print_success "Marked $task_id as complete"
elif grep -qE "$checked_pattern" "$todo_file"; then
print_info "Task $task_id already marked complete"
else
print_warning "Task $task_id not found in TODO.md (may be subtask or already moved)"
fi
done <<< "$task_ids"

if [[ $count -gt 0 ]]; then
print_success "Auto-marked $count task(s) complete:$marked_tasks"
fi

return 0
}

Choose a reason for hiding this comment

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

high

This function has performance and portability issues that could become problematic as TODO.md grows.

1. Performance: The function iterates through each task_id and runs grep and sed -i inside the loop. This means TODO.md is read and re-written for every single task found in the commits. For 10 tasks, the file is processed 10 times, which is inefficient.

2. Portability: The sed -i '' command is specific to BSD sed (like on macOS) and will fail on systems with GNU sed (common on Linux).

I've suggested a refactoring that addresses both issues by:

  • Processing TODO.md only once using a while read loop in bash.
  • Using an associative array for efficient task lookups.
  • Avoiding sed -i in favor of writing to a temporary file, which is both more efficient and portable.

This new implementation is much more scalable and robust.

auto_mark_tasks_complete() {
    local todo_file="$REPO_ROOT/TODO.md"
    local today_short
    today_short=$(date +%Y-%m-%d)

    if [[ ! -f "$todo_file" ]]; then
        print_warning "TODO.md not found, skipping task auto-completion"
        return 0
    fi

    print_info "Scanning commits for task IDs to auto-mark complete..."

    local task_ids
    task_ids=$(extract_task_ids_from_commits)

    if [[ -z "$task_ids" ]]; then
        print_info "No task IDs found in commits since last release"
        return 0
    fi

    # Use an associative array for efficient lookups.
    declare -A tasks_to_process
    while IFS= read -r task_id; do
        [[ -z "$task_id" ]] && continue
        tasks_to_process["$task_id"]="unprocessed"
    done <<< "$task_ids"

    local temp_file
    temp_file=$(mktemp)
    
    # Process TODO.md once, writing to a temporary file. This is much more
    # efficient than reading and writing the file for each task.
    while IFS= read -r line; do
        local task_id
        # Match unchecked tasks: - [ ] t...
        if [[ "$line" =~ ^[[:space:]]*-' '['' '']'[[:space:]]+(t[0-9]{3}(\.[0-9]+)*) ]]; then
            task_id="${BASH_REMATCH[1]}"
            if [[ "${tasks_to_process[$task_id]:-}" == "unprocessed" ]]; then
                line="${line/\\[ \\]/\\[x\\]}"
                if [[ ! "$line" =~ completed: ]]; then
                    # Append to end of line, stripping trailing whitespace first
                    line="${line%%[[:space:]]}"
                    line="$line completed:$today_short"
                fi
                tasks_to_process["$task_id"]="marked"
            fi
        # Match already checked tasks: - [x] t...
        elif [[ "$line" =~ ^[[:space:]]*-' '['x']'[[:space:]]+(t[0-9]{3}(\.[0-9]+)*) ]]; then
            task_id="${BASH_REMATCH[1]}"
            if [[ "${tasks_to_process[$task_id]:-}" == "unprocessed" ]]; then
                tasks_to_process["$task_id"]="already_marked"
            fi
        fi
        echo "$line" >> "$temp_file"
    done < "$todo_file"

    mv "$temp_file" "$todo_file"

    local count=0
    local marked_tasks=""
    # Report results in the same order as found in commits
    while IFS= read -r task_id; do
        [[ -z "$task_id" ]] && continue
        case "${tasks_to_process[$task_id]:-unprocessed}" in
            marked)
                count=$((count + 1))
                marked_tasks="$marked_tasks $task_id"
                print_success "Marked $task_id as complete"
                ;;
            already_marked)
                print_info "Task $task_id already marked complete"
                ;;
            unprocessed)
                print_warning "Task $task_id not found in TODO.md (may be subtask or already moved)"
                ;;
        esac
    done <<< "$task_ids"

    if [[ $count -gt 0 ]]; then
        print_success "Auto-marked $count task(s) complete:$marked_tasks"
    fi

    return 0
}

Copy link
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/version-manager.sh:
- Around line 551-604: In auto_mark_tasks_complete(), the grep/sed patterns
require a trailing space after the task ID and use today_short; update the
regexes to allow the task ID to be followed by either whitespace or end-of-line
(e.g., use "(?:$|[[:space:]])" or a word-boundary-style pattern) for
unchecked_pattern, checked_pattern and sed_unchecked_pattern (and the sed match
groups that reference ${escaped_id}), and replace uses of today_short with the
full ISO timestamp variable today when appending the completed: timestamp so
completed entries use the full timestamp.

Comment on lines +551 to +604
# Function to auto-mark tasks complete in TODO.md based on commit messages
# Parses commits since last tag for task IDs and marks them complete
auto_mark_tasks_complete() {
local todo_file="$REPO_ROOT/TODO.md"
local today
today=$(date +%Y-%m-%dT%H:%M:%SZ)
local today_short
today_short=$(date +%Y-%m-%d)

if [[ ! -f "$todo_file" ]]; then
print_warning "TODO.md not found, skipping task auto-completion"
return 0
fi

print_info "Scanning commits for task IDs to auto-mark complete..."

local task_ids
task_ids=$(extract_task_ids_from_commits)

if [[ -z "$task_ids" ]]; then
print_info "No task IDs found in commits since last release"
return 0
fi

local count=0
local marked_tasks=""

# Process each task ID
while IFS= read -r task_id; do
[[ -z "$task_id" ]] && continue

# Build regex patterns (avoids shellcheck SC1087 false positive with [[:space:]])
local unchecked_pattern="^[[:space:]]*- \\[ \\] ${task_id}[[:space:]]"
local checked_pattern="^[[:space:]]*- \\[x\\] ${task_id}[[:space:]]"

# Check if task exists and is not already complete
# Pattern: - [ ] t001 ... (not already checked)
if grep -qE "$unchecked_pattern" "$todo_file"; then
# Mark task complete: change [ ] to [x] and add completed: timestamp
# Use sed to update the line
local escaped_id
escaped_id=$(echo "$task_id" | sed 's/\./\\./g')

# Build sed patterns
local sed_unchecked_pattern="^[[:space:]]*- \\[ \\] ${escaped_id}[[:space:]]"

# Check if line already has completed: field
if grep -E "$sed_unchecked_pattern" "$todo_file" | grep -q "completed:"; then
# Just change checkbox
sed -i '' "s/^\\([[:space:]]*\\)- \\[ \\] \\(${escaped_id}[[:space:]]\\)/\\1- [x] \\2/" "$todo_file"
else
# Change checkbox and add completed: timestamp
sed -i '' "s/^\\([[:space:]]*\\)- \\[ \\] \\(${escaped_id}[[:space:]].*\\)\$/\\1- [x] \\2 completed:$today_short/" "$todo_file"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Make TODO matching tolerate end‑of‑line task IDs and use full timestamps.

Current patterns require a trailing space after the task ID, so lines like - [ ] t001 won’t match. Also, today (full ISO) is computed but the shorter date is used, which diverges from the workflow examples.

🔧 Proposed fix
-    local today
-    today=$(date +%Y-%m-%dT%H:%M:%SZ)
-    local today_short
-    today_short=$(date +%Y-%m-%d)
+    local today
+    today=$(date +%Y-%m-%dT%H:%M:%SZ)
@@
-        local unchecked_pattern="^[[:space:]]*- \\[ \\] ${task_id}[[:space:]]"
-        local checked_pattern="^[[:space:]]*- \\[x\\] ${task_id}[[:space:]]"
+        local unchecked_pattern="^[[:space:]]*- \\[ \\] ${task_id}([[:space:]]|$)"
+        local checked_pattern="^[[:space:]]*- \\[x\\] ${task_id}([[:space:]]|$)"
@@
-            local sed_unchecked_pattern="^[[:space:]]*- \\[ \\] ${escaped_id}[[:space:]]"
+            local sed_unchecked_pattern="^[[:space:]]*- \\[ \\] ${escaped_id}([[:space:]]|$)"
@@
-                sed -i '' "s/^\\([[:space:]]*\\)- \\[ \\] \\(${escaped_id}[[:space:]]\\)/\\1- [x] \\2/" "$todo_file"
+                sed -i '' -E "s/^([[:space:]]*)- \\[ \\] (${escaped_id})([[:space:]].*)?$/\\1- [x] \\2\\3/" "$todo_file"
             else
-                sed -i '' "s/^\\([[:space:]]*\\)- \\[ \\] \\(${escaped_id}[[:space:]].*\\)\$/\\1- [x] \\2 completed:$today_short/" "$todo_file"
+                sed -i '' -E "s/^([[:space:]]*)- \\[ \\] (${escaped_id})([[:space:]].*)?$/\\1- [x] \\2\\3 completed:$today/" "$todo_file"
             fi
🤖 Prompt for AI Agents
In @.agent/scripts/version-manager.sh around lines 551 - 604, In
auto_mark_tasks_complete(), the grep/sed patterns require a trailing space after
the task ID and use today_short; update the regexes to allow the task ID to be
followed by either whitespace or end-of-line (e.g., use "(?:$|[[:space:]])" or a
word-boundary-style pattern) for unchecked_pattern, checked_pattern and
sed_unchecked_pattern (and the sed match groups that reference ${escaped_id}),
and replace uses of today_short with the full ISO timestamp variable today when
appending the completed: timestamp so completed entries use the full timestamp.

marcusquinn added a commit that referenced this pull request Jan 25, 2026
New features documented:
- /performance command for web performance audits (PR #209)
- /email-health-check command for deliverability checks (PR #213)
- @debug-opengraph and @debug-favicon SEO subagents (PR #206)
- Auto-task completion from commit messages (PR #208)

Updated Core Capabilities section with new monitoring features.
@augmentcode
Copy link

augmentcode bot commented Jan 25, 2026

🤖 Augment PR Summary

Summary: The release workflow now auto-completes TODO tasks referenced by recent commits.

Changes:

  • Parse commit subjects since the last tag to extract `t###` and subtask IDs.
  • Update TODO.md by checking matching tasks and appending a completed: date.
  • Stage TODO.md as part of the release commit.
  • Add CLI commands list-task-ids / auto-mark-tasks and document them in release.md.

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


# Extract task IDs (t001, t001.1, etc.) from commit messages
# Patterns: t001, feat(t001):, fix(t002):, closes t003, completes t004, mark t005
echo "$commits" | grep -oE '\bt[0-9]{3}(\.[0-9]+)*\b' | sort -u
Copy link

Choose a reason for hiding this comment

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

grep -E doesn’t treat \b as a word boundary (commonly it’s a backspace in POSIX ERE), so this extraction may return no task IDs and the auto-marking logic won’t run.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

[[ -z "$task_id" ]] && continue

# Build regex patterns (avoids shellcheck SC1087 false positive with [[:space:]])
local unchecked_pattern="^[[:space:]]*- \\[ \\] ${task_id}[[:space:]]"
Copy link

Choose a reason for hiding this comment

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

$task_id is interpolated directly into an ERE; for subtasks like t001.1, the . will be treated as “any character”, which can cause incorrect matches in TODO.md.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

marcusquinn added a commit that referenced this pull request Jan 25, 2026
New features documented:
- /performance command for web performance audits (PR #209)
- /email-health-check command for deliverability checks (PR #213)
- @debug-opengraph and @debug-favicon SEO subagents (PR #206)
- Auto-task completion from commit messages (PR #208)

Updated Core Capabilities section with new monitoring features.
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