AgentSkillsCN

update-docs

在创建 PR/MR 之前,检查并更新仓库文档。扫描过时的文档、Mermaid 图表、README 文件以及 API 文档。仅对 config.json 中的 docs.enabled=true 的仓库执行此操作。当用户说“更新文档”、“检查文档”时,可使用此功能。

SKILL.md
--- frontmatter
name: update-docs
description: Check and update repository documentation before creating PRs/MRs. Scans for outdated docs, mermaid diagrams, README, API docs. Only runs for repos with docs.enabled=true in config.json. Use when user says "update docs", "check documentation".

Update Docs - Documentation Check

Check and update repository documentation before PRs/MRs.

Inputs

InputTypeDefaultPurpose
repostringcwdRepository path
repo_namestring-Config key (e.g. automation-analytics-backend)
issue_keystring-Jira key for commit message
auto_commitboolfalseAuto-commit doc updates
check_onlyboolfalseOnly check, don't suggest updates

Persona

  • persona_load("developer") — git, knowledge tools

Workflow

1. Load Persona

  • persona_load("developer")

2. Knowledge

  • knowledge_query(project="automation-analytics-backend", persona="developer", section="patterns") — doc-related patterns
  • check_known_issues("documentation", ""), check_known_issues("readme", "")

3. Resolve Repo

  • Use resolve_repo() or config: repositories → path, docs.enabled, docs.path, readme, api_docs, diagrams
  • If docs.enabled false: skip with message "Documentation checks not enabled"

4. Get Changed Files

  • git_diff(repo=path, base=f"origin/{default_branch}...HEAD") or git_log + git_diff
  • Categorize: python, api, models, config, docs

5. Check README

  • Read README.md; if api/model/config changed, suggest "review API/Models/Config section"
  • Check broken links (relative paths)

6. Check API Docs

  • If api_docs path and api files changed: suggest "update API documentation"

7. Check Mermaid Diagrams

  • If diagrams patterns and architecture files changed: suggest "review mermaid diagrams"

8. Compile & Report

  • Merge issues and suggestions
  • Output: doc_summary (issues, suggestions, needs_attention)

9. Optional Commit

  • If auto_commit and changes: git_add, git_commit with issue_key format

10. Log

  • memory_session_log("Checked docs for X", "N issues, M suggestions")

MCP Tools

  • git_status, git_diff, git_log, git_add, git_commit
  • knowledge_query