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 .cursorrules file #966

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add .cursorrules file #966

wants to merge 1 commit into from

Conversation

portdeveloper
Copy link
Contributor

@portdeveloper portdeveloper commented Oct 18, 2024

This PR introduces a .cursorrules file to enhance the development experience with Scaffold-ETH 2. The file contains:

  • Instructions for answering Scaffold-ETH 2 related questions
  • Important notes on using correct hook names (useScaffoldReadContract, useScaffoldWriteContract, these were used wrongly by AI as useScaffoldContractRead and useScaffoldContractWrite respectively)
  • Example Q&As for common scenarios

I have read the documentation for prompt engineering on Claude.

And these were the steps:

  1. Prompt generator - is sth online
  2. Be clear and direct - tried with using clear verbs
  3. Use examples (multishot) - gave two eamples
  4. Let Claude think (chain of thought) - used the usual "think step-by-step" trick
  5. Use XML tags - used them whenever possible to tell ai about important stuff or just to categorize
  6. Give Claude a role (system prompts) - an expert in scaffold-eth 2
  7. Prefill Claude’s response - didn't use this as answers might be different?
  8. Chain complex prompts - didn't use it
  9. Long context tips - the user doesn't use a long context by default?

To be honest, prompt engineering does not overlap with what a .cursorrules file is 100%. But I believe that using a .cursorrrules file such as this one makes sense as it improves how a newbie might interact with SE-2.

Also, the user might want to index se-2 docs, to better benefit from Cursor and also from the .cursorrules file, as we tell the LLM to check the docs as well.:
image

I believe the .cursorrules file can be improved on, and I would love to hear your feedback on this.

How to test

  1. Clone the repo and switch to the branch.
  2. Go to cursor settings and index se-2 docs
  3. Open a chat
  4. While asking your first question, please use CTRL+ENTER for windows and CMD+ENTER for macos for cursor to see all the files

@damianmarti
Copy link
Member

@portdeveloper this looks good, I will try it. Is there a way to add the documentation link on the cursorrules file, so the user do not need to add this manually?

@portdeveloper
Copy link
Contributor Author

@damianmarti Thanks!

I put it as a link there, but that way, the AI does not always read it.
I also tried putting docs in a single file here, and then putting it into the cursorrules file,
https://raw.githubusercontent.com/portdeveloper/crawl-se-2-docs/refs/heads/main/flattened_docs.md

But since it is looong, the AI again does not read it well. The only way here is to index it using Cursor's Docs feature.

@damianmarti
Copy link
Member

@damianmarti Thanks!

I put it as a link there, but that way, the AI does not always read it. I also tried putting docs in a single file here, and then putting it into the cursorrules file, https://raw.githubusercontent.com/portdeveloper/crawl-se-2-docs/refs/heads/main/flattened_docs.md

But since it is looong, the AI again does not read it well. The only way here is to index it using Cursor's Docs feature.

ok, thanks!!

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.

2 participants