- 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:
parent
30dc6687dd
commit
8d02820fa5
14 changed files with 379 additions and 136 deletions
|
|
@ -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")),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue