import path from "node:path"; import { exists } from "../fsx.ts"; import type { TargetAdapter, TargetContext } from "../types.ts"; import { anyExists, scopeRoot, skillDirActions } from "./common.ts"; /** * Windsurf — ~/.codeium/windsurf/skills/designpaca/ (전역) 또는 .windsurf/skills/designpaca/ (프로젝트). * Cascade 가 Agent Skills 규약(SKILL.md)을 네이티브로 읽는다. * * 예전 .windsurf/rules/designpaca.md 방식은 규칙 파일에 12,000자 상한이 있어서 * 25KB 짜리 실제 스킬이 아예 설치되지 못했다 — 네이티브 스킬 경로로 옮기며 풀렸다. * 스킬은 name/description 만 띄우고 본문은 필요할 때 열기 때문에 크기 제약이 없다. */ export const windsurf: TargetAdapter = { id: "windsurf", label: "Windsurf", hint: "~/.codeium/windsurf/skills/designpaca — SKILL.md 그대로 (전역 지원)", scopes: ["user", "project"], async detect(ctx: TargetContext) { return anyExists([ path.join(ctx.cwd, ".windsurf"), path.join(ctx.home, ".windsurf"), path.join(ctx.home, ".codeium"), ]); }, async plan(ctx: TargetContext) { const root = scopeRoot( ctx, [".codeium", "windsurf", "skills", "designpaca"], [".windsurf", "skills", "designpaca"], ); return { target: this.id, scope: ctx.scope, root, actions: skillDirActions(root, ctx.skill), alreadyInstalled: await exists(path.join(root, "SKILL.md")), }; }, };