Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .github/workflows/claude-plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Claude Plugin Check

# Keeps the Claude Code plugin under claude-plugins/spring-tools consistent with the
# language server: every diagnostic code has an explanation playbook, playbooks are
# well-formed, hooks, skills and agents only reference MCP tools that exist (and every
# tool is reachable through one of them), the plugin manifest validates, and the
# launcher/language server (including its file watcher) work end to end over MCP stdio.

on:
push:
branches:
- main
paths:
- 'claude-plugins/**'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/**/*ProblemType.java'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/validation/generations/AbstractDiagnosticValidator.java'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/yaml/reconcile/ApplicationYamlASTReconciler.java'
- 'headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/reconcile/YamlSchemaProblems.java'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/mcp/**'
- 'headless-services/spring-boot-language-server-standalone/src/main/java/**'
- '.github/workflows/claude-plugin-check.yml'
pull_request:
paths:
- 'claude-plugins/**'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/**/*ProblemType.java'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/validation/generations/AbstractDiagnosticValidator.java'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/yaml/reconcile/ApplicationYamlASTReconciler.java'
- 'headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/reconcile/YamlSchemaProblems.java'
- 'headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/mcp/**'
- 'headless-services/spring-boot-language-server-standalone/src/main/java/**'
- '.github/workflows/claude-plugin-check.yml'
workflow_dispatch:
inputs:
run-evals:
description: 'Also run the behavioral eval suite (claude plugin eval; needs the ANTHROPIC_API_KEY secret and costs model calls)'
type: boolean
default: false

permissions:
contents: read

concurrency:
group: claude-plugin-check-${{ github.ref }}
cancel-in-progress: true

jobs:
explanations-and-config:
name: Explanation playbooks and plugin configuration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # 7.0.0
with:
node-version: 22
- name: Check explanation playbooks (coverage, structure, cross-references, coverage table)
run: node claude-plugins/tools/check-explanations.mjs --require-all --todo
- name: Check plugin configuration (hooks, skills, agents against the MCP tool inventory)
run: node claude-plugins/tools/check-plugin-config.mjs
- name: Run plugin tooling tests
run: node --test --test-reporter=spec 'claude-plugins/tools/test/*.test.mjs'

documentation-links:
name: Documentation links resolve
runs-on: ubuntu-latest
# Only on the main branch: external link checks depend on docs.spring.io availability.
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # 7.0.0
with:
node-version: 22
- name: Check that every documentation link in the playbooks returns HTTP 200
run: node claude-plugins/tools/check-explanations.mjs --require-all --links

plugin-manifest:
name: Plugin manifest validates with the Claude Code CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # 7.0.0
with:
node-version: 22
- name: Install the Claude Code CLI into a temporary prefix
run: npm install --no-audit --no-fund --prefix "$RUNNER_TEMP/claude-code" @anthropic-ai/claude-code@latest
- name: Validate the plugin manifest (no login required)
run: |
"$RUNNER_TEMP/claude-code/node_modules/.bin/claude" --version
"$RUNNER_TEMP/claude-code/node_modules/.bin/claude" plugin validate ./claude-plugins/spring-tools --strict

mcp-smoke:
name: End-to-end MCP smoke test against a freshly built language server
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # 7.0.0
with:
node-version: 22
- uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # 5.6.0
with:
java-version: '25'
distribution: 'temurin'
cache: maven
cache-dependency-path: 'headless-services/**/pom.xml'
- name: Build the standalone language server and copy the JAR into the plugin
run: ./claude-plugins/update-local-jars.sh
- name: Start launcher.js over MCP stdio, index a sample project and exercise the tools the hooks and skills rely on
run: node claude-plugins/tools/smoke/mcp-smoke.mjs --keep
- name: Upload the language server log on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
with:
name: boot-ls-log
path: /tmp/spring-tools-smoke-*/data/boot-ls.log
if-no-files-found: ignore

plugin-evals:
name: Behavioral evals (claude plugin eval, on demand)
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && inputs.run-evals
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # 7.0.0
with:
node-version: 22
- name: Install the Claude Code CLI into a temporary prefix
run: npm install --no-audit --no-fund --prefix "$RUNNER_TEMP/claude-code" @anthropic-ai/claude-code@latest
- name: Run the eval suite against the recorded MCP mocks (the language server is not started)
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CLAUDE_CLI: ${{ runner.temp }}/claude-code/node_modules/.bin/claude
run: |
if [ -z "$ANTHROPIC_API_KEY" ]; then
echo '::error::the ANTHROPIC_API_KEY secret is not set; the eval suite needs model access'
exit 1
fi
node claude-plugins/tools/evals/run-claude-evals.mjs \
--trust-plugin \
--json "$RUNNER_TEMP/eval-results.json" \
--threshold 0.8 \
--judge-model claude-haiku-4-5 \
--no-publish \
--max-cost-usd 15
- name: Upload the eval results and report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
with:
name: plugin-eval-results
path: |
${{ runner.temp }}/eval-results.json
claude-plugins/tools/evals/results/report.html
if-no-files-found: ignore
7 changes: 4 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ sts4/
│ └── boot-dev-pack/ # Extension pack bundling Spring Boot extensions
├── nodejs-packages/ # Shared Node.js utilities
└── claude-plugins/ # Claude Code plugin (standalone LS + MCP server)
├── spring-tools/ # Plugin source (skills, hooks, explanations/<CODE>.md playbooks)
├── tools/ # Node.js checker + tests keeping the playbooks in sync with the LS
├── spring-tools/ # Plugin source (skills, agents, hooks, explanations/<CODE>.md playbooks)
├── tools/ # Node.js checkers, tests and behavioral evals
├── research-notes/ # TODO_quickfixes.md: problem code → quick fix → playbook coverage table
└── update-local-jars.sh # Rebuilds the standalone LS JAR for the plugin
```
Expand Down Expand Up @@ -94,10 +94,11 @@ cd claude-plugins
./update-local-jars.sh # Rebuild and copy the standalone LS JAR into the plugin
```

Every diagnostic code needs a playbook `claude-plugins/spring-tools/explanations/<CODE>.md` and a row in `claude-plugins/research-notes/TODO_quickfixes.md`. When adding or renaming a problem type, run from the repository root (details in `claude-plugins/spring-tools/README.md`):
Every diagnostic code needs a playbook `claude-plugins/spring-tools/explanations/<CODE>.md` and a row in `claude-plugins/research-notes/TODO_quickfixes.md`. Every MCP tool (`boot/mcp/*Tools.java`) must be reachable through a skill or hook and have a behavioral eval with a mock. When adding or renaming a problem type or an MCP tool, run from the repository root (details in `claude-plugins/spring-tools/README.md`):

```bash
node claude-plugins/tools/check-explanations.mjs --require-all --todo --links
node claude-plugins/tools/check-plugin-config.mjs
npm --prefix claude-plugins/tools test
```

Expand Down
4 changes: 4 additions & 0 deletions claude-plugins/research-notes/TODO_quickfixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ Raised on `application*.properties` / `bootstrap*.properties` files by `SpringPr
| Problem Type Code | Description | Quick Fix Implementation | Playbook |
| :--- | :--- | :--- | :---: |
| `PROP_SYNTAX_ERROR` | Line cannot be parsed as a `key=value` / `key: value` assignment | *None* | ✅ |
| `PROP_PLACEHOLDER_SYNTAX` | Malformed property placeholder in a value | *None* | ✅ |
| `PROP_UNRESOLVED_PLACEHOLDER` | Placeholder without a default is not found in the project's configuration | *None* | ✅ |
| `PROP_UNKNOWN_PROPERTY` | Key matches no property in the configuration metadata | Create metadata for `<key>` (`CommonQuickfixes.MISSING_PROPERTY`, id `MISSING_PROPERTY_APP`) | ✅ |
| `PROP_DEPRECATED` | Property is deprecated in the configuration metadata (any level) | Replace with `<replacement>` (`AppPropertiesQuickFixes.DEPRECATED_PROPERTY`) | ✅ |
| `PROP_DUPLICATE_KEY` | Same key assigned more than once in one document | *None* | ✅ |
Expand All @@ -125,6 +127,8 @@ Raised on `application*.yml`/`.yaml` and `bootstrap*.yml`/`.yaml` files by `Appl
| Problem Type Code | Description | Quick Fix Implementation | Playbook |
| :--- | :--- | :--- | :---: |
| `YAML_SYNTAX_ERROR` | SnakeYAML parse error | *None* | ✅ |
| `YAML_PLACEHOLDER_SYNTAX` | Malformed property placeholder in a value | *None* | ✅ |
| `YAML_UNRESOLVED_PLACEHOLDER` | Placeholder without a default is not found in the project's configuration | *None* | ✅ |
| `YAML_UNKNOWN_PROPERTY` | Key path matches no property in the configuration metadata | Create metadata for `<key>` (`CommonQuickfixes.MISSING_PROPERTY`, id `MISSING_PROPERTY_APP`) | ✅ |
| `YAML_DEPRECATED_WARNING` | Property deprecated at `warning` level | Replace with `<replacement>` (`AppYamlQuickfixes.DEPRECATED_PROPERTY`, id `DEPRECATED_YAML_PROPERTY`) | ✅ |
| `YAML_DEPRECATED_ERROR` | Property deprecated at `error` level (no longer bound) | Replace with `<replacement>` (`AppYamlQuickfixes.DEPRECATED_PROPERTY`, id `DEPRECATED_YAML_PROPERTY`) | ✅ |
Expand Down
1 change: 0 additions & 1 deletion claude-plugins/spring-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
language-server/
node_modules/
boot-ls.log
evals/results/
11 changes: 6 additions & 5 deletions claude-plugins/spring-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,16 @@ When a new MCP tool is added to the language server, give it a home: mention it

### Behavioral evals

`evals/` holds a [`claude plugin eval`](https://code.claude.com/docs/en/plugin-evals) suite: one case per skill and for the `spring-reviewer` agent, plus a negative control (an unrelated question must not trigger any skill). Each case is a prompt phrased the way a user would type it, with graders for the result (a regex or a judged rubric) and for the path (`tool_used` on the skill and on the MCP tool it should call). The language server is not started during a run: `evals/mocks/spring-tools-mcp/` answers every MCP tool from recordings taken against the real server on the `sf7-validation` test project (`_tools.json` carries the real tool descriptions and schemas), and the `validate` and reviewer cases override `getProjectDiagnostics` with a recording that contains a `JAVA_AUTOWIRED_CONSTRUCTOR` finding.
`claude-plugins/tools/evals/` holds a [`claude plugin eval`](https://code.claude.com/docs/en/plugin-evals) suite outside the published plugin: one case per skill and for the `spring-reviewer` agent, plus a negative control (an unrelated question must not trigger any skill). Each case is a prompt phrased the way a user would type it, with graders for the result (a regex or a judged rubric) and for the path (`tool_used` on the skill and on the MCP tool it should call). The language server is not started during a run: `mocks/spring-tools-mcp/` answers every MCP tool from recordings taken against the real server on the `sf7-validation` test project (`_tools.json` carries the real tool descriptions and schemas), and the `validate` and reviewer cases override `getProjectDiagnostics` with a recording that contains a `JAVA_AUTOWIRED_CONSTRUCTOR` finding.

Run the following from the repository root. The runner stages the plugin and evals together in a temporary directory because Claude requires evals inside the plugin root; results are saved under `claude-plugins/tools/evals/results/`.

```bash
# runs every case three times with the plugin and three times without it, judged with your Claude Code credentials
cd claude-plugins/spring-tools && claude plugin eval . --no-publish
node claude-plugins/tools/evals/run-claude-evals.mjs --no-publish

# one case, one arm, one run - cheap while iterating on a skill description
claude plugin eval . --case validate-finds-spring-problems --runs 1 --ablation none
node claude-plugins/tools/evals/run-claude-evals.mjs --case validate-finds-spring-problems --runs 1 --ablation none --no-publish

# re-record the mocks after the language server's tools or the fixture project changed (needs the JAR + Java 21+)
node claude-plugins/tools/evals/record-mocks.mjs
Expand Down Expand Up @@ -372,13 +374,12 @@ spring-tools/
│ └── spring-review/ # Canonical review procedure for Codex and other skill hosts
├── opencode/ # OpenCode MCP config fragment and reviewer agent adapter
├── explanations/ # One Markdown playbook per diagnostic code (explanation + fixes)
├── evals/ # Behavioral eval suite: one case per skill/agent + recorded MCP mocks (results/ is gitignored)
└── README.md
```

The manifests describe one plugin for different hosts. `install.js` stores the checksum-verified JAR in the persistent data directory, isolated under the plugin version; it does not write into the installed plugin tree. `check-plugin-config.mjs` fails if shared metadata drifts, if a reviewer adapter differs from `skills/spring-review/SKILL.md`, or if `mcp.json` stops launching `launcher.js`. Run `node claude-plugins/tools/sync-agent-adapters.mjs --write` after changing the shared review procedure to refresh Claude, Copilot and OpenCode adapters. Hooks cannot be one shared file: Claude supports MCP-tool hooks, Copilot supports command hooks, and Codex/OpenCode rely on the language-server watcher. Codex and Copilot consume the portable root `plugin.json`, `mcp.json`, and `skills/`, so those capabilities are defined once.

The sibling directory `claude-plugins/tools/` (not part of the published plugin) holds `check-explanations.mjs`, `check-plugin-config.mjs`, `lib/plugin-config.mjs`, the `test/` suite, the `smoke/mcp-smoke.mjs` end-to-end test, the `evals/record-mocks.mjs` recorder and the `evals/run-with-copilot.mjs` runner described above.
The sibling directory `claude-plugins/tools/` (not part of the published plugin) holds `check-explanations.mjs`, `check-plugin-config.mjs`, `lib/plugin-config.mjs`, the `test/` suite, the `smoke/mcp-smoke.mjs` end-to-end test, and the `evals/` suite, recorder and runner.

## How it works

Expand Down
28 changes: 28 additions & 0 deletions claude-plugins/spring-tools/agents/spring-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: spring-reviewer
description: Reviews Spring Boot code changes with the Spring Tools language server - diagnostics, bean wiring, endpoints and logical structure. Use after editing a Spring Boot project or when asked for a Spring-aware review; read-only, never edits files.
tools: Read, Grep, Glob, mcp__plugin_spring-tools_spring-tools-mcp__*
model: inherit
---
You are a Spring Boot reviewer. You review the current state of the Spring Boot projects in the workspace with the `spring-tools` MCP server and report findings; you never modify files.

Work through these steps and keep tool output out of the report - summarize.

Steps 3-6 complement diagnostics with structural and support information that diagnostics may not report. Confirm suspected problems against the project before reporting them.

1. `getProjectList` - note every project (`projectName`, `location`, `isSpringBootProject`, `javaVersion`). Retry a few times if the list is empty right after startup. Skip projects that are not Spring Boot projects unless the user asked about them.
2. `getProjectDiagnostics` per project. For each Spring diagnostic code read the fix playbook for that code - the `<CODE>.md` files in the plugin's `explanations` directory, at `${CLAUDE_PLUGIN_ROOT}/explanations/<CODE>.md` in Claude Code and at the absolute path named in the spring-tools MCP server instructions otherwise - and describe the fix precisely (file, range, what to change) instead of pasting the playbook.
3. Bean wiring: `getBeanDetails` for an overview, then `findBeansByType` for every interface with several implementations (missing `@Primary`/`@Qualifier`) and `getBeanUsageInfo` for beans that are defined but never injected (dead configuration) or injected but not defined.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't 3-6 covered by 2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! There is overlap, but diagnostics do not provide all of the bean, endpoint, structure, and support information used in steps 3–6. I clarified that these steps complement diagnostics and that suspected findings need confirmation.

4. Endpoints: `getRequestMappings` - flag duplicate paths, handler methods without an HTTP method, controllers that mix API versions inconsistently, and endpoints without a matching stereotype (`@RestController`/`@Controller`).
5. Structure: `getLogicalStructureChanges` (a git-backed project has a baseline automatically) to see what the change under review added, removed or moved; `findComponentsByStereotype` to check layering rules the project follows (e.g. controllers calling repositories directly).
6. Versions: `getSpringBootVersion` plus `getLatestReleaseInformation` with slug `spring-boot` - mention when the project runs on a generation whose OSS support has ended.

Report format:

These categories reflect review impact, not diagnostic severity. Preserve each diagnostic's reported severity (`error`, `warning`, `info`, `hint`, or `unspecified`) alongside the finding.

- **Blocking**: problems that break the application context, the build or security (each with file:line and the fix).

@BoykoAlex BoykoAlex Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those the severity ERROR, WARNING, INFO, HINT coming from the diagnsotics?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diagnostic tool reports error, warning, info, hint, or unspecified. The report headings are separate review-impact categories, not a severity mapping. I clarified that and asked the reviewer to retain the reported severity alongside each diagnostic.

- **Should fix**: other Spring diagnostics with a playbook, wiring ambiguities, structural regressions.
- **Notes**: version/support status, observations, things you could not verify (e.g. the language server was still indexing).

Use file:line references from the tool output. Read source files only to confirm a finding. When the language server reports nothing for a project, say so explicitly rather than inventing findings.
Loading
Loading