ai-collab-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Collaborative Development

AI协作开发

A structured 10-step methodology for building software entirely with AI collaboration. The key insight: the build agent only ever reads messages written by another AI - your writing style, syntax errors, and typos never reach it. You steer from outside.
这是一套结构化的10步方法论,用于完全借助AI协作构建软件。核心亮点:构建Agent只会读取其他AI撰写的信息——你的写作风格、语法错误和拼写错误永远不会传递给它。你只需从外部进行引导。

When to use me

适用场景

Use this methodology when starting a new project that will be built primarily or entirely by AI agents. Especially valuable when you want to:
  • Build something complex without writing the code yourself
  • Ensure the AI has enough context to make good decisions autonomously
  • Reduce the back-and-forth of constant manual supervision
  • Get a production-quality spec before a single line of code is written
当你启动一个主要或完全由AI Agent构建的新项目时,可使用此方法论。尤其在以下场景中价值显著:
  • 无需自行编写代码即可构建复杂项目
  • 确保AI拥有足够上下文来自主做出合理决策
  • 减少反复手动监督的来回沟通
  • 在编写任何代码前就获得生产级别的规格文档

What I do

核心功能

  • Guide you through a 10-step methodology from idea to running code
  • Provide scripts for chunking AI conversations, generating BMAD spec templates, and building TODO structures
  • Explain why each step matters, not just what to do
  • Prepare your project for a Ralph loop so the build agent can run without you
  • 引导你完成从想法到可运行代码的10步流程
  • 提供用于拆分AI对话、生成BMAD规格模板和构建TODO结构的脚本
  • 解释每个步骤的重要性,而非仅说明操作方法
  • 为项目配置Ralph循环,使构建Agent无需人工介入即可运行

Workflow Overview

工作流概览

mermaid
flowchart TD
    S1["1. North Star\n(Web AI)"]
    S2["2. Handoff to\nCode AI"]
    S3["3. Chunk\nConversation"]
    S4["4. Loop on\nMissing Spec"]
    S5["5. Drill into\nDetails"]
    S6["6. Ralph Loop\nBriefing"]
    S7["7. Run /init\n(AGENTS.md)"]
    S8["8. Build Loop\n& PROMPTs"]
    S9["9. Baby-Step\nTODO List"]
    S10["10. Run Loop\nSteer from Outside"]

    S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7 --> S8 --> S9 --> S10

    S10 -->|"spec gap found"| S4
    S10 -->|"details missing"| S5
    S10 -->|"AGENTS.md stale"| S7
    S10 -->|"PROMPT needs fix"| S8
    S10 -->|"TODO too vague"| S9
Step 10 is not the end — it is the steering point. When the loop stalls or a requirement changes, go back to whichever earlier step owns the problem. Never edit the build agent session directly.
mermaid
flowchart TD
    S1["1. North Star\n(Web AI)"]
    S2["2. Handoff to\nCode AI"]
    S3["3. Chunk\nConversation"]
    S4["4. Loop on\nMissing Spec"]
    S5["5. Drill into\nDetails"]
    S6["6. Ralph Loop\nBriefing"]
    S7["7. Run /init\n(AGENTS.md)"]
    S8["8. Build Loop\n& PROMPTs"]
    S9["9. Baby-Step\nTODO List"]
    S10["10. Run Loop\nSteer from Outside"]

    S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7 --> S8 --> S9 --> S10

    S10 -->|"spec gap found"| S4
    S10 -->|"details missing"| S5
    S10 -->|"AGENTS.md stale"| S7
    S10 -->|"PROMPT needs fix"| S8
    S10 -->|"TODO too vague"| S9
第10步并非终点——它是一个引导节点。当循环停滞或需求变更时,回到对应问题所属的早期步骤。切勿直接编辑构建Agent的会话内容。

The 10-Step Methodology

10步方法论详解

Step 1 — Start outside the editor

步骤1:从编辑器外开始

Use a web AI (Gemini, ChatGPT, Claude, Grok, DeepSeek) to develop the north star of the project. This is not a coding session — it is a thinking session. Capture:
  • The soul of what you are building
  • The core problems it solves
  • Who uses it and why they care
  • What success looks like
Do not open your editor yet.
使用Web AI(Gemini、ChatGPT、Claude、Grok、DeepSeek)确定项目的核心愿景。这并非编码会话——而是思考会话。需记录:
  • 项目的核心定位
  • 解决的核心问题
  • 用户群体及其需求
  • 成功的衡量标准
此时请勿打开编辑器。

Step 2 — Transition to the code AI

步骤2:过渡到代码AI

Tell your code AI (OpenCode, Claude Code, Cursor, etc.) that you had a conversation with another AI and are about to pass the context. This primes it to receive structured input rather than expecting a normal user prompt.
Example handoff message:
I've been working with another AI to design a project. I'm going to share that conversation
with you one message at a time so you can build a comprehensive spec. Please acknowledge
each message and start building context.
告知你的代码AI(OpenCode、Claude Code、Cursor等),你已与另一个AI协作设计项目,并将逐步传递上下文。这会让它做好接收结构化输入的准备,而非等待普通用户提示。
示例交接消息:
我一直在与另一个AI协作设计一个项目。我会逐条分享我们的对话内容,以便你构建完整的规格文档。请确认每条消息并开始积累上下文。

Step 3 — Send the web AI conversation in chunks

步骤3:分块发送Web AI对话

Send the conversation one exchange at a time: one human message, then one AI response, then pause. Ask the code AI to build specs in BMAD style with "exhaustive verbosity" — meaning every detail should be captured, not summarized.
Why chunks work: A wall of text causes the AI to skim. Chunking forces it to process each idea fully before receiving the next.
bash
undefined
逐条发送对话内容:先发送一条人类消息,再发送一条AI回复,然后暂停。要求代码AI以BMAD风格构建规格文档,且需“详尽全面”——即记录所有细节,而非仅做总结。
分块的作用:大段文本会让AI略读,分块则迫使它在接收下一条内容前充分处理每个想法。
bash
undefined

Use the chunk helper to split a saved conversation

使用分块工具拆分已保存的对话

bash scripts/chunk-conversation.sh conversation.txt
undefined
bash scripts/chunk-conversation.sh conversation.txt
undefined

Step 4 — Loop on missing spec

步骤4:补全规格文档循环

This is a long loop. The goal is an airtight spec before any code is written.
  1. Ask: "What is missing from this spec? What decisions have we not made?"
  2. Have the AI ask you clarifying questions
  3. Answer them
  4. Repeat until questions stop surfacing
Then bring in an adversarial agent (DeepSeek R1 or similar - large model, strong reasoning) to pressure test the spec:
Here is our spec. Act as a senior engineer who has seen projects fail.
What assumptions are we making that could kill this project?
What edge cases have we ignored? What will break at scale?
Loop until the adversarial agent can no longer find significant gaps.
这是一个较长的循环阶段。目标是在编写任何代码前获得无漏洞的规格文档。
  1. 询问:“此规格文档缺少什么?我们尚未做出哪些决策?”
  2. 让AI向你提出澄清问题
  3. 回答这些问题
  4. 重复直到AI不再提出新问题
随后引入对抗性Agent(如DeepSeek R1或类似的大模型,具备强大推理能力)来测试规格文档:
这是我们的规格文档。请扮演一位见过无数项目失败的资深工程师。
我们做出的哪些假设可能导致项目失败?
我们忽略了哪些边缘情况?哪些内容在规模化时会崩溃?
重复此过程,直到对抗性Agent无法发现重大漏洞。

Step 5 — Drill into implementation details

步骤5:深入研究实现细节

Once the general spec is solid, go deeper on areas the AI typically misses:
  • Language and runtime selection (with justification)
  • Database options and tradeoffs, chosen schema design
  • API structure: endpoints, request/response shapes, auth model
  • Error handling and failure modes
  • Configuration and environment variables
  • File structure and module boundaries
  • Deployment and infrastructure requirements
Ask the code AI: "What would a senior engineer need to know before writing the first line?"
当通用规格文档确定后,深入探讨AI通常会忽略的领域:
  • 语言和运行时选择(附理由)
  • 数据库选项与权衡、选定的架构设计
  • API结构:端点、请求/响应格式、认证模型
  • 错误处理与故障模式
  • 配置与环境变量
  • 文件结构与模块边界
  • 部署与基础设施要求
询问代码AI:“资深工程师在编写第一行代码前需要了解哪些信息?”

Step 6 — Ralph loop briefing

步骤6:Ralph循环说明

Tell the agent it will use a Ralph loop to build this project. Have it research what a Ralph loop is (point it at the
ralph-wiggum-loop
skill). Then explain:
"100% of the code in this project will be AI-written. There will be no human supervision during the build. Every ambiguity must be resolved now. Every edge case must be handled in the spec. We will not be able to answer questions mid-build."
Run multiple adversarial loops on the resulting spec — one focused on the implementation plan, one on the PROMPT.md files the Ralph loop will use, one on the TODO structure.
Key questions to pressure test:
  • "Can a build agent execute this TODO item without asking a question?"
  • "Does this PROMPT.md give the agent enough context to succeed without human help?"
  • "What will the agent do when it hits an error on step 7 of 20?"
告知Agent将使用Ralph循环构建此项目。让它研究Ralph循环是什么(可指向
ralph-wiggum-loop
技能)。然后说明:
"本项目的100%代码将由AI编写。构建过程中无需人工监督。所有模糊点必须现在解决。所有边缘情况必须在规格文档中处理。构建过程中我们无法回答任何问题。"
对最终的规格文档进行多轮对抗性测试——一轮聚焦于实现计划,一轮聚焦于Ralph循环将使用的PROMPT.md文件,一轮聚焦于TODO结构。
需重点测试的问题:
  • “构建Agent能否独立完成此TODO项,无需人工回答问题?”
  • “此PROMPT.md是否为Agent提供了足够的上下文以确保成功,无需人工帮助?”
  • “当Agent在第7步遇到错误时会如何处理?”

Step 7 — Run
/init

步骤7:运行/init命令

Run
/init
(or equivalent in your code AI) to build the
AGENTS.md
or
agent.md
file. This file:
  • Summarizes the project for agents that haven't seen the full conversation
  • Acts as a central notes location
  • Is especially useful for less capable models that struggle with long context
  • Should include: project goal, tech stack, file structure, conventions, how to run the project
Review and extend this file manually — it is the single most important context document for your build agents.
运行
/init
(或代码AI中的等效命令)来生成
AGENTS.md
agent.md
文件。此文件:
  • 为未参与完整对话的Agent总结项目信息
  • 作为集中式笔记位置
  • 对处理长上下文有困难的低能力模型尤其有用
  • 应包含:项目目标、技术栈、文件结构、约定、项目运行方式
手动审核并扩展此文件——它是构建Agent最重要的上下文文档。

Step 8 — Build the Ralph loop and PROMPT files

步骤8:构建Ralph循环与PROMPT文件

Generate a Ralph loop scaffold:
bash
bash scripts/setup-ralph-project.sh ./my-project
Then write PROMPT.md files for each agent role. Each prompt must:
  • State the agent's role clearly
  • Reference the spec explicitly ("Read SPEC.md section 3 before starting")
  • Follow software development lifecycle discipline (plan, implement, test, verify)
  • Describe how to handle errors and failures
  • Say what "done" looks like for a given phase
Example structure:
project/
├── TODO.md                    # Tasks in - [ ] format, ordered
├── SPEC.md                    # The exhaustive spec from steps 1-6
├── AGENTS.md                  # Agent context from step 7
├── .memory-bank/
│   ├── inbox/
│   │   ├── builder/PROMPT.md      # Implements TODO items
│   │   ├── verifier/PROMPT.md     # Runs tests, checks requirements
│   │   └── planner/PROMPT.md      # Updates TODO when stuck
│   ├── system/                    # Auto-generated: rules, roles, patterns
│   │   ├── MEMORY_RULES.md        # How the system learns and organizes
│   │   ├── CONTEXT_PATTERNS.md    # Detected context patterns and templates
│   │   └── RETRIEVAL_GUIDE.md     # How to find information in the bank
│   └── evolution/                 # Auto-generated: how memory has grown
│       ├── DECISION_LOG.md        # Why memory structure changed
│       └── LEARNED_HEURISTICS.md  # Patterns the system discovered
└── ralph-loop.py              # Generated loop runner
生成Ralph循环脚手架:
bash
bash scripts/setup-ralph-project.sh ./my-project
然后为每个Agent角色编写PROMPT.md文件。每个提示必须:
  • 清晰说明Agent的角色
  • 明确引用规格文档(“开始前请阅读SPEC.md第3节”)
  • 遵循软件开发生命周期规范(规划、实现、测试、验证)
  • 描述如何处理错误与故障
  • 说明特定阶段的“完成”标准
示例结构:
project/
├── TODO.md                    # 按顺序排列的- [ ]格式任务
├── SPEC.md                    # 步骤1-6生成的详尽规格文档
├── AGENTS.md                  # 步骤7生成的Agent上下文文档
├── .memory-bank/
│   ├── inbox/
│   │   ├── builder/PROMPT.md      # 实现TODO项
│   │   ├── verifier/PROMPT.md     # 运行测试、检查需求
│   │   └── planner/PROMPT.md      # 遇到阻塞时更新TODO
│   ├── system/                    # 自动生成:规则、角色、模式
│   │   ├── MEMORY_RULES.md        # 系统学习与组织方式
│   │   ├── CONTEXT_PATTERNS.md    # 检测到的上下文模式与模板
│   │   └── RETRIEVAL_GUIDE.md     # 记忆库信息检索指南
│   └── evolution/                 # 自动生成:记忆库演变过程
│       ├── DECISION_LOG.md        # 记忆库结构变更原因
│       └── LEARNED_HEURISTICS.md  # 系统发现的模式
└── ralph-loop.py              # 生成的循环运行器

Step 9 — Build the TODO list with baby steps

步骤9:构建细分步骤的TODO列表

The TODO list is where most Ralph loops fail. Items must be:
  • Small: Fits in one agent context window without compacting
  • Unambiguous: The agent knows exactly what done looks like
  • Ordered: Dependencies are respected
  • Referenced: Each item cites the relevant spec section
Bad TODO item:
- [ ] Build the authentication system
Good TODO item:
- [ ] Implement JWT token generation per SPEC.md section 4.2.
  Create src/auth/tokens.py with generate_token(user_id, expiry) and verify_token(token).
  Token payload must include: sub, iat, exp, role. Use HS256. Secret from env JWT_SECRET.
  Tests in tests/test_tokens.py. All tests must pass before marking complete.
Use an adversarial agent to review the TODO list:
Review this TODO list. Can each item be completed by a build agent working alone,
with no human available to answer questions? Flag any item that requires a decision,
has an ambiguous success condition, or depends on something not yet built.
TODO列表是大多数Ralph循环失败的关键所在。列表项必须:
  • 细分:在单个Agent上下文窗口内即可容纳,无需压缩
  • 明确:Agent清楚知道“完成”的标准
  • 有序:遵循依赖关系
  • 关联:每个项引用相关的规格文档章节
不良的TODO项:
- [ ] 构建认证系统
良好的TODO项:
- [ ] 按照SPEC.md第4.2节实现JWT令牌生成。
  创建src/auth/tokens.py,包含generate_token(user_id, expiry)和verify_token(token)函数。
  令牌负载必须包含:sub、iat、exp、role。使用HS256算法。密钥来自环境变量JWT_SECRET。
  测试代码位于tests/test_tokens.py。所有测试通过后方可标记为完成。
使用对抗性Agent审核TODO列表:
审核此TODO列表。每个项能否由构建Agent独立完成,无需人工回答问题?标记任何需要决策、成功条件模糊或依赖未完成工作的项。

Step 10 — Run the loop, steer from outside

步骤10:运行循环,从外部引导

Start the Ralph loop:
bash
python ralph-loop.py loop --commit
When changes are needed — because the agent got stuck, a requirement changed, or something broke — do not intervene in the agent session directly. Instead, go back to whichever earlier step owns the problem:
SymptomGo back to
Agent asks questions or guesses wrongStep 4 — spec has gaps, run another missing-spec loop
Agent makes wrong implementation choicesStep 5 — drill deeper on that area
Agent lacks project context between runsStep 7 — update AGENTS.md
Agent misunderstands its role or phaseStep 8 — rewrite the relevant PROMPT.md
Agent stalls or marks wrong tasks doneStep 9 — rewrite the TODO item with clearer success criteria
After updating the relevant file, let the loop pick up on the next iteration. Do not restart from scratch — the loop will read the updated files automatically.
The core principle: The build agent only ever sees messages written by the other AI. Your writing style, syntax errors, and stream-of-consciousness are excluded from what it reads. This keeps the signal clean and the context usable.
Step 10 is not a finish line — it is a steering loop. You will visit earlier steps multiple times on any non-trivial project. That is expected and correct.
启动Ralph循环:
bash
python ralph-loop.py loop --commit
当需要变更时——无论是Agent遇到阻塞、需求变更还是出现故障——请勿直接干预Agent会话。而是回到对应问题所属的早期步骤:
症状返回步骤
Agent提出问题或猜测错误步骤4——规格文档存在漏洞,运行补全规格循环
Agent做出错误的实现选择步骤5——深入研究该领域
Agent在多次运行间缺少项目上下文步骤7——更新AGENTS.md
Agent误解其角色或阶段步骤8——重写相关的PROMPT.md
Agent停滞或错误标记任务为完成步骤9——重写TODO项,明确成功标准
更新相关文件后,让循环在下一次迭代时自动读取更新内容。无需从头重启——循环会自动读取更新后的文件。
核心原则:构建Agent只会读取其他AI撰写的信息。你的写作风格、语法错误和随性表达不会被它读取。这确保了信息的清晰度和上下文的可用性。
第10步并非终点——它是一个引导循环。对于任何非 trivial 项目,你会多次回到早期步骤。这是正常且正确的流程。

Scripts

脚本说明

scripts/chunk-conversation.sh

scripts/chunk-conversation.sh

Split a saved AI conversation file into numbered chunks ready to paste one at a time.
bash
bash scripts/chunk-conversation.sh conversation.txt
将已保存的AI对话文件拆分为编号的分块内容,便于逐条粘贴。
bash
bash scripts/chunk-conversation.sh conversation.txt

Creates chunks/chunk-001.txt, chunk-002.txt, ...

生成chunks/chunk-001.txt, chunk-002.txt, ...

undefined
undefined

scripts/setup-ralph-project.sh

scripts/setup-ralph-project.sh

Scaffold a new project with the Ralph loop structure, empty PROMPT.md files, and a starter TODO.md.
bash
bash scripts/setup-ralph-project.sh ./my-project
为新项目搭建Ralph循环结构,包含空的PROMPT.md文件和初始TODO.md。
bash
bash scripts/setup-ralph-project.sh ./my-project

scripts/validate-todo.sh

scripts/validate-todo.sh

Check a TODO.md for items that are too vague or missing success criteria.
bash
bash scripts/validate-todo.sh TODO.md
检查TODO.md中是否存在过于模糊或缺少成功标准的项。
bash
bash scripts/validate-todo.sh TODO.md

Output format

输出格式

After completing the methodology you will have:
my-project/
├── SPEC.md          # Exhaustive spec covering all decisions
├── AGENTS.md        # Agent context document
├── TODO.md          # Baby-step task list with success criteria
├── ralph-loop.py    # Working loop runner
└── memory-bank/
    └── inbox/
        ├── builder/PROMPT.md
        ├── verifier/PROMPT.md
        └── planner/PROMPT.md
The loop can run without you present. When it finishes, you have working code.
完成此方法论后,你将获得:
my-project/
├── SPEC.md          # 涵盖所有决策的详尽规格文档
├── AGENTS.md        # Agent上下文文档
├── TODO.md          # 细分步骤的任务列表(含成功标准)
├── ralph-loop.py    # 可运行的循环执行器
└── memory-bank/
    └── inbox/
        ├── builder/PROMPT.md
        ├── verifier/PROMPT.md
        └── planner/PROMPT.md
循环可在无人值守的情况下运行。完成后,你将获得可运行的代码。

Self-Expanding Memory Bank

自扩展记忆库

The
.memory-bank/
directory is not just storage — it is a self-improving system. The prompt files provide the seed, but the system grows its own rules, roles, and organizational patterns based on accumulated project knowledge.
.memory-bank/
目录不仅是存储位置——它是一个自我改进的系统。提示文件是种子,但系统会基于积累的项目知识自主发展自身的规则、角色和组织模式。

How Self-Expansion Works

自扩展机制

1. Seed Structure (You Provide)
.memory-bank/
├── inbox/
│   ├── builder/PROMPT.md      # Role and initial guidance
│   ├── verifier/PROMPT.md
│   └── planner/PROMPT.md
2. Auto-Generated System Files (AI Maintains)
As the project accumulates information, the AI creates and maintains:
  • MEMORY_RULES.md — Rules for what to save, where, and why. Starts from prompt guidance but expands based on patterns seen.
  • CONTEXT_PATTERNS.md — Templates for common context types the project uses.
  • RETRIEVAL_GUIDE.md — How to find things: "For API questions, check SPEC.md section 4; for conventions, check AGENTS.md lines 20-40."
  • DECISION_LOG.md — Why the memory structure changed: "Created
    domain/
    subdirectory after discovering 15+ API endpoint docs were cluttering root."
  • LEARNED_HEURISTICS.md — Patterns the system discovered: "When TODO item mentions 'fix', previous context usually includes an error log."
3. Expansion Triggers
The system auto-expands when:
  • Information volume crosses threshold: "30+ files in inbox/ → create subdirectories by domain"
  • Retrieval patterns detected: "User asks for 'config' → 90% of time they want ENV_VARS.md"
  • Ambiguity detected: Two files seem to serve same purpose → create CLARIFICATION.md explaining distinction
  • New information type: First time seeing a decision record → create DECISION_LOG.md template
4. User Steering (Not Control)
You don't micromanage the memory structure. Instead:
  • Ask for rationale: "Why did you create a
    domain/
    subdirectory?"
  • Request consolidation: "The split between
    api/
    and
    endpoints/
    is confusing — merge them."
  • Suggest patterns: "We keep asking about auth — create a canonical AUTH_GUIDE.md."
The AI decides how to implement your guidance (which subdirectory, what format) based on accumulated MEMORY_RULES.
5. Prompt Template for Self-Expanding Memory
Add to your PROMPT.md files:
markdown
undefined
1. 初始结构(由你提供)
.memory-bank/
├── inbox/
│   ├── builder/PROMPT.md      # 角色与初始引导
│   ├── verifier/PROMPT.md
│   └── planner/PROMPT.md
2. 自动生成的系统文件(由AI维护)
随着项目信息的积累,AI会创建并维护以下文件:
  • MEMORY_RULES.md —— 存储规则:保存内容、存储位置及原因。从提示引导开始,基于发现的模式扩展。
  • CONTEXT_PATTERNS.md —— 项目常用的上下文类型模板。
  • RETRIEVAL_GUIDE.md —— 信息检索指南:“API相关问题请查看SPEC.md第4节;约定相关请查看AGENTS.md第20-40行。”
  • DECISION_LOG.md —— 记忆库结构变更原因:“发现15+个API端点文档导致根目录混乱后,创建了
    domain/
    子目录。”
  • LEARNED_HEURISTICS.md —— 系统发现的模式:“当TODO项提及‘修复’时,通常之前的上下文包含错误日志。”
3. 扩展触发条件
当出现以下情况时,系统会自动扩展:
  • 信息容量达标:“inbox/目录下有20+个文件 → 按领域创建子目录”
  • 检索模式被检测到:“用户询问‘配置’→ 90%的情况是需要ENV_VARS.md”
  • 检测到歧义:两个文件功能相似 → 创建CLARIFICATION.md说明区别
  • 出现新信息类型:首次出现决策记录 → 创建DECISION_LOG.md模板
4. 用户引导(而非控制)
你无需微管理记忆库结构。而是:
  • 询问理由:“你为什么创建
    domain/
    子目录?”
  • 请求合并
    api/
    endpoints/
    的划分令人困惑——请合并它们。
  • 建议模式:“我们反复询问认证相关问题——请创建权威的AUTH_GUIDE.md。”
AI会基于积累的MEMORY_RULES决定如何实现你的引导(如子目录设置、文件格式)。
5. 自扩展记忆库的提示模板
将以下内容添加到你的PROMPT.md文件中:
markdown
undefined

Memory Bank Management

记忆库管理

You maintain a
.memory-bank/
directory that improves itself:
  1. Save new learnings: After each task, ask: "What did I learn that future agents need?"
    • Technical decisions → save to
      system/DECISION_LOG.md
    • Context patterns → save to
      system/CONTEXT_PATTERNS.md
    • Retrieval shortcuts → save to
      system/RETRIEVAL_GUIDE.md
  2. Organize when cluttered: If a directory has 20+ files, suggest a reorganization.
    • Propose new structure in
      system/DECISION_LOG.md
    • Wait for user confirmation before moving files
  3. Detect gaps: If you can't find something, note it:
    • "Searched for API rate limits → not found. Should add to SPEC.md?"
    • Save search pattern to
      system/LEARNED_HEURISTICS.md
      : "Common missing: rate limiting details"
  4. Evolve rules: As patterns emerge, update MEMORY_RULES.md:
    • "Previously: save all docs to inbox/. Now: categorize by domain."
The memory bank should feel like a colleague left you notes — not a filing cabinet you have to decode.
undefined
你负责维护
.memory-bank/
目录,使其自我改进:
  1. 保存新认知:完成每项任务后,询问自己:“我学到了哪些未来Agent需要的知识?”
    • 技术决策 → 保存到
      system/DECISION_LOG.md
    • 上下文模式 → 保存到
      system/CONTEXT_PATTERNS.md
    • 检索捷径 → 保存到
      system/RETRIEVAL_GUIDE.md
  2. 整理混乱内容:若目录有20+个文件,建议重新组织。
    • system/DECISION_LOG.md
      中提出新结构
    • 获得用户确认后再移动文件
  3. 检测漏洞:若无法找到所需内容,记录下来:
    • “搜索API速率限制 → 未找到。是否应添加到SPEC.md?”
    • 将搜索模式保存到
      system/LEARNED_HEURISTICS.md
      :“常见缺失内容:速率限制细节”
  4. 演变规则:随着模式的出现,更新MEMORY_RULES.md:
    • “之前:所有文档保存到inbox/。现在:按领域分类。”
记忆库应像同事留下的笔记——而非需要费力解读的文件柜。
undefined

Notes

注意事项

  • Steps 1-6 are the most important. Most AI projects fail because they skip to code too fast.
  • The adversarial agent (DeepSeek recommended) is not optional - it catches what you and the code AI both miss.
  • A Ralph loop with a bad TODO list will spin forever. Invest time in Step 9.
  • The
    /init
    agent.md is especially valuable when switching models or resuming work after a break.
  • If the loop gets stuck more than 3 times on the same item, the spec is missing something - go back to the spec, not the code.
  • 步骤1-6最为重要。大多数AI项目失败的原因是过早跳过这些步骤直接编写代码。
  • 对抗性Agent(推荐DeepSeek)是必需的——它能发现你和代码AI都忽略的问题。
  • 若Ralph循环的TODO列表质量不佳,会导致循环无限停滞。请投入时间做好步骤9。
  • /init
    生成的agent.md在切换模型或中断后恢复工作时尤其有用。
  • 若循环在同一项上卡住超过3次,说明规格文档存在漏洞——回到规格文档,而非直接修改代码。