본문으로 건너뛰기

플러그인 저작

comfozi의 확장성은 기능 개수가 아니라 구조입니다. 얼린 코어 계약(SSOT)은 수정·삭제 없이 두고(추가만), 공개 타입 계약의 슬롯에 GUI 플러그인을 끼웁니다. 누구나 코어를 건드리지 않고 플러그인을 저작·기여할 수 있습니다.

공개 타입 계약

플러그인은 @comfozi/ui-kitComfoziUiPlugin(= @comfozi/contractComfoziPlugin 확장)을 구현합니다.

import type {ComfoziUiPlugin} from '@comfozi/ui-kit';

const myPlugin: ComfoziUiPlugin = {
key: 'my-plugin',
slots: {
'card:footer': (ctx) => <MyFooter item={ctx.item} />,
},
onDecision?: (ctx) => { /* 승인/반려 훅 (관측만, 대신 결정하지 않음) */ },
onEdit?: (ctx) => { /* 필드 수정 훅 */ },
};

export default myPlugin;

슬롯 5개

공용 슬롯 4개 + pipeline-view 전용 1개 = 총 5개.

슬롯위치
card:footer카드 하단
card:actions카드 액션 영역
toolbar:right상단 툴바 우측
sidebar:panel우측 사이드바 패널
pipeline:timeline파이프라인 타임라인 (pipeline-view 전용)

등록

현재 등록은 빌드타임 정적 레지스트리입니다. comfozi.app/src/App.tsxAVAILABLE_PLUGINS에 top-level import로 추가합니다.

import myPlugin from '@comfozi/plugin.my-plugin';

const AVAILABLE_PLUGINS = {
'diff-view': diffView,
// ...
'my-plugin': myPlugin,
};
정직 경계

지금은 런타임 동적 로딩·마켓플레이스가 아닙니다. 할 수 있는 주장은 "공개 계약으로 누구나 코어 편집 없이 플러그인을 저작·기여할 수 있다"까지입니다. 실시간 드롭인은 향후 확장 범위입니다.

현재 플러그인 7개

diff-view(단가 변동 비교) · gbm-score(승인 신뢰도) · explain-card(이유 설명) · provenance(출처 추적, 다중 슬롯) · pipeline-view(파이프라인 무대) · flywheel-log(결정 로그) · triage-toolbar(분류 툴바).