GitHub Copilot May 28, 2026

AI code generation in Java

How generative AI has transformed software development

Julien Dubois
Julien Dubois
Java Champion  •  Principal Manager @ Microsoft / GitHub

Who am I?

Julien Dubois
Julien Dubois
☕ Java Champion 🏢 Microsoft / GitHub ⭐ JHipster 🤖 AI × Java
  • Principal Manager, Java Developer Relations @ Microsoft / GitHub
  • Creator of JHipster — Open Source platform with 22,000+ ⭐
  • Contributor to LangChain4j & Spring AI
  • 200+ international talks (Devoxx, SpringOne, Microsoft Build…)
  • Author of "Spring par la pratique" — the first French book on Spring
  • 25+ years of experience in the Java ecosystem
🌐 julien-dubois.com    𝕏 @juliendubois    🐙 github.com/jdubois    💼 linkedin.com/in/juliendubois

The evolution of AI agents

📅
The early days — limited
Outdated training data  •  Code completion only  •  One file at a time
💡
Maturity — multi-file
Project-wide understanding  •  Extended context  •  End-to-end feature generation
🤖
Today — autonomous assistants
Agent mode  •  Plan mode  •  Skills  •  MCP  •  Deep IDE integration

Agent Mode, Plan Mode & Git Worktrees

🤖 Agent Mode

The AI acts autonomously:

  • Reads project files
  • Writes and edits code
  • Runs shell commands
  • Executes tests automatically
  • Fixes errors on its own
💡 GitHub Copilot Agent Mode

📋 Plan Mode

The AI plans before acting:

  • Analyzes the request in depth
  • Generates a detailed action plan
  • Asks for your approval
  • Executes step by step
  • Backtracks if needed
💡 Fewer mistakes thanks to upfront reasoning

🌳 Git Worktrees

Multiple agents in parallel, with no conflicts:

  • One directory per branch
  • One agent per worktree
  • Several tasks at once
  • Full isolation of changes
  • Controlled final merge
💡 git worktree add + 1 agent per folder

Model Context Protocol (MCP)

🔌 An open standard protocol

MCP lets AI agents connect to external tools: databases, APIs, file systems, cloud services — in real time.

🗄️
Databases
PostgreSQL, MySQL, MongoDB…
☁️
Cloud & APIs
GitHub, Azure, AWS, REST…
🔍
Docs & Search
Javadoc, Stack Overflow…
💡 The agent gains access to enriched, real-time context to generate more accurate and more relevant code
🚀 Demo: Using GitHub's MCP server

Demo: Using GitHub's MCP server

copilot — prompt
>
Use the GitHub official MCP server to find:
- In repositories coded in Java, with more than 100 stars
- 10 tickets with the "good first issue" label
- Tickets should have a title, GitHub repository, link

Skills

🎯 What is a Skill?

A skill lets you specialize an AI agent with precise domain instructions, context files and dedicated tools — for a specific domain.
Open standard Agent Skills (agentskills.io) — compatible with Copilot CLI, Claude Code, Windsurf…

📦 dr-jskill

My skill for building Spring Boot 4.x applications with Java 25, PostgreSQL, Docker, and your choice of a Vue / React / Angular front-end.

github.com/jdubois/dr-jskill

💡 Why use skills?

  • Custom coding conventions
  • Architecture defined upfront
  • Reproducible results
  • Shareable across the team
🚀 Demo: Generating a Spring Boot 4 + Java 25 + Vue.js application with dr-jskill

Demo: Spring Boot 4 + Java 25 + Vue.js with dr-jskill

copilot — prompt
>
Create a ticket management application with Dr JSkill.
    
Here are the specifications:

- the application's goal is to find good tickets to help Java Open Source projects
- tickets are GitHub tickets, as discovered with the MCP prompt from the previous demo
- add/edit/remove tickets with a title, GitHub repository, link and status
- store them in a database, and initialize the database with the tickets from the previous command
- it has a fancy UI with Vue.js

IDE Integration

Java IDEs now integrate AI natively.

🟦 VS Code

  • Native GitHub Copilot — built by Microsoft, the deepest integration
  • Agent mode — completion, chat and agent mode
  • Java Extension Pack — JDTLS, debug, tests, Maven/Gradle — used by the agent
  • Choose your model (GPT, Claude, …) within Copilot

🟥 IntelliJ IDEA

  • GitHub Copilot plugin — completion, chat and agent mode
  • ACP plugin (Agent Client Protocol, an open standard launched by Zed) — plug an external agent (GitHub Copilot CLI…) directly into the IDE
  • IntelliJ MCP server — exposes the PSI index, refactorings and inspections to external agents
  • JetBrains Junie — JetBrains' own agent
  • Access IntelliJ's semantic refactorings (rename, extract, change signature…) from the agent

AGENTS.md — the project brief

A single file at the root, read by all agents: the open AGENTS.md standard.

🧭 What it contains

  • Project overview, stack, ports
  • Exact commands: ./mvnw verify, ./mvnw spring-boot:run
  • JDK version, framework, BOM
  • Code conventions, tests, coverage
  • Commit & PR conventions
  • Forbidden actions (prod, secrets, --force…)

🚀 How to create it

  • /init in Copilot CLI — the agent reads your repo and proposes a draft
  • Review and trim: short beats long (context rot)
  • Iterate: every time the agent gets it wrong, fix AGENTS.md — not the prompt
  • Versioned, reviewed in PRs just like code

🗂️ Monorepo & modules

  • AGENTS.md at the root = global rules
  • One AGENTS.md per sub-module for specifics (closest wins)
  • Point to expected skills and MCP servers
  • Link to docs/ rather than duplicating everything
💡 Without an AGENTS.md, the agent rediscovers the project every session — and makes the same mistakes in the same places
🚀 Demo: Generating a copilot-instructions.md with /init

Demo: Generating a copilot-instructions.md with /init

copilot — prompt
> /init
copilot — prompt
> Create a public GitHub repo called jdubois/2026-demo and push the code there

Best practices for Java

Modern agentic CLIs (Copilot CLI, Claude Code…) integrate the LSP protocol. For Java, that means JDTLS (Eclipse JDT Language Server).

☕ JDTLS — Eclipse JDT Language Server

  • The same engine as VS Code Java & Eclipse, exposed via LSP
  • Full semantic analysis: AST, type system, Maven/Gradle classpath
  • Safe refactorings: rename, extract method, change signature — propagated across the whole project
  • Navigation: go-to-definition, find-references, type hierarchy
  • Quick-fix & organize imports, driven by the agent
  • Real-time diagnostics: compilation errors, warnings, nullability

✅ Project hygiene

  • Pin the JDK
  • ./mvnw compile must be fast
  • Keep main green — it's the agent's source of truth
  • Loop: generate → verify → read the errors → fix

🚫 Not recommended inside an agent loop

-DskipTests — tests must run.

Harness > model

An agent = tools in a loop. At equal model quality, it's the harness around the model that makes the difference between an agent that ships and one that hallucinates.

🔁 The loop

  • Observe → decide → act → verify, continuously
  • Plan mode before agent mode on any non-trivial task
  • Sub-agents: isolate contexts, parallelize

🛠️ The tools

  • Skills, MCP servers, LSP, sandbox shell — deterministic capabilities
  • Beyond ~20 loaded tools, the model picks the wrong one

🧠 The context

  • AGENTS.md + skills: brief the agent once and for all
  • Avoid context rot: poisoning, distraction, confusion, clash
  • Context offloading: plan.md, memory, summaries — not everything in the window

✅ The verdict (evals)

  • A machine-verifiable criterion: ./mvnw verify
  • The agent reads the errors (LSP, tests) and fixes them on its own
  • Without a clear verdict, the agent spins — and no model will save it

💡 Practical consequence

The same model, in two different harnesses, produces very different results (see SWE-bench rankings). Investing in the harness — skills, MCP, AGENTS.md, LSP, verification loop — pays off more than chasing the latest model.

GitHub Copilot App

Technical preview — a native desktop app from GitHub: start an agentic session, isolate it, steer it, and merge the final PR.

🧭 Start from GitHub context

  • Kick off from an issue, PR, prompt or a previous session
  • Unified inbox across all connected repos
  • Details, reviews and checks stay attached to the session

⚡ Isolated sessions

  • Each session: its own git worktree, files, conversation
  • Pause / resume, in parallel across multiple repos

✅ Steer, validate, ship

  • Review the plan and the diff, guide iteration
  • Validate via the built-in terminal and browser
  • Open the PR — same reviews, same checks
  • Agent Merge: reviews, checks, automatic merge
🚀 Demo: GitHub Copilot App — 3 sessions, 3 merged PRs, without leaving the app

Demo: 3 parallel sessions with the GitHub Copilot App

session 1 — prompt
> Transform the UI to be enterprise-like.
session 2 — prompt
> Translate the UI to French.
session 3 — prompt
>
I want to assign tickets to users. There are 3 users, stored in a database table: julien, alice, bob. Update the database, the Java code and the front-end code accordingly.

Conclusion

🚀 What has changed

  • From completion to autonomy (agent + plan mode)
  • The importance of the harness: MCP & Skills, LSP, AGENTS.md
  • GitHub Copilot App & Git worktrees = agents in parallel
  • Deep integration in VS Code & IntelliJ

✅ What stays true

  • The developer stays in charge of the code
  • Technical understanding is key
  • JHipster is still relevant! 😄
Julien Dubois
Julien Dubois
github.com/jdubois/dr-jskill
🙏
Thank you!