@@ -79,6 +79,23 @@ function collectLocales(index) {
7979 return [ ...localeSet ] . sort ( )
8080}
8181
82+ const EXCLUDED_BUNDLED_SKILL_FILES = new Set ( [
83+ "php_deserialization.md" ,
84+ "java_practical.md" ,
85+ ] )
86+
87+ async function removeExcludedBundledSkillFiles ( dir = bundledSkillsDir ) {
88+ for ( const entry of await fs . readdir ( dir , { withFileTypes : true } ) . catch ( ( ) => [ ] ) ) {
89+ const entryPath = path . join ( dir , entry . name )
90+ if ( entry . isDirectory ( ) ) {
91+ await removeExcludedBundledSkillFiles ( entryPath )
92+ } else if ( EXCLUDED_BUNDLED_SKILL_FILES . has ( entry . name ) ) {
93+ await fs . rm ( entryPath )
94+ console . log ( ` ⚠ Removed excluded file: ${ entryPath } ` )
95+ }
96+ }
97+ }
98+
8299async function getExtensionVersion ( ) {
83100 try {
84101 const packagePath = path . join ( projectRoot , "src" , "package.json" )
@@ -105,24 +122,6 @@ async function cloneAndCopy(cloneDir, index) {
105122 await fs . rm ( entryPath , { recursive : true , force : true } )
106123 }
107124 }
108- // Files to always exclude from bundled skills (flagged by VS Marketplace virus scan)
109- const excludeFiles = new Set ( [
110- "php_deserialization.md" ,
111- ] )
112-
113- async function removeExcludedFiles ( dir ) {
114- for ( const file of excludeFiles ) {
115- const filePath = path . join ( dir , file )
116- try {
117- await fs . access ( filePath )
118- await fs . rm ( filePath )
119- console . log ( ` ⚠ Removed excluded file: ${ filePath } ` )
120- } catch {
121- // File not present, skip
122- }
123- }
124- }
125-
126125 for ( const locale of locales ) {
127126 for ( const skill of index . skills ) {
128127 const skillMdPath = skill . path [ locale ]
@@ -137,7 +136,7 @@ async function cloneAndCopy(cloneDir, index) {
137136 await fs . cp ( srcDir , outputDir , { recursive : true } )
138137
139138 // Remove files that are flagged by VS Marketplace
140- await removeExcludedFiles ( outputDir )
139+ await removeExcludedBundledSkillFiles ( outputDir )
141140
142141 // Verify SKILL.md exists
143142 const skillMd = path . join ( outputDir , "SKILL.md" )
@@ -244,6 +243,7 @@ async function main() {
244243 }
245244 }
246245
246+ await removeExcludedBundledSkillFiles ( )
247247 await generateIndexJson ( commitSha )
248248
249249 console . log ( `✓ Bundled skills directory: ${ bundledSkillsDir } ` )
0 commit comments