docs: codify subagent-mediated API / library / platform research workflow#397
Merged
H-Chris233 merged 1 commit intobetafrom May 10, 2026
Merged
Conversation
User-requested mechanism (/init args): when implementing against any external surface — third-party HTTP APIs, unfamiliar Rust crates / npm packages, or platform APIs (Apple Security framework / Win32 / Carbon / AppKit) — Claude must dispatch a dedicated subagent to fetch authoritative documentation rather than write integration code from training memory. The subagent acts as a network-search-and-retrieval layer that returns distilled, version-aware usage data so the main context stays uncluttered and the implementation always tracks the current upstream surface. Two surgical edits: 1. AGENTS.md §"Third-party service integrations" — heading widened to "Third-party service integrations & library / platform API research" so the existing 5-step research-first workflow explicitly covers library + platform APIs, not just HTTP service integrations. Rephrased the lead-in paragraph to enumerate the broader scope. 2. CLAUDE.md — new top-level section "调研先于编码:派子 agent 查 API / 库 / 平台文档" pointing back to AGENTS.md as the canonical rules and listing the concrete tooling Claude Code has available: Context7 MCP (resolve-library-id + query-docs), the documentation-lookup skill, and Agent dispatch with subagent_type=general-purpose. Specifies trigger conditions, non-trigger conditions (when grep is enough), the prompt fields every subagent dispatch must include, and the four canonical anti-patterns. No code changes; pure docs.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Collaborator
Author
|
该部分文档用于帮助项目内其他 AI 编程工作者进行 AI 编程的排布,以有效提升其他项目工作者的工作能力和计划执行力。 |
H-Chris233
approved these changes
May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Why
User-requested via `/init`:编码外部依赖时,Claude 必须先派子 agent 去查实时文档,不能基于训练记忆瞎写。机制要在 .md 里固化,否则下一会话会丢。
发现:origin/beta 的 AGENTS.md 实际没有这段(我读 local 看到的是脏未追踪状态),所以这个 PR 等于首次落地这条规则到 repo。
What
1. AGENTS.md +24 行
新增 `### Third-party service integrations & library / platform API research` 段,覆盖:
2. CLAUDE.md +52 行
Claude-specific 落地:
CLAUDE.md 段头明确 link 回 AGENTS.md,避免规则两边漂移。
Test plan
PR Type
Documentation
Description
Codify mandatory research-before-coding workflow in
AGENTS.mdDefine sub-agent dispatch guidelines and anti-patterns
Add Claude-specific tooling guidance and prompt structure in
CLAUDE.mdDiagram Walkthrough
File Walkthrough
AGENTS.md
Codify mandatory research workflow for external integrationsAGENTS.md
research
cross-verify, implement)
API versions, skipping error handling)
CLAUDE.md
Add Claude-specific tool guidance for research workflowCLAUDE.md
dispatch → direct WebFetch