Skip to content

GH#3793: refactor command generator to eliminate code duplication#3971

Merged
marcusquinn merged 4 commits intomainfrom
refactor/command-generator-dedup
Mar 9, 2026
Merged

GH#3793: refactor command generator to eliminate code duplication#3971
marcusquinn merged 4 commits intomainfrom
refactor/command-generator-dedup

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

@marcusquinn marcusquinn commented Mar 9, 2026

Summary

Details

Each command definition previously repeated the same 5-line pattern:

  1. cat >"$OPENCODE_COMMAND_DIR/name.md" <<'EOF' with manually-written frontmatter
  2. Body content
  3. EOF
  4. ((++command_count))
  5. echo -e " ${GREEN}✓${NC} Created /name command"

The new create_command() function accepts name, description, agent, subtask flag, and body via stdin heredoc. Frontmatter is generated programmatically based on which fields are non-empty.

Verification

  • Script runs successfully, generating all 41 commands (same count as before)
  • Generated command files have correct frontmatter format (verified: agent+subtask, agent-only, no-agent variants)
  • ShellCheck clean (only SC1091 info about external source)
  • Output is functionally identical to the original

Review Findings Addressed

Finding Severity Source Status
Code duplication in command creation Critical Gemini (PR #70) Fixed in this PR
Post-increment ((var++)) across scripts Medium CodeRabbit (PR #70) Follow-up #3970
Augment review - no suggestions Medium Augment (PR #70) N/A

Closes #3793

Summary by CodeRabbit

  • Chores
    • Streamlined command generation for consistent, uniform command files across the toolset.
    • Added automatic discovery and safe importing of existing commands to expand available commands.
    • Normalized command text and messaging for clearer, more consistent output and presentation.
  • Bug Fixes
    • Improved error handling and reporting during command import and generation.

…ommand generator

The script had 41 manually-defined commands, each repeating the same
boilerplate: cat heredoc, frontmatter generation, counter increment,
and success message. This created ~316 lines of pure duplication.

Introduced create_command() function that accepts name, description,
agent, subtask flag, and body via stdin. Each command definition is
now a single function call with a heredoc body, eliminating all
repeated boilerplate.

Result: 1617 -> 1301 lines (-20%), same 41 commands generated,
identical output verified by running the script.

Addresses critical finding from PR #70 review (Gemini Code Assist):
'the script contains significant code duplication for command creation
that could be refactored into a function to improve maintainability'

Closes #3793
@github-actions github-actions bot added the refactor Auto-created from TODO.md tag label Mar 9, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 refactors the command generation script by introducing a reusable helper function. This change streamlines the creation of new commands, improves maintainability, and reduces the overall codebase size by eliminating redundant code blocks previously used for each command definition. The refactoring also addresses a critical code duplication finding and sets up a follow-up for another identified code pattern.

Highlights

  • Code Duplication Elimination: Introduced a create_command() helper function to centralize the logic for generating command definition files, removing repetitive boilerplate across 41 command definitions.
  • Script Size Reduction: The script .agents/scripts/generate-opencode-commands.sh was reduced from 1617 to 1301 lines, resulting in a 20% decrease in code size.
  • Follow-up Issue Creation: A follow-up issue (refactor: standardize on pre-increment ((++var)) across all shell scripts #3970) was created to address the ((var++)) post-increment pattern identified by CodeRabbit across multiple scripts.
Changelog
  • .agents/scripts/generate-opencode-commands.sh
    • Refactored command creation logic to use a new create_command helper function.
    • Removed boilerplate code for 41 command definitions.
    • Updated command definitions to call the create_command function.
    • Replaced with -> in command descriptions for consistency.
Activity
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
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 17 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 846127ac-0cf9-4a04-9cc8-20d30e797b17

📥 Commits

Reviewing files that changed from the base of the PR and between b6f792c and 1f5af07.

📒 Files selected for processing (1)
  • .agents/scripts/generate-opencode-commands.sh

Walkthrough

Introduces a parameterized create_command() helper and agent name constants in the OpenCode command generator script; replaces many inline command definitions with calls to the helper; adds auto-discovery to copy scripts/commands/*.md into the OpenCode command directory; normalizes messaging and fixes increment semantics.

Changes

Cohort / File(s) Summary
Command generator (single file)
\.agent/scripts/generate-opencode-commands.sh
Adds create_command(name, description, agent, subtask) helper and AGENT_BUILD/AGENT_SEO constants; replaces 40+ inline command definitions with helper calls; adds auto-discovery that copies scripts/commands/*.md into ${OPENCODE_COMMAND_DIR} (with error handling); normalizes text/punctuation and uses prefix increment ((++command_count)) consistently; updates final summary/output logic.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as Runner / CI
    participant Generator as generate-opencode-commands.sh
    participant Source as scripts/commands/*.md
    participant Target as ${OPENCODE_COMMAND_DIR}

    Runner->>Generator: execute script
    Generator->>Generator: define create_command(), AGENT_* constants
    Generator->>Generator: for each inline definition: call create_command(name, desc, agent, subtask)
    create_command-->>Target: write `${name}.md` (frontmatter + body)
    create_command-->>Generator: ++command_count, log success
    Generator->>Source: discover files
    Source-->>Generator: return .md files
    Generator->>Target: copy missing `.md` files (auto-discovery)
    Generator-->>Runner: print final summary (command_count, list)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • #698 — Moves/decouples when OpenCode command generation runs (setup orchestration), directly interacts with generation timing and placement.
  • #244 — Consolidates agent naming and overlaps in generated command definitions used in this generator.
  • #37 — Adds or extends auto-discovery/copying of scripts/commands/*.md, overlapping the same copy logic.

Poem

create_command sings, one helper to bind,
forty lone files now neatly aligned,
auto-discover scouts the markdown sea,
counters corrected, output tidy and free,
a small script dance — cleaner by design 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly summarizes the main refactoring effort to eliminate code duplication in the command generator through function extraction.
Linked Issues check ✅ Passed PR successfully addresses all coding requirements from #3793: eliminates postfix increment risk under set -e, reduces duplication via create_command() helper, extracts agent constants, and maintains functional output consistency.
Out of Scope Changes check ✅ Passed All changes directly support the refactoring objectives: create_command() helper, agent constants, command consolidation, and auto-discovery mechanism with proper error handling align with issue #3793 scope.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/command-generator-dedup

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Mar 9 07:32:20 UTC 2026: Code review monitoring started
Mon Mar 9 07:32:21 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 391

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 391
  • VULNERABILITIES: 0

Generated on: Mon Mar 9 07:32:23 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

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 is an excellent refactoring that significantly reduces code duplication by introducing the create_command helper function. The script is now much shorter and more maintainable. I have one suggestion to further improve the new helper function for clarity and efficiency.

…ect in create_command

Apply Gemini Code Assist review suggestion: stream frontmatter and body
directly to file using a command group {...} redirect instead of building
a multi-line string in a variable. Clearer logic and more idiomatic shell.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Mar 9 08:11:12 UTC 2026: Code review monitoring started
Mon Mar 9 08:11:12 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 391

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 391
  • VULNERABILITIES: 0

Generated on: Mon Mar 9 08:11:15 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

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.

🧹 Nitpick comments (3)
.agents/scripts/generate-opencode-commands.sh (3)

46-68: Well-structured helper function with correct increment pattern.

The create_command() helper cleanly eliminates the 41-instance boilerplate duplication. Key observations:

  1. Prefix increment ((++command_count)) — correctly addresses the critical set -e issue from PR #70 where postfix ((var++)) returns 1 when incrementing from 0, causing premature script exit.

  2. Command-group redirect {...} > file — idiomatic shell streaming per the review suggestion from commit 2.

  3. body=$(cat) — efficient stdin capture for heredoc content.

For additional robustness, consider validating name is non-empty to prevent writing to ${OPENCODE_COMMAND_DIR}/.md:

🛡️ Optional: Add parameter guard
 create_command() {
 	local name="$1"
+	[[ -n "$name" ]] || { echo "Error: command name required" >&2; return 1; }
 	local description="$2"

,

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/generate-opencode-commands.sh around lines 46 - 68, The
create_command() function should guard against an empty name to avoid creating a
file named "${OPENCODE_COMMAND_DIR}/.md": add a check at the start of
create_command() that verifies name is non-empty (e.g., [[ -n "$name" ]]) and if
empty emit an error via the existing logger/echo and return a non-zero status;
reference the create_command function, the name parameter, OPENCODE_COMMAND_DIR,
and command_count so the guard runs before any file write or increment occurs.

1203-1224: Auto-discovery logic is sound; consider explicit error handling for cp.

The deduplication logic and SKILL.md skip are correct. The [[ -f "$cmd_file" ]] || continue properly handles empty glob expansion.

One reliability consideration: if cp fails (permissions, disk full), the script continues silently but counts it as created:

🛡️ Optional: Handle cp failure
 		# Copy command file directly (it already has proper frontmatter)
-		cp "$cmd_file" "$OPENCODE_COMMAND_DIR/$cmd_name.md"
-		((++command_count))
-		echo -e "  ${GREEN}✓${NC} Auto-discovered /$cmd_name command"
+		if cp "$cmd_file" "$OPENCODE_COMMAND_DIR/$cmd_name.md"; then
+			((++command_count))
+			echo -e "  ${GREEN}✓${NC} Auto-discovered /$cmd_name command"
+		else
+			echo -e "  ${RED}✗${NC} Failed to copy /$cmd_name command" >&2
+		fi

Note: Per the relevant code snippets, auto-discovered commands from scripts/commands/ contain extended frontmatter fields (mode: subagent, tools:) that create_command() does not generate. This schema divergence appears intentional — manually-defined commands use the simpler schema while auto-discovered commands retain their richer metadata.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/generate-opencode-commands.sh around lines 1203 - 1224, The
script currently runs cp "$cmd_file" "$OPENCODE_COMMAND_DIR/$cmd_name.md"
without checking its exit status, then increments command_count and logs success
even if the copy failed; update the auto-discovery loop to check the result of
cp (e.g., test its exit status) and only ++command_count and echo the success
message when cp succeeds, while on failure emit a clear error (including
$cmd_file and $OPENCODE_COMMAND_DIR/$cmd_name.md) and continue without
incrementing; reference COMMANDS_DIR, OPENCODE_COMMAND_DIR, cmd_name, cp, and
command_count when making the change.

75-77: Consider extracting repeated agent name literals to constants.

SonarCloud flags 'Build+' used 36 times. For maintainability, define constants near the top of the script:

♻️ Proposed refactor
 command_count=0
+
+# Agent name constants
+readonly AGENT_BUILD="Build+"
+readonly AGENT_SEO="SEO"

 # =============================================================================
 # COMMAND CREATION HELPER

Then use throughout:

-create_command "agent-review" \
-	"Systematic review and improvement of agent instructions" \
-	"Build+" "true" <<'BODY'
+create_command "agent-review" \
+	"Systematic review and improvement of agent instructions" \
+	"$AGENT_BUILD" "true" <<'BODY'

This aligns with the Zero Technical Debt goal and makes future agent renames a single-line change.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/generate-opencode-commands.sh around lines 75 - 77, The
literal "Build+" is repeated many times (e.g., in create_command calls such as
create_command "agent-review" ... "Build+" ...) — define a single constant near
the top of the script (e.g., BUILD_PLUS="Build+") and replace every hard-coded
"Build+" occurrence with that constant (use the variable name in all
create_command invocations and other places), ensuring quoting/expansion is
correct for shell context so the behavior remains identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.agents/scripts/generate-opencode-commands.sh:
- Around line 46-68: The create_command() function should guard against an empty
name to avoid creating a file named "${OPENCODE_COMMAND_DIR}/.md": add a check
at the start of create_command() that verifies name is non-empty (e.g., [[ -n
"$name" ]]) and if empty emit an error via the existing logger/echo and return a
non-zero status; reference the create_command function, the name parameter,
OPENCODE_COMMAND_DIR, and command_count so the guard runs before any file write
or increment occurs.
- Around line 1203-1224: The script currently runs cp "$cmd_file"
"$OPENCODE_COMMAND_DIR/$cmd_name.md" without checking its exit status, then
increments command_count and logs success even if the copy failed; update the
auto-discovery loop to check the result of cp (e.g., test its exit status) and
only ++command_count and echo the success message when cp succeeds, while on
failure emit a clear error (including $cmd_file and
$OPENCODE_COMMAND_DIR/$cmd_name.md) and continue without incrementing; reference
COMMANDS_DIR, OPENCODE_COMMAND_DIR, cmd_name, cp, and command_count when making
the change.
- Around line 75-77: The literal "Build+" is repeated many times (e.g., in
create_command calls such as create_command "agent-review" ... "Build+" ...) —
define a single constant near the top of the script (e.g., BUILD_PLUS="Build+")
and replace every hard-coded "Build+" occurrence with that constant (use the
variable name in all create_command invocations and other places), ensuring
quoting/expansion is correct for shell context so the behavior remains
identical.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 80da831b-7628-4911-ad50-bd02244cba10

📥 Commits

Reviewing files that changed from the base of the PR and between fa50e7e and 3bedcd4.

📒 Files selected for processing (1)
  • .agents/scripts/generate-opencode-commands.sh

…ndling, agent constants

Address CodeRabbit review suggestions:
- Add parameter guard for empty name in create_command() to prevent writing to .md
- Wrap cp in auto-discovery loop with if/else for graceful error handling
- Extract AGENT_BUILD and AGENT_SEO constants to eliminate 40+ repeated literals

Verified: ShellCheck clean (SC1091 info only), 41 commands generated, frontmatter correct.
@marcusquinn
Copy link
Copy Markdown
Owner Author

All three CodeRabbit nitpick suggestions applied in commit b6f792c:

  1. Parameter guard (lines 46-68): Added [[ -n "$name" ]] guard at the top of create_command() to prevent writing to ${OPENCODE_COMMAND_DIR}/.md if called with an empty name.

  2. cp error handling (lines 1203-1224): Wrapped cp in if/else so a copy failure logs an error and continues without incrementing command_count.

  3. Agent name constants (lines 75-77): Extracted AGENT_BUILD="Build+" and AGENT_SEO="SEO" as readonly constants. Replaced all 40 hard-coded occurrences. Future agent renames are now a single-line change.

Verified: ShellCheck clean, 41 commands generated (unchanged), frontmatter output correct.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Mar 9 09:17:35 UTC 2026: Code review monitoring started
Mon Mar 9 09:17:35 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 391

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 391
  • VULNERABILITIES: 0

Generated on: Mon Mar 9 09:17:38 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

coderabbitai[bot]
coderabbitai bot previously requested changes Mar 9, 2026
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/scripts/generate-opencode-commands.sh:
- Around line 1228-1233: The loop that copies discovered command files uses cp
on "$cmd_file" to "$OPENCODE_COMMAND_DIR/$cmd_name.md" and currently only prints
an error on failure; modify the logic in the loop (around the cp, cmd_file,
cmd_name, and command_count handling) to propagate failures: either exit
immediately with a non-zero code when cp fails (fail-fast) or set a
boolean/exit_code flag when any cp fails and after the loop check that flag and
exit with a non-zero status; ensure messaging remains but that the script does
not continue to the final "Done!" success path when any copy failed.
- Around line 50-58: The create_command() function currently dereferences $2–$4
without ensuring they exist, which under set -u can cause an unbound variable
error; add an explicit arity check at the top of create_command (e.g., verify
that $# -ge 4) and return a clear diagnostic (using the existing error
formatting) before any use of $2, $3, or $4 so the function fails predictably on
insufficient arguments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4a6d7147-5383-4297-9bde-c1e6e83893e9

📥 Commits

Reviewing files that changed from the base of the PR and between 3bedcd4 and b6f792c.

📒 Files selected for processing (1)
  • .agents/scripts/generate-opencode-commands.sh

@marcusquinn
Copy link
Copy Markdown
Owner Author

Dispatching worker to address CodeRabbit CHANGES_REQUESTED feedback.

Address CodeRabbit CHANGES_REQUESTED review on PR #3971:

1. Add (($# == 4)) arity check at top of create_command() — prevents
   unhelpful 'unbound variable' errors under set -u when called with
   fewer than 4 arguments.

2. Add exit 1 after cp failure in auto-discovery loop — ensures the
   script exits non-zero on partial generation instead of reporting
   success with an incomplete command set.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Mar 9 18:12:19 UTC 2026: Code review monitoring started
Mon Mar 9 18:12:19 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 391

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 391
  • VULNERABILITIES: 0

Generated on: Mon Mar 9 18:12:22 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 9, 2026

@marcusquinn
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 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.

@marcusquinn marcusquinn dismissed coderabbitai[bot]’s stale review March 9, 2026 19:22

Both actionable items confirmed addressed by CodeRabbit: arity guard (commit 1f5af07) and cp fail-fast exit (commit 1f5af07). Re-review requested.

@marcusquinn
Copy link
Copy Markdown
Owner Author

Review Bot Suggestions - All Addressed

All 6 review bot suggestions have been applied across 4 commits. Summary:

# Source Suggestion Commit Status
1 Gemini Replace multi-line string variable with command group {...} redirect 3bedcd4 Applied
2 CodeRabbit (nitpick) Add [[ -n "$name" ]] parameter guard b6f792c Applied
3 CodeRabbit (nitpick) Wrap cp in if/else for error handling b6f792c Applied
4 CodeRabbit (nitpick) Extract agent name literals to constants (AGENT_BUILD, AGENT_SEO) b6f792c Applied
5 CodeRabbit (actionable) Add (($# == 4)) arity guard before $N dereference 1f5af07 Applied
6 CodeRabbit (actionable) Add exit 1 after cp failure for fail-fast behaviour 1f5af07 Applied

Verification:

  • Script generates all 41 commands successfully (unchanged count)
  • ShellCheck clean (only SC1091 info about external source)
  • All review threads resolved
  • CodeRabbit confirmed both actionable fixes
  • CI: all checks passing (SonarCloud, Codacy, CodeFactor, Socket, Framework Validation)

No invalid suggestions found — all 6 were valid improvements. Removed needs-review-fixes label.

@marcusquinn marcusquinn merged commit 0a83ebc into main Mar 9, 2026
36 checks passed
@marcusquinn marcusquinn deleted the refactor/command-generator-dedup branch March 9, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: PR #70 review feedback (critical)

1 participant