AgentSkillsCN

doc-generator-output-templates

为文档页面生成提供输出模板与响应格式。定义JSON响应结构、元数据模式以及错误处理模板。当您需要生成文档页面并返回状态时,可选用此技能。

SKILL.md
--- frontmatter
name: doc-generator-output-templates
description: Output templates and response formats for documentation page generation. Defines JSON response structure, metadata schema, and error handling templates. Use when generating documentation pages and returning status.
user-invocable: false

Doc Generator Output Templates

Response formats and error templates for the deepwiki-doc-generator agent.

Response Structure

All responses follow this JSON structure:

json
{
  "status": "success | partial | failed",
  "page_path": "relative/path/to/page.md",
  "file_written": true,
  "file_location": "/absolute/path/to/wiki/relative/path/to/page.md",
  "file_size_bytes": 4521,
  "metadata": { ... },
  "warnings": [],
  "sections_generated": []
}

Status Values

StatusMeaningUse When
successAll operations completedFile written, all diagrams generated
partialCompleted with issuesSome diagrams failed, missing source files
failedCould not completeInvalid input, file write error

Success Response

json
{
  "status": "success",
  "page_path": "architecture/system-architecture.md",
  "file_written": true,
  "file_location": "/path/to/wiki/architecture/system-architecture.md",
  "file_size_bytes": 4521,
  "metadata": {
    "generated_at": "2026-01-22T10:30:00Z",
    "word_count": 1247,
    "section_count": 5,
    "code_blocks": 3,
    "diagrams_generated": 2,
    "diagrams": [
      {
        "type": "c4-context",
        "title": "System Context",
        "status": "generated",
        "lines": 12
      },
      {
        "type": "c4-container",
        "title": "Container Architecture",
        "status": "generated",
        "lines": 18
      }
    ],
    "external_links": 5,
    "internal_links": 8,
    "evidence_sources": [
      "app/main.py:1-50",
      "docker-compose.yml",
      "package.json"
    ]
  },
  "warnings": [],
  "sections_generated": [
    "System Context and Scope",
    "Architectural Layers",
    "Major Components",
    "Technology Stack Overview",
    "Key Design Decisions"
  ]
}

Metadata Schema

json
{
  "metadata": {
    "generated_at": "[ISO timestamp]",
    "word_count": "[number]",
    "section_count": "[number]",
    "code_blocks": "[number]",
    "diagrams_generated": "[number]",
    "diagrams": [
      {
        "type": "[diagram type]",
        "title": "[diagram title]",
        "status": "generated | failed | skipped",
        "lines": "[number of lines]"
      }
    ],
    "external_links": "[number]",
    "internal_links": "[number]",
    "evidence_sources": ["[file:line references]"]
  }
}

Field Descriptions

FieldTypeDescription
generated_atstringISO 8601 timestamp of generation
word_countnumberTotal words in generated content
section_countnumberNumber of sections written
code_blocksnumberNumber of code blocks included
diagrams_generatednumberSuccessfully generated diagrams
diagramsarrayDetails for each diagram
external_linksnumberLinks to external resources
internal_linksnumberCross-references to other wiki pages
evidence_sourcesarraySource files cited in content

Front Matter Template

All generated pages include YAML front matter:

yaml
---
title: [Page Title]
description: [Short description]
generated_at: [ISO timestamp]
commit: [commit hash if available]
last_updated: [timestamp]
word_count: [count]
diagrams: [count]
---

Error Responses

Invalid Input

Missing or invalid parameters:

json
{
  "status": "failed",
  "error": "Missing required parameter: 'page_path'",
  "code": "INVALID_INPUT"
}

File Write Error

Cannot write to destination:

json
{
  "status": "failed",
  "error": "Cannot write file: {path}",
  "code": "FILE_WRITE_ERROR"
}

Partial Success Responses

Diagram Generation Failure

Some diagrams could not be generated:

json
{
  "status": "partial",
  "page_path": "architecture/system-architecture.md",
  "file_written": true,
  "metadata": {
    "diagrams_generated": 1,
    "diagrams": [
      {
        "type": "c4-context",
        "title": "System Context",
        "status": "generated",
        "lines": 12
      },
      {
        "type": "c4-container",
        "title": "Container Architecture",
        "status": "failed",
        "error": "Insufficient component data"
      }
    ]
  },
  "warnings": [
    "Diagram generation failed for 'c4-container': Insufficient component data",
    "Proceeding without diagram"
  ]
}

Source Files Not Found

Expected source files missing:

json
{
  "status": "partial",
  "page_path": "architecture/system-architecture.md",
  "file_written": true,
  "warnings": [
    "Could not locate expected source files: [patterns]",
    "Proceeding with available evidence"
  ]
}

Error Codes

CodeMeaningResolution
INVALID_INPUTMissing/invalid parametersCheck required parameters
FILE_WRITE_ERRORCannot write to destinationCheck permissions and path
SITEMAP_NOT_FOUNDCannot read sitemapVerify sitemap_path
NO_EVIDENCENo source files foundCheck source_files patterns

Version: 1.0 Last Updated: 2026-01-22