--- pretty_name: DeepSkill language: - en task_categories: - text-retrieval tags: - agent-skills - relevance-judgments - qrels size_categories: - 1K> pt.terrier.Retriever( index, wmodel="BM25", controls={"termpipelines": ""}) # Swap bm25 for your own retriever: any PyTerrier pipeline that returns skill_ids as docno print(pt.Experiment([bm25], queries, qrels, eval_metrics=[nDCG@5, P(rel=2)@5, R(rel=2)@5, Judged@5], names=["BM25"])) ``` BM25 scores nDCG@5 0.276, P(rel=2)@5 0.176, R(rel=2)@5 0.246 and Judged@5 1.0: it was one of the pool retrievers, so all of its top 5 is judged. A retriever outside the pool will have some unjudged skills. **Skill-Usage.** Set `DATASETS = ["skill_usage"]` and load the skills from Skill-Usage's archive (788 MB) instead. BM25 then scores nDCG@5 0.578. ```python import io, zipfile archive = zipfile.ZipFile(download("Shiyu-Lab/Skill-Usage", "skills-34k/skills.zip")) skills = [] for line in open(download("Shiyu-Lab/Skill-Usage", "skills-34k/skills_meta.jsonl")): meta = json.loads(line) try: text = io.TextIOWrapper(archive.open(f"{meta['skill_id']}/SKILL.md"), encoding="utf-8", errors="replace").read() except KeyError: # no SKILL.md text = "" content = re.sub(r"^---\s*\n.*?\n---\s*\n", "", text, count=1, flags=re.DOTALL).strip() # drop the frontmatter skills.append({"skill_id": meta["skill_id"], "name": meta.get("name", ""), "description": meta.get("description", ""), "content": content}) ``` **A run file.** To score a run you already have in TREC format: ```python import ir_measures from huggingface_hub import hf_hub_download from ir_measures import nDCG, P, R, Judged qrels = list(ir_measures.read_trec_qrels(hf_hub_download( "jdh235/DeepSkill", "qrels/skill_usage-relevance.qrels", repo_type="dataset"))) run = list(ir_measures.read_trec_run("my_run.trec")) print(ir_measures.calc_aggregate([nDCG@5, P(rel=2)@5, R(rel=2)@5, Judged@5], qrels, run)) ``` Its query IDs must be the `query_id`s here and its document IDs the corpus's `skill_id`s. Ten Skill-Usage `skill_id`s contain spaces (e.g. `benchflow-ai--FFmpeg Media Info`), which break the space-separated TREC format. None of them is judged, so if your run includes one, replace its spaces with `_`. It still counts as non-relevant, and every other skill keeps its rank. **How to measure.** A skill counts as relevant when graded 2 or 3, so set `rel=2` in binary measures. ## Queries `queries/{dataset}.jsonl` has the query text every retriever was given (some dense models prepend their own instruction, as their model cards recommend), one `{"query_id", "query"}` per line. For SRA-Bench this is the agent's prompt for the task: the dataset's prompt template around the question, followed by the system prompt. For Skill-Usage it is the task's `instruction.md`. The queries are optional. The grades judge each skill against the task, not against a particular query, so you can write your own queries from the source benchmarks instead. A `query_id` is the `instance_id` in SRA-Bench's `instances/{dataset}.json`, or the task's folder name in the [Skill-Usage repository](https://github.com/UCSB-NLP-Chang/Skill-Usage)'s `tasks/` (we used commit `03446d16f7b659ccc93ac5bd512f62e9b7fabb45`). To download the labels without them: ```bash hf download jdh235/DeepSkill --repo-type dataset --exclude "queries/*" ``` ## Files `{dataset}` is `bigcodebench`, `champ`, `logicbench`, `medcalcbench` or `theoremqa` (SRA-Bench), or `skill_usage`. | Path | Contents | |---|---| | `qrels/{dataset}-relevance.qrels` | Final grade per pair: `query_id 0 skill_id grade` (0–3) | | `flags/{dataset}-flags.tsv` | Final grade and quality flags per pair (tab-separated, header row; flag 1 = flagged). The dataset viewer shows these as the `labels` config | | `queries/{dataset}.jsonl` | The query for each task (see [Queries](#queries)); the `queries` config in the viewer | ## How the labels were made **Judgment pool.** Each task's pool is the union of 12 retrievers' top 5, plus any reference skill none of them returned. Every task–skill pair in it was graded. **Final grade.** The re-annotation grade if the pair was re-annotated (its first-round grades differed by two or more), otherwise the median of the three first-round grades. **Final flags.** Flags are given per skill, so a skill's flags repeat on each of its pairs. A flag any annotator marked in the first round was re-annotated by all three, and is final if two of the three second-round answers mark it; any other flag is final as not flagged. **Malicious skills.** The annotators flagged 4 skills as malicious on SRA-Bench and 1 on Skill-Usage. Flags were annotated by eye: the annotators read each skill but did not run it or check it with security tools. A flag is therefore a reader's judgement, and an unflagged skill is not known to be safe, all the more because the flags cover only the judged skills. A skill can also change what it does over time, for example by installing a package or downloading a file whose contents later change. Run agents that use skills from these corpora in an isolated environment. ## Licence MIT License Copyright (c) 2026 Jdh235 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.