chore(core): enforce AGENTS.md rules in ToolScaffolder generation templates
This commit is contained in:
@@ -41,7 +41,7 @@ public class ToolScaffolder {
|
|||||||
Scanner scanner = new Scanner(System.in);
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
|
||||||
System.out.println("=========================================");
|
System.out.println("=========================================");
|
||||||
System.out.println(" 🛠️ MCP Tool Scaffolder (Java CLI) 🛠️ ");
|
System.out.println(" MCP Tool Scaffolder (Java CLI) ");
|
||||||
System.out.println("=========================================\n");
|
System.out.println("=========================================\n");
|
||||||
|
|
||||||
String baseName = getOrAsk(args, 0, scanner, "1. 생성할 Tool의 기본 이름 (예: ExchangeRate) [영문 PascalCase]: ");
|
String baseName = getOrAsk(args, 0, scanner, "1. 생성할 Tool의 기본 이름 (예: ExchangeRate) [영문 PascalCase]: ");
|
||||||
@@ -83,12 +83,26 @@ public class ToolScaffolder {
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package %s.dto
|
||||||
|
* @className %sReq
|
||||||
|
* @description AX HUB 시스템 처리 클래스
|
||||||
|
* @author 김형식
|
||||||
|
* @create 2026.09.01
|
||||||
|
* <pre>
|
||||||
|
* ---------- 개정이력 ----------
|
||||||
|
* 수정일 수정자 수정내용
|
||||||
|
* ---------- -------- ---------------------------
|
||||||
|
* 2026.09.01 김형식 최초생성
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class %sReq {
|
public class %sReq {
|
||||||
// TODO: Add request fields here
|
// TODO: Add request fields here
|
||||||
}
|
}
|
||||||
""".formatted(BASE_PACKAGE, baseName);
|
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName);
|
||||||
Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent);
|
Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent);
|
||||||
|
|
||||||
// Generate Res DTO
|
// Generate Res DTO
|
||||||
@@ -98,6 +112,20 @@ public class ToolScaffolder {
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package %s.dto
|
||||||
|
* @className %sRes
|
||||||
|
* @description AX HUB 시스템 처리 클래스
|
||||||
|
* @author 김형식
|
||||||
|
* @create 2026.09.01
|
||||||
|
* <pre>
|
||||||
|
* ---------- 개정이력 ----------
|
||||||
|
* 수정일 수정자 수정내용
|
||||||
|
* ---------- -------- ---------------------------
|
||||||
|
* 2026.09.01 김형식 최초생성
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class %sRes {
|
public class %sRes {
|
||||||
@@ -105,7 +133,7 @@ public class ToolScaffolder {
|
|||||||
private String message;
|
private String message;
|
||||||
// TODO: Add response fields here
|
// TODO: Add response fields here
|
||||||
}
|
}
|
||||||
""".formatted(BASE_PACKAGE, baseName);
|
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName);
|
||||||
Files.writeString(dtoDir.resolve(baseName + "Res.java"), resContent);
|
Files.writeString(dtoDir.resolve(baseName + "Res.java"), resContent);
|
||||||
|
|
||||||
String toolName = baseName.toLowerCase();
|
String toolName = baseName.toLowerCase();
|
||||||
@@ -120,6 +148,20 @@ public class ToolScaffolder {
|
|||||||
import %s.dto.%sRes;
|
import %s.dto.%sRes;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package %s.service
|
||||||
|
* @className %sService
|
||||||
|
* @description AX HUB 시스템 처리 클래스
|
||||||
|
* @author 김형식
|
||||||
|
* @create 2026.09.01
|
||||||
|
* <pre>
|
||||||
|
* ---------- 개정이력 ----------
|
||||||
|
* 수정일 수정자 수정내용
|
||||||
|
* ---------- -------- ---------------------------
|
||||||
|
* 2026.09.01 김형식 최초생성
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@McpTool(
|
@McpTool(
|
||||||
routingType = "%s",
|
routingType = "%s",
|
||||||
@@ -143,6 +185,7 @@ public class ToolScaffolder {
|
|||||||
BASE_PACKAGE,
|
BASE_PACKAGE,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE, baseName,
|
||||||
routingType,
|
routingType,
|
||||||
group,
|
group,
|
||||||
baseName,
|
baseName,
|
||||||
@@ -176,11 +219,11 @@ public class ToolScaffolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("\n=========================================");
|
System.out.println("\n=========================================");
|
||||||
System.out.println("✅ Scaffolding Complete!");
|
System.out.println(" Scaffolding Complete!");
|
||||||
System.out.println("=========================================");
|
System.out.println("=========================================");
|
||||||
System.out.println("[Service] " + serviceDir.resolve(baseName + "Service.java"));
|
System.out.println("[Service] " + serviceDir.resolve(baseName + "Service.java"));
|
||||||
System.out.println("[Req DTO] " + dtoDir.resolve(baseName + "Req.java"));
|
System.out.println("[Req DTO] " + dtoDir.resolve(baseName + "Req.java"));
|
||||||
System.out.println("[Res DTO] " + dtoDir.resolve(baseName + "Res.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에 추가하세요.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user