Agent Native

codeprobe-mine

Extracts reusable eval tasks from a repository's merge history using the codeprobe CLI.

by SourcegraphOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (sourcegraph)

Agents
Claude Code
License
Apache-2.0 (permissive)
Pin
349658apinned Oct 9, 2026
Context cost
about 1,600 tokenswhen the skill loads
GitHub stars
2on sourcegraph/codeprobe
Scripts
None found

What it does

“Mine eval tasks from a repository's history using the codeprobe CLI. Extracts real code-change tasks from merged PRs/MRs with ground truth, test scripts, and scoring rubrics. Triggers on mine tasks, extract tasks, propose tasks, benchmark my repo, eval my repo, discover tasks. Use this when the agent needs to produce a reusable task suite from a codebase.”
The author's description, from SKILL.md

Generated summary from the skill's own text

Extracts reusable eval tasks from a repository's merge history using the codeprobe CLI. Each mined task includes test scripts, ground-truth diffs, and scoring rubrics for automated evaluation. Supports Python, Go, and JavaScript/TypeScript repositories.

When to use it

  • Building evaluation task suites from real codebase changes
  • Mining tasks for benchmarking code-change capabilities
  • Creating test datasets from merged pull requests
  • Extracting architecture comprehension tasks from Python repos

When not to

  • Repositories without merged PRs or pull request history
  • Languages outside Python, Go, and JavaScript/TypeScript
  • Real-time code modification or deployment tasks

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add sourcegraph/codeprobe --skill codeprobe-mine

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install sourcegraph/codeprobe codeprobe-mine@349658a0c14622dccccc9be038cabca63a1e4a0b

Installs the commit we checked (349658a).

Copy by hand

Download the folder at 349658a and put it in .claude/skills/codeprobe-mine for Claude Code and in .agents/skills/codeprobe-mine for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 349658a

Claude Code plugin

/plugin install sourcegraph@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "codeprobe-mine" by Sourcegraph.

Source, pinned to commit 349658a0c14622dccccc9be038cabca63a1e4a0b:
https://github.com/sourcegraph/codeprobe/tree/349658a0c14622dccccc9be038cabca63a1e4a0b/src/codeprobe/skills_data/codeprobe-mine

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/codeprobe-mine/ for Claude Code and .agents/skills/codeprobe-mine/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/sourcegraph/codeprobe-mine

SKILL.md at the pin

---
name: codeprobe-mine
description: Mine eval tasks from a repository's history using the codeprobe CLI. Extracts real code-change tasks from merged PRs/MRs with ground truth, test scripts, and scoring rubrics. Triggers on mine tasks, extract tasks, propose tasks, benchmark my repo, eval my repo, discover tasks. Use this when the agent needs to produce a reusable task suite from a codebase.
user-invocable: false
---

# codeprobe mine (autonomous agent contract)

Mine real eval tasks from a repository's merge history. The resulting task
directories contain instruction.md, test.sh, metadata.json, and the ground-truth
diff required for automated scoring.

## Environment (pre-loaded)

The following commands are executed and their JSON envelopes are read into the
prompt before this skill's body runs. Treat them as authoritative context:

- !`codeprobe doctor --json`
- !`codeprobe check-infra offline --json`

If doctor's envelope reports `ok: false`, resolve the flagged checks before
invoking `codeprobe mine`. If check-infra offline reports a TTL shorter than the
expected mining duration, either extend credentials or omit `--offline` at call
time.

## Bare invocation

Minimum viable call. Always pair `--json` with `--no-interactive` for agents —
the default CLI is TTY-interactive:

```bash
codeprobe mine <repo_path> --json --no-interactive --goal general --count 5
```

For MCP/tool-benefit task mining:

```bash
codeprobe mine <repo_path> --json --no-interactive --goal mcp --count 10
```

When the repo has no merged PRs (squash-only history) the default narrative
source is undetectable and mining fails loudly. In that case, pass a commit-
based narrative source explicitly:

```bash
codeprobe mine <repo_path> --json --no-interactive --narrative-source commits
```

## Supported language matrix

`codeprobe mine` supports Python, Go, and JavaScript/TypeScript repositories
only — test-command generation exists solely for this matrix. Comprehension
mining (`--goal navigation` / `--task-type architecture_comprehension`) is
Python-only (import-graph static analysis). Any other primary language fails
fast with UNSUPPORTED_LANGUAGE before PR scanning starts. Do not retry the
same repo; pick a supported repository, or for comprehension on a Go/JS-TS
repo re-run with `--goal quality`.

## JSON fields to parse

`--json` emits a single terminal envelope on stdout. Top-level keys are
exactly:

```json
{
  "record_type": "envelope",
  "ok": true,
  "command": "mine",
  "version": "<codeprobe version>",
  "schema_version": "1",
  "exit_code": 0,
  "data": {
    "command_schema_version": "1",
    "tasks_dir": "<abs-path or null>",
    "task_count": 5,
    "goal": "<goal or null>",
    "tenant": "<tenant or null>",
    "tenant_source": "<flag|env or null>",
    "comprehension_consensus": null,
    "experiment_created": true,
    "experiment_dir": "<abs-path or null>",
    "llm_spend": { "calls": 0, "input_tokens": 0, "output_tokens": 0, "cost_usd": 0.0, "cost_unknown_calls": 0, "cost_source": "calculated" },
    "rejections": { "quality": 0, "min_files": 0, "subsystem": 0, "extraction": 0, "total": 0 }
  },
  "error": null,
  "warnings": [ { "code": "<CODE>", "message": "...", "detail": {} } ],
  "next_steps": [ { "summary": "...", "command": "..." } ]
}
```

On failure `ok` is `false`, `exit_code` is non-zero, and `error` is a single
object (never an array):

```json
{
  "record_type": "envelope",
  "ok": false,
  "command": "mine",
  "version": "<codeprobe version>",
  "schema_version": "1",
  "exit_code": 2,
  "data": null,
  "error": {
    "code": "<CODE>",
    "message": "...",
    "kind": "prescriptive",
    "terminal": false,
    "next_try_flag": "--narrative-source",
    "next_try_value": "commits",
    "diagnose_cmd": null,
    "message_for_agent": null,
    "detail": {}
  },
  "warnings": [],
  "next_steps": []
}
```

Parse `ok`. On `false`, inspect `error.code`; when `error.kind` is
`"prescriptive"`, retry with `error.next_try_flag` set to
`error.next_try_value`; when `"diagnostic"`, run `error.diagnose_cmd` (if
set) and stop unless the table below says otherwise. On `true`, read
`data.tasks_dir` and `data.task_count`.

Zero-yield mining still exits 0 with `ok: true` (emptiness is data, not an
error), so branch on `data.task_count`, never on `ok` alone. When mining
under-delivers (`task_count` of 0, or fewer tasks than requested with
candidates filtered), `data.rejections` carries per-filter rejection counts,
`warnings` gains a `MINE_SHORTFALL` entry, and `next_steps[0].command` is an
executable remediation command derived from the dominant rejection filter.
Execute it instead of proceeding to `codeprobe run` against an empty suite.
`data.rejections` is absent on a full-yield mine.

## Error handling

Only the codes below may surface from this command. At runtime the
envelope's `error` object carries the authoritative description and
remediation pattern for whichever code fired.

| Code | Kind | Retryable? | Action |
|---|---|---|---|
| NARRATIVE_SOURCE_UNDETECTABLE | prescriptive | yes (with fix) | Re-run with explicit `--narrative-source commits` or `--narrative-source commits+rfcs`. |
| GOAL_UNDETECTABLE | diagnostic | yes (with fix) | Pass an explicit `--goal`; re-run. |
| INVALID_GIT_URL | prescriptive | yes (with fix) | Re-issue with a well-formed `<repo_path>` (absolute local dir or valid git URL). |
| CLONE_FAILED | diagnostic | yes (bounded) | Inspect credentials/network; retry once more. Stop after second failure. |
| OFFLINE_PREFLIGHT_FAILED | diagnostic | no | Resolve preflight output from pre-loaded `check-infra offline` envelope; do not retry blindly. |
| METADATA_MISSING | diagnostic | no | Structural problem in the target repo or cached fixture; stop and surface to caller. |
| LLM_UNAVAILABLE | diagnostic | yes (bounded) | Treat as transient provider outage; retry once. |
| UNSUPPORTED_LANGUAGE | diagnostic | no | Repo's primary language is outside the Python/Go/JavaScript-TypeScript matrix (or comprehension mining on a non-Python repo). Pick a supported repository; for comprehension use a Python repo or `--goal quality`. |
| INTERRUPTED | diagnostic | **TERMINAL — do not retry** | User/signal halted the run. Partial output is preserved on disk; `error.diagnose_cmd` carries the exact `codeprobe mine <path> --resume` command for a later continuation. Exit. |

## Retry policy

- Maximum retry depth per error chain: **2**. After two consecutive errors
  sharing the same code, stop and surface the envelope to the caller.
- Terminal errors (INTERRUPTED, BUDGET_EXCEEDED) are **never** retried.
- Do not auto-change flags on retry unless `error.next_try_flag` /
  `error.next_try_value` explicitly tell you which flag to set (e.g.
  NARRATIVE_SOURCE_UNDETECTABLE → `--narrative-source commits`). Arbitrary
  flag mutation is out of scope.
- Between retries, re-read the pre-loaded doctor envelope; if doctor now
  reports failing checks, stop.

From sourcegraph/codeprobe at 349658a, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 349658a

Files

1 file, 7.0 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 349658a
All 7 skills from Sourcegraph

More from Sourcegraph

  • searching-sourcegraph

    This skill enables agents to search and navigate codebases using Sourcegraph, with guided workflows for finding implementations, understanding systems…

    Claude Code, Codex, Cursor +4 · about 2.2K tokens · pinned 6 days ago

  • codeprobe-calibrate

    This skill runs a validation gate for a curator version by comparing it against a holdout dataset and a reference curator.

    Claude Code · about 870 tokens · pinned 6 days ago

  • codeprobe-check-infra

    This skill diagnoses whether mined task directories can run safely by checking for capability drift and verifying credential time-to-live against expected…

    Claude Code · about 970 tokens · pinned 6 days ago

  • codeprobe-interpret

    This skill analyzes results from codeprobe benchmark runs by comparing configurations, computing statistical rankings, and generating actionable…

    Claude Code · about 920 tokens · pinned 6 days ago

  • codeprobe-run

    Execute eval task suites against an AI coding agent using codeprobe, spawning isolated sessions and scoring each task with automated tests.

    Claude Code · about 1.5K tokens · pinned 6 days ago

  • sourcegraph-nav

    Navigates code using Sourcegraph to locate where symbols are defined and find all places they are used.

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 580 tokens · pinned 6 days ago

All AI and agents skills
  • agent-builder

    Agent Builder orchestrates the creation, modification, testing, and publishing of n8n Agents.

    by n8nOfficial publisher

    Claude Code, Codex, Cursor +3 · about 2.3K tokens · pinned 6 days ago

  • intent-recognition

    Classifies automation requests by determining which primitive owns the top-level control flow (workflow, agent, needs clarification, or out-of-scope) and…

    by n8nOfficial publisher

    Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 6 days ago

  • planned-task-runtime

    This skill manages follow-up interactions with a background task execution system, handling task completion synthesis, failure replanning, workflow building…

    by n8nOfficial publisher

    Claude Code, Codex, Cursor +3 · about 2.2K tokens · pinned 6 days ago

  • skill-creator

    This skill guides agents through creating new skills that extend Gemini CLI with specialized knowledge, workflows, and tool integrations.

    by GoogleOfficial publisher

    Contains scripts

    Gemini CLI · about 5K tokens · pinned 6 days ago

  • -21risk-automation

    This skill automates 21risk operations by connecting to the 21risk toolkit through Composio's Rube MCP server.

    by ComposioOfficial publisher

    Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago

  • -2chat-automation

    This skill automates 2chat tasks by integrating with Composio's 2chat toolkit through Rube MCP.

    by ComposioOfficial publisher

    Agents not labelled yet · about 680 tokens · pinned 6 days ago

Open roles at Sourcegraph

2 open roles on the jobs board

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use