chore: add missing OpenCode commands to generator#45
chore: add missing OpenCode commands to generator#45marcusquinn wants to merge 1 commit intomainfrom
Conversation
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.
|
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 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 (1)
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 addresses a gap where several predefined commands were not being generated for the OpenCode agent. By updating the command generation script, it successfully integrates 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
|
There was a problem hiding this comment.
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:
- 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.
- There's a minor inconsistency in the summary description for the new
/full-loopcommand. I've provided a suggestion to correct it.
Overall, this is a good addition that expands the agent's capabilities.
| # ============================================================================= | ||
| # 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" | ||
|
|
There was a problem hiding this comment.
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)
EOFApplying 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" |
There was a problem hiding this comment.
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.
| echo " /full-loop - End-to-end: task → preflight → PR → postflight" | |
| echo " /full-loop - End-to-end: task → preflight → PR → postflight → deploy" |
|
Closing: changes already included in main via PR #46 |
🤖 Augment PR SummarySummary: This PR updates the OpenCode command generator so it outputs stubs for commands that already exist in aidevops’ command documentation. Changes:
Technical Notes: The generator increments 🤖 Was this summary useful? React with 👍 or 👎 |
| agent: Build+ | ||
| --- | ||
|
|
||
| Read ~/.aidevops/agents/tools/code-review/code-simplifier.md and follow its instructions. |
There was a problem hiding this comment.
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.
🤖 Was this useful? React with 👍 or 👎
| **Usage:** | ||
| ```bash | ||
| /session-review # Review current session | ||
| /session-review --capture # Also capture learnings to memory |
There was a problem hiding this comment.
* 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
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 memoriesChanges
generate-opencode-commands.shto include new commands