{"owner":"tusen-ai","repo":"naive-ui","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"files":{"AGENTS.md":"# Agent Guide for Naive UI\n\nThis file provides guidance to AI coding agents when working on the [Naive UI](https://github.com/tusen-ai/naive-ui) repository.\n\n## Important Notes\n\n- Vue 3 + TypeScript component library. Source is in `src/`.\n- Package manager: pnpm (`11.10.0`). Node: `>=20`.\n- Use English in code and comments. Keep comments meaningful and concise.\n- Do not change public APIs or user-facing behavior unless requested.\n\n## Build and Development Commands\n\n```bash\n# Start documentation site dev server\npnpm run dev\n\n# Run all unit tests\npnpm run test\n\n# Run tests for a specific component\npnpm run test src/button\n\n# Update snapshots\npnpm run test:update\n\n# Lint code and types\npnpm run lint\n\n# Auto-fix lint issues\npnpm run lint:fix\n\n# Format code\npnpm run format\n\n# Full library build\npnpm run build:package\n\n# Production docs site build\npnpm run build:site\n```\n\n## Architecture Overview\n\n```\nnaive-ui/\n├── src/                  # Component library source\n│   ├── _internal/        # Internal helper components\n│   ├── _mixins/          # Shared composables: useTheme, useConfig, useFormItem, etc.\n│   ├── _styles/          # Global theme tokens\n│   ├── _utils/           # Utility modules\n│   ├── <component>/      # One directory per public component\n│   │   ├── index.ts      # Public exports\n│   │   ├── src/          # Component implementation (.tsx)\n│   │   ├── styles/       # Theme vars (light.ts / dark.ts / _common.ts / rtl.ts)\n│   │   ├── demos/        # Documentation demos\n│   │   └── tests/        # Vitest specs\n│   ├── composables/      # Public composables\n│   ├── locales/          # i18n locale objects\n│   ├── themes/           # Theme definitions\n│   ├── components.ts     # Aggregated component exports\n│   ├── preset.ts         # Default plugin\n│   ├── create.ts         # Plugin factory\n│   └── vitest-setup.ts   # Test environment polyfills\n├── demo/                 # Documentation site source\n├── build/                # Custom Vite plugins and build helpers\n├── scripts/              # Build/release scripts\n├── themes/tusimple/      # Tusimple-branded theme overrides\n├── generic/              # Generic Vue component wrappers\n├── esm-test/             # Smoke test for ES build\n├── umd-test/             # Smoke test for UMD build\n└── coverage/             # Vitest coverage output\n```\n\n## Component Conventions\n\n- Props are declared as `componentProps` and exported from `index.ts`.\n- Component implementation lives in `src/Component.tsx` using `defineComponent` + JSX.\n- Styles live in `src/styles/index.cssr.ts` as CSS-render strings.\n- Theme variables live in `styles/light.ts`, `styles/dark.ts`, and `styles/_common.ts`.\n- Tests live in `tests/Component.spec.tsx`.\n\n## Key Development Patterns\n\n- Use shared mixins from `src/_mixins/`: `useConfig`, `useTheme`, `useThemeClass`, `useFormItem`, `useLocale`, `useRtl`.\n- CSS class naming follows BEM: `.n-button`, `.n-button--primary`, `.n-button__icon`.\n- Theme variable naming follows `<component><State><Variant>` order, e.g. `buttonColorErrorHover`.\n- Use named imports and `h` from `vue` for JSX.\n\n## Code Style\n\n- Do not fix formatting manually. Use `pnpm run lint:fix` and `pnpm run format` to let the tools handle it.\n- Prettier: `semi: false`, `singleQuote: true`, `printWidth: 80`, `trailingComma: none`.\n- ESLint: `@antfu/eslint-config` with a few project-specific overrides.\n- File naming: kebab-case directories, PascalCase component files.\n- TypeScript strict mode enabled.\n\n## Testing Approach\n\n- Vitest with `jsdom` and `@vue/test-utils`.\n- `src/vitest-setup.ts` polyfills browser APIs.\n- When a change only affects a single component, run only that component's tests first: `pnpm run test src/<component>`.\n- Add tests for new props or behaviors. Keep tests focused.\n\n## Commit Message Format\n\nUse Angular style:\n\n```\nfeat(button): add ghost prop\nfix(input): handle empty value correctly\ndocs: update contributing guide\n```\n\n## Pull Requests\n\n- Prefer the `gh` CLI when interacting with GitHub (listing PRs, checking CI status, creating PRs, etc.).\n- Always follow `.github/pull_request_template.md` when creating a PR.\n- Keep PR titles and descriptions factual and concise.\n- Do not add AI-tool branding or co-author trailers.\n- If public APIs or user-facing behavior change, update docs and call out the impact in the PR template.\n\n## Debugging\n\n- Use `chrome-devtools-mcp` (Chrome DevTools Protocol) for browser debugging: inspecting elements, capturing screenshots, monitoring network requests, running performance traces, and executing scripts in the page context.\n\n## Useful References\n\n- `package.json` — scripts, dependencies\n- `vite.config.mts` — dev server, aliases, test config\n- `tsconfig.json` — TypeScript config\n- `eslint.config.mjs` — lint rules\n- `CONTRIBUTING.md` — contribution workflow\n- `design-notes/maintaining.md` — release process\n- `design-notes/how-to-name-a-style-var.md` — theme variable naming guide\n"}}