-
Notifications
You must be signed in to change notification settings - Fork 6
chore: implement agent-review improvements #46
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1524,6 +1524,36 @@ EOF | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ((command_count++)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo -e " ${GREEN}✓${NC} Created /recall command" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # AUTO-DISCOVERED COMMANDS FROM scripts/commands/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Commands in .agent/scripts/commands/*.md are auto-generated | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Each file should have frontmatter with description and agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This prevents needing to manually add new commands to this script | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| COMMANDS_DIR="$HOME/.aidevops/agents/scripts/commands" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -d "$COMMANDS_DIR" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for cmd_file in "$COMMANDS_DIR"/*.md; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [[ -f "$cmd_file" ]] || continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmd_name=$(basename "$cmd_file" .md) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Skip SKILL.md (not a command) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [[ "$cmd_name" == "SKILL" ]] && continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Skip if already manually defined (avoid duplicates) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -f "$OPENCODE_COMMAND_DIR/$cmd_name.md" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 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" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1537
to
+1554
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The A more robust way to iterate through the files is to glob all items in the directory and then filter for markdown files within the loop. This handles paths with spaces correctly.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ============================================================================= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Because this block skips when
"$OPENCODE_COMMAND_DIR/$cmd_name.md"already exists, auto-discovered commands won’t refresh on subsequent runs (only first-time creation), which can leave OpenCode with stale command definitions. Also, the header comment mentions.agent/scripts/commandsbutCOMMANDS_DIRpoints at~/.aidevops/agents/scripts/commands, which may confuse future maintainers.🤖 Was this useful? React with 👍 or 👎