-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Description
Currently, the automated process for adding new prompts is based on the addition of a single prompt.md file in the prompts directory, which triggers GitHub Actions to process and relocate the prompt. This system needs to be enhanced to handle multiple prompt files simultaneously, enabling a more efficient bulk addition process.
The enhancement will involve modifying the existing GitHub Actions workflow (update_views.yml) and potentially updating the core scripts (generate_metadata.ts and update_views.ts) to process multiple new prompt directories at once while maintaining the current file structure and organization.
Technical Details
- Affected files:
.github/workflows/update_views.ymlsrc/core/generate_metadata.tssrc/core/update_views.ts
- Components/Services:
- GitHub Actions
- Metadata generation process
- View update process
- Related issues/PRs: None identified
Acceptance Criteria
- Modify the GitHub Actions workflow to detect multiple new prompt directories
- Update
generate_metadata.tsto process multiple prompts in a single run - Update
update_views.tsto handle bulk updates of README files - Ensure each new prompt is processed correctly (metadata generation, view updates)
- Maintain the existing file structure (
README.md,metadata.yml,prompt.md) for each new prompt - Verify that the bulk addition process doesn't interfere with the existing single prompt addition functionality
- Add appropriate error handling and logging for the bulk process
- Update documentation to reflect the new bulk addition capability
Potential Solutions
-
Modify
update_views.yml:- Change the trigger to watch for changes in the
promptsdirectory instead of specific files - Implement a step to identify all new or modified prompt directories
- Change the trigger to watch for changes in the
-
Update
generate_metadata.ts:- Modify the
updatePromptMetadatafunction to accept an array of prompt directories - Implement parallel processing of multiple prompts using
Promise.all()
- Modify the
-
Update
update_views.ts:- Modify the
updateViewsfunction to handle multiple prompt updates in a single run - Optimize the README generation process for bulk updates
- Modify the
-
Create a new utility function in
src/utils:- Implement a
getBulkPromptChangesfunction to identify new or modified prompt directories
- Implement a
Additional Context
When implementing the bulk addition process, it's crucial to maintain this organization and ensure that the new functionality doesn't introduce complexity or reduce the system's maintainability.
Consider creating a small set of test prompts to verify the bulk addition process during development. This will help ensure that edge cases (such as prompts with special characters in their names or varying file sizes) are handled correctly.
Additionally, update the project's main README.md file to include instructions on how to use the new bulk addition feature, including any naming conventions or structural requirements for new prompt directories.