261006_01_DOC: UI 레지스트리 참조 문서 및 에이전트 스킬 정비

This commit is contained in:
2026-10-06 10:19:15 +09:00
parent 8e873714b6
commit 7c4dba52ef
18 changed files with 427 additions and 75 deletions

View File

@@ -0,0 +1,5 @@
# KriEditor HTML Compatibility
- `enableImageMap` opt-in preserves `map`, nested `area`, and `img.usemap` HTML in WYSIWYG mode; consumers remain responsible for sanitizing URLs and attributes according to their server policy.
- Use `htmlSanitizer` when a consumer must apply a stricter HTML policy than the editor's default DOMPurify profile.
- Use `getWysiwygCompatibility` to keep lossy HTML in HTML mode. The callback must return `compatible: false` when WYSIWYG parsing would remove or materially rewrite content.

View File

@@ -0,0 +1,17 @@
# KriUiRegistry Installation and Adaptation
## Installation and Ownership
- Inspect the registry item and its dependencies before installation. Use the shadcn CLI with the approved registry endpoint under `https://ui-registry.kric.com/r/` instead of copying files from `dist/r` manually.
- `kri-data-table` uses the TanStack Table v8 API. Keep `@tanstack/react-table` within the supported `^8.21.3` range and do not upgrade it to v9 until KriUiRegistry provides an explicitly migrated component contract.
- Respect the consumer project's component aliases, target paths, package manager, styling system, React version, and existing design tokens.
- The shadcn workflow copies component source into the consumer repository. After installation, treat that copy as project-owned code; do not assume registry updates propagate automatically.
- Do not overwrite an existing project component without reviewing the diff and confirming that local behavior and accessibility are preserved.
- Keep package and lockfile changes produced by an installation within the approved scope.
## Adaptation and Verification
- Adapt business data and application behavior outside the shared component when possible. Avoid embedding project-specific API, route, authentication, or environment logic into a reusable component.
- Preserve the installed component's public props, accessibility, keyboard behavior, responsive layout, and loading, empty, error, and disabled states unless the task explicitly changes them.
- If the registry lacks a generally reusable capability, propose it in KriUiRegistry; do not modify that repository unless it is explicitly in scope.
- Run the consumer repository's focused type-check, lint, tests, and build after installation or upgrade.

View File

@@ -1,32 +1,19 @@
## KriUiRegistry Consumer Contract
### UI Component Selection
When implementing or changing frontend UI, use this order:
1. Reuse an existing shared component in the project when it already meets the requirement.
2. Prefer an approved component from KriUiRegistry.
3. Otherwise, prefer a suitable shadcn/ui component.
4. Create a new custom component only when the preceding options cannot meet the requirement without an unsafe or misleading adaptation.
4. Create a custom component only when the preceding options cannot meet the requirement safely.
### Installation and Ownership
### Required Shared References
- Inspect the registry item and its dependencies before installation. Use the shadcn CLI with the approved registry endpoint under `https://ui-registry.kric.com/r/` instead of copying files from `dist/r` manually.
- `kri-data-table` uses the TanStack Table v8 API. Keep `@tanstack/react-table` within the supported `^8.21.3` range and do not upgrade it to v9 until KriUiRegistry provides an explicitly migrated component contract.
- Respect the consumer project's component aliases, target paths, package manager, styling system, React version, and existing design tokens.
- The shadcn workflow copies component source into the consumer repository. After installation, treat that copy as project-owned code; do not assume registry updates propagate automatically.
- Do not overwrite an existing project component without reviewing the diff and confirming that local behavior and accessibility are preserved.
- Keep package and lockfile changes produced by an installation within the approved scope.
Before each related task, read the current contents of every matching reference, even if it was read earlier in the session.
### Adaptation and Verification
| Task scope | Required reference |
|---|---|
| Installing, upgrading, adapting, or verifying a registry component | `.agent-harness/references/kri-ui-registry/installation-and-adaptation.md` |
| KriEditor HTML, image-map, sanitizer, or WYSIWYG compatibility | `.agent-harness/references/kri-ui-registry/editor-html-compatibility.md` |
- Adapt business data and application behavior outside the shared component when possible. Avoid embedding project-specific API, route, authentication, or environment logic into a reusable component.
- Preserve the installed component's public props, accessibility, keyboard behavior, responsive layout, and loading, empty, error, and disabled states unless the task explicitly changes them.
- If the registry lacks a generally reusable capability, propose it in KriUiRegistry; do not modify that repository unless it is explicitly in scope.
- Run the consumer repository's focused type-check, lint, tests, and build after installation or upgrade.
### KriEditor HTML Compatibility
- `enableImageMap` opt-in preserves `map`, nested `area`, and `img.usemap` HTML in WYSIWYG mode; consumers remain responsible for sanitizing URLs and attributes according to their server policy.
- Use `htmlSanitizer` when a consumer must apply a stricter HTML policy than the editor's default DOMPurify profile.
- Use `getWysiwygCompatibility` to keep lossy HTML in HTML mode. The callback must return `compatible: false` when WYSIWYG parsing would remove or materially rewrite content.
If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriUiRegistry's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead.

View File

@@ -1,24 +1,18 @@
## KriUiRegistry Repository Rules
# KriUiRegistry Project Instruction Router
### Repository Role and Sources
## Required Project References
- This repository is the internal shadcn registry named `kri`, published from `https://ui-registry.kric.com`.
- `registry.json`, `registry/components/registry.json`, and the files under `registry/` are source inputs. `dist/r` is generated output and must not be edited directly.
- Treat registry item names, targets, dependencies, registry dependencies, component props, behavior, styling tokens, and the public registry URL as consumer-facing contracts.
- Preserve shadcn registry schema compatibility and keep every item self-contained enough for the shadcn CLI to install it into a consumer project.
Before each related task, read the current contents of every matching reference below, even if it was read earlier in the session.
### Component and Metadata Rules
| Task scope | Required reference |
|---|---|
| Any substantive analysis, planning, implementation, debugging, review, or documentation work in this repository | `.agent/references/repository-rules.md` |
- Prefer accessible shadcn/Radix composition and the registry's existing component patterns before introducing a new abstraction.
- Keep project-specific business rules, API clients, routes, credentials, and environment assumptions out of registry components.
- Use portable design tokens and styles. Do not introduce project-only `content-text-*` classes or imports from `@kri/common/ui`; the repository verifier rejects them.
- Declare all package dependencies and registry dependencies accurately. Keep item file targets stable unless an approved migration covers consumers.
- Preserve loading, empty, error, disabled, keyboard, focus, and screen-reader behavior when changing an interactive component.
- Avoid embedding generated files or consumer-local configuration in registry source items.
If a task spans multiple scopes, read every matching reference. Do not assume remembered content is current.
### Verification and Release Boundary
## Harness Workflow
- Use the committed lockfile and run `npm run build`, followed by `npm run verify`, for registry changes.
- Inspect the generated item JSON when changing files, dependencies, item names, or targets.
- Update `.agent/consumer.md` and human documentation in the same approved change when installation or component-selection behavior changes.
- Registry publication, deployment, version changes, and consumer-repository updates require separate explicit approval.
- `AGENTS.md` and `CLAUDE.md` are generated outputs. Never edit them directly.
- Edit `.agent/project.md` only when routing changes. Store durable project detail in `.agent/references/`.
- A reference-only content change does not require recomposition when its route is unchanged. Run harness verification to validate routing and UTF-8.
- Recompose and verify after changing `.agent/project.md`, `.agent/profile.yml`, or another composed instruction source.

View File

@@ -0,0 +1,24 @@
## KriUiRegistry Repository Rules
### Repository Role and Sources
- This repository is the internal shadcn registry named `kri`, published from `https://ui-registry.kric.com`.
- `registry.json`, `registry/components/registry.json`, and the files under `registry/` are source inputs. `dist/r` is generated output and must not be edited directly.
- Treat registry item names, targets, dependencies, registry dependencies, component props, behavior, styling tokens, and the public registry URL as consumer-facing contracts.
- Preserve shadcn registry schema compatibility and keep every item self-contained enough for the shadcn CLI to install it into a consumer project.
### Component and Metadata Rules
- Prefer accessible shadcn/Radix composition and the registry's existing component patterns before introducing a new abstraction.
- Keep project-specific business rules, API clients, routes, credentials, and environment assumptions out of registry components.
- Use portable design tokens and styles. Do not introduce project-only `content-text-*` classes or imports from `@kri/common/ui`; the repository verifier rejects them.
- Declare all package dependencies and registry dependencies accurately. Keep item file targets stable unless an approved migration covers consumers.
- Preserve loading, empty, error, disabled, keyboard, focus, and screen-reader behavior when changing an interactive component.
- Avoid embedding generated files or consumer-local configuration in registry source items.
### Verification and Release Boundary
- Use the committed lockfile and run `npm run build`, followed by `npm run verify`, for registry changes.
- Inspect the generated item JSON when changing files, dependencies, item names, or targets.
- Update `.agent/consumer.md` and human documentation in the same approved change when installation or component-selection behavior changes.
- Registry publication, deployment, version changes, and consumer-repository updates require separate explicit approval.