From 1dd3e09d7bd5de6fbcc5e4a1e167cd851dfced32 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 08:31:35 +0000 Subject: [PATCH] [refactor: anti-hallucination-harden] Applied targeted replacements of weak phrasing in instruction blocks, added GitHub important alert boxes, and enforced conflict resolution per specifications. Co-authored-by: beginwebdev2002 <102213457+beginwebdev2002@users.noreply.github.com> --- audit-log.md | 2 +- docs/windsurf-vibe-coding-hints.md | 11 ++++++----- frontend/angular/components-signals.md | 3 ++- frontend/typescript/objects-functions.md | 6 ++++-- frontend/typescript/readme.md | 1 + frontend/typescript/types-interfaces.md | 1 + 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/audit-log.md b/audit-log.md index ff67be8..54b8db3 100644 --- a/audit-log.md +++ b/audit-log.md @@ -10,6 +10,6 @@ last_updated: 2026-03-29 # Audit Log -Replaced 46 ambiguous phrases with hard constraints and quantified terms. +Replaced 10 ambiguous phrases with hard constraints and quantified terms. Also explicitly enforced logical conflict resolution: TypeScript 5.x -> prefer 'interface' for structure, 'type' for unions. diff --git a/docs/windsurf-vibe-coding-hints.md b/docs/windsurf-vibe-coding-hints.md index 0a91773..3d6e3d0 100644 --- a/docs/windsurf-vibe-coding-hints.md +++ b/docs/windsurf-vibe-coding-hints.md @@ -16,7 +16,7 @@ vibe_coding_ready: true # 🏄 Windsurf Advanced Usage Hints: Mastering Vibe Coding ## 📖 1. Introduction to Windsurf AI Agents -Windsurf is a powerful tool for developers who use AI agents to write code. By understanding how Windsurf works, you can improve your vibe coding workflow. Vibe coding allows you to build software by giving intent-based instructions to an AI agent. This guide provides advanced usage hints to help you get the best results from Windsurf, optimize the context window, and manage memory limits. +Windsurf is a powerful tool for developers who use AI agents to write code. Understanding how Windsurf works is MANDATORY to improve your vibe coding workflow. Vibe coding allows you to build software by giving intent-based instructions to an AI agent. This guide provides advanced usage hints to help you get the best results from Windsurf, optimize the context window, and manage memory limits. ## 🏗️ 2. The Windsurf Vibe Coding Workflow To get robust, deterministic code from Windsurf, you need a clear process. The AI agent needs the right context window to understand what you want. The following diagram shows the best workflow for sending instructions to the Windsurf AI agent. @@ -38,7 +38,8 @@ graph TD ``` ## 🧠 3. Managing Memory Limits and Context Size -One of the biggest challenges in vibe coding is managing the AI memory limits. If you give the AI agent too much information, it might forget important details in the context window. If you give it too little, it will make mistakes. +One of the biggest challenges in vibe coding is managing the AI memory limits. > [!IMPORTANT] +> If you give the AI agent too much information, it STRICTLY risks forgetting important details in the context window. If you give it too little, it will make mistakes. Here is a comparison of different ways to manage the context window and memory limits in Windsurf: @@ -49,16 +50,16 @@ Here is a comparison of different ways to manage the context window and memory l | **Full Folder Search** | When you do not know where a code bug is located. | Low accuracy, high memory usage. | ## 💡 4. Advanced Usage Hints for Prompt Creation -To make Windsurf AI agents generate perfect code, follow these simple rules for vibe coding: +To make Windsurf AI agents generate perfect code, follow these deterministic rules for vibe coding: 1. **Be Specific:** Tell the AI agent exactly which file to change. For example, say "Update the button component in `src/button.tsx`" instead of "Change the button". -2. **Use Clear English:** Write your prompts in simple, direct language. Avoid using complex phrasing. +2. **Use Clear English:** Write your prompts in deterministic, direct language. Avoid using complex phrasing. 3. **Limit the Context Window:** Close unnecessary files to keep the context window small and avoid reaching memory limits. ## ✅ 5. Actionable Checklist for Windsurf Vibe Coding Success Follow these steps every time you start a new vibe coding session with Windsurf: -- [ ] Write a clear and simple prompt that states your exact goal for the AI agent. +- [ ] Write a deterministic and structured prompt that states your exact goal for the AI agent. - [ ] Open only the files that the AI agent needs to read in the context window. - [ ] Add a `.windsurfrules` file to your project to set global constraints. - [ ] Check the generated code for errors before accepting the changes. diff --git a/frontend/angular/components-signals.md b/frontend/angular/components-signals.md index 31adc19..a55c370 100644 --- a/frontend/angular/components-signals.md +++ b/frontend/angular/components-signals.md @@ -73,7 +73,8 @@ Boilerplate code that is easy to break if you make a mistake in naming the `Chan value = model(); ``` ### 🚀 Solution -Use `model()`. This creates a Signal that can be both read and written to, automatically synchronizing its state with the parent. +> [!IMPORTANT] +> STRICTLY use `model()`. This creates a Signal with read and write capabilities, automatically synchronizing its state with the parent. --- diff --git a/frontend/typescript/objects-functions.md b/frontend/typescript/objects-functions.md index 1beff2d..6e4c343 100644 --- a/frontend/typescript/objects-functions.md +++ b/frontend/typescript/objects-functions.md @@ -30,7 +30,8 @@ The index signature syntax is more verbose, harder to read, and less semanticall const prices: Record = { apple: 1 }; ``` ### 🚀 Solution -Use the `Record` utility type for key-value maps. It provides a deterministic, clean, and declarative syntax that AI agents and engineers can parse instantly. +> [!IMPORTANT] +> Use the `Record` utility type for key-value maps. It provides a deterministic, structured, and declarative syntax that AI agents and engineers MUST parse instantly. ## 🚨 22. Excess property checks and object spreading > [!NOTE] > **Context:** Passing objects to functions. @@ -83,7 +84,8 @@ Manually unwrapping promises via custom conditional types is unnecessarily compl type Result = Awaited>; ``` ### 🚀 Solution -Always use the built-in `Awaited` utility type (TS 4.5+) for deterministic and clean promise resolution. +> [!IMPORTANT] +> Always use the built-in `Awaited` utility type (TS 4.5+) for deterministic and structured promise resolution. ## 🚨 25. `this` typing in functions > [!NOTE] > **Context:** Ensuring correct context in callback-heavy code. diff --git a/frontend/typescript/readme.md b/frontend/typescript/readme.md index 415b8c4..1cddfd5 100644 --- a/frontend/typescript/readme.md +++ b/frontend/typescript/readme.md @@ -89,6 +89,7 @@ type Status = "active" | "inactive"; ``` ### 🚀 Solution > [!IMPORTANT] +> > [!IMPORTANT] > Prefer `interface` for structure, `type` for unions. Interfaces provide better error messages and performance for structural types in TypeScript 5.x. > > **Logical Conflict Resolution:** To enforce the repo standard, NEVER use `type` for defining object structures, and NEVER use `interface` for unions. diff --git a/frontend/typescript/types-interfaces.md b/frontend/typescript/types-interfaces.md index d0bdb90..f908e2e 100644 --- a/frontend/typescript/types-interfaces.md +++ b/frontend/typescript/types-interfaces.md @@ -92,6 +92,7 @@ type Status = "active" | "inactive"; ``` ### 🚀 Solution > [!IMPORTANT] +> > [!IMPORTANT] > Prefer `interface` for structure, `type` for unions. Interfaces provide better error messages and performance for structural types in TypeScript 5.x. ---