agent-oss-contribute
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent 开源贡献全流程
Agent Open Source Contribution Full Workflow
面向 Agent / LLM / MCP 类开源仓库的一条流水线,六个阶段。用户没点名时,从当前对话能判断走到哪一步,就只做那一步;不要搜完项目自动改代码,也不要没方案就提 PR,也不要提完 PR 自动写总结。
回复语言跟随用户;用户未指定时默认中文。技术专有名词保留英文。只输出当前阶段规定的结构。
A six-phase pipeline for Agent / LLM / MCP open-source repositories. When the user doesn't specify a phase, infer it from the current conversation and run only that phase; don't search a project and auto-edit code, don't open a PR without a plan, and don't auto-write a summary after a PR.
Response language follows the user; default to Chinese if not specified. Keep technical terms in English. Output only the structure required for the current phase.
阶段路由
Phase Routing
| 用户在做什么 | 进入 | 先读 |
|---|---|---|
搜可贡献项目 / 找开源仓库 / 没给 | 阶段 0 发现 | references/discover.md |
给了 | 阶段 1 分析 | references/analysis.md 和 references/architecture-dimensions.md |
| 从 Top 3 里选定一条 / 要技术方案 / 问题边界 / 实现步骤 | 阶段 2 方案 | references/design.md |
| 粘贴了选定方案并要落地 / 技术方案实现 / 先定义接口 | 阶段 3 落地 | references/implementation.md |
| 提交 PR / 开 PR / 按 feat/fix 发 PR | 阶段 4 提 PR | references/pull-request.md |
| 产出 PR 总结 / 已提 PR 复盘 / 给了 PR 地址或之前提过的项目 | 阶段 5 总结 | references/summary.md |
一次只跑一个阶段,跑完停下来等用户。用户明确说「一次做完」时:无 先阶段 0 并停下让用户选仓库;有 才从阶段 1 往后走,且阶段 2 的方案仍要先给用户看过。阶段 5 不随「一次做完」自动跑,除非用户同时要求总结。
REPO_URLREPO_URL缺关键输入就问,不要用虚构仓库或虚构方案硬跑。
| What the user is doing | Enter | Read first |
|---|---|---|
Searching for contributable projects / looking for open-source repos / no | Phase 0 Discovery | references/discover.md |
Provided | Phase 1 Analysis | references/analysis.md and references/architecture-dimensions.md |
| Picked one from Top 3 / wants technical plan / problem scope / implementation steps | Phase 2 Design | references/design.md |
| Pasted the selected plan and wants implementation / technical solution implementation / define interfaces first | Phase 3 Implementation | references/implementation.md |
| Submitting PR / open PR / sending PR with feat/fix | Phase 4 Pull Request | references/pull-request.md |
| Producing PR summary / reviewing submitted PR / given PR URL or previously mentioned project | Phase 5 Summary | references/summary.md |
Run only one phase at a time, then stop and wait for the user. When the user explicitly says "do it all in one go": without , run Phase 0 first and stop for the user to pick a repo; with , proceed from Phase 1 onward, and the Phase 2 plan must still be reviewed by the user first. Phase 5 is not auto-run with "do it all in one go" unless the user also asks for a summary.
REPO_URLREPO_URLAsk for missing key inputs; don't force-run with fabricated repos or plans.
共用输入
Shared Inputs
| 字段 | 说明 |
|---|---|
| GitHub 仓库 URL;阶段 0 不需要 |
| GitHub PR URL( |
| 本地仓库根;缺省用当前任务工作目录(本仓库 evals 未指定时 clone 到仓库根 |
| 中间产物根目录;缺省为 |
| 技术栈 | 未给则用:Python、TypeScript、React、MCP 集成、LangChain.js |
| 目标周期 | 未给则用:2 周 |
当前任务工作目录:本阶段开始时进程的工作目录(cwd / workspace root)。不绑定任何特定编辑器或 Agent 产品;用户显式给出 时以用户为准。
ARTIFACT_ROOT本仓库跑 skill 测试 / 时:工作目录、fixture、以及未给出 时的 clone 目标,均为技能集合仓库根下的 (已 gitignore,不要提交其中内容)。日常使用仍以用户 cwd / / 为准。
evals/LOCAL_PATHtest/LOCAL_PATHARTIFACT_ROOT阶段 1–4 工作目录必须是目标仓库。阶段 3、4 禁止改别的 repo。阶段 5 不要求切到目标仓库,且禁止改任何仓库代码。
| Field | Description |
|---|---|
| GitHub repo URL; not needed for Phase 0 |
| GitHub PR URL ( |
| Local repo root; default is the current task working directory (in this repo's evals, clone to repo root |
| Artifact root directory; default is |
| Tech stack | If not given, use: Python, TypeScript, React, MCP integration, LangChain.js |
| Target cycle | If not given, use: 2 weeks |
Current task working directory: the process working directory at the start of this phase (cwd / workspace root). Not tied to any specific editor or Agent product; if the user explicitly provides , use theirs.
ARTIFACT_ROOTWhen running skill tests / in this repo: the working directory, fixtures, and clone target when is not given are all under in the skill collection repo root (gitignored, don't commit its contents). Daily use follows user's cwd / / .
evals/LOCAL_PATHtest/LOCAL_PATHARTIFACT_ROOTPhases 1–4 must run in the target repo working directory. Phases 3 and 4 must not modify other repos. Phase 5 doesn't require switching to the target repo and must not modify any repo code.
中间产物落盘
Artifact Persistence
每个阶段在回复用户的同时,必须把该阶段完整输出写入 (默认 ;本仓库 evals 时为 )。聊天输出与落盘内容一致;先写文件再结束本阶段。路径一律相对 书写与落盘;回复用户时可附绝对路径方便打开。
ARTIFACT_ROOT<当前任务工作目录>/artifacts<仓库根>/test/artifactsARTIFACT_ROOT| 阶段 | 相对 | 规则 |
|---|---|---|
| 0 发现 | | 每次搜索新建一个文件,文件名用执行时刻本地时间 |
| 1 分析 | | 项目目录不存在则创建;已有则覆盖 |
| 2 方案 | | 同上 |
| 3 落地 | | 同上(改动摘要 + 提交计划 + 验证结果) |
| 4 提 PR | | 同上(标题、正文草稿、最终 PR URL) |
| 5 总结 | | 项目目录不存在则创建;同一 PR 再跑则覆盖 |
- 取自
<owner>-<repo>(如REPO_URL→https://github.com/langchain-ai/langchainjs)。langchain-ai-langchainjs - 规则见 references/summary.md(优先
<pr名>)。{number}-{slug} - 阶段 1–4 的产物只写在对应 目录下,不要写到别的项目文件夹。
project/ - 阶段 0 只写 ,不要在
search/下建目录。project/ - 阶段 5 只写 ,不要覆盖
summary/里的中间产物。project/ - 禁止写死某台机器的绝对路径(如 );禁止写死某产品专用目录。
/Users/... - 落盘失败(权限/路径不存在)时:先建缺的目录再写;仍失败则把错误告诉用户,不要假装已保存。
Each phase, while replying to the user, must write the full output of this phase to (default ; in this repo's evals ). Chat output and saved content must match; write the file before ending the phase. All paths are written and saved relative to ; you may include absolute paths in replies for convenience.
ARTIFACT_ROOT<current task working directory>/artifacts<repo root>/test/artifactsARTIFACT_ROOT| Phase | Path relative to | Rule |
|---|---|---|
| 0 Discovery | | Create a new file per search; filename uses local time at execution |
| 1 Analysis | | Create project directory if missing; overwrite if exists |
| 2 Design | | Same as above |
| 3 Implementation | | Same (change summary + commit plan + verification results) |
| 4 Pull Request | | Same (title, draft body, final PR URL) |
| 5 Summary | | Create project directory if missing; overwrite if same PR rerun |
- is derived from
<owner>-<repo>(e.g.REPO_URL→https://github.com/langchain-ai/langchainjs).langchain-ai-langchainjs - rules see references/summary.md (prefer
<pr-name>).{number}-{slug} - Artifacts for Phases 1–4 are written only in the corresponding directory, not in other project folders.
project/ - Phase 0 writes only to , don't create directories under
search/.project/ - Phase 5 writes only to , don't overwrite intermediate artifacts in
summary/.project/ - Don't hardcode machine-specific absolute paths (e.g. ); don't hardcode product-specific directories.
/Users/... - If persistence fails (permission/path missing): create missing directories first then write; if it still fails, tell the user the error, don't pretend it was saved.
阶段门闩
Phase Gates
- 0 → 1:用户从发现结果里选了一个仓库(或自己给了 )。
REPO_URL - 1 → 2:用户点了分析 Top 3 中的一条,或自己给出等价方向。
- 2 → 3:方案里的选定方案、问题边界、成功标准、文件清单、实现步骤已经齐,且用户确认可以落地。
- 3 → 4:代码已按方案落地并验证过;用户明确说提交 / 开 PR。未要求时不要 /
git commit/push。gh pr create - 4 → 5:用户明确要总结,或给出已提 PR 的项目 / 。阶段 4 结束后不要自动写 summary。阶段 5 可从新会话直接进入,不要求本会话跑过 0–4。
PR_URL
- 0 → 1: The user selected a repo from discovery results (or provided their own ).
REPO_URL - 1 → 2: The user picked one from the analysis Top 3, or gave an equivalent direction.
- 2 → 3: The selected plan, problem scope, success criteria, file list, and implementation steps are complete, and the user confirmed implementation.
- 3 → 4: Code has been implemented and verified according to the plan; the user explicitly says commit / open PR. Don't /
git commit/pushunless asked.gh pr create - 4 → 5: The user explicitly asks for a summary, or provides the submitted PR project / . Don't auto-write a summary after Phase 4. Phase 5 can be entered directly from a new session; it doesn't require Phases 0–4 in the same session.
PR_URL
硬约束
Hard Constraints
- 阶段 0 必须跑 ,禁止用记忆编造仓库榜;必须传
scripts/discover_repos.py与--artifact-root;用户口头过滤条件必须译成脚本参数。项目描述必须用用户语言,覆盖做什么 / 解决的问题 / 适用场景;下载量、使用分、排名以脚本为准,禁止改排名或编造用量。--user-language - 每阶段结束必须落盘(见「中间产物落盘」),禁止只回复不写文件。
- 先读该仓库的真实文件和 Issue,再用训练记忆。路径用仓库内相对路径。
- 贡献范围必须能在约 2 周内完成,禁止「重写编排层」这类方向。
- 阶段 3、4:最小侵入、向后兼容、风格与仓库一致;新第三方依赖必须先问用户。阶段 5 不改代码。
- 阶段 4 的 commit type 只用:/
feat/fix/refactor/test。docs - 阶段 4 的 PR body:禁止自造 checklist / ,禁止追加任何 AI/编辑器署名 footer。
Test plan - 阶段 5:star 数、PR 正文、中间产物必须来自 或
gh已存文件;禁止编造分析来源与仓库数据。ARTIFACT_ROOT
- Phase 0 must run , and is forbidden from fabricating repo rankings from memory; must pass
scripts/discover_repos.pyand--artifact-root; user verbal filters must be translated into script parameters. Project descriptions must be in the user's language, covering what it does / problems solved / applicable scenarios; downloads, usage scores, and rankings come from the script, and rankings or usage must not be fabricated.--user-language - Each phase must persist artifacts (see "Artifact Persistence"); no replies without writing files.
- Read the repo's real files and Issues first, then use training memory. Use repo-relative paths.
- Contribution scope must be completable in about 2 weeks; directions like "rewrite the orchestration layer" are forbidden.
- Phases 3, 4: minimal intrusion, backward compatible, consistent with repo style; new third-party dependencies must be asked first. Phase 5 doesn't change code.
- Phase 4 commit types only: /
feat/fix/refactor/test.docs - Phase 4 PR body: forbidden to fabricate checklist / , forbidden to append any AI/editor attribution footer.
Test plan - Phase 5: star counts, PR body, and artifacts must come from or files already stored in
gh; don't fabricate analysis sources or repo data.ARTIFACT_ROOT