@@ -391,7 +391,7 @@ func installRun(opts *InstallOptions) error {
391391 }
392392
393393 printFileTree (opts .IO .ErrOut , cs , result .Dir , result .Installed )
394- printReviewHint (opts .IO .ErrOut , cs , repoSource , resolved .SHA , result .Installed )
394+ printReviewHint (opts .IO .ErrOut , cs , repoSource , resolved .SHA , result .Installed , opts . AllowHiddenDirs )
395395 printHostHints (opts .IO .ErrOut , cs , plan .hosts , result .Installed , result .Dir , gitRoot )
396396 }
397397
@@ -536,7 +536,7 @@ func runLocalInstall(opts *InstallOptions) error {
536536 }
537537
538538 printFileTree (opts .IO .ErrOut , cs , result .Dir , result .Installed )
539- printReviewHint (opts .IO .ErrOut , cs , "" , "" , result .Installed )
539+ printReviewHint (opts .IO .ErrOut , cs , "" , "" , result .Installed , false )
540540 printHostHints (opts .IO .ErrOut , cs , plan .hosts , result .Installed , result .Dir , gitRoot )
541541 }
542542
@@ -1118,8 +1118,10 @@ func printPreInstallDisclaimer(w io.Writer, cs *iostreams.ColorScheme) {
11181118
11191119// printReviewHint warns the user to review installed skills and suggests preview commands.
11201120// When sha is non-empty the suggested commands include @SHA so the user previews
1121- // exactly the version that was installed.
1122- func printReviewHint (w io.Writer , cs * iostreams.ColorScheme , repo , sha string , skillNames []string ) {
1121+ // exactly the version that was installed. When allowHiddenDirs is true, the
1122+ // suggested commands include --allow-hidden-dirs so previewing hidden-dir
1123+ // skills works without an extra manual step.
1124+ func printReviewHint (w io.Writer , cs * iostreams.ColorScheme , repo , sha string , skillNames []string , allowHiddenDirs bool ) {
11231125 if len (skillNames ) == 0 {
11241126 return
11251127 }
@@ -1130,11 +1132,15 @@ func printReviewHint(w io.Writer, cs *iostreams.ColorScheme, repo, sha string, s
11301132 }
11311133 fmt .Fprintln (w , " Review installed content before use:" )
11321134 fmt .Fprintln (w )
1135+ hiddenFlag := ""
1136+ if allowHiddenDirs {
1137+ hiddenFlag = " --allow-hidden-dirs"
1138+ }
11331139 for _ , name := range skillNames {
11341140 if sha != "" {
1135- fmt .Fprintf (w , " gh skill preview %s %s@%s\n " , repo , name , sha )
1141+ fmt .Fprintf (w , " gh skill preview %s %s@%s%s \n " , repo , name , sha , hiddenFlag )
11361142 } else {
1137- fmt .Fprintf (w , " gh skill preview %s %s\n " , repo , name )
1143+ fmt .Fprintf (w , " gh skill preview %s %s%s \n " , repo , name , hiddenFlag )
11381144 }
11391145 }
11401146 fmt .Fprintln (w )
@@ -1180,10 +1186,9 @@ func kiroResourcePath(installDir, gitRoot string) string {
11801186 return filepath .ToSlash (installDir )
11811187}
11821188
1183- // filterHiddenDirSkills separates hidden-dir skills from the full list and
1184- // applies the --allow-hidden-dirs flag logic. When the flag is set, all skills
1185- // are returned and a warning is printed. When the flag is not set, hidden-dir
1186- // skills are excluded and an error is returned if no standard skills remain.
1189+ // filterHiddenDirSkills applies the --allow-hidden-dirs flag logic. When the
1190+ // flag is set, all skills are returned with a warning. Otherwise, hidden-dir
1191+ // skills are excluded with an error if no standard skills remain.
11871192func filterHiddenDirSkills (opts * InstallOptions , allSkills []discovery.Skill ) ([]discovery.Skill , error ) {
11881193 cs := opts .IO .ColorScheme ()
11891194
@@ -1198,25 +1203,16 @@ func filterHiddenDirSkills(opts *InstallOptions, allSkills []discovery.Skill) ([
11981203 return allSkills , nil
11991204 }
12001205
1201- var standard []discovery.Skill
1202- var hiddenCount int
1203- for _ , s := range allSkills {
1204- if s .IsHiddenDirConvention () {
1205- hiddenCount ++
1206- } else {
1207- standard = append (standard , s )
1208- }
1209- }
1210-
1211- if len (standard ) == 0 && hiddenCount > 0 {
1206+ r := discovery .PartitionHiddenDirSkills (allSkills )
1207+ if len (r .Standard ) == 0 && r .HiddenCount > 0 {
12121208 return nil , fmt .Errorf (
12131209 "no standard skills found, but %d skill(s) exist in hidden directories\n " +
12141210 " Use --allow-hidden-dirs to include them" ,
1215- hiddenCount ,
1211+ r . HiddenCount ,
12161212 )
12171213 }
12181214
1219- return standard , nil
1215+ return r . Standard , nil
12201216}
12211217
12221218// checkUpstreamProvenance fetches the skill's SKILL.md via the contents API
0 commit comments