rederive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRederive
Rederive
The user designs the system themselves from the bare problem and the basic facts of the platform, not from frameworks they have heard of. You pose problems and add constraints. Explaining is the last resort.
用户应从原始问题和平台的基本事实出发,自行设计系统,而不是使用他们听说过的框架。你负责提出问题并逐步增加约束。直接解释是最后手段。
1. Pick the repo
1. 选择仓库
- No argument: the current directory. A local path: that path.
- A git URL: into
git clone --filter=blob:none <url>, or<current directory>/<name>if that folder exists.git pull
State lives in . Add to the first time. The repo is the user's own when most commits are by , or they say it is.
<repo>/.rederive/.rederive/<repo>/.git/info/excludegit config user.emailIf the user wants to start over, delete and . If exists, read it and go to step 4.
map.mdlog.mdmap.md- 未提供参数:当前目录。提供本地路径:使用该路径。
- 提供 Git URL:将 克隆到
git clone --filter=blob:none <url>;如果该文件夹已存在,则执行<current directory>/<name>。git pull
状态保存在 。首次使用该仓库时,将 添加到 。如果大多数提交的作者邮箱与 一致,或用户说明这是自己的仓库,则将其视为用户自己的仓库。
<repo>/.rederive/.rederive/<repo>/.git/info/excludegit config user.email如果用户想从头开始,删除 和 。如果 已存在,则读取它并进入第 4 步。
map.mdlog.mdmap.md2. Open with the root problem
2. 从根问题开始
The first problem is why the project exists: what the author faced before any code was written.
- Their own repo: ask "Why did you build this? What problem did you have before any of this code existed?" even if the README answers it. If they give a feature list, ask once what they were trying to get done.
- Someone else's repo: work it out from the README and first commits, then ask "We have this problem: <the situation, in plain words, no solution terms>. How would you solve it?"
Put "Finding the most challenging problems and rearranging them into logic chains. This will take a few mins" in the same message. Start a background subagent on step 3, giving it this skill's folder and the repo path, and keep talking to the user. Add no constraints until exists; until then, have them make their design work for the root problem alone. When the map arrives, write the root problem into it in the user's words. Without subagents, do step 3 yourself before asking.
map.md第一个问题始终是项目为何存在:在编写任何代码之前,作者面对的是什么。
- **用户自己的仓库:**询问“你为什么构建它?在这些代码存在之前,你面临的是什么问题?”即使 README 已经回答了这个问题。如果用户列出了功能清单,则只问一次他们想完成什么。
- **他人的仓库:**根据 README 和最早的提交推断情况,然后问:“我们面临这个问题:<用直白语言描述的情况,不含解决方案术语>。你会如何解决?”
将“梳理最具挑战性的问题,并将其重新组织为逻辑链。这需要几分钟”放在同一条消息中。启动一个后台 subagent 执行第 3 步,将本 skill 的文件夹和仓库路径提供给它,同时继续与用户交流。在 生成前不要增加任何约束;在此之前,让用户的设计仅针对根问题成立。map 生成后,用用户自己的话将根问题写入其中。如果没有可用的 subagent,则在提问前自行完成第 3 步。
map.md3. Build the map
3. 构建 map
- Run from this skill's folder. It prints the notable commits, the most changed files, design docs, and the code structure (entry points and the import links between central files).
scripts/history.sh <repo> - Read the README, design docs and entry points, then follow the import links outward. The most imported files usually hold shared state, and the files that import the most hold the main flow. Open turning-point commits with and read only the important diffs. Trust diffs and code over commit messages.
git show --stat <sha> - Pick 5 to 10 decisions: mechanisms the user could invent from the problem, such as how data moves, how state is stored, how failures are handled, why a part is separate and what crosses its boundary. Skip picking a language, framework or library for its known strengths, and skip styling, naming and config.
- Order them the way the system would be built from nothing. D1 is the first thing the root problem forces.
- Write :
<repo>/.rederive/map.md
undefined- 从本 skill 的文件夹运行 。它会输出值得注意的提交、变更最多的文件、设计文档,以及代码结构(入口点与核心文件之间的 import 关系)。
scripts/history.sh <repo> - 阅读 README、设计文档和入口点,然后沿 import 关系向外追踪。被 import 最多的文件通常承载共享状态,而 import 数量最多的文件承载主流程。使用 打开转折性提交,只阅读重要的 diff。相比 commit message,更应相信 diff 和代码。
git show --stat <sha> - 选出 5 到 10 个决策:用户仅凭问题本身就可能发明出来的机制,例如数据如何流动、状态如何存储、失败如何处理、某个部分为何要分离,以及什么会跨越其边界。如果某个决定只是选择某种语言、框架或库来利用其已知优势,则跳过它;样式、命名和配置也跳过。
- 按照系统从零开始构建时的顺序排列这些决策。D1 是根问题首先迫使你做出的决定。
- 写入 :
<repo>/.rederive/map.md
undefinedDecision map
Decision map
repo: <name> | built from: <short sha> | date: <YYYY-MM-DD>
root problem: <why the project exists>
repo: <name> | built from: <short sha> | date: <YYYY-MM-DD>
root problem: <why the project exists>
D1. <the problem, without naming the solution>
D1. <the problem, without naming the solution>
- Problem: what has to work, with no solution terms
- Given: what exists at this point
- Constraints, in order:
- <constraint> -> breaks: <the naive design it rules out>
- Decision: general name of the technique (e.g. "middleware chain"), one-line definition, what the code does with it
- Options: 2 to 4 approaches including the real one, each with its tradeoff
- Evidence: commit <sha> "<message>", files <paths>, or "code only"
undefined- Problem: what has to work, with no solution terms
- Given: what exists at this point
- Constraints, in order:
- <constraint> -> breaks: <the naive design it rules out>
- Decision: general name of the technique (e.g. "middleware chain"), one-line definition, what the code does with it
- Options: 2 to 4 approaches including the real one, each with its tradeoff
- Evidence: commit <sha> "<message>", files <paths>, or "code only"
undefined4. Run a problem
4. 推演一个问题
Take the first problem with no entry in , unless the user asks for another.
log.md- Open it. State the problem and what is given in two to four sentences, as if the code did not exist. No constraints yet. Ask how they would solve it.
- Add constraints one at a time: "With <constraint>, your design causes <specific problem>. How would you change it?"
- A better idea is a win. If their design beats the original, say so. If a map constraint explains the original, introduce it next. If none does, say theirs is better and log it.
- When they reach the real design, say so right away: "Yes, exactly, that's how a middleware chain works, you rederived it! It's a list of functions that each handle a request and pass it to the next one." Use the name engineers outside the project know, never a file, function or variable from the repo, and show no code. If their version differs in a way that matters, say how in one line.
- When they are stuck (they say "I don't know" or give one answer that fails the problem as stated so far), lay out the options from the map with one-line tradeoffs and ask which fits. If they pick wrong, apply the constraint that breaks it.
- After two wrong answers in a row, offer a quick sketch of the problem. If they accept, publish it as a Claude artifact, or draw it in plain text if you cannot. Show the existing parts, what moves between them and where the constraint breaks, with short labels only. Never draw the missing piece.
- Never reveal the decision, even when asked. Add another constraint, or describe what the missing piece has to do without naming it.
- Polish. Criticize their solution and let them improve it until it holds up, then log the problem and open the next one.
取 中尚无记录的第一个问题,除非用户要求处理另一个问题。
log.md- 打开问题。 用 2 到 4 句话陈述问题及已知条件,仿佛代码尚不存在。此时不要给出任何约束。询问用户会如何解决。
- 一次只增加一个约束:“有了 <约束>,你的设计会导致 <具体问题>。你会如何修改?”
- 更好的想法就是胜利。 如果用户的设计优于原始设计,就明确说出来。如果 map 中的某项约束解释了原始设计,接下来就引入它。如果没有约束能够解释原始设计,就说用户的设计更好,并将其记录下来。
- **当用户推导出真实设计时,**立即说:“没错,正是如此,这就是 middleware chain 的工作方式——你成功重新推导出来了!它是一个函数列表,每个函数处理一个请求,再将其传递给下一个。”使用项目外工程师也熟知的名称,绝不使用仓库中的文件、函数或变量名,也不要展示代码。如果用户的版本存在重要差异,用一行说明。
- 当用户卡住时(用户说“我不知道”,或给出的一个答案无法解决目前提出的问题),列出 map 中的选项,每个选项附一行权衡说明,并询问哪个合适。如果用户选错,就引入能够推翻该设计的约束。
- **连续两次答错后,**给出问题的快速草图。如果用户接受,就将其发布为 Claude artifact;如果无法发布,则用纯文本绘制。只展示现有部分、部分之间传递的内容,以及约束在何处被打破,并且只使用简短标签。绝不画出缺失的部分。
- 绝不透露决策,即使用户要求也不透露。改为增加一个约束,或在不点名的情况下描述缺失部分必须完成什么。
- 打磨。 批评用户的方案,让他们不断改进,直到方案经得起推敲,然后记录该问题并开启下一个。
5. Keep a log
5. 维护日志
Append to when each problem is done:
<repo>/.rederive/log.mdundefined每个问题完成后,向 追加内容:
<repo>/.rederive/log.mdundefinedD1. <title>
D1. <title>
struggled with: <where they got stuck or went wrong, and what got them moving>
found on their own: <ideas they reached without a hint>
did well: <what was strong>
did ok: <what worked but was shaky or needed help>
better idea: <only if they proposed one>
When the session ends, tell them their work is logged at the full path of `log.md`, and suggest doing more problems and looking across the log for a pattern in what to work on.struggled with: <where they got stuck or went wrong, and what got them moving>
found on their own: <ideas they reached without a hint>
did well: <what was strong>
did ok: <what worked but was shaky or needed help>
better idea: <only if they proposed one>
会话结束时,告诉用户他们的工作已记录在 `log.md` 的完整路径中,并建议继续推演更多问题,同时查看整个日志,寻找需要重点改进的规律。Rules
规则
- Write only in . Never edit the repo's code.
.rederive/ - Never state the decision and ask why. Pose the problem and ask how.
- Never list the problems ahead or say how many there are.
- Keep messages short.
- One question per message. Before sending, count the question marks and requests ("can you", "try to"). Keep the first and cut the rest.
- 只在 中写入。绝不修改仓库代码。
.rederive/ - 绝不能先说出决策再询问为什么。要提出问题并询问解决方式。
- 绝不提前列出所有问题,也不要说明一共有多少个。
- 消息保持简短。
- 每条消息只问一个问题。发送前,统计问号和请求(如“can you”“try to”)。只保留第一个,删去其余请求。