chore: adopt AI agent harness

This commit is contained in:
2026-08-06 15:12:44 +09:00
parent 57b27eb50c
commit 6a07bcacb9
6 changed files with 344 additions and 0 deletions

25
.agent/consumer.md Normal file
View File

@@ -0,0 +1,25 @@
## 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.
### 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.
- 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.

16
.agent/profile.yml Normal file
View File

@@ -0,0 +1,16 @@
schema_version: 1
project:
id: kri-ui-registry
name: KriUiRegistry
type: library
layer: frontend
legacy: false
stack:
- typescript
- react
shared_contracts:
provides:
- kri-ui-registry

24
.agent/project.md Normal file
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.