Files
ui-ux-pro-max-skill/cli/src/utils/detect.ts
Viet Tran 939818b024 feat: add GitHub Copilot support (#17)
- Add .github/prompts/ui-ux-pro-max.prompt.md for Copilot
- Add 'copilot' as new AI type in CLI
- Update detect utility to recognize .github folder
- Update CLAUDE.md sync rules with .github
- Update README with Copilot installation and usage
- Bump version to 1.2.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-03 14:19:03 +07:00

56 lines
1.4 KiB
TypeScript

import { existsSync } from 'node:fs';
import { join } from 'node:path';
import type { AIType } from '../types/index.js';
interface DetectionResult {
detected: AIType[];
suggested: AIType | null;
}
export function detectAIType(cwd: string = process.cwd()): DetectionResult {
const detected: AIType[] = [];
if (existsSync(join(cwd, '.claude'))) {
detected.push('claude');
}
if (existsSync(join(cwd, '.cursor'))) {
detected.push('cursor');
}
if (existsSync(join(cwd, '.windsurf'))) {
detected.push('windsurf');
}
if (existsSync(join(cwd, '.agent'))) {
detected.push('antigravity');
}
if (existsSync(join(cwd, '.github'))) {
detected.push('copilot');
}
// Suggest based on what's detected
let suggested: AIType | null = null;
if (detected.length === 1) {
suggested = detected[0];
} else if (detected.length > 1) {
suggested = 'all';
}
return { detected, suggested };
}
export function getAITypeDescription(aiType: AIType): string {
switch (aiType) {
case 'claude':
return 'Claude Code (.claude/skills/)';
case 'cursor':
return 'Cursor (.cursor/commands/ + .shared/)';
case 'windsurf':
return 'Windsurf (.windsurf/workflows/ + .shared/)';
case 'antigravity':
return 'Antigravity (.agent/workflows/ + .shared/)';
case 'copilot':
return 'GitHub Copilot (.github/prompts/ + .shared/)';
case 'all':
return 'All AI assistants';
}
}