跳到正文
Skillpedia
技术文档40k · #7174

doc-and-modernize

它能做什么

这个工具可以帮你理解并整理代码项目。它可以生成一份关于项目架构的详细文档,也可以制定项目的现代化改造计划。

适用场景

  • ✓刚加入一个新项目,需要快速了解它时。
  • ✓想要为现有项目的结构编写文档时。
  • ✓计划更新或重写一个老旧系统时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/doc-and-modernize/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/doc-and-modernize/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“为这个仓库编写架构文档,并告诉我如何对它进行现代化改造。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会在本地读取你的项目文件,理解其运行方式。然后,它会根据分析结果生成架构文档,或者生成现代化改造计划。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Documentation & Modernization

Two complementary workflows for a repository the user already has checked out locally, bundled as one skill:

  • Documentation mode — produce one definitive, cited architecture document from the code on disk. Ideal for onboarding, system-design maps, or as the evidence base for a modernization effort.
  • Modernization mode — turn that architecture into a phased, safety-laddered plan to upgrade, migrate, or rewrite a legacy system.

Mode selection

  • If the user wants to understand, document, map, research, or onboard onto a codebase, run Documentation mode.
  • If the user wants to modernize, migrate, upgrade, or rewrite a system, run Modernization mode. Modernization mode is self-sufficient: if no architecture document exists yet, it runs the Documentation mode workflow first (in the same pass), then continues straight through to the plan.

When in doubt, produce the architecture document first — it is the audited evidence base both modes rely on.

Documentation mode

Generate one definitive, cited architecture document for a repository the user already has checked out locally. The goal is a writeup someone could hand to a new engineer as their onboarding reference — broad enough to cover the whole system, deep enough on the hard parts to be useful, and trustworthy because every claim traces back to a file on disk.

Why local-first

Reading from the local checkout (not the GitHub API or the web) is the deliberate default. It is faster, free, avoids rate limits, and — most importantly — it describes the exact code in front of you rather than whatever main happens to look like remotely. The one tradeoff is that remote-only facts (star counts, full CI run history, sibling repos) aren't visible. That's fine: state those as out-of-scope or mark them [UNVERIFIED] rather than guessing.

Local-first is not local-never-remote: a web/API lookup is a deliberate last-resort fallback, reserved for a fact that genuinely cannot be determined from disk and that materially matters to the document. When you do reach for it, flag the result clearly (e.g. [UNVERIFIED] / sourced-remotely) so the reader knows it didn't come from the checkout, and never let it become the easy path that displaces reading the code on disk.

Workflow

  1. Establish identity first. Run git remote -v, git branch --show-current, and git log -1 so the document is anchored to a specific remote, branch, and commit. A reader must be able to tell which snapshot this describes. Remote URLs can contain embedded credentials (e.g. https://<token>@github.com/...) — redact any credentials/tokens from the URL before recording it in the document.
  2. Detect, don't assume. Read the real manifests (go.mod, package.json, Cargo.toml, pyproject.toml, pom.xml, etc.), the Makefile/task runner, CI config, and any repo-specific agent or contributor docs (AGENTS.md, CONTRIBUTING, README, docs/). These are the source of truth for the tech stack and commands — prefer them over your prior knowledge of the framework.
  3. Map breadth, then drill into depth. First build the whole-repo map (the three lenses below), then pick the 2-3 hardest subsystems and go deep on them.
  4. Verify as you go. Open the files you cite. If you reference a line number, you should have actually read that line. Unsupported claims are worse than omissions here — the whole value of this document is that it can be trusted.

Output structure

Produce a single Markdown file with the sections below, in this order. Adapt the headings to the actual project (a CLI tool has no "frontend" lens — fold that slot into whatever matters for that repo), but keep the three-lens shape and the verification discipline.

Part 1 — Whole-repo technical deep-dive

  • What the repository is (one paragraph, cited to README).
  • Tech-stack detection table: layer | technology | evidence (file+line).
  • Entry points (backend, frontend, CLI — whatever applies).
  • Commands & Verification Inventory — a table of the canonical project commands (command | purpose | evidence), verified against the task runner / manifests / CI config, not guessed. Cover build, run/serve, test (and how to run a single test), lint, format, and — where they exist — typecheck, end-to-end/smoke, contract, and any other gate commands, plus the CI

…

常见问题

为什么工具要在本地读取文件?

本地读取速度更快,没有使用次数限制,而且能确保文档准确反映你手中的代码,而不是某个线上版本。

如果工具需要的信息不在本地代码中,会怎样?

它可以作为最后的手段去线上获取信息,但每次这样做都会明确告知你,让你知道信息的来源。

文档模式和现代化模式有什么区别?

文档模式会生成一份详细的项目“地图”。现代化模式则基于这份地图,制定一份分步的系统更新计划。

详情

作者的原始描述

Two related workflows for a locally-cloned codebase, in one skill. Documentation mode produces a single, comprehensive, verifiable architecture document primarily by reading files on disk (local-first) — use it whenever the user wants to understand, map, document, research, or onboard onto a codebase ("research this repo", "write up the architecture", "do an architecture deep dive", "document how

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7174
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能