marketplace/bundles/pm-dev-java-cui/skills/recipe-cui-logging-enforce/SKILL.md
Recipe for enforcing CUI logging standards across all modules — migrate loggers, implement LogRecords, add test coverage
npx skillsauth add cuioss/plan-marshall recipe-cui-logging-enforceInstall 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.
Custom recipe for enforcing CUI logging standards across Java modules. Discovers modules, creates one deliverable per module. The task executor loads cui-logging standards and handles analysis and fixing in a single pass per module.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| plan_id | string | Yes | Plan identifier |
| recipe_domain | string | Yes | Domain key (auto-assigned: java-cui) |
| recipe_profile | string | No | Not used — this recipe scans whole modules, not packages |
| recipe_package_source | string | No | Not used — scope is module-level |
The enforcement requires logging standards and testing standards (for LogAsserts):
python3 .plan/execute-script.py plan-marshall:manage-config:manage-config \
resolve-domain-skills --domain java-cui --profile core
Also resolve the module_testing profile for test coverage skills:
python3 .plan/execute-script.py plan-marshall:manage-config:manage-config \
resolve-domain-skills --domain java-cui --profile module_testing
Combine all resolved skills. The deliverables will always include both profiles (implementation and module_testing) since enforcement modifies both production code (logger migration, LogRecord implementation) and test code (LogAsserts).
Query the project architecture for available modules:
python3 .plan/execute-script.py plan-marshall:manage-architecture:architecture modules
Present module list to user for confirmation/filtering. User may exclude modules (e.g., parent POMs, modules without Java source files).
For each selected module:
3a. Query module details:
python3 .plan/execute-script.py plan-marshall:manage-architecture:architecture \
module --module {module_name} --full
3b. Discover logging-related files using the canonical manage-files discover subcommand. Logging enforcement requires four distinct file categories — each is collected in a separate call so step 3c can consume the lists independently. Run all four calls per module:
LogMessages classes (production):
python3 .plan/execute-script.py plan-marshall:manage-files:manage-files discover \
--root {module_path} --glob "**/*LogMessages.java" --include-files
All production Java files (for logger migration scan):
python3 .plan/execute-script.py plan-marshall:manage-files:manage-files discover \
--root {module_path} --glob "**/*.java" --include-files
Test files (for LogAssert coverage):
python3 .plan/execute-script.py plan-marshall:manage-files:manage-files discover \
--root {module_path} --glob "**/*Test.java" --include-files
LogMessages documentation:
python3 .plan/execute-script.py plan-marshall:manage-files:manage-files discover \
--root {module_path} --glob "doc/LogMessages.adoc" --include-files
Each call returns the matching file list under its own files[] array. Step 3c consumes the four discovered lists separately when assembling the deliverable's Affected files set. Skip modules with no Java source files (i.e., the production-Java call returns an empty list).
3c. Collect one deliverable per module (in-memory, for Step 4):
Enforce logging standards: {module}change_type: tech_debtexecution_mode: automateddomain: java-cuimodule: {module_name}implementation, module_testingmodule-tests command for the module4a. Read the deliverable template to understand the required structure:
Read: marketplace/bundles/plan-marshall/skills/manage-solution-outline/templates/deliverable-template.md
4b. Read an example to see the full document skeleton:
Read: marketplace/bundles/plan-marshall/skills/manage-solution-outline/examples/refactoring.md
4c. Resolve the target path:
python3 .plan/execute-script.py plan-marshall:manage-solution-outline:manage-solution-outline \
resolve-path --plan-id {plan_id}
4d. Resolve verification commands for each module:
python3 .plan/execute-script.py plan-marshall:manage-architecture:architecture \
resolve --command module-tests --module {module} --audit-plan-id {plan_id}
4e. Write the solution outline using the Write tool to {resolved_path}. The document MUST include these sections in order:
# Solution: Enforce CUI Logging Standards header with plan_id, created, compatibility metadata## Summary — scope description ({N} modules)## Overview — resolved skills list and module breakdown## Deliverables — all deliverables from Step 3, grouped by module, using the template structure from 4a4f. Validate the written outline:
python3 .plan/execute-script.py plan-marshall:manage-solution-outline:manage-solution-outline \
write --plan-id {plan_id}
This section defines how the task executor enforces logging standards within each module. The cui-logging skill provides the underlying standards — this workflow defines the enforcement sequence.
Production code protection:
Bug handling protocol: When non-logging production bugs discovered:
Find violations using pm-dev-java-cui:cui-logging skill workflow:
LoggerFactory.getLogger, Log4j, @Slf4j, System.out/err)Verify LogRecord coverage for each LogMessages class:
.format() calls, static imports)resolveIdentifierString)Execute in this order:
LoggerFactory.getLogger / Logger.getLogger / @Slf4j with CuiLogger. Apply patterns from standards/logging-maintenance-reference.md → "Logger Migration"{} placeholders to %s. Follow DSL-style structure from standards/logging-standards.md → "LogMessages Class Structure"@EnableTestLogger and LogAsserts. If no business logic test exists: ask user.Renumber identifiers for each LogMessages class:
Update documentation for each modified LogMessages class — update corresponding doc/LogMessages.adoc via pm-dev-java-cui:cui-logging skill.
pm-dev-java-cui:cui-logging — Core logging standards and maintenance referencepm-dev-java-cui:cui-testing — Test standards including LogAssertsplan-marshall:recipe-refactor-to-profile-standards — Built-in recipe (same 4-step pattern)plan-marshall:phase-3-outline Step 2.5 — Loads this skill with input parameterstesting
A test skill for README generation
testing
A test skill with existing references
tools
Skill without references directory
development
Test skill with table-format references