research-after-failure

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Research After Failure

失败后开展研究

Overview

概述

After 2 failed attempts, stop and research. Don't keep trying the same thing.
Core principle: Insanity is doing the same thing and expecting different results.
Trigger: Two consecutive failed attempts at solving a problem.
Announce at start: "I've failed twice. I'm stopping to research before trying again."
连续两次尝试失败后,停止尝试并开展研究。不要重复做同样的事情。
核心原则: 重复做同样的事情却期待不同结果,这是不明智的。
触发条件: 连续两次尝试解决问题均失败。
开始前告知: "我已经失败两次了。我会先停止尝试,开展研究后再继续。"

The Rule

规则

Attempt 1: Try solution
         Failed?
     ┌──────┴──────┐
     │             │
    Yes           No → Done
Attempt 2: Try different approach
         Failed?
     ┌──────┴──────┐
     │             │
    Yes           No → Done
    STOP
  RESEARCH ← You are here
Attempt 3: Try with new knowledge
Attempt 1: Try solution
         Failed?
     ┌──────┴──────┐
     │             │
    Yes           No → Done
Attempt 2: Try different approach
         Failed?
     ┌──────┴──────┐
     │             │
    Yes           No → Done
    STOP
  RESEARCH ← You are here
Attempt 3: Try with new knowledge

What Counts as a Failure

什么情况算失败

FailureNot a Failure
Tests don't passMinor syntax error fixed
Build breaksTypo corrected
Feature doesn't workIDE autocomplete issue
Same error recursDifferent error (progress)
No progress madePartial progress
失败情况非失败情况
测试不通过修复了轻微语法错误
构建失败修正了拼写错误
功能无法正常工作IDE自动补全问题
相同错误重复出现出现不同错误(有进展)
没有任何进展取得部分进展

The Research Protocol

研究流程

Step 1: Document the Failures

步骤1:记录失败情况

Before researching, document what was tried:
markdown
undefined
开展研究前,记录已尝试的内容:
markdown
undefined

Failed Attempts

失败尝试记录

Attempt 1

第一次尝试

Approach: [What was tried] Result: [What happened] Error: [Error message if any]
方法: [尝试了什么] 结果: 发生了什么 错误: [如有错误信息请填写]

Attempt 2

第二次尝试

Approach: [What was tried] Result: [What happened] Error: [Error message if any]
方法: [尝试了什么] 结果: 发生了什么 错误: [如有错误信息请填写]

Pattern

失败规律

[What do these failures have in common?]
undefined
[这些失败有什么共同点?]
undefined

Step 2: Research Repository Documentation

步骤2:研究仓库文档

bash
undefined
bash
undefined

Check README

查看README

cat README.md
cat README.md

Check docs directory

查看docs目录

ls -la docs/ cat docs/[relevant-topic].md
ls -la docs/ cat docs/[relevant-topic].md

Check CONTRIBUTING

查看CONTRIBUTING文档

cat CONTRIBUTING.md
cat CONTRIBUTING.md

Search for relevant docs

搜索相关文档

grep -r "[keyword]" docs/

**Questions to answer:**
- Is there documented guidance for this?
- Are there examples of similar work?
- Are there known issues or limitations?
grep -r "[keyword]" docs/

**需要回答的问题:**
- 是否有针对此问题的文档指导?
- 是否有类似工作的示例?
- 是否有已知问题或限制?

Step 3: Research Existing Codebase

步骤3:研究现有代码库

bash
undefined
bash
undefined

Find similar patterns

查找类似模式

grep -r "[pattern]" src/
grep -r "[pattern]" src/

Find how others solved similar problems

查看他人如何解决类似问题

git log --all --oneline --grep="[keyword]"
git log --all --oneline --grep="[keyword]"

Look at test files for usage examples

查看测试文件中的使用示例

grep -r "[function/class]" **/*.test.ts

**Questions to answer:**
- How does existing code handle this?
- What patterns are established?
- Are there utility functions I'm missing?
grep -r "[function/class]" **/*.test.ts

**需要回答的问题:**
- 现有代码是如何处理此类问题的?
- 已确立的模式有哪些?
- 是否有我未注意到的工具函数?

Step 4: Research Online

步骤4:在线研究

Use web search for:
  1. Error messages - Exact error text
  2. Library documentation - Official docs
  3. Stack Overflow - Similar problems
  4. GitHub Issues - Known bugs
markdown
Search queries to try:
- "[exact error message]"
- "[library name] [problem description]"
- "[framework] [what you're trying to do]"
使用网页搜索以下内容:
  1. 错误信息 - 精确的错误文本
  2. 库文档 - 官方文档
  3. Stack Overflow - 类似问题
  4. GitHub Issues - 已知bug
markdown
可尝试的搜索关键词:
- "[精确错误信息]"
- "[库名称] [问题描述]"
- "[框架名称] [你要实现的功能]"

Step 5: Synthesize Findings

步骤5:整合研究结果

markdown
undefined
markdown
undefined

Research Findings

研究结果

From Repository Docs

从仓库文档中获得

  • [Finding 1]
  • [Finding 2]
  • [发现1]
  • [发现2]

From Codebase

从代码库中获得

  • [Pattern found]
  • [Example found]
  • 找到的模式
  • 找到的示例

From Online

从在线资源中获得

  • [Solution found]
  • [Workaround found]
  • 找到的解决方案
  • 找到的替代方案

New Approach

新尝试方法

Based on research, the new approach is:
  1. [Step 1]
  2. [Step 2]
  3. [Step 3]
undefined
基于研究结果,新的尝试方法是:
  1. [步骤1]
  2. [步骤2]
  3. [步骤3]
undefined

Step 6: Update Issue

步骤6:更新issue

Post research findings to the issue:
bash
gh issue comment [ISSUE_NUMBER] --body "## Research After Failed Attempts
将研究结果发布到issue中:
bash
gh issue comment [ISSUE_NUMBER] --body "## 失败尝试后的研究结果

What Was Tried

已尝试的方法

  1. [Attempt 1]
  2. [Attempt 2]
  1. [尝试1]
  2. [尝试2]

Research Findings

研究发现

[Summary of findings]
[研究结果摘要]

New Approach

新尝试方法

[How this will be solved now] "
undefined
[现在将如何解决此问题] "
undefined

Step 7: Resume with New Knowledge

步骤7:结合新认知继续尝试

Apply findings to the next attempt.
If third attempt also fails → Consider escalating to human.
将研究发现应用到下一次尝试中。
如果第三次尝试仍然失败 → 考虑向他人求助。

When to Escalate

何时求助

After research + third attempt, if still failing:
markdown
undefined
在完成研究+第三次尝试后,如果仍然失败:
markdown
undefined

Escalation: Need Human Input

升级求助:需要人工协助

Issue: #[NUMBER]
Attempted:
  1. [Approach 1] - [Result]
  2. [Approach 2] - [Result]
  3. [Approach 3 after research] - [Result]
Researched:
  • [Sources checked]
  • [Findings]
Current Understanding: [What we know now]
Blocking Question: [Specific question that needs human insight]

Mark issue as Blocked and await response.
Issue编号: #[NUMBER]
已尝试的方法:
  1. [方法1] - [结果]
  2. [方法2] - [结果]
  3. [研究后的方法3] - [结果]
已研究的资源:
  • [查阅的资源]
  • [研究发现]
当前认知: [目前已了解的信息]
阻塞问题: [需要人工解答的具体问题]

将issue标记为“阻塞”状态,等待回复。

Research Anti-Patterns

研究反模式

Anti-PatternCorrect Approach
Keep trying same thingStop and research
Research indefinitelyTime-box to 15-30 min
Ignore error messagesSearch exact error text
Skip local docsCheck README first
Guess at solutionsUnderstand problem first
反模式正确做法
重复尝试相同方法停止尝试并开展研究
无限期研究设定15-30分钟的时间限制
忽略错误信息搜索精确的错误文本
跳过本地文档先查看README
猜测解决方案先理解问题

What to Research First

研究优先级

Priority order:
  1. Error message - Often contains the answer
  2. Local documentation - Project-specific guidance
  3. Existing code - Established patterns
  4. Library docs - Official guidance
  5. Online search - Community solutions
优先顺序:
  1. 错误信息 - 通常包含答案
  2. 本地文档 - 项目专属指导
  3. 现有代码 - 已确立的模式
  4. 库文档 - 官方指导
  5. 在线搜索 - 社区解决方案

Time Boxing

时间限制

Research should be focused:
ResourceTime Limit
Local docs5 minutes
Codebase search10 minutes
Online search15 minutes
Total research30 minutes max
After 30 minutes without breakthrough → Escalate.
研究应聚焦:
资源时间限制
本地文档5分钟
代码库搜索10分钟
在线搜索15分钟
总研究时间最多30分钟
如果30分钟内没有突破 → 求助他人。

Checklist

检查清单

When triggered by 2 failures:
  • Document what failed and why
  • Check repository documentation
  • Search existing codebase
  • Search online resources
  • Synthesize findings
  • Update issue with research
  • Formulate new approach
  • If still failing, escalate
当连续两次失败触发此流程时:
  • 记录失败情况及原因
  • 查阅仓库文档
  • 搜索现有代码库
  • 搜索在线资源
  • 整合研究结果
  • 更新issue并附上研究内容
  • 制定新的尝试方法
  • 如果仍然失败,发起求助

Integration

集成

This skill is triggered by:
  • issue-driven-development
    - Step 8 (verification loop)
This skill calls:
  • issue-lifecycle
    - Post research findings
  • memory-integration
    - Store findings for future reference
此技能由以下内容触发:
  • issue-driven-development
    - 步骤8(验证循环)
此技能会调用:
  • issue-lifecycle
    - 发布研究结果
  • memory-integration
    - 存储研究结果以备未来参考