Skip to main content

Overview

The template-builder command creates custom, reusable templates for ArcKit commands. It enables organizations to standardize their documentation patterns, compliance frameworks, and report formats by creating templates that can be used across multiple projects. This command empowers teams to extend ArcKit’s capabilities and adapt it to their specific organizational requirements, industry standards, or custom frameworks.

Usage

arckit template-builder [options]

Key Features

  • Custom Template Creation: Build templates for any ArcKit command
  • Template Types: Support for multiple formats (Markdown, HTML, JSON, YAML)
  • Variable Substitution: Define placeholders that get filled from project data
  • Section Management: Modular sections that can be included/excluded
  • Validation Rules: Define required fields and validation logic
  • Template Library: Organize templates by category and use case
  • Version Control: Track template versions and changes
  • Preview Mode: Test templates before deployment

Arguments

Optional Arguments

  • --command <name>: Target ArcKit command for the template (e.g., service-assessment, presentation)
  • --type <format>: Template format - markdown, html, json, yaml, or text (default: markdown)
  • --name <string>: Template name/identifier
  • --category <string>: Template category (e.g., “compliance”, “quality”, “custom”)
  • --interactive: Launch interactive template builder wizard
  • --base-template <path>: Start from an existing template
  • --preview: Generate preview with sample data
  • --output <path>: Custom output directory (default: templates/custom/)
  • --variables <list>: Define template variables (comma-separated)

Output

Generates a custom template file with:

Template Structure

  1. Template Metadata
    • Template name and version
    • Target command and format
    • Author and creation date
    • Description and usage instructions
  2. Variable Definitions
    • Variable names and types
    • Default values
    • Validation rules
    • Description and examples
  3. Template Content
    • Structured content with placeholders
    • Conditional sections
    • Loops and iterations
    • Formatting instructions
  4. Validation Rules
    • Required sections
    • Field constraints
    • Cross-field validation
    • Custom validation logic

Example Output Location

templates/
├── custom/
│   ├── my-compliance-framework.md
│   ├── custom-presentation.md
│   └── industry-assessment.yaml
├── variables/
│   └── [variable definitions]
└── metadata/
    └── template-registry.json

Examples

Create Basic Template

arckit template-builder --command service-assessment --name "ISO-27001 Assessment"
Creates a custom service assessment template for ISO 27001 compliance.

Interactive Template Builder

arckit template-builder --interactive
Launches an interactive wizard that guides you through template creation with prompts for:
  • Target command selection
  • Template format
  • Section definitions
  • Variable configuration
  • Validation rules

Create from Base Template

arckit template-builder --base-template templates/service-assessment.md --name "Healthcare HIPAA Assessment"
Starts with the standard service assessment template and customizes it for HIPAA requirements.

Create HTML Report Template

arckit template-builder --command analyze --type html --name "Executive Dashboard"
Creates an HTML template for analysis reports with rich formatting.

Create with Preview

arckit template-builder --command presentation --name "Quarterly Review" --preview
Generates the template and immediately previews it with sample data.

Define Custom Variables

arckit template-builder --command tcop --name "Custom TCoP" --variables "framework_version,assessment_date,auditor_name"
Creates a template with specific custom variables.

Prerequisites

Optional but Helpful

  • Base Templates: Existing ArcKit templates to use as starting points
  • Template Requirements: Document defining what the template should include
  • Sample Data: Example data to test template rendering
  • Style Guides: Organizational formatting and content standards

Template Types

By Command Category

  1. Compliance Templates
    • Custom assessment frameworks
    • Industry-specific standards (ISO, NIST, SOC2)
    • Regional compliance requirements
  2. Quality Templates
    • Custom analysis reports
    • Specialized traceability formats
    • Technical debt assessments
  3. Publishing Templates
    • Branded presentation themes
    • Custom report layouts
    • Executive summary formats
  4. Integration Templates
    • API documentation formats
    • Contract specifications
    • Interface definitions

By Format

  • Markdown: Documentation, reports, assessments
  • HTML: Interactive dashboards, web reports
  • JSON/YAML: Machine-readable contracts, configurations
  • Text: Plain text reports, logs

Template Variables

Supported variable types:
  • Project Variables: Automatically populated from project metadata
    • {{project.name}}, {{project.version}}, {{project.owner}}
  • Date/Time Variables: Dynamic timestamps
    • {{date.today}}, {{date.year}}, {{time.now}}
  • User Variables: Current user information
    • {{user.name}}, {{user.email}}, {{user.role}}
  • Custom Variables: User-defined placeholders
    • {{custom.framework_version}}, {{custom.assessment_level}}
  • Computed Variables: Calculated from project data
    • {{computed.risk_score}}, {{computed.completion_rate}}

Template Sections

Conditional Sections

{{#if has_security_requirements}}
## Security Requirements
...
{{/if}}

Iterative Sections

{{#each requirements}}
### {{this.id}}: {{this.title}}
{{this.description}}
{{/each}}

Reusable Sections

{{include "common/executive-summary.md"}}

Validation Rules

Define validation for:
  • Required Fields: Must be present
  • Format Constraints: Regex patterns, length limits
  • Value Constraints: Allowed values, ranges
  • Cross-field Rules: Dependencies between fields
  • Custom Logic: JavaScript validation functions

Interactive Builder Workflow

The interactive mode guides you through:
  1. Command Selection: Choose target ArcKit command
  2. Template Type: Select output format
  3. Section Definition: Define major sections
  4. Variable Configuration: Set up placeholders
  5. Validation Setup: Define required elements
  6. Preview & Test: Review with sample data
  7. Save & Register: Store in template library

Template Organization

Directory Structure

templates/
├── builtin/           # ArcKit default templates
├── custom/            # User-created templates
├── shared/            # Reusable sections
├── variables/         # Variable definitions
└── metadata/          # Template registry

Template Naming Convention

<category>-<purpose>-<version>.md

Examples:
compliance-iso27001-v1.md
quality-custom-analysis-v2.md
presentation-executive-review-v1.md

Using Custom Templates

Once created, use templates with the --template flag:
# Use custom service assessment template
arckit service-assessment --template templates/custom/iso27001-assessment.md

# Use custom presentation template
arckit presentation --template templates/custom/executive-review.md

# Use custom analysis template
arckit analyze --template templates/custom/technical-debt-report.md

Integration with Other Commands

Create Template from Existing Output

# Generate standard report
arckit service-assessment

# Convert to template
arckit template-builder --base-template service-assessment.md --name "Standard Assessment Template"

Preview Template with Real Data

# Create template
arckit template-builder --name "Custom Analysis"

# Test with real project
arckit analyze --template templates/custom/custom-analysis.md --preview

Best Practices

  1. Start Simple: Begin with basic templates and add complexity gradually
  2. Use Base Templates: Build on existing ArcKit templates when possible
  3. Document Variables: Clearly document all custom variables and their purpose
  4. Version Templates: Use semantic versioning for template changes
  5. Test Thoroughly: Preview templates with various data scenarios
  6. Organize Logically: Group templates by category and purpose
  7. Share Reusable Sections: Extract common sections for reuse
  8. Include Examples: Provide sample variable values in template documentation
  9. Validate Early: Define validation rules during template creation
  10. Maintain Registry: Keep template metadata up to date

Advanced Features

Template Inheritance

Create template hierarchies:
base-compliance-template.md
├── iso27001-template.md
├── soc2-template.md
└── nist-template.md

Template Composition

Combine multiple templates:
arckit template-builder --compose templates/header.md,templates/body.md,templates/footer.md

Dynamic Content

Include computed sections based on project analysis:
{{#if computed.risk_level == 'high'}}
⚠️ **High Risk Areas Identified**
{{/if}}

Resources

Output Summary

The command displays:
Custom Template Created
======================
Name: ISO-27001 Assessment
Command: service-assessment
Format: markdown
Location: templates/custom/iso27001-assessment.md

Template Details:
- 8 sections defined
- 12 variables configured
- 5 validation rules
- Base template: service-assessment.md

Usage:
  arckit service-assessment --template templates/custom/iso27001-assessment.md

Next Steps:
1. Review and test template with sample data
2. Document variable requirements
3. Share with team via version control
4. Register in template library
Only the summary is shown - the full template file is written to the specified location.

Build docs developers (and LLMs) love