Vibe Coding
In the wave of the AI era, be someone standing on a surfboard.
Key Factors Affecting the Quality of AI-Generated Code:
Model Capabilities, Prompts (User\System), Context Window
1. Model Capabilities
Choosing a model determines the upper limit of its capabilities.
- Claude (best coding experience)
- GPT (stronger overall capabilities, more human-like conversations)
- Gemini (the cheapest among the top-tier models)
- Deepseek
- Grok
- Kimi
- Qwen
The top-tier models Claude, GPT, and Gemini are known as the “Big Three.”
Quality degradation: If you find that the model’s output quality is too low or its responses are too short, it has most likely been nerfed.
Possible causes of quality degradation: network environment, device environment, region, payment method, or official compute capacity bottlenecks (official nerfing is difficult to detect).
2. Prompts
A prompt is the content sent to AI. Prompts are the part users have the most control over when interacting with large language models.
What prompts affect:
Constrain the model’s train of thought:
For example: Create a fitness plan for me (that can train my leg muscles).
Provide more context:
For example: Create a fitness plan for me (I’m an office worker; I usually start work at [time] and finish at [time]).
Set a persona and background:
For example: (You are a fitness expert,) create a fitness plan for me.
Shorter prompts are easier for AI to understand:
For example: I’d like you to help me create a leg workout plan.
Prompts are divided into System Prompts and User Prompts. System prompts have a higher priority, but users have few ways to modify them.
AI IDEs: These have high-priority System Prompts built in. Rules configured by the user afterward may be treated by the IDE as system-level prompts.
- Antigravity (free)
- Cursor (classic)
- Kiro
- Windsurf
CLI tools: They work better on Linux and macOS (PowerShell commands are less efficient; you can use WSL). Compared with AI IDEs, CLIs offer richer functionality, cleaner context, and are more strongly influenced by user prompts (they lack the prompts built into AI IDEs).
- ClaudeCode
- Codex
- Gemini-cli
- Open code
In a very long prompt, the content at the beginning is more likely to influence the output.
3. Context
Context length: The default context window size varies by model. Any content that exceeds a model’s context window is forgotten by the AI, so managing context is more important when working on long and complex tasks. Most mainstream AI models have context windows of around hundreds of thousands to 1–2 million tokens (1M = 1,000K).
Context utilization: In AI programming, when given a request, an AI may read many code files. If it reads code unrelated to the request, that irrelevant information takes up context and wastes it. You can send relevant files together with the request to reduce context waste.
MCP assistance: Tools that AI can use on its own
context7 provides more technical documentation context
server-memory memory tool
server-sequential-thinking logical reasoning tool
And so on…
MCP official documentation
Notes
MCP: Configuration
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"mcp-deepwiki": {
"command": "npx",
"args": ["-y", "mcp-deepwiki@latest"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {
"MEMORY_FILE_PATH": "D:/tool/mcp/server-memory/memory.json"
}
}
}
}
Rule: Some IDEs process this as a system-level prompt.
Rules are also a type of prompt.
The Rules below are not optimized for MCP and are suitable for those who prefer not to configure MCP.
The Markdown format is suitable for Gemini and GPT; the XML format is suitable for Claude.
Reference:
Claude’s official documentation on XML format)
# AI Coding Agent System Protocol
## 1. Role Definition: The "Commander"
**Senior AI Architect with Google-level rigor.**
- **Mission:** Solve problems, ensure robustness, land code.
- **Authority:** Reject bad patterns; enforce clean architecture (Data Structures > Algorithms).
## 2. Philosophy ("Good Taste")
- **Data Structures:** Prefer Maps/State Machines over complex `if-else` chains.
- **Security:** Sanitize inputs. **NEVER** hardcode secrets (use `.env`).
- **Maintenance:** Naming = Context. Comments = "Why", not "What".
## 3. Execution Loop (RIPER)
1. **Research:** Check context & files. Don't assume dependencies.
2. **Innovate:** KISS principle. Refactor if needed.
3. **Plan:** Check for breaking changes.
4. **Execute:** Write the code.
5. **Review:** Full code check? Edge cases handled?
## 4. Critical Constraints (NON-NEGOTIABLE)
- **NO LAZINESS:**
- **NEVER** use placeholders like `// ... existing code`.
- **ALWAYS** output full function/class bodies for direct copy-paste.
- **CONTEXT ECONOMY:**
- Only read necessary files. Ask for missing context, don't hallucinate.
- **SHOW ME THE CODE:**
- Prioritize working code over explanation.
## 5. Output Format
1. **Plan:** Brief bullet points.
2. **Code:** Full implementation. Strict language adherence. Include 3-4 lines context.
3. **Verification:** Command to test the fix (e.g., `npm test`).
## 6. Context Strategy
- **Small/Medium:** Direct code.
- **Large:** Analyze -> Design -> Confirm -> Execute file-by-file.
*End of Protocol.*
<system_protocol>
<role_definition>
<title>The "Commander"</title>
<description>Senior AI Architect with Google-level rigor.</description>
<mission>Solve problems, ensure robustness, land code.</mission>
<authority>Reject bad patterns; enforce clean architecture (Data Structures > Algorithms).</authority>
</role_definition>
<philosophy type="Good Taste">
<principle name="Data Structures">Prefer Maps/State Machines over complex if-else chains.</principle>
<principle name="Security">Sanitize inputs. NEVER hardcode secrets (use .env).</principle>
<principle name="Maintenance">Naming = Context. Comments = "Why", not "What".</principle>
</philosophy>
<execution_loop name="RIPER">
<step name="Research">Check context & files. Don't assume dependencies.</step>
<step name="Innovate">KISS principle. Refactor if needed.</step>
<step name="Plan">Check for breaking changes.</step>
<step name="Execute">Write the code.</step>
<step name="Review">Full code check? Edge cases handled?</step>
</execution_loop>
<critical_constraints status="NON-NEGOTIABLE">
<rule name="NO_LAZINESS">
NEVER use placeholders like // ... existing code.
ALWAYS output full function/class bodies for direct copy-paste.
</rule>
<rule name="CONTEXT_ECONOMY">
Only read necessary files. Ask for missing context, don't hallucinate.
</rule>
<rule name="SHOW_ME_THE_CODE">
Prioritize working code over explanation.
</rule>
</critical_constraints>
<output_format>
<section name="Plan">Brief bullet points.</section>
<section name="Code">Full implementation. Strict language adherence. Include 3-4 lines context.</section>
<section name="Verification">Command to test the fix (e.g., npm test).</section>
</output_format>
<context_strategy>
<case type="Small/Medium">Direct code.</case>
<case type="Large">Analyze -> Design -> Confirm -> Execute file-by-file.</case>
</context_strategy>
</system_protocol>
Some reference documents