Agent skill

Rust Analyzer Ssr

by rocky-data in rocky-data/rocky

Use rust-analyzer's Structural Search and Replace (SSR) for semantic Rust code transformations across the engine workspace.

Apache-2.0Auto-check passedDevelopment

Install Rust Analyzer Ssr

skills CLI
$ npx skills add rocky-data/rocky --skill rust-analyzer-ssr -a claude-code

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

GitHub CLI
$ gh skill install rocky-data/rocky rust-analyzer-ssr --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/rocky-data/rocky.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engine/.claude/skills/rust-analyzer-ssr .claude/skills/rust-analyzer-ssr && 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
rust-analyzer-ssr
GitHub stars
304
Token cost
~1.4k tokens
SKILL.md length
504 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
Apache-2.0

At a glance

Use rust-analyzer's Structural Search and Replace (SSR) for semantic Rust code transformations across the engine workspace.

  • Tasks that involve Refactoring
  • SKILL.md covers When to Use, Basic Syntax, Common Patterns and Constraints, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Rust Analyzer Ssr is an agent skill from rocky-data/rocky. Use rust-analyzer's Structural Search and Replace (SSR) for semantic Rust code transformations across the engine workspace. Apply when refactoring API shapes, migrating patterns, or searching for code structure across the workspace crates.

Its SKILL.md is about 1.4k 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, covering Refactoring. It works with Rust. The repository describes itself as: A SQL transformation engine that type-checks your whole pipeline and catches breaking changes before they run — branches, replay, column-level lineage, compile-time contracts… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “/rust-analyzer-ssr”

What it can do on your machine

Read from SKILL.md and the folder at commit 46be77e. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust, json and bash).

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

  • Network

    Links to these hosts (documentation or services it may open):

    • gist.github.com

    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

Rust Analyzer Ssr loads about 1.4k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 504 words of instructions outside code blocks.

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

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 rocky-data/rocky at commit 46be77e, republished under its Apache-2.0 licence (© rocky-data). 504 words, ~1,447 tokens.

Download SKILL.mdSave it as .claude/skills/rust-analyzer-ssr/SKILL.md (or your agent's skills folder).
name
rust-analyzer-ssr
description
Use rust-analyzer's Structural Search and Replace (SSR) for semantic Rust code transformations across the engine workspace. Apply when refactoring API shapes, migrating patterns, or searching for code structure across the workspace crates.

rust-analyzer Structural Search and Replace (SSR)

Source: vendored from davidbarsky/8fae6dc45c294297db582378284bd1f2 @ 191b2ee46088920de97d682561e2abd1edd64a42 (SKILL-3.md). Author: David Barsky (rust-analyzer contributor at Meta). This is a pure tooling reference with no style opinions.

Use rust-analyzer's SSR for semantic code transformations in Rust projects. SSR matches code by AST structure and semantic meaning, not text. In Rocky this is especially useful for cross-crate refactors against the multi-crate workspace — string grep regularly over-matches.

When to Use

  • Refactoring patterns across a codebase (rename, restructure, migrate APIs)
  • Converting between equivalent forms (UFCS to method calls, struct literals to constructors)
  • Finding all usages of a specific code pattern
  • Semantic-aware search that understands type resolution

Basic Syntax

<search_pattern> ==>> <replacement_pattern>

Placeholders capture matched code:

  • $name — matches any expression/type/pattern in that position
  • ${name:constraint} — matches with constraints

Common Patterns

Swap function arguments
foo($a, $b) ==>> foo($b, $a)
Convert struct literal to constructor
Foo { a: $a, b: $b } ==>> Foo::new($a, $b)
UFCS to method call
Foo::method($receiver, $arg) ==>> $receiver.method($arg)
Method to UFCS
$receiver.method($arg) ==>> Foo::method($receiver, $arg)
Wrap in Result
Option<$t> ==>> Result<$t, Error>
Unwrap to expect
$e.unwrap() ==>> $e.expect("TODO")
Match only literals
Some(${a:kind(literal)}) ==>> ...
Match non-literals
Some(${a:not(kind(literal))}) ==>> ...

Constraints

ConstraintMatches
kind(literal)Literal values: 42, "foo", true
not(...)Negates inner constraint

How to Invoke

Via Comment Assist (Interactive)

Write a comment containing an SSR rule, then trigger code actions:

rust
// foo($a, $b) ==>> bar($b, $a)

Actions appear: "Apply SSR in file" or "Apply SSR in workspace"

Via LSP Command
json
{
  "command": "rust-analyzer.ssr",
  "arguments": [{
    "query": "foo($a) ==>> bar($a)",
    "parseOnly": false
  }]
}
Via CLI
bash
rust-analyzer ssr 'foo($a, $b) ==>> bar($b, $a)'

Key Behaviors

Path Resolution: Paths match semantically. foo::Bar matches Bar if imported from foo.

Auto-qualification: Replacement paths are qualified appropriately for each insertion site.

Parenthesization: Automatic parens added when needed (e.g., $a + $b becoming ($a + $b).method()).

Comment Preservation: Comments within matched ranges are preserved.

Macro Handling

SSR can match code inside macro expansions, but with an important restriction: all matched tokens must originate from the same source.

Example: Macro Boundary
rust
macro_rules! my_macro {
    ($x:expr) => {
        foo($x, 42)  // "42" comes from macro definition
    };
}

my_macro!(bar);  // "bar" comes from call site

The expanded code is foo(bar, 42). Here:

  • bar originates from the call site (what the user wrote)
  • foo, 42 originate from the macro definition

If you search for foo($a, $b):

  • It would NOT match the expanded foo(bar, 42) because $a would capture bar (call site) but $b would capture 42 (definition site) — these cross the macro boundary.
Show full SKILL.md (180 more words)Show less
Why This Limitation Exists

SSR can only generate edits for code the user actually wrote. If a match spans both user code and macro-generated code, SSR couldn't produce a valid edit — it would need to modify the macro definition, which is a different (and potentially shared) piece of code.

What SSR CAN Do With Macros
  • Match code entirely within macro arguments: my_macro!(foo($a)) can match foo($a)
  • Match the macro call itself: my_macro!($x) works
  • Match expanded code where all tokens come from call-site arguments

Other Limitations

  • Constraints limited to kind(literal) and not()
  • Single-identifier patterns (foo ==>> bar) may be filtered if ambiguous
  • Cannot modify use declarations with braces

More Examples

Convert Option methods
$o.map_or(None, Some) ==>> $o
Change field access
$s.foo ==>> $s.bar
Reorder struct fields
Foo { a: $a, b: $b } ==>> Foo { b: $b, a: $a }
Generic type transformation
Vec<$t> ==>> SmallVec<[$t; 4]>

Source Files

  • Core implementation: crates/ide-ssr/src/ (in the rust-analyzer repo)
  • IDE integration: crates/ide/src/ssr.rs (in the rust-analyzer repo)
  • Tests with examples: crates/ide-ssr/src/tests.rs (in the rust-analyzer repo)

Rocky-specific examples

Cross-crate patterns you might want to run against the Rocky workspace:

# Find every place a SQL identifier is interpolated without validation
format!($fmt, $ident) ==>> /* audit: should go through rocky_sql::validation */

# Migrate an adapter trait method
Adapter::old_method($self, $arg) ==>> $self.new_method($arg)

# Swap the ordering of a tagged payload
RunOutput { tables_copied: $t, materializations: $m, ..$rest } ==>> RunOutput { materializations: $m, tables_copied: $t, ..$rest }

Always dry-run with parseOnly: true or preview in the editor before applying workspace-wide — the multi-crate workspace makes a botched refactor expensive to back out.

© rocky-data, Apache-2.0. 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 engine/.claude/skills/rust-analyzer-ssr of rocky-data/rocky.

Open the folder on GitHubat commit 46be77e

Compare with similar skills

Rust Analyzer Ssr 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.

Rust Analyzer Ssr compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Analyzer Ssr this skillrocky-data/rocky304—~1.4kAutomated safety check: PassApache-2.0
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
RTK Rust Code Simplifierrtk-ai/rtk83k—~1.1kAutomated safety check: PassApache-2.0
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.

    83k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed

More from rocky-data/rocky

All 22 skills in this repo
  • Fivetran

    rocky-data/rocky

    Fivetran REST API reference for Rocky's source adapter. An agent skill from rocky-data/rocky.

    304 GitHub stars~914 tokensUpdated today
    Auto-check passed
  • Databricks

    rocky-data/rocky

    Databricks REST API and SQL reference for Rocky's warehouse adapter.

    304 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Rocky Codegen

    rocky-data/rocky

    Rocky CLI JSON-output schema cascade. An agent skill from rocky-data/rocky.

    304 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Rocky Dev

    rocky-data/rocky

    Top-level router for Rocky development tasks. An agent skill from rocky-data/rocky.

    304 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Rocky Dsl Change

    rocky-data/rocky

    Rocky DSL (.rocky file) cross-subproject cascade. An agent skill from rocky-data/rocky.

    304 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Rocky New Adapter

    rocky-data/rocky

    Adding a new warehouse or source adapter crate to the Rocky engine.

    304 GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Rust Analyzer Ssr

What does Rust Analyzer Ssr do?

Use rust-analyzer's Structural Search and Replace (SSR) for semantic Rust code transformations across the engine workspace. Rust Analyzer Ssr is an agent skill from rocky-data/rocky. Use rust-analyzer's Structural Search and Replace (SSR) for semantic Rust code transformations across the engine workspace.

When should I use Rust Analyzer Ssr?

Rust Analyzer Ssr fits situations like: tasks that involve Refactoring.

How do I install Rust Analyzer Ssr in Claude Code?

Run `npx skills add rocky-data/rocky --skill rust-analyzer-ssr -a claude-code`. Or copy the skill folder (engine/.claude/skills/rust-analyzer-ssr in rocky-data/rocky) into .claude/skills/rust-analyzer-ssr in your project. Claude Code loads it when a task matches its description.

How do I install Rust Analyzer Ssr in Codex?

Run `npx skills add rocky-data/rocky --skill rust-analyzer-ssr -a codex`. Or copy the skill folder (engine/.claude/skills/rust-analyzer-ssr in rocky-data/rocky) into .agents/skills/rust-analyzer-ssr in your project. Codex loads it when a task matches its description.

Can I use Rust Analyzer Ssr 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 rocky-data/rocky --skill rust-analyzer-ssr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-analyzer-ssr, .gemini/skills/rust-analyzer-ssr, .github/skills/rust-analyzer-ssr and .opencode/skills/rust-analyzer-ssr in your project.

What does Rust Analyzer Ssr need to run?

SKILL.md names no scripts, command-line tools or credentials: Rust Analyzer Ssr is instructions for the agent only.

Does Rust Analyzer Ssr access the network?

SKILL.md names 1 domain. As links in the text: gist.github.com. This is read from the text; nothing was executed.

Is Rust Analyzer Ssr 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 Rust Analyzer Ssr use?

Rust Analyzer Ssr is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Analyzer Ssr use?

About 1.4k tokens (SKILL.md is roughly 5.8k 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 Rust Analyzer Ssr?

Skills that share tags, products or a category with Rust Analyzer Ssr: Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Rust Best Practices (farm-fe/farm, 5.6k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars) and RTK Rust Code Simplifier (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Analyzer Ssr?

rocky-data (a GitHub organization) maintains it in rocky-data/rocky, which has 304 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 8, 2026.

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