feat(core): 어떤 하네스에서든 스킬을 발견하는 타깃 체계로 바꾼다
Some checks are pending
ci / build (push) Waiting to run

- ZCode(~/.zcode/skills) 타깃 추가
- 중립 경로 agents(~/.agents/skills · .agents/skills) 타깃 추가
- gemini-cli(.gemini/skills)·copilot(~/.copilot/skills · .github/skills) 타깃 추가
- Cursor·Windsurf 를 네이티브 스킬 경로로 전환 — 규칙 파일 12,000자 상한 때문에
  Windsurf 는 실제 스킬이 아예 설치되지 못했었다. 전역 설치도 가능해진다
- Antigravity 전역 경로를 공식 문서대로 ~/.gemini/antigravity-cli/skills 로 수정
This commit is contained in:
Yun Chan 2026-08-21 12:24:34 +09:00
parent 30dc6687dd
commit 8d02820fa5
14 changed files with 379 additions and 136 deletions

View file

@ -1,66 +1,42 @@
import path from "node:path";
import { exists } from "../fsx.ts";
import type { FileAction, TargetAdapter, TargetContext } from "../types.ts";
import { anyExists, referenceActions, rewriteRefPaths } from "./common.ts";
const REF_PREFIX = ".windsurf/rules/designpaca";
/** Windsurf 규칙 파일의 하드 상한. 넘으면 잘려서 조용히 망가진다. */
const WINDSURF_CHAR_LIMIT = 12_000;
import type { TargetAdapter, TargetContext } from "../types.ts";
import { anyExists, scopeRoot, skillDirActions } from "./common.ts";
/**
* Windsurf .windsurf/rules/designpaca.md.
* Cursor · (trigger/globs, .mdc ).
* Windsurf ~/.codeium/windsurf/skills/designpaca/ () .windsurf/skills/designpaca/ ().
* Cascade Agent Skills (SKILL.md) .
*
* trigger model_decision . always_on
* .
* .windsurf/rules/designpaca.md 12,000
* 25KB .
* name/description .
*/
export const windsurf: TargetAdapter = {
id: "windsurf",
label: "Windsurf",
hint: ".windsurf/rules/designpaca.md — 프로젝트 단위",
scopes: ["project"],
hint: "~/.codeium/windsurf/skills/designpaca — SKILL.md 그대로 (전역 지원)",
scopes: ["user", "project"],
async detect(ctx: TargetContext) {
return anyExists([
path.join(ctx.cwd, ".windsurf"),
path.join(ctx.cwd, ".windsurfrules"),
path.join(ctx.home, ".windsurf"),
path.join(ctx.home, ".codeium"),
]);
},
async plan(ctx: TargetContext) {
const rulesDir = path.join(ctx.cwd, ".windsurf", "rules");
const rule = path.join(rulesDir, "designpaca.md");
const refRoot = path.join(rulesDir, "designpaca");
const header = [
"---",
"trigger: model_decision",
`description: ${ctx.skill.description}`,
"---",
"",
].join("\n");
const body = header + rewriteRefPaths(ctx.skill.body, REF_PREFIX);
const actions: FileAction[] = [
{ kind: "write", path: rule, content: body },
...referenceActions(refRoot, ctx.skill),
];
const root = scopeRoot(
ctx,
[".codeium", "windsurf", "skills", "designpaca"],
[".windsurf", "skills", "designpaca"],
);
return {
target: this.id,
scope: ctx.scope,
root: rulesDir,
actions,
alreadyInstalled: await exists(rule),
// 상한을 넘으면 설치는 되지만 Windsurf 가 뒷부분을 버린다. 조용히 깨지느니 막는다.
...(body.length > WINDSURF_CHAR_LIMIT
? {
blocked: `규칙 본문이 ${body.length}자로 Windsurf 상한(${WINDSURF_CHAR_LIMIT}자)을 넘는다. SKILL.md 를 줄여야 한다.`,
}
: {}),
root,
actions: skillDirActions(root, ctx.skill),
alreadyInstalled: await exists(path.join(root, "SKILL.md")),
};
},
};