Skip to content

Allow custom prompts #2

@thealternator89

Description

@thealternator89

Currently the prompts are hardcoded. We should allow users to customize the prompt to get whatever output they want from the AI tool.

Provide substitution handling to allow the custom prompt to be populated as the user wants, e.g.

Generate a set of comprehensive test cases for the following user story/ticket.

Ticket ID: %%Id%%
Title: %%Title%%
Description: %%Description%%
Acceptance Criteria: %%AcceptanceCriteria%%

Additional Context: %%Context%%

Please format the output in a Markdown table, including:
- Test Case ID
- Description
- Pre-conditions
- Steps
- Expected Result
- Priority

Note the above %%...%% substitutions are just a suggestion - we can consider using something like Handlebars or other templating engines, or other substitution characters for handling the substitutions, however consider:

  • Whether the substitutions are likely to cause issues with someone writing a prompt (e.g. you could use parentheses, but someone possibly would want to include those literally and it might lead to issues with the prompt - things like $$...$$ or %%...%% are pretty unusual in regular text so we can be pretty safe that they won't be used)
  • Whether the tool is an appropriate size for what we need to do
  • Ideally don't require regexes to parse the text - but they can be used if they are simple.

Acceptance Criteria:

  1. Allow the user to customise the prompt for each tool

  2. Keep the current prompts as initial values, and allow the user to reset back to the initial prompts if they break theirs

  3. The final part should be fixed on all prompts, as that is designed to ensure GitHub Copilot doesn't do anything unexpected (it either should be fixed based on the tool, or contain substitutions to work for all tools):

    DO NOT create any files. Directly output the test cases in your response here.
    DO NOT include any other text in your response other than the markdown table.
    

    The fixed final part of the prompt should be displayed in the editor screen so the user is aware of it

  4. For each prompt, we should display which substitutions are available in the editor, and check if they are used in the user's prompt.

    • Possibly track which substitutions are required or optional, and ensure the required ones are present in the prompt when saving, to ensure the user can't write a faulty prompt
    • Warn the user if they include something that looks like a substitution but we don't recognise it - to catch typos like %%AcceptnceCriteria%%. If AC's aren't required (above point) we will otherwise silently ignore them being missing from the prompt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovements or minor features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions