Skip to content

feat: add /list-todo and /show-plan commands#126

Merged
marcusquinn merged 4 commits intomainfrom
feature/list-todo-show-plan-commands
Jan 19, 2026
Merged

feat: add /list-todo and /show-plan commands#126
marcusquinn merged 4 commits intomainfrom
feature/list-todo-show-plan-commands

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 19, 2026

Summary

  • Add /list-todo command for fast task listing with sorting and filtering
  • Add /show-plan command for detailed plan information display
  • Both commands use helper scripts for instant output (no AI parsing delay)

New Files

Scripts

  • list-todo-helper.sh (~760 lines) - Parse TODO.md with options:

    • --priority, --estimate, --date, --alpha for sorting
    • -t TAG, -o OWNER, --status, --estimate-filter for filtering
    • --plans, --done, --all, --compact, --json for display
  • show-plan-helper.sh (~580 lines) - Parse PLANS.md with options:

    • Fuzzy match by name or exact match by plan ID
    • --list for plan overview
    • --current for plan related to current branch
    • --json for programmatic use

Command Subagents

  • list-todo.md - Delegates to script, fallback to manual parsing
  • show-plan.md - Delegates to script, fallback to manual parsing

Testing

# List all tasks
.agent/scripts/list-todo-helper.sh

# Filter by tag
.agent/scripts/list-todo-helper.sh -t seo

# Quick wins under 2 hours
.agent/scripts/list-todo-helper.sh --estimate-filter "<2h"

# Show specific plan
.agent/scripts/show-plan-helper.sh opencode

# List all plans
.agent/scripts/show-plan-helper.sh --list

Compatibility

  • Compatible with bash 3.2 (macOS default)
  • ShellCheck clean (one expected SC2034 for reserved GROUP_BY variable)

Summary by CodeRabbit

  • New Features

    • Interactive task viewer to list/filter/sort TODOs (priority, estimate, date, alpha) with tag/owner/status/estimate filters, compact/all/done views, limits, and post-display actions.
    • Plan inspector to list plans, show plan details by name or from branch, and initiate "start work" flows.
    • Flexible outputs: Markdown and JSON export, color toggle, and command-line examples.
  • Documentation

    • Added step-by-step usage guides and examples for the task viewer and plan inspector.

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

- list-todo-helper.sh: Fast task listing with sorting/filtering options
  - Sort by priority, estimate, date, or alphabetically
  - Filter by tag, owner, status, or estimate range
  - Output as markdown tables or JSON
  - Include plans with --plans flag

- show-plan-helper.sh: Display detailed plan information
  - Fuzzy match by plan name or exact match by ID
  - Show purpose, progress, decisions, discoveries
  - List related tasks from TODO.md
  - Support --list for plan overview

- Command subagents delegate to scripts for instant output
- Fallback to manual parsing if scripts unavailable
- Compatible with bash 3.2 (macOS default)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds two CLI command docs and two Bash helper scripts that parse project TODO.md/PLANS.md, provide multi-criteria filtering, sorting, and formatting, return Markdown or JSON, and support interactive post-display actions and Git-branch-based plan inference.

Changes

Cohort / File(s) Summary
Command docs
.agent/scripts/commands/list-todo.md, .agent/scripts/commands/show-plan.md
New docs describing CLI usage, arguments, quick/fallback flows, examples, output formats, and interactive post-display actions (selecting tasks/plans, start-work flow).
Task listing helper
.agent/scripts/list-todo-helper.sh
New Bash script: discovers project root, parses TODO.md/optional PLANS.md into structured tasks/plans, supports sorting (priority/estimate/date/alpha), filters (tag/owner/status/estimate ranges), limits, grouping placeholders, color toggle, and Markdown/JSON output; safe temp-file handling and error on missing TODO.md.
Plan display helper
.agent/scripts/show-plan-helper.sh
New Bash script: discovers PLANS.md/TODO.md, lists plans, resolves plan by fuzzy name/ID/--current (via Git branch), parses plan fields, finds related tasks, and outputs formatted Markdown or JSON with color toggle and error handling.
Changelog
CHANGELOG.md
Minor formatting edit (blank line inserted).

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant CLI as list-todo Command
    participant Helper as list-todo-helper.sh
    participant Files as TODO.md / PLANS.md

    User->>CLI: run list-todo with options
    CLI->>Helper: forward args (sort, filter, format)
    Helper->>Helper: locate project root (find TODO.md)
    Helper->>Files: read/parse TODO.md
    alt --plans flag
        Helper->>Files: read/parse PLANS.md
    end
    Helper->>Helper: filter & sort tasks
    Helper->>Helper: format output (Markdown or JSON)
    Helper->>CLI: return results
    CLI->>User: display results (interactive prompt possible)
Loading
sequenceDiagram
    actor User
    participant CLI as show-plan Command
    participant Helper as show-plan-helper.sh
    participant PLANS as PLANS.md
    participant TODO as TODO.md
    participant Git as Git Branch

    User->>CLI: request plan by name/ID or --current
    CLI->>Helper: pass identifier or --current
    alt --current
        Helper->>Git: read branch name
        Helper->>PLANS: fuzzy-match plan from branch hint
    else name/ID
        Helper->>PLANS: lookup plan by name or pID
    end
    Helper->>PLANS: extract plan block & metadata
    Helper->>TODO: find related tasks referencing plan
    Helper->>Helper: format plan (Markdown/JSON)
    Helper->>CLI: return plan details
    CLI->>User: display plan and actions (start work, view tasks)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

✨ A script to list and one to show,
Tasks and plans in tidy row,
Filters, sorts, and JSON bright,
Branch-born plans come into sight,
Devs click, the workflow starts to glow.

🚥 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 summarizes the main addition: two new commands (/list-todo and /show-plan) with their supporting helper scripts and documentation files.
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.


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 significantly enhances the system's task and plan management capabilities by introducing two new commands, '/list-todo' and '/show-plan'. These commands are designed to provide users with quick and efficient access to their project's tasks and plans, offering a rich set of options for filtering, sorting, and displaying information. The primary goal is to streamline workflow management and improve user interaction with project documentation by providing immediate, script-driven feedback.

Highlights

  • New Commands Added: Introduced two new commands: '/list-todo' for task listing and '/show-plan' for detailed plan information.
  • Fast Script-Based Output: Both new commands leverage dedicated helper scripts ('list-todo-helper.sh' and 'show-plan-helper.sh') to provide instant output, bypassing potential AI parsing delays.
  • Comprehensive Task Management: The '/list-todo' command offers extensive sorting options (priority, estimate, date, alphabetical) and filtering capabilities (by tag, owner, status, estimate range) for tasks from TODO.md and PLANS.md.
  • Detailed Plan Viewing: The '/show-plan' command allows users to view detailed information about specific plans from PLANS.md, supporting fuzzy matching by name, exact ID, or by detecting the plan related to the current Git branch.
  • Robust Fallback Mechanisms: Each command includes a fallback mechanism to manually parse files if the helper scripts are unavailable or fail, ensuring functionality.
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, 274 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Jan 19 02:10:13 UTC 2026: Code review monitoring started
Mon Jan 19 02:10:14 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 274
Mon Jan 19 02:10:14 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Mon Jan 19 02:10:16 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 274
  • VULNERABILITIES: 0

Generated on: Mon Jan 19 02:10:56 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 introduces two new commands, /list-todo and /show-plan, along with their respective helper scripts. These commands provide fast, script-based task and plan listing and detailed display, with options for sorting, filtering, and output formats (markdown or JSON). The implementation demonstrates a good understanding of shell scripting best practices, including robust argument parsing, temporary file handling, and error management. However, there are some areas for improvement regarding the robustness of content parsing in the helper scripts and clarity in the markdown documentation.

Comment on lines 177 to 223
if [[ "$line" =~ ^####[[:space:]]+Decision ]]; then
in_purpose=false
in_progress=false
in_decisions=true
in_discoveries=false
in_context=false
continue
fi

if [[ "$line" =~ ^####[[:space:]]+Surprises ]]; then
in_purpose=false
in_progress=false
in_decisions=false
in_discoveries=true
in_context=false
continue
fi

if [[ "$line" =~ ^####[[:space:]]+Context ]]; then
in_purpose=false
in_progress=false
in_decisions=false
in_discoveries=false
in_context=true
continue
fi

# Skip TOON blocks
[[ "$line" =~ ^\<\!--TOON ]] && continue
[[ "$line" =~ ^--\> ]] && continue

# Accumulate content
if $in_purpose && [[ -n "$line" ]]; then
purpose+="$line"$'\n'
fi
if $in_progress && [[ "$line" =~ ^-\ \[ ]]; then
progress+="$line"$'\n'
fi
if $in_decisions && [[ "$line" =~ ^-\ \*\*Decision ]]; then
decisions+="$line"$'\n'
fi
if $in_discoveries && [[ "$line" =~ ^-\ \*\*Observation ]]; then
discoveries+="$line"$'\n'
fi
if $in_context && [[ -n "$line" ]]; then
context+="$line"$'\n'
fi

Choose a reason for hiding this comment

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

critical

The parse_plan_content function currently only captures the first line of multi-line sections like 'Decisions' and 'Discoveries'. For example, a decision with a rationale and date will only have the 'Decision' line captured, leading to data loss. This is a critical correctness issue as it prevents the full plan details from being processed and displayed.

Suggested change
if [[ "$line" =~ ^####[[:space:]]+Decision ]]; then
in_purpose=false
in_progress=false
in_decisions=true
in_discoveries=false
in_context=false
continue
fi
if [[ "$line" =~ ^####[[:space:]]+Surprises ]]; then
in_purpose=false
in_progress=false
in_decisions=false
in_discoveries=true
in_context=false
continue
fi
if [[ "$line" =~ ^####[[:space:]]+Context ]]; then
in_purpose=false
in_progress=false
in_decisions=false
in_discoveries=false
in_context=true
continue
fi
# Skip TOON blocks
[[ "$line" =~ ^\<\!--TOON ]] && continue
[[ "$line" =~ ^--\> ]] && continue
# Accumulate content
if $in_purpose && [[ -n "$line" ]]; then
purpose+="$line"$'\n'
fi
if $in_progress && [[ "$line" =~ ^-\ \[ ]]; then
progress+="$line"$'\n'
fi
if $in_decisions && [[ "$line" =~ ^-\ \*\*Decision ]]; then
decisions+="$line"$'\n'
fi
if $in_discoveries && [[ "$line" =~ ^-\ \*\*Observation ]]; then
discoveries+="$line"$'\n'
fi
if $in_context && [[ -n "$line" ]]; then
context+="$line"$'\n'
fi
if $in_decisions; then
decisions+="$line"$'
'
fi
if $in_discoveries; then
discoveries+="$line"$'
'
fi
if $in_context && [[ -n "$line" ]]; then
context+="$line"$'
'
fi

Comment on lines +464 to +475

# Read next few lines for status and estimate
while IFS= read -r meta_line; do
if [[ "$meta_line" =~ ^\*\*Status:\*\*[[:space:]]+(.+)$ ]]; then
status="${BASH_REMATCH[1]}"
elif [[ "$meta_line" =~ ^\*\*Estimate:\*\*[[:space:]]+(.+)$ ]]; then
estimate="${BASH_REMATCH[1]}"
break
elif [[ "$meta_line" =~ ^#### ]]; then
break
fi
done

Choose a reason for hiding this comment

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

high

The list_plans function's logic for extracting status and estimate by reading "next few lines" is fragile. It assumes a fixed order and immediate presence of these metadata lines after the plan title. If the PLANS.md format changes (e.g., new fields are added, or order is altered), this parsing could easily break or return incorrect information. A more robust approach would be to parse the entire plan section (similar to extract_plan) and then extract specific fields using regex or string manipulation.

Suggested change
# Read next few lines for status and estimate
while IFS= read -r meta_line; do
if [[ "$meta_line" =~ ^\*\*Status:\*\*[[:space:]]+(.+)$ ]]; then
status="${BASH_REMATCH[1]}"
elif [[ "$meta_line" =~ ^\*\*Estimate:\*\*[[:space:]]+(.+)$ ]]; then
estimate="${BASH_REMATCH[1]}"
break
elif [[ "$meta_line" =~ ^#### ]]; then
break
fi
done
# Read next few lines for status and estimate
local plan_metadata_lines=""
local current_line
while IFS= read -r current_line; do
if [[ "$current_line" =~ ^#### ]]; then # Stop at next section header
break
fi
plan_metadata_lines+="$current_line"$'
'
done
if [[ "$plan_metadata_lines" =~ \*\*Status:\*\*[[:space:]]+(.+)$ ]]; then
status="${BASH_REMATCH[1]}"
fi
if [[ "$plan_metadata_lines" =~ \*\*Estimate:\*\*[[:space:]]+(.+)$ ]]; then
estimate="${BASH_REMATCH[1]}"
fi

Comment on lines 95 to 96
1. Work on a specific task (enter task ID like `t014` or number)
2. Filter/sort differently

Choose a reason for hiding this comment

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

medium

The options for user input in the "Output Format" section could be more explicit. "number" is vague; it would be clearer to specify that it refers to the # column in the tables. This improves user experience by removing ambiguity.

Suggested change
1. Work on a specific task (enter task ID like `t014` or number)
2. Filter/sort differently
1. Work on a specific task (enter task ID like `t014` or the number from the `#` column)
2. Filter/sort differently

Comment on lines 105 to 106
2. **Filter command** - Re-run with new filters
3. **"done" or "3"** - End browsing

Choose a reason for hiding this comment

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

medium

Similar to the previous comment, the "number" option for task selection should be more explicit. Additionally, the options "Filter command" and "Done browsing" are described with phrases like "Re-run with new filters" and "End browsing", but the actual input expected (e.g., "2" or "3") is not explicitly mentioned alongside these phrases, which could lead to confusion.

Suggested change
2. **Filter command** - Re-run with new filters
3. **"done" or "3"** - End browsing
1. **Task ID or number (from `#` column)** - Start working on that task
2. **Filter command (e.g., `--priority`)** - Re-run with new filters

Comment on lines 106 to 107
1. **"1" or "start"** - Begin working on the plan
- Run pre-edit check

Choose a reason for hiding this comment

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

medium

The options for user input in the "After Display" section are not fully consistent with the examples provided. While "1" is shown, "start" is not explicitly listed as an option in the "Output Format" section. For clarity, ensure that all valid user inputs are either explicitly listed or clearly implied by the output format.

Suggested change
1. **"1" or "start"** - Begin working on the plan
- Run pre-edit check
1. **"1"** - Begin working on the plan
- Run pre-edit check

Comment on lines 112 to 113
- Re-run `/show-plan <name>`

Choose a reason for hiding this comment

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

medium

The option "plan name" is mentioned as a valid input, but it's not explicitly presented as one of the numbered options in the "Output Format" section. This could cause confusion for users trying to navigate the options.

Suggested change
- Re-run `/show-plan <name>`
2. **"2"** - View another plan (e.g., `/show-plan <name>`)

Comment on lines +115 to +116
- Run `/list-todo`

Choose a reason for hiding this comment

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

medium

The option "back" is mentioned as a valid input, but it's not explicitly presented as one of the numbered options in the "Output Format" section. For consistency and clarity, ensure all valid inputs are clearly documented.

Suggested change
- Run `/list-todo`
3. **"3"** - Return to task list

Comment on lines +218 to +219
local desc=""
desc=$(echo "$line" | sed 's/^[[:space:]]*- \[[^]]*\][[:space:]]*//' | sed 's/^t[0-9.]*[[:space:]]*//' | sed 's/[[:space:]]*#[^[:space:]].*$//' | sed 's/[[:space:]]*~[^[:space:]].*$//' | sed 's/[[:space:]]*@[^[:space:]].*$//' | sed 's/[[:space:]]*→.*$//' | sed 's/[[:space:]]*logged:.*$//' | sed 's/[[:space:]]*blocked-by:.*$//' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')

Choose a reason for hiding this comment

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

medium

The sed command used for extracting the task description is very long and complex. While it works, it's brittle and hard to read or maintain. A slight change in the TODO.md format could easily break this. Consider breaking it down into multiple sed commands or using awk for more structured field extraction, which can be more robust and readable.

Suggested change
local desc=""
desc=$(echo "$line" | sed 's/^[[:space:]]*- \[[^]]*\][[:space:]]*//' | sed 's/^t[0-9.]*[[:space:]]*//' | sed 's/[[:space:]]*#[^[:space:]].*$//' | sed 's/[[:space:]]*~[^[:space:]].*$//' | sed 's/[[:space:]]*@[^[:space:]].*$//' | sed 's/[[:space:]]*→.*$//' | sed 's/[[:space:]]*logged:.*$//' | sed 's/[[:space:]]*blocked-by:.*$//' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
desc=$(echo "$line" | sed -E 's/^[[:space:]]*- \[[^]]*\][[:space:]]*//' \
-E 's/^t[0-9.]*[[:space:]]*//' \
-E 's/[[:space:]]*#[^[:space:]].*$//' \
-E 's/[[:space:]]*~[^[:space:]].*$//' \
-E 's/[[:space:]]*@[^[:space:]].*$//' \
-E 's/[[:space:]]*→.*$//' \
-E 's/[[:space:]]*logged:.*$//' \
-E 's/[[:space:]]*blocked-by:.*$//' \
-E 's/^[[:space:]]*//;s/[[:space:]]*$//')

@augmentcode
Copy link

augmentcode bot commented Jan 19, 2026

🤖 Augment PR Summary

Summary: Adds two new agent commands to surface project work items quickly without AI parsing.

Changes:

  • Introduces /list-todo plus list-todo-helper.sh to parse TODO.md, supporting sorting, filtering, compact/table output, and JSON.
  • Introduces /show-plan plus show-plan-helper.sh to extract a plan section from todo/PLANS.md, with fuzzy matching, --list, --current, and JSON output.
  • Both helpers auto-detect the project root by walking up until TODO.md is found.

Technical Notes: Scripts run with set -euo pipefail, use temp files + traps, and explicitly skip the TODO.md Format section/code blocks to avoid parsing examples.

🤖 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. 3 suggestions posted.

Fix All in Augment

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

fi
elif [[ "$line" =~ ^\*\*Estimate:\*\*[[:space:]]+(.+)$ ]]; then
plan_est="${BASH_REMATCH[1]}"
elif [[ "$line" =~ ^-\ \[\ \].*Phase[[:space:]]+([0-9]+):(.+) ]] && [[ -z "$plan_next" ]]; then
Copy link

Choose a reason for hiding this comment

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

The plan_next regex has a trailing ]], so it won’t match real - [ ] ... Phase N: lines and plan_next will likely stay empty. This makes the “Next Phase” column blank/misleading.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

fi

# Detect section change (end of active plans)
if [[ "$line" =~ ^##[[:space:]]+(Completed|Archived)[[:space:]]+Plans ]]; then
Copy link

Choose a reason for hiding this comment

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

After hitting ## Completed/Archived Plans, you set in_plan=false but the ### [date] Title header matcher above will still start parsing/emitting plans in those sections. This can cause completed plans to show up as “active” (and inflate plan_count).

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

# Extract potential plan name from branch
# e.g., feature/list-todo-show-plan-commands -> list-todo-show-plan
local plan_hint
plan_hint=$(echo "$branch" | sed 's|^[^/]*/||' | sed 's/-commands$//' | sed 's/-helper$//' | tr '-' ' ')
Copy link

Choose a reason for hiding this comment

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

For --current, plan_hint turns hyphens into spaces, but extract_plan does a raw substring match against the plan title (which often contains hyphens like aidevops-opencode Plugin). That makes --current likely to miss the intended plan unless titles/branches share identical punctuation.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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

🤖 Fix all issues with AI agents
In @.agent/scripts/commands/list-todo.md:
- Around line 25-66: Replace lowercase "markdown" with "Markdown" in the docs so
the term is capitalized consistently; specifically update the occurrences in the
heading/step text "Format as markdown tables" and the "Output Format" line "The
script outputs markdown tables:" (and any other instances of "markdown" in this
file) to "Format as Markdown tables" and "The script outputs Markdown tables:"
respectively.

In @.agent/scripts/commands/show-plan.md:
- Around line 52-55: In the "## Output Format" section update the lowercase word
"markdown" to "Markdown" for consistent capitalization; locate the phrase
"markdown" in that section and change it to "Markdown" so the document treats
the term as a proper noun consistently.
- Around line 121-124: The fenced code block under the "Check branch status"
section is missing blank lines around it; edit the markdown in show-plan.md so
there is a blank line after the "1. **Check branch status:**" heading and a
blank line after the closing ``` fenced block that contains the command
~/.aidevops/agents/scripts/pre-edit-check.sh, ensuring the block is wrapped by
empty lines as Codacy expects.

In @.agent/scripts/list-todo-helper.sh:
- Around line 338-345: The tag filter currently lowercases FILTER_TAG and tags
then uses the regex operator ([[ ! "$tags_lower" =~ $tag_lower ]]) which treats
user input as a regex; change it to a literal, case-insensitive substring check
to avoid regex interpretation errors by replacing the regex match with a plain
substring test (e.g., using the shell pattern "*$tag_lower*" against tags_lower
or using grep -F -i) so FILTER_TAG, tag_lower, tags_lower and the surrounding if
block perform safe literal matching and return 1 when the lowercase FILTER_TAG
is not contained in tags_lower.
- Around line 261-325: The parse_plans function currently continues treating
subsequent "###" headers as active plans even after a "## Completed/Archived
Plans" section is hit; add and use an active_section flag (e.g.,
active_section=true initially) and set active_section=false when the regex
matching ^##[[:space:]]+(Completed|Archived)[[:space:]]+Plans is encountered,
then only start a new plan (the block that sets plan_title, plan_status,
in_plan, etc.) when active_section is true; also ensure the final output of the
last plan checks active_section or in_plan to avoid emitting completed/archived
plans.
- Around line 584-648: The output_json function only escapes quotes and will
break on backslashes/newlines; add a json_escape helper (e.g., json_escape())
that replaces backslash, newline, carriage return, tab, and double-quote with
safe JSON escapes, then call this helper for every string field emitted by
output_json (desc, tags, owner, logged, blocked_by, title, next, status, est
where treated as strings) before using printf; ensure the Plans branch also
applies json_escape to title, status, est, next and keep numeric fields
(phase,total) unescaped, and use the escaped variables in the existing printf
calls so all JSON string values are robustly escaped.
- Around line 687-755: The main() option parser does not validate that
value-taking flags actually have a following argument (flags: --tag/ -t,
--owner/ -o, --status, --estimate-filter, --group-by/ -g, --limit) so with set
-u the script can hard-exit; update the case branch in main() (the option
parsing block) to check that "$2" is non-empty before assigning FILTER_TAG,
FILTER_OWNER, FILTER_STATUS, FILTER_ESTIMATE, GROUP_BY and LIMIT, print a clear
error and exit if missing, and for --limit additionally validate that the
supplied value is numeric (e.g., use a digit check or regex) before assigning
LIMIT; ensure shifts only occur after validation so behavior of parse_tasks |
sort_tasks remains unchanged.

In @.agent/scripts/show-plan-helper.sh:
- Around line 186-193: The parser currently only recognizes "Surprises" headers
via the regex ^####[[:space:]]+Surprises and sets in_discoveries=true; update
that logic so the header matching also accepts "Discoveries" (e.g., match either
"Surprises" or "Discoveries") so the in_discoveries flag is set for both cases;
modify the conditional that uses ^####[[:space:]]+Surprises (or add a similar
conditional) so the code path that sets in_discoveries, clears the other in_*
flags, and continues will run when the header text is either "Surprises" or
"Discoveries".
- Around line 365-425: The output_json function currently produces fragile JSON
and writes error JSON to stderr; update output_json to fully escape backslashes,
quotes and newlines for all string fields produced from
extract_plan/parse_plan_content (title, purpose, progress, decisions,
discoveries, context and task descs) and ensure numeric fields (phase,
total_phases) are emitted as numbers or null when empty; write error JSON to
stdout (but still return non‑zero) when extract_plan fails; also ensure the
related_tasks loop in get_related_tasks/output_json emits commas correctly (use
a first-flag and printf) and preserves proper escaping so newlines do not break
the JSON structure.
🧹 Nitpick comments (2)
.agent/scripts/list-todo-helper.sh (1)

41-43: GROUP_BY is still unused after parsing.
Codacy flags this; if grouping isn’t shipping yet, consider removing the flag or wiring it into output to keep lint clean.

Also applies to: 700-701

.agent/scripts/commands/show-plan.md (1)

1-20: Keep command guidance anchored to AGENTS.md.
This adds operational guidance; consider adding a pointer or consolidating in AGENTS.md to avoid drift. Based on learnings, AGENTS.md is the single source of truth.

Comment on lines +261 to +325
# Parse plans from PLANS.md
parse_plans() {
local plans_file="$1"

[[ ! -f "$plans_file" ]] && return 0

local in_plan=false
local plan_title=""
local plan_status=""
local plan_est=""
local plan_phase="0"
local plan_total="0"
local plan_next=""

while IFS= read -r line; do
# Detect plan header (### [date] Title)
if [[ "$line" =~ ^###[[:space:]]+\[([0-9-]+)\][[:space:]]+(.+)$ ]]; then
# Output previous plan if exists
if [[ -n "$plan_title" ]]; then
echo "plan|$plan_title|$plan_status|$plan_est|$plan_phase|$plan_total|$plan_next"
fi
plan_title="${BASH_REMATCH[2]}"
# Remove trailing markers like ✓
plan_title="${plan_title% ✓}"
plan_status="Planning"
plan_est=""
plan_phase="0"
plan_total="0"
plan_next=""
in_plan=true
continue
fi

# Parse plan metadata
if $in_plan; then
if [[ "$line" =~ ^\*\*Status:\*\*[[:space:]]+(.+)$ ]]; then
plan_status="${BASH_REMATCH[1]}"
# Extract phase info if present
if [[ "$plan_status" =~ \(Phase[[:space:]]+([0-9]+)/([0-9]+)\) ]]; then
plan_phase="${BASH_REMATCH[1]}"
plan_total="${BASH_REMATCH[2]}"
elif [[ "$plan_status" =~ Completed ]]; then
plan_status="Completed"
fi
elif [[ "$line" =~ ^\*\*Estimate:\*\*[[:space:]]+(.+)$ ]]; then
plan_est="${BASH_REMATCH[1]}"
elif [[ "$line" =~ ^-\ \[\ \].*Phase[[:space:]]+([0-9]+):(.+) ]] && [[ -z "$plan_next" ]]; then
plan_next="Phase ${BASH_REMATCH[1]}:${BASH_REMATCH[2]}"
# Trim estimate from next phase and whitespace
plan_next=$(echo "$plan_next" | sed 's/~[0-9.]*[hmd].*$//' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
fi
fi

# Detect section change (end of active plans)
if [[ "$line" =~ ^##[[:space:]]+(Completed|Archived)[[:space:]]+Plans ]]; then
in_plan=false
fi

done < "$plans_file"

# Output last plan
if [[ -n "$plan_title" ]] && [[ "$plan_status" != "Completed" ]]; then
echo "plan|$plan_title|$plan_status|$plan_est|$plan_phase|$plan_total|$plan_next"
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 | 🟠 Major

Completed/Archived plans can leak into the active list.
After the Completed/Archived section header, headers are still parsed as active plans. That can surface completed plans as active if their status line is missing or non-standard.

🔧 Proposed fix
-    local in_plan=false
+    local in_plan=false
+    local in_active=true
@@
-        if [[ "$line" =~ ^##[[:space:]]+(Completed|Archived)[[:space:]]+Plans ]]; then
-            in_plan=false
-        fi
+        if [[ "$line" =~ ^##[[:space:]]+(Completed|Archived) ]]; then
+            in_active=false
+            in_plan=false
+            continue
+        fi
+        $in_active || continue
🤖 Prompt for AI Agents
In @.agent/scripts/list-todo-helper.sh around lines 261 - 325, The parse_plans
function currently continues treating subsequent "###" headers as active plans
even after a "## Completed/Archived Plans" section is hit; add and use an
active_section flag (e.g., active_section=true initially) and set
active_section=false when the regex matching
^##[[:space:]]+(Completed|Archived)[[:space:]]+Plans is encountered, then only
start a new plan (the block that sets plan_title, plan_status, in_plan, etc.)
when active_section is true; also ensure the final output of the last plan
checks active_section or in_plan to avoid emitting completed/archived plans.

- Fix Markdown capitalization in documentation
- Use literal substring match for tag filter (not regex)
- Add require_arg() validation for options requiring values
- Add json_escape() for proper JSON string escaping
- Match both 'Surprises' and 'Discoveries' headers
- Clarify user input options in docs
@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, 274 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Jan 19 02:31:59 UTC 2026: Code review monitoring started
Mon Jan 19 02:31:59 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 274
Mon Jan 19 02:31:59 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Mon Jan 19 02:32:01 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 274
  • VULNERABILITIES: 0

Generated on: Mon Jan 19 02:32:43 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Jan 19 02:34:41 UTC 2026: Code review monitoring started
Mon Jan 19 02:34:41 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 274
Mon Jan 19 02:34:41 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Mon Jan 19 02:34:43 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 274
  • VULNERABILITIES: 0

Generated on: Mon Jan 19 02:35:24 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

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

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 274
  • VULNERABILITIES: 0

Generated on: Mon Jan 19 02:58:33 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 8f3a208 into main Jan 19, 2026
9 checks passed
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