sh-ui-cli 0.22.1 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,19 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$description": "sh-ui 릴리즈 노트 단일 소스. docs(React)와 showcase(Flutter)가 함께 읽는다. 새 릴리즈마다 맨 앞에 추가.",
4
4
  "versions": [
5
+ {
6
+ "version": "0.22.2",
7
+ "date": "2026-04-28",
8
+ "title": "에이전트 UX — MCP 라우팅 + sh-ui-create 비대화형 가드",
9
+ "type": "patch",
10
+ "highlights": [
11
+ "MCP 서버 initialize 응답에 instructions 추가 — IDE-내 AI 가 빈 폴더/새 프로젝트 요청 시 create-next-app + sh_ui_init 우회 대신 npx sh-ui-create 로 바로 가도록 안내",
12
+ "sh-ui-create --help / -h 추가 — 누락 플래그 안내 + 비대화형 사용 예시 출력",
13
+ "sh-ui-create 가 TTY 없는 환경에서 필수 플래그(--platform, --structure, name) 누락 시 prompt 대신 즉시 에러로 종료 — 에이전트/CI 가 stuck 에 빠지지 않음",
14
+ "sh-ui-create 의 --plugins 는 미지정 시 prompt 없이 빈 배열 기본값 — 플러그인은 --plugins sentry,next-intl 로 명시 활성화"
15
+ ],
16
+ "url": "https://github.com/sanghyeonKim0201/sh-ui/releases/tag/v0.22.2"
17
+ },
5
18
  {
6
19
  "version": "0.22.1",
7
20
  "date": "2026-04-27",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-ui-cli",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "description": "sh-ui CLI — 디자인 시스템 컴포넌트를 프로젝트로 복사하는 CLI (sh-ui init / add / list / remove)",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/mcp.mjs CHANGED
@@ -100,10 +100,60 @@ function resolveCwd(input) {
100
100
  return input?.cwd ? resolve(input.cwd) : process.cwd();
101
101
  }
102
102
 
103
+ const SERVER_INSTRUCTIONS = `sh-ui — Base UI 위에 빌드된 React/Flutter 디자인 시스템.
104
+
105
+ ## 새 프로젝트를 만드는 경우 (이 MCP 툴 호출 금지)
106
+
107
+ 빈 폴더에서 시작하거나 사용자가 "Next.js 앱 만들어줘", "Flutter 프로젝트 새로", "sh-ui 로 시작" 처럼 **스캐폴드부터** 요청하면 \`sh-ui-create\` 사용:
108
+
109
+ npm create sh-ui my-app # 권장 (대화형)
110
+ npx sh-ui-create my-app # 동일
111
+
112
+ 비대화형(에이전트/CI)은 **모든 필수 플래그를 명시**해야 한다 — \`sh-ui-create\` 는 \`--help\` 가 없고, 누락 시 prompt 에서 멈춘다:
113
+
114
+ # Next.js 단독:
115
+ npx sh-ui-create my-app --platform next --structure standalone --plugins "" --yes
116
+ # Next.js 모노레포 (Turborepo):
117
+ npx sh-ui-create my-app --platform next --structure monorepo --plugins "" --yes
118
+ # Flutter:
119
+ npx sh-ui-create my-app --platform flutter --yes
120
+
121
+ 플래그:
122
+ - \`--platform\` next | flutter (필수)
123
+ - \`--structure\` standalone | monorepo (next 일 때 필수)
124
+ - \`--plugins\` 콤마 구분 (sentry,next-intl) — 없으면 \`""\` 명시 (필수)
125
+ - \`--theme\` base64 인코딩된 테마 JSON (선택)
126
+ - \`--yes\` 디렉토리 덮어쓰기/모노레포 기본값 자동 채택
127
+
128
+ 이게 한 번에 해주는 일:
129
+ - Next.js (standalone / Turborepo 모노레포) 또는 Flutter 프로젝트 스캐폴드
130
+ - FSD 폴더 구조, 토큰, \`sh-ui.config.json\` 일괄 생성
131
+ - 옵션 플러그인 (Sentry, next-intl)
132
+
133
+ \`create-next-app\` + \`sh_ui_init\` 조합은 **쓰지 말 것** — 위 명령이 더 짧고 sh-ui 관용에 맞다.
134
+
135
+ ## 이미 있는 프로젝트에 sh-ui 를 얹는 경우 (MCP 툴 사용)
136
+
137
+ 기존 Next.js/Vite/Flutter 프로젝트에 sh-ui 컴포넌트만 추가하고 싶을 때:
138
+ 1. \`sh_ui_describe_init\` — 자연어 의도("다크 모던")를 enum 으로 매핑
139
+ 2. \`sh_ui_init\` — \`sh-ui.config.json\` 생성
140
+ 3. \`sh_ui_add_component\` — \`tokens\` 먼저, 그다음 컴포넌트
141
+
142
+ ## 컴포넌트 작업
143
+
144
+ - \`sh_ui_list_components\` — 어떤 게 있는지
145
+ - \`sh_ui_get_component\` — props/소스 확인 (코드 작성 전)
146
+ - \`sh_ui_add_component\` / \`sh_ui_remove_component\` — 설치/삭제
147
+ - \`sh_ui_get_changelog\` — 최근 변경 내역
148
+ `;
149
+
103
150
  export async function startMcpServer() {
104
151
  const server = new McpServer(
105
- { name: "sh-ui", version: "0.22.1" },
106
- { capabilities: { tools: {} } },
152
+ { name: "sh-ui", version: "0.22.2" }, // sh-ui-cli 와 동기화
153
+ {
154
+ capabilities: { tools: {} },
155
+ instructions: SERVER_INSTRUCTIONS,
156
+ },
107
157
  );
108
158
 
109
159
  server.registerTool(
@@ -121,6 +171,8 @@ export async function startMcpServer() {
121
171
  "sh_ui_init",
122
172
  {
123
173
  description:
174
+ "⚠️ 빈 폴더/새 프로젝트면 이 툴 대신 `npx sh-ui-create` 사용 — 스캐폴드 + 토큰 + config 일괄 처리. " +
175
+ "이 툴은 **이미 있는** Next.js/Vite/Flutter 프로젝트에 sh-ui 만 얹을 때. " +
124
176
  "현재 디렉토리(또는 cwd)에 sh-ui.config.json 을 생성. 비대화형 — 누락된 값은 기본값 사용. " +
125
177
  "선택지 의미가 헷갈리면 먼저 sh_ui_describe_init 호출 권장.",
126
178
  inputSchema: {