Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/20/2025 in all areas

  1. What is this about? When working with AI enhanced IDEs like Cursor or Windsurf, we often tend to give somewhat ambiguous requests like these exaggerated examples: or Much better wording for these examples would be AI tends to deliver much better results when we give it concise, technical instructions that fit the context. My approach I have tried to "automate" this in some ways with simple AI rules. Both Cursor and windsurf have a feature called AI rules where you can set global and project specific rules that the assistant will follow. This snippet is in my global rules: ## User Prompt Rephrasing Every time you encounter the exact keyword "rephrase" in a user prompt, do the following: 1. rephrase the user prompt in concise technical terms focusing on: - specific technical task scope - affected components/files - required functionality changes 2. preserve the users intent in the rephrased prompt 3. output the rephrased prompt and ask for confirmation with exact phrase "Act on the rephrased prompt? [y/n]" 4. IMPORTANT: after asking for confirmation, STOP and wait for explicit user response 5. proceed ONLY after receiving "y" confirmation, otherwise ask for clarification 6. when proceeding, act only on the rephrased prompt How it works Now, whenever I add "rephrase" to my prompt, the assistant will act accordingly. Example: Benefits The rephrased version offers several benefits over the original version: Component Clarity - Original was vague, rephrased version explicitly lists required components (GUI framework, drag-drop handler, PDF converter) Scope Definition - Clearly separates existing functionality (PDF conversion) from new requirements (GUI wrapper) Implementation Direction - Suggests specific technical approaches (tkinter/PyQt) while maintaining flexibility The AI assistant will perform better with the rephrased prompt because: More precise input leads to more precise output - technical specifications eliminate ambiguity about what to implement Breaking down into components helps the AI reason systematically about the solution architecture Explicit requirements (e.g., "single file processing") prevent the AI from making incorrect assumptions about scope Clear instructions to AI yield clear results. Or as the old saying goes: garbage in, garbage out :-) A bit of theory behind the concept The idea for a rule like that came to me when I heard about the concept of "Latent Space Activation" in Large Language Models. Very brief explanation from Claude: My rephrasing prompt supposedly has some impact on latent space activation. Claude again: Does it really work? I've been experimenting with this for several days now and my subjective impression is that I really get better results with this approach. Better, working code often on the first shot. Try it yourself Have a play and let me know if you get better results, too.
    5 points
  2. Hey @FireWire great thank you! My project is taking shape and we will start adding content soon, so it's a bit annoying if the translation service breaks our site snippets 🙂 Great to know that you can reproduce and a fix is coming 🙂 All the best for your event!
    1 point
  3. @bernhard Sorry for the delay! The event just started (the one that I built the site for) and it's taken over my life for the moment. I have a fix in the works, I just need to button a couple of things up. Plan for having it ready by this weekend. I'll post back here when done!
    1 point
  4. Check if there is an error on the console, this has happened to me when there is a javascript error parsing the console, sometimes happening when a PHP warning or errors gets attached to the response of the ajax file upload.
    1 point
  5. Hey @FireWire thx again for sharing your block thumbnails! I have just made it a lot easier to explore/find/use them and added this field to the module config screen where you can just click on the icon and it will copy the name to the clipboard that you can then just paste into your "thumb" property of the block's info method 😎
    1 point
  6. This week we introduce a new module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them. No matter how simple or complex your needs are, Custom Fields makes your job faster and easier. Not only does this post introduce Custom Fields, but also documents how to use them and includes numerous examples— https://processwire.com/blog/posts/custom-fields-module/
    1 point
  7. hi, justa little word to say you can also do this in the module config have a nice day
    1 point
  8. Yes! Either in the TinyMCE module settings, or in each field there are options for overriding the json config of the TinyMCE instance, and you can do sth like: site/templates/assets/tiny.css is my custom css file. In all fairness, I have only tested this in the global module config, not in the individual field context.
    1 point
  9. You can use this hook to do what you want: $wire->addHookBefore("InputfieldFile::render", function (HookEvent $event) { $inputfield = $event->object; if ($inputfield->name !== 'your_fields_name') return; $inputfield->appendMarkup .= "<script> document.currentScript.parentElement.querySelectorAll('a.InputfieldFileName').forEach(function(link) { if (!link.href.endsWith('.pdf')) return; link.removeAttribute('download'); }); </script>"; });
    1 point
×
×
  • Create New...