Skip to content

1.2: Convert all absolute paths to relative #7

@Acharnite

Description

@Acharnite

Convert absolute paths to relative

The codebase has many hardcoded absolute paths that should use relative paths resolved from the install location (e.g., via \$BROWSER_SKILL_DIR`, `dirname $0`, or gstack-paths`).

Examples found:

  1. SKILL.md files — hardcoded ~/.claude/skills/gstack/bin/... paths in bash blocks. These should use \dirname $0`` or an install-dir variable instead.

  2. bin/gstack-paths — hardcodes $HOME/.config/opencode/plans and .opencode/plans. The HOME-dependent fallback is fine, but CLI tools should resolve relative to the script location when possible.

  3. bin/gstack-gbrain-detect — the TypeScript version uses hardcoded config paths (~/.claude.json, opencode.json, ~/.config/opencode/opencode.jsonc). These should use os.homedir() + path.join or the process working directory.

  4. Setup scripts./setup references ~/.claude/skills/gstack/ and ~/.config/opencode/skills/gstack/ as install targets. These are install-time decisions, but should accept override via environment variables.

Resolution approach:

  • Use path.join(process.cwd(), ...) in TypeScript scripts instead of ~ expansion
  • In bash scripts, use SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" to resolve relative to the script
  • Pass install directory through GSTACK_INSTALL_DIR or similar env var
  • Avoid bare ~ — use $HOME (which bash expands) instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions