Agent skill

Optimize Benchmarks

by JamieMason in JamieMason/syncpack

Iterative performance optimisation loop for syncpack-specifier.

MITAuto-check passedDevelopment

Install Optimize Benchmarks

skills CLI
$ npx skills add JamieMason/syncpack --skill optimize-benchmarks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JamieMason/syncpack optimize-benchmarks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JamieMason/syncpack.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/optimize-benchmarks .claude/skills/optimize-benchmarks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
optimize-benchmarks
GitHub stars
2.1k
Token cost
~1.5k tokens
SKILL.md length
505 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Iterative performance optimisation loop for syncpack-specifier.

  • Works in 7 steps: Baseline → Identify Bottleneck → Apply ONE Optimisation → …
  • Development work in your project
  • SKILL.md covers Workflow, Known Optimisation Opportunities, Architecture Notes and Rules
  • Calls cargo

What it does

Optimize Benchmarks is an agent skill from JamieMason/syncpack. Iterative performance optimisation loop for syncpack-specifier. Runs benchmarks, identifies bottlenecks, applies optimisations, verifies tests pass and benchmarks improve, then repeats.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. The repository describes itself as: Consistent dependency versions in large JavaScript Monorepos. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/optimize-benchmarks”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Baseline
  2. Identify Bottleneck
  3. Apply ONE Optimisation
  4. Verify Tests Pass
  5. Benchmark Against Baseline
  6. Evaluate
  7. Repeat

What it can do on your machine

Read from SKILL.md and the folder at commit 958d306. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Optimize Benchmarks loads about 1.5k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 505 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from JamieMason/syncpack at commit 958d306, republished under its MIT licence (© JamieMason). 505 words, ~1,526 tokens.

Download SKILL.mdSave it as .claude/skills/optimize-benchmarks/SKILL.md (or your agent's skills folder).
name
optimize-benchmarks
description
Iterative performance optimisation loop for syncpack-specifier. Runs benchmarks, identifies bottlenecks, applies optimisations, verifies tests pass and benchmarks improve, then repeats.

Optimize Benchmarks

Iterative loop: benchmark, optimise, test, verify improvement, repeat.

Workflow

1. Baseline
bash
cargo bench -p syncpack-specifier -- --save-baseline before 2>&1 | tail -40

Save the output. Identify which variants are slowest.

2. Identify Bottleneck

From the full baseline, focus on the slowest benchmarks first.

Priority order for specifier parsing:

  1. Specifier::create — the main parse function, called for every version string
  2. parser::is_range — checks 12 regexes sequentially
  3. parser::is_exact — checks 4 regexes sequentially
  4. parser::is_complex_range — splits, collects, iterates
  5. Individual regex matches in regexes.rs
3. Apply ONE Optimisation

Make a single, focused change. Do NOT bundle multiple optimisations — each must be independently measurable.

4. Verify Tests Pass
bash
cargo test -p syncpack-specifier 2>&1 | tail -5

If tests fail, fix or revert. Never proceed with failing tests.

5. Benchmark Against Baseline
bash
cargo bench -p syncpack-specifier -- --baseline before 2>&1 | tail -40

Look for [-XX.XXX% ...] (improvement) or [+XX.XXX% ...] (regression).

6. Evaluate
  • Improved: Report the gains. Update baseline: cargo bench -p syncpack-specifier -- --save-baseline before. Continue to step 2.
  • No change: Revert and try a different approach.
  • Regressed: Revert immediately.
7. Repeat

Go to step 2. Stop when:

  • User says stop
  • No bottlenecks remain
  • Gains are <1% across all benchmarks

Known Optimisation Opportunities

High Impact

Replace regex with char-based parsing in parser.rs / regexes.rs

Most regexes in regexes.rs match simple patterns like ^[0-9]+\.[0-9]+\.[0-9]+$ (exact semver). These can be replaced with byte/char iteration:

rust
// Instead of regex EXACT: r"^[0-9]+\.[0-9]+\.[0-9]+$"
fn is_exact_version(s: &str) -> bool {
  let mut dots = 0;
  let bytes = s.as_bytes();
  if bytes.is_empty() { return false; }
  for &b in bytes {
    match b {
      b'0'..=b'9' => {},
      b'.' => dots += 1,
      _ => return false,
    }
  }
  dots == 2
}

Regex is_match() has overhead even for simple patterns: engine setup, capture group allocation. Char-based parsing for these patterns is 5-20x faster.

Reduce sequential regex attempts in parser::is_range

is_range tries 12 regexes. Instead, match on first char(s) to dispatch:

rust
fn is_range(s: &str) -> bool {
  match s.as_bytes().first() {
    Some(b'^') => is_semver_after(s, 1) || is_semver_tag_after(s, 1),
    Some(b'~') => is_semver_after(s, 1) || is_semver_tag_after(s, 1),
    Some(b'>') => { /* check >= vs > then validate remainder */ },
    Some(b'<') => { /* check <= vs < then validate remainder */ },
    _ => false,
  }
}

Consolidate related regex patterns

Many regexes are pairs: EXACT + EXACT_TAG, CARET + CARET_TAG, etc. Merge each pair into one function that handles both cases:

rust
fn is_exact(s: &str) -> bool {
  // Parse digits.digits.digits, then optionally -tag
  let rest = parse_semver_triple(s)?;
  rest.is_empty() || rest.starts_with('-')
}
Show full SKILL.md (246 more words)Show less
Medium Impact

Replace lazy_static with std::sync::OnceLock

lazy_static uses an extra indirection layer. OnceLock (stable since Rust 1.80) is zero-cost after init:

rust
use std::sync::OnceLock;

fn exact_regex() -> &'static Regex {
  static RE: OnceLock<Regex> = OnceLock::new();
  RE.get_or_init(|| Regex::new(r"^[0-9]+\.[0-9]+\.[0-9]+$").unwrap())
}

But if regex is being replaced with char-based parsing, this becomes irrelevant.

Reorder checks in Specifier::create by frequency

In a typical monorepo, most specifiers are ^x.y.z (range) or x.y.z (exact). The current order already checks exact first, then range — good. But is_exact tries 4 regex patterns. A single fast char check can short-circuit:

rust
// Fast path: first char is digit → likely exact or major or minor
// Fast path: first char is ^ or ~ → likely range

Avoid String allocation in strip_semver_range

strip_semver_range returns &str (already good), but callers like Range::create then .to_string() the result. Consider whether the allocation can be deferred.

Low Impact
  • Replace HashMap in caches with FxHashMap (faster hashing for short strings)
  • Use SmallString or stack-allocated strings for short specifiers
  • Pre-size cache HashMap with expected capacity

Architecture Notes

Key files in crates/syncpack-specifier/src/:

FileRole
lib.rsSpecifier enum, create() dispatch, caches
parser.rsis_exact(), is_range(), etc. — classification functions
regexes.rsAll lazy_static regex patterns
exact.rs, range.rs, etc.Variant constructors calling node_semver
semver_range.rsSemverRange enum, parse()

The hot path is: Specifier::create() → parser::is_*() → regexes::* → variant ::create() → node_semver parsing.

Optimising the parser::is_* layer gives the biggest wins because it runs for every specifier, and most of the time most checks return false (only one branch matches).

Rules

  • ONE change per iteration
  • Always verify tests pass before benchmarking
  • Always compare against baseline
  • Report numbers: before → after (% change)
  • Revert regressions immediately
  • Don't optimise what doesn't show up in benchmarks
  • Use fast iteration ("batch" filter) during the loop, full suite only at start and end

© JamieMason, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/optimize-benchmarks of JamieMason/syncpack.

Open the folder on GitHubat commit 958d306

Compare with similar skills

Optimize Benchmarks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Optimize Benchmarks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Optimize Benchmarks this skillJamieMason/syncpack2.1k—~1.5kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k24 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 24 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 22 repos~577 tokens
    DevelopmentAuto-check passed

More from JamieMason/syncpack

All 11 skills in this repo
  • Document Code

    JamieMason/syncpack

    Add and update the documentation website for Syncpack. An agent skill from JamieMason/syncpack.

    2.1k GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Fix Bug

    JamieMason/syncpack

    Debug and fix bugs in Syncpack using scientific debugging methodology.

    2.1k GitHub stars~1.2k tokensUpdated 11 days ago
    Auto-check passed
  • Front Loading

    JamieMason/syncpack

    Put the answer first, then context and details follow. An agent skill from JamieMason/syncpack.

    2.1k GitHub stars~1.9k tokensUpdated 11 days ago
    Auto-check passed
  • Search Code

    JamieMason/syncpack

    Search for code patterns in Syncpack. An agent skill from JamieMason/syncpack.

    2.1k GitHub stars~581 tokensUpdated 11 days ago
    Auto-check passed
  • Signal Over Noise

    JamieMason/syncpack

    Maximize useful information per word by removing filler, obvious explanations, and hedging language.

    2.1k GitHub stars~1.5k tokensUpdated 11 days ago
    Auto-check passed
  • Testing Gaps

    JamieMason/syncpack

    Run coverage, inspect results, and identify missing test scenarios for a given source file.

    2.1k GitHub stars~766 tokensUpdated 11 days ago
    Auto-check passed

Categories

Questions about Optimize Benchmarks

What does Optimize Benchmarks do?

Iterative performance optimisation loop for syncpack-specifier. Optimize Benchmarks is an agent skill from JamieMason/syncpack. Iterative performance optimisation loop for syncpack-specifier.

When should I use Optimize Benchmarks?

Optimize Benchmarks fits situations like: development work in your project.

How do I install Optimize Benchmarks in Claude Code?

Run `npx skills add JamieMason/syncpack --skill optimize-benchmarks -a claude-code`. Or copy the skill folder (.claude/skills/optimize-benchmarks in JamieMason/syncpack) into .claude/skills/optimize-benchmarks in your project. Claude Code loads it when a task matches its description.

How do I install Optimize Benchmarks in Codex?

Run `npx skills add JamieMason/syncpack --skill optimize-benchmarks -a codex`. Or copy the skill folder (.claude/skills/optimize-benchmarks in JamieMason/syncpack) into .agents/skills/optimize-benchmarks in your project. Codex loads it when a task matches its description.

Can I use Optimize Benchmarks in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JamieMason/syncpack --skill optimize-benchmarks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/optimize-benchmarks, .gemini/skills/optimize-benchmarks, .github/skills/optimize-benchmarks and .opencode/skills/optimize-benchmarks in your project.

What does Optimize Benchmarks need to run?

Going by SKILL.md and its folder, Optimize Benchmarks needs the command-line tools its instructions call (cargo).

Does Optimize Benchmarks access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Optimize Benchmarks safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Optimize Benchmarks use?

Optimize Benchmarks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Optimize Benchmarks use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Optimize Benchmarks?

Skills that share tags, products or a category with Optimize Benchmarks: Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars) and Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Optimize Benchmarks?

JamieMason (a GitHub user) maintains it in JamieMason/syncpack, which has 2,099 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 26, 2026.

Source: JamieMason/syncpack on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.