@@ -10,6 +10,31 @@ component singleton {
1010 property name = " wirebox" inject = " wirebox" ;
1111 property name = " utility" inject = " Utility@coldbox-cli" ;
1212
13+ static {
14+ SUPPORTED_AGENTS = [ " claude" , " copilot" , " cursor" , " codex" , " gemini" , " opencode" ]
15+ AGENT_FILES = {
16+ " claude" : " CLAUDE.md" ,
17+ " copilot" : " .github/copilot-instructions.md" ,
18+ " cursor" : " .cursorrules" ,
19+ " codex" : " .codex/instructions.md" ,
20+ " gemini" : " .gemini/instructions.md" ,
21+ " opencode" : " .opencode/instructions.md"
22+ }
23+ AGENT_OPTIONS = [
24+ { display : " Claude (Anthropic) - Recommended for general development" , value : " claude" },
25+ { display : " GitHub Copilot - Integrated with VS Code" , value : " copilot" },
26+ { display : " Cursor AI - AI-first code editor" , value : " cursor" },
27+ { display : " Codex (OpenAI) - GPT-powered coding assistant" , value : " codex" },
28+ { display : " Gemini (Google) - Google's AI assistant" , value : " gemini" },
29+ { display : " OpenCode - Open source AI assistant" , value : " opencode" }
30+ ]
31+ }
32+
33+ // Expose them as instance properties for easier access in commands
34+ this .SUPPORTED_AGENTS = static .SUPPORTED_AGENTS
35+ this .AGENT_OPTIONS = static .AGENT_OPTIONS
36+ this .AGENT_FILES = static .AGENT_FILES
37+
1338 /**
1439 * Configure agents for a project
1540 *
@@ -30,31 +55,19 @@ component singleton {
3055 }
3156
3257 /**
33- * Get a specific agent's config file path
58+ * Get the config path mapping for all supported agents or a specific agent if passed
3459 *
35- * @agent The agent name (claude, copilot, cursor, etc. )
60+ * @agentName Optional agent name to get specific path for (claude, copilot, cursor, codex, gemini, opencode )
3661 *
37- * @return The expected config file path for the agent
62+ * @return Struct with agent names as keys and config paths as values as per their conventions
3863 */
39- function getAgentConfigPath( required string agent ){
40- var paths = getAgentConfigPaths ()
41- return paths [ arguments .agent ] ?: " AI_INSTRUCTIONS.md"
42- }
64+ function getAgentConfigPaths( string agentName ){
4365
44- /**
45- * Get the config path mapping for all supported agents
46- *
47- * @return Struct with agent names as keys and config paths as values
48- */
49- function getAgentConfigPaths(){
50- return {
51- " claude" : " CLAUDE.md" ,
52- " copilot" : " .github/copilot-instructions.md" ,
53- " cursor" : " .cursorrules" ,
54- " codex" : " .codex/instructions.md" ,
55- " gemini" : " .gemini/instructions.md" ,
56- " opencode" : " .opencode/instructions.md"
66+ if ( ! isNull ( arguments .agentName ) ){
67+ return static .AGENT_FILES [ arguments .agentName ] ?: " AI_INSTRUCTIONS.md"
5768 }
69+
70+ return static .AGENT_FILES
5871 }
5972
6073 /**
@@ -113,12 +126,17 @@ component singleton {
113126 }
114127
115128 /**
116- * Get agent config file path
129+ * Get agent config file path for a specific agent on a specific project directory
117130 *
118131 * @directory The project directory
119132 * @agent The agent name (claude, copilot, cursor, etc.)
120133 */
121- private function getAgentConfigPath ( required string directory , required string agent ){
134+ function getAgentConfigPath ( required string directory , required string agent ){
135+ // Check if directory ends in / or \ and remove it for consistent path building
136+ if ( right ( arguments .directory , 1 ) == " /" || right ( arguments .directory , 1 ) == " \" ) {
137+ arguments .directory = left ( arguments .directory , len ( arguments .directory ) - 1 )
138+ }
139+
122140 switch ( arguments .agent ) {
123141 case " claude" :
124142 return " #arguments .directory #/CLAUDE.md"
0 commit comments