快速判断 PR 变更对文档的影响级别,决定是否需要更新或重构文档。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "docs-impact-classifier" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/apm/main/.agents/skills/docs-impact-classifier/SKILL.md 2. 保存为 ~/.claude/skills/docs-impact-classifier/SKILL.md 3. 装好后重载技能,告诉我可以用了
请根据这个 PR diff 判断文档影响级别,只返回 no-change、in-place edit 或 structural change 之一,并简述理由。仅参考 .apm/docs-index.yml 映射,不要读取完整文档语料。
返回文档影响结论及简短依据,帮助决定是否进入后续文档流程。
作为 docs-sync 的前置步骤,先分析此 PR diff 的文档影响。如果无需文档工作,返回 no-change;否则标记为 in-place edit 或 structural change,并给出触发依据。
给出可供编排器使用的分类结果,避免不必要的文档分析开销。
分析下面的接口相关 PR diff,判断它对文档的影响是无变化、原地编辑还是结构性变化。重点结合 docs-index 中的文档映射关系说明原因。
明确指出接口变更对应的文档影响级别,并说明是否可能涉及文档结构调整。
Single responsibility: given a PR diff and the .apm/docs-index.yml
corpus map, emit ONE classification verdict.
This skill is the cost gate for the entire docs-sync system. ~70% of
PRs should exit at verdict no_change with zero panel spawn.
This is a 3-layer funnel inside a single skill invocation:
The skill returns the verdict from the earliest layer that can decide.
Read .apm/docs-index.yml to load no_impact_paths[] and
user_surface_paths[]. Get the changed file list from the PR diff
(gh pr diff --name-only).
if every changed file matches no_impact_paths AND none match user_surface_paths:
return {verdict: "no_change", confidence: "high", source: "L0", scope_pages: []}
This handles:
tests/**.github/workflows/**)docs/**) -- out of scope, docs-sync doesn't review docs PRs.apm/**)Expected hit rate: ~70% of PRs short-circuit here.
If L0 did not exit, extract user-observable symbols from the diff:
^@click.command, ^@cli.command, or any apm <verb> mention in added/removed lines.^@click.option, --[a-z-]+ patterns.def <name> in src/apm_cli/__init__.py or src/apm_cli/api/**.apm.yml, apm.lock.yaml, apm-policy.yml parsers._rich_error, click.echo, raise ... Error().For each extracted symbol, consult .apm/docs-index.yml#symbol_index
to find the documented pages. Collect all hits into candidate_pages[].
Also grep -rn <symbol> docs/src/content/docs/ for symbols NOT in
the index (catches drift between index and corpus).
If L1 found zero candidate pages AND zero schema/CLI/flag changes:
return {verdict: "no_change", confidence: "medium", source: "L1", scope_pages: []}.
Otherwise, invoke the doc-analyser persona with EXACTLY this context envelope (must fit in ~8 KB tokens):
gh pr diff --stat output).apm/docs-index.yml (the whole file; it's ~8 KB seeded, may grow)pr_doc_diff_paths[]: the list of paths under docs/src/content/docs/**
that the PR itself already modifies (drives the in_place_resolved
downgrade rule in "In-place-resolved detection" below).Ask doc-analyser to return JSON matching this schema:
{
"verdict": "no_change" | "in_place_resolved" | "in_place" | "structural",
"confidence": "low" | "medium" | "high",
"scope_pages": ["docs/src/content/docs/..."],
"structural_proposal": {
"new_pages": [{"slug": "...", "rationale": "..."}],
"moved_pages": [{"from": "...", "to": "..."}],
"toc_changes": "<one-paragraph>"
},
"reasoning": "<one-paragraph: what surface changed, what docs are affected, why this verdict>"
}
structural_proposal is populated only when verdict is structural.
scope_pages is populated for in_place and structural verdicts.
| Verdict | Meaning | Panel size | Cost |
|---|---|---|---|
no_change | No user-observable surface changed | 0 panel spawns | ~0-1 LLM call |
…
优化 APM 代码库中的 CLI 输出、日志提示与诊断信息体验
在文档结构需随 PR 调整时,规划目录变更并生成新页面大纲草案。