22
33/**
44 * Generate JSON metadata files for the GitHub Pages website.
5- * This script extracts metadata from agents, prompts, instructions, skills, and plugins
5+ * This script extracts metadata from agents, instructions, skills, hooks , and plugins
66 * and writes them to website/data/ for client-side search and display.
77 */
88
@@ -15,7 +15,6 @@ import {
1515 HOOKS_DIR ,
1616 INSTRUCTIONS_DIR ,
1717 PLUGINS_DIR ,
18- PROMPTS_DIR ,
1918 ROOT_FOLDER ,
2019 SKILLS_DIR
2120} from "./constants.mjs" ;
@@ -192,50 +191,7 @@ function generateHooksData(gitDates) {
192191 } ;
193192}
194193
195- /**
196- * Generate prompts metadata
197- */
198- function generatePromptsData ( gitDates ) {
199- const prompts = [ ] ;
200- const files = fs
201- . readdirSync ( PROMPTS_DIR )
202- . filter ( ( f ) => f . endsWith ( ".prompt.md" ) ) ;
203-
204- // Track all unique tools for filters
205- const allTools = new Set ( ) ;
206-
207- for ( const file of files ) {
208- const filePath = path . join ( PROMPTS_DIR , file ) ;
209- const frontmatter = parseFrontmatter ( filePath ) ;
210- const relativePath = path
211- . relative ( ROOT_FOLDER , filePath )
212- . replace ( / \\ / g, "/" ) ;
213-
214- const tools = frontmatter ?. tools || [ ] ;
215- tools . forEach ( ( t ) => allTools . add ( t ) ) ;
216-
217- prompts . push ( {
218- id : file . replace ( ".prompt.md" , "" ) ,
219- title : extractTitle ( filePath , frontmatter ) ,
220- description : frontmatter ?. description || "" ,
221- agent : frontmatter ?. agent || null ,
222- model : frontmatter ?. model || null ,
223- tools : tools ,
224- path : relativePath ,
225- filename : file ,
226- lastUpdated : gitDates . get ( relativePath ) || null ,
227- } ) ;
228- }
229194
230- const sortedPrompts = prompts . sort ( ( a , b ) => a . title . localeCompare ( b . title ) ) ;
231-
232- return {
233- items : sortedPrompts ,
234- filters : {
235- tools : Array . from ( allTools ) . sort ( ) ,
236- } ,
237- } ;
238- }
239195
240196/**
241197 * Parse applyTo field into an array of patterns
@@ -603,7 +559,6 @@ function generateToolsData() {
603559 */
604560function generateSearchIndex (
605561 agents ,
606- prompts ,
607562 instructions ,
608563 hooks ,
609564 skills ,
@@ -625,18 +580,6 @@ function generateSearchIndex(
625580 } ) ;
626581 }
627582
628- for ( const prompt of prompts ) {
629- index . push ( {
630- type : "prompt" ,
631- id : prompt . id ,
632- title : prompt . title ,
633- description : prompt . description ,
634- path : prompt . path ,
635- lastUpdated : prompt . lastUpdated ,
636- searchText : `${ prompt . title } ${ prompt . description } ` . toLowerCase ( ) ,
637- } ) ;
638- }
639-
640583 for ( const instruction of instructions ) {
641584 index . push ( {
642585 type : "instruction" ,
@@ -799,7 +742,7 @@ async function main() {
799742 // Load git dates for all resource files (single efficient git command)
800743 console . log ( "Loading git history for last updated dates..." ) ;
801744 const gitDates = getGitFileDates (
802- [ "agents/" , "prompts/" , " instructions/", "hooks/" , "skills/" , "plugins/" ] ,
745+ [ "agents/" , "instructions/" , "hooks/" , "skills/" , "plugins/" ] ,
803746 ROOT_FOLDER
804747 ) ;
805748 console . log ( `✓ Loaded dates for ${ gitDates . size } files\n` ) ;
@@ -817,12 +760,6 @@ async function main() {
817760 `✓ Generated ${ hooks . length } hooks (${ hooksData . filters . hooks . length } hook types, ${ hooksData . filters . tags . length } tags)`
818761 ) ;
819762
820- const promptsData = generatePromptsData ( gitDates ) ;
821- const prompts = promptsData . items ;
822- console . log (
823- `✓ Generated ${ prompts . length } prompts (${ promptsData . filters . tools . length } tools)`
824- ) ;
825-
826763 const instructionsData = generateInstructionsData ( gitDates ) ;
827764 const instructions = instructionsData . items ;
828765 console . log (
@@ -854,7 +791,6 @@ async function main() {
854791
855792 const searchIndex = generateSearchIndex (
856793 agents ,
857- prompts ,
858794 instructions ,
859795 hooks ,
860796 skills ,
@@ -873,11 +809,6 @@ async function main() {
873809 JSON . stringify ( hooksData , null , 2 )
874810 ) ;
875811
876- fs . writeFileSync (
877- path . join ( WEBSITE_DATA_DIR , "prompts.json" ) ,
878- JSON . stringify ( promptsData , null , 2 )
879- ) ;
880-
881812 fs . writeFileSync (
882813 path . join ( WEBSITE_DATA_DIR , "instructions.json" ) ,
883814 JSON . stringify ( instructionsData , null , 2 )
@@ -913,7 +844,6 @@ async function main() {
913844 generated : new Date ( ) . toISOString ( ) ,
914845 counts : {
915846 agents : agents . length ,
916- prompts : prompts . length ,
917847 instructions : instructions . length ,
918848 skills : skills . length ,
919849 hooks : hooks . length ,
0 commit comments