code-generation
БесплатноБез исполняемых скриптовНе проверенFormatting rules for Java code generators that build source code via string concatenation. Use when the user asks to "fix formatter-off", "fix code generation…
от motlin★ 20 звёзд на GitHubОб этом скилле
Code Generation Formatting
Java code generators that build source via string concatenation need // @formatter:off / // @formatter:on guards. Without them, IntelliJ's formatter splits concatenation chains and breaks the correspondence between Java source lines and generated output lines.
The rule
Each \n-terminated line of generated output occupies exactly one Java source line. A Java line break occurs only where the template has a \n.
Bad (auto-formatted):
setterBody = ""
+ " domainObject.get"
+ propNameUpper
+ "().clear();\n"
+ " return;\n";
Good:
// @formatter:off
setterBody = ""
+ " domainObject.get" + propNameUpper + "().clear();\n"
+ " return;\n";
// @formatter:on
Finding violations
Look for concatenation blocks containing \n literals that are not inside // @formatter:off. Typical shapes:
- Multi-line
+chains with template variables split from their surrounding string literals. .collect()lambdas whose single-line template was broken across lines.return ( "" + ... )wrapped in parentheses instead ofreturn "" + ....
Fixing
Wrap the block in // @formatter:off and // @formatter:on, and collapse each \n-terminated segment onto one line with + continuation. A .collect() lambda with a single-line template goes entirely on one line. When the strings contain valid Java source, add // language=JAVA after // @formatter:off for IntelliJ language injection.
Match the indentation of existing @formatter:off blocks in the file. The usual pattern is tabs with aligned +:
// @formatter:off
// language=JAVA
return ""
+ "package " + packageName + ";\n"
+ "\n"
+ "public class " + className + "\n"
+ "{\n"
+ "}\n";
// @formatter:on
// @formatter:off
String fields = properties
.collect((p) -> " public final " + this.getType(p) + " " + p.getName() + ";\n")
.makeString("");
// @formatter:on
Установить code-generation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл code-generation?
Formatting rules for Java code generators that build source code via string concatenation. Use when the user asks to "fix formatter-off", "fix code generation formatting", "fix auto-formatted string concatenation", or "add formatter off", and proactively when writing, reviewing, or modifying a code generation method.
Как установить скилл code-generation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-generation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic