Skip to content

fix(portability): replace hardcoded paths, fix unbound vars, add unified installer#13

Closed
jbdevprimary wants to merge 3 commits intoalfredolopez80:mainfrom
jbdevprimary:fix/portability-and-bugs
Closed

fix(portability): replace hardcoded paths, fix unbound vars, add unified installer#13
jbdevprimary wants to merge 3 commits intoalfredolopez80:mainfrom
jbdevprimary:fix/portability-and-bugs

Conversation

@jbdevprimary
Copy link
Copy Markdown

Summary

This PR makes the project portable and installable by anyone, not just the original author.

  • Replace 11 hardcoded /Users/alfredolopez/ paths with portable alternatives ($REPO_ROOT via dirname, $HOME) across setup and validation scripts
  • Fix MEMVID_STATUS unbound variable crash in scripts/ralph — referenced but never defined after memvid removal in v2.93
  • Fix CLAUDE_DIR unbound variable in scripts/ralph-doctor.sh — crashes at line 421 with set -u
  • Fix CI workflow to accept .py and .js hooks (git-safety-guard.py, cleanup-secrets-db.js, sanitize-secrets.js were rejected by the .sh-only check)
  • Remove all scripts/mmc references — deprecated file no longer exists; broke install.sh, CONTRIBUTING.md
  • Remove duplicate status) case pattern in scripts/ralph (shellcheck SC2221/SC2222)
  • Add scripts/quick-install.sh — unified idempotent installer supporting curl -fsSL ... | bash -s -- --all

Files changed (16)

Category Files
Hardcoded paths scripts/setup-skill-symlinks.sh, scripts/setup-symlinks.sh, scripts/validate-skills-unification.sh, scripts/verify-skills-consolidation.sh, scripts/diagnose-hooks.sh, scripts/validate-all-hooks.sh, .claude/scripts/centralize-all.sh, .claude/scripts/centralize-skills.sh, .claude/scripts/setup-symlinks.sh, .claude/scripts/validate-migration.sh
Bug fixes scripts/ralph, scripts/ralph-doctor.sh
CI .github/workflows/ci.yml
Docs CONTRIBUTING.md, install.sh
New scripts/quick-install.sh

Test plan

  • bash -n syntax validation passes on all changed scripts
  • shellcheck --severity=warning clean on quick-install.sh
  • quick-install.sh --dry-run --all runs successfully
  • No /Users/alfredolopez paths remain in any changed file
  • 363/428 bats tests pass (remaining 65 failures are hardcoded paths in test files — separate fix)

Notes

  • Test files in tests/ still contain hardcoded /Users/alfredolopez paths (65 test failures). Those should be a separate PR since they're a larger change touching ~20 test files.
  • config/ralph_rules.json and .claude/snapshots/ also contain hardcoded paths but are generated data/backups — not fixed here.

🤖 Generated with Claude Code

…ied installer

- Replace all hardcoded /Users/alfredolopez/ paths with portable
  alternatives ($REPO_ROOT via dirname, $HOME) across 11 scripts
- Fix MEMVID_STATUS unbound variable crash in scripts/ralph (referenced
  but never defined after memvid removal in v2.93)
- Fix CLAUDE_DIR unbound variable in scripts/ralph-doctor.sh
- Fix CI workflow to accept .py and .js hooks (git-safety-guard.py,
  cleanup-secrets-db.js, sanitize-secrets.js were rejected)
- Remove all references to missing scripts/mmc (deprecated, no longer
  exists) from install.sh, CONTRIBUTING.md
- Remove duplicate unreachable `status)` case pattern in scripts/ralph
  (shellcheck SC2221/SC2222)
- Add scripts/quick-install.sh: unified idempotent installer that can
  be run via `curl | bash` with --all/--minimal/--skills-only flags

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 25, 2026 02:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves portability by removing author-specific hardcoded paths from scripts, fixes set -u unbound-variable crashes, updates CI hook validation to support non-.sh hooks, and introduces a unified quick-install.sh installer.

Changes:

  • Replaced hardcoded /Users/alfredolopez/... paths with repo-relative discovery (REPO_ROOT) and $HOME in setup/validation scripts.
  • Fixed CLI/runtime issues in scripts/ralph and scripts/ralph-doctor.sh caused by references to removed/unset variables.
  • Updated CI hook validation to allow .sh, .py, and .js, and added a new scripts/quick-install.sh installer.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
scripts/verify-skills-consolidation.sh Use repo-relative paths for skills + .gitignore checks.
scripts/validate-skills-unification.sh Use repo-relative root for unified skills validation.
scripts/validate-all-hooks.sh Use repo-relative hooks path; replace absolute HOME paths.
scripts/setup-symlinks.sh Use repo-relative root for symlink setup.
scripts/setup-skill-symlinks.sh Use repo-relative root for skill symlink setup.
scripts/ralph-doctor.sh Define CLAUDE_DIR to prevent set -u crashes.
scripts/ralph Remove stale memvid status logic and duplicate status) dispatch.
scripts/quick-install.sh Add unified installer for CLI + skills + agents (+ optional extras).
scripts/diagnose-hooks.sh Use repo-relative hook path and cd target.
install.sh Remove deprecated mmc install/aliases messaging.
CONTRIBUTING.md Remove mmc references from contributor instructions.
.github/workflows/ci.yml Allow .py/.js hook extensions in validation step.
.claude/scripts/validate-migration.sh Make repo alignment validation use repo-relative root.
.claude/scripts/setup-symlinks.sh Make repo root resolution portable.
.claude/scripts/centralize-skills.sh Replace author-specific paths with $HOME/repo-relative root.
.claude/scripts/centralize-all.sh Replace author-specific paths with $HOME/repo-relative root.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot review (7 of 10 accepted, 3 rejected as out-of-scope):
- Move jq from required to recommended in quick-install.sh (#1)
- Use generic package manager hint instead of macOS-only brew (#2)
- Warn on git fetch/reset failure instead of silent || true (#3)
- Normalize trailing slashes in symlink comparison (#4)
- Skip .ARCHIVED/.bak/.old files in CI hook extension check (#5)
- Fix $1 unbound variable in centralize-skills.sh under set -u (#6)
- Use grep -Fx for exact PATH match, avoid false positives (#8)
- Gate CLI verification on MODE != skills-only (#9)
- Clean up mmc references in uninstall.sh (#7, added to scope)

CodeRabbit review (1 finding):
- Add umask 077 security hardening to quick-install.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ings

The installer verification checked for curator.sh and repo-learn.sh
at ~/.ralph/, but nothing in the install flow creates them. Changed
from blocking errors to informational warnings with install hints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbdevprimary jbdevprimary closed this by deleting the head repository Apr 10, 2026
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.

2 participants