mirror of
https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git
synced 2026-11-19 00:30:30 +00:00
feat(cli): add Kimi Code platform (--ai kimi) (#538)
* feat(cli): add Kimi Code platform (--ai kimi) Kimi Code discovers skills as SKILL.md folders (name + description frontmatter) in .kimi-code/skills/ (project) and ~/.kimi-code/skills/ (user). Add a kimi platform template, register the type, detect an existing .kimi-code folder, and document it in the README. Tests: add kimi to the dry-run and script-path e2e specs. check:assets, typecheck and those specs pass; init --ai kimi was run in an empty repo. Kimi Code itself was not run. Refs #455. * test(cli): add kimi install and detection specs Cover the rendered SKILL.md frontmatter, a real install into .kimi-code/skills (skill, data, scripts and sub-skills), and detection of a .kimi-code folder. Refs #455. * fix(scripts): expect 24 platform configs in validate-agent-guide Adding the kimi platform template raises the config count from 23 to 24. Keep the check strict and update the expected count. Refs #455. * test(cli): expect 24 platform configs in agent-query-contract The kimi platform raises the platform config count from 23 to 24. Refs #455.
This commit is contained in:
parent
623a9a9037
commit
076a2b3a31
@ -290,6 +290,7 @@ uipro init --ai warp # Warp
|
||||
uipro init --ai augment # Augment
|
||||
uipro init --ai codewhale # CodeWhale
|
||||
uipro init --ai zcode # ZCode
|
||||
uipro init --ai kimi # Kimi Code
|
||||
uipro init --ai amazonq # Amazon Q Developer
|
||||
uipro init --ai openclaw # OpenClaw (.agents/skills/)
|
||||
uipro init --ai universal # Universal / Agent Standard (.agents/skills/)
|
||||
@ -304,6 +305,7 @@ The npm package is `ui-ux-pro-max-cli`; it still installs the `uipro` command. O
|
||||
uipro init --ai claude --global # Install to ~/.claude/skills/
|
||||
uipro init --ai cursor --global # Install to ~/.cursor/skills/
|
||||
uipro init --ai zcode --global # Install to ~/.zcode/skills/
|
||||
uipro init --ai kimi --global # Install to ~/.kimi-code/skills/
|
||||
uipro init --ai universal --global # Install to ~/.agents/skills/
|
||||
```
|
||||
|
||||
@ -336,7 +338,7 @@ If it is missing, install it yourself from [python.org](https://www.python.org/d
|
||||
|
||||
### Skill Mode (Auto-activate)
|
||||
|
||||
**Supported:** Claude Code, Cursor, Windsurf, Antigravity, Codex CLI, Continue, Gemini CLI, OpenCode, Qoder, CodeBuddy, Droid (Factory), KiloCode, Warp, Augment, CodeWhale, ZCode, Amazon Q Developer, OpenClaw, GitHub Copilot
|
||||
**Supported:** Claude Code, Cursor, Windsurf, Antigravity, Codex CLI, Continue, Gemini CLI, OpenCode, Qoder, CodeBuddy, Droid (Factory), KiloCode, Warp, Augment, CodeWhale, ZCode, Kimi Code, Amazon Q Developer, OpenClaw, GitHub Copilot
|
||||
|
||||
The skill activates automatically when you request UI/UX work. Just chat naturally:
|
||||
|
||||
|
||||
21
cli/assets/templates/platforms/kimi.json
Normal file
21
cli/assets/templates/platforms/kimi.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"platform": "kimi",
|
||||
"displayName": "Kimi Code",
|
||||
"installType": "full",
|
||||
"folderStructure": {
|
||||
"root": ".kimi-code",
|
||||
"skillPath": "skills/ui-ux-pro-max",
|
||||
"filename": "SKILL.md"
|
||||
},
|
||||
"scriptPath": "skills/ui-ux-pro-max/scripts/search.py",
|
||||
"frontmatter": {
|
||||
"name": "ui-ux-pro-max",
|
||||
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks."
|
||||
},
|
||||
"sections": {
|
||||
"quickReference": false
|
||||
},
|
||||
"title": "ui-ux-pro-max",
|
||||
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks.",
|
||||
"skillOrWorkflow": "Skill"
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
export type AIType = 'claude' | 'cursor' | 'windsurf' | 'antigravity' | 'copilot' | 'kiro' | 'roocode' | 'codex' | 'qoder' | 'gemini' | 'trae' | 'opencode' | 'continue' | 'codebuddy' | 'droid' | 'kilocode' | 'warp' | 'augment' | 'codewhale' | 'zcode' | 'amazonq' | 'openclaw' | 'universal' | 'all';
|
||||
export type AIType = 'claude' | 'cursor' | 'windsurf' | 'antigravity' | 'copilot' | 'kiro' | 'roocode' | 'codex' | 'qoder' | 'gemini' | 'trae' | 'opencode' | 'continue' | 'codebuddy' | 'droid' | 'kilocode' | 'warp' | 'augment' | 'codewhale' | 'zcode' | 'kimi' | 'amazonq' | 'openclaw' | 'universal' | 'all';
|
||||
export type ConcreteAIType = Exclude<AIType, 'all'>;
|
||||
|
||||
export type InstallType = 'full' | 'reference';
|
||||
@ -44,7 +44,7 @@ export interface PlatformConfig {
|
||||
skillOrWorkflow: string;
|
||||
}
|
||||
|
||||
export const AI_TYPES: AIType[] = ['claude', 'cursor', 'windsurf', 'antigravity', 'copilot', 'roocode', 'kiro', 'codex', 'qoder', 'gemini', 'trae', 'opencode', 'continue', 'codebuddy', 'droid', 'kilocode', 'warp', 'augment', 'codewhale', 'zcode', 'amazonq', 'openclaw', 'universal', 'all'];
|
||||
export const AI_TYPES: AIType[] = ['claude', 'cursor', 'windsurf', 'antigravity', 'copilot', 'roocode', 'kiro', 'codex', 'qoder', 'gemini', 'trae', 'opencode', 'continue', 'codebuddy', 'droid', 'kilocode', 'warp', 'augment', 'codewhale', 'zcode', 'kimi', 'amazonq', 'openclaw', 'universal', 'all'];
|
||||
|
||||
// Legacy folder mapping for backward compatibility with ZIP-based installs.
|
||||
// Note: .shared is included for platforms that used ZIP installs. Post-ZIP platforms
|
||||
@ -70,6 +70,7 @@ export const AI_FOLDERS: Record<ConcreteAIType, string[]> = {
|
||||
augment: ['.augment', '.shared'],
|
||||
codewhale: ['.codewhale', '.shared'],
|
||||
zcode: ['.zcode', '.shared'],
|
||||
kimi: ['.kimi-code', '.shared'],
|
||||
amazonq: ['.amazonq', '.shared'],
|
||||
openclaw: ['.agents', '.shared'],
|
||||
universal: ['.agents', '.shared'],
|
||||
|
||||
@ -88,6 +88,9 @@ export function detectAIType(cwd: string = process.cwd()): DetectionResult {
|
||||
if (existsSync(join(cwd, '.zcode'))) {
|
||||
detected.push('zcode');
|
||||
}
|
||||
if (existsSync(join(cwd, '.kimi-code'))) {
|
||||
detected.push('kimi');
|
||||
}
|
||||
if (existsSync(join(cwd, '.amazonq'))) {
|
||||
detected.push('amazonq');
|
||||
}
|
||||
@ -152,6 +155,8 @@ export function getAITypeDescription(aiType: AIType): string {
|
||||
return 'CodeWhale (.codewhale/skills/)';
|
||||
case 'zcode':
|
||||
return 'ZCode (.zcode/skills/)';
|
||||
case 'kimi':
|
||||
return 'Kimi Code (.kimi-code/skills/)';
|
||||
case 'amazonq':
|
||||
return 'Amazon Q Developer (.amazonq/rules/)';
|
||||
case 'openclaw':
|
||||
|
||||
@ -70,6 +70,7 @@ const AI_TO_PLATFORM: Record<string, string> = {
|
||||
augment: 'augment',
|
||||
codewhale: 'codewhale',
|
||||
zcode: 'zcode',
|
||||
kimi: 'kimi',
|
||||
amazonq: 'amazonq',
|
||||
openclaw: 'openclaw',
|
||||
universal: 'universal',
|
||||
|
||||
@ -6,7 +6,7 @@ const DESCRIPTION =
|
||||
|
||||
test('all platform metadata uses one accurate activation description', async () => {
|
||||
const configs = await loadAllPlatformConfigs();
|
||||
expect(configs.size).toBe(23);
|
||||
expect(configs.size).toBe(24);
|
||||
for (const [platform, config] of configs) {
|
||||
expect(config.description, platform).toBe(DESCRIPTION);
|
||||
if (config.frontmatter?.description) {
|
||||
|
||||
@ -43,6 +43,19 @@ test('dry-run plan supports the zcode platform layout', async () => {
|
||||
expect(joined).toContain('Would copy 6 sub-skills (');
|
||||
});
|
||||
|
||||
test('dry-run plan supports the kimi platform layout', async () => {
|
||||
const scratch = await mkdtemp(join(tmpdir(), 'uipro-dry-run-kimi-'));
|
||||
|
||||
const actions = await planPlatformInstallActions(scratch, 'kimi');
|
||||
|
||||
const joined = actions.join('\n');
|
||||
expect(joined).toContain(
|
||||
join(scratch, '.kimi-code', 'skills', 'ui-ux-pro-max', 'SKILL.md')
|
||||
);
|
||||
expect(joined).toContain('Would copy data + scripts:');
|
||||
expect(joined).toContain('Would copy 6 sub-skills (');
|
||||
});
|
||||
|
||||
test('dry-run plan keeps amazonq data and sub-skills out of the rules folder', async () => {
|
||||
const scratch = await mkdtemp(join(tmpdir(), 'uipro-dry-run-amazonq-'));
|
||||
|
||||
|
||||
54
cli/tests/e2e/kimi-skills.spec.ts
Normal file
54
cli/tests/e2e/kimi-skills.spec.ts
Normal file
@ -0,0 +1,54 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { mkdir, mkdtemp } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { detectAIType, getAITypeDescription } from '../../src/utils/detect.js';
|
||||
import {
|
||||
generatePlatformFiles,
|
||||
listBundledSubSkills,
|
||||
loadPlatformConfig,
|
||||
renderSkillFile,
|
||||
} from '../../src/utils/template.js';
|
||||
|
||||
// Kimi Code loads project skills from .kimi-code/skills/<name>/SKILL.md
|
||||
// (and .agents/skills/). SKILL.md needs name and description frontmatter:
|
||||
// https://www.kimi.com/code/docs/en/kimi-code-cli/customization/skills.html
|
||||
|
||||
function scratchDir(name: string): Promise<string> {
|
||||
return mkdtemp(join(tmpdir(), `uipro-kimi-${name}-`));
|
||||
}
|
||||
|
||||
test('kimi SKILL.md has the name and description frontmatter Kimi Code requires', async () => {
|
||||
const config = await loadPlatformConfig('kimi');
|
||||
const content = await renderSkillFile(config);
|
||||
const frontmatter = content.match(/^---\n([\s\S]*?)\n---\n/)?.[1] ?? '';
|
||||
|
||||
expect(frontmatter).toMatch(/^name: ui-ux-pro-max$/m);
|
||||
expect(frontmatter).toMatch(/^description: "UI\/UX design intelligence/m);
|
||||
});
|
||||
|
||||
test('kimi installs the skill, its data and the sub-skills under .kimi-code/skills', async () => {
|
||||
const scratch = await scratchDir('install');
|
||||
|
||||
await generatePlatformFiles(scratch, 'kimi');
|
||||
|
||||
const skills = join(scratch, '.kimi-code', 'skills');
|
||||
expect(existsSync(join(skills, 'ui-ux-pro-max', 'SKILL.md'))).toBe(true);
|
||||
expect(existsSync(join(skills, 'ui-ux-pro-max', 'scripts', 'search.py'))).toBe(true);
|
||||
expect(existsSync(join(skills, 'ui-ux-pro-max', 'data'))).toBe(true);
|
||||
for (const name of await listBundledSubSkills()) {
|
||||
expect(existsSync(join(skills, name, 'SKILL.md')), name).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test('a .kimi-code directory is detected as kimi', async () => {
|
||||
const scratch = await scratchDir('detect');
|
||||
await mkdir(join(scratch, '.kimi-code'));
|
||||
|
||||
const { detected, suggested } = detectAIType(scratch);
|
||||
|
||||
expect(detected).toEqual(['kimi']);
|
||||
expect(suggested).toBe('kimi');
|
||||
expect(getAITypeDescription('kimi')).toBe('Kimi Code (.kimi-code/skills/)');
|
||||
});
|
||||
@ -7,6 +7,7 @@ const cases = [
|
||||
['kiro', '.kiro/steering/ui-ux-pro-max/scripts/search.py'],
|
||||
['droid', '.factory/skills/ui-ux-pro-max/scripts/search.py'],
|
||||
['zcode', '.zcode/skills/ui-ux-pro-max/scripts/search.py'],
|
||||
['kimi', '.kimi-code/skills/ui-ux-pro-max/scripts/search.py'],
|
||||
['amazonq', '.amazonq/skills/ui-ux-pro-max/scripts/search.py'],
|
||||
['openclaw', '.agents/skills/ui-ux-pro-max/scripts/search.py'],
|
||||
] as const;
|
||||
|
||||
@ -28,7 +28,7 @@ FLAGS = {
|
||||
"-f", "--persist", "--page", "--output-dir", "-o", "--force",
|
||||
"--variance", "--motion", "--density",
|
||||
}
|
||||
PLATFORM_COUNT = 23
|
||||
PLATFORM_COUNT = 24
|
||||
GUIDE_REQUIREMENTS = (
|
||||
"## Query Contract", "one dominant intent", "Retry once",
|
||||
"Do not persist unverified output", "explicit accessibility outcome terms",
|
||||
|
||||
21
src/ui-ux-pro-max/templates/platforms/kimi.json
Normal file
21
src/ui-ux-pro-max/templates/platforms/kimi.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"platform": "kimi",
|
||||
"displayName": "Kimi Code",
|
||||
"installType": "full",
|
||||
"folderStructure": {
|
||||
"root": ".kimi-code",
|
||||
"skillPath": "skills/ui-ux-pro-max",
|
||||
"filename": "SKILL.md"
|
||||
},
|
||||
"scriptPath": "skills/ui-ux-pro-max/scripts/search.py",
|
||||
"frontmatter": {
|
||||
"name": "ui-ux-pro-max",
|
||||
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks."
|
||||
},
|
||||
"sections": {
|
||||
"quickReference": false
|
||||
},
|
||||
"title": "ui-ux-pro-max",
|
||||
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks.",
|
||||
"skillOrWorkflow": "Skill"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user