Skip to content

feat: add --user flag to install skills at user level#316

Merged
sachiniyer merged 2 commits into
mainfrom
devin/1781651773-skill-user-flag
Jun 17, 2026
Merged

feat: add --user flag to install skills at user level#316
sachiniyer merged 2 commits into
mainfrom
devin/1781651773-skill-user-flag

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

detail skill currently always installs to <repo>/.claude/skills/, requiring a git repo. This adds a --user flag that installs to ~/.claude/skills/ instead, so skills are accessible from any project.

detail skill --user          # installs detail-bugs to ~/.claude/skills/
detail skill --user rules    # installs detail-create-rules to ~/.claude/skills/

When --user is passed, handle() resolves the base path via homedir::my_home() (already a dependency) instead of git rev-parse --show-toplevel, skipping the git-repo requirement entirely.

Link to Devin session: https://app.devin.ai/sessions/9c05871e14e84779b12a3b96a7669c01
Requested by: @sachiniyer


Open in Devin Review

Summary by cubic

Adds a --user flag to install Detail skills to ~/.claude/skills/, so skills work from any project without a git repo. Default repo-level installs remain unchanged.

  • New Features
    • detail skill --user installs to the user path via homedir::my_home(), bypassing the git root requirement.
    • Works for the default install and the rules subcommand; --user is global, so both detail skill --user rules and detail skill rules --user are supported.
    • Updated CLI help to show detail skill [OPTIONS] [COMMAND] and document --user.

Written for commit 7c62d1d. Summary will update on new commits.

Review in cubic

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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author
Original prompt from Sachin

Siddhartha Mishra [4:06 PM]
the cli only installs skills inside a repo? ideally I would move them to my user level skills so I can use them everywhere. is that a conscious choice?
Dan Robinson [4:07 PM]
Nah just an oversight on our part. We keep our skills inside our monorepo.
Dan Robinson [4:07 PM]
It's just a markdown so worst case you can take it with you / move it wherever.
Siddhartha Mishra [4:07 PM]
yeah will do
Dan Robinson [4:08 PM]
Is there a standard location for these skills to go?
Dan Robinson [4:08 PM]
also just saw a bunch of the bugs detail had flagged in that repo, had never logged into the detail dashboard before lol so will work through some of those as wellOk there is definitely something to be learned here. For future ref, if you go in to Settings > Repositories > repo you should be able to set it up to automatically send future bugs on that repo to Linear or Slack or github or ...

Let us know what you notice! (Any of them any good? Noisy? Other takes?)
Siddhartha Mishra [4:09 PM]
i just want the skills to go in my ~/.claude/skills so I can access them anywhere
Dan Robinson [4:09 PM]
cc @Sachin Iyer ^
Sachin Iyer [4:11 PM]
i just want the skills to go in my ~/.claude/skills so I can access them anywhere

will fix!

Can you add a flag to allow installing skills in the user level configuration instead

@aviator-app

aviator-app Bot commented Jun 16, 2026

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

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-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread src/lib.rs
Comment on lines +212 to +214
/// Install to user-level ~/.claude/skills instead of the current repo
#[arg(long)]
user: bool,

@devin-ai-integration devin-ai-integration Bot Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call — added global = true so both detail skill --user rules and detail skill rules --user work. Fixed in 7c62d1d.

Comment thread src/commands/skill.rs
Comment on lines +33 to +37
fn user_home() -> Result<PathBuf> {
my_home()
.context("failed to determine home directory")?
.context("home directory not found")
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 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).

Open in Devin Review

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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Test Results

Built debug binary from PR branch and ran CLI commands directly. All 6 tests passed.

Feature Tests (4/4 passed)
Test Result
detail skill --user installs to ~/.claude/skills/detail-bugs/ PASSED
detail skill --user rules installs to ~/.claude/skills/detail-create-rules/ PASSED
detail skill rules --user works (global flag after subcommand) PASSED
detail skill --user works outside a git repo PASSED
Regression Tests (2/2 passed)
Test Result
detail skill without --user fails outside git repo with "not inside a git repository" PASSED
detail skill without --user installs to repo .claude/skills/ only (not user-level) PASSED
Help output

Both detail skill --help and detail skill rules --help show the --user flag, confirming global = true works.

$ detail skill rules --help
Install the detail-create-rules skill

Usage: detail skill rules [OPTIONS]

Options:
      --user  Install to user-level ~/.claude/skills instead of the current repo
  -h, --help  Print help

Devin session

@sachiniyer sachiniyer merged commit 9ccab47 into main Jun 17, 2026
13 of 14 checks passed
@sachiniyer sachiniyer deleted the devin/1781651773-skill-user-flag branch June 17, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant