
Applying Brand Guidelines
- 71 installs
- 51 repo stars
- Updated November 25, 2025
- ovachiever/droid-tings
Helps with ai & agent building tasks during AI-assisted development.
About
applying-brand-guidelines is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- applying-brand-guidelines
- AI & Agent Building
- AI-coding skill
Applying Brand Guidelines by the numbers
- 71 all-time installs (skills.sh)
- Ranked #5,591 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ovachiever/droid-tings --skill applying-brand-guidelinesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 71 |
|---|---|
| repo stars | ★ 51 |
| Last updated | November 25, 2025 |
| Repository | ovachiever/droid-tings ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Corporate Brand Guidelines Skill
This skill ensures all generated documents adhere to corporate brand standards for consistent, professional communication.
Brand Identity
Company: Acme Corporation
Tagline: "Innovation Through Excellence" Industry: Technology Solutions
Visual Standards
Color Palette
Primary Colors:
- Acme Blue: #0066CC (RGB: 0, 102, 204) - Headers, primary buttons
- Acme Navy: #003366 (RGB: 0, 51, 102) - Text, accents
- White: #FFFFFF - Backgrounds, reverse text
Secondary Colors:
- Success Green: #28A745 (RGB: 40, 167, 69) - Positive metrics
- Warning Amber: #FFC107 (RGB: 255, 193, 7) - Cautions
- Error Red: #DC3545 (RGB: 220, 53, 69) - Negative values
- Neutral Gray: #6C757D (RGB: 108, 117, 125) - Secondary text
Typography
Primary Font Family: Segoe UI, system-ui, -apple-system, sans-serif
Font Hierarchy:
- H1: 32pt, Bold, Acme Blue
- H2: 24pt, Semibold, Acme Navy
- H3: 18pt, Semibold, Acme Navy
- Body: 11pt, Regular, Acme Navy
- Caption: 9pt, Regular, Neutral Gray
Logo Usage
- Position: Top-left corner on first page/slide
- Size: 120px width (maintain aspect ratio)
- Clear space: Minimum 20px padding on all sides
- Never distort, rotate, or apply effects
Document Standards
PowerPoint Presentations
Slide Templates: 1. Title Slide: Company logo, presentation title, date, presenter 2. Section Divider: Section title with blue background 3. Content Slide: Title bar with blue background, white content area 4. Data Slide: For charts/graphs, maintain color palette
Layout Rules:
- Margins: 0.5 inches all sides
- Title position: Top 15% of slide
- Bullet indentation: 0.25 inches per level
- Maximum 6 bullet points per slide
- Charts use brand colors exclusively
Excel Spreadsheets
Formatting Standards:
- Headers: Row 1, Bold, White text on Acme Blue background
- Subheaders: Bold, Acme Navy text
- Data cells: Regular, Acme Navy text
- Borders: Thin, Neutral Gray
- Alternating rows: Light gray (#F8F9FA) for readability
Chart Defaults:
- Primary series: Acme Blue
- Secondary series: Success Green
- Gridlines: Neutral Gray, 0.5pt
- No 3D effects or gradients
PDF Documents
Page Layout:
- Header: Company logo left, document title center, page number right
- Footer: Copyright notice left, date center, classification right
- Margins: 1 inch all sides
- Line spacing: 1.15
- Paragraph spacing: 12pt after
Section Formatting:
- Main headings: Acme Blue, 16pt, bold
- Subheadings: Acme Navy, 14pt, semibold
- Body text: Acme Navy, 11pt, regular
Content Guidelines
Tone of Voice
- Professional: Formal but approachable
- Clear: Avoid jargon, use simple language
- Active: Use active voice, action-oriented
- Positive: Focus on solutions and benefits
Standard Phrases
Opening Statements:
- "At Acme Corporation, we..."
- "Our commitment to innovation..."
- "Delivering excellence through..."
Closing Statements:
- "Thank you for your continued partnership."
- "We look forward to serving your needs."
- "Together, we achieve excellence."
Data Presentation
Numbers:
- Use comma separators for thousands
- Currency: $X,XXX.XX format
- Percentages: XX.X% (one decimal)
- Dates: Month DD, YYYY
Tables:
- Headers in brand blue
- Alternating row colors
- Right-align numbers
- Left-align text
Quality Standards
Before Finalizing
Always ensure: 1. Logo is properly placed and sized 2. All colors match brand palette exactly 3. Fonts are consistent throughout 4. No typos or grammatical errors 5. Data is accurately presented 6. Professional tone maintained
Prohibited Elements
Never use:
- Clip art or stock photos without approval
- Comic Sans, Papyrus, or decorative fonts
- Rainbow colors or gradients
- Animations or transitions (unless specified)
- Competitor branding or references
Application Instructions
When creating any document: 1. Start with brand colors and fonts 2. Apply appropriate template structure 3. Include logo on first page/slide 4. Use consistent formatting throughout 5. Review against brand standards 6. Ensure professional appearance
Scripts
apply_brand.py: Automatically applies brand formatting to documentsvalidate_brand.py: Checks documents for brand compliance
Notes
- These guidelines apply to all external communications
- Internal documents may use simplified formatting
- Special projects may have exceptions (request approval)
- Brand guidelines updated quarterly - check for latest version
"""
Brand application module for corporate document styling.
Applies consistent branding to Excel, PowerPoint, and PDF documents.
"""
from typing import Dict, Any, List
class BrandFormatter:
"""Apply corporate brand guidelines to documents."""
# Brand color definitions
COLORS = {
"primary": {
"acme_blue": {"hex": "#0066CC", "rgb": (0, 102, 204)},
"acme_navy": {"hex": "#003366", "rgb": (0, 51, 102)},
"white": {"hex": "#FFFFFF", "rgb": (255, 255, 255)},
},
"secondary": {
"success_green": {"hex": "#28A745", "rgb": (40, 167, 69)},
"warning_amber": {"hex": "#FFC107", "rgb": (255, 193, 7)},
"error_red": {"hex": "#DC3545", "rgb": (220, 53, 69)},
"neutral_gray": {"hex": "#6C757D", "rgb": (108, 117, 125)},
"light_gray": {"hex": "#F8F9FA", "rgb": (248, 249, 250)},
},
}
# Font definitions
FONTS = {
"primary": "Segoe UI",
"fallback": ["system-ui", "-apple-system", "sans-serif"],
"sizes": {"h1": 32, "h2": 24, "h3": 18, "body": 11, "caption": 9},
"weights": {"regular": 400, "semibold": 600, "bold": 700},
}
# Company information
COMPANY = {
"name": "Acme Corporation",
"tagline": "Innovation Through Excellence",
"copyright": "© 2025 Acme Corporation. All rights reserved.",
"website": "www.acmecorp.example",
"logo_path": "assets/acme_logo.png",
}
def __init__(self):
"""Initialize brand formatter with standard settings."""
self.colors = self.COLORS
self.fonts = self.FONTS
self.company = self.COMPANY
def format_excel(self, workbook_config: Dict[str, Any]) -> Dict[str, Any]:
"""
Apply brand formatting to Excel workbook configuration.
Args:
workbook_config: Excel workbook configuration dictionary
Returns:
Branded workbook configuration
"""
branded_config = workbook_config.copy()
# Apply header formatting
branded_config["header_style"] = {
"font": {
"name": self.fonts["primary"],
"size": self.fonts["sizes"]["body"],
"bold": True,
"color": self.colors["primary"]["white"]["hex"],
},
"fill": {"type": "solid", "color": self.colors["primary"]["acme_blue"]["hex"]},
"alignment": {"horizontal": "center", "vertical": "center"},
"border": {"style": "thin", "color": self.colors["secondary"]["neutral_gray"]["hex"]},
}
# Apply data cell formatting
branded_config["cell_style"] = {
"font": {
"name": self.fonts["primary"],
"size": self.fonts["sizes"]["body"],
"color": self.colors["primary"]["acme_navy"]["hex"],
},
"alignment": {"horizontal": "left", "vertical": "center"},
}
# Apply alternating row colors
branded_config["alternating_rows"] = {
"enabled": True,
"color": self.colors["secondary"]["light_gray"]["hex"],
}
# Chart color scheme
branded_config["chart_colors"] = [
self.colors["primary"]["acme_blue"]["hex"],
self.colors["secondary"]["success_green"]["hex"],
self.colors["secondary"]["warning_amber"]["hex"],
self.colors["secondary"]["neutral_gray"]["hex"],
]
return branded_config
def format_powerpoint(self, presentation_config: Dict[str, Any]) -> Dict[str, Any]:
"""
Apply brand formatting to PowerPoint presentation configuration.
Args:
presentation_config: PowerPoint configuration dictionary
Returns:
Branded presentation configuration
"""
branded_config = presentation_config.copy()
# Slide master settings
branded_config["master"] = {
"background_color": self.colors["primary"]["white"]["hex"],
"title_area": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["h1"],
"color": self.colors["primary"]["acme_blue"]["hex"],
"bold": True,
"position": {"x": 0.5, "y": 0.15, "width": 9, "height": 1},
},
"content_area": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["body"],
"color": self.colors["primary"]["acme_navy"]["hex"],
"position": {"x": 0.5, "y": 2, "width": 9, "height": 5},
},
"footer": {
"show_slide_number": True,
"show_date": True,
"company_name": self.company["name"],
},
}
# Title slide template
branded_config["title_slide"] = {
"background": self.colors["primary"]["acme_blue"]["hex"],
"title_color": self.colors["primary"]["white"]["hex"],
"subtitle_color": self.colors["primary"]["white"]["hex"],
"include_logo": True,
"logo_position": {"x": 0.5, "y": 0.5, "width": 2},
}
# Content slide template
branded_config["content_slide"] = {
"title_bar": {
"background": self.colors["primary"]["acme_blue"]["hex"],
"text_color": self.colors["primary"]["white"]["hex"],
"height": 1,
},
"bullet_style": {"level1": "•", "level2": "○", "level3": "▪", "indent": 0.25},
}
# Chart defaults
branded_config["charts"] = {
"color_scheme": [
self.colors["primary"]["acme_blue"]["hex"],
self.colors["secondary"]["success_green"]["hex"],
self.colors["secondary"]["warning_amber"]["hex"],
self.colors["secondary"]["neutral_gray"]["hex"],
],
"gridlines": {"color": self.colors["secondary"]["neutral_gray"]["hex"], "width": 0.5},
"font": {"name": self.fonts["primary"], "size": self.fonts["sizes"]["caption"]},
}
return branded_config
def format_pdf(self, document_config: Dict[str, Any]) -> Dict[str, Any]:
"""
Apply brand formatting to PDF document configuration.
Args:
document_config: PDF document configuration dictionary
Returns:
Branded document configuration
"""
branded_config = document_config.copy()
# Page layout
branded_config["page"] = {
"margins": {"top": 1, "bottom": 1, "left": 1, "right": 1},
"size": "letter",
"orientation": "portrait",
}
# Header configuration
branded_config["header"] = {
"height": 0.75,
"content": {
"left": {"type": "logo", "width": 1.5},
"center": {
"type": "text",
"content": document_config.get("title", "Document"),
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["body"],
"color": self.colors["primary"]["acme_navy"]["hex"],
},
"right": {"type": "page_number", "format": "Page {page} of {total}"},
},
}
# Footer configuration
branded_config["footer"] = {
"height": 0.5,
"content": {
"left": {
"type": "text",
"content": self.company["copyright"],
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["caption"],
"color": self.colors["secondary"]["neutral_gray"]["hex"],
},
"center": {"type": "date", "format": "%B %d, %Y"},
"right": {"type": "text", "content": "Confidential"},
},
}
# Text styles
branded_config["styles"] = {
"heading1": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["h1"],
"color": self.colors["primary"]["acme_blue"]["hex"],
"bold": True,
"spacing_after": 12,
},
"heading2": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["h2"],
"color": self.colors["primary"]["acme_navy"]["hex"],
"bold": True,
"spacing_after": 10,
},
"heading3": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["h3"],
"color": self.colors["primary"]["acme_navy"]["hex"],
"bold": False,
"spacing_after": 8,
},
"body": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["body"],
"color": self.colors["primary"]["acme_navy"]["hex"],
"line_spacing": 1.15,
"paragraph_spacing": 12,
},
"caption": {
"font": self.fonts["primary"],
"size": self.fonts["sizes"]["caption"],
"color": self.colors["secondary"]["neutral_gray"]["hex"],
"italic": True,
},
}
# Table formatting
branded_config["table_style"] = {
"header": {
"background": self.colors["primary"]["acme_blue"]["hex"],
"text_color": self.colors["primary"]["white"]["hex"],
"bold": True,
},
"rows": {
"alternating_color": self.colors["secondary"]["light_gray"]["hex"],
"border_color": self.colors["secondary"]["neutral_gray"]["hex"],
},
}
return branded_config
def validate_colors(self, colors_used: List[str]) -> Dict[str, Any]:
"""
Validate that colors match brand guidelines.
Args:
colors_used: List of color codes used in document
Returns:
Validation results with corrections if needed
"""
results = {"valid": True, "corrections": [], "warnings": []}
approved_colors = []
for category in self.colors.values():
for color in category.values():
approved_colors.append(color["hex"].upper())
for color in colors_used:
color_upper = color.upper()
if color_upper not in approved_colors:
results["valid"] = False
# Find closest brand color
closest = self._find_closest_brand_color(color)
results["corrections"].append(
{
"original": color,
"suggested": closest,
"message": f"Non-brand color {color} should be replaced with {closest}",
}
)
return results
def _find_closest_brand_color(self, color: str) -> str:
"""Find the closest brand color to a given color."""
# Simplified - in reality would calculate color distance
return self.colors["primary"]["acme_blue"]["hex"]
def apply_watermark(self, document_type: str) -> Dict[str, Any]:
"""
Generate watermark configuration for documents.
Args:
document_type: Type of document (draft, confidential, etc.)
Returns:
Watermark configuration
"""
watermarks = {
"draft": {
"text": "DRAFT",
"color": self.colors["secondary"]["neutral_gray"]["hex"],
"opacity": 0.1,
"angle": 45,
"font_size": 72,
},
"confidential": {
"text": "CONFIDENTIAL",
"color": self.colors["secondary"]["error_red"]["hex"],
"opacity": 0.1,
"angle": 45,
"font_size": 60,
},
"sample": {
"text": "SAMPLE",
"color": self.colors["secondary"]["warning_amber"]["hex"],
"opacity": 0.15,
"angle": 45,
"font_size": 72,
},
}
return watermarks.get(document_type, watermarks["draft"])
def get_chart_palette(self, num_series: int = 4) -> List[str]:
"""
Get color palette for charts.
Args:
num_series: Number of data series
Returns:
List of hex color codes
"""
palette = [
self.colors["primary"]["acme_blue"]["hex"],
self.colors["secondary"]["success_green"]["hex"],
self.colors["secondary"]["warning_amber"]["hex"],
self.colors["secondary"]["neutral_gray"]["hex"],
self.colors["primary"]["acme_navy"]["hex"],
self.colors["secondary"]["error_red"]["hex"],
]
return palette[:num_series]
def format_number(self, value: float, format_type: str = "general") -> str:
"""
Format numbers according to brand standards.
Args:
value: Numeric value to format
format_type: Type of formatting (currency, percentage, general)
Returns:
Formatted string
"""
if format_type == "currency":
return f"${value:,.2f}"
elif format_type == "percentage":
return f"{value:.1f}%"
elif format_type == "large_number":
if value >= 1_000_000:
return f"{value / 1_000_000:.1f}M"
elif value >= 1_000:
return f"{value / 1_000:.1f}K"
else:
return f"{value:.0f}"
else:
return f"{value:,.0f}" if value >= 1000 else f"{value:.2f}"
def apply_brand_to_document(document_type: str, config: Dict[str, Any]) -> Dict[str, Any]:
"""
Main function to apply branding to any document type.
Args:
document_type: Type of document ('excel', 'powerpoint', 'pdf')
config: Document configuration
Returns:
Branded configuration
"""
formatter = BrandFormatter()
if document_type.lower() == "excel":
return formatter.format_excel(config)
elif document_type.lower() in ["powerpoint", "pptx"]:
return formatter.format_powerpoint(config)
elif document_type.lower() == "pdf":
return formatter.format_pdf(config)
else:
raise ValueError(f"Unsupported document type: {document_type}")
# Example usage
if __name__ == "__main__":
# Example Excel configuration
excel_config = {"title": "Quarterly Report", "sheets": ["Summary", "Details"]}
branded_excel = apply_brand_to_document("excel", excel_config)
print("Branded Excel Configuration:")
print(branded_excel)
# Example PowerPoint configuration
ppt_config = {"title": "Business Review", "num_slides": 10}
branded_ppt = apply_brand_to_document("powerpoint", ppt_config)
print("\nBranded PowerPoint Configuration:")
print(branded_ppt)
Brand Guidelines Reference
Quick Reference Card
Must-Have Elements
✅ Company logo on first page/slide ✅ Correct brand colors (no variations) ✅ Approved fonts only ✅ Consistent formatting throughout ✅ Professional tone of voice
Never Use
❌ Competitor logos or references ❌ Unapproved colors or gradients ❌ Decorative or script fonts ❌ Pixelated or stretched logos ❌ Informal language or slang
Color Codes Reference
For Digital (RGB/Hex)
| Color Name | Hex Code | RGB | Usage |
|---|---|---|---|
| Acme Blue | #0066CC | 0, 102, 204 | Primary headers, CTAs |
| Acme Navy | #003366 | 0, 51, 102 | Body text, secondary |
| Success Green | #28A745 | 40, 167, 69 | Positive values |
| Warning Amber | #FFC107 | 255, 193, 7 | Warnings, attention |
| Error Red | #DC3545 | 220, 53, 69 | Errors, negative |
| Neutral Gray | #6C757D | 108, 117, 125 | Muted text |
| Light Gray | #F8F9FA | 248, 249, 250 | Backgrounds |
For Print (CMYK)
| Color Name | CMYK | Pantone |
|---|---|---|
| Acme Blue | 100, 50, 0, 20 | 2935 C |
| Acme Navy | 100, 50, 0, 60 | 2965 C |
Document Templates
Email Signature
[Name]
[Title]
Acme Corporation | Innovation Through Excellence
[Phone] | [Email]
www.acmecorp.exampleSlide Footer
© 2025 Acme Corporation | Confidential | Page [X]Report Header
[Logo] [Document Title] Page [X] of [Y]Accessibility Standards
Color Contrast
- Text on white background: Use Acme Navy (#003366)
- Text on blue background: Use white (#FFFFFF)
- Minimum contrast ratio: 4.5:1 for body text
- Minimum contrast ratio: 3:1 for large text
Font Sizes
- Minimum body text: 11pt (print), 14px (digital)
- Minimum caption text: 9pt (print), 12px (digital)
File Naming Conventions
Standard Format
YYYY-MM-DD_DocumentType_Version_Status.extExamples
2025-01-15_QuarterlyReport_v2_FINAL.pptx2025-01-15_BudgetAnalysis_v1_DRAFT.xlsx2025-01-15_Proposal_v3_APPROVED.pdf
Common Mistakes to Avoid
1. Wrong Blue: Using generic blue instead of Acme Blue #0066CC 2. Stretched Logo: Always maintain aspect ratio 3. Too Many Colors: Stick to the approved palette 4. Inconsistent Fonts: Don't mix font families 5. Missing Logo: Always include on first page 6. Wrong Date Format: Use "Month DD, YYYY" 7. Decimal Places: Be consistent (currency: 2, percentage: 1)
Department-Specific Guidelines
Finance
- Always right-align numbers in tables
- Use parentheses for negative values: ($1,234)
- Include data source citations
Marketing
- Can use full secondary color palette
- May include approved imagery
- Follow social media specific guidelines when applicable
Legal
- Use numbered sections (1.0, 1.1, 1.2)
- Include document control information
- Apply "Confidential" watermark when needed
International Considerations
Date Formats by Region
- US: Month DD, YYYY (January 15, 2025)
- UK: DD Month YYYY (15 January 2025)
- ISO: YYYY-MM-DD (2025-01-15)
Currency Display
- USD: $1,234.56
- EUR: €1.234,56
- GBP: £1,234.56
Version History
| Version | Date | Changes |
|---|---|---|
| 2.0 | Jan 2025 | Added digital color codes |
| 1.5 | Oct 2024 | Updated font guidelines |
| 1.0 | Jan 2024 | Initial brand guidelines |
Contact for Questions
Brand Team Email: brand@acmecorp.example Slack: #brand-guidelines
For Exceptions Submit request to brand team with business justification
#!/usr/bin/env python3
"""
Brand Validation Script
Validates content against brand guidelines including colors, fonts, tone, and messaging.
"""
import re
import json
from typing import Dict, List, Tuple, Optional
from dataclasses import dataclass, asdict
@dataclass
class BrandGuidelines:
"""Brand guidelines configuration"""
brand_name: str
primary_colors: List[str]
secondary_colors: List[str]
fonts: List[str]
tone_keywords: List[str]
prohibited_words: List[str]
tagline: Optional[str] = None
logo_usage_rules: Optional[Dict] = None
@dataclass
class ValidationResult:
"""Result of brand validation"""
passed: bool
score: float
violations: List[str]
warnings: List[str]
suggestions: List[str]
class BrandValidator:
"""Validates content against brand guidelines"""
def __init__(self, guidelines: BrandGuidelines):
self.guidelines = guidelines
def validate_colors(self, content: str) -> Tuple[List[str], List[str]]:
"""
Validate color usage in content (hex codes, RGB, color names)
Returns: (violations, warnings)
"""
violations = []
warnings = []
# Find hex colors
hex_pattern = r"#[0-9A-Fa-f]{6}|#[0-9A-Fa-f]{3}"
found_colors = re.findall(hex_pattern, content)
# Find RGB colors
rgb_pattern = r"rgb\s*\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)"
found_colors.extend(re.findall(rgb_pattern, content, re.IGNORECASE))
approved_colors = self.guidelines.primary_colors + self.guidelines.secondary_colors
for color in found_colors:
if color.upper() not in [c.upper() for c in approved_colors]:
violations.append(f"Unapproved color used: {color}")
return violations, warnings
def validate_fonts(self, content: str) -> Tuple[List[str], List[str]]:
"""
Validate font usage in content
Returns: (violations, warnings)
"""
violations = []
warnings = []
# Common font specification patterns
font_patterns = [
r'font-family\s*:\s*["\']?([^;"\']+)["\']?',
r"font:\s*[^;]*\s+([A-Za-z][A-Za-z\s]+)(?:,|;|\s+\d)",
]
found_fonts = []
for pattern in font_patterns:
matches = re.findall(pattern, content, re.IGNORECASE)
found_fonts.extend(matches)
for font in found_fonts:
font_clean = font.strip().lower()
# Check if any approved font is in the found font string
if not any(approved.lower() in font_clean for approved in self.guidelines.fonts):
violations.append(f"Unapproved font used: {font}")
return violations, warnings
def validate_tone(self, content: str) -> Tuple[List[str], List[str]]:
"""
Validate tone and messaging
Returns: (violations, warnings)
"""
violations = []
warnings = []
# Check for prohibited words
content_lower = content.lower()
for word in self.guidelines.prohibited_words:
if word.lower() in content_lower:
violations.append(f"Prohibited word/phrase used: '{word}'")
# Check for tone keywords (should have at least some)
tone_matches = sum(
1 for keyword in self.guidelines.tone_keywords if keyword.lower() in content_lower
)
if tone_matches == 0 and len(content) > 100:
warnings.append(
f"Content may not align with brand tone. "
f"Consider using terms like: {', '.join(self.guidelines.tone_keywords[:5])}"
)
return violations, warnings
def validate_brand_name(self, content: str) -> Tuple[List[str], List[str]]:
"""
Validate brand name usage and capitalization
Returns: (violations, warnings)
"""
violations = []
warnings = []
# Find all variations of the brand name
brand_pattern = re.compile(re.escape(self.guidelines.brand_name), re.IGNORECASE)
matches = brand_pattern.findall(content)
for match in matches:
if match != self.guidelines.brand_name:
violations.append(
f"Incorrect brand name capitalization: '{match}' "
f"should be '{self.guidelines.brand_name}'"
)
return violations, warnings
def calculate_score(self, violations: List[str], warnings: List[str]) -> float:
"""Calculate compliance score (0-100)"""
violation_penalty = len(violations) * 10
warning_penalty = len(warnings) * 3
score = max(0, 100 - violation_penalty - warning_penalty)
return round(score, 2)
def generate_suggestions(self, violations: List[str], warnings: List[str]) -> List[str]:
"""Generate helpful suggestions based on violations and warnings"""
suggestions = []
if any("color" in v.lower() for v in violations):
suggestions.append(
f"Use approved colors: Primary: {', '.join(self.guidelines.primary_colors[:3])}"
)
if any("font" in v.lower() for v in violations):
suggestions.append(f"Use approved fonts: {', '.join(self.guidelines.fonts)}")
if any("tone" in w.lower() for w in warnings):
suggestions.append(
f"Incorporate brand tone keywords: {', '.join(self.guidelines.tone_keywords[:5])}"
)
if any("brand name" in v.lower() for v in violations):
suggestions.append(f"Always capitalize brand name as: {self.guidelines.brand_name}")
return suggestions
def validate(self, content: str) -> ValidationResult:
"""
Perform complete brand validation
Returns: ValidationResult
"""
all_violations = []
all_warnings = []
# Run all validation checks
color_v, color_w = self.validate_colors(content)
all_violations.extend(color_v)
all_warnings.extend(color_w)
font_v, font_w = self.validate_fonts(content)
all_violations.extend(font_v)
all_warnings.extend(font_w)
tone_v, tone_w = self.validate_tone(content)
all_violations.extend(tone_v)
all_warnings.extend(tone_w)
brand_v, brand_w = self.validate_brand_name(content)
all_violations.extend(brand_v)
all_warnings.extend(brand_w)
# Calculate score and generate suggestions
score = self.calculate_score(all_violations, all_warnings)
suggestions = self.generate_suggestions(all_violations, all_warnings)
return ValidationResult(
passed=len(all_violations) == 0,
score=score,
violations=all_violations,
warnings=all_warnings,
suggestions=suggestions,
)
def load_guidelines_from_json(filepath: str) -> BrandGuidelines:
"""
Load brand guidelines from JSON file
Args:
filepath: Path to JSON file containing brand guidelines
Returns:
BrandGuidelines object
Raises:
FileNotFoundError: If the file doesn't exist
json.JSONDecodeError: If the file contains invalid JSON
TypeError: If required fields are missing
"""
try:
with open(filepath, "r") as f:
data = json.load(f)
return BrandGuidelines(**data)
except FileNotFoundError:
raise FileNotFoundError(f"Brand guidelines file not found: {filepath}")
except json.JSONDecodeError as e:
raise json.JSONDecodeError(f"Invalid JSON in brand guidelines file: {e.msg}", e.doc, e.pos)
except TypeError as e:
raise TypeError(f"Missing required fields in brand guidelines: {e}")
def get_acme_corporation_guidelines() -> BrandGuidelines:
"""
Get default Acme Corporation brand guidelines.
These guidelines match the standards defined in the SKILL.md reference.
Users should customize these for their own organization.
Returns:
BrandGuidelines object with Acme Corporation standards
"""
return BrandGuidelines(
brand_name="Acme Corporation",
primary_colors=["#0066CC", "#003366", "#FFFFFF"], # Acme Blue, Acme Navy, White
secondary_colors=[
"#28A745",
"#FFC107",
"#DC3545",
"#6C757D",
"#F8F9FA",
], # Success Green, Warning Amber, Error Red, Neutral Gray, Light Gray
fonts=["Segoe UI", "system-ui", "-apple-system", "sans-serif"],
tone_keywords=[
"innovation",
"excellence",
"professional",
"solutions",
"trusted",
"reliable",
],
prohibited_words=["cheap", "outdated", "inferior", "unprofessional", "sloppy"],
tagline="Innovation Through Excellence",
)
def main():
"""Example usage demonstrating brand validation"""
# Load Acme Corporation brand guidelines
# Users should customize this for their own organization
guidelines = get_acme_corporation_guidelines()
# Example content to validate (intentionally contains violations for demonstration)
test_content = """
Welcome to acme corporation!
We are a cheap solution provider with outdated technology.
Our innovation and excellence in professional solutions are trusted by many.
Contact us at: font-family: 'Comic Sans MS'
Color scheme: #FF0000
Background: rgb(255, 0, 0)
"""
# Validate
validator = BrandValidator(guidelines)
result = validator.validate(test_content)
# Print results
print("=" * 60)
print("BRAND VALIDATION REPORT")
print("=" * 60)
print(f"\nOverall Status: {'✓ PASSED' if result.passed else '✗ FAILED'}")
print(f"Compliance Score: {result.score}/100")
if result.violations:
print(f"\n❌ VIOLATIONS ({len(result.violations)}):")
for i, violation in enumerate(result.violations, 1):
print(f" {i}. {violation}")
if result.warnings:
print(f"\n⚠️ WARNINGS ({len(result.warnings)}):")
for i, warning in enumerate(result.warnings, 1):
print(f" {i}. {warning}")
if result.suggestions:
print("\n💡 SUGGESTIONS:")
for i, suggestion in enumerate(result.suggestions, 1):
print(f" {i}. {suggestion}")
print("\n" + "=" * 60)
# Return JSON for programmatic use
return asdict(result)
if __name__ == "__main__":
main()