@@ -8,7 +8,7 @@ import { homedir } from 'node:os'
88import { join } from 'node:path'
99
1010import process from 'node:process'
11- import { cancel , confirm , isCancel , select } from '@clack/prompts'
11+ import { cancel , confirm , isCancel , select , spinner } from '@clack/prompts'
1212import { updateConfig } from 'c12/update'
1313import { defineCommand } from 'citty'
1414import { colors } from 'consola/utils'
@@ -25,6 +25,7 @@ import { relativeToProcess } from '../../utils/paths'
2525import { getNuxtVersion } from '../../utils/versions'
2626import { cwdArgs , logLevelArgs } from '../_shared'
2727import prepareCommand from '../prepare'
28+ import { detectModuleSkills , getSkillNames , installSkills } from './_skills'
2829import { checkNuxtCompatibility , fetchModules , getRegistryFromContent } from './_utils'
2930
3031interface RegistryMeta {
@@ -101,6 +102,27 @@ export default defineCommand({
101102
102103 await addModules ( resolvedModules , { ...ctx . args , cwd } , projectPkg )
103104
105+ // Check for agent skills
106+ if ( ! ctx . args . skipInstall ) {
107+ const moduleNames = resolvedModules . map ( m => m . pkgName )
108+ const checkSpinner = spinner ( )
109+ checkSpinner . start ( 'Checking for agent skills...' )
110+ const skillInfos = await detectModuleSkills ( moduleNames , cwd )
111+ checkSpinner . stop ( skillInfos . length > 0 ? `Found ${ skillInfos . length } skill(s)` : 'No skills found' )
112+
113+ if ( skillInfos . length > 0 ) {
114+ const skillNames = getSkillNames ( skillInfos )
115+ const shouldInstall = await confirm ( {
116+ message : `Install agent skill(s): ${ skillNames } ?` ,
117+ initialValue : true ,
118+ } )
119+
120+ if ( ! isCancel ( shouldInstall ) && shouldInstall ) {
121+ await installSkills ( skillInfos , cwd )
122+ }
123+ }
124+ }
125+
104126 // Run prepare command if install is not skipped
105127 if ( ! ctx . args . skipInstall ) {
106128 const args = Object . entries ( ctx . args ) . filter ( ( [ k ] ) => k in cwdArgs || k in logLevelArgs ) . map ( ( [ k , v ] ) => `--${ k } =${ v } ` )
0 commit comments