From 4181a79cd81928647909d8c4dfd6fe02f2947bf5 Mon Sep 17 00:00:00 2001 From: jade Date: Thu, 9 Jul 2026 13:06:53 +0900 Subject: [PATCH] chore(core): enforce AGENTS.md rules in ToolScaffolder generation templates --- .../biz/mcp/tool/util/ToolScaffolder.java | 53 +++++++++++++++++-- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/util/ToolScaffolder.java b/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/util/ToolScaffolder.java index 4aef13c..0fff529 100644 --- a/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/util/ToolScaffolder.java +++ b/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/util/ToolScaffolder.java @@ -41,7 +41,7 @@ public class ToolScaffolder { Scanner scanner = new Scanner(System.in); System.out.println("========================================="); - System.out.println(" πŸ› οΈ MCP Tool Scaffolder (Java CLI) πŸ› οΈ "); + System.out.println(" MCP Tool Scaffolder (Java CLI) "); System.out.println("=========================================\n"); String baseName = getOrAsk(args, 0, scanner, "1. 생성할 Tool의 κΈ°λ³Έ 이름 (예: ExchangeRate) [영문 PascalCase]: "); @@ -83,12 +83,26 @@ public class ToolScaffolder { import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; + /** + * @package %s.dto + * @className %sReq + * @description AX HUB μ‹œμŠ€ν…œ 처리 클래슀 + * @author κΉ€ν˜•μ‹ + * @create 2026.09.01 + *
+             * ---------- κ°œμ •μ΄λ ₯ ----------
+             * μˆ˜μ •μΌ      μˆ˜μ •μž    μˆ˜μ •λ‚΄μš©
+             * ---------- -------- ---------------------------
+             * 2026.09.01  κΉ€ν˜•μ‹    μ΅œμ΄ˆμƒμ„±
+             * 
+             * 
+ */ @Data @JsonInclude(JsonInclude.Include.NON_NULL) public class %sReq { // TODO: Add request fields here } - """.formatted(BASE_PACKAGE, baseName); + """.formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName); Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent); // Generate Res DTO @@ -98,6 +112,20 @@ public class ToolScaffolder { import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; + /** + * @package %s.dto + * @className %sRes + * @description AX HUB μ‹œμŠ€ν…œ 처리 클래슀 + * @author κΉ€ν˜•μ‹ + * @create 2026.09.01 + *
+             * ---------- κ°œμ •μ΄λ ₯ ----------
+             * μˆ˜μ •μΌ      μˆ˜μ •μž    μˆ˜μ •λ‚΄μš©
+             * ---------- -------- ---------------------------
+             * 2026.09.01  κΉ€ν˜•μ‹    μ΅œμ΄ˆμƒμ„±
+             * 
+             * 
+ */ @Data @JsonInclude(JsonInclude.Include.NON_NULL) public class %sRes { @@ -105,7 +133,7 @@ public class ToolScaffolder { private String message; // TODO: Add response fields here } - """.formatted(BASE_PACKAGE, baseName); + """.formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName); Files.writeString(dtoDir.resolve(baseName + "Res.java"), resContent); String toolName = baseName.toLowerCase(); @@ -120,6 +148,20 @@ public class ToolScaffolder { import %s.dto.%sRes; import org.springframework.stereotype.Service; + /** + * @package %s.service + * @className %sService + * @description AX HUB μ‹œμŠ€ν…œ 처리 클래슀 + * @author κΉ€ν˜•μ‹ + * @create 2026.09.01 + *
+             * ---------- κ°œμ •μ΄λ ₯ ----------
+             * μˆ˜μ •μΌ      μˆ˜μ •μž    μˆ˜μ •λ‚΄μš©
+             * ---------- -------- ---------------------------
+             * 2026.09.01  κΉ€ν˜•μ‹    μ΅œμ΄ˆμƒμ„±
+             * 
+             * 
+ */ @Service @McpTool( routingType = "%s", @@ -143,6 +185,7 @@ public class ToolScaffolder { BASE_PACKAGE, BASE_PACKAGE, baseName, BASE_PACKAGE, baseName, + BASE_PACKAGE, baseName, routingType, group, baseName, @@ -176,11 +219,11 @@ public class ToolScaffolder { } System.out.println("\n========================================="); - System.out.println("βœ… Scaffolding Complete!"); + System.out.println(" Scaffolding Complete!"); System.out.println("========================================="); System.out.println("[Service] " + serviceDir.resolve(baseName + "Service.java")); System.out.println("[Req DTO] " + dtoDir.resolve(baseName + "Req.java")); System.out.println("[Res DTO] " + dtoDir.resolve(baseName + "Res.java")); - System.out.println("\nπŸ’‘ 팁: " + interfaceId + " λͺ©μ—… 데이터λ₯Ό mock-responses.json에 μΆ”κ°€ν•˜μ„Έμš”."); + System.out.println("\n Tip: " + interfaceId + " λͺ©μ—… 데이터λ₯Ό mock-responses.json에 μΆ”κ°€ν•˜μ„Έμš”."); } } \ No newline at end of file