Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agent/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ User confirms with numbered options to override if needed.
| `todo/tasks/prd-*.md` | Product requirement documents |
| `todo/tasks/tasks-*.md` | Implementation task lists |

**Slash commands:** `/save-todo`, `/plan-status`, `/create-prd`, `/generate-tasks`, `/log-time-spent`, `/ready`, `/sync-beads`, `/remember`, `/recall`, `/session-review`, `/full-loop`
**Slash commands:** `/save-todo`, `/plan-status`, `/create-prd`, `/generate-tasks`, `/log-time-spent`, `/ready`, `/sync-beads`, `/remember`, `/recall`, `/session-review`, `/full-loop`, `/code-simplifier`

**Time tracking format:**

Expand Down
30 changes: 30 additions & 0 deletions .agent/scripts/generate-opencode-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

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/commands but COMMANDS_DIR points at ~/.aidevops/agents/scripts/commands, which may confuse future maintainers.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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

Choose a reason for hiding this comment

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

medium

The for loop on line 1537 uses a glob pattern "$COMMANDS_DIR"/*.md that may not work as expected if $COMMANDS_DIR contains spaces. While $HOME paths usually don't have spaces, writing shell scripts to be robust against such cases is a good practice.

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
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
for cmd_file in "$COMMANDS_DIR"/*; do
[[ -f "$cmd_file" ]] || continue
[[ "$cmd_file" != *.md ]] && 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

fi

# =============================================================================
# SUMMARY
# =============================================================================
Expand Down
40 changes: 40 additions & 0 deletions .agent/workflows/ralph-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,46 @@ head -10 .claude/ralph-loop.local.md
test -f .claude/ralph-loop.local.md && echo "Active" || echo "Not active"
```

## Multi-Worktree Awareness

When working with git worktrees, Ralph loops are aware of parallel sessions.

### Check All Worktrees

```bash
# Show loops across all worktrees
~/.aidevops/agents/scripts/ralph-loop-helper.sh status --all
```

Output shows:
- Branch name for each active loop
- Current iteration and max
- Which worktree is current

### Parallel Loop Warnings

When starting a new loop, the helper automatically checks for other active loops:

```text
Other active Ralph loops detected:
- feature/other-task (iteration 5)

Use 'ralph-loop-helper.sh status --all' to see details
```

This helps prevent confusion when multiple AI sessions are running in parallel.

### Integration with worktree-sessions.sh

The worktree session mapper shows Ralph loop status:

```bash
# List all worktrees with their sessions and loop status
~/.aidevops/agents/scripts/worktree-sessions.sh list
```

Output includes a "Ralph loop: iteration X/Y" line for worktrees with active loops.

## CI/CD Wait Time Optimization

When using Ralph loops with PR review workflows, the loop uses adaptive timing based on observed CI/CD service completion times.
Expand Down
Loading