AgentSkillsCN

build-check

在部署前,运行 Docusaurus 构建、类型检查与代码风格检查,以全面验证站点的完整性与正确性。

SKILL.md
--- frontmatter
name: build-check
description: Run Docusaurus build, type checking, and linting to validate the site before deployment
disable-model-invocation: true
allowed-tools: Bash, Read, Grep, Glob
model: haiku

Build Check

Run a full validation of the Docusaurus site.

Steps

  1. Clear cache first to ensure clean build:

    bash
    npm run clear
    
  2. Run TypeScript type checking:

    bash
    npm run typecheck
    
  3. Run production build:

    bash
    npm run build
    
  4. Report results: Summarize any errors, warnings, or broken links found during the build process.

Common Issues to Watch For

  • Broken links (Docusaurus throws on broken links with onBrokenLinks: "throw")
  • MDX compilation errors (invalid JSX, unclosed tags)
  • Missing imports in MDX files
  • Image references to non-existent files
  • TypeScript type errors in custom components

Output Format

Report results as:

  • Total build time
  • Number of pages generated
  • Any warnings or errors found
  • Broken links if any
  • Suggested fixes for any issues