designpaca 초기 구현 — 스킬 · 설치 CLI · 배포 파이프라인

웹 디자인 파이프라인 스킬과 이를 5개 에이전트에 설치하는 CLI 를 담은 모노레포.

스킬 (packages/skill)
- SKILL.md 261줄 + 참조 문서 16개 3,349줄. progressive disclosure 로
  본문은 절차와 인덱스만, 지식은 references/ 로 분리
- 0~6단계 파이프라인. 규모에 따라 전체·연장·국소 세 경로로 분기
- 하드 게이트 12개는 grep·카운트로 검증 가능한 것만. 취향 판단은 제외
- 미학 프리셋 5종, AI 슬롭 지문 목록, 한글 조판 규칙,
  SVG 필터·three.js·인터랙티브 모션·HTML-in-Canvas 실전 지침

설치 CLI (packages/cli, packages/core)
- npx designpaca 온보딩 TUI. Claude Code · Codex · Cursor · Windsurf · AGENTS.md
- 매니페스트에 설치 시점 해시를 기록해 사용자가 고친 파일은 update 가 건너뛴다
- 타깃별로 본문의 references/ 경로를 실제 설치 위치로 재작성
- AGENTS.md 는 항상 로드되므로 본문 대신 303자 포인터만 주입
- Windsurf 는 12,000자 상한 초과 시 설치를 차단

배포 (build/ci, .forgejo/workflows)
- 태그 v* → 검사·테스트·빌드 → npmjs 배포 + Forgejo 레지스트리 미러
  → draft 릴리스 → Cloudflare Pages. 재실행 멱등

근거 (research/)
- 약 250개 웹 소스 조사 결과와 도그푸딩 검증 2건. 스킬의 모든 수치는 여기서 나온다

테스트 22개 통과 (core 16 · cli 6)
This commit is contained in:
Yun Chan 2026-08-20 10:48:00 +09:00
commit 8808c672dc
135 changed files with 38838 additions and 0 deletions

65
packages/core/src/fsx.ts Normal file
View file

@ -0,0 +1,65 @@
import { createHash } from "node:crypto";
import fs from "node:fs/promises";
import path from "node:path";
export function sha256(content: string): string {
// 개행 정규화 — Windows 체크아웃(autocrlf)에서 해시가 흔들리는 것을 막는다
return createHash("sha256").update(content.replace(/\r\n/g, "\n"), "utf8").digest("hex");
}
export async function exists(p: string): Promise<boolean> {
try {
await fs.access(p);
return true;
} catch {
return false;
}
}
export async function readIfExists(p: string): Promise<string | null> {
try {
return await fs.readFile(p, "utf8");
} catch {
return null;
}
}
/** 임시 파일에 쓴 뒤 rename — 중간에 죽어도 반쯤 쓰인 파일이 남지 않는다 */
export async function writeAtomic(p: string, content: string): Promise<void> {
await fs.mkdir(path.dirname(p), { recursive: true });
const tmp = `${p}.${process.pid}.tmp`;
await fs.writeFile(tmp, content, "utf8");
await fs.rename(tmp, p);
}
/** 사용자가 고친 파일을 덮기 전에 원본을 남겨둔다 */
export async function backup(p: string): Promise<string | null> {
const cur = await readIfExists(p);
if (cur === null) return null;
const dest = `${p}.orig`;
await fs.writeFile(dest, cur, "utf8");
return dest;
}
/** 파일을 지우고, 비게 된 상위 디렉터리를 stopAt 까지 정리한다 */
export async function removeFileAndPrune(p: string, stopAt: string): Promise<void> {
await fs.rm(p, { force: true });
let dir = path.dirname(p);
const stop = path.resolve(stopAt);
while (path.resolve(dir).startsWith(stop) && path.resolve(dir) !== stop) {
try {
const rest = await fs.readdir(dir);
if (rest.length > 0) break;
await fs.rmdir(dir);
} catch {
break;
}
dir = path.dirname(dir);
}
// stopAt 자체도 비었으면 함께 정리한다
try {
if ((await fs.readdir(stop)).length === 0) await fs.rmdir(stop);
} catch {
/* 남아있으면 그대로 둔다 */
}
}