<< All versions

Skill v1.0.0

currentAutomated scan100/100
clankerguru/openspec-gradle/srcx-extract
──Details
PublishedNovember 26, 2026 at 06:58 PM
Content Hashsha256:95a88e158390878e...
Git SHA0ff0b9d7efa8
──Files
Files (1 file, 1.0 KB)
SKILL.md1.0 KBactive
SKILL.md · 31 lines · 1.0 KB

name: srcx-extract description: "Extract code into a new function or class. Use when the user says 'extract this' or wants to refactor by pulling out code." metadata: version: "1.0.0"


<!-- openspec-gradle:0.33.0 -->

Extract a block of code into a new function or class.

Steps

  1. Identify the code to extract (file path, start line, end line)
  2. Run: ./gradlew srcx-extract -PsourceFile=path/File.kt -PstartLine=10 -PendLine=25 -PnewName=doSomething
  3. Review .opsx/extract.md — it shows:
  • The extracted code block
  • Detected free variables (potential parameters)
  • Suggested function signature
  • Call site replacement
  1. Adjust the suggestion: fix parameter types, return type, visibility
  2. Apply the refactoring manually based on the suggestion
  3. Run ./gradlew srcx-usages -Psymbol=doSomething to verify

Notes

  • The task suggests but does NOT auto-apply (extraction needs human judgment)
  • Free variable detection is heuristic — review the parameter list
  • Works best with Kotlin; Java support is basic
All versions