mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-22 07:18:05 +00:00
docs: 更新文档和技能
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
# Glue Coding Methodology
|
||||
|
||||
## **1. Definition of Glue Coding**
|
||||
|
||||
**Glue coding** is a new type of software construction method, whose core idea is:
|
||||
|
||||
> **Almost entirely reusing mature open-source components, combining them into a complete system with minimal "glue code".**
|
||||
|
||||
It emphasizes "connecting" rather than "creating", and is particularly efficient in the AI era.
|
||||
|
||||
## **2. Background**
|
||||
|
||||
Traditional software engineering often requires developers to:
|
||||
|
||||
* Design architecture
|
||||
* Write logic themselves
|
||||
* Manually handle various details
|
||||
* Reinvent the wheel
|
||||
|
||||
This leads to high development costs, long cycles, and low success rates.
|
||||
|
||||
However, the current ecosystem has fundamentally changed:
|
||||
|
||||
* Thousands of mature open-source libraries on GitHub
|
||||
* Frameworks covering various scenarios (Web, AI, distributed, model inference...)
|
||||
* GPT / Grok can help search, analyze, and combine these projects
|
||||
|
||||
In this environment, writing code from scratch is no longer the most efficient way.
|
||||
|
||||
Thus, "glue coding" has emerged as a new paradigm.
|
||||
|
||||
## **3. Core Principles of Glue Coding**
|
||||
|
||||
### **3.1 If it can be avoided, don't write it; if it can be minimized, minimize it.**
|
||||
|
||||
Any function with a mature existing implementation should not be reinvented.
|
||||
|
||||
### **3.2 If it can be copied and pasted, copy and paste.**
|
||||
|
||||
Directly copying and using community-tested code is a normal engineering process, not laziness.
|
||||
|
||||
### **3.3 Stand on the shoulders of giants, rather than trying to become a giant.**
|
||||
|
||||
Utilize existing frameworks, rather than trying to write a "better wheel" yourself.
|
||||
|
||||
### **3.4 Do not modify the original repository code.**
|
||||
|
||||
All open-source libraries should remain as immutable as possible, used as black boxes.
|
||||
|
||||
### **3.5 Minimize custom code.**
|
||||
|
||||
The code you write only serves for:
|
||||
|
||||
* Combination
|
||||
* Calling
|
||||
* Encapsulation
|
||||
* Adaptation
|
||||
|
||||
This is the so-called **glue layer**.
|
||||
|
||||
## **4. Standard Process of Glue Coding**
|
||||
|
||||
### **4.1 Clarify Requirements**
|
||||
|
||||
Break down the system's functionalities into individual requirements.
|
||||
|
||||
### **4.2 Use GPT/Grok to Decompose Requirements**
|
||||
|
||||
Let AI refine requirements into reusable modules, capabilities, and corresponding subtasks.
|
||||
|
||||
### **4.3 Search for Existing Open-Source Implementations**
|
||||
|
||||
Utilize GPT's internet capabilities (like Grok):
|
||||
|
||||
* Search for corresponding GitHub repositories based on each sub-requirement
|
||||
* Check for reusable components
|
||||
* Compare quality, implementation methods, licenses, etc.
|
||||
|
||||
### **4.4 Download and Organize Repositories**
|
||||
|
||||
Pull selected repositories locally and categorize them.
|
||||
|
||||
### **4.5 Organize by Architectural System**
|
||||
|
||||
Place these repositories into the project structure, for example:
|
||||
|
||||
```
|
||||
/services
|
||||
/libs
|
||||
/third_party
|
||||
/glue
|
||||
```
|
||||
|
||||
And emphasize: **Open-source repositories, as third-party dependencies, must absolutely not be modified.**
|
||||
|
||||
### **4.6 Write the Glue Layer Code**
|
||||
|
||||
The glue code's functions include:
|
||||
|
||||
* Encapsulating interfaces
|
||||
* Unifying input and output
|
||||
* Connecting different components
|
||||
* Implementing minimal business logic
|
||||
|
||||
The final system is composed of multiple mature modules.
|
||||
|
||||
## **5. Value of Glue Coding**
|
||||
|
||||
### **5.1 Extremely High Success Rate**
|
||||
|
||||
Because it uses community-verified mature code.
|
||||
|
||||
### **5.2 Extremely Fast Development Speed**
|
||||
|
||||
A large number of functionalities can be directly reused.
|
||||
|
||||
### **5.3 Reduced Costs**
|
||||
|
||||
Time costs, maintenance costs, and learning costs are significantly reduced.
|
||||
|
||||
### **5.4 More Stable System**
|
||||
|
||||
Relies on mature frameworks rather than individual implementations.
|
||||
|
||||
### **5.5 Easy to Extend**
|
||||
|
||||
Capabilities can be easily upgraded by replacing components.
|
||||
|
||||
### **5.6 Strong Synergy with AI**
|
||||
|
||||
GPT can assist in searching, decomposing, and integrating, serving as a natural enhancer for glue engineering.
|
||||
## **6. Glue Coding vs. Traditional Development**
|
||||
|
||||
| Project | Traditional Development | Glue Coding |
|
||||
| ----------- | ----------------------- | --------------- |
|
||||
| Feature Implementation | Write yourself | Reuse open-source |
|
||||
| Workload | Large | Much smaller |
|
||||
| Success Rate| Uncertain | High |
|
||||
| Speed | Slow | Extremely fast |
|
||||
| Error Rate | Prone to pitfalls | Uses mature solutions |
|
||||
| Focus | "Inventing wheels" | "Combining wheels" |
|
||||
|
||||
## **7. Typical Application Scenarios for Glue Coding**
|
||||
|
||||
* Rapid prototyping
|
||||
* Small teams building large systems
|
||||
* AI applications/model inference platforms
|
||||
* Data processing pipelines
|
||||
* Internal tool development
|
||||
* System Integration
|
||||
|
||||
## **8. Future: Glue Engineering Will Become the New Mainstream Programming Method**
|
||||
|
||||
As AI capabilities continue to strengthen, future developers will no longer need to write large amounts of code themselves, but rather:
|
||||
|
||||
* Find wheels
|
||||
* Combine wheels
|
||||
* Intelligently connect components
|
||||
* Build complex systems at extremely low cost
|
||||
|
||||
Glue coding will become the new standard for software productivity.
|
||||
@@ -0,0 +1,172 @@
|
||||
# 🧬 Glue Coding
|
||||
|
||||
> **The Holy Grail and Silver Bullet of Software Engineering — finally here.**
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Disruptive Manifesto
|
||||
|
||||
**Glue Coding is not a technology; it's a revolution.**
|
||||
|
||||
It might perfectly solve the three fatal flaws of Vibe Coding:
|
||||
|
||||
| Pain Points of Traditional Vibe Coding | Solutions of Glue Coding |
|
||||
| :----------------------------------- | :----------------------- |
|
||||
| 🎭 **AI Hallucinations** - Generating non-existent APIs, incorrect logic | ✅ **Zero Hallucinations** - Only uses verified mature code |
|
||||
| 🧩 **Complexity Explosion** - The larger the project, the more out of control | ✅ **Zero Complexity** - Every module is a time-tested wheel |
|
||||
| 🎓 **High Barrier to Entry** - Requires deep programming skills to master AI | ✅ **Barrier Disappears** - You only need to describe "how to connect" |
|
||||
|
||||
---
|
||||
|
||||
## 💡 Core Concept
|
||||
|
||||
```
|
||||
Traditional Programming: Humans write code
|
||||
Vibe Coding: AI writes code, humans review code
|
||||
Glue Coding: AI connects code, humans review connections
|
||||
```
|
||||
|
||||
### Paradigm Shift
|
||||
|
||||
**A fundamental shift from "generation" to "connection":**
|
||||
|
||||
- ❌ No longer letting AI generate code from scratch (the source of hallucinations)
|
||||
- ❌ No longer reinventing the wheel (the source of complexity)
|
||||
- ❌ No longer requiring you to understand every line of code (the source of high barrier)
|
||||
|
||||
- ✅ Only reusing mature, production-verified open-source projects
|
||||
- ✅ AI's sole responsibility: understanding your intent and connecting modules
|
||||
- ✅ Your sole responsibility: clearly describing "what is the input, what is the desired output"
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Architectural Philosophy
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────┐
|
||||
│ Your Business Requirements │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────┐
|
||||
│ AI Glue Layer │
|
||||
│ │
|
||||
│ "I understand what you want to do, let me connect these blocks" │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
│
|
||||
┌────────────────┼────────────────┐
|
||||
▼ ▼ ▼
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ Mature Module A │ │ Mature Module B │ │ Mature Module C │
|
||||
│ (100k+ ⭐) │ │ (Production Verified) │ │ (Official SDK) │
|
||||
└─────────────┘ └─────────────┘ └─────────────┘
|
||||
```
|
||||
|
||||
**Entity**: Mature open-source projects, official SDKs, time-tested libraries
|
||||
**Link**: AI-generated glue code, responsible for data flow and interface adaptation
|
||||
**Function**: Your described business goals
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Why is this a Silver Bullet?
|
||||
|
||||
### 1. Hallucination Issue → Completely Disappears
|
||||
|
||||
AI no longer needs to "invent" anything. It only needs to:
|
||||
- Read Module A's documentation
|
||||
- Read Module B's documentation
|
||||
- Write the data transformation from A to B
|
||||
|
||||
**This is what AI excels at, and where it is least likely to make mistakes.**
|
||||
|
||||
### 2. Complexity Issue → Transferred to the Community
|
||||
|
||||
Behind each module are:
|
||||
- Thousands of Issue discussions
|
||||
- Wisdom of hundreds of contributors
|
||||
- Years of refinement in production environments
|
||||
|
||||
**You are not managing complexity; you are standing on the shoulders of giants.**
|
||||
|
||||
### 3. Barrier to Entry Issue → Minimized
|
||||
|
||||
You don't need to understand:
|
||||
- Underlying implementation principles
|
||||
- Details of best practices
|
||||
- Handling of edge cases
|
||||
|
||||
You just need to speak plainly:
|
||||
> "I want to take Telegram messages, process them with GPT, and save them to PostgreSQL"
|
||||
|
||||
**AI will help you find the most suitable wheels and then glue them together.**
|
||||
|
||||
---
|
||||
|
||||
## 📋 Practical Process
|
||||
|
||||
```
|
||||
1. Clarify Goal
|
||||
└─→ "I want to implement XXX functionality"
|
||||
|
||||
2. Find Wheels
|
||||
└─→ "Are there mature libraries/projects that have done something similar?"
|
||||
└─→ Let AI help you search, evaluate, and recommend
|
||||
|
||||
3. Understand Interfaces
|
||||
└─→ Feed official documentation to AI
|
||||
└─→ AI summarizes: what is the input, what is the output
|
||||
|
||||
4. Describe Connection
|
||||
└─→ "Output of A should become input of B"
|
||||
└─→ AI generates glue code
|
||||
|
||||
5. Verify Operation
|
||||
└─→ Runs successfully → Done
|
||||
└─→ Errors → Throw errors to AI, continue gluing
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔥 Classic Case Study
|
||||
|
||||
### Case Study: Polymarket Data Analysis Bot
|
||||
|
||||
**Requirement**: Get real-time Polymarket data, analyze it, and push to Telegram
|
||||
|
||||
**Traditional Approach**: Write scraper from scratch, write analysis logic, write Bot → 3000 lines of code, 2 weeks
|
||||
|
||||
**Glue Approach**:
|
||||
```
|
||||
Wheel 1: polymarket-py (Official SDK)
|
||||
Wheel 2: pandas (Data Analysis)
|
||||
Wheel 3: python-telegram-bot (Message Push)
|
||||
|
||||
Glue code: 50 lines
|
||||
Development time: 2 hours
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Further Reading
|
||||
|
||||
- [Glue Development Prompt](../../prompts/coding_prompts/glue-development.md)
|
||||
- [Project Practice: polymarket-dev](../Project%20Practical%20Experience/polymarket-dev/)
|
||||
|
||||
---
|
||||
|
||||
## 🎖️ Summary
|
||||
|
||||
> **If you can copy, don't write; if you can connect, don't build; if you can reuse, don't originate.**
|
||||
|
||||
Glue Coding is the ultimate evolutionary form of Vibe Coding.
|
||||
|
||||
It's not laziness; it's the **highest embodiment of engineering wisdom**—
|
||||
|
||||
Leveraging the least amount of original code to drive the greatest productivity.
|
||||
|
||||
**This is the silver bullet software engineering has been waiting 50 years for.**
|
||||
|
||||
---
|
||||
|
||||
*"The best code is no code at all. The second best is glue code."*
|
||||
Reference in New Issue
Block a user