-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Expand file tree
/
Copy pathdetect.ts
More file actions
executable file
·125 lines (119 loc) · 3.32 KB
/
Copy pathdetect.ts
File metadata and controls
executable file
·125 lines (119 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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, '.agents')) || existsSync(join(cwd, '.agent'))) {
detected.push('antigravity');
}
if (existsSync(join(cwd, '.github'))) {
detected.push('copilot');
}
if (existsSync(join(cwd, '.github', 'copilot-instructions.md'))) {
detected.push('copilot-cli');
}
if (existsSync(join(cwd, '.kiro'))) {
detected.push('kiro');
}
if (existsSync(join(cwd, '.codex'))) {
detected.push('codex');
}
if (existsSync(join(cwd, '.roo'))) {
detected.push('roocode');
}
if (existsSync(join(cwd, '.qoder'))) {
detected.push('qoder');
}
if (existsSync(join(cwd, '.gemini'))) {
detected.push('gemini');
}
if (existsSync(join(cwd, '.trae'))) {
detected.push('trae');
}
if (existsSync(join(cwd, '.opencode'))) {
detected.push('opencode');
}
if (existsSync(join(cwd, '.continue'))) {
detected.push('continue');
}
if (existsSync(join(cwd, '.codebuddy'))) {
detected.push('codebuddy');
}
if (existsSync(join(cwd, '.factory'))) {
detected.push('droid');
}
if (existsSync(join(cwd, '.kilocode'))) {
detected.push('kilocode');
}
if (existsSync(join(cwd, '.warp'))) {
detected.push('warp');
}
if (existsSync(join(cwd, '.augment'))) {
detected.push('augment');
}
// 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/skills/)';
case 'windsurf':
return 'Windsurf (.windsurf/skills/)';
case 'antigravity':
return 'Antigravity (.agents/skills/)';
case 'copilot':
return 'GitHub Copilot (.github/prompts/)';
case 'copilot-cli':
return 'GitHub Copilot CLI (.github/skills/)';
case 'kiro':
return 'Kiro (.kiro/steering/)';
case 'codex':
return 'Codex (.codex/skills/)';
case 'roocode':
return 'RooCode (.roo/skills/)';
case 'qoder':
return 'Qoder (.qoder/skills/)';
case 'gemini':
return 'Gemini CLI (.gemini/skills/)';
case 'trae':
return 'Trae (.trae/skills/)';
case 'opencode':
return 'OpenCode (.opencode/skills/)';
case 'continue':
return 'Continue (.continue/skills/)';
case 'codebuddy':
return 'CodeBuddy (.codebuddy/skills/)';
case 'droid':
return 'Droid (Factory) (.factory/skills/)';
case 'kilocode':
return 'KiloCode (.kilocode/skills/)';
case 'warp':
return 'Warp (.warp/skills/)';
case 'augment':
return 'Augment (.augment/skills/)';
case 'all':
return 'All AI assistants';
}
}