G3 - AI
uses
- understanding code
- problem fixing
- code/idea generation
- context-aware code completion
- improving code quality (type hints, comments, docstrings)
- the art and science of designing and optimising prompts to guide AI models, particularly LLMs, towards generating the desired responses
Google Cloud

image: prompt engineering workflow, Generative AI on Vertex AI, Google
-
effective prompt: content + structure
-
components:
- objective
- instruction
-
additional optional components include system instructions, which the model processes before the prompts:
- persona (role/vision: who or what the model is acting as)
- constraints
- contect
- few-shot examples
- reasoning steps
- response format
- recap
- safeguards
<OBJECTIVE_AND_PERSONA>
**You are a [insert a persona, such as a "math teacher" or "automotive expert"]. Your task is to...**
</OBJECTIVE_AND_PERSONA>
<INSTRUCTIONS>
**To complete the task, you need to follow these steps:
1.
2.
...**
</INSTRUCTIONS>
------------- Optional Components ------------
<CONSTRAINTS>
**Dos and don'ts for the following aspects
1. Dos
2. Don'ts**
</CONSTRAINTS>
<CONTEXT>
**The provided context**
</CONTEXT>
<OUTPUT_FORMAT>
**The output format must be
1.
2.
...**
</OUTPUT_FORMAT>
<FEW_SHOT_EXAMPLES>
**Here we provide some examples:
1. Example #1
Input:
Thoughts:
Output:
...**
</FEW_SHOT_EXAMPLES>
<RECAP>
**Re-emphasize the key aspects of the prompt, especially the constraints, output format, etc.**
</RECAP>
source: Generative AI on Vertex AI, Google*
- prompt format includes style and structure
- different models may respond better to specific formats
- influences how AI interprets the request
- natural language questions, direct commands, or structured inputs with specific fields
- context and examples
- fine-tuning the AI model on specific tasks using tailored prompts, and adapting prompts based on user feedback or model output
- multi-turn conversations
prompt types
- direct / zero-shot
- direct instruction/question with no additional context or example
- eg: idea generation, brainstorming, summarisation, translation
- one-, few- and multi-shot
- provide model with additional examples before the actual prompt
- chain of thought (CoT)
- break down complex reasoning into a series of intermediate steps
- zero-shot CoT
- ask model to perform reasoning steps
issues with prompts
- overt manipulation attempting influence using emotional appeals, flattery or artificial pressure
- conflicting/redundant/irrelevant instructions and examples
- missing output format specification and role definition
- under-specification
- task outside of model capabilities or overloading
- non-standard data formant
- incorrect chain of thought order
- conflicting internal references
- prompt injection risk (check for explicit safeguards surrounding untrusted user )
prompt writing strategies
source: Google Cloud
- setting clear goals and objectives
- using action verbs
- setting the desired length and format
- specifying the target audience
- providing context
- including relevant facts and data
- referencing specific sources
- defining key terms and concepts
- using few-shot prompting
- using XML-like markup and consistent formatting
- being specific
- using precise language
- quantifying requests
- breaking down complex tasks
- iterate and experiment
- trying different phrasings, keywords and prompt lengths
- adjusting the level of detail and specificity
- guiding model through the logic
- leveraging CoT
- encouraging step-by-step reasoning
- asking for explanations of reasoing process
WindSurf
-
the first agentic IDE
- agentic AI: autonomous artificial intelligence systems that can set goals, make decisions, and take actions with minimal human intervention to achieve objectives; unlike traditional AI that simply responds to commands, agentic AI proactively plans, reasons, and executes multi-step tasks, often using tools and adapting to changing conditions
-
copilots are generally confined to short scoped tasks, and are great as they keep the human in loop
-
agents act independently to complete much larger tasks, but the tradeoff is the loss of collaboration
-
WindSurf combines the best of both worlds: collaboration + independence
-
they call this system AI flows - collaborative agents - providing a new paradigm of working with AI
-
forked from VS Code
-
respect people's native editors

image: windsurf
Cascade
- WindSurf's AI code platgorm

image: windsurf
-
flow awareness: action tracking to infer intent
-
knowledge base: direct int4egration into repo and curated docs to build code understanding for accurate reflective solutions
-
autocomplete lines as well as entire snippets predicting your intent - super complete
-
predicts the location of your next edit and jumps there with a tab press, eg: variable name change, imports
-
inline and terminal commands (
cmd+i) using natural language -
'codelenses' : explain, refactor, add docstring

image: windsurf

image: cursor