AgentSkillsCN

update-docs

根据自上次推送以来的代码变更,更新相关文档。当用户希望更新、同步或刷新文档,使其与各软件包中的最新代码变更保持一致时使用。

SKILL.md
--- frontmatter
name: update-docs
description: Update documentation based on code changes since last push. Use when the user wants to update, sync, or refresh documentation to match recent code changes across packages.

Update Documentation

Analyze code changes since last push and update documentation for affected packages.

Steps

1. Get Changed Files Since Last Push

bash
git diff --name-only @{push}...HEAD

If @{push} doesn't exist (never pushed), compare with main:

bash
git diff --name-only origin/main...HEAD

2. Identify Affected Packages

From the changed files list:

  • Filter to files matching packages/*/src/**
  • Extract unique package names (e.g., text2sql, agent, toolbox)
  • Skip packages without existing docs in apps/docs/app/docs/

3. For EACH Affected Package, Spawn a doc-updater Sub-Agent IN PARALLEL

Use the Task tool with subagent_type: "doc-updater" for each package:

code
Task({
  subagent_type: "doc-updater",
  prompt: "Update documentation for package: [package-name]

           Changed files in this package:
           - path/to/file1.ts
           - path/to/file2.ts

           Documentation location: apps/docs/app/docs/[package-name]/

           Analyze the changes and update corresponding documentation."
})

4. Summarize Updates

After all sub-agents complete, provide a summary:

  • Which packages were updated
  • What documentation changes were made
  • Any new pages created or pages that need attention

Change Detection Rules

Change TypeDocumentation Impact
src/index.ts exports changedCheck if public API docs need update
New file in src/lib/**/*.tsMay need new documentation page
Modified file in src/lib/**/*.tsUpdate related docs
Deleted fileRemove or deprecate related docs
New adapter/agent/featureCreate new documentation page

Writing Style

Read prose.md for documentation writing conventions (frontmatter, headings, Fumadocs components, code blocks, content patterns).