feat: add --user flag to install skills at user level#316
Conversation
When --user is passed to `detail skill`, installs skills to ~/.claude/skills/ instead of the current repo's .claude/skills/. This lets users access skills from any repo. Co-Authored-By: Sachin Iyer <siyer@detail.dev>
Original prompt from Sachin
|
Current Aviator status
This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| /// Install to user-level ~/.claude/skills instead of the current repo | ||
| #[arg(long)] | ||
| user: bool, |
There was a problem hiding this comment.
📝 Info: global = true on --user propagates to subcommands but isn't shown in subcommand help
The #[arg(long, global = true)] at src/lib.rs:213 makes --user valid both before and after the rules subcommand (e.g. detail skill --user rules and detail skill rules --user). However, clap-markdown does not render global options in subcommand help sections, so docs/HELP.md:502-506 shows detail skill rules usage without [OPTIONS]. This is a clap-markdown limitation, not a code bug — the flag works correctly at runtime. Users may be confused that --user isn't documented under the rules subcommand, but discoverability via detail skill rules --help (which clap renders at runtime) should show it.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Good call — added global = true so both detail skill --user rules and detail skill rules --user work. Fixed in 7c62d1d.
| fn user_home() -> Result<PathBuf> { | ||
| my_home() | ||
| .context("failed to determine home directory")? | ||
| .context("home directory not found") | ||
| } |
There was a problem hiding this comment.
📝 Info: user_home() follows existing my_home() error-handling pattern
The new user_home() function at src/commands/skill.rs:33-37 uses the same double-.context() pattern as src/config/storage.rs:47-49 to handle the Result<Option<PathBuf>> return type of homedir::my_home(). This is consistent and correct — the first .context() handles IO errors and the second handles the None case (home directory not found).
Was this helpful? React with 👍 or 👎 to provide feedback.
Allows both 'detail skill --user rules' and 'detail skill rules --user'. Co-Authored-By: Sachin Iyer <siyer@detail.dev>
Test ResultsBuilt debug binary from PR branch and ran CLI commands directly. All 6 tests passed. Feature Tests (4/4 passed)
Regression Tests (2/2 passed)
Help outputBoth |
Summary
detail skillcurrently always installs to<repo>/.claude/skills/, requiring a git repo. This adds a--userflag that installs to~/.claude/skills/instead, so skills are accessible from any project.When
--useris passed,handle()resolves the base path viahomedir::my_home()(already a dependency) instead ofgit rev-parse --show-toplevel, skipping the git-repo requirement entirely.Link to Devin session: https://app.devin.ai/sessions/9c05871e14e84779b12a3b96a7669c01
Requested by: @sachiniyer
Summary by cubic
Adds a
--userflag to install Detail skills to~/.claude/skills/, so skills work from any project without a git repo. Default repo-level installs remain unchanged.detail skill --userinstalls to the user path viahomedir::my_home(), bypassing the git root requirement.rulessubcommand;--useris global, so bothdetail skill --user rulesanddetail skill rules --userare supported.detail skill [OPTIONS] [COMMAND]and document--user.Written for commit 7c62d1d. Summary will update on new commits.