IntelliJ plugin to navigate between @UseCase-annotated Java test methods and their Markdown specs in
AI Unified Process (AIUP) projects — with a live activity diagram of the
Use Case spec you are editing.
The plugin requires the host project to define a Java annotation type named UseCase. It is looked up by short name, so
any package works. The canonical shape is:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface UseCase {
String id();
String scenario() default "Main Success Scenario";
String[] businessRules() default {};
}When the plugin opens a project that contains Markdown Use Case specs but no UseCase annotation type, it shows a
one-time balloon notification with a Create UseCase.java action: pick a source root and the file is scaffolded for
you.
The AIUP Diagram tool window (right-hand side) shows a live PlantUML activity diagram of the Use Case
spec in the selected editor: the main flow forms the numbered spine, and every Alternative
Flow branches at the step its trigger references (e.g. (Schritt 3) / (step 3)) and rejoins the flow
after its own steps. The diagram updates as you type (debounced) and is rendered entirely in-process with
the MIT-licensed PlantUML build and the Smetana layout engine — no Graphviz installation, no external
rendering service, the spec content never leaves the IDE.
Both English and German spec styles are recognised: ## Main Success Scenario / ## Hauptszenario /
## Hauptablauf for the main flow, and ## Alternative Flows / ## Alternativszenarien /
## Alternativabläufe for the alternative flows. Flow headings may carry a label (### A1: …, branching
at the step the **Trigger:** references) or a step code in the German style (### 3a. Keine Treffer gefunden, branching directly at step 3). Sub-bullets under a numbered step are treated as detail and
kept out of the step's diagram node.
In Java:
@UseCase(id = "UC-XXX")jumps to the matching spec file, landing on the scenario heading and any business rule headings referenced viabusinessRules = {...}.
In Markdown specs:
**Use Case ID:** UC-XXXjumps to all test methods annotated with that ID.# Title(H1) jumps to the test class(es) containing those methods.## Main Success Scenario/## Hauptszenario/## Hauptablaufjumps to test methods with noscenarioattribute (or one of those labels as thescenariovalue).### A1: ...or### 3a. ...(alternative-flow headings coded as<Letter><Digits>or<Step><letter>) jumps to test methods whosescenariostarts with that code.### BR-XXXbusiness rule headings — or- **GR-XXX:** …bullet items in the German style — jump to test methods that reference that rule viabusinessRules = {"BR-XXX"}, scoped to the Use Case declared by the spec file (rule ids are unique only within a UC).
Find Usages is wired in both directions, mirroring the gutter icons:
- On a
@UseCaseannotation or itsidliteral — finds spec leaves (scenario heading + BR headings). - On a string inside
businessRules = {...}— finds the matching### BR-XXXheading in the spec. - On
**Use Case ID:** UC-XXX, the H1 title,## Main Success Scenario,### A1: ..., and### BR-XXXlines — finds the corresponding test methods or test classes.
- Use Case ID has no matching spec — flags
@UseCase(id = "UC-XXX")whose ID has no spec file in the project.
The plugin works with the Markdown conventions from the AIUP PetClinic example:
# View Veterinarians
**Use Case ID:** UC-002
## Main Success Scenario
### A1: No Veterinarians Found
### BR-001: Lazy Loadingand with the German AIUP spec style, which declares the ID in the title and codes alternative flows by step:
# UC-001: Kunde suchen
## Hauptablauf
## Alternativabläufe
### 3a. Keine Treffer gefunden
## Geschäftsregeln
- **GR-001:** Inaktive Kunden werden standardmässig nicht angezeigt.Use Case IDs may be plain UC-XXX or the SUC-XXX / BUC-XXX variants (System / Business Use Case). Spec files are
matched three ways:
- By file name — the ID at the start of the name (
UC-002-view-veterinarians.md,UC-032_Kundeninformationen_bearbeiten.md,SUC-001-*.md,BUC-001-*.md) or after an arbitrary project prefix (petclinic-UC-002-*.md,*-SUC-*.md,*-BUC-*.md). - By body line — a
**Use Case ID:** UC-XXXdeclaration anywhere in the file. - By title — an H1 starting with the ID, e.g.
# UC-001: Kunde suchen(used when no body line exists).
See Setup above for the matching Java annotation shape.
./gradlew buildThe plugin zip will be in build/distributions/.
./gradlew runIdeThis launches a sandbox IntelliJ with the plugin installed. Open your aiup-petclinic project in it.
./gradlew buildPlugin- In IntelliJ:
Settings->Plugins-> gear icon ->Install Plugin from Disk... - Pick the zip file from
build/distributions/.
Targets IntelliJ IDEA 2026.1 and later (build 261+, no upper bound). Adjust sinceBuild / untilBuild and the
platform dependency in build.gradle.kts if you need a different range. Requires the bundled Markdown plugin.
- The spec lookup scans Markdown files in the project. For very large projects you may want to add an index later. For typical AIUP repos the scan is fast enough because the spec folder is small.
- If you rename the annotation, the lookup still works as long as it is called
UseCaseand is an annotation type.
