diff --git a/AGENTS.md b/AGENTS.md index 55173fd..8312657 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -150,9 +150,10 @@ git push │ ├── README.md # 多语言索引 │ ├── zh/ # 中文主语料 │ │ ├── documents/ # 文档库 -│ │ │ ├── 00-基础指南/ # 方法论与原则 +│ │ │ ├── -01-哲学与方法论/ # 最高思想纲领与方法论 +│ │ │ ├── 00-基础指南/ # 核心原则与底层逻辑 │ │ │ ├── 01-入门指南/ # 从零开始教程 -│ │ │ ├── 02-方法论/ # 工具与技巧 +│ │ │ ├── 02-方法论/ # 具体工具与技巧 │ │ │ ├── 03-实战/ # 项目实战案例 │ │ │ └── 04-资源/ # 外部资源聚合 │ │ ├── prompts/ # 提示词库 @@ -280,7 +281,7 @@ bash backups/一键备份.sh ### Core Directories - **`i18n/zh/prompts/`**: 核心提示词库(00-元提示词、01-系统提示词、02-编程提示词、03-用户提示词) - **`i18n/zh/skills/`**: 模块化技能库(00-元技能、01-AI工具、02-数据库、03-加密货币、04-开发工具) -- **`i18n/zh/documents/`**: 知识库(00-基础指南、01-入门指南、02-方法论、03-实战、04-资源) +- **`i18n/zh/documents/`**: 知识库(-01-哲学与方法论、00-基础指南、01-入门指南、02-方法论、03-实战、04-资源) - **`libs/external/prompts-library/`**: Excel ↔ Markdown 转换工具 - **`libs/external/chat-vault/`**: AI 聊天记录保存工具 - **`backups/`**: 备份脚本与存档 diff --git a/README.md b/README.md index a11d404..f354d41 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@

+ 哲学与方法论 核心哲学 胶水编程 Canvas白板驱动开发 @@ -391,9 +392,10 @@ Canvas方式:**代码 ⇄ 白板 ⇄ AI ⇄ 人类**,白板成为单一真 │ ├── README.md # 多语言索引 │ ├── zh/ # 中文主语料 │ │ ├── documents/ # 文档库 -│ │ │ ├── 00-基础指南/ # 方法论与原则 +│ │ │ ├── -01-哲学与方法论/ # 最高思想纲领与方法论 +│ │ │ ├── 00-基础指南/ # 核心原则与底层逻辑 │ │ │ ├── 01-入门指南/ # 从零开始教程 -│ │ │ ├── 02-方法论/ # 工具与技巧 +│ │ │ ├── 02-方法论/ # 具体工具与技巧 │ │ │ ├── 03-实战/ # 项目实战案例 │ │ │ └── 04-资源/ # 外部资源聚合 │ │ ├── prompts/ # 提示词库 diff --git a/i18n/en/documents/-01-philosophy-and-methodology/README.md b/i18n/en/documents/-01-philosophy-and-methodology/README.md new file mode 100644 index 0000000..2fec1c5 --- /dev/null +++ b/i18n/en/documents/-01-philosophy-and-methodology/README.md @@ -0,0 +1,99 @@ +# -01- Philosophy & Methodology: The Underlying Protocol of Vibe Coding + +> **"Code is a projection of thought; philosophy is the operating system of thought."** + +In the paradigm of Vibe Coding, we are no longer just "typists" but "architects of intention." This module transforms cross-disciplinary philosophical tools into executable engineering directives, aimed at eliminating cognitive friction in human-AI collaboration and enhancing the precision of intention delivery. + +--- + +## Index + +1. [Perception & Definition: Seeing the Truth](#1-perception--definition-seeing-the-truth) +2. [Logic & Refinement: Deep Reasoning](#2-logic--refinement-deep-reasoning) +3. [Verification & Correction: Countering Hallucinations](#3-verification--correction-countering-hallucinations) +4. [Systems & Evolution: Global Decision Making](#4-systems--evolution-global-decision-making) +5. [Frontier Cognitive Tools: Formalization & Computation](#5-frontier-cognitive-tools-formalization--computation) + +--- + +## 1. Perception & Definition: Seeing the Truth +*Goal: Eliminate subjective bias and linguistic ambiguity before prompting.* + +### Phenomenological Reduction +* **Method**: **Epoche (Suspension of Judgment)**. Describe "what is actually happening" rather than "what should happen." +* **Vibe App**: When describing bugs, provide raw logs and observed outputs; avoid injecting "I think it's this function" biases. + +### Hermeneutics +* **Method**: **Hermeneutic Circle**. Understand the part through the whole and the whole through the part. +* **Vibe App**: Ask the model to restate requirements and list ambiguities before writing code. + +### Steelmanning +* **Method**: Addressing the strongest possible version of an opponent's argument. +* **Vibe App**: In refactoring, ask: "Prove why my current solution is reasonable first, then propose a new one that surpasses it." + +--- + +## 2. Logic & Refinement: Deep Reasoning +*Goal: Elevate the model's thinking depth towards optimal rather than just feasible solutions.* + +### Socratic Questioning +* **Method**: Continuous inquiry. Why? What's the evidence? What's the counterexample? +* **Vibe App**: Use 5 layers of "Why" for model solutions, focusing on performance, edge cases, and graceful degradation. + +### Occam's Razor +* **Method**: Entia non sunt multiplicanda praeter necessitatem (Entities should not be multiplied beyond necessity). +* **Vibe App**: Demand the model to "remove 30% complexity while keeping core requirements," favoring stateless designs. + +### Bayesian Epistemology +* **Method**: Dynamically updating beliefs based on new evidence. +* **Vibe App**: Treat error logs as "new evidence" to update the prompt strategy via conditionalization, rather than repeating the same path. + +--- + +## 3. Verification & Correction: Countering Hallucinations +*Goal: Establish scientific feedback loops to ensure code determinism.* + +### Popperian Falsifiability +* **Method**: A theory that is not falsifiable is not scientific. +* **Vibe App**: Every "seemingly correct" code must have a test case that could prove it wrong. Shift from "I think it's right" to "I haven't falsified it yet." + +### Counterfactual Thinking +* **Method**: Ask "What if X were not the case?" +* **Vibe App**: Build test matrices: What if the network times out? What if the disk is full? What if API returns are out of order? + +### Experimental Philosophy (x-phi) +* **Method**: Using data to test intuitions. +* **Vibe App**: Don't argue over which API is better; generate A/B test scripts and let the benchmark data decide. + +--- + +## 4. Systems & Evolution: Global Decision Making +*Goal: Maintain elegance in complex engineering, balancing speed and quality.* + +### Systems Thinking / Holism +* **Method**: Focus on boundaries, feedback, and coupling. +* **Vibe App**: Visualize data flows and dependency graphs to decouple high-risk points and shorten feedback loops. + +### Dialectical Contradiction Analysis +* **Method**: Identify and resolve the primary contradiction. +* **Vibe App**: When stuck, analyze if it's "unclear requirements," "unstable APIs," or "slow feedback." Resolve the core bottleneck first. + +### Pragmatism +* **Method**: Truth is defined by its utility and effect. +* **Vibe App**: Define quantifiable metrics (P95 latency, cost, delivery time). Optimize one metric per iteration. + +### Decision Theory +* **Method**: Distinguish between reversible and irreversible decisions. +* **Vibe App**: Label modifications as "fragile" or "foundational." Prioritize high-value, reversible actions (MVP). + +--- + +## 5. Frontier Cognitive Tools: Formalization & Computation + +* **Formal Methods**: Using math and modal logic to make epistemological problems computable and cumulative. +* **Computational Philosophy**: Using simulations and agent models to turn mental models into runnable experiments. +* **Reflective Equilibrium**: Iteratively calibrating specific judgments and general principles for systemic consistency. +* **Conceptual Engineering**: Actively engineering and optimizing conceptual tools to serve Vibe Coding practices. + +--- +*Note: This content evolves continuously as the supreme ideological directive of the Vibe Coding CN project.* diff --git a/i18n/en/documents/README.md b/i18n/en/documents/README.md index f07f6a3..7e1a071 100644 --- a/i18n/en/documents/README.md +++ b/i18n/en/documents/README.md @@ -8,6 +8,7 @@ ``` documents/ +├── -01-philosophy-and-methodology/ # Supreme ideological directive ├── 00-fundamentals/ # Core concepts & principles │ ├── Glue Coding.md │ ├── Language Layer Elements.md @@ -47,6 +48,10 @@ documents/ ## 🗂️ Categories +### -01-philosophy-and-methodology +Supreme ideological directive and epistemological tools: +- **Philosophy & Methodology** - The underlying protocol of Vibe Coding + ### 00-fundamentals Core concepts and methodology: - **Glue Coding** - Revolutionary programming paradigm diff --git a/i18n/zh/documents/-01-哲学与方法论/README.md b/i18n/zh/documents/-01-哲学与方法论/README.md new file mode 100644 index 0000000..1cdac3b --- /dev/null +++ b/i18n/zh/documents/-01-哲学与方法论/README.md @@ -0,0 +1,99 @@ +# -01- 哲学与方法论:Vibe Coding 的底层协议 + +> **“代码是思维的投影,哲学是思维的操作系统。”** + +在 Vibe Coding 的范式中,我们不再仅仅是“打字员”,而是“意图的架构师”。本模块将跨学科的哲学工具转化为可执行的工程指令,旨在消除人机协作中的认知摩擦,提升意图传递的精确度。 + +--- + +## 目录索引 + +1. [感知与定义:如何看清真相](#1-感知与定义如何看清真相) +2. [逻辑与精炼:如何深度推理](#2-逻辑与精炼如何深度推理) +3. [验证与纠偏:如何对抗幻觉](#3-验证与纠偏如何对抗幻觉) +4. [系统与演进:如何全局决策](#4-系统与演进如何全局决策) +5. [前沿认知工具:形式化与计算化](#5-前沿认知工具形式化与计算化) + +--- + +## 1. 感知与定义:如何看清真相 +*目标:在输入 prompt 之前,消除主观偏见与语境歧义。* + +### 现象学还原 (Phenomenological Reduction) +* **方法**:**悬置假设**。不讨论“应该怎么做”,只记录“实际发生了什么”。 +* **Vibe 应用**:在描述 Bug 时,只提供原始日志、输入数据和观察到的输出,严禁带入“我觉得是某个函数坏了”的预设。 + +### 诠释学 (Hermeneutics) +* **方法**:**语境循环**。理解局部必须基于整体,理解整体必须基于局部。 +* **Vibe 应用**:让模型先复述需求并列出所有歧义点(术语定义、隐含前提),在达成语境一致后再编写代码。 + +### “钢人化”原则 (Steelmanning) +* **方法**:以最强版本的理解去反驳或改进。 +* **Vibe 应用**:在重构讨论时,要求模型:“先证明我现有方案的合理性,再提出一个能全面超越它的新方案。” + +--- + +## 2. 逻辑与精炼:如何深度推理 +*目标:提升模型的思考深度,追求最优解而非可行解。* + +### 苏格拉底式诘问 (Socratic Questioning) +* **方法**:连续追问。你凭什么?证据是什么?反例是什么? +* **Vibe 应用**:对模型的方案进行 5 层追问,特别是关于“性能开销”、“边界安全”和“失败降级”的底层逻辑。 + +### 奥卡姆剃刀 (Occam's Razor) +* **方法**:若无必要,勿增实体。 +* **Vibe 应用**:让模型给出方案后,强制执行指令:“删掉 30% 复杂度,保持核心需求不变,优先选择无状态设计。” + +### 贝叶斯认识论 (Bayesian Epistemology) +* **方法**:根据新证据动态更新信念。 +* **Vibe 应用**:将报错信息视为“新证据”,通过条件化更新(Conditionalization)修正 Prompt 策略,而非在错误的路径上死磕。 + +--- + +## 3. 验证与纠偏:如何对抗幻觉 +*目标:建立科学的反馈回路,确保代码的确定性。* + +### 波普尔式可证伪性 (Falsifiability) +* **方法**:不能被证伪的理论不是科学。 +* **Vibe 应用**:任何“看起来对”的代码都必须配一个能把它证明为错的测试用例。从“我认为正确”转变为“我暂时没能证伪”。 + +### 反事实推理 (Counterfactual Thinking) +* **方法**:问“如果 X 不成立会怎样?” +* **Vibe 应用**:构建测试矩阵:如果网络超时?如果磁盘写满?如果 API 返回乱序?将反事实场景转化为容错分支。 + +### 实验哲学 (Experimental Philosophy / x-phi) +* **方法**:用数据检验直觉。 +* **Vibe 应用**:不争论哪个 API 更好用,直接让模型生成 A/B 测试脚本,用 Benchmark 的客观数据做决策。 + +--- + +## 4. 系统与演进:如何全局决策 +*目标:在复杂工程中保持优雅,平衡速度与质量。* + +### 系统论/整体论 (Systems Thinking) +* **方法**:关注边界、反馈与耦合。 +* **Vibe 应用**:让模型可视化数据流与依赖图,优先解耦高风险点,通过缩短反馈回路(如本地 Mock 环境)来加速 Vibe。 + +### 辩证法的矛盾分析 +* **方法**:定位并解决主要矛盾。 +* **Vibe 应用**:当卡住时,分析是“需求不清”、“接口不稳”还是“反馈太慢”?先冻结次要矛盾,集中火力解决核心瓶颈。 + +### 实用主义 (Pragmatism) +* **方法**:以效果为真理标准。 +* **Vibe 应用**:定义量化指标(P95 延迟、成本、交付时间)。每轮迭代只优化一个指标,避免过度工程。 + +### 决策论 (Decision Theory) +* **方法**:区分可逆与不可逆决策。 +* **Vibe 应用**:要求模型标注:哪些修改是“易碎”的?哪些是“地基”?优先执行高价值且可逆的动作(MVP)。 + +--- + +## 5. 前沿认知工具:形式化与计算化 + +* **形式化方法 (Formal Methods)**:使用数学与模态逻辑精确化论证,使认识论问题可推演、可对比、可累积。 +* **计算哲学 (Computational Philosophy)**:用仿真与代理模型实例化哲学研究,将思维模型转化为可运行的代码实验。 +* **反思平衡 (Reflective Equilibrium)**:在具体判断、通用原则与背景理论之间反复校正,追求系统的一致性。 +* **概念工程 (Conceptual Engineering)**:不仅是澄清概念,更是主动改造和优化概念工具以服务于 Vibe Coding 实践。 + +--- +*注:本模块内容将持续演进,作为 Vibe Coding CN 项目的最高思想纲领。* diff --git a/i18n/zh/documents/-01-哲学与方法论/现象学还原.md b/i18n/zh/documents/-01-哲学与方法论/现象学还原.md new file mode 100644 index 0000000..00186fa --- /dev/null +++ b/i18n/zh/documents/-01-哲学与方法论/现象学还原.md @@ -0,0 +1,107 @@ +### 现象学还原(悬置假设)用于 vibe coding + +**核心目的** +把“我以为需求是这样”从对话里剥离出去,只留下可观察、可复现、可检验的事实与体验结构,从而让模型在更少臆测的前提下产出可用代码。 + +--- + +## 1) 方法要点(在工程语境下怎么理解) + +* **悬置(epoché)**:暂时不采纳任何“原因解释/业务推断/最佳实践偏好”。 + 只记录:发生了什么、期望是什么、约束是什么。 + +* **还原(reduction)**:把问题还原到“给定输入→经过过程→得到输出”的最小结构。 + 先不谈架构、模式、技术栈优雅与否。 + +* **意向性(intentionality)**:明确“这个功能是为谁、在什么情境下、要达成什么体验”。 + 不是“做个登录”,而是“用户在弱网下也能在 2 秒内完成登录并得到明确反馈”。 + +--- + +## 2) 适用场景 + +* 需求描述充满抽象词:快、稳定、像某某一样、智能、顺滑。 +* 模型开始“自带设定”:自己补产品逻辑、乱选框架、擅自加复杂度。 +* Bug 复现困难:偶发、环境相关、输入边界不清。 + +--- + +## 3) 操作流程(可直接照做) + +### A. 先“清空解释”,只保留现象 + +用四件套描述: + +1. **现象**:实际发生的结果(含报错/截图/日志片段)。 +2. **意图**:我想要的结果(可观察标准)。 +3. **情境**:环境与前置条件(版本、平台、网络、权限、数据规模)。 +4. **边界**:哪些不需要做/不要假设(不改接口、不引入新依赖、不改数据库结构等)。 + +### B. 产出“最小可复现体”(MRE) + +* 最小输入样例(最短 JSON/最小表/最小请求) +* 最小代码片段(去掉无关模块) +* 明确复现步骤(1、2、3) +* 预期 vs 实际(对照表) + +### C. 把“抽象词”降维成可测指标 + +* “快”→ P95 延迟 < X、冷启动 < Y、吞吐 >= Z +* “稳定”→ 错误率 < 0.1%、重试策略、熔断条件 +* “好用”→ 交互反馈、错误文案、可撤销/可恢复 + +--- + +## 4) 给模型的提示词模板(可直接复制) + +**模板 1:还原问题(禁止脑补)** + +``` +请先做“现象学还原”:不要推测原因、不要引入额外功能。 +只根据我给的信息,输出: +1) 现象(可观察事实) +2) 意图(我想要的可观察结果) +3) 情境(环境/约束) +4) 未确定项(必须问清或需要我补的最小信息) +5) 最小可复现步骤(MRE) +然后再给出最小修复方案与对应测试。 +``` + +**模板 2:抽象需求变可测规格** + +``` +把下面需求做“悬置假设”处理:删掉所有抽象词,转成可验证规格: +- 明确输入/输出 +- 明确成功/失败判定 +- 明确性能/资源指标(如需要) +- 明确不做什么 +最后给出验收用例列表。 +需求:<粘贴> +``` + +--- + +## 5) 在 vibe coding 的具体落地方式(习惯化) + +* **每次开工先写“现象卡片”**(2 分钟):现象/意图/情境/边界。 +* **先让模型复述**:要求它只复述事实与缺口,不许给方案。 +* **再进入生成**:方案必须绑定到“可观察验收”与“可证伪测试”。 + +--- + +## 6) 常见陷阱与对策 + +* **陷阱:把解释当事实**(“可能是缓存导致”) + 对策:把“可能”移到“假设列表”,每条假设配验证步骤。 + +* **陷阱:需求用形容词堆叠** + 对策:强制转成指标与用例;不满足“可测”不让写代码。 + +* **陷阱:模型自选技术栈** + 对策:边界里写死:语言/框架/依赖/接口不可变。 + +--- + +## 7) 一句话口诀(便于放进工具箱卡片) + +**先悬置解释,再固定现象;先写验收标准,再让模型写实现。** diff --git a/i18n/zh/documents/-01-哲学与方法论/辩证法.md b/i18n/zh/documents/-01-哲学与方法论/辩证法.md new file mode 100644 index 0000000..4e63718 --- /dev/null +++ b/i18n/zh/documents/-01-哲学与方法论/辩证法.md @@ -0,0 +1,11 @@ +把辩证法的正反合用到 vibe coding:我把每次写代码都当一轮“三段论” + +正(当前状态):先让模型按直觉快速给出“最顺的实现”,目标只有一个:尽快跑通主路径 + +反(审计与调优):立刻站在“挑刺者”视角反驳它:列失败模式/边界条件/性能与安全隐患,并用测试、类型、lint、基准把反驳落地 + +合(根据审核计修正):把速度与约束合起来:重构接口、收敛依赖、补齐测试与文档,形成下一轮更稳定的起点 + +实践口诀:先顺写 → 再打脸 → 再收敛 + +vibe 负责生成可能性,正反合负责把可能性变成工程确定 \ No newline at end of file diff --git a/i18n/zh/documents/README.md b/i18n/zh/documents/README.md index 24ae36f..c2bb122 100644 --- a/i18n/zh/documents/README.md +++ b/i18n/zh/documents/README.md @@ -6,17 +6,19 @@ ``` documents/ -├── 00-基础指南/ # 核心理念,胶水编程,方法论 -├── 01-入门指南/ # 从零开始,环境配置 -├── 02-方法论/ # 工具教程,开发经验 -├── 03-实战/ # 项目实战经验 -└── 04-资源/ # 模板,工具,外部资源 +├── -01-哲学与方法论/ # 最高思想纲领,底层逻辑 +├── 00-基础指南/ # 核心理念,胶水编程,方法论 +├── 01-入门指南/ # 从零开始,环境配置 +├── 02-方法论/ # 工具教程,开发经验 +├── 03-实战/ # 项目实战经验 +└── 04-资源/ # 模板,工具,外部资源 ``` ## 🚀 快速导航 | 目录 | 说明 | 适合人群 | |:---|:---|:---| +| [-01-哲学与方法论](./-01-哲学与方法论/) | 思想纲领、认识论工具 | 架构师与深度开发者 | | [00-基础指南](./00-基础指南/) | 胶水编程、核心理念 | 理解本质 | | [01-入门指南](./01-入门指南/) | 环境配置、从零开始 | 新手入门 | | [02-方法论](./02-方法论/) | 工具教程、开发经验 | 提升效率 | @@ -25,8 +27,9 @@ documents/ ## 📖 推荐学习路径 -1. **理念** → [胶水编程](./00-基础指南/胶水编程.md) -2. **入门** → [Vibe Coding 哲学原理](./01-入门指南/00-Vibe%20Coding%20哲学原理.md) +1. **思维** → [-01-哲学与方法论](./-01-哲学与方法论/README.md) +2. **理念** → [胶水编程](./00-基础指南/胶水编程.md) +3. **入门** → [Vibe Coding 哲学原理](./01-入门指南/00-Vibe%20Coding%20哲学原理.md) 3. **配置** → [开发环境搭建](./01-入门指南/02-开发环境搭建.md) 4. **工具** → [tmux 快捷键](./02-方法论/tmux快捷键大全.md) 5. **实践** → [项目实战经验](./03-实战/)