Agent skill

Debug Surefire

by eclipse-rdf4j in eclipse-rdf4j/rdf4j

Debug Maven Surefire unit tests by running them in JDWP "wait for debugger" mode (-Dmaven.surefire.debug) and attaching to the forked test JVM using jdb (preferred for CLI/agent debugging)…

BSD-3-ClauseAuto-check passedTesting & QA

Install Debug Surefire

skills CLI
$ npx skills add eclipse-rdf4j/rdf4j --skill debug-surefire -a claude-code

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

GitHub CLI
$ gh skill install eclipse-rdf4j/rdf4j debug-surefire --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/eclipse-rdf4j/rdf4j.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agent/skills/debug-surefire .claude/skills/debug-surefire && 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
debug-surefire
GitHub stars
420
Token cost
~2.4k tokens
SKILL.md length
1,095 words
Files
2 (incl. scripts)
Skills in repo
6
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Debug Maven Surefire unit tests by running them in JDWP "wait for debugger" mode (-Dmaven.surefire.debug) and attaching to the forked test JVM using jdb (preferred for CLI/agent debugging)…

  • Works in 7 steps: Add exclusions immediately (so stepping… → Break where it matters → Break on the failure, not just your guess → …
  • Asked to debug/step through a failing JUnit test
  • SKILL.md covers What this does, Quick start, Notes and jdb interaction guide, plus 2 more sections
  • Runs Shell scripts from its folder; calls mvn

What it does

Debug Surefire is an agent skill from eclipse-rdf4j/rdf4j. Debug Maven Surefire unit tests by running them in JDWP "wait for debugger" mode (-Dmaven.surefire.debug) and attaching to the forked test JVM using jdb (preferred for CLI/agent debugging), IntelliJ, or VS Code. Use when asked to debug/step through a failing JUnit test, attach a debugger to a Maven test run, or run mvn test -Dtest=Class[method] suspended on a port (including multi-module -pl runs). The JVM will block at startup until a debugger attaches; the agent should attach with jdb -attach <host:<port and…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/debug-surefire.sh`).

It sits in Testing & QA, covering Unit testing and Debugging. It works with JUnit, JetBrains IDEs, Visual Studio Code and Java. The repository describes itself as: Eclipse RDF4J: scalable RDF for Java. The licence is BSD-3-Clause.

When your agent uses it

  • Asked to debug/step through a failing JUnit test
  • Attach a debugger to a Maven test run
  • Run mvn test -Dtest=Class[method] suspended on a port (including multi-module -pl runs)

Example prompts

  • “wait for debugger”
  • “/debug-surefire”

Requirements

  • A Bash shell

Workflow steps

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

  1. Add exclusions immediately (so stepping doesn’t become a swamp)
  2. Break where it matters
  3. Break on the failure, not just your guess
  4. Resume and drive
  5. Find the “real” test thread quickly
  6. Keep the JVM count predictable
  7. Use “thread-only” breakpoints when concurrency matters

What it can do on your machine

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

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • mvn

    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

Debug Surefire loads about 2.4k tokens when it runs. Until then it costs about 146 tokens; SKILL.md has 1,095 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~146
When it runs · the whole SKILL.md, loaded when a task matches
~2.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); the scripts in this folder are not scanned.

SKILL.md

The full file from eclipse-rdf4j/rdf4j at commit fdbf6e5, republished under its BSD-3-Clause licence (© eclipse-rdf4j). 1,095 words, ~2,395 tokens.

Download SKILL.mdSave it as .claude/skills/debug-surefire/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
debug-surefire
description
Debug Maven Surefire unit tests by running them in JDWP "wait for debugger" mode (`-Dmaven.surefire.debug`) and attaching to the forked test JVM using **jdb** (preferred for CLI/agent debugging), IntelliJ, or VS Code. Use when asked to debug/step through a failing JUnit test, attach a debugger to a Maven test run, or run `mvn test -Dtest=Class[#method]` suspended on a port (including multi-module `-pl` runs). The JVM will block at startup until a debugger attaches; the agent should attach with `jdb -attach <host>:<port>` and drive the session from the terminal.

debug-surefire

Run Maven Surefire tests suspended in JDWP so you can attach a debugger and step through the code.
In headless/agent environments, attach with jdb (the JDK’s command-line debugger).

What this does

  • Runs mvn test with Surefire in debug mode via -Dmaven.surefire.debug.
  • Surefire launches the forked test JVM with a JDWP socket and suspend=y, meaning:
    • the forked JVM starts,
    • prints “Listening for transport dt_socket at address: <port>”,
    • then waits until a debugger attaches,
    • only then does it begin executing tests.

This is important: you do not attach to the mvn process itself; you attach to the forked JVM running the tests.

Quick start

  1. Start a suspended test run
  • Debug a test class:
    • .codex/skills/debug-surefire/scripts/debug-surefire.sh --test-class MyTest
  • Debug a single test method (quote the #):
    • .codex/skills/debug-surefire/scripts/debug-surefire.sh --test 'MyTest#shouldDoThing'
  • Debug a test in a specific module:
    • .codex/skills/debug-surefire/scripts/debug-surefire.sh --module core/sail/shacl --test-class ShaclSailTest
    • .codex/skills/debug-surefire/scripts/debug-surefire.sh --module rdf4j-sail-shacl --test 'ShaclSailTest#testSomething'

When the forked JVM is ready, you should see something like:

  • Listening for transport dt_socket at address: 55005
  1. Attach with jdb (preferred)

In a second terminal, attach to the printed port:

  • Local attach (port only implies localhost):
    • jdb -attach 55005
  • Explicit host+port:
    • jdb -attach localhost:55005

If you need source listing inside jdb, provide a sourcepath up front:

  • jdb -sourcepath module/src/main/java:module/src/test/java -attach 55005
  1. Set breakpoints / catches, then resume

Once you’re at the jdb prompt, set a breakpoint (or exception catch) and continue:

  • stop in com.example.MyTest.shouldDoThing
  • catch uncaught java.lang.AssertionError
  • cont

Tip: right after attaching to a just-started suspended JVM, jdb may show:

  • No frames on the current call stack

That’s normal. The JVM hasn’t executed into any Java frames yet. Set breakpoints first, then cont.


Notes

  • The script runs a fast pre-test install (-Pquick into the repo-local .m2_repo) and then runs mvn test with Surefire in debug mode.
  • Use SUREFIRE_DEBUG_PORT=8000 to change the port (default: 55005).
  • Use --no-offline / --online if offline (-o) resolution fails.
  • Everything after -- is passed to Maven, e.g.:
    • .codex/skills/debug-surefire/scripts/debug-surefire.sh --test-class MyTest -- -DtrimStackTrace=false -DfailIfNoTests=false -DforkCount=1 -DreuseForks=false

jdb interaction guide

This section is optimized for quickly getting signal from a failing unit test without drowning in framework/JDK internals.

Command cheat sheet (the ones you’ll actually use)

Start / resume

  • cont — continue execution from current stop/breakpoint
  • run — start execution when jdb launched the VM (less relevant when you used -attach)

Breakpoints

  • stop in <class>.<method> — break on method entry
  • stop at <class>:<line> — break at a specific line
  • stop — list all breakpoints
  • clear <class>.<method> / clear <class>:<line> — remove a breakpoint
  • clear — list breakpoints (same idea as stop listing)

Stepping

  • next — step over calls (line-level)
  • step — step into calls (line-level)
  • step up — run until current method returns
  • stepi — step one bytecode instruction (rarely needed)

Threads / stacks

  • threads — list threads
  • thread <id> — select default thread
  • where — stack trace for current thread
  • where all — stack traces for all threads
  • up / down — move the current frame up/down the stack

Inspect state

  • locals — print locals in current frame
  • print <expr> — evaluate/print an expression (same as eval)
  • dump <expr> — more complete object dump
  • set <lvalue> = <expr> — mutate a variable/field (use sparingly)

Source

  • list — show source around current line
  • list <line> or list <method> — show a specific region
  • use <path1>:<path2> (aka sourcepath) — set where jdb looks for sources

Exceptions

  • catch uncaught <exception> — break when an uncaught exception occurs
  • catch caught <exception> — break when a caught exception occurs
  • catch all <exception> — break for both caught+uncaught
  • ignore ... — undo a catch

Reduce noise

  • exclude <pattern>,<pattern>,... — don’t report step/method events for matching classes
  • exclude none — clear exclusions

Automation

  • monitor <command> — run a command every time the program stops (e.g., monitor where)
  • read <file> — execute commands from a file
  • !! — repeat last command
  • <n> <command> — repeat command n times (e.g., 10 next)
Efficient workflow for failing JUnit tests
1) Add exclusions immediately (so stepping doesn’t become a swamp)

Right after connecting, set exclusions to avoid stepping into JDK/framework code:

  • exclude java.*,javax.*,jdk.*,sun.*,com.sun.*,org.junit.*,org.junit.jupiter.*,org.assertj.*,org.hamcrest.*,org.mockito.*,org.apache.maven.*

You can always clear this later:

  • exclude none
Show full SKILL.md (460 more words)Show less
2) Break where it matters

Common breakpoint patterns:

  • Break at the failing test method:

    • stop in com.example.MyTest.shouldDoThing
  • Break inside the code under test:

    • stop in com.example.service.FooService.doWork
  • Break at a specific suspicious line:

    • stop at com.example.service.FooService:123

If the method is overloaded, specify argument types:

  • stop in com.example.FooService.doWork(int,java.lang.String)

Note: jdb supports deferred breakpoints. If the class isn’t loaded yet, it will still accept the breakpoint and activate it when the class loads.

3) Break on the failure, not just your guess

For unit tests, breaking on the thrown assertion/error is often faster than guessing a line.

Useful catches:

  • Classic Java assertions / many test failures:

    • catch uncaught java.lang.AssertionError
  • Common in JUnit 5 assertions:

    • catch uncaught org.opentest4j.AssertionFailedError
  • NPE hunting:

    • catch uncaught java.lang.NullPointerException

You can remove a catch with ignore:

  • ignore uncaught java.lang.AssertionError

Tip: catch all java.lang.Throwable is the nuclear option. It works, but it can get loud.

4) Resume and drive

Once breakpoints/catches are set:

  • cont

When you hit a breakpoint:

  • where to see the call stack
  • list to see nearby source
  • locals to see local variables
  • print someVar or print this.someField to inspect
  • next to step over, step to step into
5) Find the “real” test thread quickly

Surefire + JUnit can spin up multiple threads (and Maven itself has its own). When in doubt:

  • threads
  • where all

Then pick the thread that’s in your test/code-under-test:

  • thread <id>
  • where
6) Keep the JVM count predictable

Surefire forking and parallelism can make debugging confusing. If you see multiple JVMs / inconsistent behavior, pass Maven flags to keep it single and fresh:

  • -DforkCount=1 -DreuseForks=false

Example:

  • .codex/skills/debug-surefire/scripts/debug-surefire.sh --test 'MyTest#shouldDoThing' -- -DforkCount=1 -DreuseForks=false
7) Use “thread-only” breakpoints when concurrency matters

By default, jdb breakpoints suspend all threads, which can create deadlocks in concurrent tests. You can tell jdb to suspend only the thread that hits the breakpoint:

  • stop thread in com.example.concurrent.Worker.run

(You can also target a specific thread id with stop thread <thread_id> in ... if needed.)


jdb startup customization (optional but powerful)

jdb will execute startup commands from jdb.ini or .jdbrc in either user.home or user.dir.

This is handy for keeping your default exclusions/catches consistent, e.g.:

  • exclude java.*,javax.*,jdk.*,sun.*,com.sun.*,org.junit.*,org.assertj.*
  • catch uncaught java.lang.AssertionError

You can also keep a project-local command file and load it on demand:

  • read .codex/skills/debug-surefire/jdb.cmds

Troubleshooting

  • jdb can’t connect

    • Confirm the port printed by the suspended JVM matches what you used in jdb -attach.
    • Confirm you’re attaching to the forked JVM port (the one that prints “Listening for transport…”), not Maven’s PID.
    • If running remotely (CI box / container / VM), ensure the port is reachable or forwarded.
  • Breakpoints don’t hit

    • Use fully qualified class names.
    • If overloaded, include argument types.
    • Use classes to see what’s loaded.
    • Try stop at <class>:<line> to avoid signature mismatch.
  • list can’t find source

    • Set sourcepath:
      • use module/src/main/java:module/src/test/java
    • Or launch jdb with -sourcepath ... from the start.

© eclipse-rdf4j, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in .agent/skills/debug-surefire of eclipse-rdf4j/rdf4j.

  • SKILL.md
  • scripts/debug-surefire.sh

Open the folder on GitHubat commit fdbf6e5

Compare with similar skills

Debug Surefire 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.

Debug Surefire compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Debug Surefire this skilleclipse-rdf4j/rdf4j420—~2.4kAutomated safety check: PassBSD-3-Clause
Mps TestsJetBrains/MPS1.7k—~2.9kAutomated safety check: PassApache-2.0
Code Completionfacioquo/stock-indicators-dotnet1.2k—~1.2kAutomated safety check: PassApache-2.0
Debug E2E Pipelinekubernetes-sigs/cloud-provider-azure294—~3.4kAutomated safety check: PassApache-2.0
Minecraft TestingJahrome907/minecraft-agent-skills166—~3.8kAutomated safety check: PassMIT
Eclipse Testgradusnikov/eclipse-chatgpt-plugin171—~1kAutomated safety check: PassMIT

Similar skills

  • Mps Tests

    JetBrains/MPS

    Official

    A skill your agent uses when writing or modifying tests inside MPS @tests models — NodesTestCase (typesystem, constraints, scopes, dataflow, generator output), EditorTestCase (intentions, actions…

    1.7k GitHub stars~2.9k tokensUpdated yesterday
    MobileAuto-check passed
  • Code Completion

    facioquo/stock-indicators-dotnet

    Quality gates for finishing work in this repository — dead-code cleanup, Roslynator and dotnet format fixes, markdownlint, build, unit tests, documentation, and Obsolete migration shims — with the…

    1.2k GitHub stars~1.2k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Debug E2E Pipeline

    kubernetes-sigs/cloud-provider-azure

    Official

    Fetch and analyze Prow e2e pipeline failures for cloud-provider-azure.

    294 GitHub stars~3.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Minecraft Testing

    Jahrome907/minecraft-agent-skills

    Design and implement automated tests for current Minecraft 26.x or legacy 1.21.x mods and plugins using JUnit, MockBukkit, NeoForge Game Tests, or Fabric Game Tests.

    166 GitHub stars~3.8k tokensUpdated 25 days ago
    Testing & QAAuto-check passed
  • Eclipse Test

    gradusnikov/eclipse-chatgpt-plugin

    Run JUnit tests in Eclipse projects — all tests, by package, by class, or individual test methods.

    171 GitHub stars~1k tokensUpdated 10 days ago
    Testing & QAAuto-check passed
  • Unit Testing

    Leavesfly/Jimi

    Java单元测试编写指南(基于JUnit和Mockito)

    237 GitHub stars~667 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed

More from eclipse-rdf4j/rdf4j

  • Docker Jfr Benchmark Loop

    eclipse-rdf4j/rdf4j

    Run a repeatable RDF4J performance loop against one JMH benchmark in Docker with Linux Java 26 and JFR CPU-time profiling.

    420 GitHub stars~945 tokensUpdated yesterday
    Auto-check passed
  • Jmh Benchmark Compare

    eclipse-rdf4j/rdf4j

    Parse JMH result text by finding the first header line that starts with Benchmark and contains Mode and Score, build a structured table for all columns/rows, compare overlapping benchmarks across 2+…

    420 GitHub stars~804 tokensUpdated yesterday
    Auto-check passed
  • Mvnf

    eclipse-rdf4j/rdf4j

    Run Maven tests in this repo with a consistent workflow (module test-artifact cleanup, root -Pquick install to refresh .m2repo, then module verify or a single test class/method).

    420 GitHub stars~971 tokensUpdated yesterday
    Auto-check passed
  • Query Plan Snapshot CLI

    eclipse-rdf4j/rdf4j

    Use QueryPlanSnapshotCli to capture and compare RDF4J query plans, then assess likely performance improvements/regressions from execution verification and semantic plan diffs.

    420 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Gh Read Inspector

    eclipse-rdf4j/rdf4j

    Retrieve GitHub issues, pull requests, and milestones with read-only, whitelisted gh commands only.

    420 GitHub stars~950 tokensUpdated yesterday
    Auto-check passed

Questions about Debug Surefire

What does Debug Surefire do?

Debug Maven Surefire unit tests by running them in JDWP "wait for debugger" mode (-Dmaven.surefire.debug) and attaching to the forked test JVM using jdb (preferred for CLI/agent debugging)…. Debug Surefire is an agent skill from eclipse-rdf4j/rdf4j.debug) and attaching to the forked test JVM using jdb (preferred for CLI/agent debugging), IntelliJ, or VS Code.

When should I use Debug Surefire?

Debug Surefire fits situations like: asked to debug/step through a failing JUnit test; attach a debugger to a Maven test run; run mvn test -Dtest=Class[method] suspended on a port (including multi-module -pl runs).

How do I install Debug Surefire in Claude Code?

Run `npx skills add eclipse-rdf4j/rdf4j --skill debug-surefire -a claude-code`. Or copy the skill folder (.agent/skills/debug-surefire in eclipse-rdf4j/rdf4j) into .claude/skills/debug-surefire in your project. Claude Code loads it when a task matches its description.

How do I install Debug Surefire in Codex?

Run `npx skills add eclipse-rdf4j/rdf4j --skill debug-surefire -a codex`. Or copy the skill folder (.agent/skills/debug-surefire in eclipse-rdf4j/rdf4j) into .agents/skills/debug-surefire in your project. Codex loads it when a task matches its description.

Can I use Debug Surefire 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 eclipse-rdf4j/rdf4j --skill debug-surefire -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debug-surefire, .gemini/skills/debug-surefire, .github/skills/debug-surefire and .opencode/skills/debug-surefire in your project.

What does Debug Surefire need to run?

Going by SKILL.md and its folder, Debug Surefire needs a shell for the scripts in its folder and the command-line tools its instructions call (mvn). Our summary lists: A Bash shell.

Does Debug Surefire 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 Debug Surefire 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Debug Surefire use?

Debug Surefire is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Debug Surefire use?

About 2.4k tokens (SKILL.md is roughly 9.6k 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 Debug Surefire?

Skills that share tags, products or a category with Debug Surefire: Mps Tests (JetBrains/MPS, 1.7k stars), Code Completion (facioquo/stock-indicators-dotnet, 1.2k stars), Debug E2E Pipeline (kubernetes-sigs/cloud-provider-azure, 294 stars) and Minecraft Testing (Jahrome907/minecraft-agent-skills, 166 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Debug Surefire?

eclipse-rdf4j (a GitHub organization) maintains it in eclipse-rdf4j/rdf4j, which has 420 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

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