Skip to content

Bugfix/issue #122 fish shell support#125

Open
stephenfeather wants to merge 6 commits intoparcadei:mainfrom
stephenfeather:bugfix/issue-122-fish-shell-support
Open

Bugfix/issue #122 fish shell support#125
stephenfeather wants to merge 6 commits intoparcadei:mainfrom
stephenfeather:bugfix/issue-122-fish-shell-support

Conversation

@stephenfeather
Copy link
Copy Markdown
Contributor

@stephenfeather stephenfeather commented Jan 24, 2026

@MauroToscano Please test

  • Detect fish shell and set CLAUDE_OPC_DIR/LOOGLE_HOME using fish-compatible syntax
  • Added a verification step at the end of the wizard to check for CLAUDE_OPC_DIR
  • Updated math features guide with fish instructions

Summary by CodeRabbit

  • Documentation

    • Updated skill documentation with standardized metadata and descriptions across the platform.
    • Improved setup documentation for environment configuration persistence across multiple shells (zsh, bash, fish).
  • New Features

    • Enhanced setup wizard with environment variable verification steps and user guidance.
    • Added intelligent shell-specific configuration handling for improved cross-platform compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

Greptile Overview

Greptile Summary

This PR adds fish shell support to the setup wizard by:

  • Detecting fish shell via $SHELL environment variable in new get_shell_config() function
  • Using fish-compatible syntax (set -gx instead of export) for CLAUDE_OPC_DIR and LOOGLE_HOME environment variables
  • Adding verification step at wizard completion to check if CLAUDE_OPC_DIR is set
  • Updating math features documentation with fish shell instructions
  • Adding YAML frontmatter metadata to skill documentation files

Critical Issues Found:

  • Verification step suggests using source command which doesn't work correctly with fish shell's config.fish
  • Missing directory creation for ~/.config/fish/ before writing to config.fish (will fail on fresh fish installations)
  • No tests provided - Repository explicitly requires tests to prove fixes, but none were added for the fish shell detection or configuration logic

Recommendation:
The fish shell support implementation is on the right track but needs the two logic bugs fixed before merge. Additionally, tests should be added to verify shell detection and config file writing work correctly for fish, bash, and zsh.

Confidence Score: 2/5

  • This PR has critical bugs that will cause fish shell users to experience failures
  • Score reflects two critical logic errors: (1) verification step incorrectly suggests source command for fish shell which won't work properly, and (2) missing directory creation will cause writes to fail on fresh fish installations. Additionally, no tests were provided despite explicit repository requirement.
  • Pay close attention to opc/scripts/setup/wizard.py - it contains the two critical bugs that need fixing

Important Files Changed

Filename Overview
opc/scripts/setup/wizard.py Added fish shell support for environment variables; has critical bug in verification step and missing directory creation
opc/scripts/setup/math_features.py Updated documentation to include fish shell instructions for LMSTUDIO_BASE_URL

Sequence Diagram

sequenceDiagram
    participant User
    participant Wizard as setup/wizard.py
    participant ShellConfig as get_shell_config()
    participant FileSystem as Shell Config File
    
    User->>Wizard: Run setup wizard
    Wizard->>Wizard: Setup steps 1-8
    
    Note over Wizard: Step 9: Set CLAUDE_OPC_DIR
    Wizard->>ShellConfig: Get shell config path & type
    ShellConfig->>ShellConfig: Check $SHELL env var
    alt Fish Shell
        ShellConfig-->>Wizard: (~/.config/fish/config.fish, "fish")
    else Zsh Shell
        ShellConfig-->>Wizard: (~/.zshrc, "zsh")
    else Bash Shell
        ShellConfig-->>Wizard: (~/.bashrc, "bash")
    else Unknown
        ShellConfig-->>Wizard: (None, "unknown")
    end
    
    alt Shell config exists
        Wizard->>FileSystem: Read config file
        FileSystem-->>Wizard: Current content
        alt Fish shell
            Wizard->>FileSystem: Append "set -gx CLAUDE_OPC_DIR <path>"
        else Bash/Zsh
            Wizard->>FileSystem: Append "export CLAUDE_OPC_DIR=<path>"
        end
    else Config missing
        Wizard->>User: Show manual setup instructions
    end
    
    Note over Wizard: Optional: Loogle Setup
    alt Loogle installed
        Wizard->>ShellConfig: Get shell config again
        Wizard->>FileSystem: Append LOOGLE_HOME (fish or bash/zsh syntax)
    end
    
    Note over Wizard: Verification Step
    Wizard->>Wizard: Check if CLAUDE_OPC_DIR in current env
    alt Not set in env
        Wizard->>User: WARNING - suggest source config (BUG: doesn't work for fish)
    end
    
    Wizard->>User: Setup complete!
Loading

(4/5) You can add custom instructions or style guidelines for the agent here!

…zard

- Detect fish shell and set CLAUDE_OPC_DIR/LOOGLE_HOME using fish-compatible syntax
- Added a verification step at the end of the wizard to check for CLAUDE_OPC_DIR
- Updated math features guide with fish instructions

Closes parcadei#122
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 24, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR adds YAML front matter metadata (name and description fields) to 17 skill definition files and refactors shell configuration handling in setup scripts. The wizard script introduces a new get_shell_config() helper function to consolidate shell detection logic and extends support for fish-shell syntax, plus adds verification steps to warn users about missing environment variables.

Changes

Cohort / File(s) Summary
Skill metadata declarations
.claude/skills/commit/SKILL.md, .claude/skills/continuity_ledger/SKILL.md, .claude/skills/create_handoff/SKILL.md, .claude/skills/debug/SKILL.md, .claude/skills/describe_pr/SKILL.md, .claude/skills/discovery-interview/SKILL.md, .claude/skills/loogle-search/SKILL.md, .claude/skills/plan-agent/SKILL.md, .claude/skills/recall/SKILL.md, .claude/skills/remember/SKILL.md, .claude/skills/repo-research-analyst/SKILL.md, .claude/skills/resume_handoff/SKILL.md, .claude/skills/system_overview/SKILL.md, .claude/skills/tldr-deep/SKILL.md, .claude/skills/tldr-overview/SKILL.md, .claude/skills/tldr-router/SKILL.md, .claude/skills/tldr-stats/SKILL.md, .claude/skills/tour/SKILL.md, .claude/skills/validate-agent/SKILL.md
Added YAML front matter with name and description fields to standardize skill metadata declarations across 19 skill files.
Setup script shell configuration
opc/scripts/setup/wizard.py
Introduces new get_shell_config() helper function to map current shell to config path and type; refactors environment variable export logic (CLAUDE_OPC_DIR, LOOGLE_HOME) to use the helper and support fish-shell syntax; adds verification steps to warn if environment variables are not set in the current session.
Setup documentation
opc/scripts/setup/math_features.py
Broadened shell configuration persistence guidance from zsh-only to include zsh, bash, and fish, with separate example commands for each.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Bugfix/issue #122 fish shell support' clearly summarizes the main change: adding fish shell support to address issue #122, which aligns with the core changes across multiple SKILL.md files and shell setup scripts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
opc/scripts/setup/wizard.py (2)

876-881: Fallback message uses incorrect syntax for fish shell.

When the fish config file doesn't exist (e.g., fresh fish install without ~/.config/fish/), the fallback shows export syntax which won't work in fish. Consider using shell_type to show the correct syntax.

Proposed fix
     elif sys.platform == "win32":
         console.print("  [yellow]NOTE[/yellow] Add to your environment:")
         console.print(f'       set CLAUDE_OPC_DIR="{opc_dir}"')
     else:
-        console.print("  [yellow]NOTE[/yellow] Add to your shell config:")
-        console.print(f'       export CLAUDE_OPC_DIR="{opc_dir}"')
+        if shell_type == "fish":
+            console.print("  [yellow]NOTE[/yellow] Add to your fish config:")
+            console.print(f'       set -gx CLAUDE_OPC_DIR "{opc_dir}"')
+        else:
+            console.print("  [yellow]NOTE[/yellow] Add to your shell config:")
+            console.print(f'       export CLAUDE_OPC_DIR="{opc_dir}"')

1235-1240: Same fallback syntax issue for fish shell.

The fallback message at line 1240 shows export syntax which won't work for fish users whose config directory doesn't exist yet. Apply the same fix as suggested for the CLAUDE_OPC_DIR fallback.

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile


shell_config, _ = get_shell_config()
if shell_config:
console.print(f" 1. Run: [bold]source {shell_config}[/bold]")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

source doesn't work with fish shell. For fish, the instruction should be different (fish uses just the path without source, or can use . for POSIX scripts).

Suggested change
console.print(f" 1. Run: [bold]source {shell_config}[/bold]")
console.print(f" 1. Restart your terminal or reload config")
Prompt To Fix With AI
This is a comment left during a code review.
Path: opc/scripts/setup/wizard.py
Line: 1279:1279

Comment:
`source` doesn't work with fish shell. For fish, the instruction should be different (fish uses just the path without `source`, or can use `.` for POSIX scripts).

```suggestion
            console.print(f"  1. Restart your terminal or reload config")
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +519 to +521
if "fish" in shell:
# Standard location for fish config
return Path.home() / ".config" / "fish" / "config.fish", "fish"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fish config directory ~/.config/fish/ may not exist. Should create it before attempting to write to config.fish, otherwise the write operation will fail.

Add before line 863 and 1222:

if shell_type == "fish" and shell_config:
    shell_config.parent.mkdir(parents=True, exist_ok=True)
Prompt To Fix With AI
This is a comment left during a code review.
Path: opc/scripts/setup/wizard.py
Line: 519:521

Comment:
Fish config directory `~/.config/fish/` may not exist. Should create it before attempting to write to `config.fish`, otherwise the write operation will fail.

Add before line 863 and 1222:
```python
if shell_type == "fish" and shell_config:
    shell_config.parent.mkdir(parents=True, exist_ok=True)
```

How can I resolve this? If you propose a fix, please make it concise.

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.

1 participant