# Sourcegraph Skills

AI agent skills for searching and understanding codebases with Sourcegraph.

## Installation

### Claude Code

```bash
npx skills add sourcegraph-community/sourcegraph-skill --skill "searching-sourcegraph"
```

Or manually copy the `.claude/skills/` directory to your project or `~/.claude/skills/`.

### Any Agent

The skills follow the [Agent Skills](https://agentskills.io) open standard and can be used with any compatible AI agent.

## Available Skills

### searching-sourcegraph

Search Sourcegraph-indexed codebases for patterns, examples, and system understanding.

**Use when:**
- Implementing new features (find similar patterns first)
- Understanding unfamiliar code ("how does X work")
- Debugging issues (trace errors and recent changes)
- Finding examples of API usage

**Tools used:**
- `keyword_search` - Exact pattern matching
- `nls_search` - Semantic/concept search
- `deepsearch_read` - Architectural understanding
- `find_references` - Trace symbol usage
- `go_to_definition` - Jump to implementations
- `read_file` - Read file contents
- `diff_search` - Find code changes
- `commit_search` - Search commit history

## Structure

```
.claude/skills/searching-sourcegraph/
├── SKILL.md                    # Main skill instructions
├── query-patterns.md           # Regex patterns reference
├── examples/
│   └── common-searches.md      # Real-world examples
└── workflows/
    ├── implementing-feature.md
    ├── understanding-code.md
    └── debugging-issue.md
```

