Agent skill

java-refactoring-extract-method

Refactoring using Extract Methods in Java Language

GitHub68,948★ · +463/wk · 2 repos on radarProfile →
copilotMIT
Install
npx skills add github/awesome-copilot --skill java-refactoring-extract-method --agent copilot

Same command for any agent — swap --agent for claude-code, codex, cursor.

Facts
Files in the skill folder: 1
SKILL.md size: 3 KB
Bundled scripts: none
Path: skills/java-refactoring-extract-method/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 37,432 · +281 this week
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Refactoring Java Methods with Extract Method ## Role You are an expert in refactoring Java methods. Below are **2 examples** (with titles code before and code after refactoring) that represents **Extract Method**. ## Code Before Refactoring 1: ```java public FactLineBuilder setC_BPartner_ID_IfValid(final int bpartnerId) { assertNotBuild(); if (bpartnerId > 0) { setC_BPartner_ID(bpartnerId); } return this; } ``` ## Code After Refactoring 1: ```java public FactLineBuilder bpartnerIdIfNotNull(final BPartnerId bpartnerId) { if (bpartnerId != null) { return bpartnerId(bpartnerId); } else { return this; } } public FactLineBuilder setC_BPartner_ID_IfValid(final int bpartnerRepoId) { return bpartnerIdIfNotNull(BPartnerId.ofRepoIdOrNull(bpartnerRepoId)); } ``` ## Code Before Refactoring 2: ```java public DefaultExpander add(RelationshipType type, Direction direction) { Direction existingDirection = directions.get(type.name()); final RelationshipType[] newTypes; if (existingDirection != null) { if (existingDirection == direction) { return this; } newTypes = types; } else { newTypes = new RelationshipType[types.length + 1]; System.arraycopy(types, 0, newTypes, 0, types.length); newTypes[typ

What's inside
Steps it walks through
  1. Role
  2. Code Before Refactoring 1:
  3. Code After Refactoring 1:
  4. Code Before Refactoring 2:
  5. Code After Refactoring 2:
  6. Task
  7. Code to be Refactored:
More from awesome-copilot
All skills →
About this skill
What does the java-refactoring-extract-method skill do?

Refactoring using Extract Methods in Java Language

How do I install it?

Run `npx skills add github/awesome-copilot --skill java-refactoring-extract-method --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From github/awesome-copilot, a repository with 37,432 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going