java/zcl/SKILL.md
Add colored terminal output to Java applications using zcl (Zero-dependency Colour Logger). Use when adding colored console output, terminal logging with colors, ANSI color support, or integrating zcl into a Java project. Triggers on "zcl", "colored output", "colored logging", "terminal colors", "ANSI colors", "console colors", or requests to add color-coded log output to a Java application.
npx skillsauth add adambien/airails zclInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Add colored terminal output to a Java application using $ARGUMENTS. Apply all rules below.
zcl is a zero-dependency, single-enum Java logging utility using ANSI 24-bit true-colour escape sequences from the Solarized Dark accent palette. zcl is designed as a source-reuse project — the Log.java file is copied directly into your source tree, not consumed as a Maven/Gradle dependency or JAR. This keeps the project free of external dependencies.
Log.info(...), Log.error(...), etc.Copy the Log.java enum below into the application's source tree. Adjust the package declaration to match the target package.
import java.io.PrintStream;
public enum Log {
ERROR(Color.RED, System.err),
USER(Color.CYAN, System.out),
INFO(Color.GREEN, System.out),
SYSTEM(Color.BLUE, System.out),
WARNING(Color.YELLOW, System.out),
DEBUG(Color.VIOLET, System.out),
SUCCESS(Color.MAGENTA, System.out);
private PrintStream out;
enum Color {
YELLOW("\033[38;2;181;137;0m"), // Solarized Yellow #b58900
ORANGE("\033[38;2;203;75;22m"), // Solarized Orange #cb4b16
RED("\033[38;2;220;50;47m"), // Solarized Red #dc322f
MAGENTA("\033[38;2;211;54;130m"), // Solarized Magenta #d33682
VIOLET("\033[38;2;108;113;196m"), // Solarized Violet #6c71c4
BLUE("\033[38;2;38;139;210m"), // Solarized Blue #268bd2
CYAN("\033[38;2;42;161;152m"), // Solarized Cyan #2aa198
GREEN("\033[38;2;133;153;0m");
String code;
Color(String code) {
this.code = code;
}
}
private final String value;
private final static String RESET = "\u001B[0m";
private Log(Color color, PrintStream out) {
this.value = (color.code + "%s" + RESET);
this.out = out;
}
String formatted(String raw) {
return this.value.formatted(raw);
}
void out(String message) {
var colored = formatted(message);
this.out.println(colored);
}
public static void debug(String message) {
Log.DEBUG.out(message);
}
public static void error(String message) {
Log.ERROR.out(message);
}
public static void error(String message, Exception e) {
Log.ERROR.out(message + ": " + e.getMessage());
e.printStackTrace(System.err);
}
public static void user(String message){
Log.USER.out(message);
}
public static void info(String message){
Log.INFO.out(message);
}
public static void system(String message){
Log.SYSTEM.out(message);
}
public static void clearScreen(){
IO.println("\033c");
}
public static void warning(String message){
Log.WARNING.out(message);
}
public static void success(String message){
Log.SUCCESS.out(message);
}
public static void stop(String message){
error(message);
System.exit(0);
}
}
| Level | Solarized Color | Stream | Static Method | Purpose |
|-------|----------------|--------|---------------|---------|
| ERROR | Red | System.err | Log.error(msg) | Critical failures |
| USER | Cyan | System.out | Log.user(msg) | User messages and interactive elements |
| INFO | Green | System.out | Log.info(msg) | General information |
| SYSTEM | Blue | System.out | Log.system(msg) | System-level messages |
| WARNING | Yellow | System.out | Log.warning(msg) | Warning conditions |
| DEBUG | Violet | System.out | Log.debug(msg) | Debug information for developers |
| SUCCESS | Magenta | System.out | Log.success(msg) | Success messages and completions |
All interaction uses the public static convenience methods. The instance methods out() and formatted() are package-private.
Log.error("Database connection failed");
Log.error("Connection failed", exception); // logs message + full stack trace to stderr
Log.user("Welcome to the application");
Log.info("Operation completed");
Log.system("Server started on port 8080");
Log.warning("Cache miss detected");
Log.debug("Processing item #42");
Log.success("Build completed successfully");
Log.clearScreen(); // sends ESC c to reset the terminal
Log.stop("Fatal error — shutting down"); // logs error and calls System.exit(0)
Log.java into the project source tree — do not add it as a Maven/Gradle dependency. Only include the enum constants, Color entries, and static methods that the target project actually uses. Remove unused log levels and their corresponding colors and convenience methods.package declaration matching the target package at the top of the copied fileLog.error(), Log.info(), Log.system(), etc.) — never call the package-private instance methods out() or formatted() from outside the enumSystem.out.println calls with the appropriate Log levelLog.error(message, exception) for exception logging — it prints the message and full stack trace to System.errLog.stop(message) only for unrecoverable errors that require immediate process terminationPROMPT, RESPONSE, QUERY, METRIC), add a new enum constant with an appropriate Solarized Color and a corresponding public static void convenience method. Domain-specific levels make log output immediately scannable by category.System.out.println and Log.* call sites across the codebase and identify recurring domain categories (e.g., HTTP requests, AI prompts, pipeline stages, business events). If a category appears in three or more locations and would benefit from distinct color-coding for scannability, propose a dedicated enum constant and convenience method. Do not introduce domain-specific loggers speculatively — only when actual usage patterns justify them.tools
Generic, composable Java 25 code conventions — modern syntax, code style, naming, visibility, structure, methods, streams, exceptions, and documentation rules that apply across all Java contexts (single-file scripts, CLI apps, MicroProfile/Jakarta EE servers, libraries). Technology-neutral within the Java world; meant to be composed with context-specific skills (e.g. `java-cli-script`, `java-cli-app`, `microprofile-server`, `bce`). Use when writing, generating, or reviewing Java code anywhere the composed skill does not already specify style. Triggers on "Java conventions", "Java style", "Java code style", "modern Java", "Java 25", "idiomatic Java", or any request to write or review Java code where context-specific skills do not already cover style.
tools
Generic, composable architecture rules for the Boundary-Control-Entity (BCE/ECB) pattern — business components, layer responsibilities, package structure, and cross-component relationships. Technology-neutral; meant to be composed with language- or framework-specific skills (e.g. microprofile-server, web-components, aws-cdk, java-cli-app). Use when creating, generating, scaffolding, writing, or reviewing code organized as business components with boundary/control/entity layers. Triggers on "BCE", "ECB", "Boundary-Control-Entity", "business component", "BC layout", "BC structure", "boundary layer", "control layer", "entity layer", or requests to organize, package, refactor, or review code along BCE lines.
tools
Create zero-dependency, single-file executable Java scripts for system-wide use via PATH. Use when asked to create a single-file Java shell script, system utility, PATH-installed Java tool, or shebang-launched Java program without the .java extension. Triggers on "Java script", "Java utility", "PATH script", "system script", or requests for single-file Java programs installed in /usr/local/bin or similar PATH directories. Not for multi-file Java applications — use java-cli-app for those.
development
Architecture and coding rules for long-running Java MicroProfile / Jakarta EE server applications — BCE layering, business components (BC), JAX-RS resources, CDI, JSON-P, testing (unit/integration/system), and Maven project structure. Use when creating, generating, scaffolding, writing, or reviewing code, resources, entities, boundaries, or business components in MicroProfile server projects. Not for serverless deployments.