Skip to content

feat: Add local-repo skill#50

Open
adinauer wants to merge 4 commits intomainfrom
feat/local-repo-skill
Open

feat: Add local-repo skill#50
adinauer wants to merge 4 commits intomainfrom
feat/local-repo-skill

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Feb 18, 2026

A skill that lets you investigate, compare and modify other local git repositories from your current chat in a single repo.

How it works

The ~/.claude/repos.local.json config file is used to specify which directories contain repositories on your machine.

When using the skill, it'll look for a matching repo in all configured directories and then use that.
It will notify you if the repo is missing.
It will also notify you if the referenced repo is outdated, on a non main branch or has local changes.

  [!WARNING]
  sentry-android-gradle-plugin is on branch 5.x.x (default is main)

  [!NOTE]
  sentry-android-gradle-plugin is 12 commit(s) behind origin/5.x.x

  [!WARNING]
  sentry-android-gradle-plugin has local changes

Why

An alternative to setting up workspaces in Cursor that include multiple repos.

I used to start a new chat in a specific (SDK) repo just to answer a question about some internals of that SDK. This involved lots of duplicate explaining and also becomes annoying to manage in terms of which chat on repo A goes with which chat on repo B etc.

Example usages

  • What version of Java SDK is used in /local-repo sentry-android-gradle-plugin

  • Which options for metrics are available in /local-repo ruby

  • Compare what products event processors are able to modify in Java SDK, /local-repo ruby and /local-repo javascript

Also works when using speech-to-text to enter:

What version is local repo Python currently on

Recommended permissions

NOTE: Please review those before copying them.

In ~/.claude/settings.json:

{
  "permissions": {
    "allow": [
      "Bash(bash */local-repo/scripts/list-repos.sh)",
      "Bash(test -d *)",
      "Bash(test -e *)",
      "Bash(git -C * symbolic-ref refs/remotes/origin/HEAD *)",
      "Bash(git -C * branch --show-current)",
      "Bash(git -C * fetch origin *)",
      "Bash(git -C * rev-list *)",
      "Bash(git -C * status *)",
      "Bash(git rev-parse --show-toplevel)",
      "Bash(git status *)",
      "Bash(git status)",
      "Bash(git log *)",
      "Bash(git diff *)",
      "Bash(echo $HOME)",
      "Read(~/.claude/plugins/cache/sentry-skills/sentry-skills/*/skills/similar-sdks/references/sdk-groups.md)",
      "Read(~/.claude/repos.local.json)",
      "Read(~/sentry-repos/**)",
      "Grep(~/sentry-repos/**)",
      "Glob(~/sentry-repos/**)",
      "Read(~/repos/**)",
      "Grep(~/repos/**)",
      "Glob(~/repos/**)"
    ]
  },
...

@adinauer
Copy link
Member Author

adinauer commented Feb 18, 2026

It also seems like using /local-repo sagp can be used to refer to sentry-android-gradle-plugin, not sure what exactly makes that work.

Wasn't able to get autocomplete for repo names.

name: local-repo
description: Investigate, compare, and modify files in other local git repositories. Use when asked to "check another repo", "look at other repo", "compare repos", "local-repo", "cross-repo", "what does sentry-python do", or work with a repository outside the current working directory.
argument-hint: "<repo-name> [file-pattern-or-query]"
allowed-tools: Read, Glob, Bash, Edit, Write, Task, WebFetch, AskUserQuestion
Copy link

Choose a reason for hiding this comment

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

🟠 [YLL-4LU] High number of allowed tools (8 tools) warrants scrutiny (medium confidence)

The skill requests 8 tools (Read, Glob, Bash, Edit, Write, Task, WebFetch, AskUserQuestion) which exceeds the 5-tool threshold that typically warrants review. While each tool appears justified by the skill instructions, this broad permission set increases the attack surface.

Identified by Warden via skill-scanner · medium, medium confidence

Comment on lines +80 to +84
```bash
git -C <repo-path> symbolic-ref refs/remotes/origin/HEAD --short
```
Strip the `origin/` prefix from the output. If this command fails, try `main` then `master`.

Copy link

Choose a reason for hiding this comment

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

Bug: The local-repo skill requires git -C and test -e commands, but the permission settings in .claude/settings.json don't grant access, breaking the skill.
Severity: HIGH

Suggested Fix

Update the .claude/settings.json file to include permission patterns that cover the commands used by the local-repo skill. This would involve adding patterns for git -C commands (e.g., Bash(git -C *:*)) and for the test command (e.g., Bash(test -e *:*)).

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: plugins/sentry-skills/skills/local-repo/SKILL.md#L80-L84

Potential issue: The `local-repo` skill, as defined in `SKILL.md`, instructs the agent
to execute several shell commands, including `git` commands with the `-C` flag (e.g.,
`git -C <repo-path> branch --show-current`) and `test -e` commands. The permission
system uses prefix matching, and the existing patterns in `.claude/settings.json` like
`Bash(git branch:*)` do not match commands that start with `git -C`. Additionally, there
is no permission pattern that allows the `test -e` command. As a result, when the skill
is invoked, these essential commands will be blocked, rendering the skill
non-functional.

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

Comments