@conscience-technology/ovenn 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -4
- package/assets/components/AttachmentThumb/AttachmentThumb.tsx +1 -0
- package/assets/components/ChatComposer/ChatComposer.tsx +1 -1
- package/assets/components/FileIcon/FileIcon.tsx +1 -0
- package/assets/components/FileIcon/fileExtMap.ts +1 -0
- package/assets/components/Onboarding/OnboardingAxisPanel.tsx +1 -1
- package/assets/components/Onboarding/OnboardingPage.tsx +13 -11
- package/assets/components/Onboarding/actions.ts +9 -9
- package/assets/components/TableRowEdit/TableRowEdit.tsx +2 -2
- package/assets/components/ThemeController.tsx +2 -2
- package/assets/components/TimelineView/TimelineView.tsx +4 -2
- package/assets/components/Tooltip/Tooltip.module.css +1 -0
- package/assets/components/_utils.css +1 -0
- package/assets/components/side-effect-css.d.ts +5 -0
- package/assets/components/themeBootScript.ts +7 -1
- package/assets/components/tokens.css +1 -0
- package/assets/prompts/ASSEMBLY.md +2 -0
- package/assets/prompts/CASCADE.md +2 -2
- package/assets/prompts/CATALOG.md +1 -1
- package/assets/prompts/PRINCIPLES.md +4 -8
- package/assets/prompts/RULES.md +19 -1
- package/assets/prompts/SLOTS.md +2 -4
- package/assets/prompts/WORKFLOW_DESIGN.md +0 -4
- package/assets/prompts/axes/icon.md +1 -1
- package/assets/prompts/axes/motion.md +1 -1
- package/assets/prompts/axes/voice.md +1 -1
- package/assets/prompts/components/_variants.md +3 -3
- package/assets/prompts/components/accordion.md +4 -4
- package/assets/prompts/components/attachment-item.md +2 -2
- package/assets/prompts/components/button.md +2 -2
- package/assets/prompts/components/card.md +1 -2
- package/assets/prompts/components/chart-bar.md +1 -1
- package/assets/prompts/components/chat-input.md +1 -1
- package/assets/prompts/components/checkbox.md +5 -5
- package/assets/prompts/components/color-field.md +2 -2
- package/assets/prompts/components/command-palette.md +3 -3
- package/assets/prompts/components/context-menu.md +5 -5
- package/assets/prompts/components/date-picker.md +2 -2
- package/assets/prompts/components/drawer.md +2 -2
- package/assets/prompts/components/dropdown-menu.md +3 -3
- package/assets/prompts/components/event-list-item.md +4 -4
- package/assets/prompts/components/file-icon.md +2 -2
- package/assets/prompts/components/gallery-item.md +1 -1
- package/assets/prompts/components/hint.md +3 -3
- package/assets/prompts/components/kanban.md +2 -3
- package/assets/prompts/components/list-item.md +11 -11
- package/assets/prompts/components/menu-item.md +2 -2
- package/assets/prompts/components/message-table.md +4 -4
- package/assets/prompts/components/onboarding.md +3 -3
- package/assets/prompts/components/page-header.md +6 -7
- package/assets/prompts/components/quotation-bar.md +1 -1
- package/assets/prompts/components/select.md +1 -1
- package/assets/prompts/components/shortcut.md +3 -3
- package/assets/prompts/components/sidebar.md +5 -4
- package/assets/prompts/components/stepper.md +1 -1
- package/assets/prompts/components/tab-strip.md +2 -2
- package/assets/prompts/components/table-row-edit.md +6 -6
- package/assets/prompts/components/table-row-select.md +1 -1
- package/assets/prompts/components/tabs.md +5 -2
- package/assets/prompts/components/textarea.md +1 -1
- package/assets/prompts/components/toast.md +3 -3
- package/assets/prompts/components/tooltip.md +3 -3
- package/assets/prompts/components/topbar.md +1 -1
- package/assets/prompts/primitives/scroll.md +1 -1
- package/assets/prompts/recipes/README.md +5 -6
- package/assets/prompts/recipes/meta-line.md +2 -2
- package/assets/prompts/recipes/page-header.md +2 -2
- package/assets/prompts/recipes/section-header.md +1 -1
- package/assets/prompts/themes/_SCHEMA.md +2 -2
- package/assets/skills/ovenn-validate/SKILL.md +1 -1
- package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +7 -1
- package/assets/skills/ovenn-validate/scripts/lib/engine.mjs +105 -0
- package/assets/skills/ovenn-validate/scripts/lib/engine.test.mjs +46 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-utils.mjs +5 -3
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.mjs +28 -5
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.test.mjs +15 -0
- package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.mjs +7 -0
- package/assets/skills/ovenn-validate/scripts/rules/hardcoded.mjs +61 -30
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.mjs +7 -4
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.test.mjs +3 -0
- package/assets/skills/ovenn-validate/scripts/validate.mjs +8 -136
- package/assets/skills/ovenn-wireframe/SKILL.md +1 -1
- package/bin/ovenn.js +8 -0
- package/package.json +2 -2
- package/src/commands/check.js +70 -0
- package/src/commands/info.js +32 -7
- package/src/commands/init.js +26 -30
- package/src/commands/setup-checks.js +80 -0
- package/src/commands/update.js +90 -18
- package/src/data/ctds-releases.json +1 -0
- package/src/utils/assets.js +5 -0
- package/src/utils/component-usage.js +7 -1
- package/src/utils/design-workflow.js +6 -2
- package/src/utils/doctor.js +7 -1
- package/src/utils/legacy-ctds.js +169 -0
- package/src/utils/managed-assets.js +16 -3
- package/src/utils/route.js +17 -0
- package/src/utils/rules-context.js +91 -0
- package/src/utils/update-transaction.js +16 -3
- package/assets/prompts/FEEDBACK_PROCESS.md +0 -19
- package/assets/prompts/GUIDE.md +0 -307
- package/assets/prompts/MEMORY.md +0 -202
- package/assets/prompts/TEMPLATE_PREVIEWS.md +0 -21
- package/assets/prompts/components/README.md +0 -84
|
@@ -28,7 +28,7 @@ Body 안 메뉴 리스트는 **반드시 `MenuItem.Section`으로 묶어서**
|
|
|
28
28
|
- **섹션 제목 ↔ 첫 아이템**: 2~4px(기본 4px), MenuItem.Section의 `--menu-section-gap`이 담당한다. 제목 margin을 추가해 이중 간격을 만들지 않는다.
|
|
29
29
|
- **그룹 사이** (다음 섹션과의 거리): `--space-3`: Body 안쪽 콘텐츠 wrapper의 flex gap이 담당.
|
|
30
30
|
- 비율 3:1 유지. 라벨 톤 다운만으론 섹션 identity 부족: 간격 비율이 결정적.
|
|
31
|
-
- 이중 여백
|
|
31
|
+
- 이중 여백 금지: 그룹 wrapper에 추가 margin 공급 금지, 부모 gap 하나만 쓸 것.
|
|
32
32
|
|
|
33
33
|
### 사이드바 안의 Input
|
|
34
34
|
사이드바 내부 Input(검색 등)은 **`variant="outline"` 기본**. 흰색·연한 배경에서는 `filled`를 사용하지 않는다([[PRINCIPLES]] §5c). `line`도 금지: ghost MenuItem 사이에서 밑줄이 흐름에 섞여 검색창의 경계가 불분명해진다.
|
|
@@ -93,7 +93,7 @@ Header는 **가로 행**이기 때문에 Section을 넣으면 nav 전체가 가
|
|
|
93
93
|
</AppFrame>
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
AppFrame 밖에서 바깥 수제 grid(`grid-template-columns: 260px 1fr` 등)에 Sidebar를 그대로 꽂으면: Body가 자기 scroll container 높이를 못 잡아 **섹션들이 flex-shrink로 뭉개지거나, Body가 0 높이로 접혀 메뉴 전체가 안 보임**.
|
|
96
|
+
AppFrame 밖에서 바깥 수제 grid(`grid-template-columns: 260px 1fr` 등)에 Sidebar를 그대로 꽂으면: Body가 자기 scroll container 높이를 못 잡아 **섹션들이 flex-shrink로 뭉개지거나, Body가 0 높이로 접혀 메뉴 전체가 안 보임**.
|
|
97
97
|
|
|
98
98
|
**2단 쉘(Rail + Main)**: `<Sidebar>` 안에서 `<Sidebar.Rail>`과 `<Sidebar.Main>`을 compound로 조합. AppFrame.Sidebar 슬롯이 Sidebar를 그대로 담고, Sidebar 벤더가 자체 `.root:has(.rail)` CSS로 flex row 전환·폭 합산을 처리. 과거 바깥 수제 flex 조립은 폐기: 이젠 Sidebar 자체가 2단을 안다.
|
|
99
99
|
|
|
@@ -106,16 +106,17 @@ AppFrame 밖에서 바깥 수제 grid(`grid-template-columns: 260px 1fr` 등)에
|
|
|
106
106
|
- Brand는 Home 링크 자리로. `symbol`(항상 노출) + `wordmark`(expanded만).
|
|
107
107
|
- Section 묶음은 `title`로 그룹. collapsed일 땐 title 자동 숨김.
|
|
108
108
|
- `collapsed` 상태에서는 `aria-label`과 `title`을 자동으로 걸어 접근성 유지.
|
|
109
|
+
- 접기 버튼은 `Sidebar.CollapseToggle`(`size="sm | md | lg"`, 기본 sm)을 쓴다. Sidebar 안에서는 Context의 collapsed를 따르고, 바깥에 둘 때는 `collapsed`·`onCollapsedChange`를 직접 넘긴다. 라벨은 상태에 따라 "사이드바 열기/접기"로 바뀐다.
|
|
109
110
|
- 콘텐츠 영역과의 **경계선은 [[components/app-frame]] `variant="outlined"`** 가 그린다: Sidebar 자체는 border를 그리지 않음. 사이드바가 녹아 보이면 AppFrame variant부터 확인.
|
|
110
111
|
|
|
111
112
|
### Don't
|
|
112
|
-
- **워크스페이스/프로필 트리거에 Select·Input Dropdown 금지**: 폼 값 선택과 네비게이션 액션은 다른 역할. MenuItem(avatar + align="center") + DropdownMenu 조합이 유일한
|
|
113
|
+
- **워크스페이스/프로필 트리거에 Select·Input Dropdown 금지**: 폼 값 선택과 네비게이션 액션은 다른 역할. MenuItem(avatar + align="center") + DropdownMenu 조합이 유일한 표준.
|
|
113
114
|
- **수제 Button + span 조립 금지**: 매번 레이아웃·폰트·collapsed 전환이 어긋나서 일관성이 깨짐. MenuItem preset 하나로 끝.
|
|
114
115
|
- **Header에 Section·Item·nav를 넣지 않는다**: Header는 가로 flex 행이라 세로 nav가 깔리면 전부 눌려 겹친다. Brand 전용.
|
|
115
116
|
- 페이지 안 뷰 전환에 쓰지 않는다: 그건 [[components/tabs]].
|
|
116
117
|
- Item 안에 variant로 다른 톤을 쓰지 않는다. active 외의 강조 금지.
|
|
117
118
|
- Sidebar 자체에 padding/width를 CSS로 덮지 않는다. `--sidebar-w*` 토큰 경유.
|
|
118
|
-
- `.root`에 padding을 꽂지 않는다: Body가 스크롤 컨테이너라 스크롤바가 안쪽으로 밀려 가장자리에 안
|
|
119
|
+
- `.root`에 padding을 꽂지 않는다: Body가 스크롤 컨테이너라 스크롤바가 안쪽으로 밀려 가장자리에 안 붙는다.
|
|
119
120
|
- **Sidebar 큰 컨테이너(root/Header/Body/Footer wrapper)에 좌우 패딩 금지**. 좌우/상하 축은 preset slot(`data-sidebar-slot`) 또는 안쪽 콘텐츠 래퍼에 공급. `--sidebar-pad-x`·`--sidebar-pad-y` 토큰 사용 금지(벤더에서 폐기됨).
|
|
120
121
|
- [HARD] **Sidebar 내부 Input은 `outline` 기본**: `line` 금지, 흰색·연한 배경의 `filled` 금지.
|
|
121
122
|
- [HARD] **액티브바는 기본적으로 사용하지 않는다.** 선택 표면·텍스트 위계로 표시한다. 필요한 바를 둥근 행의 border·inset shadow에 붙여 곡선으로 만드는 구현은 금지한다([[PRINCIPLES]] §5c).
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
- 활성 스텝을 진하게, 미도달을 진하게 동시에 강조하지 않는다. 위계는 하나(active만 `--stepper-fg`).
|
|
23
23
|
- [SOFT] 연결선은 dashed/solid 중 문맥에 맞춰 선택한다.
|
|
24
24
|
- Motion 축과 무관하게 marker에 커스텀 애니메이션(bounce, spin 등) 붙이지 않는다. 상태 전환은 `--transition-colors`로 통일.
|
|
25
|
-
- `data-state="active"` 위에 hover가 border/bg를 덮어쓰지 않는다.
|
|
25
|
+
- `data-state="active"` 위에 hover가 border/bg를 덮어쓰지 않는다.
|
|
26
26
|
|
|
27
27
|
### Fallback
|
|
28
28
|
orientation 애매하면 `vertical`, marker 애매하면 `dot`. 스텝 6개 초과에 orientation·marker 판단 안 서면 사용자에게 확인.
|
|
@@ -36,9 +36,9 @@ const [activeId, setActiveId] = useState<string>(openDocs[0].id);
|
|
|
36
36
|
- **활성 색을 `--primary`로 덮지 않는다**: 활성은 `--fg-strong` + `--bg-muted` 무채. 브랜드 컬러는 CTA와 위계가 충돌 ([[components/tabs]]와 동일 원칙).
|
|
37
37
|
- **라벨 가로 폭을 숫자(px)로 고정 금지**: 폰트 축이 바뀌면 깨짐. `ch` 단위 사용.
|
|
38
38
|
- **x 아이콘을 상시 노출하지 말 것**: 시각 노이즈. hover·active에만, 활성 탭은 늘 보이는 게 맞다.
|
|
39
|
-
- **`<svg>` 인라인 금지**: leadingIcon은 Icon·이미지·브랜드 svg는 OK지만 "아이콘용 raw svg"는
|
|
39
|
+
- **`<svg>` 인라인 금지**: leadingIcon은 Icon·이미지·브랜드 svg는 OK지만 "아이콘용 raw svg"는 금지.
|
|
40
40
|
- **trailing에 생짜 `<button>` 넣지 말 것**: Button·IconButton·DropdownMenu 트리거 등 Ovenn 컴포넌트 경유. 자리별 간격·디바이더는 wrapper가 담당하니 소비처는 버튼만 넘김.
|
|
41
|
-
-
|
|
41
|
+
- 탭 사이에 문자 구분자를 넣지 않는다([[RULES]] §3). 탭 자체가 구분된 블록이다.
|
|
42
42
|
|
|
43
43
|
### Fallback
|
|
44
44
|
자리 애매하면 **Topbar 아래 2번째 줄**(shell 2단), size 애매하면 **md** (shell chrome에서도 sm보다 md가 안정적: Topbar와 같은 리듬).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
### 원칙
|
|
4
4
|
Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는 행"(행 전체 클릭)이라면 이 컴포넌트는 "편집 가능한 셀 그리드": 상호작용 단위가 **행이 아니라 셀**이다. 세로 구분선이 **강제**되는 유일한 Row 타입으로, 사용자가 edit 모드임을 즉시 인지할 수 있게 한다.
|
|
5
5
|
|
|
6
|
-
**외곽은 line, 높이는 md
|
|
6
|
+
**외곽은 line, 기본 높이는 md**: variant 축은 없고 size(sm·md·lg)는 행 최소 높이만 바꾼다. lg는 TableRow와 API를 맞추려 받지만 편집 행에는 권장하지 않는다. pill(plate) 조합은 edit의 정체성(스프레드시트 톤, 세로선 그리드)과 어긋나 지원하지 않는다. 레이아웃·fade mask는 [[components/table-row]]의 CSS를 상속: 헤더와의 폭·정렬 동기화 규칙은 동일. 셀 안쪽 콘텐츠는 [[components/table-cell]] 포맷터 또는 Input/Select/DatePicker 같은 편집 컨트롤을 호출 측에서 `columns[].render(data)`로 꽂아 쓴다.
|
|
7
7
|
|
|
8
8
|
### Do
|
|
9
9
|
- 편집 행 위 헤더는 `TableHeader variant="grid"`로 조합하면 상단 가로선과 여백 없는 세로 경계가 편집 행의 열 경계로 이어진다.
|
|
@@ -22,9 +22,9 @@ Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는
|
|
|
22
22
|
- 세로 구분선을 끄지 않는다. edit 모드의 **정체성**: 끄면 navigate 모드와 시각 구분이 사라져 사용자가 편집 가능 여부를 인지하지 못함.
|
|
23
23
|
- [HARD] 셀 안에 또 다른 anchor/button을 중첩하지 않는다. 셀 자체가 포커스 타겟(`tabIndex=0`): nested interactive는 접근성·키보드 탐색 파괴.
|
|
24
24
|
- [HARD] `activeCellKey`를 여러 개로 동시에 유지하지 않는다. "지금 편집 중"은 한 번에 하나. 멀티셀 선택이 필요하면 별도 selection state로 분리(미래 기능).
|
|
25
|
-
- hover가 selected/active 셀을 덮지 않는다: 컴포넌트 CSS가
|
|
25
|
+
- hover가 selected/active 셀을 덮지 않는다: 컴포넌트 CSS가 보장.
|
|
26
26
|
- `background`를 직접 지정하지 않는다. selected/active는 축 토큰(`--primary-subtle`)으로 자동.
|
|
27
|
-
-
|
|
27
|
+
- variant를 쓰려 하지 않는다: prop이 없다. 큰 밀도가 필요하면 edit 대신 [[components/table-row]]의 size로 해결.
|
|
28
28
|
|
|
29
29
|
### Fallback
|
|
30
30
|
- 셀 콘텐츠 애매하면 [[components/table-cell]] 중 `TableCellText`. 편집 시만 [[components/input]]으로 교체.
|
|
@@ -36,9 +36,9 @@ Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는
|
|
|
36
36
|
- [[components/table-header]]: columns·order·widths·selectable 세트 (variant=grid 권장)
|
|
37
37
|
- [[components/table-cell]]: 각 셀 콘텐츠 포맷터
|
|
38
38
|
- [[components/input]], [[components/select]], [[components/date-picker]]: 활성 셀의 편집 컨트롤로 꽂음
|
|
39
|
-
- [[axes/density]]: space-* 토큰을 통해 자동 반영 (
|
|
39
|
+
- [[axes/density]]: space-* 토큰을 통해 자동 반영 (size는 행 최소 높이만 조절)
|
|
40
40
|
- [[tokens/color]]: `--primary-subtle`/`--primary`(active cell), `--border`(세로 구분선), `--hover`(셀 hover), `--fg-disabled`
|
|
41
|
-
-
|
|
41
|
+
- selected/active 위 hover가 상태 톤을 덮지 않음
|
|
42
42
|
|
|
43
43
|
### Props 시그니처
|
|
44
44
|
```tsx
|
|
@@ -52,7 +52,7 @@ type TableRowColumn<T> = TableHeaderColumn & {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
<TableRowEdit<T>
|
|
55
|
-
size="sm | md"
|
|
55
|
+
size="sm | md | lg" // default: md (min-height sm=control-h-md, md=control-h-lg, lg=size-11)
|
|
56
56
|
columns={TableRowColumn<T>[]} // 헤더와 동일 스펙 + render + editable + 생략
|
|
57
57
|
order={string[]} // 헤더와 공유
|
|
58
58
|
widths={Record<string, number>} // 헤더와 공유
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
- **columns는 TableRow와 동일 스펙**: 같은 `TableRowColumn<T>[]`를 Header와 Row 모두에 전달. 폭·정렬·render가 자동 동기화.
|
|
11
11
|
- **체크박스 UI 없음**: 행 자체가 토글 영역: 선택된 상태는 배경 톤으로만 표현. 헤더에도 `selectable=false` (기본).
|
|
12
12
|
- **선택 배경은 `--primary-subtle`**: 기본 hover와 선택이 구분된다. hover가 선택을 덮지 않는다.
|
|
13
|
-
- **hover가 selected를 덮지 않도록**: selected 위에서 hover해도 배경 톤 유지.
|
|
13
|
+
- **hover가 selected를 덮지 않도록**: selected 위에서 hover해도 배경 톤 유지.
|
|
14
14
|
- **키보드 Space로 토글**: Enter는 안 받음: Finder·Explorer도 선택은 Space. 접근성 트리는 `role="row"` + `aria-selected`.
|
|
15
15
|
- **전체 선택/해제는 외부 UI로**: Row 자체엔 "select all" 개념이 없음. 상위 툴바에 버튼으로 두거나 헤더의 `selectable`을 켜고 TableRow(navigate)와 섞어 쓰는 패턴은 지양.
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
variant 애매하면 `underline`, size 애매하면 `md`.
|
|
36
36
|
|
|
37
37
|
### 관련
|
|
38
|
-
- [[components/button]] · [[components/
|
|
38
|
+
- [[components/button]] · [[components/control-group]]: 동일한 `--control-h-*` 사이즈 토큰 공유
|
|
39
39
|
- [[components/chip]]: 여러 개 동시 선택이면 토글 Chip. Tabs는 항상 1개만 활성.
|
|
40
40
|
- [[axes/density]]: `--control-h-*`가 트리거 높이·segmented 컨테이너 높이에 매핑
|
|
41
41
|
- [[axes/shape]]: segmented 컨테이너/트리거 radius가 Shape 축에 반응
|
|
@@ -47,7 +47,7 @@ variant 애매하면 `underline`, size 애매하면 `md`.
|
|
|
47
47
|
<Tabs
|
|
48
48
|
stretch={boolean} // default: false. true면 부모 전체 폭
|
|
49
49
|
variant="underline | segmented | text" // default: underline
|
|
50
|
-
size="xs | sm | md | lg"
|
|
50
|
+
size="xs | sm | md | lg | xl | 2xl | 3xl" // default: md
|
|
51
51
|
orientation="horizontal | vertical" // default: horizontal. vertical은 좌측 탭 + 우측 패널
|
|
52
52
|
value={string} // controlled
|
|
53
53
|
defaultValue={string} // uncontrolled 초기값
|
|
@@ -81,6 +81,9 @@ variant 애매하면 `underline`, size 애매하면 `md`.
|
|
|
81
81
|
| `sm` | control-h-sm | 밀도 높은 대시보드, 사이드 패널 안, 카드 헤더 |
|
|
82
82
|
| `md` | control-h-md | **기본.** 페이지 섹션 탭, 대부분의 스위처 |
|
|
83
83
|
| `lg` | control-h-lg | 랜딩·마케팅 상단, 태블릿·터치 |
|
|
84
|
+
| `xl` | auto (`text-lg`) | 섹션 제목을 탭으로 바꾸는 자리. 컨트롤 높이 대신 글자 크기가 위계를 만든다 |
|
|
85
|
+
| `2xl` | auto (`text-xl`) | 페이지 상단의 큰 제목형 탭 |
|
|
86
|
+
| `3xl` | auto (`text-2xl`) | 랜딩·히어로의 제목형 탭 |
|
|
84
87
|
|
|
85
88
|
### 접근성
|
|
86
89
|
- 루트가 자동으로 `role=tablist` / `role=tab` / `role=tabpanel`과 `aria-selected` / `aria-controls` / `aria-labelledby` 를 붙인다.
|
|
@@ -25,7 +25,7 @@ size 애매하면 `md`, variant 애매하면 `outline`, autoResize 애매하면
|
|
|
25
25
|
|
|
26
26
|
### 관련
|
|
27
27
|
- [[components/input]]: 한 줄 입력, 모든 시각·width·label 규약 공유
|
|
28
|
-
-
|
|
28
|
+
- 입력 부품의 `label`·`description`·`warning` props: label·description·warning 자리
|
|
29
29
|
- [[primitives/scroll]]: 단일 콘텐츠 scroll 룰 (root padding 0 + textarea padding 전담)
|
|
30
30
|
- [[axes/density]]: padding·font-size가 Density에 반응
|
|
31
31
|
- [[axes/shape]]: radius가 Shape 축에 반응
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Toast
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
휘발성 피드백: 사용자 액션의 결과를 짧게 알리고 자동으로 사라진다. 흐름을 끊지 않는다. [[components/callout]]은 상주 안내, [[
|
|
4
|
+
휘발성 피드백: 사용자 액션의 결과를 짧게 알리고 자동으로 사라진다. 흐름을 끊지 않는다. [[components/callout]]은 상주 안내, [[recipes/page-banner]]는 페이지 폭 경고, Toast는 **일회성 결과 신호**.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- action과 닫기 X는 추가 gap 없이 인접하게 배치하며 클릭 영역은 유지한다.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- Toast 표면색에 tone별 tint 금지: 색은 아이콘·action 버튼에만.
|
|
21
21
|
- action Button 2개 이상 두지 않는다: Toast 폭에서 신호 분산.
|
|
22
22
|
- action variant에 `primary`·`destructive` solid 금지: inverse 표면에서 색 신호가 깨짐.
|
|
23
|
-
- 긴 본문(2줄 초과) 금지: Toast는 1~2줄까지. 그 이상이면 [[components/callout]] 또는 [[
|
|
23
|
+
- 긴 본문(2줄 초과) 금지: Toast는 1~2줄까지. 그 이상이면 [[components/callout]] 또는 [[recipes/page-banner]].
|
|
24
24
|
- [HARD] `placement="top-center"`에 `description` 전달 금지: Viewport가 숨긴다. multiline 신호 필요하면 placement부터 `bottom-right`로.
|
|
25
25
|
- 비동기 로딩 상태(spinner Toast)로 쓰지 않는다: Toast는 완료 신호 전용.
|
|
26
26
|
- 플로팅이지만 `data-side` 기반 `.m-float` 유틸은 쓰지 않는다: Toast는 placement별 slide-in 전용 애니.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
### 관련
|
|
34
34
|
- [[components/callout]]: 상주 안내 카드. Toast는 휘발.
|
|
35
|
-
- [[
|
|
35
|
+
- [[recipes/page-banner]]: 페이지 폭 전역 경고. Toast는 코너 소형.
|
|
36
36
|
- [[components/button]]: `action` 슬롯의 요소.
|
|
37
37
|
- [[axes/motion]]: placement별 slide-in·fade-out 파라미터 스왑.
|
|
38
38
|
- [[tokens/z-index]]: `z-toast` 레이어 (Modal 위, Tooltip 아래).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Tooltip
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 compound. 라벨이 없는 [[components/icon-button]]의 의미 설명, 축약된 단어의 보충, 단축키 힌트에 사용. **클릭 액션은 담지 않는다**: 그건
|
|
4
|
+
hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 compound. 라벨이 없는 [[components/icon-button]]의 의미 설명, 축약된 단어의 보충, 단축키 힌트에 사용. **클릭 액션은 담지 않는다**: 그건 Popover(Ovenn 공용 부품 없음, `@radix-ui/react-popover`로 로컬 조합).
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- 라벨이 없는 아이콘 버튼엔 반드시 Tooltip + `aria-label` 둘 다.
|
|
@@ -13,7 +13,7 @@ hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 co
|
|
|
13
13
|
|
|
14
14
|
### Don't
|
|
15
15
|
- [HARD] 모바일/터치에서 hover에만 의존하는 힌트는 쓰지 않는다. 중요한 정보는 Label·description으로 제공한다. 클릭 완료 후 잠시 표시하는 결과 피드백은 허용한다.
|
|
16
|
-
- [HARD] 액션 버튼이 담긴 Tooltip 금지:
|
|
16
|
+
- [HARD] 액션 버튼이 담긴 Tooltip 금지: Popover(Ovenn 공용 부품 없음, `@radix-ui/react-popover`로 로컬 조합)로.
|
|
17
17
|
- content에 긴 문단 금지. 설명이 길면 Dialog 또는 Popover.
|
|
18
18
|
- [HARD] hover 시 사라지는 중요 정보 금지: WCAG 2.5.3 (호버 지속성) 위반.
|
|
19
19
|
- 표면 등장·퇴장을 별도 애니메이션으로 재작성하지 않는다. `.m-float`이 전담한다. 액션 결과의 내부 콘텐츠 전환은 아래 표준을 따른다.
|
|
@@ -24,7 +24,7 @@ side 애매하면 `top`, align 애매하면 `center`, delayDuration을 생략하
|
|
|
24
24
|
### 관련
|
|
25
25
|
- [[components/icon-button]]: 가장 흔한 트리거 (aria-label 보충)
|
|
26
26
|
- [[components/shortcut]]: content 안쪽 단축키 힌트
|
|
27
|
-
-
|
|
27
|
+
- Popover(Ovenn 공용 부품 없음, `@radix-ui/react-popover`로 로컬 조합): 액션·입력이 담긴 자리 (Tooltip 대신)
|
|
28
28
|
- [[axes/motion]]: Content in/out은 `.m-float` 유틸
|
|
29
29
|
|
|
30
30
|
### Props 시그니처
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
- zone 밖에 **자식을 바로 넣지 않는다**. `<Topbar><Breadcrumb/>...</Topbar>` 같은 구조 금지: 반드시 Leading/Center/Trailing 중 하나로 감싼다.
|
|
23
23
|
- `h1`·큰 hero head·환영 메시지("good morning")·페이지 섹션 타이틀을 Topbar 안에 넣지 않는다: Topbar는 **얇은 축**이고 큰 타이포가 들어가는 순간 `align-items` 전쟁이 벌어진다. 이걸 로컬 CSS로 때우는 순간(`align-items: flex-start`, `padding-bottom` override 등) Topbar의 "축" 약속이 깨지고, 아래 body와의 수직 리듬도 어긋난다. hero는 body의 첫 섹션으로 꺼낸다.
|
|
24
24
|
- 수직 스택(eyebrow + title 세로 두 줄 같은 조합)을 Topbar 안에 넣지 않는다. 수직 리듬은 body의 섹션 head에서.
|
|
25
|
-
- **[HARD] Topbar 안 identity 트리거(MenuItem avatar preset)에 `description`
|
|
25
|
+
- **[HARD] Topbar 안 identity 트리거(MenuItem avatar preset)에 `description` 금지**: 2줄 모드가 Topbar "얇은 축" 리듬을 깬다. 2줄이 필요하다 느껴지면 자리 자체가 틀림: 콘텐츠 소속감이 필요한 자리면 PageHeader(body 안), 네비게이션 소속감이면 Sidebar.Footer 로 옮긴다.
|
|
26
26
|
- 알림·검색·Breadcrumb 외의 **콘텐츠**(KPI·요약·공지 문구)를 Topbar에 끼우지 않는다. 그건 body hero 섹션 또는 Callout의 자리.
|
|
27
27
|
- Topbar에 로컬 `padding`·`align-items`를 override해서 "큰 요소 끼운 걸 수습"하지 않는다: 수습이 필요한 순간 그 요소가 Topbar의 자리가 아니라는 신호.
|
|
28
28
|
- 자체 bg/border/shadow 추가 금지: AppFrame variant가 쥐고 있는 자리.
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
### 스크롤바 시각 정책 (전역, globals.css)
|
|
48
48
|
|
|
49
|
-
핵심은 **overlay 방식 전용** — 스크롤바는 콘텐츠 위에 뜨기만 하고 **공간을 먹지 않는다**. 공간을 먹는 "고정 스크롤바" 는 다크 모드에서 OS·브라우저 조합이 트랙·코너를 흰색으로 강제 렌더해 그 자리가 하얗게 뜨는 함정이 있어 영구
|
|
49
|
+
핵심은 **overlay 방식 전용** — 스크롤바는 콘텐츠 위에 뜨기만 하고 **공간을 먹지 않는다**. 공간을 먹는 "고정 스크롤바" 는 다크 모드에서 OS·브라우저 조합이 트랙·코너를 흰색으로 강제 렌더해 그 자리가 하얗게 뜨는 함정이 있어 영구 금지.
|
|
50
50
|
|
|
51
51
|
- 평상시: thumb 투명 → 스크롤바 자리는 있지만 안 보임 (overlay)
|
|
52
52
|
- 부모 `:hover` 또는 `:focus-within`: thumb에 `--border-strong` 페이드 인
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## 레시피 작성 규칙
|
|
12
12
|
|
|
13
|
-
레시피 파일은
|
|
13
|
+
레시피 파일은 프롬프트 문서의 **공통 골격(`### 원칙` · `### Do` · `### Don't` · `### Fallback` · `### 관련`)**을 따르되, 아래 추가 섹션을 포함한다.
|
|
14
14
|
|
|
15
15
|
```markdown
|
|
16
16
|
# <레시피 이름>
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
|
|
61
61
|
- **meta-line separator** — 초기 레시피의 `width:1px / height:0.75em`가 check_tokens hook에서 리터럴로 차단됨 → `border-left: 1px solid var(--border)` + `align-self: stretch`로 수정
|
|
62
62
|
- **배경·경계 조합** — [[PRINCIPLES]] §5b의 미세한 표시 색 차이 기준을 따른다. 완전 투명한 border는 보이는 스트로크가 아니므로 동시 사용 위반으로 보지 않는다. 불필요한 테두리 선언은 생략한다.
|
|
63
|
-
- **날짜 포맷** — 초기 예시들의 "10. 13." 숫자 날짜가
|
|
64
|
-
- **Callout 유령 참조** — `
|
|
63
|
+
- **날짜 포맷** — 초기 예시들의 "10. 13." 숫자 날짜가 룰 위반 → "10월 13일" 표기로 수정
|
|
64
|
+
- **Callout 유령 참조** — `components/banner`가 유령 → `recipes/page-banner`로 교체
|
|
65
65
|
- **아이콘 이름 misname** — 레시피 예시의 `name="chevron-right" / "refresh" / "share" / "code" / "shield" / "checklist" / "terminal"` 중 어느 것도 Ovenn Icon 세트에 **등재되지 않음**. 각각 `caret-right / arrow-clockwise / share-network / brackets-square / shield-check / clipboard-text / brackets-square`로 교체. **레시피에 "아이콘 이름은 `web/components/Icon/Icon.tsx`의 phosphor 이름 레지스트리에서 찾을 것" 가이드 추가 필요**
|
|
66
66
|
- **Badge API prop 오류** — 레시피가 `tone="warning"`을 썼지만 실제 API는 `status="warning"` + `variant="soft"` 조합. `tone`은 Callout prop. 레시피 수정 필요
|
|
67
67
|
- **Vendor prop 선언 확인 공백** — ASSEMBLY §1 2단계 "가장 가까운 벤더 anatomy 베끼기"는 API까지 확인하지 않으면 복제가 깨짐. ASSEMBLY에 **"vendor prop·타입 선언을 반드시 확인"** 단계 추가 필요
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
- **섹션 header가 "통짜 라벨"만 있으면 어색** — h2만 떠있고 count·설명·eyebrow 없으면 섹션끼리 구별 안 됨. count badge 또는 설명 1줄 **의미 있는 자리면** 넣기
|
|
81
81
|
|
|
82
82
|
**브라우저 렌더 3차 피드백 (유저 육안 검증, 2026-10-14)** — ★ 레이아웃 전면 교체:
|
|
83
|
-
- **"margin-top differential rhythm"은 틀린 결론이었음** — 2차에서 시도한 `A + B { margin-top: ... }`도 그룹 설계가 틀렸다는 신호였음. 정답은 **wrapper 추가 + 그룹별 flex column + gap**. 레이아웃 1원칙은 "**관련있는 것끼리 묶기**" — 이게 **padding/margin으로 간격 조정보다 선행**해야 함. → ASSEMBLY §2a 전면 재작성,
|
|
83
|
+
- **"margin-top differential rhythm"은 틀린 결론이었음** — 2차에서 시도한 `A + B { margin-top: ... }`도 그룹 설계가 틀렸다는 신호였음. 정답은 **wrapper 추가 + 그룹별 flex column + gap**. 레이아웃 1원칙은 "**관련있는 것끼리 묶기**" — 이게 **padding/margin으로 간격 조정보다 선행**해야 함. → ASSEMBLY §2a 전면 재작성, 메모리 교체 (기존 differential rhythm 폐기)
|
|
84
84
|
- **유령 토큰 `--font-medium` → 모든 타이틀 얇음의 숨은 원인** — 실제 토큰은 `--font-weight-medium`. 레시피들이 전부 `var(--font-medium)` 썼고 **check_tokens hook이 유령 토큰은 못 잡음** (리터럴만 잡음). 조용히 상속된 400으로 렌더되어 h1·h2·cardTitle 전부 얇음. → ASSEMBLY §1 체크리스트 "font-weight 토큰 이름 정확성" 추가, 전수 교체
|
|
85
85
|
- **섹션 header의 `margin-bottom`은 틀림** — section 자체를 flex column + gap으로 묶으면 header와 body가 자연스럽게 간격을 가짐. margin-bottom은 그룹 설계 실패의 흔적
|
|
86
86
|
- **3-tier 리듬 확립**: 그룹 안 `space-2~3` / 섹션 반복 `space-6` / 그룹 사이 `space-10`. 콘솔 리듬 기준
|
|
87
|
-
- **`<section>`
|
|
87
|
+
- **`<section>` 여백 함정 정정**: 80px 여백은 Ovenn 문서 사이트의 `.content section` 규칙이었고 설치 프로젝트에는 없다. 의미에 맞는 태그를 쓰고, 태그 선택자 여백은 wrapper class로 좁힌다([[tokens/spacing]]).
|
|
88
88
|
- **그룹 안에서도 "미니 그룹" 필요** — introGroup 안 banner↔header↔hint 셋을 `space-3` 하나로 통일했더니 "같은 거리로 뭉쳐" 성격 구분 안 됨. **banner(메타)와 headerBlock(타이틀+설명)**을 분리하는 중간 wrapper(headerBlock) 추가 → introGroup gap을 `space-6`로 벌리고 headerBlock 안은 `space-2` 좁게. 그룹 설계는 **재귀적**이어야 함.
|
|
89
89
|
- **3-tier 리듬 수치 상향** — 초기 "섹션 반복 space-6 / 그룹 space-10"은 실측에서 좁았음. "섹션 ↔ 섹션 반복"과 "그룹 ↔ 그룹"은 둘 다 `space-20` (80px) 수준이 자연스러움. space-6은 "섹션 안 블록 단위" 또는 "같은 그룹 안 성격 다른 요소"에만.
|
|
90
90
|
- **"가까운 관계일수록 더 좁게" 원칙 확립 (ASSEMBLY §2a 재작성)** — 유저 지적: section header↔body `space-2` + cardList 아이템 간 `space-2`가 **같은 값**이라 "타이틀과 아이템이 같은 레벨"로 뭉쳐 보임. **인접한 두 레벨은 반드시 한 단계 이상 차이**가 나야 위계 성립. 수정: 아이템 간 `space-1`, 섹션 header↔body `space-3`. 같은 원칙으로 headerBlock gap도 `space-2`→`space-3` 상향 (pageHeader 안 title↔description이 `space-1`이므로)
|
|
@@ -100,5 +100,4 @@
|
|
|
100
100
|
## 관련
|
|
101
101
|
|
|
102
102
|
- [[ASSEMBLY]] — 조립 알고리즘. 레시피는 그 3단계에서 참조된다
|
|
103
|
-
- [[GUIDE]] — 공통 골격·N/A 규칙. 레시피 파일도 이를 따른다
|
|
104
103
|
- [[components/_variants]] — 역할 × variant 매핑. 레시피 내 vendor 선택 시 참조
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
- separator는 `aria-hidden="true"` — 스크린리더에서 읽히지 않게
|
|
19
19
|
- label 중 하나가 **값**(사람 이름·시각)이고 나머지가 **고정 라벨**이면, 값만 `color: var(--fg)` (살짝 올림) — 단 톤 차이는 1단계 이내
|
|
20
20
|
- 전체 wrapper: `display: flex; align-items: center; gap: var(--space-2);`
|
|
21
|
-
- 날짜·시간은
|
|
21
|
+
- 날짜·시간은 전략 중 하나로 (상대어 "12분 전" / "10월 13일") — 숫자 패턴("10. 13") 금지
|
|
22
22
|
|
|
23
23
|
### Don't
|
|
24
|
-
-
|
|
24
|
+
- 문자 구분자는 쓰지 않는다([[RULES]] §3). hairline으로만 나눈다.
|
|
25
25
|
- [HARD] separator를 label 앞뒤에도 넣지 않는다. **"사이에만"**. 끝에 또는 처음에 두면 끊긴 느낌
|
|
26
26
|
- [HARD] label 하나하나를 Badge로 쓰지 않는다 — 메타 라인은 톤이 조용해야 한다. Badge는 상태·카테고리 **표시**가 필요할 때만, 메타 라인에 섞이지 않게 분리
|
|
27
27
|
- [SOFT] 3개 넘으면 메타 라인이 아니라 **별도 블록**이 맞는지 재검토. 4개 이상은 사용자가 다 못 읽음
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
- eyebrow와 title 사이: `space-1`
|
|
16
16
|
- title과 description 사이: `space-2`
|
|
17
|
-
- **블록 전체 아래 (다음 섹션까지)의 간격은 상위 wrapper 의 `gap` 이 담당**. `space-6` (앱 리듬) / `space-10` (랜딩 리듬). PageHeader 자체는 `margin-bottom` 을 걸지
|
|
17
|
+
- **블록 전체 아래 (다음 섹션까지)의 간격은 상위 wrapper 의 `gap` 이 담당**. `space-6` (앱 리듬) / `space-10` (랜딩 리듬). PageHeader 자체는 `margin-bottom` 을 걸지 않는다.
|
|
18
18
|
- actions는 title과 같은 row — `align-items: center`, `flex: 1 1 auto` title / `flex: 0 0 auto` actions
|
|
19
19
|
|
|
20
20
|
### Do
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
### Don't
|
|
28
28
|
- [HARD] h1 아래 `margin-bottom`을 자식(h1)이 걸고 **동시에** 부모 wrapper도 gap을 걸지 않는다 — 이중 여백 ([[tokens/spacing]] Don't)
|
|
29
29
|
- [HARD] h1을 `font-semibold`/`font-bold`로 쓰지 않는다 — [[tokens/typography]] font weight cap
|
|
30
|
-
-
|
|
30
|
+
- uppercase + letter-spacing 조합은 쓰지 않는다(기본값).
|
|
31
31
|
- [SOFT] eyebrow 없이 breadcrumb만 Topbar leading에 두는 패턴은 피한다 — 페이지 식별이 shell로 샌다. Topbar leading에는 workspace/section만, 페이지 이름은 body로
|
|
32
32
|
|
|
33
33
|
### Fallback
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
- 액션이 2개 이상이면 서로 간 gap `space-1`
|
|
25
25
|
|
|
26
26
|
### Don't
|
|
27
|
-
-
|
|
27
|
+
- Ovenn 컴포넌트는 `section`·`article` 같은 태그에 여백을 걸지 않으므로 의미에 맞는 태그를 쓴다. 프로젝트 전역 CSS가 태그 선택자에 여백을 걸었다면 그 규칙을 wrapper class 안으로 좁힌다([[tokens/spacing]]).
|
|
28
28
|
- [HARD] h2를 `font-semibold`/`font-bold`로 쓰지 않는다 — [[tokens/typography]] font weight cap
|
|
29
29
|
- [HARD] h2 아래에 `border-bottom`을 깔지 않는다. 섹션 분리는 **gap**이 담당. 선 + 공간은 이중 분리
|
|
30
30
|
- [HARD] 섹션끼리 `space-6` 이상 gap으로 분리하지 않는다 — 각 섹션이 border/배경으로 분리돼 있으면 과한 공간은 "구조가 끊긴" 결과 ([[tokens/spacing]] Don't)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Theme Schema
|
|
2
2
|
|
|
3
3
|
Theme 레이어 자체의 규칙. 개별 Theme 문서는 이 스키마를 따른다.
|
|
4
|
-
[[PRINCIPLES]]
|
|
4
|
+
[[PRINCIPLES]]의 전제를 모두 이어받는다.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ Theme은 **6개 축의 preset 묶음 + 축 밖 산문 레이어**다. "룩의
|
|
|
31
31
|
축 6개 중 preset 선택이 애매하면 각 축의 기본값([[axes/mode]] 등 참고)으로 둔다. 그래도 애매하면 사용자에게 확인.
|
|
32
32
|
|
|
33
33
|
### 관련
|
|
34
|
-
-
|
|
34
|
+
- Theme도 프롬프트 문서의 공통 골격(`### 원칙` · `### Do` · `### Don't` · `### Fallback` · `### 관련`)을 따르고, 아래 "Theme 전용 추가 항목"을 더한다.
|
|
35
35
|
- [[themes/_TEMPLATE]] — 복사해서 쓰는 Theme skeleton.
|
|
36
36
|
|
|
37
37
|
---
|
|
@@ -9,6 +9,6 @@ description: 선언된 프로젝트 토큰과 사용처 리터럴, 미선언 변
|
|
|
9
9
|
|
|
10
10
|
필요한 행동은 전체 `prompts/CATALOG.md`에서 찾고 해당 문서의 Do/Don't·Props와 실제 컴포넌트 코드를 확인한다. 클라이언트의 실행·캡처·독립 검수 기능이 없으면 원본의 검수 대기 계약을 따른다. 검사 통과를 화면 검수로 대신하지 않는다.
|
|
11
11
|
|
|
12
|
-
로컬 규칙 검사는 이 스킬의 `scripts/validate.mjs
|
|
12
|
+
로컬 규칙 검사는 `npx @conscience-technology/ovenn check [경로]`로 실행한다(서버 불필요, 위반 시 종료 코드 1, 기본 범위에서 `components/ovenn` 제외). 이 스킬의 `scripts/validate.mjs`도 같은 엔진이다. 정당한 예외는 `ovenn-validate-disable-next-line <규칙>` 또는 이유를 붙인 `ovenn-validate-disable-file <규칙> -- <이유>`로 표시한다. 결과는 자동 검사 증거이며 독립 시각 검수와 구분한다. `hard/*` 규칙은 `prompts/RULES.md`의 필수 규칙 중 정적으로 잡히는 것(em dash·구분 문자·IconButton 라벨·placeholder 전용 입력·상호작용 중첩은 error, filled 배경·액티브바는 review)이다.
|
|
13
13
|
|
|
14
14
|
조립 전 역할별 componentPlan과 실제 부품 사용 검증은 `prompts/ASSEMBLY.md`의 v2 계약을 따른다. MCP의 `check_component_usage` 또는 `ovenn info check-component-usage --local`로 확인한다.
|
|
@@ -10,8 +10,14 @@ const digest=value=>createHash('sha256').update(value).digest('hex');
|
|
|
10
10
|
export function componentExports(source){return [...new Set([...source.matchAll(/export\s*\{([^}]+)\}/g)].flatMap(match=>match[1].split(',').map(value=>value.trim()).filter(value=>value&&!value.startsWith('type ')).map(value=>value.split(/\s+as\s+/).at(-1))))];}
|
|
11
11
|
function exportFolder(registry,name,files={},base='components/') {return registry.find(entry=>entry.status!=='wip'&&(entry.folder===name||(entry.exports||componentExports(files[base+entry.folder+'/index.ts']||'')).includes(name)))?.folder;}
|
|
12
12
|
export function componentContract(text){const match=text.match(/<!-- component-contract -->\s*```json\s*([\s\S]*?)```/);return match?JSON.parse(match[1]):null;}
|
|
13
|
+
// The checks parse with TypeScript's JS compiler API. TypeScript 7's `typescript` package no longer exposes it,
|
|
14
|
+
// so a TS 7 project resolves it from @typescript/typescript6, the compatibility package Microsoft publishes for tools.
|
|
13
15
|
export function loadTypeScript(root=process.cwd()){
|
|
14
|
-
|
|
16
|
+
let native=null;
|
|
17
|
+
for(const base of [root,path.join(root,'web')])for(const name of ['typescript','@typescript/typescript6']){
|
|
18
|
+
try{const ts=createRequire(path.join(base,'package.json'))(name);if(typeof ts.createSourceFile==='function'&&typeof ts.preProcessFile==='function')return ts;native??=ts.version;}catch{}
|
|
19
|
+
}
|
|
20
|
+
if(native)throw new Error(`TypeScript ${native} has no JS compiler API, which this check needs. Install the compatibility package next to it: npm install -D @typescript/typescript6. No packages were installed automatically.`);
|
|
15
21
|
throw new Error('TypeScript parser is unavailable. Use a project with TypeScript installed; no packages were installed automatically.');
|
|
16
22
|
}
|
|
17
23
|
export function planSchema(){return {type:'object',additionalProperties:false,required:['version','scope','direction','roles'],properties:{version:{type:'string',enum:['2']},scope:{type:'string',enum:['page','partial','component']},direction:{type:'string',minLength:1},roles:{type:'array',minItems:1,items:{type:'object',additionalProperties:false,required:['id','purpose','component','components','strategy','source','originalHash','reason','requires','sourceFiles','evidence'],properties:{id:{type:'string'},purpose:{type:'string'},component:{type:'string'},components:{type:'array',items:{type:'string'}},strategy:{type:'string',enum:['reuse','compose','derived','custom','preserved']},source:{type:'string'},originalHash:{type:'string'},reason:{type:'string'},requires:{type:'array',items:{type:'string'}},sourceFiles:{type:'array',items:{type:'string'}},evidence:{type:'array',items:{type:'string'}}}}}}};}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// One validation engine for every entry point: `ovenn check`, this skill's validate.mjs and the MCP check_hardcoding tool.
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { checkHardcoded } from '../rules/hardcoded.mjs';
|
|
5
|
+
import { checkGhostTokens, loadDeclaredTokens } from '../rules/ghost-tokens.mjs';
|
|
6
|
+
import { checkMemoryRules } from '../rules/memory-rules.mjs';
|
|
7
|
+
import { checkDocSync } from '../rules/doc-sync.mjs';
|
|
8
|
+
import { checkHardRules } from '../rules/hard-rules.mjs';
|
|
9
|
+
|
|
10
|
+
export const SOURCE_EXT = new Set(['.tsx', '.ts', '.jsx', '.js', '.mjs', '.css']);
|
|
11
|
+
const SKIP_DIRS = new Set(['node_modules', '.next', '.git', '.ovenn', '.turbo', '.vercel', 'out', 'dist', 'build', 'coverage']);
|
|
12
|
+
|
|
13
|
+
function globToRegex(glob) {
|
|
14
|
+
let re = '^';
|
|
15
|
+
for (let i = 0; i < glob.length; i++) {
|
|
16
|
+
const c = glob[i];
|
|
17
|
+
if (c === '*') {
|
|
18
|
+
if (glob[i + 1] === '*') { re += '.*'; i++; if (glob[i + 1] === '/') i++; } else re += '[^/]*';
|
|
19
|
+
} else if (c === '?') re += '[^/]';
|
|
20
|
+
else if ('.+^$(){}|[]\\'.includes(c)) re += '\\' + c;
|
|
21
|
+
else re += c;
|
|
22
|
+
}
|
|
23
|
+
return new RegExp(re + '$');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function walk(dir, out) {
|
|
27
|
+
let entries;
|
|
28
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
29
|
+
for (const e of entries) {
|
|
30
|
+
if (SKIP_DIRS.has(e.name) || e.isSymbolicLink()) continue;
|
|
31
|
+
const full = path.join(dir, e.name);
|
|
32
|
+
if (e.isDirectory()) walk(full, out); else if (e.isFile()) out.push(full);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Files, folders or globs relative to root. `exclude` holds root-relative folder prefixes left out of folder and glob matches. */
|
|
37
|
+
export function collectFiles(root, patterns, { exclude = [] } = {}) {
|
|
38
|
+
const matched = new Set(), all = [];
|
|
39
|
+
const excluded = (rel) => exclude.some((prefix) => rel === prefix || rel.startsWith(`${prefix}/`));
|
|
40
|
+
for (const pattern of patterns) {
|
|
41
|
+
const full = path.resolve(root, pattern);
|
|
42
|
+
const stat = fs.existsSync(full) ? fs.statSync(full) : null;
|
|
43
|
+
if (stat?.isFile()) { matched.add(full); continue; }
|
|
44
|
+
if (stat?.isDirectory()) {
|
|
45
|
+
const found = []; walk(full, found);
|
|
46
|
+
for (const f of found) if (!excluded(rel(root, f))) matched.add(f);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (!all.length) walk(root, all);
|
|
50
|
+
const re = globToRegex(pattern.replace(/^\.\//, ''));
|
|
51
|
+
for (const f of all) if (re.test(rel(root, f)) && !excluded(rel(root, f))) matched.add(f);
|
|
52
|
+
}
|
|
53
|
+
return [...matched].sort();
|
|
54
|
+
}
|
|
55
|
+
const rel = (root, file) => path.relative(root, file).split(path.sep).join('/');
|
|
56
|
+
|
|
57
|
+
// `/* ovenn-validate-disable-file hardcoded/hex-color -- brand colours are the format signal */` turns rules off for a file;
|
|
58
|
+
// `ovenn-validate-disable-next-line <rules>` and the repository linter's `/* lint-hardcoded: ignore */` (same or previous line) for one line.
|
|
59
|
+
function suppressions(content) {
|
|
60
|
+
const file = new Set(), lines = new Map();
|
|
61
|
+
const add = (line, ids) => { const set = lines.get(line) ?? new Set(); for (const id of ids) set.add(id); lines.set(line, set); };
|
|
62
|
+
content.split('\n').forEach((text, index) => {
|
|
63
|
+
const whole = text.match(/ovenn-validate-disable-file\s+([\w\-/,*\s]+?)\s+--\s+\S/);
|
|
64
|
+
if (whole) for (const id of whole[1].split(/[\s,]+/).filter(Boolean)) file.add(id);
|
|
65
|
+
const next = text.match(/ovenn-validate-disable-next-line\s+([\w\-/,*\s]+)/);
|
|
66
|
+
if (next) add(index + 2, next[1].split(/[\s,]+/).filter(Boolean));
|
|
67
|
+
if (/lint-hardcoded:\s*ignore/.test(text)) { add(index + 1, ['hardcoded']); add(index + 2, ['hardcoded']); }
|
|
68
|
+
});
|
|
69
|
+
const matches = (set, ruleId) => set.has(ruleId) || set.has(ruleId.split('/')[0]) || set.has(`${ruleId.split('/')[0]}/*`);
|
|
70
|
+
return (line, ruleId) => matches(file, ruleId) || (lines.has(line) && matches(lines.get(line), ruleId));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Rules over one source text. Without `declared`, undeclared-token checks are skipped (no project to resolve against).
|
|
75
|
+
* @param {{ code: string, ext: string, rel?: string, declared?: Set<string> }} input
|
|
76
|
+
*/
|
|
77
|
+
export function validateSource({ code, ext, rel: name = `input${ext}`, declared }) {
|
|
78
|
+
const ctx = { file: name, rel: name, content: code, ext };
|
|
79
|
+
// Tests are not shipped UI; their fixtures deliberately contain literals.
|
|
80
|
+
if (!SOURCE_EXT.has(ext) || /\.test\.[cm]?[jt]sx?$/.test(name)) return [];
|
|
81
|
+
const suppressed = suppressions(code);
|
|
82
|
+
return [
|
|
83
|
+
...checkHardcoded(ctx), ...(declared ? checkGhostTokens(ctx, declared) : []), ...checkMemoryRules(ctx), ...checkHardRules(ctx),
|
|
84
|
+
].filter((v) => !suppressed(v.line, v.ruleId)).map((v) => ({ ...v, rel: name }));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Rules over project files; returns violations sorted by file and line. */
|
|
88
|
+
export function validateFiles(root, files, { docSync = true } = {}) {
|
|
89
|
+
const declared = loadDeclaredTokens(root);
|
|
90
|
+
const violations = [];
|
|
91
|
+
for (const file of files) {
|
|
92
|
+
const ext = path.extname(file);
|
|
93
|
+
violations.push(...validateSource({ code: fs.readFileSync(file, 'utf8'), ext, rel: rel(root, file), declared }));
|
|
94
|
+
}
|
|
95
|
+
if (docSync) violations.push(...checkDocSync(files, root));
|
|
96
|
+
violations.sort((a, b) => a.rel.localeCompare(b.rel) || a.line - b.line);
|
|
97
|
+
const errors = violations.filter((v) => v.severity !== 'review');
|
|
98
|
+
return { files: files.length, violations, errors: errors.length, reviews: violations.length - errors.length };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function formatReport(report) {
|
|
102
|
+
if (!report.violations.length) return `0개 위반 (${report.files}개 파일 검사)\n`;
|
|
103
|
+
const lines = report.violations.map((v) => `${v.rel}:${v.line} — ${v.severity === 'review' ? 'REVIEW' : 'ERROR'} — ${v.ruleId} — ${v.message}${v.suggest ? `\n 제안: ${v.suggest}` : ''}`);
|
|
104
|
+
return `${lines.join('\n')}\n\n${report.errors}개 오류, ${report.reviews}개 검토 (${new Set(report.violations.map((v) => v.rel)).size}개 파일)\n`;
|
|
105
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { validateSource, validateFiles, collectFiles } from './engine.mjs';
|
|
7
|
+
|
|
8
|
+
const ids = (violations) => violations.map((v) => `${v.line}:${v.ruleId}`);
|
|
9
|
+
|
|
10
|
+
test('a custom property spanning lines is a definition, and lines after a comment keep their numbers', () => {
|
|
11
|
+
const css = '/* one\n two */\n:root {\n --ring:\n 0 0 0 2px oklch(0.6 0.1 250);\n}\n.x { color: #f00; }\n';
|
|
12
|
+
assert.deepEqual(ids(validateSource({ code: css, ext: '.css' })), ['7:hardcoded/hex-color']);
|
|
13
|
+
});
|
|
14
|
+
test('idioms are not design values: inherit, em, pills, mask stops, grid tracks', () => {
|
|
15
|
+
const css = '.a { font-family: inherit; width: 1em; border-radius: 999px; mask-image: linear-gradient(#000, transparent); grid-template-columns: 240px 1fr; }';
|
|
16
|
+
assert.deepEqual(validateSource({ code: css, ext: '.css' }), []);
|
|
17
|
+
});
|
|
18
|
+
test('bare numbers count as px only inside JSX style objects', () => {
|
|
19
|
+
const tsx = 'const box = { left: 2, top: 3 };\nexport const A = () => <div style={{ padding: 13, opacity: 1 }} />;\n';
|
|
20
|
+
assert.deepEqual(ids(validateSource({ code: tsx, ext: '.tsx' })), ['2:hardcoded/size']);
|
|
21
|
+
});
|
|
22
|
+
test('suppressions: next-line, the repository marker, and file-level only with a reason', () => {
|
|
23
|
+
assert.deepEqual(validateSource({ code: '/* ovenn-validate-disable-next-line hardcoded/hex-color */\n.a { color: #f00; }', ext: '.css' }), []);
|
|
24
|
+
assert.deepEqual(validateSource({ code: '.a { color: #f00; } /* lint-hardcoded: ignore */', ext: '.css' }), []);
|
|
25
|
+
assert.deepEqual(validateSource({ code: '/* ovenn-validate-disable-file hardcoded -- token layer */\n.a { color: #f00; }', ext: '.css' }), []);
|
|
26
|
+
assert.equal(validateSource({ code: '/* ovenn-validate-disable-file hardcoded */\n.a { color: #f00; }', ext: '.css' }).length, 1);
|
|
27
|
+
});
|
|
28
|
+
test('tokens set at runtime from TSX or completed at runtime are declared', (t) => {
|
|
29
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'ovenn-engine-'));
|
|
30
|
+
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
31
|
+
fs.mkdirSync(path.join(root, 'components'));
|
|
32
|
+
fs.writeFileSync(path.join(root, 'components/Zoom.tsx'), 'export const Z = () => <div style={{ "--zoom": 2 } as never} />;\n');
|
|
33
|
+
fs.writeFileSync(path.join(root, 'components/zoom.module.css'), '.z { scale: var(--zoom); color: var(--chart-${1}); fill: var(--missing); }\n');
|
|
34
|
+
fs.writeFileSync(path.join(root, 'components/zoom.test.mjs'), "const c = '#f00';\n");
|
|
35
|
+
const report = validateFiles(root, collectFiles(root, ['components']), { docSync: false });
|
|
36
|
+
assert.deepEqual(report.violations.map((v) => `${v.rel}:${v.ruleId}:${v.message.split(': ')[1]}`), ['components/zoom.module.css:ghost-token/undeclared:--missing']);
|
|
37
|
+
});
|
|
38
|
+
test('folder matches leave out excluded prefixes, explicit files do not', (t) => {
|
|
39
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'ovenn-engine-'));
|
|
40
|
+
t.after(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
41
|
+
fs.mkdirSync(path.join(root, 'components/ovenn'), { recursive: true });
|
|
42
|
+
fs.writeFileSync(path.join(root, 'components/ovenn/a.css'), '');
|
|
43
|
+
fs.writeFileSync(path.join(root, 'components/b.css'), '');
|
|
44
|
+
assert.deepEqual(collectFiles(root, ['components'], { exclude: ['components/ovenn'] }).map((f) => path.relative(root, f)), ['components/b.css']);
|
|
45
|
+
assert.equal(collectFiles(root, ['components/ovenn/a.css'], { exclude: ['components/ovenn'] }).length, 1);
|
|
46
|
+
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
// Blank out comments but keep every newline, so offsets and line numbers still point at the original source.
|
|
2
|
+
const blank = (text) => text.replace(/[^\n]/g, ' ');
|
|
1
3
|
export function stripComments(src, ext) {
|
|
2
|
-
if (ext === '.css') return src.replace(/\/\*[\s\S]*?\*\//g,
|
|
4
|
+
if (ext === '.css') return src.replace(/\/\*[\s\S]*?\*\//g, blank);
|
|
3
5
|
return src
|
|
4
|
-
.replace(/\/\*[\s\S]*?\*\//g,
|
|
5
|
-
.replace(/(^|[^:])\/\/[^\n]*/g, (m, p) => p +
|
|
6
|
+
.replace(/\/\*[\s\S]*?\*\//g, blank)
|
|
7
|
+
.replace(/(^|[^:])\/\/[^\n]*/g, (m, p) => p + blank(m.slice(p.length)));
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export function lineOf(src, idx) {
|