Skip to content
Closed
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
18 changes: 9 additions & 9 deletions .claude/scripts/centralize-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@
#
# Locations:
# Skills:
# - /Users/alfredolopez/.claude-code-old/.claude-old/skills
# - /Users/alfredolopez/.claude-sneakpeek-old/zai/skills
# - /Users/alfredolopez/.config/agents/skills (kimi-cli shared)
# - ~/.claude-code-old/.claude-old/skills (legacy)
# - ~/.claude-sneakpeek-old/zai/skills (legacy)
# - ~/.config/agents/skills (kimi-cli shared)
# - Repository: multi-agent-ralph-loop/.claude/skills
#
# Plugins:
# - /Users/alfredolopez/.claude-code-old/.claude-old/plugins
# - ~/.claude-code-old/.claude-old/plugins (legacy)
# - Repository enabledPlugins

set -euo pipefail

DRY_RUN=false
[[ "${1:-}" == "--dry-run" ]] && DRY_RUN=true

REPO_ROOT="/Users/alfredolopez/Documents/GitHub/multi-agent-ralph-loop"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
CLAUDE_DIR="$HOME/.claude"
BACKUP_DIR="$HOME/.claude-backup-$(date +%Y%m%d-%H%M%S)"

# Source locations
OLD_CLAUDE_DIR="/Users/alfredolopez/.claude-code-old/.claude-old"
OLD_ZAI_DIR="/Users/alfredolopez/.claude-sneakpeek-old/zai"
KIMI_SKILLS="/Users/alfredolopez/.config/agents/skills"
# Source locations (legacy — only used if they exist on this machine)
OLD_CLAUDE_DIR="${HOME}/.claude-code-old/.claude-old"
OLD_ZAI_DIR="${HOME}/.claude-sneakpeek-old/zai"
KIMI_SKILLS="${HOME}/.config/agents/skills"
REPO_SKILLS="$REPO_ROOT/.claude/skills"
REPO_AGENTS="$REPO_ROOT/.claude/agents"

Expand Down
18 changes: 9 additions & 9 deletions .claude/scripts/centralize-skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
#
# This script consolidates skills and agents from multiple locations into ~/.claude/
# Locations:
# - /Users/alfredolopez/.claude-code-old/.claude-old/skills
# - /Users/alfredolopez/.claude-sneakpeek-old/zai/skills
# - /Users/alfredolopez/.config/agents/skills (kimi-cli shared)
# - ~/.claude-code-old/.claude-old/skills (legacy)
# - ~/.claude-sneakpeek-old/zai/skills (legacy)
# - ~/.config/agents/skills (kimi-cli shared)
# - Repository: multi-agent-ralph-loop/.claude/skills

set -euo pipefail

DRY_RUN=false
[[ "$1" == "--dry-run" ]] && DRY_RUN=true
[[ "${1:-}" == "--dry-run" ]] && DRY_RUN=true

REPO_ROOT="/Users/alfredolopez/Documents/GitHub/multi-agent-ralph-loop"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
CLAUDE_DIR="$HOME/.claude"
BACKUP_DIR="$HOME/.claude-backup-$(date +%Y%m%d-%H%M%S)"

# Source locations
OLD_CLAUDE_SKILLS="/Users/alfredolopez/.claude-code-old/.claude-old/skills"
OLD_ZAI_SKILLS="/Users/alfredolopez/.claude-sneakpeek-old/zai/skills"
KIMI_SKILLS="/Users/alfredolopez/.config/agents/skills"
# Source locations (legacy — only used if they exist on this machine)
OLD_CLAUDE_SKILLS="${HOME}/.claude-code-old/.claude-old/skills"
OLD_ZAI_SKILLS="${HOME}/.claude-sneakpeek-old/zai/skills"
KIMI_SKILLS="${HOME}/.config/agents/skills"
REPO_SKILLS="$REPO_ROOT/.claude/skills"
REPO_AGENTS="$REPO_ROOT/.claude/agents"

Expand Down
2 changes: 1 addition & 1 deletion .claude/scripts/setup-symlinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -e

# Configuración
REPO_ROOT="/Users/alfredolopez/Documents/GitHub/multi-agent-ralph-loop"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
REPO_CLAUDE="$REPO_ROOT/.claude"
STD_CLAUDE="$HOME/.claude"
BACKUP_DIR="$HOME/.claude-backup-$(date +%Y%m%d-%H%M%S)"
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/validate-migration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ echo ""
# 4. Verificar alineación con repo
echo -e "${BLUE}[4/5] Verificando alineación con repo...${NC}"

REPO="/Users/alfredolopez/Documents/GitHub/multi-agent-ralph-loop/.claude"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
REPO="${REPO_ROOT}/.claude"

repo_agents=$(ls $REPO/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
link_agents=$(ls ~/.claude/agents 2>/dev/null | wc -l | tr -d ' ')
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ jobs:
run: |
# Check hooks exist
test -d .claude/hooks
# Verify all hooks have .sh extension
# Verify all hooks have a recognized script extension
for hook in .claude/hooks/*; do
if [ -f "$hook" ] && [[ ! "$hook" == *.sh ]]; then
echo "ERROR: Hook $hook missing .sh extension"
exit 1
if [ -f "$hook" ]; then
case "$hook" in
*.ARCHIVED|*.bak|*.old|*.backup|*.backup_*) ;; # Skip archived/backup files
*.sh|*.py|*.js) ;; # Valid hook extensions
*) echo "ERROR: Hook $hook has unrecognized extension (expected .sh, .py, or .js)"; exit 1 ;;
esac
fi
done

Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cd multi-agent-ralph-loop
bats tests/

# Check bash scripts
shellcheck scripts/ralph scripts/mmc install.sh uninstall.sh
shellcheck scripts/ralph install.sh uninstall.sh
```

## Project Structure
Expand All @@ -66,8 +66,7 @@ multi-agent-ralph-loop/
│ ├── hooks/ # Git safety guard, quality gates
│ └── skills/ # Reusable skills (deep-clarification, etc.)
├── scripts/
│ ├── ralph # Main CLI tool
│ └── mmc # MiniMax wrapper
│ └── ralph # Main CLI tool
├── tests/ # Bats test files
├── install.sh # Global installer
├── uninstall.sh # Uninstaller
Expand Down Expand Up @@ -152,7 +151,7 @@ All PRs must pass the automated CI pipeline before merging:
# Run locally before submitting PR
./tests/run_tests.sh # All tests
ruff check .claude/hooks/*.py tests/*.py # Python lint
shellcheck scripts/ralph scripts/mmc # Shell lint
shellcheck scripts/ralph # Shell lint
```

## Branch Protection
Expand Down
70 changes: 13 additions & 57 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,11 @@ create_directories() {
install_scripts() {
log_info "Installing CLI scripts..."

# Copy ralph and mmc
# Copy ralph CLI
cp "${SCRIPT_DIR}/scripts/ralph" "$INSTALL_DIR/ralph"
cp "${SCRIPT_DIR}/scripts/mmc" "$INSTALL_DIR/mmc"

# Make executable
chmod +x "$INSTALL_DIR/ralph"
chmod +x "$INSTALL_DIR/mmc"

log_success "CLI scripts installed to $INSTALL_DIR"
}
Expand Down Expand Up @@ -813,11 +811,6 @@ alias rhl='ralph loop'
alias rhc='ralph clarify'
alias rhret='ralph retrospective'
alias rhi='ralph improvements'

# MiniMax aliases
alias mm='mmc'
alias mml='mmc --loop 30'
alias mmlight='mmc --lightning'
$END_MARKER
RCEOF
log_success "Shell aliases configured in $SHELL_RC"
Expand All @@ -832,7 +825,6 @@ verify_installation() {
local ERRORS=0

[ -x "$INSTALL_DIR/ralph" ] && log_success "ralph CLI installed" || { log_error "ralph not found"; ((ERRORS++)); }
[ -x "$INSTALL_DIR/mmc" ] && log_success "mmc CLI installed" || { log_error "mmc not found"; ((ERRORS++)); }
[ -d "${CLAUDE_DIR}/agents" ] && log_success "Agents directory OK" || { log_error "Agents missing"; ((ERRORS++)); }
[ -d "${CLAUDE_DIR}/commands" ] && log_success "Commands directory OK" || { log_error "Commands missing"; ((ERRORS++)); }
[ -x "${CLAUDE_DIR}/hooks/git-safety-guard.py" ] && log_success "Git Safety Guard installed (ACTIVE)" || log_warn "Git Safety Guard may need chmod +x"
Expand All @@ -842,46 +834,18 @@ verify_installation() {



# Verify curator and repo-learn scripts
log_info "Running post-installation tests..."

if [ -x "${RALPH_DIR}/curator/curator.sh" ]; then
log_success "curator.sh installed"
else
log_error "curator.sh not found or not executable"
((ERRORS++))
fi

if [ -x "${RALPH_DIR}/scripts/repo-learn.sh" ]; then
log_success "repo-learn.sh installed"
else
log_error "repo-learn.sh not found or not executable"
((ERRORS++))
fi

# Run validation script if available
if [ -x "${RALPH_DIR}/tests/validate_commands.sh" ]; then
log_info "Running validation tests..."
if "${RALPH_DIR}/tests/validate_commands.sh" > /dev/null 2>&1; then
log_success "All validation tests passed"
else
log_warn "Some validation tests failed - check ${RALPH_DIR}/logs/"
((ERRORS++))
fi
fi
# Optional post-installation checks (non-blocking)
log_info "Running post-installation checks..."

# Verify commands work
if "$INSTALL_DIR/ralph" repo-learn --help > /dev/null 2>&1; then
log_success "ralph repo-learn command works"
else
log_error "ralph repo-learn command failed"
((ERRORS++))
fi
# These scripts are managed by skills, not the installer
[ -x "${RALPH_DIR}/curator/curator.sh" ] && log_success "curator.sh available" || log_warn "curator.sh not found (install via /curator skill)"
[ -x "${RALPH_DIR}/scripts/repo-learn.sh" ] && log_success "repo-learn.sh available" || log_warn "repo-learn.sh not found (install via /repo-learn skill)"

if "$INSTALL_DIR/ralph" curator > /dev/null 2>&1; then
log_success "ralph curator command works"
# Verify ralph CLI responds
if "$INSTALL_DIR/ralph" --version > /dev/null 2>&1; then
log_success "ralph CLI responds"
else
log_error "ralph curator command failed"
log_error "ralph CLI not responding"
((ERRORS++))
fi
return $ERRORS
Expand All @@ -898,7 +862,6 @@ main() {
echo ""
echo " This will install:"
echo " • ralph CLI to ~/.local/bin/"
echo " • mmc (MiniMax wrapper) to ~/.local/bin/"
echo " • 9 agents to ~/.claude/agents/"
echo " • 15 commands to ~/.claude/commands/"
echo " • 5 skills to ~/.claude/skills/ (including React Best Practices from Vercel)"
Expand Down Expand Up @@ -943,21 +906,14 @@ main() {
echo " 1. Reload your shell:"
echo " ${CYAN}source ~/.zshrc${NC} (or ~/.bashrc)"
echo ""
echo " 2. (Optional) Configure MiniMax for 2-4x iterations:"
echo " ${CYAN}mmc --setup${NC}"
echo ""
echo " 3. Start using Ralph:"
echo " 2. Start using Ralph:"
echo " ${CYAN}ralph help${NC}"
echo " ${CYAN}ralph orch \"Your task here\"${NC}"
echo ""
echo " 4. Run quality gates manually when needed:"
echo " 3. Run quality gates manually when needed:"
echo " ${CYAN}ralph gates${NC}"
echo ""
echo " 5. View usage statistics (hybrid logging):"
echo " ${CYAN}mmc --stats all${NC} # Global + project"
echo " ${CYAN}mmc --stats project${NC} # This repo only"
echo ""
echo " 6. (v2.20) Install WorkTrunk for git worktree workflow:"
echo " 4. (v2.20) Install WorkTrunk for git worktree workflow:"
echo " ${CYAN}brew install max-sixty/worktrunk/wt${NC}"
echo " ${CYAN}wt config shell install${NC}"
echo " ${CYAN}ralph worktree \"your feature\"${NC}"
Expand Down
5 changes: 3 additions & 2 deletions scripts/diagnose-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ echo "" | tee -a "$LOG_FILE"
echo "=== 5. Test Hook Execution ===" | tee -a "$LOG_FILE"

# Test a simple hook
TEST_HOOK="/Users/alfredolopez/Documents/GitHub/multi-agent-ralph-loop/.claude/hooks/session-start-restore-context.sh"
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
TEST_HOOK="${REPO_ROOT}/.claude/hooks/session-start-restore-context.sh"
if [ -x "$TEST_HOOK" ]; then
echo "Testing: $TEST_HOOK" | tee -a "$LOG_FILE"
OUTPUT=$("$TEST_HOOK" 2>&1 | head -5)
Expand All @@ -127,7 +128,7 @@ echo "" | tee -a "$LOG_FILE"
echo "=== 6. Claude-mem Worker Test ===" | tee -a "$LOG_FILE"

export CLAUDE_PLUGIN_ROOT="$PLUGIN_ROOT"
cd /Users/alfredolopez/Documents/GitHub/multi-agent-ralph-loop 2>/dev/null || true
cd "${REPO_ROOT}" 2>/dev/null || true

if [ -f "$PLUGIN_ROOT/scripts/worker-service.cjs" ]; then
echo "Testing worker status..." | tee -a "$LOG_FILE"
Expand Down
Loading