plugins/code/skills/code-generation/SKILL.md
This skill should be used when the user asks to "fix formatter-off", "fix code generation formatting", "fix auto-formatted string concatenation", "add formatter off", or when writing, reviewing, or generating Java code generators that build source code via string concatenation. Also applies proactively when creating new code generation methods or modifying existing ones — always use @formatter:off guards and the one-output-line-per-source-line convention.
npx skillsauth add motlin/claude-code-plugins code-generationInstall 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.
Java code generators that build source code via string concatenation must use // @formatter:off / // @formatter:on guards. Without these, IntelliJ's auto-formatter breaks concatenation chains across multiple lines, destroying the correspondence between Java source lines and generated output lines.
Each line of generated output (terminated by \n) must occupy a single Java source line. A new line in the Java source should only occur where there is a \n in the template string.
setterBody = ""
+ " domainObject.get"
+ propNameUpper
+ "().clear();\n"
+ " return;\n";
// @formatter:off
setterBody = ""
+ " domainObject.get" + propNameUpper + "().clear();\n"
+ " return;\n";
// @formatter:on
Search for string concatenation blocks that contain \n literals but are NOT wrapped in // @formatter:off. Common patterns:
+ chains where each + is on its own line and template variables are separated from their surrounding string literals.collect() lambdas producing single-line templates that got broken across multiple linesreturn ( "" + ... ) instead of direct return "" + ...\n that lacks @formatter:off guards// @formatter:off before the block\n-terminated segment is on one Java source line// @formatter:on after the block.collect() lambdas that produce single-line templates (one \n), collapse the entire template string onto one line\n-terminated segment gets its own line with + continuation@formatter:off blocks in the fileMatch the existing convention in each file. The typical pattern uses tabs with + aligned:
// @formatter:off
// language=JAVA
return ""
+ "package " + packageName + ";\n"
+ "\n"
+ "public class " + className + "\n"
+ "{\n"
+ "}\n";
// @formatter:on
For .collect() lambdas with single-line output, keep it all on one line:
// @formatter:off
String fields = properties
.collect((p) -> " public final " + this.getType(p) + " " + p.getName() + ";\n")
.makeString("");
// @formatter:on
When the string block contains valid Java source, add // language=JAVA after // @formatter:off to enable IntelliJ language injection for syntax highlighting inside the strings.
tools
This skill should be used after completing any task, before returning control to the user. Always run this skill — it handles the case where there's nothing to do.
development
Commit message format and git workflow rules. ALWAYS use this skill for every git commit — no exceptions — and whenever rewording an existing commit message.
tools
CLI guidelines. Use whenever using the Bash tool, which is almost always. Also use when you see "command not found: __zoxide_z" errors.
tools
Maven CLI invocation patterns. Use whenever running `mvn` commands in Java/Maven projects. Covers when `-am` is required, why `-o` (offline) mode hides bugs in multi-worktree setups, and how to verify compile/test cleanly without trusting stale `~/.m2` artifacts.