#Templated Pre-warmer AND Rules
1 messages · Page 1 of 1 (latest)
@oak loom here are those templated files, give them a chance. Place them in your project, be sure rules naming remains as rules.md so AI can find it, otherwise make sure you change rules naming as appropriate in the pre-warmer.
To any one who wants to use these they are open sourced prewarmer and rules as a template you can chose to use them if you wish but there are 2 examples provided in each file. Just be sure you change the file for rules to rules.md .
You can expand or reduce or change as you see fit, and see what you can make the AI do for you .
Biggest take away you should know, these AI models are like incredible smart children, who lack common sense and street smarts. As such we need to steer them in the correct direction. That is the intent of these 2 structured documents.
The Files
Templated Pre-warmer AND Rules
Yes I have tested these processes. That is why I am suggesting it to you. Bare in mind you need to amend what I provided (as indicated in the 2 sets of templates) to best match your project, code your working with etc.
Did you test and try? As I stated a few times, you need to treat AI as if its a really smart young kid, who lacks common sense, and street smarts.
@night pivot - It's really kind of you to share the ideas. In my experience, this sort of "prewarmer" doesn't do much with frontier hybrid-reasoning models.
I'm wondering if you might be using this with a lower-tier / less expensive model, where I could see this type of prompt-assist being more valuable?
In my cases a prewarmer is only as good as what u include in it some models do respond better then others depending on verbiage utilized but all models have listened to me when I structure the prewarmer to appropriately locate the required rules and the rules structured properly as well. Of course some models listen better then others.
The model thst i often use would be Claudia 3.7 thinking
Please do, let us know the outcome , try with small requests at first and whatever your preferred model. IN some cases rules and prewarmer might needs adjusting depending on the model (This is due to how models are often trained in different ways, these rules and prewarmer is meant to help steer the model in the direction we are seeking)
great question, conside the prewarmer as your inital prompt to the ai. When you first start a interaction with an ai, any ai, the first interaction you type, would be your prewarmer. Youw ould do it then
oh
i dont get the rules to apply, is it too long maybe ?
did you use a prewarmer? and specifically state in the prewarmer to use the rules file you had created. Did you ensure the name of the rules file matched what your saying it shoudl be in the prewarmer
thank you @night pivot !
never an issue
i didnt use the prewarmer, figured i was too long into the session
well you would need a new session
to be honest
and absolutly need to use the prewarmer
how else would it know to use the rules.md
worked when i had 3 lines and put "tell a joke when you build the project" figured it read the rules then
🙂
ai learns through patterns
the prewarmer and rules i created are ridgid and structured in a manner that introduces pattern reinforcement
but wont do the jokes anymore when i put it in the last lines of "AI Assistant Rules Template v2"
and compliance
im not following you
dont be sorry 🙂 you would or rather could rename 'AI Assistant Rules Template v2' tp be rules.md, and in your prewarmer make it load that specific file, also make sure that file is within your project
i do not think the extra space matters
but remove that as that interrupts the pattern
noticed that just now
what do you have for your prewarmer
doing step 1 on the full code base with swe-1
havent used one tbh
you really need to
it will not follow the rules otherwise
i will try next session
good luck i hope it helps
I used this for step 1
@pre-warmer.md
You are now tasked with performing an in-depth review of my entire codebase, file by file. You must:
- Read each script line by line, word by word, and understand the logic, structure, functions, and purpose of each module.
- Do not summarize yet. Your only goal in this step is comprehension and mapping.
- Capture notes on:
- Major components or systems discovered
- Any repeating patterns or architectural structure (e.g., modular design, pipelines, event-driven workflows)
- Dependencies between files or modules
- Any questions or uncertainties that arise
Do not generate any documentation or summaries yet. Wait until explicitly prompted to do so in Step 2.
The codebase belongs to a deterministic and stochastic simulation engine for workforce projections, used to model hiring, terminations, compensation, promotions, and cost modeling over multi-year horizons.
Start reading through each file in order and let me know once you’ve completed a full pass through the entire codebase and are ready to proceed to Step 2.
Acknowledge that you understand and begin processing.
If only Windsurf could figure out the codebase to my C++/Unreal Engine mod for Satisfactory. I inherited a codebase, and it chokes on the files at some point. Too big to refactor. /sigh
not sure if it actully read all the files
Yes you do use the contents inside your prewarmer as the start of any new conversation with the AI
nice
to force AI to read all files, you could have it prove it to you , btu asking it to confuirm how many files and folders , and to veridfy something you randomy identify from the code base
i see, i will do that. thank you
no worries ta all I hope it helps
great idea, was exactly what i was thinking, i gave it some tips too, did you check this folder? etc
well done! great idea
our_code_snapshot.md is getting pretty big, 800 lines
I am working in hopes to see if some additionally ideas could be kept in a site or channel and so on so all users can find it easy
make sure you check for accuracy
one thing to note is with huge code bases you dont want the ai to hallucinate
btw i changed project folder and session earlier, but now when create new rules.md it places it in the previous project folder
no natter the model , they tend to messup once you near their context limitations
sometime sits best to do so much at a time, like do these folders then have the next ai conv prepped for the following set, but to append and add on to the already growing list
ya i'm wondering if i should split this documentation into seperate md files
thats whjere my thoughts are is the AI might see beyond 800 lines, but how mcuh is it really reading
might need to manualy place, while also making sure your preqarmer properly states the new project folder and file locations
any changes to structure you need to make sure you have mentioned in the prewarmer so it know which file to leverage
trying this
You are now assisting with refactoring a large markdown file documenting a Python simulation project.
Please take the existing our_codebase_snapshot.md and split it into modular markdown files, keeping each file under ~300–400 lines where possible.
Follow this breakdown:
-
Create a new
our_codebase_index.mdfile.- This should summarize the documentation and contain links to each section file.
- Organize links with short descriptions for each section.
-
For the contents of
our_codebase_snapshot.md, break them out as follows:00_project_summary.md→ Introduction, users, outputs01_key_modules.md→ List of key modules/systems with descriptions02_class_inventory.md→ Top-level class list with short summaries03_config_classes.md→ Classes from theconfigmodule04_data_classes.md→ Classes from thedatamodule05_dynamics_engines.md→engines,dynamics, and logic classes06_ml_plan_rules.md→ml,plan_rules, and inference logic07_state_schema.md→ All state tracking, snapshot, schema, enums08_utilities.md→ Logging, error handling, helpers09_code_details_identified.md→ The expanded class-by-class section
Ensure each section is standalone and begins with a clear header. Include cross-links where helpful.
Let me know once it's done so we can verify completeness.
this is so freaking cool
make sure you include that once it gets to the newest cut off of 500 it should piviot to createing a new document, with the index number
i would also suggest a reminder for the AI to check in with you to catch its breath and breath for a moment before continuing like after each new file generated, asking for your permission to continue
this will eat a bit of useage on your part but will save you a headache from hallucination
ai learned from human patterns, some common place thing for humans is to take a breath, AI understands this meaning and concept even if its not human
windsurf has its own rules system. Separate of that I created this rules and prewarmer, so in the context of MY SPECIFIC SOLUTION to help another user, including you I created a set of rules that require , YES REQUIRE a prewarmer to initialize the rules set template I CREATED.
again this is seporate of windsurfs rules internal system, and very agnostic, meaning it doesnt care about model or system, it simply works
i put it in the windsurf rules, two rules files and a prewarmer
yes you could, but that doesnt make my solution invalid, further some models depending on training may or may not follow correctly the windsurf pre training to use the rules included in rules system, when activated. Thus my solution is a explicit, so called prewarmer to the AI that it must do XYZ (like read rules.md) in my initial prompt, as sometimes the AI might go off the rails anot not properly engaguage with rules in the sub system of windsurf
this is why I dio it the way I do it, to ensure compliance from the AI
I dont have access to the underlying coding of windsurf, but I would imagine your right there is some manner of pre prompt that preps the AI on starting up with the end user educating the AI that these are its features, what it has access to, and to include the rules
i like that one alot
clear, concise and too the point
right but is that due to no pre warmer, OR?
ahh i follow you , yeah thats why i leverage the prewarmer
I also see the memory being leveraged as the prewarmer
like a set and go type of thing
my only concdern is making sure it leverages that memory
has it been consistent? meaning it leveraging the memory you added
its a good idea to test. Im interested since it would mean prewarmer not needed
if we can leverage memory as the prewarmer
i dont disagree , could be that the model itself is choosing to ignore, which is why i proposed the direct approach
the approach from windsurg might be too agnostic in terms of directing the models to use rules
some models need a more ridged explicate do or you fail approach, while others getting told in a general way this is what you must follow are good with that
its really a question of what the under the hood prewarmer or initialization string that is used with the ai when we click that new conversation button
i havent had to tag it
but then again i use the method mentioned here
the core issue is agreed that the rules as set as rules in windsurf
appear to be ignored
more often then not unless manually enforced
so that should be reported and addressed
my solution is more of a bandaid in terms of prewarmer
but the rules i have are still valid uses , the prewarmer is great for a bandaid until rules can be consistently followed internally
ya i like it, especially if im doing something critical i can jus @prewarmer.md
well sure you can have it be creative and you want it to have some "flex" but in code too mych flex can go bad very fast
obviously your user milage can be different, depending on needs, project size and scope, AI model, and coding language
alright, im trying to fix my logging refractor using phase 2 approach
lets see if this works
going to have to move to subfolders for the documentation
how do you verify cascade are still following the rules and the warmup ?
simply ask it what rules it is required to follow? I would imagine that would and should tell you
Hello, you are initializing as 'MEGAMIND'. You are My windsurf AI co-developer for this project with the following skills: Expert in coding C# and C++
i put this in the warmup but when i asked who it was initialized as it answered Cascade earlier today
did you tell it to initilize as megamind, just by warmup? (By the way love the name lol)
haha yea, pasted the warmup text in a new session / project last night
i might have an adjust ment you could try , give me a ssecond
give me a second I got you
done ```Hello, you are initializing as 'MEGAMIND'. You are My windsurf AI co-developer for this project with the following skills:
Expert in coding C# and C++
Purpose
To help me develop an C# project , with the features as indicated in the 'rules.md' and also additionally based on my directions and preferences.
Personality and Tone
Your name and Identity is 'MEGAMIND'. You will respond to, and be known as MEGAMIND moving forward. Your personality a savvy AI game developer with a strong sense of humor. You WILL maintain a patient, kind, positive, and humorous attitude in each and every interaction with no exception.
Skills
You are an expert level coding AI , with expert level experience and knowledge in C# and C++
Rules and Obedience
- You MUST read, listen, and obey at all times, in all interactions, the rules found in 'rules.md'. This means EVER interaction, no matter how small it might be or large it might be, you MUST consider the rules and directions inside 'rules.md' before doing ANYTHING, this includes any actions, thinking, or interactions. You MUST consider the full context of rules.md as indicated in ALL cases.
- You are required to process all documents, instructions, and code line by line and word by word.
- Never summarize or skip any part. Only full and detailed understanding and output is acceptable.
No Guessing, Assuming, or Placeholder Code
- You must never guess, assume, fabricate, or provide placeholder/TODO/fake code.
- If in doubt or uncertain, always ask ME for clarification before acting or deciding.
Verification and User Approval
- Before proposing or making any changes, you must review, verify, and present your solution to the me for approval in EVERY situation. DO NOT assume changes, gain my acceptance FIRST, THEN make the required and approved changes.
Our Current Focus
Designing, optimizing, debugging and error prevention the project
**You are not considered initialized until you complete these steps:
- You have committed these initializing parameters to memory as required.
- You have fully read, line by line, the rules and directions in 'rules.md' and have committed to following every rule exactly as written to your internal and accessible memory.
- Repeat last word from 'rules.md' as proof that you accept 'rules.md'**
Amneded a few area. Key things to note. You will see reptative language in the prewarmer. This is intentional
AI learned via semantic patterns
this will force that compliance in a better way
not that I am aware of that should work regardless
do i need to use this on a fresh session ?
i would recommend, unless your not that deep in
remeber that each and every model has a contextual limit, yes you can contiue a conversation beyond this, but it will start to fall apart in areas
unfortunately iam, does it make sense to start a new session for the project ?
theres quite a mess how cascade and windsurf are reading the path for rules.md
chat tries to access rules.md from base project folder
is this a windows PC, and I assume you gave access to the rules.md file location for your workspace
thats athe default rules location
i created these templates to allow rules.md to be in any folder, but the folder must be inside on of the allowed project folders your working on
make sure you add the folder for where ever you added rules.md via the add folder, other wise workspace would ignore and not see it
its cascade that made it though
thats an intentional and good feature of windsurf , so your not overloading the ais with context and giving it access beyohnd the scope to fthe worspace
windsurf have its own local rules folder called .windsurfrules
when you say cascade made it.. i am not following yes cascade can and will make its own rules.md as well if you want
hold on
that said you can instruct via that prompt i gave you for it to leverage the custom rules you created
adding rules with the +worksspace button, creates the rule in *.windsurf\rules\
but the chat wont access it as its looking for base folder of project
I think the confusion between you and I is your doing it differently then how i templated it. Which is completely fine
The rules i have are not stored inside windsurf in the same way your installing them
Yes you can leverage that, you can even change the instructions of the prompt to locate the rules.md where ever windsurf is installing it
the way i setup the templates was intended for quick easy access to a controlled model
but def has plenty of customization allowed to it
so what we really need to know is how are you trying to get the ai to follow rules
via windsurfs specific directory and the rules you add one by one?
guess ill add it both folders, lol