-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add readme-helper.sh for dynamic count management #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- New script: readme-helper.sh with commands: - counts: Show current agent/script counts - check: Verify if README counts are stale - update: Update README counts (with --apply flag) - Updated full-loop.md: Added README check step for aidevops repo - Updated readme-create-update.md: Added dynamic counts guidance - Updated readme.md command: Added helper script reference This enables automated README maintenance and prevents count staleness.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (4)
Note Other AI code review bot(s) detectedCodeRabbit 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. 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 new shell script, 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: Wed Jan 21 01:02:41 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this 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 very useful readme-helper.sh script to automate the management of dynamic counts in the README.md file. This is a great step towards improving maintainability and ensuring documentation doesn't become stale. The script is well-structured, and the updates to the documentation files are clear. I have a few suggestions for the script to improve its performance and robustness.
.agent/scripts/readme-helper.sh
Outdated
| @@ -0,0 +1,309 @@ | |||
| #!/bin/bash | |||
| # shellcheck disable=SC2034,SC2155 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shellcheck disable=SC2034 for unused variables appears to be unnecessary as all variables seem to be used within the script. It's good practice to remove suppression comments that are no longer needed to ensure shellcheck can catch future issues. Could you please remove SC2034 from the disable list?
| # shellcheck disable=SC2034,SC2155 | |
| # shellcheck disable=SC2155 |
| # Count main agents (*.md files in .agent/ root, excluding AGENTS.md) | ||
| count_main_agents() { | ||
| local count | ||
| count=$(find "$AGENT_DIR" -maxdepth 1 -name "*.md" -type f ! -name "AGENTS.md" 2>/dev/null | wc -l | tr -d ' ') | ||
| echo "$count" | ||
| return 0 | ||
| } | ||
|
|
||
| # Count subagent markdown files (all .md files in subdirectories) | ||
| count_subagents() { | ||
| local count | ||
| count=$(find "$AGENT_DIR" -mindepth 2 -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ') | ||
| echo "$count" | ||
| return 0 | ||
| } | ||
|
|
||
| # Count helper scripts | ||
| count_scripts() { | ||
| local count | ||
| count=$(find "$AGENT_DIR/scripts" -name "*.sh" -type f 2>/dev/null | wc -l | tr -d ' ') | ||
| echo "$count" | ||
| return 0 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The counting functions (count_main_agents, count_subagents, count_scripts) are called in multiple places, which results in running find repeatedly. On large repositories, this could be inefficient. To improve performance, you could calculate all counts once at the beginning of the script execution and store them in global variables. These cached values can then be used throughout the script.
For example, you could implement caching like this:
# At the top of the script
_main_agents_count=""
_subagents_count=""
_scripts_count=""
# A function to populate counts if not already done
_ensure_counts() {
if [[ -z "$_main_agents_count" ]]; then
_main_agents_count=$(find "$AGENT_DIR" -maxdepth 1 -name "*.md" -type f ! -name "AGENTS.md" 2>/dev/null | wc -l | tr -d ' ')
_subagents_count=$(find "$AGENT_DIR" -mindepth 2 -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
_scripts_count=$(find "$AGENT_DIR/scripts" -name "*.sh" -type f 2>/dev/null | wc -l | tr -d ' ')
fi
}
# Modified counting function
count_main_agents() {
_ensure_counts
echo "$_main_agents_count"
}
# ... and so on for other count functions.| case "$1" in | ||
| --apply) apply="true"; shift ;; | ||
| *) file="$1"; shift ;; | ||
| esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument parsing for the update command currently allows multiple file arguments, with the last one taking precedence. The help text update [file] suggests that only one file should be processed. To make the script more robust and prevent unexpected behavior, it would be better to add a check to ensure that only one file argument is provided.
| case "$1" in | |
| --apply) apply="true"; shift ;; | |
| *) file="$1"; shift ;; | |
| esac | |
| case "$1" in | |
| --apply) apply="true"; shift ;; | |
| *) | |
| if [[ -n "$file" ]]; then | |
| print_error "The update command accepts only one file argument." | |
| return 1 | |
| fi | |
| file="$1" | |
| shift | |
| ;; | |
| esac |
🤖 Augment PR SummarySummary: This PR adds a dedicated helper script to keep README “dynamic counts” (agents/subagents/scripts) from going stale and updates internal docs to reference the new workflow. Changes:
Technical Notes: The script assumes the repo layout under 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.agent/scripts/readme-helper.sh
Outdated
| # Count helper scripts | ||
| count_scripts() { | ||
| local count | ||
| count=$(find "$AGENT_DIR/scripts" -name "*.sh" -type f 2>/dev/null | wc -l | tr -d ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With set -euo pipefail, a missing $AGENT_DIR/scripts directory will make this find pipeline fail and terminate the script (even though stderr is redirected), which makes counts/check brittle outside the expected repo layout. Consider guarding for missing dirs and treating the count as 0.
🤖 Was this useful? React with 👍 or 👎
.agent/scripts/readme-helper.sh
Outdated
| # Calculate approximate values | ||
| local approx_scripts approx_subagents | ||
| approx_scripts=$((scripts / 10 * 10)) | ||
| approx_subagents=$((subagents / 50 * 50)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update_readme_counts floors approx_subagents to a multiple of 50 unconditionally, but get_approximate_counts rounds to nearest 10 when <200, so check can suggest e.g. 190+ while update writes 150+ for the same state. Consider aligning the rounding logic so check/update agree.
🤖 Was this useful? React with 👍 or 👎
- Remove unnecessary SC2034 shellcheck disable (Gemini feedback) - Add caching for count functions to avoid repeated find calls (Gemini) - Guard for missing directories, return 0 instead of failing (Augment) - Align rounding logic between check and update commands (Augment) - Both now use round_scripts() and round_subagents() functions - Consistent output: 150+ subagents, 130+ scripts
🔍 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: Wed Jan 21 01:07:00 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
Fix Codacy markdown linting issues in full-loop.md and readme-create-update.md
|
🔍 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: Wed Jan 21 01:09:06 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
* feat: add readme-helper.sh for dynamic count management - New script: readme-helper.sh with commands: - counts: Show current agent/script counts - check: Verify if README counts are stale - update: Update README counts (with --apply flag) - Updated full-loop.md: Added README check step for aidevops repo - Updated readme-create-update.md: Added dynamic counts guidance - Updated readme.md command: Added helper script reference This enables automated README maintenance and prevents count staleness. * fix: address review feedback for readme-helper.sh - Remove unnecessary SC2034 shellcheck disable (Gemini feedback) - Add caching for count functions to avoid repeated find calls (Gemini) - Guard for missing directories, return 0 instead of failing (Augment) - Align rounding logic between check and update commands (Augment) - Both now use round_scripts() and round_subagents() functions - Consistent output: 150+ subagents, 130+ scripts * style: add blank lines before fenced code blocks Fix Codacy markdown linting issues in full-loop.md and readme-create-update.md
* docs: improve README maintainability and add AI-CONTEXT block - Remove hardcoded version badge (2.66.0) - use dynamic GitHub release badge - Remove hardcoded lines of code badge - goes stale quickly - Add AI-CONTEXT block with quick reference for AI assistants - Fix Architecture section: remove duplicates, add proper structure - Update MCP badge to 20+ (approximate count) These changes follow maintainability guidelines from workflows/readme-create-update.md * fix: update version validator to accept dynamic GitHub release badge The validator now recognizes the dynamic GitHub release badge (img.shields.io/github/v/release) as the preferred approach over hardcoded version badges that go stale. This aligns with README maintainability guidelines that recommend avoiding hardcoded counts and versions. * fix: use approximate counts in AI-CONTEXT and Architecture sections Address CodeRabbit review feedback: - Change '14 main agents' to '~15 main agents' (approximate) - Change '130+ helper scripts' to '100+ helper scripts' (round number) This ensures counts remain accurate longer without frequent updates. * style: use h3 headings in AI-CONTEXT block for better semantic structure Address Gemini Code Assist feedback: - Change 'Key Commands' from bold to ### heading - Change 'Agent Structure' from bold to ### heading This improves machine readability and semantic consistency. * fix: make remaining agent count approximate Missed one hardcoded '14 domain agents' at line 892. Changed to '~15 domain agents' for consistency. * 🤖 AUTO-FIX: Apply code quality improvements ✅ AUTOMATED FIXES: - Applied Qlty auto-formatting - Fixed common shellcheck issues - Updated code quality standards 🔍 ANALYSIS: - SonarCloud: 323 code smells - Codacy: Analysis completed - Qlty: Auto-formatting applied Generated by: GitHub Actions Code Review Monitoring * feat(plan-plus): add agent design subagents for planning discussions (#132) Add build-agent and agent-review to Plan+ subagents list so users can discuss agent design patterns during planning mode before implementation. * feat: add readme-helper.sh for dynamic count management (#131) * feat: add readme-helper.sh for dynamic count management - New script: readme-helper.sh with commands: - counts: Show current agent/script counts - check: Verify if README counts are stale - update: Update README counts (with --apply flag) - Updated full-loop.md: Added README check step for aidevops repo - Updated readme-create-update.md: Added dynamic counts guidance - Updated readme.md command: Added helper script reference This enables automated README maintenance and prevents count staleness. * fix: address review feedback for readme-helper.sh - Remove unnecessary SC2034 shellcheck disable (Gemini feedback) - Add caching for count functions to avoid repeated find calls (Gemini) - Guard for missing directories, return 0 instead of failing (Augment) - Align rounding logic between check and update commands (Augment) - Both now use round_scripts() and round_subagents() functions - Consistent output: 150+ subagents, 130+ scripts * style: add blank lines before fenced code blocks Fix Codacy markdown linting issues in full-loop.md and readme-create-update.md * 🤖 AUTO-FIX: Apply code quality improvements ✅ AUTOMATED FIXES: - Applied Qlty auto-formatting - Fixed common shellcheck issues - Updated code quality standards 🔍 ANALYSIS: - SonarCloud: 324 code smells - Codacy: Analysis completed - Qlty: Auto-formatting applied Generated by: GitHub Actions Code Review Monitoring * chore(release): bump version to 2.67.0 - feat: add readme-helper.sh for dynamic count management (#131) - feat(plan-plus): add agent design subagents for planning discussions (#132) - docs: improve README maintainability and add AI-CONTEXT block (#130) Also fixes version-manager.sh to accept dynamic GitHub release badges. * 🤖 AUTO-FIX: Apply code quality improvements ✅ AUTOMATED FIXES: - Applied Qlty auto-formatting - Fixed common shellcheck issues - Updated code quality standards 🔍 ANALYSIS: - SonarCloud: 328 code smells - Codacy: Analysis completed - Qlty: Auto-formatting applied Generated by: GitHub Actions Code Review Monitoring * fix: consolidate version validation to single source of truth (#133) - Update validate-version-consistency.sh with aidevops.sh, package.json, marketplace.json checks - Refactor version-manager.sh to call standalone validator instead of duplicate logic - Add validation after marketplace.json sed update to catch silent failures - Update auto-version-bump.sh with complete file list Fixes issue where version-manager.sh had its own validation logic that drifted from validate-version-consistency.sh (used by CI), causing release v2.67.0 to fail initially when PR #130 updated only the standalone script. * docs: add changelog entry for version validation fix * chore(release): bump version to 2.67.1 * 🤖 AUTO-FIX: Apply code quality improvements ✅ AUTOMATED FIXES: - Applied Qlty auto-formatting - Fixed common shellcheck issues - Updated code quality standards 🔍 ANALYSIS: - SonarCloud: 328 code smells - Codacy: Analysis completed - Qlty: Auto-formatting applied Generated by: GitHub Actions Code Review Monitoring * fix: handle dynamic GitHub release badge in version-manager.sh (#134) The README.md now uses a dynamic GitHub release badge instead of a hardcoded version badge. The version-manager.sh was still trying to update the hardcoded badge and failing when it wasn't found, which caused it to return early before updating marketplace.json. Changes: - Check for dynamic badge (img.shields.io/github/v/release) first - Skip README update if dynamic badge is used (GitHub handles it) - Only update hardcoded badge if present - Warn if no version badge found (non-fatal) This fixes the issue where marketplace.json wasn't being updated during releases because the README validation failed first. * docs: add changelog entry for dynamic badge fix * chore(release): bump version to 2.67.2 * docs: add /add-skill command to README - Add /add-skill to Meta/Improvement slash commands table - Add 'Importing External Skills' section under Cross-Tool Compatibility - Document supported formats (SKILL.md, AGENTS.md, .cursorrules) - Document features (conflict detection, version tracking, symlinks) * style: add blank line before heading in CHANGELOG (MD022) --------- Co-authored-by: GitHub Action <action@github.com>



Summary
Adds tooling to manage dynamic counts in README.md, preventing staleness issues identified in PR #130.
Changes
New Script:
readme-helper.shUpdated Workflows
full-loop.mdreadme-create-update.mdreadme.mdcommandTesting
Related