@conscience-technology/ovenn 0.7.2 → 0.7.4

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.
Files changed (69) hide show
  1. package/assets/components/Button/Button.module.css +19 -0
  2. package/assets/components/CommandPalette/CommandPalette.module.css +1 -1
  3. package/assets/components/DatePicker/DatePicker.module.css +3 -2
  4. package/assets/components/Input/Input.module.css +1 -1
  5. package/assets/components/Select/Select.module.css +5 -1
  6. package/assets/components/TimePicker/TimePicker.module.css +3 -2
  7. package/assets/components/_utils.css +2 -2
  8. package/assets/components/tokens.css +1 -9
  9. package/assets/prompts/PRINCIPLES.md +1 -1
  10. package/assets/prompts/RULES.md +31 -0
  11. package/assets/prompts/axes/palette.md +1 -1
  12. package/assets/prompts/axes/voice.md +2 -2
  13. package/assets/prompts/components/_variants.md +2 -2
  14. package/assets/prompts/components/accordion.md +1 -1
  15. package/assets/prompts/components/app-frame.md +2 -2
  16. package/assets/prompts/components/avatar.md +2 -2
  17. package/assets/prompts/components/badge.md +1 -1
  18. package/assets/prompts/components/button.md +2 -1
  19. package/assets/prompts/components/calendar.md +1 -1
  20. package/assets/prompts/components/canvas-node.md +1 -1
  21. package/assets/prompts/components/chart-radial.md +1 -1
  22. package/assets/prompts/components/chart.md +1 -1
  23. package/assets/prompts/components/chat-reactions.md +1 -1
  24. package/assets/prompts/components/checkbox-card.md +3 -3
  25. package/assets/prompts/components/checkbox.md +1 -1
  26. package/assets/prompts/components/chip.md +4 -4
  27. package/assets/prompts/components/code-block.md +1 -1
  28. package/assets/prompts/components/combobox.md +3 -3
  29. package/assets/prompts/components/comment.md +2 -2
  30. package/assets/prompts/components/control-group.md +1 -1
  31. package/assets/prompts/components/data-table.md +1 -1
  32. package/assets/prompts/components/disclosure.md +1 -1
  33. package/assets/prompts/components/dropdown-menu.md +1 -1
  34. package/assets/prompts/components/event-chip.md +2 -2
  35. package/assets/prompts/components/file-icon.md +1 -1
  36. package/assets/prompts/components/file-upload.md +1 -1
  37. package/assets/prompts/components/icon-button.md +1 -1
  38. package/assets/prompts/components/input.md +3 -3
  39. package/assets/prompts/components/menu-item.md +2 -2
  40. package/assets/prompts/components/metric-card.md +1 -1
  41. package/assets/prompts/components/mini-calendar.md +1 -1
  42. package/assets/prompts/components/page-header.md +1 -1
  43. package/assets/prompts/components/segmented-chart.md +1 -1
  44. package/assets/prompts/components/sidebar.md +3 -3
  45. package/assets/prompts/components/skeleton.md +3 -3
  46. package/assets/prompts/components/tab-strip.md +1 -1
  47. package/assets/prompts/components/table-cell.md +1 -1
  48. package/assets/prompts/components/table-header.md +1 -1
  49. package/assets/prompts/components/table-row-edit.md +3 -3
  50. package/assets/prompts/components/table-row.md +1 -1
  51. package/assets/prompts/components/table-toolbar.md +1 -1
  52. package/assets/prompts/components/timeline-view.md +2 -2
  53. package/assets/prompts/components/toast.md +1 -1
  54. package/assets/prompts/components/tooltip.md +3 -3
  55. package/assets/prompts/components/tree-nav.md +2 -2
  56. package/assets/prompts/primitives/scroll.md +1 -1
  57. package/assets/prompts/tokens/color.md +4 -5
  58. package/assets/skills/ovenn-validate/SKILL.md +1 -1
  59. package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +27 -5
  60. package/assets/skills/ovenn-validate/scripts/rules/hard-rules.mjs +174 -0
  61. package/assets/skills/ovenn-validate/scripts/rules/hard-rules.test.mjs +57 -0
  62. package/assets/skills/ovenn-validate/scripts/validate.mjs +2 -0
  63. package/package.json +1 -1
  64. package/src/commands/info.js +5 -4
  65. package/src/commands/update.js +5 -1
  66. package/src/utils/agents.js +28 -17
  67. package/src/utils/client-bridges.js +4 -2
  68. package/src/utils/component-usage.js +27 -5
  69. package/src/utils/patch.js +2 -1
@@ -19,7 +19,7 @@
19
19
  - `<section>` **안에** 넣지 않는다: 전역 `.content section`이 `padding-top: 80px`를 꽂는다. PageHeader는 section 바깥, body 최상단에 둔다 ([[feedback_no_semantic_tags_in_components]]).
20
20
  - 배경과 테두리로 꾸밀 때 뚜렷한 이중 경계를 만들지 않는다. 아주 미세한 표시 색 차이만 허용한다 ([[PRINCIPLES]] §5b).
21
21
  - Eyebrow에 uppercase + wide letter-spacing 조합 금지 ([[feedback_no_uppercase]]).
22
- - Lead에 em dash·ellipsis 금지 ([[feedback_no_em_dash]]).
22
+ - [HARD] Lead에 em dash·ellipsis 금지 ([[feedback_no_em_dash]]).
23
23
  - 페이지에 두 개 쓰지 않는다. 하위 섹션 head는 `<h2>`로.
24
24
  - 데이터 요약(KPI·숫자·차트)을 PageHeader에 끼우지 않는다: body 첫 섹션의 [[components/metric-card]] 자리.
25
25
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  ### Don't
26
26
  - 완료율을 나타내는 `progressbar` 역할을 주지 않는다. 단일 작업 완료율은 [[components/progress-bar]].
27
- - 색만으로 데이터를 설명하지 않는다. 수치 목록은 항상 유지한다.
27
+ - [HARD] 색만으로 데이터를 설명하지 않는다. 수치 목록은 항상 유지한다.
28
28
  - 클릭 콜백 없이 가짜 상세 버튼을 만들지 않는다.
29
29
  - 음수·NaN·Infinity를 유효한 비중으로 쓰지 않는다. 방어적으로 0으로 정규화하며 금융 손익처럼 음수 의미가 필요한 데이터는 Bar Chart를 쓴다.
30
30
 
@@ -77,7 +77,7 @@ Header는 **가로 행**이기 때문에 Section을 넣으면 nav 전체가 가
77
77
  </Sidebar.Body>
78
78
  ```
79
79
 
80
- - **`<Sidebar.Item>` 과 `<Sidebar.Section>`** export도 존재하지만 **일반 메뉴에는 쓰지 않는다**: brand/profile preset의 뼈대 공유용 내부 요소. 일반 네비게이션 자리는 `MenuItem.Section` + `MenuItem` 하나로 통일 ([[components/menu-item]]).
80
+ - **`Sidebar.Section` + `Sidebar.Item`은 `MenuItem.Section` + `MenuItem`의 사이드바 preset이다.** `Sidebar.Item`은 내부에서 `MenuItem`을 렌더하므로 두 조립은 같은 결과를 낸다. 일반 메뉴에는 둘 중 하나를 쓰되 한 사이드바 안에서 섞지 않는다. 세밀 제어(description·avatar·커스텀 trailing)가 필요하면 `MenuItem.Section` + `MenuItem`을 직접 쓴다 ([[components/menu-item]]). 아래 예시는 `Sidebar.Item` 기준이다.
81
81
  - Section 안 Item 사이 세로 리듬·active 톤·leading/trailing 슬롯이 전부 MenuItem에 녹아 있어 수작업 조립이 불필요.
82
82
 
83
83
  ### AppFrame.Sidebar 슬롯 안에 넣는다 (중요)
@@ -117,8 +117,8 @@ AppFrame 밖에서 바깥 수제 grid(`grid-template-columns: 260px 1fr` 등)에
117
117
  - Sidebar 자체에 padding/width를 CSS로 덮지 않는다. `--sidebar-w*` 토큰 경유.
118
118
  - `.root`에 padding을 꽂지 않는다: Body가 스크롤 컨테이너라 스크롤바가 안쪽으로 밀려 가장자리에 안 붙는다 ([[project_scroll_rule]]).
119
119
  - **Sidebar 큰 컨테이너(root/Header/Body/Footer wrapper)에 좌우 패딩 금지**. 좌우/상하 축은 preset slot(`data-sidebar-slot`) 또는 안쪽 콘텐츠 래퍼에 공급. `--sidebar-pad-x`·`--sidebar-pad-y` 토큰 사용 금지(벤더에서 폐기됨).
120
- - **Sidebar 내부 Input은 `outline` 기본**: `line` 금지, 흰색·연한 배경의 `filled` 금지.
121
- - **액티브바는 기본적으로 사용하지 않는다.** 선택 표면·텍스트 위계로 표시한다. 필요한 바를 둥근 행의 border·inset shadow에 붙여 곡선으로 만드는 구현은 금지한다([[PRINCIPLES]] §5c).
120
+ - [HARD] **Sidebar 내부 Input은 `outline` 기본**: `line` 금지, 흰색·연한 배경의 `filled` 금지.
121
+ - [HARD] **액티브바는 기본적으로 사용하지 않는다.** 선택 표면·텍스트 위계로 표시한다. 필요한 바를 둥근 행의 border·inset shadow에 붙여 곡선으로 만드는 구현은 금지한다([[PRINCIPLES]] §5c).
122
122
  - Brand symbol·wordmark 크기 override 금지. `--sidebar-brand-symbol-max`·`--sidebar-brand-wordmark-max` 상한 안에서만.
123
123
  - **Body 안 섹션 리스트가 길어서 스크롤이 필요할 때**, 섹션들에 `flex-shrink`를 그대로 두지 않는다. Body는 `display:flex column`이라 자식(Section)이 기본 `flex-shrink:1`로 수축되어 header가 몇 px로 뭉개지고 아이템이 사라져 보인다. 해결: Body 직속 자식에 `flex: 0 0 auto`를 걸어 각 섹션이 자기 콘텐츠 전체 높이를 유지하게 하고, 스크롤은 Body의 `overflow-y:auto`가 담당하게 한다.
124
124
  - **2단 쉘(아이콘 Rail + Sidebar) 조립 시 바깥 수제 flex 금지**: `<Sidebar.Rail>` + `<Sidebar.Main>` compound를 쓴다. `.root:has(.rail)` CSS가 자동으로 flex row로 전환하고 Rail/Main 폭·경계선·높이를 벤더가 공급. 과거 `SidebarSplit`는 panel이 자체 flex 체인으로 섹션들을 짓눌러 header가 4px로 뭉개지는 함정이 있어 폐기됨.
@@ -17,9 +17,9 @@ Skeleton은 aria-hidden인 span이며 포커스나 로딩 상태를 따로 만
17
17
  - 시스템 모션 축소 설정을 유지한다.
18
18
 
19
19
  ### Don't
20
- - Skeleton에 버튼·링크·tabIndex를 넣거나 가짜 콘텐츠로 읽히게 하지 않는다.
21
- - 오류나 빈 상태를 영구 로딩으로 가리지 않는다.
22
- - 로딩마다 상태 알림을 중복 낭독하지 않는다.
20
+ - [HARD] Skeleton에 버튼·링크·tabIndex를 넣거나 가짜 콘텐츠로 읽히게 하지 않는다.
21
+ - [HARD] 오류나 빈 상태를 영구 로딩으로 가리지 않는다.
22
+ - [HARD] 로딩마다 상태 알림을 중복 낭독하지 않는다.
23
23
 
24
24
  ### Fallback
25
25
  콘텐츠 형태를 모르면 기본 `rect` 하나로 영역만 확보한다. 애니메이션은 기본 `shimmer`이며 모션 축소 환경에서는 자동으로 멈춘다. 로딩 시간이 짧거나 자리를 미리 알 수 없으면 Skeleton 대신 [[components/spinner]]를 쓴다. 로딩이 실패하면 Skeleton을 유지하지 않고 오류·빈 상태로 전환한다.
@@ -38,7 +38,7 @@ const [activeId, setActiveId] = useState<string>(openDocs[0].id);
38
38
  - **x 아이콘을 상시 노출하지 말 것**: 시각 노이즈. hover·active에만, 활성 탭은 늘 보이는 게 맞다.
39
39
  - **`<svg>` 인라인 금지**: leadingIcon은 Icon·이미지·브랜드 svg는 OK지만 "아이콘용 raw svg"는 [[feedback_no_inline_svg]].
40
40
  - **trailing에 생짜 `<button>` 넣지 말 것**: Button·IconButton·DropdownMenu 트리거 등 Ovenn 컴포넌트 경유. 자리별 간격·디바이더는 wrapper가 담당하니 소비처는 버튼만 넘김.
41
- - **탭 사이에 가운뎃점·대시 구분자 금지**: [[feedback_no_bullet_separator]]. 탭 자체가 구분된 블록.
41
+ - [HARD] **탭 사이에 가운뎃점·대시 구분자 금지**: [[feedback_no_bullet_separator]]. 탭 자체가 구분된 블록.
42
42
 
43
43
  ### Fallback
44
44
  자리 애매하면 **Topbar 아래 2번째 줄**(shell 2단), size 애매하면 **md** (shell chrome에서도 sm보다 md가 안정적: Topbar와 같은 리듬).
@@ -14,7 +14,7 @@
14
14
 
15
15
  ### Don't
16
16
  - 셀 너비나 좌우 패딩을 포맷터에서 중복 지정하지 않는다.
17
- - 아이콘만으로 텍스트의 의미를 대체하지 않는다.
17
+ - [HARD] 아이콘만으로 텍스트의 의미를 대체하지 않는다.
18
18
  - 표시 전용 셀에 불필요한 상호작용을 추가하지 않는다.
19
19
  - TableCellIcon·TableCellLink는 제공하지 않는다. 아이콘은 Text의 icon 슬롯으로 조합한다.
20
20
 
@@ -24,7 +24,7 @@
24
24
  - 이 컴포넌트 안에서 데이터를 정렬하지 않는다. `onSortChange`만 발화하고 정렬은 상위 Table의 책임.
25
25
  - variant 시각을 `background`/`border` 직접 지정으로 커스터마이즈하지 않는다: Palette·Mode 축 스왑이 깨진다. 색이 필요하면 축·프리셋에 정의.
26
26
  - resize handle 폭을 CSS로 좁히지 않는다: 8px 히트 영역이 접근성 최소치.
27
- - 셀 안에 두 개 이상의 인터랙션 요소(라벨 정렬 + 아이콘 필터 등)를 넣지 않는다. 셀 = 하나의 columnheader.
27
+ - [HARD] 셀 안에 두 개 이상의 인터랙션 요소(라벨 정렬 + 아이콘 필터 등)를 넣지 않는다. 셀 = 하나의 columnheader.
28
28
  - `reorderable=off`에서 hover 배경을 억지로 살리지 않는다: "이동 불가한데 반응만 있으면" 의미 없는 시각 노이즈.
29
29
  - 3-state sort(asc→desc→none)로 확장하지 않는다. 정렬 해제는 "다른 컬럼 클릭"으로 대체: 클릭당 결과가 명확해야 함.
30
30
 
@@ -18,10 +18,10 @@ Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는
18
18
  - **편집 컨트롤은 호출 측 책임**: Input은 `Enter` 커밋 / `Esc` 취소 / `Tab` 다음 셀로 쓰는 게 Notion/Excel 표준. Select는 `defaultOpen`으로 셀 활성화와 동시에 open해 한 번의 클릭으로 선택까지 끝나게. `autoFocus` 대신 `focus({ preventScroll: true })` + `select()`를 쓸 것: autoFocus는 scrollIntoView로 페이지가 튐.
19
19
 
20
20
  ### Don't
21
- - 행 전체에 `onClick`/`href`를 걸지 않는다. edit 모드는 **셀**이 상호작용 단위: 행 전체 핸들러가 있으면 셀 활성화와 충돌해 포커스/편집이 꼬인다. 행 라우팅이 필요하면 [[components/table-row]]를 쓸 것.
21
+ - [HARD] 행 전체에 `onClick`/`href`를 걸지 않는다. edit 모드는 **셀**이 상호작용 단위: 행 전체 핸들러가 있으면 셀 활성화와 충돌해 포커스/편집이 꼬인다. 행 라우팅이 필요하면 [[components/table-row]]를 쓸 것.
22
22
  - 세로 구분선을 끄지 않는다. edit 모드의 **정체성**: 끄면 navigate 모드와 시각 구분이 사라져 사용자가 편집 가능 여부를 인지하지 못함.
23
- - 셀 안에 또 다른 anchor/button을 중첩하지 않는다. 셀 자체가 포커스 타겟(`tabIndex=0`): nested interactive는 접근성·키보드 탐색 파괴.
24
- - `activeCellKey`를 여러 개로 동시에 유지하지 않는다. "지금 편집 중"은 한 번에 하나. 멀티셀 선택이 필요하면 별도 selection state로 분리(미래 기능).
23
+ - [HARD] 셀 안에 또 다른 anchor/button을 중첩하지 않는다. 셀 자체가 포커스 타겟(`tabIndex=0`): nested interactive는 접근성·키보드 탐색 파괴.
24
+ - [HARD] `activeCellKey`를 여러 개로 동시에 유지하지 않는다. "지금 편집 중"은 한 번에 하나. 멀티셀 선택이 필요하면 별도 selection state로 분리(미래 기능).
25
25
  - hover가 selected/active 셀을 덮지 않는다: 컴포넌트 CSS가 보장([[feedback/hover-over-active]]).
26
26
  - `background`를 직접 지정하지 않는다. selected/active는 축 토큰(`--primary-subtle`)으로 자동.
27
27
  - 사이즈·variant를 쓰려 하지 않는다: 애초에 prop이 없다. 밀도 다른 테이블이 필요하면 edit 대신 [[components/table-row]]의 size로 해결.
@@ -18,7 +18,7 @@
18
18
  - **셀 기본 콘텐츠는 포맷터**: `columns[].render` 안에는 `TableCell*` 포맷터 또는 1개의 레벨 안쪽 요소까지. 보조 Button/링크/메뉴는 별도 행동으로 넣을 수 있다. 자식 컨트롤 이벤트가 주 행동을 실행하지 않도록 컴포넌트가 분리한다.
19
19
 
20
20
  ### Don't
21
- - 주 행동 링크/버튼 안에 다른 컨트롤을 중첩하지 않는다. root는 role=row이며 셀 안 보조 링크/버튼은 주 행동과 형제 관계다. 일반 보조 작업 때문에 셀 편집 모드로 바꾸지 않는다.
21
+ - [HARD] 주 행동 링크/버튼 안에 다른 컨트롤을 중첩하지 않는다. root는 role=row이며 셀 안 보조 링크/버튼은 주 행동과 형제 관계다. 일반 보조 작업 때문에 셀 편집 모드로 바꾸지 않는다.
22
22
  - `line` 행에 `background`를 직접 지정해 활성/hover 색을 커스텀하지 않는다. `active` prop + 축 토큰(hover) 조합으로 해결.
23
23
  - `size`로 셀 padding을 바꾸지 않는다: 사이즈는 세로 폭·폰트만. 셀 안 요소(badge·chip)의 리듬이 깨짐.
24
24
  - 셀 사이 세로 구분선을 넣지 않는다. navigate 모드는 "읽는 행": 세로 구분선은 [[components/table-row-edit]](엑셀/Notion 스타일 셀 편집) 전용 시각이다.
@@ -20,7 +20,7 @@
20
20
  ### Don't
21
21
  - 새 구성을 만들기 위해 간편 API의 filters/actions 슬롯 안에 모든 도구를 밀어 넣지 않는다. 순서·위치가 다르면 Root부터 조합한다.
22
22
  - 모든 툴바를 회색 배경·고정된 좌우 슬롯·동일 버튼 외형으로 제한하지 않는다.
23
- - 배경이나 스타일 때문에 검색 입력·포커스·disabled·상태·메뉴 의미를 제거하지 않는다.
23
+ - [HARD] 배경이나 스타일 때문에 검색 입력·포커스·disabled·상태·메뉴 의미를 제거하지 않는다.
24
24
  - 검색어·날짜·선택 값이 바뀌어도 실제 목록이 변하지 않는 장식 필터를 제품 기능으로 제시하지 않는다.
25
25
 
26
26
  ### 자유 조합
@@ -13,8 +13,8 @@
13
13
  - EventChip의 7개 tone과 Shape/Density 토큰을 재사용한다. 뷰 전환·필터·추가 액션은 호스트 툴바가 담당한다.
14
14
 
15
15
  ### Don't
16
- - 막대 너비를 제목 길이에 맞춰 바꾸지 않는다. 너비는 실제 기간이다.
17
- - 계산 불가능한 표시용 문자열을 시작·종료 값으로 넣지 않는다.
16
+ - [HARD] 막대 너비를 제목 길이에 맞춰 바꾸지 않는다. 너비는 실제 기간이다.
17
+ - [HARD] 계산 불가능한 표시용 문자열을 시작·종료 값으로 넣지 않는다.
18
18
  - 기능 없는 추가·필터 버튼이나 총 일정 수를 장식으로 넣지 않는다.
19
19
 
20
20
  ### Fallback
@@ -21,7 +21,7 @@
21
21
  - action Button 2개 이상 두지 않는다: Toast 폭에서 신호 분산.
22
22
  - action variant에 `primary`·`destructive` solid 금지: inverse 표면에서 색 신호가 깨짐.
23
23
  - 긴 본문(2줄 초과) 금지: Toast는 1~2줄까지. 그 이상이면 [[components/callout]] 또는 [[components/banner]].
24
- - `placement="top-center"`에 `description` 전달 금지: Viewport가 숨긴다. multiline 신호 필요하면 placement부터 `bottom-right`로.
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 전용 애니.
27
27
  - 영구 안내·설명·FAQ 유도에 쓰지 않는다: [[components/callout]] 영역.
@@ -12,10 +12,10 @@ hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 co
12
12
  - `followMouse`는 긴 호버 요소(차트·툴바)에서만.
13
13
 
14
14
  ### Don't
15
- - 모바일/터치에서 hover에만 의존하는 힌트는 쓰지 않는다. 중요한 정보는 Label·description으로 제공한다. 클릭 완료 후 잠시 표시하는 결과 피드백은 허용한다.
16
- - 액션 버튼이 담긴 Tooltip 금지: [[components/popover]]로.
15
+ - [HARD] 모바일/터치에서 hover에만 의존하는 힌트는 쓰지 않는다. 중요한 정보는 Label·description으로 제공한다. 클릭 완료 후 잠시 표시하는 결과 피드백은 허용한다.
16
+ - [HARD] 액션 버튼이 담긴 Tooltip 금지: [[components/popover]]로.
17
17
  - content에 긴 문단 금지. 설명이 길면 Dialog 또는 Popover.
18
- - hover 시 사라지는 중요 정보 금지: WCAG 2.5.3 (호버 지속성) 위반.
18
+ - [HARD] hover 시 사라지는 중요 정보 금지: WCAG 2.5.3 (호버 지속성) 위반.
19
19
  - 표면 등장·퇴장을 별도 애니메이션으로 재작성하지 않는다. `.m-float`이 전담한다. 액션 결과의 내부 콘텐츠 전환은 아래 표준을 따른다.
20
20
 
21
21
  ### Fallback
@@ -15,9 +15,9 @@
15
15
  - 가이드선은 선택 행과 독립된 중립 직선이다. `--tree-nav-indent`, `--tree-nav-guide-color`, `--tree-nav-gap`으로 조정한다. `guides={false}`로 선만 숨길 수 있다.
16
16
 
17
17
  ### Don't
18
- - `role="tree"`를 덧붙이지 않는다. 이 부품은 이름 있는 `nav`와 중첩 `ul/li`, 펼침 `button`, 이동 `a`의 disclosure navigation이다. 단일 Tab 정지점과 방향키 조작이 필요한 데스크톱 파일 탐색기와 구별한다.
18
+ - [HARD] `role="tree"`를 덧붙이지 않는다. 이 부품은 이름 있는 `nav`와 중첩 `ul/li`, 펼침 `button`, 이동 `a`의 disclosure navigation이다. 단일 Tab 정지점과 방향키 조작이 필요한 데스크톱 파일 탐색기와 구별한다.
19
19
  - 분기에 `href`를 지정해 펼침과 이동을 한 행에 혼합하지 않는다. 현재 API에서 분기의 `href`는 사용하지 않는다.
20
- - `renderIcon`에 버튼·링크·입력 등 중첩 상호작용을 넣지 않는다.
20
+ - [HARD] `renderIcon`에 버튼·링크·입력 등 중첩 상호작용을 넣지 않는다.
21
21
  - 항목 수량·단계 번호·하단 프로필을 자동으로 추가하지 않는다. TreeNav는 계층 탐색 본문만 책임진다.
22
22
 
23
23
  ### Fallback
@@ -19,7 +19,7 @@
19
19
  ### Don't
20
20
  - 스크롤 컨테이너 자체에 `padding`을 걸지 않는다 → thumb이 콘텐츠와 겹쳐 보임.
21
21
  - items에 `margin: first-child/last-child` 트릭으로 여백 흉내내지 않는다 → 정렬 깨지고 유지보수 어려움.
22
- - `overflow: hidden` 위에 scrollTop을 JS로 조작하는 커스텀 스크롤은 접근성 무너짐. 반드시 네이티브 `overflow: auto`.
22
+ - [HARD] `overflow: hidden` 위에 scrollTop을 JS로 조작하는 커스텀 스크롤은 접근성 무너짐. 반드시 네이티브 `overflow: auto`.
23
23
 
24
24
  ### Fallback
25
25
  스크롤 필요 없는 경우엔 안쪽 트랙 패딩만으로도 무해. 그러니 규약을 컴포넌트 기본으로 두는 게 안전.
@@ -6,7 +6,7 @@ Semantic 이름으로 참조. 실제 색은 Palette(brand hex + paletteSet + mon
6
6
 
7
7
  ### Do
8
8
  - **브랜드 색은 하나 — `--primary`**. 주 액션(CTA·submit·confirm)·링크·활성 상태·강조 전부 primary로. 브랜드 톤이 둘로 쪼개지지 않게.
9
- - 텍스트 위계: 본문 `--fg`, 보조 `--fg-muted`, 메타 `--fg-subtle`, 플레이스홀더 `--fg-placeholder`. 플레이스홀더는 Select·날짜/시간 필드처럼 실제 텍스트로 렌더되는 자리가 있으므로 subtle보다 진한 알파로 AA 4.5:1을 지키되 본문보다 옅게 유지한다.
9
+ - 텍스트 위계: 본문 `--fg`, 보조 `--fg-muted`, 메타·플레이스홀더 `--fg-subtle`. 플레이스홀더는 기존 색 위에 공통 `--placeholder-opacity`를 적용하여 한 단계 옅게 표시한다.
10
10
  - 표면 위계: 페이지 `--bg`, 카드/영역 `--bg-subtle`, 코드/hover `--bg-muted`.
11
11
  - 앱 탑바와 본문 페이지 바탕은 언제나 같은 색을 쓴다. AppFrame은 공통 `--app-frame-bg`(기본 `--bg`)로 Topbar·Tabs·Content를 연결한다. 프로젝트에서 바탕을 바꾸면 이 매핑과 페이지 바탕을 함께 바꾼다. 사이드바와 카드의 표면 구분은 [[components/app-frame]]의 배경 계약을 따른다.
12
12
  - 다크의 일반 `--border`는 밝은 전경18% 알파, `--border-strong`은26% 알파로 구분한다. 전용 테이블 경계는 별도 토큰을 따른다.
@@ -16,7 +16,7 @@ Semantic 이름으로 참조. 실제 색은 Palette(brand hex + paletteSet + mon
16
16
  ### Don't
17
17
  - hex/rgb/oklch 리터럴 금지. 모든 색은 CSS 변수 경유.
18
18
  - Status hue를 재정의하지 않는다 (성공은 항상 초록, 경고는 항상 주황).
19
- - 밝은 배경에 흰 텍스트, 어두운 배경에 검은 텍스트 금지 — 항상 semantic pair 사용.
19
+ - [HARD] 밝은 배경에 흰 텍스트, 어두운 배경에 검은 텍스트 금지 — 항상 semantic pair 사용.
20
20
  - **`--accent`를 쓰지 않는다** — Ovenn은 Palette 축이 "한 프로젝트 = 한 brand hex"로 설계돼 primary 외의 별도 브랜드 색이 존재하지 않는다. 과거 `--accent` 참조는 `--primary`로 교체.
21
21
 
22
22
  ### Fallback
@@ -43,8 +43,7 @@ Semantic 이름으로 참조. 실제 색은 Palette(brand hex + paletteSet + mon
43
43
  |---|---|
44
44
  | `--fg` | 본문 |
45
45
  | `--fg-muted` | 보조 텍스트 |
46
- | `--fg-subtle` | 메타 |
47
- | `--fg-placeholder` | 플레이스홀더. 실제 텍스트로 렌더되는 자리표시도 AA 대비를 지킴 |
46
+ | `--fg-subtle` | 메타·플레이스홀더 |
48
47
 
49
48
  **경계**
50
49
  | Token | 용도 |
@@ -107,4 +106,4 @@ mono에서는 모든 chart token의 chroma가 0이다. 단순 등간격 그레
107
106
 
108
107
  ### 플레이스홀더 표현
109
108
 
110
- `--fg-placeholder`는 native input/textarea의 `::placeholder`와 Select·날짜/시간 필드·검색 트리거의 자리표시 라벨에 공통으로 쓴다. 투명도로 옅게 만들지 않는다. 본문·라벨·도움말·disabled 토큰은 변경하지 않는다.
109
+ `--placeholder-opacity`는 기본 0.85다. native input/textarea는 전역 유틸에서 적용하며 Select·날짜/시간 필드의 자리표시 라벨에도 동일하게 적용한다. 본문·라벨·도움말·disabled 토큰은 변경하지 않는다.
@@ -9,6 +9,6 @@ description: 선언된 프로젝트 토큰과 사용처 리터럴, 미선언 변
9
9
 
10
10
  필요한 행동은 전체 `prompts/CATALOG.md`에서 찾고 해당 문서의 Do/Don't·Props와 실제 컴포넌트 코드를 확인한다. 클라이언트의 실행·캡처·독립 검수 기능이 없으면 원본의 검수 대기 계약을 따른다. 검사 통과를 화면 검수로 대신하지 않는다.
11
11
 
12
- 로컬 규칙 검사는 이 스킬의 `scripts/validate.mjs`를 사용한다. 결과는 자동 검사 증거이며 독립 시각 검수와 구분한다.
12
+ 로컬 규칙 검사는 이 스킬의 `scripts/validate.mjs`를 사용한다. 결과는 자동 검사 증거이며 독립 시각 검수와 구분한다. `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`로 확인한다.
@@ -2,6 +2,7 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import {createRequire} from 'node:module';
4
4
  import {createHash} from 'node:crypto';
5
+ import {spawnSync} from 'node:child_process';
5
6
  import {normalizeSource,resolveSource,sourceGraph} from './source-graph.js';
6
7
  const hasText=value=>typeof value==='string'&&Boolean(value.trim());
7
8
  const list=value=>Array.isArray(value)?value:[];
@@ -29,9 +30,11 @@ export function assessComponentPlan(plan,registry,{files={},componentsPath='comp
29
30
  }
30
31
  return {valid:!violations.length,violations};
31
32
  }
32
- export function checkComponentUsage(input,{ts=loadTypeScript()}={}) {
33
+ // Remote (MCP) requests stay small; the local CLI runs in-process on the consumer's own machine and may pass larger limits.
34
+ export const REMOTE_USAGE_LIMITS={files:500,chars:5000000},LOCAL_USAGE_LIMITS={files:5000,chars:50000000};
35
+ export function checkComponentUsage(input,{ts=loadTypeScript(),limits=REMOTE_USAGE_LIMITS}={}) {
33
36
  const files=Object.fromEntries(Object.entries(input.files||{}).map(([name,text])=>[normalizeSource(name),text]));
34
- if(Object.keys(files).length>500||Object.values(files).reduce((n,t)=>n+t.length,0)>5000000)throw new Error('Provide at most 500 source files / 5,000,000 characters.');
37
+ if(Object.keys(files).length>limits.files||Object.values(files).reduce((n,t)=>n+t.length,0)>limits.chars)throw new Error(`Provide at most ${limits.files.toLocaleString('en-US')} source files / ${limits.chars.toLocaleString('en-US')} characters.`);
35
38
  const registry=input.registry||[],base=normalizeSource(input.componentsPath||'components').replace(/\/$/,'')+'/',entries=input.entryFiles||Object.keys(files).filter(n=>/(?:page|layout)\.[jt]sx$/.test(n)),providers=new Set();
36
39
  const graph=sourceGraph(ts,files,entries,base),violations=[],unknown=graph.missing.map(reference=>({rule:'missing-source',reference})),uses=[],apiCalls=[],native=[],candidates=[];
37
40
  const parsed=new Map(Object.entries(graph.files).filter(([name])=>/\.[jt]sx?$/.test(name)).map(([name,text])=>[name,ts.createSourceFile(name,text,ts.ScriptTarget.Latest,true,ts.ScriptKind.TSX)]));
@@ -103,10 +106,29 @@ export function checkComponentUsage(input,{ts=loadTypeScript()}={}) {
103
106
  const sourceHash=digest(JSON.stringify(Object.entries(graph.files).sort(([a],[b])=>a.localeCompare(b))));
104
107
  return {version:'2',engineFingerprint:digest([checkComponentUsage,sourceGraph,resolveSource,normalizeSource,componentContract,componentExports,assessComponentPlan,exportFolder].map(fn=>fn.toString()).join('\n')),parserVersion:ts.version,valid:!violations.length,complete:!unknown.length&&Boolean(entries.length),sourceHash,registryHash:digest(JSON.stringify(registry)),uses,apiCalls,native,roles:roleResults,violations,unknown,coverage:{components:[...new Set(uses.map(u=>u.component))].sort(),authoredFiles:[...parsed.keys()].filter(n=>!n.startsWith(base))},limitations:['Static submitted-source analysis, not visual or behavioural certification. Semantic candidates and exceptions require evidence review. Internal child components are not counted as direct consumer calls. Engine fingerprint identifies the loaded host implementation; bundler transforms can produce different fingerprints.']};
105
108
  }
106
- export function readUsageProject(root,{componentsPath,planFile='.ovenn/component-plan.json'}={}){
109
+ /**
110
+ * Collect a consumer project for the local usage check.
111
+ * - `entry`: optional path prefixes (e.g. ["src/app/operate"]). Only page/layout files under them become entries,
112
+ * which lets a migration be checked one route at a time.
113
+ * - `ts`: when provided, files are pruned to the import graph reachable from the entries plus the files the
114
+ * component plan names, so large apps stay within the analysis limits.
115
+ */
116
+ export function readUsageProject(root,{componentsPath,planFile='.ovenn/component-plan.json',entry=[],ts}={}){
107
117
  componentsPath ||= ['components/ovenn','src/components/ovenn','components','web/components'].find(base=>fs.existsSync(path.join(root,base,'component-registry.json')));
108
118
  if(!componentsPath)throw new Error('Installed component registry not found. Set --components to the actual installation path.');
109
- const files={};function walk(dir,prefix=''){for(const e of fs.readdirSync(dir,{withFileTypes:true})){if(e.isSymbolicLink()||e.name.startsWith('.')||['node_modules','out','prompts'].includes(e.name))continue;const name=prefix+e.name;if(e.isDirectory())walk(path.join(dir,e.name),name+'/');else if(/\.[jt]sx?$/.test(name)&&!name.endsWith('.d.ts'))files[name]=fs.readFileSync(path.join(dir,e.name),'utf8');}}walk(root);
119
+ let files={};function walk(dir,prefix=''){for(const e of fs.readdirSync(dir,{withFileTypes:true})){if(e.isSymbolicLink()||e.name.startsWith('.')||['node_modules','out','prompts'].includes(e.name))continue;const name=prefix+e.name;if(e.isDirectory())walk(path.join(dir,e.name),name+'/');else if(/\.[jt]sx?$/.test(name)&&!name.endsWith('.d.ts'))files[name]=fs.readFileSync(path.join(dir,e.name),'utf8');}}walk(root);
110
120
  const registryPath=path.join(root,componentsPath,'component-registry.json'),registry=JSON.parse(fs.readFileSync(registryPath,'utf8'));let plan;try{plan=JSON.parse(fs.readFileSync(path.join(root,planFile),'utf8'));}catch{}
111
- return {files,registry,componentsPath,plan,entryFiles:Object.keys(files).filter(n=>/(?:^|\/)(?:page|layout)\.[jt]sx$/.test(n))};
121
+ const prefixes=[].concat(entry).filter(Boolean).map(p=>normalizeSource(p).replace(/\/$/,'')+'/');
122
+ let entryFiles=Object.keys(files).filter(n=>/(?:^|\/)(?:page|layout)\.[jt]sx$/.test(n));
123
+ if(prefixes.length){const scoped=entryFiles.filter(n=>prefixes.some(p=>n.startsWith(p)));if(!scoped.length)throw new Error(`No page/layout file under: ${prefixes.join(', ')}`);
124
+ // Ancestor layouts wrap every scoped route; without them providers such as ThemeController look missing.
125
+ const layouts=new Set();for(const file of scoped){let dir=path.posix.dirname(file);while(dir&&dir!=='.'){for(const name of entryFiles)if(name!==file&&path.posix.dirname(name)===dir&&/(?:^|\/)layout\.[jt]sx$/.test(name))layouts.add(name);dir=path.posix.dirname(dir);}}
126
+ entryFiles=[...new Set([...layouts,...scoped])];}
127
+ if(ts){const base=normalizeSource(componentsPath).replace(/\/$/,'')+'/';const keep=new Set([...Object.keys(sourceGraph(ts,files,entryFiles,base).files),...entryFiles]);for(const role of plan?.roles||[])for(const f of [...(role.sourceFiles||[]),...(role.evidence||[]),role.source].filter(Boolean))if(Object.hasOwn(files,normalizeSource(f)))keep.add(normalizeSource(f));files=Object.fromEntries(Object.entries(files).filter(([n])=>keep.has(n)));}
128
+ // `preserved` and `derived` roles compare against the pre-change file. Locally the committed version (git HEAD)
129
+ // is that baseline; without it every preserved role stays unknown and a migration can never be marked complete.
130
+ const baselineFiles={};
131
+ const wanted=new Set();for(const role of plan?.roles||[]){if(role?.strategy==='preserved')for(const f of role.sourceFiles||[])wanted.add(normalizeSource(f));if(role?.strategy==='derived'&&role.source)wanted.add(normalizeSource(role.source));}
132
+ for(const file of wanted){const head=spawnSync('git',['show',`HEAD:${file}`],{cwd:root,encoding:'utf8',maxBuffer:50*1024*1024});if(head.status===0)baselineFiles[file]=head.stdout;}
133
+ return {files,registry,componentsPath,plan,entryFiles,...(Object.keys(baselineFiles).length?{baselineFiles}:{})};
112
134
  }
@@ -0,0 +1,174 @@
1
+ // prompts/RULES.md의 필수 규칙 중 정적으로 잡을 수 있는 것.
2
+ // 접근성 계약(중첩 상호작용·라벨)은 error, 화면 문맥이 필요한 것(filled 배경·액티브바)은 review.
3
+ import { stripComments, lineOf, findBlocks } from '../lib/source-utils.mjs';
4
+
5
+ const SOURCE = 'prompts/RULES.md';
6
+ const INTERACTIVE = new Set(['button', 'a', 'Button', 'IconButton', 'Link']);
7
+ const FIELDS = new Set(['Input', 'Textarea', 'input', 'textarea']);
8
+ const FILLED_FIELDS = new Set(['Input', 'Textarea', 'Select', 'Combobox', 'MultiSelect', 'DatePicker', 'TimePicker']);
9
+
10
+ /** JSX 태그를 순서대로 돌려준다. 문자 단위 스캔이라 큰 파일에서도 선형 시간이다(stripComments 후 호출). */
11
+ function* tags(src) {
12
+ const n = src.length;
13
+ let i = 0;
14
+ while (i < n) {
15
+ const lt = src.indexOf('<', i);
16
+ if (lt < 0) return;
17
+ let j = lt + 1;
18
+ const closing = src[j] === '/';
19
+ if (closing) j++;
20
+ const nameStart = j;
21
+ while (j < n && /[A-Za-z0-9_.]/.test(src[j])) j++;
22
+ const name = src.slice(nameStart, j);
23
+ if (!name || !/^[A-Za-z]/.test(name)) { i = lt + 1; continue; }
24
+ // attributes: walk until ">" at brace depth 0 and outside quotes
25
+ let depth = 0, quote = null, k = j, ok = false;
26
+ while (k < n) {
27
+ const c = src[k];
28
+ if (quote) { if (c === quote) quote = null; k++; continue; }
29
+ if (c === '"' || c === "'" || c === '`') { quote = c; k++; continue; }
30
+ if (c === '{') depth++;
31
+ else if (c === '}') depth = Math.max(0, depth - 1);
32
+ else if (c === '>' && depth === 0) { ok = true; break; }
33
+ else if (c === '<' && depth === 0) break; // malformed; restart from here
34
+ k++;
35
+ }
36
+ if (!ok) { i = k; continue; }
37
+ const attrsRaw = src.slice(j, k);
38
+ const selfClosing = /\/\s*$/.test(attrsRaw);
39
+ yield { closing, name, attrs: selfClosing ? attrsRaw.replace(/\/\s*$/, '') : attrsRaw, selfClosing, index: lt, end: k + 1 };
40
+ i = k + 1;
41
+ }
42
+ }
43
+
44
+ function hasAttr(attrs, name) {
45
+ // boolean props (asChild) have no "="; attribute names end at whitespace, "=", "/" or the tag end
46
+ return new RegExp(`(^|\\s)${name.replace(/[-]/g, '\\-')}(?=\\s*=|\\s|/|$)`).test(attrs);
47
+ }
48
+ const hasSpread = (attrs) => /\{\s*\.\.\./.test(attrs);
49
+
50
+ /** em dash·en dash·생략부호·수사적 큰따옴표: 생성 문구 금지. JSX 텍스트와 문자열 리터럴만 본다. */
51
+ function checkTypography(src, ext) {
52
+ const violations = [];
53
+ if (!['.tsx', '.jsx'].includes(ext)) return violations;
54
+ const re = /[—–…“”]/g;
55
+ let m;
56
+ while ((m = re.exec(src))) {
57
+ // a string that is only the glyph ("—" as an empty-value placeholder) is data, not prose
58
+ const around = src.slice(Math.max(0, m.index - 1), m.index + 2);
59
+ if (/^["'`][—–…]["'`]$/.test(around)) continue;
60
+ violations.push({ line: lineOf(src, m.index), ruleId: 'hard/em-dash', message: `생성 문구에 ${m[0] === '…' ? '생략부호' : m[0] === '—' || m[0] === '–' ? 'dash' : '수사적 큰따옴표'}(${m[0]}) 금지`, suggest: '문장을 나누거나 쉼표·괄호로 바꾼다. 사용자 원문 인용이면 ovenn-validate-disable-next-line hard/em-dash', source: SOURCE });
61
+ }
62
+ return violations;
63
+ }
64
+
65
+ /** 메타 사이 가운뎃점 구분자(· • ∙): JSX 텍스트와 구분자만 담은 문자열에서만 본다. '|'는 타입 유니온과 구분할 수 없어 보지 않는다. */
66
+ function checkBulletSeparator(src, ext) {
67
+ const violations = [];
68
+ if (!['.tsx', '.jsx'].includes(ext)) return violations;
69
+ const seen = new Set();
70
+ const report = (index, glyph) => { if (seen.has(index)) return; seen.add(index); violations.push({ line: lineOf(src, index), ruleId: 'hard/bullet-separator', message: `구분 문자 '${glyph}' 금지: 라벨·메타 사이는 간격이나 hairline으로 나눈다`, suggest: 'gap 토큰 또는 EventListItem/meta-line의 hairline 구분을 쓴다', source: SOURCE }); };
71
+ // JSX text between tags/expressions, e.g. <span>{date} · {author}</span>
72
+ // non-empty text runs only; an empty match would not advance lastIndex and loop forever
73
+ const text = /(?<=[>}])([^<>{}]+)(?=[<{])/g;
74
+ let m;
75
+ while ((m = text.exec(src))) {
76
+ const g = m[1].match(/(?:^|\s)([·•∙])(?:\s|$)/);
77
+ if (g) report(m.index + g.index, g[1]);
78
+ }
79
+ // string literals that are only a separator: {" · "} or {" | "}
80
+ const lit = /["'`]\s*([·•∙])\s*["'`]/g;
81
+ while ((m = lit.exec(src))) report(m.index, m[1]);
82
+ return violations;
83
+ }
84
+
85
+ /** 아이콘 버튼은 접근 가능한 이름이 필수. */
86
+ function checkIconButtonLabel(src, ext) {
87
+ const violations = [];
88
+ if (!['.tsx', '.jsx'].includes(ext)) return violations;
89
+ for (const t of tags(src)) {
90
+ if (t.closing || t.name !== 'IconButton') continue;
91
+ if (hasAttr(t.attrs, 'aria-label') || hasAttr(t.attrs, 'aria-labelledby') || hasAttr(t.attrs, 'label')) continue;
92
+ violations.push({ line: lineOf(src, t.index), ruleId: 'hard/icon-button-label', severity: hasSpread(t.attrs) ? 'review' : 'error', message: 'IconButton에 aria-label이 없다: 스크린리더가 읽을 이름 필수', suggest: 'aria-label="동작 이름"을 넣는다', source: SOURCE });
93
+ }
94
+ return violations;
95
+ }
96
+
97
+ /** placeholder만 있고 라벨이 없는 입력: 값이 들어가면 힌트가 사라진다. */
98
+ function checkPlaceholderOnly(src, ext) {
99
+ const violations = [];
100
+ if (!['.tsx', '.jsx'].includes(ext)) return violations;
101
+ for (const t of tags(src)) {
102
+ if (t.closing || !FIELDS.has(t.name) || !hasAttr(t.attrs, 'placeholder')) continue;
103
+ if (hasAttr(t.attrs, 'label') || hasAttr(t.attrs, 'aria-label') || hasAttr(t.attrs, 'aria-labelledby') || hasAttr(t.attrs, 'id')) continue;
104
+ violations.push({ line: lineOf(src, t.index), ruleId: 'hard/placeholder-only', severity: hasSpread(t.attrs) ? 'review' : 'error', message: `${t.name}에 placeholder만 있고 라벨이 없다`, suggest: 'label 또는 aria-label을 지정한다. 외부 <label htmlFor>를 쓰면 id를 넣는다', source: SOURCE });
105
+ }
106
+ return violations;
107
+ }
108
+
109
+ /** 상호작용 요소 중첩: button 안 button, 링크 안 버튼 등. asChild 래퍼는 하나의 요소다. */
110
+ function checkNestedInteractive(src, ext) {
111
+ const violations = [];
112
+ if (!['.tsx', '.jsx'].includes(ext)) return violations;
113
+ const stack = [];
114
+ for (const t of tags(src)) {
115
+ if (t.closing) {
116
+ for (let i = stack.length - 1; i >= 0; i--) if (stack[i].name === t.name) { stack.splice(i); break; }
117
+ continue;
118
+ }
119
+ const interactive = INTERACTIVE.has(t.name) && !hasAttr(t.attrs, 'asChild');
120
+ if (interactive) {
121
+ const parent = stack.find((s) => s.interactive);
122
+ if (parent) violations.push({ line: lineOf(src, t.index), ruleId: 'hard/nested-interactive', message: `<${t.name}>이 <${parent.name}> 안에 있다: 상호작용 요소를 중첩하지 않는다`, suggest: '보조 동작은 형제로 두거나 Trigger에 asChild를 쓴다', source: SOURCE });
123
+ }
124
+ if (!t.selfClosing) stack.push({ name: t.name, interactive });
125
+ }
126
+ return violations;
127
+ }
128
+
129
+ /** filled 입력은 연한 배경 위에서 금지. 배경은 화면을 봐야 하므로 검토로 남긴다. */
130
+ function checkFilledField(src, ext) {
131
+ const violations = [];
132
+ if (!['.tsx', '.jsx'].includes(ext)) return violations;
133
+ for (const t of tags(src)) {
134
+ if (t.closing || !FILLED_FIELDS.has(t.name) || !/variant\s*=\s*["']filled["']/.test(t.attrs)) continue;
135
+ violations.push({ line: lineOf(src, t.index), ruleId: 'hard/filled-on-light', severity: 'review', message: `${t.name} variant="filled": 흰색·연한 배경 위에서는 금지(outline 사용). 실제 배경을 확인한다`, suggest: '연한 배경이면 variant="outline"', source: SOURCE });
136
+ }
137
+ return violations;
138
+ }
139
+
140
+ /** 탐색 액티브바: active/selected 선택자에 한쪽 변 border·inset shadow·가는 pseudo bar. */
141
+ function checkActiveBar(src, ext) {
142
+ const violations = [];
143
+ if (ext !== '.css') return violations;
144
+ let prevEnd = 0;
145
+ for (const b of findBlocks(src)) {
146
+ const selector = src.slice(prevEnd, b.start).replace(/[^{}]*}\s*/g, '').trim();
147
+ prevEnd = b.end + 1;
148
+ b.selector = selector;
149
+ // navigation/menu selection only; hover and focus rings (inset shadows) are a different contract
150
+ if (!/(active|selected|aria-current|data-state=["']?(active|on)|current)/i.test(selector)) continue;
151
+ if (/:(hover|focus)/i.test(selector)) continue;
152
+ if (!/(nav|menu|sidebar|tab|link|item|rail)/i.test(selector) && !/::?(before|after)/.test(selector)) continue;
153
+ const body = b.body;
154
+ const bar = body.match(/border-(?:left|right|inline-start|inline-end)\s*:\s*(?!0|none|transparent)[^;]+|box-shadow\s*:\s*inset\s+[^;]+|(?:^|;)\s*width\s*:\s*(?:2|3|4)px/i);
155
+ if (!bar) continue;
156
+ if (/width\s*:/.test(bar[0]) && !/::?(before|after)/.test(b.selector)) continue;
157
+ violations.push({ line: lineOf(src, b.start + 1 + (body.indexOf(bar[0]) >= 0 ? body.indexOf(bar[0]) : 0)), ruleId: 'hard/active-bar', severity: 'review', message: `선택 표시 액티브바로 보인다 (${b.selector.trim().slice(0, 60)}): 선택은 표면·글자색·굵기로 표시한다`, suggest: '바를 제거하거나, 꼭 필요하면 radius와 분리된 직선으로 둔다', source: SOURCE });
158
+ }
159
+ return violations;
160
+ }
161
+
162
+ export function checkHardRules(ctx) {
163
+ const src = stripComments(ctx.content, ctx.ext);
164
+ const violations = [
165
+ ...checkTypography(src, ctx.ext),
166
+ ...checkBulletSeparator(src, ctx.ext),
167
+ ...checkIconButtonLabel(src, ctx.ext),
168
+ ...checkPlaceholderOnly(src, ctx.ext),
169
+ ...checkNestedInteractive(src, ctx.ext),
170
+ ...checkFilledField(src, ctx.ext),
171
+ ...checkActiveBar(src, ctx.ext),
172
+ ];
173
+ return violations.map((v) => ({ severity: 'error', ...v }));
174
+ }
@@ -0,0 +1,57 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { checkHardRules } from './hard-rules.mjs';
4
+
5
+ const run = (content, ext = '.tsx') => checkHardRules({ content, ext, file: 'app/page.tsx', rel: 'app/page.tsx' });
6
+ const ids = (v) => v.map((x) => x.ruleId);
7
+
8
+ test('em dash, en dash and ellipsis in copy are errors; comments are ignored', () => {
9
+ const v = run('// 주석 — 무시\nexport const a = <p>저장 — 완료…</p>;');
10
+ assert.deepEqual(ids(v), ['hard/em-dash', 'hard/em-dash']);
11
+ assert.ok(v.every((x) => x.severity === 'error'));
12
+ assert.equal(run('export const a = <p>저장 완료</p>;').length, 0);
13
+ assert.equal(run('const none = "—"; const cell = <td>{value ?? "—"}</td>;').length, 0, 'a lone dash is an empty-value placeholder');
14
+ });
15
+
16
+ test('bullet separators between meta are flagged, logical OR and imports are not', () => {
17
+ assert.deepEqual(ids(run('const m = <span>{date} · {author}</span>;')), ['hard/bullet-separator']);
18
+ assert.equal(run('type V = "a" | "b"; const m = <span>{date} | {author}</span>;').length, 0, 'pipe is indistinguishable from unions; not checked');
19
+ assert.equal(run('const ok = a || b; const s = "x|y"; import { x } from "y";').length, 0);
20
+ });
21
+
22
+ test('IconButton needs an accessible name', () => {
23
+ assert.deepEqual(ids(run('<IconButton icon={<Icon name="x" />} onClick={f} />')), ['hard/icon-button-label']);
24
+ assert.equal(run('<IconButton aria-label="닫기" icon={<Icon name="x" />} />').length, 0);
25
+ const spread = run('<IconButton {...props} icon={<Icon name="x" />} />');
26
+ assert.equal(spread[0].severity, 'review');
27
+ });
28
+
29
+ test('placeholder-only fields are flagged; labelled ones pass', () => {
30
+ assert.deepEqual(ids(run('<Input placeholder="검색" value={q} onChange={set} />')), ['hard/placeholder-only']);
31
+ assert.equal(run('<Input label="검색" placeholder="이름" value={q} onChange={set} />').length, 0);
32
+ assert.equal(run('<label htmlFor="q">검색</label><input id="q" placeholder="이름" />').length, 0);
33
+ });
34
+
35
+ test('nested interactive elements are errors unless the wrapper is asChild', () => {
36
+ assert.deepEqual(ids(run('<Link href="/a"><Button>열기</Button></Link>')), ['hard/nested-interactive']);
37
+ assert.deepEqual(ids(run('<button><IconButton aria-label="x" icon={i} /></button>')), ['hard/nested-interactive']);
38
+ assert.equal(run('<DropdownMenu.Trigger asChild><Button>메뉴</Button></DropdownMenu.Trigger>').length, 0);
39
+ assert.equal(run('<Button asChild><Link href="/a">열기</Link></Button>').length, 0);
40
+ assert.equal(run('<div><Button>a</Button><Button>b</Button></div>').length, 0);
41
+ });
42
+
43
+ test('filled fields are reviews, not errors', () => {
44
+ const v = run('<Input label="이름" variant="filled" />');
45
+ assert.deepEqual(ids(v), ['hard/filled-on-light']);
46
+ assert.equal(v[0].severity, 'review');
47
+ });
48
+
49
+ test('active bars in css are reviews', () => {
50
+ const v = run('.item[data-active="true"] { border-left: 2px solid var(--primary); }', '.css');
51
+ assert.deepEqual(ids(v), ['hard/active-bar']);
52
+ assert.equal(v[0].severity, 'review');
53
+ assert.equal(run('.item[data-active="true"] { background: var(--bg-muted); font-weight: 600; }', '.css').length, 0);
54
+ assert.equal(run('.cell[data-selected] { box-shadow: inset 0 0 0 1px var(--primary); }', '.css').length, 0, 'calendar cell selection is not a nav bar');
55
+ assert.equal(run('.item[data-active]:focus-visible { box-shadow: inset 0 0 0 2px var(--ring); }', '.css').length, 0, 'focus rings are allowed');
56
+ assert.deepEqual(ids(run('.nav a[aria-current="page"]::before { content: ""; width: 3px; }', '.css')), ['hard/active-bar']);
57
+ });
@@ -6,6 +6,7 @@ import { checkHardcoded } from './rules/hardcoded.mjs';
6
6
  import { checkGhostTokens, loadDeclaredTokens } from './rules/ghost-tokens.mjs';
7
7
  import { checkMemoryRules } from './rules/memory-rules.mjs';
8
8
  import { checkDocSync } from './rules/doc-sync.mjs';
9
+ import { checkHardRules } from './rules/hard-rules.mjs';
9
10
 
10
11
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
12
  const REPO_ROOT = path.resolve(__dirname, '../../../..');
@@ -136,6 +137,7 @@ function run() {
136
137
  raw.push(...checkHardcoded(ctx));
137
138
  raw.push(...checkGhostTokens(ctx, declaredTokens));
138
139
  raw.push(...checkMemoryRules(ctx));
140
+ raw.push(...checkHardRules(ctx));
139
141
  }
140
142
 
141
143
  for (const v of raw) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conscience-technology/ovenn",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Ovenn — 하이브리드 디자인 시스템 설치 · 온보딩 CLI (shadcn식 코드 생성기)",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  import {listDesignExamples, getDesignExample} from "../utils/design-examples.js";
2
2
  import {join} from "node:path";
3
- import {checkComponentUsage,readUsageProject,loadTypeScript,assessComponentPlan} from '../utils/component-usage.js';
3
+ import {checkComponentUsage,readUsageProject,loadTypeScript,assessComponentPlan,LOCAL_USAGE_LIMITS} from '../utils/component-usage.js';
4
4
  import {getAssetSources} from "../utils/assets.js";
5
5
  import {workflowContext, workflowPolicy, assessWorkflow} from "../utils/design-workflow.js";
6
6
  /**
@@ -124,7 +124,7 @@ Subcommands:
124
124
  get-axis <name> Axis values and the tokens they drive
125
125
  get-guide [topic] Guides (e.g. axes/shape, tokens/spacing, ASSEMBLY)
126
126
  get-design-workflow [--scope=page] Common workflow and review schema
127
- check-component-usage --local [--project=input.json] Actual component render use
127
+ check-component-usage --local [--entry=src/app/x,...] [--project=input.json] Actual component render use; --entry limits page/layout entries to path prefixes
128
128
  check-design-review --file=workflow.json [--phase=preflight] Validate submitted evidence structure
129
129
  get-rules Global PRINCIPLES
130
130
  check-hardcoding --file=<path> [--ext=css] Quick CSS/TSX hardcoding scan
@@ -175,8 +175,9 @@ export async function run(argv) {
175
175
  return;
176
176
  }
177
177
  if(flags.local && sub==="check-component-usage") {
178
- const input=flags.project?JSON.parse(readFileSync(String(flags.project),"utf8")):readUsageProject(process.cwd(),{componentsPath:flags.components,planFile:flags.plan||".ovenn/component-plan.json"});
179
- const report=checkComponentUsage(input,{ts:loadTypeScript(process.cwd())});console.log(JSON.stringify(report,null,2));if(!report.valid||!report.complete)process.exitCode=1;return;
178
+ const ts=loadTypeScript(process.cwd());
179
+ const input=flags.project?JSON.parse(readFileSync(String(flags.project),"utf8")):readUsageProject(process.cwd(),{componentsPath:flags.components,planFile:flags.plan||".ovenn/component-plan.json",entry:flags.entry?String(flags.entry).split(","):[],ts});
180
+ const report=checkComponentUsage(input,{ts,limits:LOCAL_USAGE_LIMITS});console.log(JSON.stringify(report,null,2));if(!report.valid||!report.complete)process.exitCode=1;return;
180
181
  }
181
182
  if(flags.local && ["get-design-workflow","check-design-review"].includes(sub)) {
182
183
  const root=existsSync(join(process.cwd(),"prompts/ASSEMBLY.md"))?join(process.cwd(),"prompts"):getAssetSources().prompts;
@@ -1,4 +1,5 @@
1
1
  import { bridgeSources } from "../utils/client-bridges.js";
2
+ import { checkMissingDeps, renderInstallCmd } from "../utils/deps.js";
2
3
  import { existsSync, readFileSync } from "node:fs";
3
4
  import { join } from "node:path";
4
5
  import { fileURLToPath } from "node:url";
@@ -61,5 +62,8 @@ export async function run(args) {
61
62
  const changes = plan.filter((item) => item.kind !== "unchanged" && !kept.has(item.path));
62
63
  if (changes.length || JSON.stringify(meta.pendingLocalEdits ?? []) !== JSON.stringify([...kept])) changes.push({path:metaFile,current:metaHash,content:Buffer.from(JSON.stringify(nextMeta,null,2)+"\n")});
63
64
  report.transaction = applyUpdate(root, changes);
64
- console.log(json ? JSON.stringify(report,null,2) : `${changes.length} files written; ${kept.size} local edits preserved.\n${report.transaction ? `Backup: .ovenn/updates/${report.transaction}\nRollback: ovenn update --rollback=${report.transaction}` : "Already up to date."}`);
65
+ // New components can bring new runtime packages (e.g. CodeBlock → shiki). Say so, or the consumer's typecheck fails after the update.
66
+ const { missing } = checkMissingDeps(root);
67
+ report.missingDependencies = missing;
68
+ console.log(json ? JSON.stringify(report,null,2) : `${changes.length} files written; ${kept.size} local edits preserved.\n${report.transaction ? `Backup: .ovenn/updates/${report.transaction}\nRollback: ovenn update --rollback=${report.transaction}` : "Already up to date."}${missing.length ? `\nInstall these packages (Ovenn components need them):\n ${renderInstallCmd(missing)}` : ""}`);
65
69
  }