Skip to content

chore: add missing OpenCode commands to generator#45

Closed
marcusquinn wants to merge 1 commit intomainfrom
chore/add-missing-opencode-commands
Closed

chore: add missing OpenCode commands to generator#45
marcusquinn wants to merge 1 commit intomainfrom
chore/add-missing-opencode-commands

Conversation

@marcusquinn
Copy link
Owner

Summary

Add commands that were defined in scripts/commands/ but not generated in OpenCode agent configs.

New Commands

  • /full-loop - End-to-end development loop
  • /code-simplifier - Code clarity improvements
  • /session-review - Session completeness check
  • /remember - Store cross-session memories
  • /recall - Search previous memories

Changes

  • Update generate-opencode-commands.sh to include new commands
  • Update summary output to show new commands

Add commands that were defined in scripts/commands/ but not generated:
- /full-loop - End-to-end development loop
- /code-simplifier - Code clarity improvements
- /session-review - Session completeness check
- /remember - Store cross-session memories
- /recall - Search previous memories

Also updated summary output to show new commands.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 39 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.

📥 Commits

Reviewing files that changed from the base of the PR and between a361dc6 and f617fc8.

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

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 addresses a gap where several predefined commands were not being generated for the OpenCode agent. By updating the command generation script, it successfully integrates /full-loop, /code-simplifier, /session-review, /remember, and /recall into the agent's capabilities. This enhancement significantly expands the agent's functionality, offering tools for streamlined development workflows, improved code quality, better session management, and persistent memory features, ultimately leading to a more robust and intelligent agent experience.

Highlights

  • New Agent Commands Added: Five new commands have been integrated into the OpenCode agent configuration: /full-loop for end-to-end development, /code-simplifier for code clarity, /session-review for session completeness, /remember for cross-session memory storage, and /recall for memory retrieval.
  • Command Generation Script Update: The generate-opencode-commands.sh script has been updated to include the generation logic for the new commands, ensuring their proper setup within the agent's environment.
  • Enhanced Command Summary Output: The script's summary output now correctly lists the newly added commands, providing clear visibility of their availability and purpose to users.
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.

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 adds several new commands to the OpenCode agent command generator. The changes are well-structured and follow the existing pattern for adding commands. I have two suggestions for improvement:

  1. There's significant code duplication in the script for generating each new command file. I've recommended refactoring this into a helper function to improve maintainability.
  2. There's a minor inconsistency in the summary description for the new /full-loop command. I've provided a suggestion to correct it.

Overall, this is a good addition that expands the agent's capabilities.

Comment on lines +1364 to +1526
# =============================================================================
# FULL-LOOP COMMAND
# =============================================================================
# End-to-end development loop (task → preflight → PR → postflight → deploy)

cat > "$OPENCODE_COMMAND_DIR/full-loop.md" << 'EOF'
---
description: Start end-to-end development loop (task → preflight → PR → postflight → deploy)
agent: Build+
---

Read ~/.aidevops/agents/scripts/commands/full-loop.md and follow its instructions.

Start a full development loop for: $ARGUMENTS

**Full Loop Phases:**
```text
Task Development → Preflight → PR Create → PR Review → Postflight → Deploy
```

**Usage:**
```bash
/full-loop "Implement feature X with tests"
/full-loop "Fix bug Y" --max-task-iterations 30
```

**Options:**
- `--max-task-iterations N` - Max iterations for task (default: 50)
- `--skip-preflight` - Skip preflight checks
- `--skip-postflight` - Skip postflight monitoring
- `--no-auto-pr` - Pause for manual PR creation

**Completion promise:** `<promise>FULL_LOOP_COMPLETE</promise>`
EOF
((command_count++))
echo -e " ${GREEN}✓${NC} Created /full-loop command"

# =============================================================================
# CODE-SIMPLIFIER COMMAND
# =============================================================================
# Simplify and refine code for clarity

cat > "$OPENCODE_COMMAND_DIR/code-simplifier.md" << 'EOF'
---
description: Simplify and refine code for clarity, consistency, and maintainability
agent: Build+
---

Read ~/.aidevops/agents/tools/code-review/code-simplifier.md and follow its instructions.

Target: $ARGUMENTS

**Usage:**
```bash
/code-simplifier # Simplify recently modified code
/code-simplifier src/ # Simplify code in specific directory
/code-simplifier --all # Review entire codebase (use sparingly)
```

**Key Principles:**
- Preserve exact functionality
- Clarity over brevity
- Avoid nested ternaries
- Remove obvious comments
- Apply project standards
EOF
((command_count++))
echo -e " ${GREEN}✓${NC} Created /code-simplifier command"

# =============================================================================
# SESSION-REVIEW COMMAND
# =============================================================================
# Review session for completeness before ending

cat > "$OPENCODE_COMMAND_DIR/session-review.md" << 'EOF'
---
description: Review session for completeness before ending
agent: Build+
---

Read ~/.aidevops/agents/scripts/commands/session-review.md and follow its instructions.

Review the current session for: $ARGUMENTS

**Checks performed:**
1. All objectives completed
2. Workflow best practices followed
3. Knowledge captured for future sessions
4. Clear next steps identified

**Usage:**
```bash
/session-review # Review current session
/session-review --capture # Also capture learnings to memory
```
EOF
((command_count++))
echo -e " ${GREEN}✓${NC} Created /session-review command"

# =============================================================================
# REMEMBER COMMAND
# =============================================================================
# Store a memory for cross-session recall

cat > "$OPENCODE_COMMAND_DIR/remember.md" << 'EOF'
---
description: Store a memory for cross-session recall
agent: Build+
---

Read ~/.aidevops/agents/scripts/commands/remember.md and follow its instructions.

Remember: $ARGUMENTS

**Usage:**
```bash
/remember "User prefers worktrees over checkout"
/remember "The auth module uses JWT with 24h expiry"
/remember --type WORKING_SOLUTION "Fixed by adding explicit return"
```

**Memory types:**
- WORKING_SOLUTION - Solutions that worked
- FAILED_APPROACH - Approaches that didn't work
- CODEBASE_PATTERN - Patterns in this codebase
- USER_PREFERENCE - User preferences
- TOOL_CONFIG - Tool configurations
- DECISION - Decisions made
- CONTEXT - General context

**Storage:** ~/.aidevops/.agent-workspace/memory/memory.db
EOF
((command_count++))
echo -e " ${GREEN}✓${NC} Created /remember command"

# =============================================================================
# RECALL COMMAND
# =============================================================================
# Search memories from previous sessions

cat > "$OPENCODE_COMMAND_DIR/recall.md" << 'EOF'
---
description: Search memories from previous sessions
agent: Build+
---

Read ~/.aidevops/agents/scripts/commands/recall.md and follow its instructions.

Search for: $ARGUMENTS

**Usage:**
```bash
/recall authentication # Search for auth-related memories
/recall --recent # Show 10 most recent memories
/recall --stats # Show memory statistics
/recall --type WORKING_SOLUTION # Filter by type
```

**Storage:** ~/.aidevops/.agent-workspace/memory/memory.db
EOF
((command_count++))
echo -e " ${GREEN}✓${NC} Created /recall command"

Choose a reason for hiding this comment

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

medium

This pull request adds several new commands, and each one repeats a significant amount of boilerplate code (comment headers, cat redirection, counter increment, and echo status). To improve maintainability and reduce redundancy, consider abstracting this logic into a helper function.

For example, you could define a function like this (perhaps at the top of the script):

# Helper function to generate a command file
generate_command() {
  local name="$1"
  local description="$2"
  
  echo ""
  echo "# ============================================================================="
  echo "# ${name^^} COMMAND"
  echo "# ============================================================================="
  echo "# $description"

  cat > "$OPENCODE_COMMAND_DIR/$name.md"

  ((command_count++))
  echo -e "  ${GREEN}${NC} Created /$name command"
}

Then, you could generate each new command much more concisely, like this for /full-loop:

generate_command "full-loop" "End-to-end development loop (task → preflight → PR → postflight → deploy)" << 'EOF'
---
description: Start end-to-end development loop (task → preflight → PR → postflight → deploy)
agent: Build+
---

Read ~/.aidevops/agents/scripts/commands/full-loop.md and follow its instructions.

Start a full development loop for: $ARGUMENTS

# ... (rest of the heredoc content)

EOF

Applying this pattern to all the new commands would make the script cleaner and easier to extend in the future.

echo " Automation (Ralph Loops):"
echo " /ralph-loop - Start iterative AI development loop"
echo " /ralph-task - Run Ralph loop for a TODO.md task by ID"
echo " /full-loop - End-to-end: task → preflight → PR → postflight"

Choose a reason for hiding this comment

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

medium

The summary description for /full-loop is inconsistent with its detailed documentation. The documentation (in full-loop.md) specifies the final step as deploy, which is missing here. To ensure consistency, please add it to the summary.

Suggested change
echo " /full-loop - End-to-end: task → preflight → PR → postflight"
echo " /full-loop - End-to-end: task → preflight → PR → postflight → deploy"

@marcusquinn
Copy link
Owner Author

Closing: changes already included in main via PR #46

@augmentcode
Copy link

augmentcode bot commented Jan 11, 2026

🤖 Augment PR Summary

Summary: This PR updates the OpenCode command generator so it outputs stubs for commands that already exist in aidevops’ command documentation.

Changes:

  • Extend .agent/scripts/generate-opencode-commands.sh to generate new OpenCode command files for /full-loop, /code-simplifier, /session-review, /remember, and /recall.
  • Each generated command includes YAML frontmatter (description/agent) and forwards users to the corresponding aidevops docs under ~/.aidevops/agents/… while passing through $ARGUMENTS.
  • Update the generator’s “Available commands” summary output so the new commands appear in the appropriate sections (Quality, Utilities, Memory, Automation).

Technical Notes: The generator increments command_count for each newly generated stub so totals and completion messaging reflect the added commands.

🤖 Was this summary useful? React with 👍 or 👎

marcusquinn added a commit that referenced this pull request Jan 11, 2026
Processed:
- PR #44 (bugfix/sonarcloud-default-cases): Merged
- PR #45 (chore/add-missing-opencode-commands): Closed (in main via #46)
- PR #46 (chore/agent-review-improvements): Merged
- PR #47 (chore/agents-md-progressive-disclosure): Closed (in main)

Remaining: 9 branches (4 chore, 5 feature)
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.

agent: Build+
---

Read ~/.aidevops/agents/tools/code-review/code-simplifier.md and follow its instructions.
Copy link

Choose a reason for hiding this comment

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

The /code-simplifier stub points directly to ~/.aidevops/agents/tools/code-review/code-simplifier.md, but this command also has a wrapper doc under scripts/commands/ (and the PR description mentions generating those); consider aligning this reference so the generated OpenCode command stays consistent with the canonical command doc.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

**Usage:**
```bash
/session-review # Review current session
/session-review --capture # Also capture learnings to memory
Copy link

Choose a reason for hiding this comment

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

This usage example advertises a --capture flag, but the canonical scripts/commands/session-review.md describes positional “focus” arguments (e.g., workflow, knowledge); this may confuse users if they rely on the help text.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

marcusquinn added a commit that referenced this pull request Jan 11, 2026
* docs: add branch inventory and cleanup task (t059)

- Create todo/BRANCH-INVENTORY.md documenting 13 unmerged branches
- All branches pushed to remote for preservation
- Add t059 task for reviewing and merging branches
- Prune stale worktree references
- Delete local branches (safely on remote)

Cleanup summary:
- 5 merged branches deleted (local + remote)
- 4 local-only branches pushed to remote
- 12 local branches deleted (all on remote)
- 1 stale worktree reference pruned

Remaining work documented for future sessions.

* docs: update branch inventory after processing branches 1-4

Processed:
- PR #44 (bugfix/sonarcloud-default-cases): Merged
- PR #45 (chore/add-missing-opencode-commands): Closed (in main via #46)
- PR #46 (chore/agent-review-improvements): Merged
- PR #47 (chore/agents-md-progressive-disclosure): Closed (in main)

Remaining: 9 branches (4 chore, 5 feature)

* docs: update t059 progress after processing branches 1-4
@marcusquinn marcusquinn deleted the chore/add-missing-opencode-commands branch January 11, 2026 05:38
marcusquinn added a commit that referenced this pull request Jan 11, 2026
All 13 unmerged branches processed:
- PRs merged: #44, #46, #48, #51
- PRs closed (already in main): #45, #47, #49, #50
- Branches deleted (superseded): 5 feature branches

All remote branches cleaned up. t059 marked complete.
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