Logging

From andresdiegolanda/design-first-ai · View interactive version

Logging is an AI agent skill from the GitHub repository andresdiegolanda/design-first-ai. Consistent, safe log statements with correct levels and no PII. Use when adding or reviewing log statements.

How to use this skill

Skill file

Skill: Logging

When to load it: When adding any new log statement, or when reviewing log coverage

in an existing feature.


What This Skill Does

Produces log statements at the correct level, with safe content (no PII, no full

request/response bodies), following a consistent pattern across the codebase.


Rules


Pattern

private static final Logger log = LoggerFactory.getLogger([ClassName].class);

// Service entry (DEBUG)
log.debug("Finding [resource] id={}", id);

// Business event (INFO)
log.info("Created [resource] id={}", resource.getId());

// Recoverable condition (WARN)
log.warn("No [resource] found for id={}, returning empty result", id);

// Exception boundary (ERROR — once, with stack trace)
log.error("Failed to retrieve [resource] id={}", id, ex);

Design Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.