Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LLM instructions file suggestion #669

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Conversation

madmath
Copy link

@madmath madmath commented Dec 11, 2024

What are you adding in this PR?

This PR introduces support for:

  • Suggesting the addition of an LLM instructions file in the repo if there isn't one
  • Suggesting the update of an LLM instructions file when it looks outdated
  • The "Shopify Magic" button in the top corner of the editor
  • The "Shopify Magic" refactoring button in the context menu when users select a piece of Liquid
  • The creation of the .cursorrules/copilot-instructions.md which works with multiple themes opened in the same workspace
  • The .cursorrules/copilot-instructions.md files are generated based on https://github.com/Shopify/theme-liquid-docs

Click here to check a demo of this feature.

What's next? Any follow-up issues?

After clicking on “Quick fix,” close the hover dialog automatically (so users may see the suggestions immediately) — I don't think that's possible, but I'm planning to revisit this when we get this work on main.

Before you deploy

  • I included a minor bump changeset
  • My feature is backward compatible

@madmath madmath force-pushed the llm-instructions-file branch 2 times, most recently from a7f5b8b to 81ad912 Compare December 12, 2024 15:43
@karreiro karreiro force-pushed the llm-instructions-file branch 2 times, most recently from 1edad8c to 288f786 Compare January 28, 2025 14:11
@karreiro
Copy link
Contributor

I've created this PR for future reference so we can have a diff of the changes between the prototype and this version.

@karreiro karreiro marked this pull request as ready for review January 28, 2025 16:08
@karreiro karreiro requested a review from a team as a code owner January 28, 2025 16:08
@karreiro
Copy link
Contributor

👋 Hey @charlespwd @frandiox, this PR is ready for review now :)

Copy link

@frandiox frandiox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thanks a lot for all the improvements and tests! The fact that it uses up to date liquid docs is such a nice change 🙌

I'm having certificate issues to run this in my new laptop though, so I couldn't 🎩 yet :/

Copy link

@frandiox frandiox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally able to test it, great job 🎉
I've tried to close the hover without much luck either!

While testing, I found a few minor things:

  1. I got into this situation a couple of times when applying one suggestion after another. cmd+z and click again fixes the situation... no idea why it happens in the first place :/
image image
  1. I saw you added a comment to avoid the "Keep xyz when is already valid"... however this still happens often:
image

Should we maybe compare the suggestion with the code-to-be-replaced and skip it if it's the same? 🤔

  1. Not important but do we rename sidefix to something else?
image

@karreiro
Copy link
Contributor

Thank you for the review, @frandiox!

I've applied the suggestions :) also, I've created this to handle scenario 1, slightly updated the prompt to prevent the scenario 2 (I couldn't get those "Keep <suggestion...>" anymore in my theme), and I've renamed sidefix to sideMagic to handle scenario 3 :)

Thanks again for the review! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants