Skip to main content

Documentation Creation Rules and Standards

File: docs/rules-howtodoc.md Purpose: Define mandatory rules and patterns for creating documentation in the Urbalurba Infrastructure Target Audience: Developers, technical writers, and LLMs creating documentation Last Updated: September 23, 2025

πŸ“‹ Overview​

This document establishes mandatory rules for creating and maintaining documentation in the docs/ folder. These rules ensure consistency, discoverability, and maintainability across all documentation types in the Urbalurba infrastructure.

πŸ—οΈ Core Documentation Architecture​

Rule 1: Three-Tier Naming Convention​

ALL documentation files MUST follow the hierarchical naming pattern:

<larger-grouping>-<focus-grouping>-<service>.md

Mandatory Naming Patterns:​

  • Service Documentation: package-databases-postgresql.md
  • Index Files: package-databases-readme.md
  • Technical Guides: rules-ingress-traefik.md
  • Overview Documents: overview-system-architecture.md

βœ… Approved Larger Groupings:​

  • package - Service and application deployments
  • overview - High-level guides and architectural overviews
  • rules - Standards, patterns, and mandatory procedures
  • hosts - Host system configuration and setup
  • networking - Network configuration and connectivity
  • provision - Infrastructure provisioning and management
  • troubleshooting - Problem diagnosis and resolution
  • secrets - Security and secrets management

βœ… Approved Package Focus Groupings:​

  • ai - Artificial Intelligence and ML services
  • auth - Authentication and authorization systems
  • core - Essential infrastructure services
  • databases - Data storage and management
  • datascience - Analytics and data processing
  • development - Developer tools and workflows
  • management - Administrative and monitoring tools
  • queues - Message brokers and queuing systems
  • search - Search and indexing services

Rule 2: Index File Pattern​

Every focus grouping MUST have an index file:

<larger-grouping>-<focus-grouping>-readme.md

Purpose: Serve as the entry point and navigation hub for all related service documentation.

Required Index File Content:​

  1. Overview of the focus grouping purpose
  2. Service listing with status indicators
  3. Quick start instructions
  4. Architecture summary
  5. Cross-references to related documentation

πŸ“ Document Structure Rules​

Rule 3: Standard Header Format​

ALL documentation files MUST start with this header:

# [Service Name] - [Brief Description]

**Key Features**: Feature1 β€’ Feature2 β€’ Feature3 β€’ Feature4 β€’ Feature5 β€’ Feature6

**File**: `docs/[filename].md`
**Purpose**: [Single sentence describing document purpose]
**Target Audience**: [Specific user groups]
**Last Updated**: [Date in format: September 23, 2025]

Header Requirements:​

  • Title: Clear service name with descriptive subtitle
  • Key Features: 3-7 bullet points using β€’ separator
  • File Path: Exact relative path from repository root
  • Purpose: One sentence maximum, specific and actionable
  • Target Audience: Comma-separated list of user personas
  • Last Updated: Date in full month format

Rule 4: Service Documentation Template​

Service documentation (package-*-[service].md) MUST follow this structure:

# [Service Name] - [Brief Description]

**Key Features**: [List using β€’ separator]
**File**: `docs/package-[category]-[service].md`
**Purpose**: Complete guide to [service] deployment and configuration in Urbalurba infrastructure
**Target Audience**: [Specific personas]
**Last Updated**: [Date]

## πŸ“‹ Overview
[2-3 paragraphs describing service role and capabilities]

**Key Features**:
- **Feature 1**: Description
- **Feature 2**: Description
- **Architecture Type**: Description

## πŸ—οΈ Architecture
### **Deployment Components**

[ASCII diagram of service stack]


### **File Structure**

[Directory structure showing related files]


## πŸš€ Deployment
### **Manual Deployment**
### **Prerequisites**

## βš™οΈ Configuration
### **[Service] Configuration**
### **Resource Configuration**
### **Security Configuration**

## πŸ” Monitoring & Verification
### **Health Checks**
### **Service Verification**
### **[Service] Access Testing**
### **Automated Verification**

## πŸ› οΈ Management Operations
### **[Service] Administration**
### **Service Removal**

## πŸ”§ Troubleshooting
### **Common Issues**

## πŸ“‹ Maintenance
### **Regular Tasks**
### **Backup Procedures**
### **Disaster Recovery**

## πŸš€ Use Cases
[3-4 practical examples with code]

Rule 5: Index Documentation Template​

Index files (*-readme.md) MUST follow this structure:

# [Category Name] - [Description]

**File**: `docs/[category]-readme.md`
**Purpose**: Overview of all [category] services in Urbalurba infrastructure
**Target Audience**: [User groups]
**Last Updated**: [Date]

## πŸ“‹ Overview
[Category description and purpose]

**Available [Category] Services**:
- **Service 1**: Brief description
- **Service 2**: Brief description

## [Icon] [Category] Services
### **Service Name - Primary Service** πŸ₯‡
**Status**: Active | **Port**: [port] | **Type**: [type]

[Service description paragraph]

**Key Features**:
- **Feature 1**: Description
- **Feature 2**: Description

**Documentation**: [package-category-service.md](./package-category-service.md)

## πŸš€ Quick Start
[Category-wide deployment instructions]

## πŸ”— Related Documentation
[Cross-references to related docs]

🎯 Content Quality Rules​

Rule 6: Mandatory Metadata Fields​

Every document MUST include:

Required Fields:​

  • **File**: Exact path from repository root
  • **Purpose**: Single sentence description
  • **Target Audience**: Specific user personas
  • **Last Updated**: Date in full format

Service Documents Must Add:​

  • **Key Features**: 3-7 items with β€’ separator
  • Architecture diagrams (ASCII or Mermaid)
  • File structure listings
  • Practical use case examples

Index Documents Must Add:​

  • Service status indicators (Active/Inactive/Development)
  • Quick start section
  • Cross-reference links

Rule 7: Status Indicators​

Use these standardized status indicators:

**Status**: βœ… Active | πŸ”„ Development | ⏸️ Inactive | 🚫 Deprecated

Rule 8: Cross-Reference Standards​

[Document Title](./filename.md)
**Documentation**: [package-category-service.md](./package-category-service.md)

Required Cross-References:​

  • Index files MUST link to all service documentation
  • Service files MUST link back to index file
  • Related services MUST be cross-referenced
  • Prerequisites MUST link to setup documentation

πŸ”§ Technical Writing Standards​

Rule 9: Code and Configuration Examples​

Required Elements:​

  • Command examples: Include description comments
  • Configuration snippets: Show context and purpose
  • File paths: Always use absolute paths from repository root
  • Variable placeholders: Use [variable-name] format

Code Block Standards:​

# Description of what this does
```bash
command --option value
# Configuration section purpose
key: value

Rule 10: Emoji and Visual Indicators​

Use standardized emoji patterns:

## πŸ“‹ Overview          # Overview sections
## πŸš€ Deployment # Getting started/deployment
## πŸ—οΈ Architecture # System design/structure
## βš™οΈ Configuration # Setup and config
## πŸ” Monitoring # Verification/monitoring
## πŸ› οΈ Management # Operations/admin
## πŸ”§ Troubleshooting # Problem solving
## πŸ“‹ Maintenance # Ongoing tasks
## πŸ”— Related # Cross-references

Status Indicators:​

βœ… Success/Active/Complete
πŸ”„ In Progress/Development
⚠️ Warning/Attention Required
❌ Error/Failed/Deprecated
🎯 Target/Goal/Objective
πŸ’‘ Tip/Insight/Key Point

πŸ“‚ File Organization Rules​

Rule 11: Directory Structure​

Files MUST be placed directly in /doc/ folder:

doc/
β”œβ”€β”€ README.md # Master index
β”œβ”€β”€ overview-*.md # High-level guides
β”œβ”€β”€ package-category-readme.md # Category indexes
β”œβ”€β”€ package-category-service.md # Service documentation
β”œβ”€β”€ rules-*.md # Standards and patterns
β”œβ”€β”€ hosts-*.md # Host configuration
β”œβ”€β”€ networking-*.md # Network setup
β”œβ”€β”€ provision-*.md # Infrastructure management
└── troubleshooting-*.md # Problem resolution

Forbidden:​

  • Subdirectories: All .md files must be in root /doc/
  • Spaces in names: Use hyphens instead
  • Version numbers: Use "Last Updated" metadata instead
  • Duplicate names: Each filename must be unique

Rule 12: New Category Creation​

Before creating a new larger grouping:

Required Justification:​

  1. Scope: Does it warrant 3+ service documents?
  2. Distinction: Is it clearly different from existing categories?
  3. Longevity: Will it remain relevant long-term?
  4. User Value: Does it improve navigation and discoverability?

Creation Process:​

  1. Document proposal with justification
  2. Create index file first: [grouping]-readme.md
  3. Add to main README.md navigation
  4. Create minimum 2 service documents

πŸ” Quality Assurance Rules​

Rule 13: Review Requirements​

Before publishing documentation:

Self-Review Checklist:​

  • Header format matches Rule 3 exactly
  • Structure follows appropriate template (Rule 4 or 5)
  • All required metadata fields present
  • Code examples tested and working
  • Cross-references valid and functional
  • Grammar and spelling checked
  • Last Updated date is current

Content Validation:​

  • Commands execute successfully
  • File paths exist and are correct
  • Configuration examples are valid
  • Screenshots/diagrams are current
  • Use cases demonstrate real value

Rule 14: Maintenance Standards​

Update Requirements:​

  • Content changes: Update "Last Updated" date
  • Significant revisions: Update purpose or target audience if needed
  • Broken links: Fix within 24 hours of discovery
  • Deprecated features: Mark clearly with status indicators

Regular Reviews:​

  • Monthly: Check for broken internal links
  • Quarterly: Validate code examples and commands
  • Semi-annually: Review structure and cross-references
  • Annually: Comprehensive content audit

🚨 Anti-Patterns and Violations​

Rule 15: Forbidden Practices​

Never Do This:​

❌ # How to setup postgres              # Unclear, no context
❌ **File**: postgres.md # Wrong path format
❌ **Purpose**: This document... # Verbose, not specific
❌ **Target Audience**: Everyone # Too broad
❌ **Last Updated**: 2024 # Incomplete date format
❌ See documentation for setup # Vague cross-reference
❌ Run this command: sudo rm -rf / # Dangerous without context

Always Do This:​

βœ… # PostgreSQL - Primary Database Service
βœ… **File**: `docs/package-databases-postgresql.md`
βœ… **Purpose**: Complete guide to PostgreSQL deployment and configuration in Urbalurba infrastructure
βœ… **Target Audience**: Database administrators, developers, architects
βœ… **Last Updated**: September 23, 2025
βœ… **Documentation**: [PostgreSQL Setup Guide](./package-databases-postgresql.md)
βœ… # Deploy PostgreSQL with authentication
kubectl apply -f manifests/050-postgresql-config.yaml

πŸ“ˆ Success Metrics​

Rule 16: Quality Indicators​

Documentation quality is measured by:

Structure Compliance:​

  • βœ… 100% header format compliance
  • βœ… Template structure adherence
  • βœ… Required section completeness
  • βœ… Cross-reference accuracy

User Value Metrics:​

  • βœ… Clear, actionable instructions
  • βœ… Working code examples
  • βœ… Comprehensive troubleshooting
  • βœ… Practical use case demonstrations

Maintenance Health:​

  • βœ… Current "Last Updated" dates
  • βœ… No broken links
  • βœ… Accurate file references
  • βœ… Valid command examples

πŸ’‘ Key Insight: Consistent documentation structure and naming conventions are essential for maintainability and user experience. These rules ensure that all documentation in the Urbalurba infrastructure follows predictable patterns, making it easier for users to find information and for contributors to create high-quality documentation that serves its intended audience effectively.