Dr JSkill AI Agent Skill

repository·main·Indexed 43 days ago

https://github.com/jdubois/dr-jskill

An AI Agent Skill designed to automate the creation of production-ready Spring Boot 4.x applications. It provides instructions for AI coding assistants like GitHub Copilot CLI and Claude Code to scaffold projects using Java 25, PostgreSQL, and Docker, with frontend options including Vue.js, React, Angular, or Vanilla JS. The skill includes scripts for generating basic, web, and full-stack projects, and integrates with BootUI and Coffilot.

Tokens
113.9K
Snippets
296
Records
391
Agent score
54%

What's inside Dr JSkill

  1. Overview of Dr JSkill

    main

    Dr JSkill is an Agent Skill consisting of Markdown instructions designed to teach AI coding agents (such as GitHub Copilot CLI or Claude Code) how to scaffold Spring Boot applications following Julien Dubois' best practices.

    Key features of generated projects include:

    • Backend: Spring Boot 4 + Java 25 with PostgreSQL (using Hibernate ddl-auto).
    • Frontend: Choice of Vue.js (default), React, Angular, or Vanilla JS, served directly from the Spring Boot application.
    • Build & Deployment: Maven-only (no Lombok), Docker support for local development (auto-starting Postgres), and GraalVM native image readiness.
    • Production Defaults: Includes configuration, logging, security, monitoring, and testing recipes.
    • Consistency: All tool and library versions are managed via a centralized versions.json file.
  2. Overview of Dr JSkill capabilities

    main

    Dr JSkill is an AI Agent Skill designed to generate Spring Boot 4.x applications following specific best practices. It is intended for use with AI coding assistants like GitHub Copilot CLI or Claude Code.

    Key Features:

    • Automated Generation: Uses https://start.spring.io to generate projects with the latest Spring Boot versions.
    • Tech Stack: Supports Java 25, PostgreSQL, and Docker (including standard and native image builds).
    • Front-end Options: Supports Vue.js (default), React, Angular, or Vanilla JS.
    • Production Ready: Includes REST APIs, monitoring, and production-grade configurations.
  3. Overview of the Dr JSkill Workshop

    main

    The Dr JSkill workshop is a hands-on guide for building a complete Spring Boot application by interacting with an AI coding agent (specifically GitHub Copilot CLI). Instead of writing code manually, you use the Dr JSkill Agent Skill to drive the agent to generate production-ready code following best practices.

    Project Outcome: You will build a Todo List web application featuring:

    • A REST API (Spring Boot 4, Hibernate, PostgreSQL)
    • A Vue.js frontend
    • Docker-based local development (Postgres in a container)
    • A 'switch user' feature
    • Tests, performance tuning, and a deployable Docker image.
  4. Understand the generated application structure

    main

    A project generated by Dr JSkill follows a layered architecture with a Spring Boot backend and a Vite + Vue frontend. The key directories are:

    • pom.xml: Maven build file containing dependencies, plugins, and profiles.
    • src/main/java/: The Spring Boot backend source code.
    • src/main/resources/: Application configuration files.
    • compose.yaml: Docker Compose configuration for local development (e.g., PostgreSQL).
    • frontend/: The Vue.js application source code.
    # Open the project in VS Code
    code ~/workshop
  5. Workshop Overview: Building a Spring Boot App with Dr JSkill

    main

    This workshop guides you through building a complete Todo List web application by interacting with an AI coding agent using the Dr JSkill Agent Skill. Dr JSkill teaches GitHub Copilot CLI how to generate Spring Boot projects following specific best practices.

    The application includes:

    • A REST API (Spring Boot 4 + Hibernate + PostgreSQL)
    • A Vue.js front-end
    • Docker configuration for local development (Postgres in a container)
    • A simple "switch user" feature
    • Tests, performance tuning, and a deployable Docker image

    Key Learning Goals:

    • Driving an AI coding agent to produce production-ready Spring Boot apps.
    • Understanding and extending the code generated by the agent.
    • Mastering the rhythm of working with AI agents in a terminal environment.
  6. Spring Boot 4 Testing Overview and Changes

    main

    This guide outlines testing best practices for Spring Boot 4.x applications. Key changes in version 4 include:

    • TestContainers 2.0+ Required: Integration is simplified using the @ServiceConnection annotation.
    • Mocking Changes: @MockBean and @SpyBean are DEPRECATED. Use @MockitoBean and @MockitoSpyBean from the Spring Framework instead.
    • Simplified Configuration: @ServiceConnection removes the need for manual @DynamicPropertySource setup.
    • Modular Starters: New test starters like spring-boot-starter-webmvc-test and spring-boot-starter-data-jpa-test are used for specific testing scopes.
    • Package Changes: @WebMvcTest and @AutoConfigureMockMvc have moved to the org.springframework.boot.webmvc.test.autoconfigure package.
  7. The BootUI family tool overview

    main

    The BootUI family consists of three tools sharing a common Spring Boot development philosophy and a shared design language (the 'circle of color'):

    ToolColorWhat it does
    Dr JSkill🟤 TerracottaAn Agent Skill that generates Spring Boot applications from a prompt.
    BootUI🟢 GreenA starter that adds a local-only, in-app developer console to a running app.
    Coffilot🔵 BlueA Copilot side-panel that builds, runs, tests, and debugs the app.
  8. Understand the generated Spring Boot application structure

    main

    A project generated by Dr JSkill follows a layered architecture. The core components are located in the following directories:

    • pom.xml: The Maven build file containing dependencies, plugins, and profiles.
    • src/main/java/: The Spring Boot backend source code.
    • src/main/resources/: Application configuration files (e.g., application.properties).
    • compose.yaml: Docker Compose configuration for local development (e.g., PostgreSQL).
    • frontend/: The Vue.js application source code.

    Note: If you selected TypeScript during generation, all .js files in the frontend/ directory will be .ts files.

    # Open the project in VS Code
    code ~/workshop
  9. What is an Agent Skill?

    main

    An Agent Skill is a portable bundle of instructions (Markdown files, scripts, and references) that provides a specification for an AI coding agent (such as GitHub Copilot CLI, Claude Code, or Cursor).

    Instead of relying on the generic, often inconsistent knowledge of an AI agent, an Agent Skill acts as a "senior engineer's checklist," teaching the agent how to perform specific tasks according to defined conventions, quality standards, and best practices. This ensures that different agents and different prompts produce consistent, high-quality results.

  10. Overview of Spring Boot 4 Docker Image Variants

    main

    This project provides four distinct container image variants for Spring Boot 4 applications, each optimized for different startup speeds and resource footprints. All images use multi-stage builds, exploded Spring Boot layers for caching, and run as a non-root user. Most images use a distroless base (gcr.io/distroless/base-debian12:nonroot), meaning they have no shell, package manager, or curl.

    Important Distroless Note: Because there is no shell, you cannot use docker exec to enter the container. You must use orchestrator liveness/readiness probes (e.g., checking /actuator/health) and debug via logs, JFR, or heap dumps. The CRaC image is the only exception as it includes /bin/sh.

    | File | What it is |
    | ---- | ---------- |
    | `Dockerfile` | JVM image — `jlink` custom runtime on a **distroless** base |
    | `Dockerfile-aot` | JVM + **Spring AOT** for faster startup, distroless |
    | `Dockerfile-crac` | **CRaC** (Coordinated Restore at Checkpoint), restores in tens of ms |
    | `Dockerfile-native` | **GraalVM** native image, sub-second startup, smallest compressed image |
  11. Manage environment-specific settings with Configuration Profiles

    main

    Spring Boot profiles allow you to define different configurations for different environments (e.g., dev, test, prod).

    1. Create Profile-Specific Files

    Place files in src/main/resources/ following the pattern application-{profile}.properties:

    • application.properties: Default configuration
    • application-dev.properties: Development overrides
    • application-prod.properties: Production settings

    2. Activate Profiles

    • Command Line: java -jar app.jar --spring.profiles.active=prod or java -jar app.jar --spring.profiles.active=prod,monitoring
    • Environment Variable: export SPRING_PROFILES_ACTIVE=prod
    • Docker: Use -e SPRING_PROFILES_ACTIVE=prod in your docker run command.

    3. Conditional Bean Registration

    Use the @Profile annotation in Java to register beans only when a specific profile is active.

    @Configuration
    public class CacheConfiguration {
    
        @Bean
        @Profile("dev")
        public CacheManager simpleCacheManager() {
            return new ConcurrentMapCacheManager();
        }
    
        @Bean
        @Profile("prod")
        public CacheManager redisCacheManager(RedisConnectionFactory factory) {
            return RedisCacheManager.builder(factory).build();
        }
    }
  12. Use JDTLS for semantic Java code intelligence

    main

    Generated projects are designed to work with the Eclipse JDT Language Server (JDTLS). AI agents should prefer the lsp tool over text-based tools like grep or sed to perform semantic operations like navigating definitions, refactoring, or checking types.

    Recommended Task Mapping:

    TaskLSP Command
    Find definitionlsp goToDefinition
    Find callers/referenceslsp findReferences or incomingCalls
    Inspect types/parameters/Javadoclsp hover
    List symbols in filelsp documentSymbol
    Search project-widelsp workspaceSymbol
    Safe renaminglsp rename
    Check compile errorside-get_diagnostics

    Preference Order: lsp $\rightarrow$ grep (with .java glob) $\rightarrow$ view.