8000 Refine prompt to avoid statements were it keeps the logic [3] · Shopify/theme-tools@6f2b83b · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Refine prompt to avoid statements were it keeps the logic [3]
Browse files Browse the repository at this point in the history
  • Loading branch information
karreiro committed Feb 10, 2025
1 parent c8b67ad commit 6f2b83b
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions packages/vscode-extension/src/node/shopify-magic-prompts/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,34 @@ export function basePrompt(textEditor: TextEditor): string {
<objective>Optimal Theme Development</objective>
</prompt_metadata>
<focus_areas>
<area>Enhancing readability, conciseness, and efficiency while maintaining the same functionality</area>
<area>Leveraging new features in Liquid, including filters, tags, and objects</area>
<area>Be pragmatic and don't suggest without a really good reason</area>
<area>Combine multiple operations into one to improve readability and performance -- for example, use the find filter instead of where and first, if find is a valid filter</area>
<area>You should not suggest changes to the code that impact only HTML -- they should be focused on Liquid and Theme features.</area>
<area>You should not talk about whitespaces and the style of the code; leave that to the linter!</area>
<area>**Do not suggest to keep** something that is already valid</area>
<area>**Improve the conciseness and efficiency of Liquid code** while maintaining the same functionality</area>
<area>**Leverage the most appropriate Liquid** features (filters, tags, and objects); sometimes a filter can achieve the same result as a block of code</area>
<area>Avoid logic that matches the default behavior (especially for filters)</area>
<area>Improve readability, but **be pragmatic** and **do not suggest unless there's a strong reason**</area>
<area>Use filters for operations that perform the same function as a filter</area>
<area>Use unless for negative conditions</area>
</focus_areas>
<ensurance>
<point>The new code you propose contain full lines of valid code and keep the correct indentation, scope, and style format as the original code</point>
<point>Scopes are defined by the opened by "{%", "{{" with the matching closing element "%}" or "}}"</point>
<point>The range must include the closing element ("%}","}}") for every opening element ("{%","{{")</point>
<point>**Suggest only valid Liquid**</point>
<point>Suggested code must be different from the original code (not considering Liquid hyphens)</point>
<point>**Do not suggest code styling changes**; whitespaces, blank lines, it's best to leave that to the linter!</point>
<point>**Do not suggest refactorings** about combining variables</point>
<point>**Do not suggest refactorings** about Liquid hyphens</point>
<point>**Do not suggest keeping** something that is already good</point>
<point>**Do not suggest refactor** content_for using render</point>
<point>**Do not suggest** changes that impact **only readability**</point>
<point>**Do not suggest** something that **changes the logic/functionality**</point>
<point>**Do not make up or create** new invalid Shopify Liquid features (filters, tags, objects, etc.)</point>
<point>**Do not suggest** changes that affect only **HTML**—focus on Liquid and Theme features instead</point>
<point>Do not suggest the default filter with settings with a default value</point>
<point>The new code you propose should contain full lines of valid code and maintain the correct indentation, scope, and style format as the original code</point>
<point>Scopes are defined by the opening of "{%" or "{{" with the matching closing element "%}" or "}}"</point>
<point>The range must include the closing element ("%}", "}}") for every opening element ("{%", "{{")</point>
<point>Code suggestions cannot overlap in line numbers. If you have multiple suggestions for the same code chunk, merge them into a single suggestion</point>
<point>Make full-scope suggestions that consider the entire context of the code you are modifying, keeping the logical scope of the code valid</point>
<point>The resulting code must work and should not break existing HTML tags or Liquid syntax</point>
<point>The suggestions are specific, actionable, and align with the best practices in Liquid and Shopify theme development</point>
<point>Add a maximum of ${numberOfSuggestions} distinct suggestions to the array</point>
<point>The suggestions should be specific, actionable, and align with the best practices in Liquid and Shopify theme development</point>
<point>You must have zero up to a maximum of ${numberOfSuggestions} distinct suggestions to the array</point>
</ensurance>
<references>
Use the <theme_architecture>, <liquid_rules>, and Shopify.dev context as a reference. Do not make up new information.
Expand Down

0 comments on commit 6f2b83b

Please sign in to comment.
0