본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

setup-ts-deep-modules

TypeScript 패키지 내부 파일의 직접 참조와 순환 의존성을 감지합니다. 공개 파일만 진입점으로 쓰도록 설정하고 예제, 검증, 문서까지 마련합니다.

원문원문 설명 보기

Wire dependency-cruiser into a TypeScript repo so each package is a deep module, with implementation hidden in subfolders and reachable only through its entry-point files. User-invoked.

AI 평가100점/ 100설치 방법 보기

이 스킬의 소개 기사

이럴 때 유용합니다

  • 패키지 내부 파일의 직접 참조를 막을 때
  • 타입 검사와 함께 패키지 경계를 확인할 때
  • 복사해서 쓸 패키지 틀을 만들 때
  • 에이전트에 공개 범위 규칙을 공유할 때

한국어 소개

할 수 있는 일

TypeScript 패키지의 내부 기능을 소수의 공개 파일을 통해 사용하도록 구성합니다. dependency-cruiser를 설치해 외부에서 패키지 하위 폴더를 직접 참조하는 경우와 순환 의존성을 감지합니다. 패키지 최상위 파일이 공개 범위이므로 진입점을 여러 개 둘 수 있습니다. 테스트도 공개 파일을 통해 동작을 확인하도록 합니다.

이럴 때 유용합니다

내부 구현이 여러 곳에서 참조되어 변경하기 어려운 프로젝트에 유용합니다. 경계 검사를 타입 검사와 같은 확인 명령에 포함하고, 예제와 문서로 이후 개발 규칙을 공유할 때도 사용합니다.

사용 예시

  • “공개 파일을 통해서만 참조하도록 패키지 경계 검사를 도입해 주세요.”
  • “복사용 패키지 예제를 만들고 규칙 위반을 감지하는지 확인해 주세요.”

정상 예제에서 성공하고, 내부 직접 참조에서 실패하며, 수정 후 다시 성공하는지 검증합니다.

주의 사항

사용자가 명시적으로 호출하는 스킬입니다. dependency-cruiser를 개발 의존성으로 추가하고 기존 설정에 규칙을 통합합니다. 패키지 간 의존 방향 제한은 별도 설정이 필요하며, 패키지 안에 다른 패키지를 넣는 구조는 지원하지 않습니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

객관 평가

AI가 SKILL.md의 내용만을 근거로 4가지 관점에서 판정했습니다. 스타 수나 인기도는 판정에 넣지 않았습니다.

지시의 명확성언제 쓰고 무엇을 하는지 알 수 있는가
A양호명시적 호출과 진입점, 내부 참조, 테스트, 순환 의존성의 네 규칙을 명시합니다.
절차의 구체성절차·입출력·예시가 구체적으로 적혀 있는가
A양호환경 확인부터 문서화까지 일곱 단계와 성공, 실패, 재성공 검증이 있습니다.
안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호기존 설정은 덮어쓰지 않고 통합하며 검증용 임시 위반은 되돌리도록 명시합니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
A양호패키지 관리 도구 확인과 dependency-cruiser 설치 절차가 있습니다.

총점은 각 항목을 A=25점, B=15점, C=5점으로 더한 값입니다. 2026년 10월 19일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(3)

  • SKILL.md7.4 KB
  • agents/openai.yaml149 B
  • dependency-cruiser.config.cjs3.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Setup TS Deep Modules

Make every package in this repo a deep module: a lot of behaviour behind a small interface. A package's public surface is its entry points (the files at the package root), and everything in its subfolders is hidden. This skill installs dependency-cruiser and the rules that make the entry points the only way in, then proves the rules bite.

For the vocabulary (deep module, interface, seam, depth), call the Skill tool with "codebase-design" and use its language throughout.

The shape this enforces

src/packages/
  <name>/
    index.ts        ← an entry point (public). Import this from outside.
    client.ts       ← another entry point. Packages may expose SEVERAL.
    lib/            ← implementation: hidden from outside, free to import each other.
    tests/          ← co-located tests + fixtures (a subfolder, so private).

The public surface is the package's root files, not one designated index.ts. By convention implementation lives in lib/ and tests in tests/, giving every package the same two-folder shape. The rule itself is general, though: anything in any subfolder is private, so you never extend the config to add a folder.

Four rules, all error:

  1. Entry-point boundary: code outside a package (app code or another package) may import only that package's entry points (its root files), never anything in its subfolders.
  2. Intra-package freedom: a package's own files import each other freely.
  3. Tests through the entry points: files under <pkg>/tests/ may import any package's entry points and their own tests/ fixtures, but never any package's subfolder internals (not even their own). Integration tests across packages are fine; deep imports are not.
  4. No cycles: no dependency cycles.

Entry points, not a barrel. Because the public surface is every root file, a package can expose several small entry points (index.ts, client.ts, server.ts) instead of funnelling everything through one giant index.ts. Barrel files that re-export a whole subtree are discouraged; keep entry points small and hide implementation in subfolders.

Layering (which packages may depend on which) is a different concern and is left as a commented stub in the config for this repo to fill in.

Steps

1. Detect the environment

  • Package manager: pnpm-lock.yaml → pnpm, yarn.lock → yarn, bun.lockb → bun, else npm. Use it for every command below (pnpm/yarn/npm run/bunx).
  • Packages root: if src/ exists use src/packages, else packages. Confirm the choice with the user if the repo already has a different obvious convention.
  • Existing config: check for a .dependency-cruiser.* file. If one exists, do not overwrite it: merge the four rules and the options in, and tell the user what you added.

Done when: package manager, packages root, and existing-config status are all known.

2. Install dependency-cruiser

Install dependency-cruiser as a devDependency with the detected package manager.

Done when: dependency-cruiser is in devDependencies.

3. Write the config

Copy dependency-cruiser.config.cjs to the repo root as .dependency-cruiser.cjs. Set PACKAGES_ROOT to the root detected in step 1. The rules are path-depth based and extension-agnostic, so nothing else needs adapting.

Done when: .dependency-cruiser.cjs exists with the correct PACKAGES_ROOT, and the four forbidden rules are present.

4. Wire it into the checks

  • Add a lint:boundaries script: depcruise <packages-root> (or depcruise src).
  • Fold it into the repo's umbrella check command, the one that already runs typecheck (e.g. a check / ci / validate script). Do not touch tsconfig or add path aliases.
  • If there is no umbrella script, add lint:boundaries and tell the user to include it in CI.

Done when: lint:boundaries exists and runs as part of the same command as typecheck.

5. Scaffold the example package

Create a committed <packages-root>/example/ as a copy-me template:

  • index.ts is an entry point. Export one function that delegates to an internal file (so the package is visibly deep, not a pass-through).
  • lib/impl.ts: an internal file in a subfolder, imported by index.ts, not reachable from outside.
  • tests/example.test.ts imports only ../index (an entry point) and asserts against the public function.

Tell the user this is a starter template to copy or delete.

Done when: the example package exists, exposes its behaviour through a root entry point, and hides impl in a subfolder.

6. Prove the rules bite

This is the completion criterion for the whole skill: a config that doesn't fail on a violation is worthless.

  1. Run lint:boundaries. It must pass on the clean example.
  2. Temporarily add a deep import to tests/example.test.ts (e.g. import { thing } from "../lib/impl"). Run lint:boundaries again; it must fail with tests-through-entrypoints.
  3. Revert the deep import. Run once more, and it must pass.

Done when: you have observed a pass, then a fail on the deep import, then a pass again. If step 2 does not fail, the rules are not wired correctly, so fix before finishing.

7. Document the convention

Write a README.md in the packages folder (<packages-root>/README.md, next to the packages it governs) covering: the src/packages/<name>/ layout (entry points at the root, lib/ for implementation, tests/ for tests), "import only through a package's entry points (its root files)", and how to run lint:boundaries. Discourage barrel files explicitly: expose several small entry points instead of re-exporting a whole subtree through one index. Keep it to the copy-me snippet plus the four rules in one paragraph each.

Then add a context pointer to it from the repo's agent-instructions file (CLAUDE.md if present, else AGENTS.md, creating AGENTS.md if neither exists). One line is enough, e.g. Packages are deep modules: see [src/packages/README.md](./src/packages/README.md) before adding or importing one. This is what makes an agent discover the boundary rule instead of tripping over it.

Done when: <packages-root>/README.md exists and discourages barrels, and the repo's CLAUDE.md/AGENTS.md links to it.

Notes

  • The config's $1 back-references (dependency-cruiser's group matching) are what let a package reach its own internals while outsiders can't. Don't flatten them into separate per-package rules.
  • Public vs private is decided by depth: a package's root files are entry points; anything in a subfolder is private. The conventional subfolders are lib/ (implementation) and tests/, but the rule doesn't hardcode them: any subfolder is private, so a new folder never needs a config change. Adding an entry point is just adding a root file (no barrel).
  • Packages are flat: one tier of immediate children under the root. A package's internals may nest as deep as you like; a package may not contain another package.
  • Use .cjs (not .js) so the config's module.exports works even in "type": "module" repos.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

ask-matt

무료요약 있음AI 평가 90점

아이디어 정리, 구현, 오류 조사에 맞는 관련 스킬과 사용 순서를 안내합니다. 작업의 규모와 단계에 따라 다음 절차를 선택하도록 돕습니다.

  • 아이디어부터 구현까지의 절차 선택
  • 오류 조사를 시작할 지점 찾기
  • 여러 세션에 걸친 개발 진행 방식 상담
mattpocock/skills29.8만2026년 10월 20일 업데이트

chief-of-staff

무료요약 있음AI 평가 60점

한 세션에서 장기 목표를 향해 여러 하위 에이전트의 작업을 조율합니다. 사용자와 대화를 이어가면서 다음 작업에도 도움이 될 환경과 공통 규칙을 개선합니다.

  • 장기 목표를 위한 작업 담당을 조율할 때
  • 백그라운드 작업 중에도 대화를 이어갈 때
  • 공통 규칙과 작업 환경을 개선할 때
mattpocock/skills29.8만2026년 10월 20일 업데이트

claude-handoff

무료요약 있음AI 평가 90점

진행 중인 대화를 인계용으로 요약하고 민감한 정보를 제외한 뒤 새 백그라운드 에이전트에 전달합니다. 다음 작업의 초점과 참고 자료를 정리해 현재 작업 위치에서 이어 갑니다.

  • 새 에이전트에 후속 작업 인계
  • 다음 세션의 작업 범위를 좁혀 인계
  • 다음 세션에 필요한 참고 자료 정리
mattpocock/skills29.8만2026년 10월 20일 업데이트

code-review

무료요약 있음AI 평가 90점

지정한 커밋이나 브랜치를 기준으로 코드 변경을 검토합니다. 문서화된 개발 규칙 준수와 요구 사항 구현을 별도로 확인하고 두 관점의 지적 사항을 나누어 보고합니다.

  • 브랜치나 PR의 변경 검토
  • 지정 커밋이나 태그 이후 변경 확인
  • 문서화된 개발 규칙과 대조
mattpocock/skills29.8만2026년 10월 20일 업데이트

codebase-design

무료요약 있음AI 평가 90점

호출자가 익혀야 할 사용법은 줄이고 복잡한 처리는 내부에 모으는 모듈 설계를 돕습니다. 공통 용어와 판단 기준으로 사용 편의성과 테스트 용이성을 검토합니다.

  • 모듈 호출 방법 간소화
  • 흩어진 복잡한 처리 통합
  • 구현을 교체할 위치 검토
mattpocock/skills29.8만2026년 10월 20일 업데이트

diagnosing-bugs

무료요약 있음AI 평가 80점

재현하기 어려운 오류와 성능 저하를 증상 감지 테스트나 스크립트로 조사합니다. 원인 후보를 검증하고 수정한 뒤 재발 방지 테스트까지 확인합니다.

  • 재현하기 어려운 오류 조사
  • 처리 속도가 느려진 원인 조사
  • 간헐적 오류를 반복해서 검증
mattpocock/skills29.8만2026년 10월 20일 업데이트

mattpocock의 스킬 모두 보기

이 스킬의 문제 신고