feat(blog): 마켓플레이스 스킬 계층 관계 맵을 추가하고 배포 경로 검증을 수정한다
- @xyflow/react 기반 좌->우 4계층 스킬 계층·연결 맵(SkillHierarchyMap)과 모바일 계층 리스트를 /marketplace에 추가 - skills/**/*.md 실제 상대 링크에서 스킬 간 참조 엣지·용어집 리프를 자동 추출하는 SKILL_GRAPH 추가 - goraebap-mode 플레이북 중복 제목(프론트엔드/백엔드 프로젝트 구성) 정리 - .github/workflows/deploy.yml 및 deploy/blog.sh의 제거된 옛 경로(marketplace/fullstack) 검증을 marketplace/goraebap-mode로 수정
This commit is contained in:
1 parent
15670c236b
commit
46dc6f5106
13 files changed
+1396
-45
No files matched your search
@@ -53,7 +53,7 @@ jobs:
|
||||
pnpm build
|
||||
test -f apps/blog/dist/index.html
|
||||
test -f apps/blog/dist/marketplace/index.html
|
||||
test -f apps/blog/dist/marketplace/fullstack/index.html
|
||||
test -f apps/blog/dist/marketplace/goraebap-mode/index.html
|
||||
|
||||
- name: Upload release to homeserver
|
||||
if: steps.check.outputs.ready == 'true'
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ fi
|
||||
|
||||
[ -f "$DIST/index.html" ] || { echo "빌드 결과에 index.html이 없습니다"; exit 1; }
|
||||
[ -f "$DIST/marketplace/index.html" ] || { echo "빌드 결과에 marketplace/index.html이 없습니다"; exit 1; }
|
||||
[ -f "$DIST/marketplace/fullstack/index.html" ] || { echo "빌드 결과에 marketplace/fullstack/index.html이 없습니다"; exit 1; }
|
||||
[ -f "$DIST/marketplace/goraebap-mode/index.html" ] || { echo "빌드 결과에 marketplace/goraebap-mode/index.html이 없습니다"; exit 1; }
|
||||
|
||||
echo "올리기: releases/$ID"
|
||||
tar -C "$DIST" --exclude='./brand-drafts' --exclude='brand-drafts' -czf - . | remote "set -e; mkdir -p $SITE/releases/$ID; tar -xzf - -C $SITE/releases/$ID;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 프로젝트 구성
|
||||
title: 백엔드 프로젝트 구성
|
||||
summary: 새 백엔드 서버를 단일 프로젝트, shared와 첫 모듈, 마이그레이션, 품질 검사, 에이전트 지침까지 갖춰 세팅하는 공통 절차입니다.
|
||||
order: 1
|
||||
icon: rocket
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 프로젝트 구성
|
||||
title: 프론트엔드 프로젝트 구성
|
||||
summary: 새 프론트엔드 프로젝트를 FSD 레이어, 라우터, 데이터 조회 도구, 디자인 시스템, 품질 검사, 에이전트 지침까지 갖춰 세팅하는 공통 절차입니다.
|
||||
order: 1
|
||||
icon: rocket
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"@goraebap/design-system": "workspace:*",
|
||||
"@goraebap/ui-react": "workspace:*",
|
||||
"@tanstack/react-router": "catalog:",
|
||||
"@xyflow/react": "^13.0.3",
|
||||
"lenis": "^1.3.27",
|
||||
"mermaid": "^12.3.0",
|
||||
"react": "catalog:",
|
||||
|
||||
@@ -3,6 +3,7 @@ export {
|
||||
PLUGIN,
|
||||
SKILLS,
|
||||
SKILL_CATEGORIES,
|
||||
SKILL_GRAPH,
|
||||
allSkillPrerenderRoutes,
|
||||
findSkill,
|
||||
findSkillDoc,
|
||||
@@ -10,6 +11,10 @@ export {
|
||||
type PluginInfo,
|
||||
type SkillDoc,
|
||||
type SkillEntry,
|
||||
type SkillGlossaryLeaf,
|
||||
type SkillGraph,
|
||||
type SkillLayer,
|
||||
type SkillLinkEdge,
|
||||
} from "./model/catalog";
|
||||
export { InstallTabs } from "./ui/InstallTabs";
|
||||
export { SkillArticle } from "./ui/SkillArticle";
|
||||
@@ -98,6 +98,29 @@ export interface PluginInfo {
|
||||
totalSkillTokens: number;
|
||||
}
|
||||
|
||||
export type SkillLayer = "orchestrator" | "reference" | "utility";
|
||||
|
||||
export interface SkillLinkEdge {
|
||||
source: string;
|
||||
target: string;
|
||||
count: number;
|
||||
kind: "orchestrates" | "references" | "feedback";
|
||||
}
|
||||
|
||||
export interface SkillGlossaryLeaf {
|
||||
id: string;
|
||||
skillName: string;
|
||||
title: string;
|
||||
href: string;
|
||||
termCount: number;
|
||||
}
|
||||
|
||||
export interface SkillGraph {
|
||||
edges: SkillLinkEdge[];
|
||||
glossaryLeaves: SkillGlossaryLeaf[];
|
||||
layerOf: Record<string, SkillLayer>;
|
||||
}
|
||||
|
||||
const STACK_LABELS: Record<string, string> = {
|
||||
common: "공통",
|
||||
"react-tanstack": "React · TanStack",
|
||||
@@ -333,6 +356,106 @@ export const SKILLS: SkillEntry[] = buildSkills();
|
||||
|
||||
export const SKILL_CATEGORIES: string[] = Array.from(new Set(SKILLS.map((s) => s.category)));
|
||||
|
||||
function resolveTargetSkillFromLink(
|
||||
skillName: string,
|
||||
relPath: string,
|
||||
rawHref: string,
|
||||
): string | null {
|
||||
if (!rawHref || /^(https?:|mailto:|#|\/)/.test(rawHref)) return null;
|
||||
const [filePart] = rawHref.split("#");
|
||||
if (!filePart.endsWith(".md")) return null;
|
||||
const segments = [skillName, ...relPath.split("/").slice(0, -1)];
|
||||
for (const seg of decodeURI(filePart).split("/")) {
|
||||
if (!seg || seg === ".") continue;
|
||||
if (seg === "..") segments.pop();
|
||||
else segments.push(seg);
|
||||
}
|
||||
return segments[0] ?? null;
|
||||
}
|
||||
|
||||
function buildSkillGraph(skills: SkillEntry[]): SkillGraph {
|
||||
const skillNames = new Set(skills.map((s) => s.name));
|
||||
const layerOf: Record<string, SkillLayer> = {};
|
||||
|
||||
for (const skill of skills) {
|
||||
if (skill.playbooks.length > 0) {
|
||||
layerOf[skill.name] = "orchestrator";
|
||||
} else if (skill.invocation === "explicit" && skill.references.length === 0) {
|
||||
layerOf[skill.name] = "utility";
|
||||
} else {
|
||||
layerOf[skill.name] = "reference";
|
||||
}
|
||||
}
|
||||
|
||||
const counts = new Map<string, number>();
|
||||
const linkRe = /\]\(([^)]+\.md(?:#[^)]*)?)\)/g;
|
||||
|
||||
for (const skill of skills) {
|
||||
const sources: { relPath: string; raw: string }[] = [];
|
||||
for (const doc of skill.allDocs) {
|
||||
sources.push({ relPath: doc.relPath, raw: doc.source });
|
||||
for (const stack of doc.stacks) {
|
||||
sources.push({ relPath: stack.relPath, raw: stack.source });
|
||||
}
|
||||
}
|
||||
for (const item of sources) {
|
||||
for (const match of item.raw.matchAll(linkRe)) {
|
||||
const target = resolveTargetSkillFromLink(skill.name, item.relPath, match[1]);
|
||||
if (target && target !== skill.name && skillNames.has(target)) {
|
||||
const key = `${skill.name}->${target}`;
|
||||
counts.set(key, (counts.get(key) ?? 0) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const edges: SkillLinkEdge[] = [];
|
||||
for (const [key, count] of counts) {
|
||||
const [source, target] = key.split("->");
|
||||
edges.push({
|
||||
source,
|
||||
target,
|
||||
count,
|
||||
kind: layerOf[source] === "orchestrator" ? "orchestrates" : "references",
|
||||
});
|
||||
}
|
||||
|
||||
const orchestrator = skills.find((s) => layerOf[s.name] === "orchestrator");
|
||||
const utilities = skills.filter((s) => layerOf[s.name] === "utility");
|
||||
if (orchestrator) {
|
||||
for (const util of utilities) {
|
||||
const exists = edges.some((e) => e.source === orchestrator.name && e.target === util.name);
|
||||
if (!exists) {
|
||||
edges.push({
|
||||
source: orchestrator.name,
|
||||
target: util.name,
|
||||
count: 1,
|
||||
kind: "feedback",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const glossaryLeaves: SkillGlossaryLeaf[] = [];
|
||||
for (const skill of skills) {
|
||||
for (const doc of skill.glossaryDocs) {
|
||||
const termCount = (doc.source.match(/^###\s+/gm) ?? []).length;
|
||||
const metaLabel = (doc.meta as { label?: string }).label;
|
||||
glossaryLeaves.push({
|
||||
id: `glossary:${skill.name}`,
|
||||
skillName: skill.name,
|
||||
title: metaLabel ? `${metaLabel} 용어집` : doc.title,
|
||||
href: doc.href,
|
||||
termCount,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return { edges, glossaryLeaves, layerOf };
|
||||
}
|
||||
|
||||
export const SKILL_GRAPH: SkillGraph = buildSkillGraph(SKILLS);
|
||||
|
||||
export const PLUGIN: PluginInfo = {
|
||||
name: marketJson.plugin.name,
|
||||
displayName: marketJson.plugin.displayName ?? marketJson.plugin.name,
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
SKILL_CATEGORIES,
|
||||
type SkillEntry,
|
||||
} from "@/entities/plugin-catalog";
|
||||
import { SkillHierarchyMap } from "@/widgets/skill-map";
|
||||
|
||||
export const Route = createFileRoute("/marketplace/")({
|
||||
component: MarketplacePage,
|
||||
@@ -161,28 +162,33 @@ function MarketplacePage() {
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<SkillHierarchyMap />
|
||||
|
||||
<section className="space-y-5">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<div role="group" aria-label="스킬 카테고리 필터" className="flex flex-wrap gap-1.5">
|
||||
{["전체", ...SKILL_CATEGORIES].map((cat) => {
|
||||
const count =
|
||||
cat === "전체" ? SKILLS.length : SKILLS.filter((s) => s.category === cat).length;
|
||||
return (
|
||||
<Button
|
||||
key={cat}
|
||||
type="button"
|
||||
size="sm"
|
||||
shape="pill"
|
||||
variant={category === cat ? "default" : "outline"}
|
||||
aria-pressed={category === cat}
|
||||
onClick={() => setCategory(cat)}
|
||||
className="h-7 px-3 text-xs"
|
||||
>
|
||||
{cat}
|
||||
<span className="ml-1 tabular-nums opacity-70">{count}</span>
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
<div className="flex flex-wrap items-center gap-3">
|
||||
<h2 className="text-foreground text-lg font-semibold tracking-tight">개별 스킬 목록</h2>
|
||||
<div role="group" aria-label="스킬 카테고리 필터" className="flex flex-wrap gap-1.5">
|
||||
{["전체", ...SKILL_CATEGORIES].map((cat) => {
|
||||
const count =
|
||||
cat === "전체" ? SKILLS.length : SKILLS.filter((s) => s.category === cat).length;
|
||||
return (
|
||||
<Button
|
||||
key={cat}
|
||||
type="button"
|
||||
size="sm"
|
||||
shape="pill"
|
||||
variant={category === cat ? "default" : "outline"}
|
||||
aria-pressed={category === cat}
|
||||
onClick={() => setCategory(cat)}
|
||||
className="h-7 px-3 text-xs"
|
||||
>
|
||||
{cat}
|
||||
<span className="ml-1 tabular-nums opacity-70">{count}</span>
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { SkillHierarchyMap } from "./ui/SkillHierarchyMap";
|
||||
@@ -0,0 +1,922 @@
|
||||
import "@xyflow/react/dist/style.css";
|
||||
import "./skill-map.css";
|
||||
|
||||
import { useMemo, useState, useSyncExternalStore } from "react";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import {
|
||||
Background,
|
||||
BackgroundVariant,
|
||||
Controls,
|
||||
MarkerType,
|
||||
ReactFlow,
|
||||
type Edge,
|
||||
type NodeMouseHandler,
|
||||
} from "@xyflow/react";
|
||||
import { Badge } from "@goraebap/ui-react/components/badge";
|
||||
import { Button, buttonVariants } from "@goraebap/ui-react/components/button";
|
||||
import { SystemIcon } from "@goraebap/ui-react/icons";
|
||||
import {
|
||||
MARKET,
|
||||
PLUGIN,
|
||||
SKILLS,
|
||||
SKILL_GRAPH,
|
||||
findSkill,
|
||||
type SkillEntry,
|
||||
type SkillGlossaryLeaf,
|
||||
} from "@/entities/plugin-catalog";
|
||||
import {
|
||||
GlossaryMapNode,
|
||||
PluginMapNode,
|
||||
SkillMapNodeCard,
|
||||
type SkillMapNode,
|
||||
} from "./SkillMapNodes";
|
||||
|
||||
const PLUGIN_NODE_ID = `plugin:${PLUGIN.name}`;
|
||||
|
||||
const NODE_TYPES = {
|
||||
pluginNode: PluginMapNode,
|
||||
skillNode: SkillMapNodeCard,
|
||||
glossaryNode: GlossaryMapNode,
|
||||
} as const;
|
||||
|
||||
const LAYER_COLUMNS = [
|
||||
{ step: "0", label: "단일 플러그인", sub: `${PLUGIN.name}@${MARKET.name}` },
|
||||
{ step: "1", label: "오케스트레이터", sub: "playbooks/*" },
|
||||
{ step: "2", label: "기준 스킬", sub: "references/*" },
|
||||
{ step: "3", label: "최하위 용어집", sub: "glossary/ (링크 0)" },
|
||||
] as const;
|
||||
|
||||
const ROW_GAP = 94;
|
||||
const BASE_Y = 20;
|
||||
|
||||
interface GraphLayout {
|
||||
nodes: SkillMapNode[];
|
||||
edges: Edge[];
|
||||
canvasHeight: number;
|
||||
}
|
||||
|
||||
function computeConnectedSet(focusId: string | null): Set<string> {
|
||||
if (!focusId) return new Set();
|
||||
const set = new Set<string>([focusId]);
|
||||
|
||||
if (focusId === PLUGIN_NODE_ID) {
|
||||
for (const s of SKILLS) {
|
||||
if (SKILL_GRAPH.layerOf[s.name] !== "reference") {
|
||||
set.add(s.name);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
if (focusId.startsWith("glossary:")) {
|
||||
const owner = focusId.slice("glossary:".length);
|
||||
set.add(owner);
|
||||
return set;
|
||||
}
|
||||
|
||||
const layer = SKILL_GRAPH.layerOf[focusId];
|
||||
if (layer === "orchestrator" || layer === "utility") {
|
||||
set.add(PLUGIN_NODE_ID);
|
||||
}
|
||||
for (const e of SKILL_GRAPH.edges) {
|
||||
if (e.source === focusId) set.add(e.target);
|
||||
if (e.target === focusId) set.add(e.source);
|
||||
}
|
||||
for (const leaf of SKILL_GRAPH.glossaryLeaves) {
|
||||
if (leaf.skillName === focusId) set.add(leaf.id);
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
function buildFlowGraph(selectedId: string, hoveredId: string | null): GraphLayout {
|
||||
const focusId = hoveredId ?? selectedId;
|
||||
const connectedIds = computeConnectedSet(focusId);
|
||||
|
||||
const orchestrators = SKILLS.filter((s) => SKILL_GRAPH.layerOf[s.name] === "orchestrator");
|
||||
const references = SKILLS.filter((s) => SKILL_GRAPH.layerOf[s.name] === "reference");
|
||||
const utilities = SKILLS.filter((s) => SKILL_GRAPH.layerOf[s.name] === "utility");
|
||||
|
||||
const refCount = Math.max(references.length, 1);
|
||||
const totalHeight = BASE_Y * 2 + (refCount - 1) * ROW_GAP + 82;
|
||||
const centerY = Math.round(((refCount - 1) * ROW_GAP) / 2) + BASE_Y;
|
||||
|
||||
const nodes: SkillMapNode[] = [];
|
||||
|
||||
// Column 0: Single Plugin Entry
|
||||
nodes.push({
|
||||
id: PLUGIN_NODE_ID,
|
||||
type: "pluginNode",
|
||||
position: { x: 0, y: centerY - 12 },
|
||||
data: {
|
||||
kind: "plugin",
|
||||
name: PLUGIN.name,
|
||||
marketName: MARKET.name,
|
||||
version: PLUGIN.version,
|
||||
logoUrl: PLUGIN.logoUrl,
|
||||
skillCount: SKILLS.length,
|
||||
totalDocs: PLUGIN.totalDocs,
|
||||
active: selectedId === PLUGIN_NODE_ID,
|
||||
dimmed: Boolean(focusId) && !connectedIds.has(PLUGIN_NODE_ID),
|
||||
},
|
||||
});
|
||||
|
||||
// Column 1: Orchestrator + Utility
|
||||
const orchestratorY = utilities.length > 0 ? Math.max(BASE_Y + 72, centerY - 58) : centerY;
|
||||
orchestrators.forEach((skill, idx) => {
|
||||
nodes.push({
|
||||
id: skill.name,
|
||||
type: "skillNode",
|
||||
position: { x: 228, y: orchestratorY + idx * ROW_GAP },
|
||||
data: {
|
||||
kind: "skill",
|
||||
skill,
|
||||
layer: "orchestrator",
|
||||
active: selectedId === skill.name,
|
||||
connected: connectedIds.has(skill.name),
|
||||
dimmed: Boolean(focusId) && !connectedIds.has(skill.name),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const utilityStartY = orchestratorY + orchestrators.length * ROW_GAP + 84;
|
||||
utilities.forEach((skill, idx) => {
|
||||
nodes.push({
|
||||
id: skill.name,
|
||||
type: "skillNode",
|
||||
position: { x: 228, y: utilityStartY + idx * ROW_GAP },
|
||||
data: {
|
||||
kind: "skill",
|
||||
skill,
|
||||
layer: "utility",
|
||||
active: selectedId === skill.name,
|
||||
connected: connectedIds.has(skill.name),
|
||||
dimmed: Boolean(focusId) && !connectedIds.has(skill.name),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Column 2: Reference Skills
|
||||
const refYBySkill = new Map<string, number>();
|
||||
const refIndexBySkill = new Map<string, number>();
|
||||
references.forEach((skill, idx) => {
|
||||
const y = BASE_Y + idx * ROW_GAP;
|
||||
refYBySkill.set(skill.name, y);
|
||||
refIndexBySkill.set(skill.name, idx);
|
||||
nodes.push({
|
||||
id: skill.name,
|
||||
type: "skillNode",
|
||||
position: { x: 536, y },
|
||||
data: {
|
||||
kind: "skill",
|
||||
skill,
|
||||
layer: "reference",
|
||||
active: selectedId === skill.name,
|
||||
connected: connectedIds.has(skill.name),
|
||||
dimmed: Boolean(focusId) && !connectedIds.has(skill.name),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Column 3: Glossary Leaves (aligned with their owning skill)
|
||||
SKILL_GRAPH.glossaryLeaves.forEach((leaf, idx) => {
|
||||
const y = refYBySkill.get(leaf.skillName) ?? BASE_Y + idx * ROW_GAP;
|
||||
nodes.push({
|
||||
id: leaf.id,
|
||||
type: "glossaryNode",
|
||||
position: { x: 820, y: y + 10 },
|
||||
data: {
|
||||
kind: "glossary",
|
||||
leaf,
|
||||
active: selectedId === leaf.id,
|
||||
connected: connectedIds.has(leaf.id),
|
||||
dimmed: Boolean(focusId) && !connectedIds.has(leaf.id),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const edges: Edge[] = [];
|
||||
const edgeHighlight = (src: string, dst: string) =>
|
||||
focusId === src || focusId === dst || (focusId === PLUGIN_NODE_ID && src === PLUGIN_NODE_ID);
|
||||
|
||||
// Plugin -> Orchestrators & Utilities
|
||||
for (const orch of orchestrators) {
|
||||
const active = edgeHighlight(PLUGIN_NODE_ID, orch.name);
|
||||
edges.push({
|
||||
id: `${PLUGIN_NODE_ID}->${orch.name}`,
|
||||
source: PLUGIN_NODE_ID,
|
||||
sourceHandle: "right",
|
||||
target: orch.name,
|
||||
targetHandle: "left",
|
||||
type: "default",
|
||||
markerEnd: {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 14,
|
||||
height: 14,
|
||||
color: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
},
|
||||
style: {
|
||||
stroke: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
strokeWidth: active ? 2 : 1.3,
|
||||
opacity: active ? 0.9 : 0.3,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
for (const util of utilities) {
|
||||
const active = edgeHighlight(PLUGIN_NODE_ID, util.name);
|
||||
edges.push({
|
||||
id: `${PLUGIN_NODE_ID}->${util.name}`,
|
||||
source: PLUGIN_NODE_ID,
|
||||
sourceHandle: "right",
|
||||
target: util.name,
|
||||
targetHandle: "left",
|
||||
type: "default",
|
||||
style: {
|
||||
stroke: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
strokeWidth: active ? 1.6 : 1.1,
|
||||
strokeDasharray: "4 4",
|
||||
opacity: active ? 0.75 : 0.22,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Skill-to-Skill real markdown link edges
|
||||
const seenCrossPairs = new Set<string>();
|
||||
for (const e of SKILL_GRAPH.edges) {
|
||||
const active = edgeHighlight(e.source, e.target);
|
||||
|
||||
if (e.kind === "orchestrates") {
|
||||
edges.push({
|
||||
id: `${e.source}->${e.target}`,
|
||||
source: e.source,
|
||||
sourceHandle: "right",
|
||||
target: e.target,
|
||||
targetHandle: "left",
|
||||
type: "default",
|
||||
label: active ? `${e.count}회` : undefined,
|
||||
labelStyle: {
|
||||
fontSize: 10,
|
||||
fontFamily: "var(--font-mono, monospace)",
|
||||
fill: "var(--foreground)",
|
||||
fontWeight: 600,
|
||||
},
|
||||
labelBgStyle: {
|
||||
fill: "var(--card)",
|
||||
stroke: "var(--border)",
|
||||
strokeWidth: 1,
|
||||
},
|
||||
labelBgPadding: [5, 2],
|
||||
labelBgBorderRadius: 999,
|
||||
markerEnd: {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 14,
|
||||
height: 14,
|
||||
color: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
},
|
||||
style: {
|
||||
stroke: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
strokeWidth: active ? 2 : 1.3,
|
||||
opacity: active ? 0.92 : 0.26,
|
||||
},
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
if (e.kind === "feedback") {
|
||||
edges.push({
|
||||
id: `${e.source}->${e.target}`,
|
||||
source: e.source,
|
||||
sourceHandle: "bottom",
|
||||
target: e.target,
|
||||
targetHandle: "top",
|
||||
type: "straight",
|
||||
label: active ? "마찰 시" : undefined,
|
||||
labelStyle: {
|
||||
fontSize: 10,
|
||||
fill: "var(--muted-foreground)",
|
||||
},
|
||||
labelBgStyle: {
|
||||
fill: "var(--card)",
|
||||
stroke: "var(--border)",
|
||||
strokeWidth: 1,
|
||||
},
|
||||
labelBgPadding: [6, 2],
|
||||
labelBgBorderRadius: 999,
|
||||
markerEnd: {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 12,
|
||||
height: 12,
|
||||
color: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
},
|
||||
style: {
|
||||
stroke: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
strokeWidth: active ? 1.6 : 1.1,
|
||||
strokeDasharray: "4 4",
|
||||
opacity: active ? 0.8 : 0.28,
|
||||
},
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// Same-layer cross-reference (between reference skills): deduplicate bidirectional pairs
|
||||
const pairKey = [e.source, e.target].sort().join("<->");
|
||||
if (seenCrossPairs.has(pairKey)) continue;
|
||||
seenCrossPairs.add(pairKey);
|
||||
|
||||
const reverse = SKILL_GRAPH.edges.find((x) => x.source === e.target && x.target === e.source);
|
||||
const idxA = refIndexBySkill.get(e.source) ?? 0;
|
||||
const idxB = refIndexBySkill.get(e.target) ?? 0;
|
||||
const isAdjacent = Math.abs(idxA - idxB) === 1;
|
||||
|
||||
// Non-adjacent single-link cross-references only appear when one endpoint is focused to avoid visual clutter
|
||||
if (!isAdjacent && !active) continue;
|
||||
|
||||
const upper = idxA < idxB ? e.source : e.target;
|
||||
const lower = idxA < idxB ? e.target : e.source;
|
||||
const countLabel = reverse ? `상호 ${e.count + reverse.count}회` : `참조 ${e.count}회`;
|
||||
|
||||
edges.push({
|
||||
id: `cross:${pairKey}`,
|
||||
source: upper,
|
||||
sourceHandle: isAdjacent ? "bottom" : "right",
|
||||
target: lower,
|
||||
targetHandle: isAdjacent ? "top" : "right",
|
||||
type: isAdjacent ? "straight" : "smoothstep",
|
||||
label: active ? countLabel : undefined,
|
||||
labelStyle: {
|
||||
fontSize: 10,
|
||||
fontFamily: "var(--font-mono, monospace)",
|
||||
fill: "var(--foreground)",
|
||||
},
|
||||
labelBgStyle: {
|
||||
fill: "var(--card)",
|
||||
stroke: "var(--border)",
|
||||
strokeWidth: 1,
|
||||
},
|
||||
labelBgPadding: [5, 2],
|
||||
labelBgBorderRadius: 999,
|
||||
markerEnd: {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 11,
|
||||
height: 11,
|
||||
color: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
},
|
||||
markerStart: reverse
|
||||
? {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 11,
|
||||
height: 11,
|
||||
color: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
}
|
||||
: undefined,
|
||||
style: {
|
||||
stroke: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
strokeWidth: active ? 1.6 : 1.1,
|
||||
strokeDasharray: "3 3",
|
||||
opacity: active ? 0.85 : 0.28,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Reference skill -> Glossary leaf
|
||||
for (const leaf of SKILL_GRAPH.glossaryLeaves) {
|
||||
const active = edgeHighlight(leaf.skillName, leaf.id);
|
||||
edges.push({
|
||||
id: `${leaf.skillName}->${leaf.id}`,
|
||||
source: leaf.skillName,
|
||||
sourceHandle: "right",
|
||||
target: leaf.id,
|
||||
targetHandle: "left",
|
||||
type: "default",
|
||||
markerEnd: {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 13,
|
||||
height: 13,
|
||||
color: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
},
|
||||
style: {
|
||||
stroke: active ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
strokeWidth: active ? 1.8 : 1.2,
|
||||
opacity: active ? 0.9 : 0.26,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return { nodes, edges, canvasHeight: Math.max(460, totalHeight) };
|
||||
}
|
||||
|
||||
function NodeInspector({
|
||||
selectedId,
|
||||
onSelect,
|
||||
}: {
|
||||
selectedId: string;
|
||||
onSelect: (id: string) => void;
|
||||
}) {
|
||||
const [copiedId, setCopiedId] = useState<string | null>(null);
|
||||
const copied = copiedId === selectedId;
|
||||
|
||||
if (selectedId === PLUGIN_NODE_ID) {
|
||||
return (
|
||||
<div className="border-border/70 bg-muted/20 flex flex-col gap-4 border-t px-5 py-4 sm:px-6">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<div className="space-y-1">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Badge variant="default" className="text-[0.6875rem]">
|
||||
단일 공개 플러그인
|
||||
</Badge>
|
||||
<span className="text-foreground font-mono text-sm font-semibold">
|
||||
{PLUGIN.name}@{MARKET.name} v{PLUGIN.version}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-muted-foreground text-xs leading-relaxed break-keep">
|
||||
{PLUGIN.description} 좌측의 오케스트레이터에서 작업 절차를 고르고, 중앙의 기준 스킬과
|
||||
우측 최하위 용어집을 단방향으로 참조합니다.
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
to="/glossary"
|
||||
className={buttonVariants({ variant: "outline", size: "sm", className: "h-8 gap-1.5" })}
|
||||
>
|
||||
<SystemIcon name="book" className="size-3.5" />
|
||||
<span>통합 용어집 보기</span>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (selectedId.startsWith("glossary:")) {
|
||||
const leaf: SkillGlossaryLeaf | undefined = SKILL_GRAPH.glossaryLeaves.find(
|
||||
(l) => l.id === selectedId,
|
||||
);
|
||||
if (!leaf) return null;
|
||||
const owner = findSkill(leaf.skillName);
|
||||
|
||||
return (
|
||||
<div className="border-border/70 bg-muted/20 flex flex-col gap-3 border-t px-5 py-4 sm:px-6">
|
||||
<div className="flex flex-wrap items-start justify-between gap-3">
|
||||
<div className="space-y-1">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Badge variant="secondary" className="text-[0.6875rem]">
|
||||
3계층 · 최하위 용어집
|
||||
</Badge>
|
||||
<h3 className="text-foreground text-sm font-semibold">{leaf.title}</h3>
|
||||
<span className="text-muted-foreground font-mono text-xs tabular-nums">
|
||||
용어 {leaf.termCount}개
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-muted-foreground text-xs leading-relaxed break-keep">
|
||||
다른 폴더나 스킬을 일절 참조하지 않는 최하위 계층입니다(외부 링크 0개). 사이트의 통합
|
||||
용어집(`/glossary`)과 본문 용어 팝오버에 자동 반영됩니다.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{owner && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-8 gap-1.5 text-xs"
|
||||
onClick={() => onSelect(owner.name)}
|
||||
>
|
||||
<span>← {owner.name}</span>
|
||||
</Button>
|
||||
)}
|
||||
<Link
|
||||
to={leaf.href}
|
||||
className={buttonVariants({
|
||||
variant: "default",
|
||||
size: "sm",
|
||||
className: "h-8 gap-1.5",
|
||||
})}
|
||||
>
|
||||
<span>용어집 열기</span>
|
||||
<SystemIcon name="arrowRight" className="size-3.5" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const skill: SkillEntry | undefined = findSkill(selectedId);
|
||||
if (!skill) return null;
|
||||
|
||||
const outbound = SKILL_GRAPH.edges.filter((e) => e.source === skill.name);
|
||||
const inbound = SKILL_GRAPH.edges.filter((e) => e.target === skill.name);
|
||||
const glossary = SKILL_GRAPH.glossaryLeaves.find((l) => l.skillName === skill.name);
|
||||
const layer = SKILL_GRAPH.layerOf[skill.name];
|
||||
|
||||
const repoSlug = MARKET.repository.replace(/^https:\/\/github\.com\//, "");
|
||||
const installCmd =
|
||||
skill.invocation === "explicit"
|
||||
? `npx skills add ${repoSlug} --skill ${skill.name} -g`
|
||||
: `npx skills add ${repoSlug} --skill ${skill.name}`;
|
||||
|
||||
const childDocs = skill.playbooks.length > 0 ? skill.playbooks : skill.references.slice(0, 8);
|
||||
const childHeading =
|
||||
skill.playbooks.length > 0
|
||||
? `플레이북 (${skill.playbooks.length})`
|
||||
: skill.references.length > 0
|
||||
? `주요 레퍼런스 (${skill.references.length})`
|
||||
: null;
|
||||
|
||||
async function copyInstall() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(installCmd);
|
||||
setCopiedId(selectedId);
|
||||
window.setTimeout(() => {
|
||||
setCopiedId((prev) => (prev === selectedId ? null : prev));
|
||||
}, 1800);
|
||||
} catch {
|
||||
// 클립보드 권한 미허용 시 무시
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="border-border/70 bg-muted/20 flex flex-col gap-4 border-t px-5 py-4 sm:px-6">
|
||||
<div className="flex flex-wrap items-start justify-between gap-4">
|
||||
<div className="min-w-0 flex-1 space-y-1.5">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Badge
|
||||
variant={layer === "orchestrator" ? "default" : "secondary"}
|
||||
className="text-[0.6875rem]"
|
||||
>
|
||||
{layer === "orchestrator"
|
||||
? "1계층 · 오케스트레이터"
|
||||
: layer === "utility"
|
||||
? "명시 호출 유틸리티"
|
||||
: `2계층 · ${skill.category} 기준`}
|
||||
</Badge>
|
||||
<h3 className="text-foreground text-sm font-semibold tracking-tight">{skill.title}</h3>
|
||||
<code className="text-muted-foreground font-mono text-xs">
|
||||
/{PLUGIN.name}:{skill.name}
|
||||
</code>
|
||||
</div>
|
||||
<p className="text-foreground/80 max-w-3xl text-xs leading-relaxed break-keep">
|
||||
{skill.description}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex shrink-0 flex-wrap items-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => void copyInstall()}
|
||||
className="h-8 gap-1.5 font-mono text-xs"
|
||||
>
|
||||
<SystemIcon name={copied ? "check" : "copy"} className="size-3.5" />
|
||||
<span>{copied ? "명령 복사됨" : "npx skills 복사"}</span>
|
||||
</Button>
|
||||
<Link
|
||||
to={skill.href}
|
||||
className={buttonVariants({ variant: "default", size: "sm", className: "h-8 gap-1.5" })}
|
||||
>
|
||||
<span>스킬북 열기</span>
|
||||
<SystemIcon name="arrowRight" className="size-3.5" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(outbound.length > 0 || inbound.length > 0 || glossary) && (
|
||||
<div className="flex flex-wrap items-center gap-x-5 gap-y-2 text-xs">
|
||||
{inbound.length > 0 && (
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="text-muted-foreground text-[11px] font-medium">상위·참조 진입</span>
|
||||
{inbound.map((e) => (
|
||||
<button
|
||||
key={`in-${e.source}`}
|
||||
type="button"
|
||||
onClick={() => onSelect(e.source)}
|
||||
className="border-border bg-card hover:border-foreground/50 inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 font-mono text-[11px] transition-colors"
|
||||
>
|
||||
<span>{e.source}</span>
|
||||
<span className="text-muted-foreground tabular-nums">
|
||||
{e.kind === "feedback" ? "마찰 시" : `${e.count}`}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{outbound.length > 0 && (
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="text-muted-foreground text-[11px] font-medium">하위·연결 스킬</span>
|
||||
{outbound.map((e) => (
|
||||
<button
|
||||
key={`out-${e.target}`}
|
||||
type="button"
|
||||
onClick={() => onSelect(e.target)}
|
||||
className="border-border bg-card hover:border-foreground/50 inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 font-mono text-[11px] transition-colors"
|
||||
>
|
||||
<span>→ {e.target}</span>
|
||||
<span className="text-muted-foreground tabular-nums">
|
||||
{e.kind === "feedback" ? "마찰 시" : `${e.count}`}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{glossary && (
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="text-muted-foreground text-[11px] font-medium">최하위 용어집</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onSelect(glossary.id)}
|
||||
className="border-border bg-card hover:border-foreground/50 inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 font-mono text-[11px] transition-colors"
|
||||
>
|
||||
<SystemIcon name="book" className="size-3" />
|
||||
<span>{glossary.title}</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{childHeading && childDocs.length > 0 && (
|
||||
<div className="space-y-1.5">
|
||||
<div className="text-muted-foreground text-[11px] font-medium">{childHeading}</div>
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{childDocs.map((doc) => (
|
||||
<Link
|
||||
key={doc.href}
|
||||
to={doc.href}
|
||||
className="border-border/80 bg-card hover:border-foreground/45 hover:text-foreground text-foreground/85 inline-flex items-center gap-1 rounded-lg border px-2.5 py-1 text-xs transition-colors"
|
||||
>
|
||||
<span>{doc.title}</span>
|
||||
</Link>
|
||||
))}
|
||||
{skill.references.length > 8 && (
|
||||
<Link
|
||||
to={skill.href}
|
||||
className="text-muted-foreground hover:text-foreground inline-flex items-center px-2 py-1 text-xs font-medium"
|
||||
>
|
||||
+{skill.references.length - 8}편 더 보기 →
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function MobileHierarchyList() {
|
||||
const orchestrators = SKILLS.filter((s) => SKILL_GRAPH.layerOf[s.name] === "orchestrator");
|
||||
const references = SKILLS.filter((s) => SKILL_GRAPH.layerOf[s.name] === "reference");
|
||||
const utilities = SKILLS.filter((s) => SKILL_GRAPH.layerOf[s.name] === "utility");
|
||||
|
||||
const groups: {
|
||||
step: string;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
items: {
|
||||
key: string;
|
||||
name: string;
|
||||
label: string;
|
||||
href: string;
|
||||
meta: string;
|
||||
links: string[];
|
||||
}[];
|
||||
}[] = [
|
||||
{
|
||||
step: "1계층",
|
||||
title: "오케스트레이터",
|
||||
subtitle: "모든 playbooks/* 절차의 앞문",
|
||||
items: orchestrators.map((s) => ({
|
||||
key: s.name,
|
||||
name: s.name,
|
||||
label: s.title,
|
||||
href: s.href,
|
||||
meta: `플레이북 ${s.playbooks.length}`,
|
||||
links: SKILL_GRAPH.edges
|
||||
.filter((e) => e.source === s.name && e.kind === "orchestrates")
|
||||
.map((e) => e.target),
|
||||
})),
|
||||
},
|
||||
{
|
||||
step: "2계층",
|
||||
title: "도메인 기준 스킬",
|
||||
subtitle: "references/* 규칙과 계약",
|
||||
items: references.map((s) => ({
|
||||
key: s.name,
|
||||
name: s.name,
|
||||
label: s.title,
|
||||
href: s.href,
|
||||
meta: `레퍼런스 ${s.references.length}`,
|
||||
links: [
|
||||
...SKILL_GRAPH.edges
|
||||
.filter((e) => e.source === s.name && e.kind === "references")
|
||||
.map((e) => e.target),
|
||||
...(s.glossaryDocs.length > 0 ? ["glossary"] : []),
|
||||
],
|
||||
})),
|
||||
},
|
||||
{
|
||||
step: "3계층",
|
||||
title: "최하위 용어집",
|
||||
subtitle: "glossary/index.md · 외부 링크 0",
|
||||
items: SKILL_GRAPH.glossaryLeaves.map((leaf) => ({
|
||||
key: leaf.id,
|
||||
name: `${leaf.skillName}/glossary`,
|
||||
label: leaf.title,
|
||||
href: leaf.href,
|
||||
meta: `용어 ${leaf.termCount}개`,
|
||||
links: [],
|
||||
})),
|
||||
},
|
||||
...(utilities.length > 0
|
||||
? [
|
||||
{
|
||||
step: "유틸",
|
||||
title: "명시 호출 유틸리티",
|
||||
subtitle: "마찰 발생 시 수동 호출",
|
||||
items: utilities.map((s) => ({
|
||||
key: s.name,
|
||||
name: s.name,
|
||||
label: s.title,
|
||||
href: s.href,
|
||||
meta: "단일 SKILL.md",
|
||||
links: [],
|
||||
})),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="space-y-4 lg:hidden">
|
||||
{groups.map((group) => (
|
||||
<div
|
||||
key={group.step}
|
||||
className="corner-squircle border-border bg-card overflow-hidden rounded-2xl border"
|
||||
>
|
||||
<div className="border-border/70 bg-muted/30 flex items-center justify-between gap-2 border-b px-4 py-2.5">
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant="secondary" className="font-mono text-[10px]">
|
||||
{group.step}
|
||||
</Badge>
|
||||
<span className="text-foreground text-xs font-semibold">{group.title}</span>
|
||||
</div>
|
||||
<span className="text-muted-foreground font-mono text-[10px]">{group.subtitle}</span>
|
||||
</div>
|
||||
|
||||
<ul className="divide-border/60 divide-y">
|
||||
{group.items.map((item) => (
|
||||
<li key={item.key}>
|
||||
<Link
|
||||
to={item.href}
|
||||
className="hover:bg-muted/35 flex flex-col gap-1.5 px-4 py-3 transition-colors"
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span className="text-foreground text-sm font-medium">{item.label}</span>
|
||||
<span className="text-muted-foreground shrink-0 font-mono text-[11px] tabular-nums">
|
||||
{item.meta}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
<span className="text-muted-foreground font-mono text-[11px]">{item.name}</span>
|
||||
{item.links.map((target) => (
|
||||
<span
|
||||
key={target}
|
||||
className="bg-muted text-muted-foreground rounded-full px-2 py-0.5 font-mono text-[10px]"
|
||||
>
|
||||
→ {target}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const emptySubscribe = () => () => {};
|
||||
|
||||
export function SkillHierarchyMap() {
|
||||
const defaultSkill =
|
||||
SKILLS.find((s) => SKILL_GRAPH.layerOf[s.name] === "orchestrator")?.name ??
|
||||
SKILLS[0]?.name ??
|
||||
PLUGIN_NODE_ID;
|
||||
const [selectedId, setSelectedId] = useState<string>(defaultSkill);
|
||||
const [hoveredId, setHoveredId] = useState<string | null>(null);
|
||||
const mounted = useSyncExternalStore(
|
||||
emptySubscribe,
|
||||
() => true,
|
||||
() => false,
|
||||
);
|
||||
|
||||
const layout = useMemo(() => buildFlowGraph(selectedId, hoveredId), [selectedId, hoveredId]);
|
||||
|
||||
const handleNodeClick: NodeMouseHandler<SkillMapNode> = (_event, node) => {
|
||||
setSelectedId(node.id);
|
||||
};
|
||||
|
||||
const handleNodeMouseEnter: NodeMouseHandler<SkillMapNode> = (_event, node) => {
|
||||
setHoveredId(node.id);
|
||||
};
|
||||
|
||||
const handleNodeMouseLeave: NodeMouseHandler<SkillMapNode> = () => {
|
||||
setHoveredId(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<section aria-label="스킬 계층 관계 맵" className="space-y-3">
|
||||
<div className="flex flex-wrap items-end justify-between gap-2">
|
||||
<div className="space-y-1">
|
||||
<h2 className="text-foreground text-lg font-semibold tracking-tight">
|
||||
스킬 계층 · 연결 구조
|
||||
</h2>
|
||||
<p className="text-muted-foreground text-xs break-keep">
|
||||
왼쪽에서 오른쪽으로 흐르는 3계층 단방향 참조 구조입니다. 실제 스킬 문서 링크에서 자동
|
||||
추출됩니다.
|
||||
</p>
|
||||
</div>
|
||||
<span className="text-muted-foreground hidden text-[11px] lg:inline">
|
||||
노드를 클릭하면 연결 경로와 하위 문서가 표시됩니다
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* 데스크탑: 좌→우 React Flow 인터랙티브 맵 */}
|
||||
<div className="corner-squircle border-border bg-card hidden overflow-hidden rounded-[24px] border shadow-xs lg:block">
|
||||
<div className="border-border/70 bg-muted/25 grid grid-cols-4 border-b px-5 py-2.5">
|
||||
{LAYER_COLUMNS.map((col, idx) => (
|
||||
<div key={col.step} className="flex items-center gap-2">
|
||||
<span className="bg-background border-border text-muted-foreground inline-flex size-5 items-center justify-center rounded-full border font-mono text-[10px] font-semibold">
|
||||
{col.step}
|
||||
</span>
|
||||
<div className="min-w-0">
|
||||
<div className="text-foreground text-xs font-semibold">{col.label}</div>
|
||||
<div className="text-muted-foreground truncate font-mono text-[10px]">
|
||||
{col.sub}
|
||||
</div>
|
||||
</div>
|
||||
{idx < LAYER_COLUMNS.length - 1 && (
|
||||
<SystemIcon
|
||||
name="chevronRight"
|
||||
className="text-muted-foreground/50 mr-3 ml-auto size-3.5 shrink-0"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="relative w-full" style={{ height: `${layout.canvasHeight}px` }}>
|
||||
{mounted ? (
|
||||
<ReactFlow<SkillMapNode>
|
||||
className="skill-map-flow"
|
||||
nodes={layout.nodes}
|
||||
edges={layout.edges}
|
||||
nodeTypes={NODE_TYPES}
|
||||
onNodeClick={handleNodeClick}
|
||||
onNodeMouseEnter={handleNodeMouseEnter}
|
||||
onNodeMouseLeave={handleNodeMouseLeave}
|
||||
fitView
|
||||
fitViewOptions={{ padding: 0.08, maxZoom: 1 }}
|
||||
minZoom={0.65}
|
||||
maxZoom={1.35}
|
||||
nodesDraggable={false}
|
||||
nodesConnectable={false}
|
||||
elementsSelectable={false}
|
||||
zoomOnScroll={false}
|
||||
panOnScroll={false}
|
||||
preventScrolling={false}
|
||||
zoomOnDoubleClick={false}
|
||||
>
|
||||
<Background
|
||||
variant={BackgroundVariant.Dots}
|
||||
gap={20}
|
||||
size={1}
|
||||
color="color-mix(in oklab, var(--muted-foreground) 22%, transparent)"
|
||||
/>
|
||||
<Controls showInteractive={false} position="bottom-left" />
|
||||
</ReactFlow>
|
||||
) : (
|
||||
<div className="grid h-full grid-cols-4 gap-4 p-6">
|
||||
{LAYER_COLUMNS.map((col) => (
|
||||
<div
|
||||
key={col.step}
|
||||
className="border-border/50 bg-muted/20 flex flex-col justify-center rounded-2xl border border-dashed p-4 text-center"
|
||||
>
|
||||
<div className="text-foreground text-xs font-semibold">{col.label}</div>
|
||||
<div className="text-muted-foreground mt-1 font-mono text-[11px]">{col.sub}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<NodeInspector selectedId={selectedId} onSelect={setSelectedId} />
|
||||
</div>
|
||||
|
||||
{/* 모바일: 계층별 세로 리스트 */}
|
||||
<MobileHierarchyList />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
import { Handle, Position, type Node, type NodeProps } from "@xyflow/react";
|
||||
import { SystemIcon } from "@goraebap/ui-react/icons";
|
||||
import type { SkillEntry, SkillGlossaryLeaf, SkillLayer } from "@/entities/plugin-catalog";
|
||||
|
||||
export interface PluginNodeData extends Record<string, unknown> {
|
||||
kind: "plugin";
|
||||
name: string;
|
||||
marketName: string;
|
||||
version: string;
|
||||
logoUrl: string;
|
||||
skillCount: number;
|
||||
totalDocs: number;
|
||||
active: boolean;
|
||||
dimmed: boolean;
|
||||
}
|
||||
|
||||
export interface SkillNodeData extends Record<string, unknown> {
|
||||
kind: "skill";
|
||||
skill: SkillEntry;
|
||||
layer: SkillLayer;
|
||||
active: boolean;
|
||||
connected: boolean;
|
||||
dimmed: boolean;
|
||||
}
|
||||
|
||||
export interface GlossaryNodeData extends Record<string, unknown> {
|
||||
kind: "glossary";
|
||||
leaf: SkillGlossaryLeaf;
|
||||
active: boolean;
|
||||
connected: boolean;
|
||||
dimmed: boolean;
|
||||
}
|
||||
|
||||
export type SkillMapNode =
|
||||
| Node<PluginNodeData, "pluginNode">
|
||||
| Node<SkillNodeData, "skillNode">
|
||||
| Node<GlossaryNodeData, "glossaryNode">;
|
||||
|
||||
export function PluginMapNode({ data }: NodeProps<Node<PluginNodeData, "pluginNode">>) {
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
"corner-squircle bg-card flex w-[184px] flex-col gap-2.5 rounded-2xl border px-3.5 py-3 text-left transition-all duration-200",
|
||||
data.active
|
||||
? "border-foreground ring-foreground/20 shadow-sm ring-2"
|
||||
: "border-border hover:border-foreground/40 shadow-xs",
|
||||
data.dimmed ? "opacity-45" : "opacity-100",
|
||||
].join(" ")}
|
||||
>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<img
|
||||
src={data.logoUrl}
|
||||
alt={`${data.name} 로고`}
|
||||
width={28}
|
||||
height={28}
|
||||
className="corner-squircle ring-border/60 size-7 shrink-0 rounded-lg ring-1"
|
||||
/>
|
||||
<div className="min-w-0">
|
||||
<div className="text-foreground truncate font-mono text-xs font-semibold">
|
||||
{data.name}@{data.marketName}
|
||||
</div>
|
||||
<div className="text-muted-foreground truncate font-mono text-[10px] whitespace-nowrap tabular-nums">
|
||||
v{data.version} · 통합 패키지
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-muted-foreground border-border/60 flex items-center justify-between border-t pt-2 font-mono text-[10px] tabular-nums">
|
||||
<span>공개 스킬 {data.skillCount}</span>
|
||||
<span>문서 {data.totalDocs}</span>
|
||||
</div>
|
||||
|
||||
<Handle type="source" position={Position.Right} id="right" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SkillMapNodeCard({ data }: NodeProps<Node<SkillNodeData, "skillNode">>) {
|
||||
const { skill, layer, active, connected, dimmed } = data;
|
||||
const isOrchestrator = layer === "orchestrator";
|
||||
const isUtility = layer === "utility";
|
||||
|
||||
const countBadge =
|
||||
skill.playbooks.length > 0
|
||||
? `플레이북 ${skill.playbooks.length}`
|
||||
: skill.references.length > 0
|
||||
? `레퍼런스 ${skill.references.length}`
|
||||
: "단일 SKILL";
|
||||
|
||||
const roleLabel = isOrchestrator ? "오케스트레이터" : isUtility ? "명시 호출" : skill.category;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
"corner-squircle flex w-[220px] flex-col gap-1.5 rounded-2xl border px-3.5 py-2.5 text-left transition-all duration-200",
|
||||
isOrchestrator ? "bg-card" : isUtility ? "bg-muted/35 border-dashed" : "bg-card",
|
||||
active
|
||||
? "border-foreground ring-foreground/20 shadow-sm ring-2"
|
||||
: connected
|
||||
? "border-foreground/55 shadow-xs"
|
||||
: "border-border hover:border-foreground/40 shadow-xs",
|
||||
dimmed ? "opacity-45" : "opacity-100",
|
||||
].join(" ")}
|
||||
>
|
||||
<Handle type="target" position={Position.Left} id="left" />
|
||||
<Handle type="target" position={Position.Top} id="top" />
|
||||
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span
|
||||
className={[
|
||||
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium",
|
||||
isOrchestrator ? "bg-foreground text-background" : "bg-muted text-muted-foreground",
|
||||
].join(" ")}
|
||||
>
|
||||
<SystemIcon
|
||||
name={isOrchestrator ? "rocket" : isUtility ? "code" : "book"}
|
||||
className="size-2.5"
|
||||
/>
|
||||
{roleLabel}
|
||||
</span>
|
||||
<span className="text-muted-foreground font-mono text-[10px] tabular-nums">
|
||||
{countBadge}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="min-w-0">
|
||||
<div className="text-foreground truncate text-[13px] font-semibold tracking-tight">
|
||||
{skill.title.replace(/\s*\([^)]*\)$/, "")}
|
||||
</div>
|
||||
<div className="text-muted-foreground truncate font-mono text-[10px]">{skill.name}</div>
|
||||
</div>
|
||||
|
||||
<Handle type="source" position={Position.Right} id="right" />
|
||||
<Handle type="source" position={Position.Bottom} id="bottom" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function GlossaryMapNode({ data }: NodeProps<Node<GlossaryNodeData, "glossaryNode">>) {
|
||||
const { leaf, active, connected, dimmed } = data;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
"corner-squircle bg-muted/35 flex w-[178px] items-center justify-between gap-2 rounded-2xl border px-3 py-2.5 text-left transition-all duration-200",
|
||||
active
|
||||
? "border-foreground ring-foreground/20 bg-card shadow-sm ring-2"
|
||||
: connected
|
||||
? "border-foreground/55 bg-card shadow-xs"
|
||||
: "border-border/80 hover:border-foreground/40",
|
||||
dimmed ? "opacity-45" : "opacity-100",
|
||||
].join(" ")}
|
||||
>
|
||||
<Handle type="target" position={Position.Left} id="left" />
|
||||
|
||||
<div className="min-w-0">
|
||||
<div className="text-foreground flex items-center gap-1.5 text-xs font-semibold">
|
||||
<SystemIcon name="book" className="text-muted-foreground size-3.5 shrink-0" />
|
||||
<span className="truncate">{leaf.title}</span>
|
||||
</div>
|
||||
<div className="text-muted-foreground mt-0.5 font-mono text-[10px] tabular-nums">
|
||||
용어 {leaf.termCount}개 · 외부 링크 0
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
.skill-map-flow {
|
||||
--xy-background-color: transparent;
|
||||
--xy-node-background-color: transparent;
|
||||
--xy-node-border: none;
|
||||
--xy-node-boxshadow-hover: none;
|
||||
--xy-node-boxshadow-selected: none;
|
||||
--xy-edge-stroke: color-mix(in oklab, var(--muted-foreground) 45%, transparent);
|
||||
--xy-edge-stroke-selected: var(--foreground);
|
||||
--xy-controls-button-background-color: var(--card);
|
||||
--xy-controls-button-background-color-hover: var(--muted);
|
||||
--xy-controls-button-color: var(--foreground);
|
||||
--xy-controls-button-border-color: var(--border);
|
||||
--xy-attribution-background-color: transparent;
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__node {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__handle {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border: 1.5px solid var(--card);
|
||||
background: color-mix(in oklab, var(--muted-foreground) 65%, transparent);
|
||||
transition:
|
||||
background-color 180ms ease,
|
||||
transform 180ms ease;
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__node:hover .react-flow__handle,
|
||||
.skill-map-flow .react-flow__node.selected .react-flow__handle {
|
||||
background: var(--foreground);
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__edge-path {
|
||||
transition:
|
||||
stroke 180ms ease,
|
||||
stroke-width 180ms ease,
|
||||
opacity 180ms ease;
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__controls {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__attribution {
|
||||
font-size: 10px;
|
||||
color: color-mix(in oklab, var(--muted-foreground) 65%, transparent);
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
.skill-map-flow .react-flow__attribution a {
|
||||
color: inherit;
|
||||
}
|
||||
Generated
+86
-21
@@ -9,39 +9,18 @@ catalogs:
|
||||
'@angular/aria':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/build':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/cdk':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/cli':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/common':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/compiler':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/compiler-cli':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/core':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/forms':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@angular/platform-browser':
|
||||
specifier: ^22.3.0
|
||||
version: 22.3.0
|
||||
'@base-ui/react':
|
||||
specifier: ^1.9.0
|
||||
version: 1.9.0
|
||||
'@tailwindcss/postcss':
|
||||
specifier: ^4.3.5
|
||||
version: 4.3.5
|
||||
'@tailwindcss/vite':
|
||||
specifier: ^4.3.5
|
||||
version: 4.3.5
|
||||
@@ -219,6 +198,9 @@ importers:
|
||||
'@tanstack/react-router':
|
||||
specifier: 'catalog:'
|
||||
version: 1.170.46([email protected]([email protected]))([email protected])
|
||||
'@xyflow/react':
|
||||
specifier: ^13.0.3
|
||||
version: 13.0.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))
|
||||
lenis:
|
||||
specifier: ^1.3.27
|
||||
version: 1.3.27([email protected])
|
||||
@@ -2902,6 +2884,24 @@ packages:
|
||||
oxc-transform-react:
|
||||
optional: true
|
||||
|
||||
'@xyflow/[email protected]':
|
||||
resolution: {integrity: sha512-deKfJUYe1aAMd2j6g/LL+5YRbqIeebOXNfwHhdu6qk4L+h7XRY9UcBgqVSYT8WyXSX+3k6ZGr/hnfx7hLfgUtA==}
|
||||
engines: {node: '>=20'}
|
||||
peerDependencies:
|
||||
'@types/react': '>=18'
|
||||
'@types/react-dom': '>=18'
|
||||
react: '>=18'
|
||||
react-dom: '>=18'
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
optional: true
|
||||
'@types/react-dom':
|
||||
optional: true
|
||||
|
||||
'@xyflow/[email protected]':
|
||||
resolution: {integrity: sha512-0vMyv9EbnV9lNe15USaIbBxJVuLF2awbzZNT+foIOd59Mpc2rw04oaozoms1TaSetTa376aHl7mJ/YNKqIoqJA==}
|
||||
engines: {node: '>=20'}
|
||||
|
||||
'@yuku-toolchain/[email protected]':
|
||||
resolution: {integrity: sha512-A3v83rNyHWlnJeeMBsWggZ+RZDP2BEMHIiMk+j23LqtVch24MXwg8veflkQgZ2GtCtZOxcG+NkztnsSUS4rWEQ==}
|
||||
cpu: [arm64]
|
||||
@@ -3099,6 +3099,9 @@ packages:
|
||||
resolution: {integrity: sha512-Ec2Z7wpcKBiMpR7DxteoqS/sq5G5d2A4fpxzPv6+fD7xNNdrTghn7L11YwV5EN1B3i72Erc3XVT5FkWIDx90+A==}
|
||||
engines: {node: '>= 22.22'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -4725,6 +4728,11 @@ packages:
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-rRfjYv66HlG8896yPUDONgKzG5BxZD1nV9U6rkm+7VCuvQc903C4MjcoZR4zPw53IKSOX9wMQVpA1IAbRtzQ7w==}
|
||||
peerDependencies:
|
||||
react: ^17.0.0 || ^18.0.0 || ^19.0.0 || ^0.0.0-experimental
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-QetiKtZWE9Uaw/pM/SYNv6WPYOTRnSJ2puL0GgwkmUFMIwiY0dtjH1W4B7DOVXVNQM0ZOClGpH/heOfBSzWeiA==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -5546,6 +5554,24 @@ packages:
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==}
|
||||
engines: {node: '>=12.20.0'}
|
||||
peerDependencies:
|
||||
'@types/react': '>=18.0.0'
|
||||
immer: '>=9.0.6'
|
||||
react: '>=18.0.0'
|
||||
use-sync-external-store: '>=1.2.0'
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
optional: true
|
||||
immer:
|
||||
optional: true
|
||||
react:
|
||||
optional: true
|
||||
use-sync-external-store:
|
||||
optional: true
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
|
||||
|
||||
@@ -7757,6 +7783,33 @@ snapshots:
|
||||
'@rolldown/pluginutils': 1.1.1
|
||||
vite: 8.3.8(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])
|
||||
|
||||
'@xyflow/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))':
|
||||
dependencies:
|
||||
'@xyflow/system': 1.0.1
|
||||
classcat: 5.0.5
|
||||
react: 19.3.1
|
||||
react-compiler-runtime: 1.0.0([email protected])
|
||||
react-dom: 19.3.1([email protected])
|
||||
zustand: 5.1.0(@types/[email protected])([email protected])([email protected]([email protected]))
|
||||
optionalDependencies:
|
||||
'@types/react': 19.3.0
|
||||
'@types/react-dom': 19.3.0(@types/[email protected])
|
||||
transitivePeerDependencies:
|
||||
- immer
|
||||
- use-sync-external-store
|
||||
|
||||
'@xyflow/[email protected]':
|
||||
dependencies:
|
||||
'@types/d3-drag': 3.0.7
|
||||
'@types/d3-interpolate': 3.0.4
|
||||
'@types/d3-selection': 3.0.12
|
||||
'@types/d3-transition': 3.0.9
|
||||
'@types/d3-zoom': 3.0.9
|
||||
d3-drag: 3.0.1
|
||||
d3-interpolate: 3.0.2
|
||||
d3-selection: 3.0.1
|
||||
d3-zoom: 3.0.1
|
||||
|
||||
'@yuku-toolchain/[email protected]':
|
||||
optional: true
|
||||
|
||||
@@ -7926,6 +7979,8 @@ snapshots:
|
||||
dependencies:
|
||||
readdirp: 5.1.1
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
restore-cursor: 5.1.0
|
||||
@@ -9877,6 +9932,10 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]([email protected]):
|
||||
dependencies:
|
||||
react: 19.3.1
|
||||
|
||||
[email protected](@types/[email protected])([email protected]):
|
||||
dependencies:
|
||||
'@date-fns/tz': 1.5.0
|
||||
@@ -10707,4 +10766,10 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected](@types/[email protected])([email protected])([email protected]([email protected])):
|
||||
optionalDependencies:
|
||||
'@types/react': 19.3.0
|
||||
react: 19.3.1
|
||||
use-sync-external-store: 1.7.0([email protected])
|
||||
|
||||
[email protected]: {}
|
||||
Reference in new issue
Block a user