ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 cskwork

mod-template

슬래시 명령, 상태 표시줄 항목, 프롬프트 위 밴드, 테스트가 있는 $.state 계약을 포함하며 cskwork/claude-code-mods marketplace를 통해 설치하는 Claude Code mod 스타터 템플릿입니다.

번역 완료

이 mod 소개

claude-code-mods

Claude Code용 mod(2.1.287+): function hooks로 Claude Code가 하는 일을 관찰하고 다시 쓰거나 응답하며 자체 UI를 그립니다. Getting started with Claude Code mods를 바탕으로 합니다.

랜딩 페이지: https://cskwork.github.io/claude-code-mods/

| Mod | 기능 | | --- | --- | | token-weather | 프롬프트 위에 컨텍스트 창을 한 줄로 예보합니다: ☀ Clear → ↯ Compact soon, 사용한 token, 최근 12개 turn의 스파크라인, 마지막 turn이 추가한 양을 표시합니다. | | blast-radius | 위험한 Bash 명령(재귀 rm, git reset --hard, git clean -f, 강제 푸시, git branch -D, git stash drop/clear, kubectl delete, SQL DROP/TRUNCATE, 마이그레이션)이 실행되기 전에 무엇에 영향을 줄지 드라이런하고 Proceed 또는 Cancel을 묻습니다. 취소하거나 닫으면 호출을 거부합니다. | | template | 설치되지 않은 스타터 mod: 슬래시 명령, 상태 표시줄 항목, 밴드, 테스트가 있는 $.state 계약을 제공합니다. |

설치

Claude Code 안에서 실행합니다:

/plugin marketplace add cskwork/claude-code-mods
/plugin install token-weather@claude-code-mods
/plugin install blast-radius@claude-code-mods
/reload-plugins

새 mod 만들기

scripts/new-mod.sh my-mod "One line about what it does"
claude --plugin-dir "$PWD/my-mod"     # hot-reloads on every save

스크립트는 template/를 복사하고 이름을 바꾸어 .claude-plugin/marketplace.json에 추가한 다음 claude plugin validate와 claude plugin test를 실행합니다.

mod는 파일 3개와 선택적 상태 계약으로 구성됩니다:

my-mod/
├── .claude-plugin/plugin.json   name, version, description, "types"
├── hooks/hooks.json             { "modules": ["./register.tsx"] }
├── hooks/register.tsx           export const register: Register = on => { ... }
├── types/index.d.ts             PluginState contract for $.state values
└── tests/my-mod.test.ts         claude plugin test my-mod

주의할 규칙:

  • 모든 hook은 ($, e, next)입니다. next(e)를 호출하면 통과시키고, next({ ...e, x })를 호출하면 다시 씁니다. 호출하지 않고 반환하면 응답합니다.
  • 값은 $.state(atom / read / update)에 보관합니다. 모듈 변수는 핫 리로드마다 초기화됩니다.
  • Node도 DOM도 없습니다. 파일, 프로세스, 시계, UI는 $를 통해 사용하고 UI 요소는 $.ui.resolve(e)에서 가져옵니다.
  • 테스트 mock도 hook입니다: on('process.run', ($, e) => ({ value: ... })).
  • 엔진이 mod를 불러온 뒤 mod 옆에 .claude-plugin/types/를 씁니다. 따라서 tsc -p <mod>로 타입을 검사할 수 있습니다(gitignore됨).

확인

for m in token-weather blast-radius template; do claude plugin validate $m && claude plugin test $m; done

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add cskwork/claude-code-mods
claude plugin install mod-template
원문 / README

claude-code-mods

Mods for Claude Code (2.1.287+): plugins of function hooks that observe, rewrite or answer what Claude Code does and draw their own UI. Based on Getting started with Claude Code mods.

Landing page: https://cskwork.github.io/claude-code-mods/

| Mod | What it does | | --- | --- | | token-weather | A one-line forecast of the context window above the prompt: ☀ Clear → ↯ Compact soon, tokens used, a sparkline of the last 12 turns, and how much the last turn added. | | blast-radius | Before a risky Bash command runs (recursive rm, git reset --hard, git clean -f, force push, git branch -D, git stash drop/clear, kubectl delete, SQL DROP/TRUNCATE, migrations), dry-runs what it would touch and asks Proceed or Cancel. Cancel or dismiss denies the call. | | template | Starter mod, not installed: a slash command, a status line entry, a band, and a $.state contract with a test. |

Install

Inside Claude Code:

/plugin marketplace add cskwork/claude-code-mods
/plugin install token-weather@claude-code-mods
/plugin install blast-radius@claude-code-mods
/reload-plugins

Make a new mod

scripts/new-mod.sh my-mod "One line about what it does"
claude --plugin-dir "$PWD/my-mod"     # hot-reloads on every save

The script copies template/, renames it, adds it to .claude-plugin/marketplace.json, then runs claude plugin validate and claude plugin test on it.

A mod is three files plus an optional state contract:

my-mod/
├── .claude-plugin/plugin.json   name, version, description, "types"
├── hooks/hooks.json             { "modules": ["./register.tsx"] }
├── hooks/register.tsx           export const register: Register = on => { ... }
├── types/index.d.ts             PluginState contract for $.state values
└── tests/my-mod.test.ts         claude plugin test my-mod

Rules that bite:

  • Every hook is ($, e, next). Call next(e) to pass on, next({ ...e, x }) to rewrite, return without it to answer.
  • Keep values in $.state (atom / read / update); module variables reset on every hot reload.
  • No Node, no DOM: files, processes, clock and UI go through $. UI elements come from $.ui.resolve(e).
  • Test mocks are hooks too: on('process.run', ($, e) => ({ value: ... })).
  • After the engine loads a mod it writes .claude-plugin/types/ beside it, so tsc -p <mod> type-checks it (gitignored).

Check

for m in token-weather blast-radius template; do claude plugin validate $m && claude plugin test $m; done

비슷한 프로젝트