Comprehensive guide to the MCP Confluence ADF template system for automated documentation generation.
Overview
The template system provides a structured approach to generating consistent, high-quality documentation using YAML-based templates that are processed by Claude AI to create rich Confluence content.
graph LR A[YAML Template] --> B[Template Engine] B --> C[Claude Processing] C --> D[Markdown Output] D --> E[ADF Conversion] E --> F[Confluence Page] style A fill:#e1f5fe style C fill:#f3e5f5 style F fill:#e8f5e8
Template Architecture
Two-Phase Processing
The system uses a two-phase approach:
Phase 1: YAML to Intermediate Template
Parse YAML structure and metadata
Generate intermediate Markdown with Claude instructions
Validate template structure and requirements
Phase 2: Claude Processing to Final Content
Claude processes instruction comments
Generates contextual content based on user input
Maintains ADF-compatible formatting
Template Components
YAML Frontmatter
User Context Requirements
Structure Definition
Template Types and Use Cases
1. API Documentation Templates
Purpose: Document REST APIs, GraphQL APIs, and service interfaces
---
name: "API Documentation"
description: "Complete API documentation with endpoints and examples"
version: "1.0.0"
category: "developer-resources"
sections: ["authentication", "endpoints", "examples"]
output_type: "confluence_page"
---
user_context_required:
service_name: "What is the name of your service?"
base_url: "What is the API base URL?"
version: "What version are you documenting?"
structure:
- "# ${service_name} API Documentation"
- type: "info_panel"
title: "API Overview"
content: "<!-- CLAUDE INSTRUCTION: Provide API overview -->"
- "## Authentication"
- type: "code_block"
language: "bash"
content: "curl -H 'Authorization: Bearer TOKEN' ${base_url}"
- What type of content needs to be generated?
- Who is the target audience?
- What information will vary between uses?
- What structure should be consistent?
---
name: "Your Template Name"
description: "Clear description of purpose"
version: "1.0.0"
category: "appropriate-category"
sections: ["list", "of", "sections"]
---
user_context_required:
key1: "What information is needed?"
key2: "Another required input?"
structure:
- "# Title with ${key1}"
- type: "info_panel"
title: "Important Information"
content: "<!-- CLAUDE INSTRUCTION: Generate relevant content -->"
<!-- CLAUDE INSTRUCTION: REPLACE THIS COMMENT WITH CONTENT -->
<!-- TASK: Explain the authentication process -->
<!-- PURPOSE: Help developers integrate with the API -->
<!-- CONTEXT: service_name=${service_name}, auth_type=${auth_type} -->
<!-- ADF FORMATTING OPTIONS: -->
<!-- - Use code blocks for examples -->
<!-- - Use warning panels for security notes -->
<!-- - Use info panels for helpful tips -->
<!-- CLAUDE INSTRUCTION: REPLACE THIS COMMENT WITH CONTENT -->
<!-- TASK: Document the ${endpoint_name} endpoint -->
<!-- PURPOSE: Help developers understand request/response format -->
<!-- CONTEXT: method=${http_method}, path=${endpoint_path} -->
<!-- ADF FORMATTING OPTIONS: -->
<!-- - HTTP request in bash code block -->
<!-- - JSON response in json code block -->
<!-- - Parameter table with descriptions -->
<!-- - Error codes in warning panels -->
<!-- CLAUDE INSTRUCTION: REPLACE THIS COMMENT WITH CONTENT -->
<!-- TASK: Provide security best practices for ${service_name} -->
<!-- PURPOSE: Ensure secure implementation -->
<!-- CONTEXT: auth_method=${auth_method}, sensitive_data=${data_types} -->
<!-- ADF FORMATTING OPTIONS: -->
<!-- - Critical security info in warning panels -->
<!-- - Code examples in code blocks -->
<!-- - Checklist format for verification steps -->
Available Templates (12 templates)
├── API Documentation (3 templates)
│ ├── REST API Documentation v2.1.0
│ ├── GraphQL API Guide v1.0.0
│ └── Microservice API v1.5.0
├── User Guides (4 templates)
│ ├── Basic User Guide v1.2.0
│ ├── Advanced User Guide v1.0.0
│ ├── Mobile App Guide v2.0.0
│ └── Web Application Guide v1.1.0
└── Technical Documentation (5 templates)
├── Technical Specification v1.0.0
├── Architecture Overview v2.0.0
├── Integration Guide v1.3.0
├── Troubleshooting Guide v1.1.0
└── Security Documentation v1.0.0
Generate API documentation using the REST API template for PaymentService
I'll help you generate API documentation. I need some information:
- Service name: PaymentService
- Base URL: https://api.example.com/v1
- Authentication method: API Key
- Version: 1.0.0
Generating comprehensive API documentation...
Help me create a custom template for security audit documentation
I'll help you create a security audit template. Let me gather requirements:
1. What sections should be included?
- Executive Summary
- Scope and Methodology
- Findings and Risks
- Recommendations
- Compliance Status
2. What user context is needed?
- Audit date and auditor
- System/application being audited
- Compliance framework (SOC 2, ISO 27001, etc.)
Creating YAML template structure...
LOG_LEVEL=debug node mcp-server.js
How do I create a custom template?
What template components are available?
Show me examples of Claude instructions