Helps developers create and manage Structural Search and Replace (SSR) patterns within IntelliJ IDEA.
Install
mkdir -p .claude/skills/ssr && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11849" && unzip -o skill.zip -d .claude/skills/ssr && rm skill.zipInstalls to .claude/skills/ssr
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.Key capabilities
- →Create Structural Search and Replace inspections.
- →Define Structural Search inspections.
- →Configure the scope of inspections.
- →Modify inspection profiles in XML.
- →Locate inspection configurations within the project.
How it works
The skill guides the creation and modification of Structural Search and Replace inspections in IntelliJ IDEA by providing XML examples and instructions for configuring search patterns, replacement templates, and inspection scopes within the project's inspection profiles.
Inputs & outputs
When to use ssr
- →Create a new code inspection
- →Define a custom structural search pattern
- →Update project-wide code style rules
About this skill
Structural Search and Replace
-
You must use terminal search (
ls,catandgrep) to read directory.idea. Do not use IDE search. -
The contents of structural search inspections is located in
.idea/inspectionProfiles/idea_default.xml -
Here is an example of a Structural Search and Replace inspection:
<replaceConfiguration name="Use Strings.areSameInstance instead of =="
description="Comparing Strings by references usually indicate a mistake, if you really need to do this (for performance reeasons or to implement "Sentinel" pattern), use Strings.areSameInstance method to make the intention explicit and get rid of warning."
suppressId="StringEqualitySSR"
problemDescriptor="Use !Strings.areSameInstance instead of '!=' if you really need to compare strings by reference"
text="$s1$ == $s2$" recursive="false" caseInsensitive="false" type="JAVA" pattern_context="default"
search_injected="false" reformatAccordingToStyle="false" shortenFQN="true"
replacement="com.intellij.openapi.util.text.Strings.areSameInstance($s1$, $s2$)">
<constraint name="__context__" within="" contains=""/>
<constraint name="s1" nameOfExprType="java\.lang\.String" within="" contains=""/>
<constraint name="s2" nameOfExprType="java\.lang\.String" within="" contains=""/>
</replaceConfiguration>
This node should be located under <inspection_tool class="SSBasedInspection" tag.
- Here is an example of a Structural Search inspection:
<searchConfiguration name="Raw coroutine scope creation" uuid="e11e9d2f-7cc2-3359-a78a-24f67cbe0850"
description="Coroutine scope should be created: <ul> <li>by a coroutine builder (<code>launch</code>, <code>async</code>, <code>runBlockingCancellable</code>);</li> <li>by a scoping function (<code>withContext</code>, <code>coroutineScope</code>, <code>supervisorScope</code>);</li> <li>by injecting it into a service constructor;</li> <li>by explicitly creating a child scope (<code>childScope</code>, <code>namedChildScope</code>)</li> </ul> "
suppressId="RAW_SCOPE_CREATION"
problemDescriptor="Raw scope might not be linked to any parent unintentionally (if passed context does not have any <code>Job</code>, or if passed <code>Job</code> does not have any parent). Use <code>namedChildScope()</code> on some existing scope instead. If no parent is actually intended, use <code>GlobalScope.namedScope()</code>."
text="CoroutineScope($args$)" recursive="true" caseInsensitive="true" type="Kotlin" pattern_context="default"
search_injected="false">
<constraint name="__context__" within="" contains=""/>
<constraint name="args" within="" contains=""/>
</searchConfiguration>
This node should be located under <inspection_tool class="SSBasedInspection" tag.
- To configure the scope of inspection, you need to make changes similar to this pattern, where class is UUID of the created replace configuration.
<inspection_tool class="e5d3c6f8-12ab-4cc9-8e51-8a8f1bd1c3e2" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="IDE Testing Framework" level="WARNING" enabled="true"/>
<scope name="Tests" level="WARNING" enabled="true"/>
<scope name="test-framework" level="WARNING" enabled="true"/>
</inspection_tool>
- You must run
InspectionProfileConsistencyTestafter changing xml files
When not to use it
- →When not working with IntelliJ IDEA's Structural Search and Replace feature.
- →When modifying files outside of the `.idea` directory.
- →When not using Java or Kotlin for the search patterns.
Limitations
- →Inspections are configured in `.idea/inspectionProfiles/idea_default.xml`.
- →Requires running `InspectionProfileConsistencyTest` after changing XML files.
- →Search patterns are defined for Java or Kotlin.
How it compares
This skill provides specific guidance and XML examples for IntelliJ's SSR feature, enabling the creation of custom code inspections and refactoring patterns directly within the IDE's configuration files, which is more targeted than manual c
Compared to similar skills
ssr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| ssr (this skill) | 0 | 2mo | No flags | Advanced |
| clarity-over-cleverness | 0 | 3mo | No flags | Intermediate |
| breach-encapsulation-naming | 0 | 5mo | No flags | Beginner |
| unit-testing | 3 | 3mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by JetBrains
View all by JetBrains →You might also like
clarity-over-cleverness
loiane
Apply clarity-over-cleverness rewrites — prefer code a junior engineer can read at a glance over compact-but-clever code. Use during `/build`'s simplify step and during `/code-simplify` (alias "simplify the code"). Never weakens behavior; suite must remain green.
breach-encapsulation-naming
j5ik2o
>-
unit-testing
TencentBlueKing
单元测试编写指南,涵盖 JUnit5/MockK 使用、测试命名规范、Mock 技巧、测试覆盖率要求、TDD 实践。当用户编写单元测试、Mock 依赖、提高测试覆盖率或进行测试驱动开发时使用。
review-pr
apache
Used to review whether an Apache ShardingSphere PR truly fixes the root cause, assess side effects and regression risks, and determine whether it can be safely merged. If not mergeable, produce committer-tone change request suggestions. Supports targeted comparison across multiple review rounds.
springboot-verification
affaan-m
Verification loop for Spring Boot projects: build, static analysis, tests with coverage, security scans, and diff review before release or PR.
jakarta-namespace
benchflow-ai
Migrate Java EE javax.* imports to Jakarta EE jakarta.* namespace. Use when upgrading to Spring Boot 3.x, migrating javax.persistence, javax.validation, javax.servlet imports, or fixing compilation errors after Jakarta EE transition. Covers package mappings, batch sed commands, and verification steps.