Skip to content

Enhance Bulk Prompt Addition Process #36

@thibaultyou

Description

@thibaultyou

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.yml
    • src/core/generate_metadata.ts
    • src/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.ts to process multiple prompts in a single run
  • Update update_views.ts to 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

  1. Modify update_views.yml:

    • Change the trigger to watch for changes in the prompts directory instead of specific files
    • Implement a step to identify all new or modified prompt directories
  2. Update generate_metadata.ts:

    • Modify the updatePromptMetadata function to accept an array of prompt directories
    • Implement parallel processing of multiple prompts using Promise.all()
  3. Update update_views.ts:

    • Modify the updateViews function to handle multiple prompt updates in a single run
    • Optimize the README generation process for bulk updates
  4. Create a new utility function in src/utils:

    • Implement a getBulkPromptChanges function to identify new or modified prompt directories

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.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions