Skip to content

fix: info command version detection, skills display, and documentation updates#149

Merged
subsy merged 6 commits intomainfrom
fix/info-version-and-skills
Jan 19, 2026
Merged

fix: info command version detection, skills display, and documentation updates#149
subsy merged 6 commits intomainfrom
fix/info-version-and-skills

Conversation

@subsy
Copy link
Copy Markdown
Owner

@subsy subsy commented Jan 18, 2026

Summary

This PR addresses several issues and improvements:

  • Fix Windows version detection: Resolved ralph-tui info showing "version: unknown" on Windows by using import.meta.url instead of __dirname for ESM path resolution
  • Add skills info to ralph-tui info: Now displays bundled skills, custom skills directory, and per-agent installed skills status
  • Fix OpenCode skills path: Corrected from ~/.opencode/skill/ to ~/.config/opencode/skills/ (XDG-compliant)
  • Add --local flag for skills install: Allow installing skills to project-local directories (which take precedence over global)
  • Fix keyboard shortcut documentation: Changed incorrect 'u' references to 'T' (Shift+T) for toggling subagent tree panel
  • Add prompt template precedence documentation: Document the priority order for prompt templates

Changes

Code Changes

  • src/commands/info.ts - ESM-compatible version detection, skills info collection
  • src/commands/info.test.ts - Tests for new functionality
  • src/commands/skills.ts - Add --local/--global flags, show both paths in list
  • src/plugins/agents/builtin/opencode.ts - Fix skills path to XDG-compliant location

Documentation Updates

  • README.md - Skills location table, keyboard shortcuts
  • website/content/docs/cli/setup.mdx - Skills locations per agent
  • website/content/docs/getting-started/installation.mdx - Skills management section
  • website/content/docs/configuration/options.mdx - Prompt precedence table
  • website/content/docs/plugins/agents/claude.mdx - Fix 'u' → 'T' for subagent tree
  • website/content/docs/plugins/agents/droid.mdx - Fix 'u' → 'T' for subagent tree

Test plan

  • bun run typecheck passes
  • bun run build passes
  • ralph-tui info shows correct version (not "unknown")
  • ralph-tui info shows skills section with per-agent status
  • ralph-tui skills list shows both global and local paths
  • ralph-tui skills install --local installs to project directory
  • Documentation accurately reflects keyboard shortcuts (Shift+T for subagent tree)

Summary by CodeRabbit

  • New Features

    • Added local and global skills installation modes; local skills take precedence.
    • Reorganised skills into per-agent directories; OpenCode now uses ~/.config/opencode/skills.
    • Updated keyboard shortcuts: T toggles the subagent tree, t cycles tracing detail, o added; i and u removed.
  • Documentation

    • Added per-agent skills locations table and updated installation guidance (local/global).
    • Added prompt template precedence guidance.
  • Other

    • System info and bug-report outputs now include skills installation status.

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

AI Agent added 5 commits January 18, 2026 20:33
- Fix version detection on Windows and when installed globally by using
  import.meta.url with proper path resolution (similar to skill-installer.ts)
- Add skills information to system info output including:
  - Bundled skills available for installation
  - Custom skills directory (if configured)
  - Per-agent installed skills with paths
- Update all output formats (text, JSON, copyable) to include skills data
- Add comprehensive tests for new functionality

Fixes issue where version showed as "unknown" on Windows due to
incorrect __dirname usage in ESM bundles.
- Fix incorrect 'u' key references to 'T' (Shift+T) for toggling
  the subagent tree panel in:
  - README.md
  - claude.mdx agent documentation
  - droid.mdx agent documentation
- Add prompt template precedence table to options.mdx showing
  the resolution order from CLI flag to built-in fallback
- Update keyboard shortcut table in README to include 't' for
  cycling detail level and 'o' for cycling panel views
The OpenCode agent's skills directory was incorrectly set to
~/.opencode/skill/ (singular) instead of ~/.config/opencode/skills/
(plural, XDG-compliant location).

Updated:
- opencode.ts: Agent plugin skillsPaths configuration
- skills.ts: Help text showing supported agents
- skills.test.ts: Test assertion for path detection
- installation.mdx: Documentation table
- README.md: Add table showing skills location for each agent
  (Claude, OpenCode, Factory Droid)
- setup.mdx: Add "Skills Locations by Agent" table section
- setup.mdx: Update troubleshooting to show mkdir commands
  for all three agents

This makes it clear where skills are installed for each
supported agent, improving discoverability.
Add support for installing skills to project-local directories in
addition to global (personal) directories. Local skills take precedence
over global skills, enabling project-specific customizations.

Changes:
- Add --local and --global flags to `ralph-tui skills install`
- Update `ralph-tui skills list` to show both global and local status
- Show both global and local paths for each agent
- Update help text with comprehensive location documentation
- Update installation.mdx and setup.mdx with local skills info

Local skill paths per agent:
- Claude Code: .claude/skills/
- OpenCode: .opencode/skills/
- Factory Droid: .factory/skills/
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ralph-tui Ready Ready Preview, Comment Jan 19, 2026 2:59pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 18, 2026

Walkthrough

Per-agent skills discovery and reporting are added to system info; package.json path resolution is refactored for bundled vs development builds; the skills CLI gains local/global install scopes with precedence (local > global); OpenCode agent skill paths updated; TUI shortcuts and documentation updated to reflect these changes.

Changes

Cohort / File(s) Summary
System Information & Package Resolution
src/commands/info.ts, src/commands/info.test.ts
Adds SkillsInfo/AgentSkillsInfo, exports computePackageJsonPath(currentDir), implements skill discovery (bundled, custom, per-agent), integrates skills into SystemInfo and formatted outputs, and updates tests to cover skills and package.json path resolution.
Skills Command Enhancement
src/commands/skills.ts, src/commands/skills.test.ts
Adds --local and --global flags; propagates cwd-based status checks; reports per-target (local/global) install status with precedence semantics; updates help and install/list outputs.
Agent Plugin Updates
src/plugins/agents/builtin/opencode.ts
Changes OpenCode default skill paths from ~/.opencode/skill~/.config/opencode/skills (personal) and .opencode/skill.opencode/skills (repo).
TUI & CLI Documentation
README.md, website/content/docs/plugins/agents/claude.mdx, website/content/docs/plugins/agents/droid.mdx
Removes i/u toggles; adds T (subagent tree toggle), t (cycle trace detail), and updates related help text and examples.
Skills & Setup Documentation
website/content/docs/cli/setup.mdx, website/content/docs/getting-started/installation.mdx
Documents per-agent bundled skills distribution; adds "Skills Locations by Agent" table; introduces global/local install guidance, examples and precedence note that local overrides global.
Configuration Documentation
website/content/docs/configuration/options.mdx
Adds "Prompt Template Precedence" section describing a four-tier resolution order with first-match-wins and CLI tips for viewing/scaffolding templates.

Sequence Diagram(s)

sequenceDiagram
  participant User as Client (CLI)
  participant CLI as ralph CLI
  participant Cmd as skills command
  participant Installer as Installer/Status
  participant FS as Filesystem/Agents

  User->>CLI: ralph skills install --local|--global
  CLI->>Cmd: parse args (scope, agent, skill)
  Cmd->>Installer: determine targets (global path, repo path using cwd)
  Installer->>FS: list/check skill dirs (bundled, custom, agent paths)
  FS-->>Installer: skill presence/status
  Installer->>FS: install skill to target path(s)
  FS-->>Installer: install result
  Installer-->>Cmd: aggregated per-target status (local vs global)
  Cmd-->>CLI: render status with precedence note (local > global)
  CLI-->>User: display install/list output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hop through directories, near and far,
Bundled skills packed in every jar,
Local first, then global I peep,
T for trees, t for depths so deep—
A rabbit's cheer for tidy paths and sweep!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: info command version detection, skills display, and documentation updates' accurately summarises the main changes across multiple components (info command, skills display, and documentation), directly reflecting the primary objectives of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 79.74684% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.97%. Comparing base (213ce5c) to head (7f1d606).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/commands/skills.ts 67.30% 17 Missing ⚠️
src/commands/info.ts 85.57% 15 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #149      +/-   ##
==========================================
+ Coverage   45.74%   45.97%   +0.23%     
==========================================
  Files          63       63              
  Lines       15988    16101     +113     
==========================================
+ Hits         7313     7402      +89     
- Misses       8675     8699      +24     
Files with missing lines Coverage Δ
src/plugins/agents/builtin/opencode.ts 37.46% <100.00%> (ø)
src/commands/info.ts 76.00% <85.57%> (+2.72%) ⬆️
src/commands/skills.ts 86.85% <67.30%> (-2.75%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@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: 1

🤖 Fix all issues with AI agents
In `@website/content/docs/configuration/options.mdx`:
- Around line 368-383: Update the Prompt Template Precedence section in
website/content/docs/configuration/options.mdx to match the real 4-tier
resolution: combine CLI `--prompt` and config `prompt_template` into the same
top-priority entry (first-match wins), replace the project-level path with
`.ralph-tui-prompt.hbs` (or configured via `.ralph-tui/config.toml`) instead of
`.ralph-tui/templates/{tracker}.hbs`, update the user-level path to
`~/.config/ralph-tui/` with filenames like `prompt.md` or `prompt-beads.md` (not
`~/.config/ralph-tui/templates/{tracker}.hbs`), remove the non-existent "Tracker
plugin template" tier, ensure the built-in default remains lowest priority, and
change the Callout command text to use `ralph-tui template show` (not `view`) so
the table and tip accurately reflect the implementation.
🧹 Nitpick comments (2)
src/commands/info.ts (1)

26-35: Consider tightening the dist directory detection to avoid false positives.

The endsWith('dist') check could match paths where dist is part of another directory name (e.g., /path/mydist). While unlikely in practice since the path originates from import.meta.url, a more robust check would verify the path separator:

Suggested improvement
 export function computePackageJsonPath(currentDir: string): string {
-  if (currentDir.endsWith('dist') || currentDir.includes('/dist/') || currentDir.includes('\\dist\\')) {
+  const isDist = currentDir === 'dist' ||
+    currentDir.endsWith('/dist') ||
+    currentDir.endsWith('\\dist') ||
+    currentDir.includes('/dist/') ||
+    currentDir.includes('\\dist\\');
+  if (isDist) {
     return join(currentDir, '..', 'package.json');
   }
   return join(currentDir, '..', '..', 'package.json');
 }
src/commands/info.test.ts (1)

484-488: The Windows path assertion could be strengthened.

The current assertion toContain('package.json') is quite permissive. On non-Windows systems, path.join doesn't interpret backslashes as path separators, so this test may pass for the wrong reason. Consider adding a comment explaining this limitation or using a conditional assertion based on process.platform.

Suggested improvement
   test('handles Windows-style dist path', () => {
+    // Note: path.join behaviour with Windows paths on Unix is platform-dependent.
+    // This test verifies the dist detection logic works with backslash separators,
+    // even if the resulting path isn't fully correct on non-Windows systems.
     const result = computePackageJsonPath('C:\\app\\dist');
 
     expect(result).toContain('package.json');
   });

- Combine CLI --prompt and config prompt_template into single top-priority entry
- Update project-level path description to .ralph-tui-prompt.hbs
- Update user-level path to ~/.config/ralph-tui/prompt.md format
- Remove non-existent "Tracker plugin template" tier
- Fix command to ralph-tui template show (not view)
@subsy subsy merged commit ec485ff into main Jan 19, 2026
9 checks passed
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
fix: info command version detection, skills display, and documentation updates
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