@@ -14,18 +14,7 @@ const SUPERPOWERS_SKILLS = [
1414 'subagent-driven-development' ,
1515] ;
1616
17- function getBaseDir ( scope : InstallScope , projectPath : string ) : string {
18- return scope === 'global' ? os . homedir ( ) : projectPath ;
19- }
20-
21- /**
22- * Check if superpowers are installed via Claude Code plugin system.
23- * Looks in ~/.claude/plugins/cache/{marketplace}/superpowers/{version}/skills/
24- */
25- async function hasPluginSuperpowers ( ) : Promise < boolean > {
26- const claudeDir = process . env . CLAUDE_CONFIG_DIR || path . join ( os . homedir ( ) , '.claude' ) ;
27- const pluginsCacheDir = path . join ( claudeDir , 'plugins' , 'cache' ) ;
28-
17+ async function hasSuperpowersInPluginCache ( pluginsCacheDir : string ) : Promise < boolean > {
2918 const marketplaceEntries = await readDir ( pluginsCacheDir ) ;
3019 for ( const marketplace of marketplaceEntries ) {
3120 const superpowersDir = path . join ( pluginsCacheDir , marketplace , 'superpowers' ) ;
@@ -40,9 +29,37 @@ async function hasPluginSuperpowers(): Promise<boolean> {
4029 }
4130 }
4231 }
32+
4333 return false ;
4434}
4535
36+ function getBaseDir ( scope : InstallScope , projectPath : string ) : string {
37+ return scope === 'global' ? os . homedir ( ) : projectPath ;
38+ }
39+
40+ /**
41+ * Check if superpowers are installed via Claude Code plugin system.
42+ * Looks in ~/.claude/plugins/cache/{marketplace}/superpowers/{version}/skills/
43+ */
44+ async function hasPluginSuperpowers ( ) : Promise < boolean > {
45+ const claudeDir = process . env . CLAUDE_CONFIG_DIR || path . join ( os . homedir ( ) , '.claude' ) ;
46+ const pluginsCacheDir = path . join ( claudeDir , 'plugins' , 'cache' ) ;
47+
48+ return hasSuperpowersInPluginCache ( pluginsCacheDir ) ;
49+ }
50+
51+ /**
52+ * Check if superpowers are installed via Codex plugin system.
53+ * Looks in ~/.codex/plugins/cache/{marketplace}/superpowers/{version}/skills/
54+ */
55+ async function hasCodexPluginSuperpowers ( ) : Promise < boolean > {
56+ const codexDir =
57+ process . env . CODEX_HOME || process . env . CODEX_CONFIG_DIR || path . join ( os . homedir ( ) , '.codex' ) ;
58+ const pluginsCacheDir = path . join ( codexDir , 'plugins' , 'cache' ) ;
59+
60+ return hasSuperpowersInPluginCache ( pluginsCacheDir ) ;
61+ }
62+
4663/**
4764 * Check if superpowers are installed via OpenCode plugin system.
4865 * Checks multiple locations:
@@ -189,6 +206,11 @@ async function hasSkills(
189206 if ( await hasPluginSuperpowers ( ) ) return true ;
190207 }
191208
209+ // Check Codex plugin cache for plugin-installed superpowers
210+ if ( component === 'superpowers' && platform . id === 'codex' ) {
211+ if ( await hasCodexPluginSuperpowers ( ) ) return true ;
212+ }
213+
192214 // Check OpenCode plugin system for plugin-installed superpowers
193215 if ( component === 'superpowers' && platform . id === 'opencode' ) {
194216 if ( await hasOpenCodePluginSuperpowers ( ) ) return true ;
@@ -201,6 +223,7 @@ export {
201223 detectPlatforms ,
202224 hasSkills ,
203225 hasPluginSuperpowers ,
226+ hasCodexPluginSuperpowers ,
204227 hasOpenCodePluginSuperpowers ,
205228 getBaseDir ,
206229} ;
0 commit comments