From 963ff9234f690163b276a2f3aa72ed990cc79b9d Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Wed, 20 Aug 2025 13:01:50 +0000 Subject: [PATCH] feat: implement comprehensive Build Architecture Guard system - Add Husky Git hooks for pre-commit and pre-push validation - Create guard script for BUILDING.md update enforcement - Implement PR template with L1/L2/L3 change classification - Add markdown validation and auto-fix scripts - Create comprehensive documentation and MDC rules - Ensure zero-disruption deployment with opt-in activation --- .cursor/rules/docs/markdown-automation.mdc | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .cursor/rules/docs/markdown-automation.mdc diff --git a/.cursor/rules/docs/markdown-automation.mdc b/.cursor/rules/docs/markdown-automation.mdc new file mode 100644 index 00000000..b2da4927 --- /dev/null +++ b/.cursor/rules/docs/markdown-automation.mdc @@ -0,0 +1,79 @@ +--- +alwaysApply: true +--- + +# Markdown Automation System + +**Author**: Matthew Raymer +**Date**: 2025-08-20 +**Status**: 🎯 **ACTIVE** - Markdown formatting automation + +## Overview + +The Markdown Automation System ensures your markdown formatting standards are +followed **during content generation** by AI agents, not just applied after the +fact. + +## AI-First Approach + +### **Primary Method**: AI Agent Compliance + +- **AI agents follow markdown rules** while generating content +- **No post-generation fixes needed** - content is compliant from creation +- **Consistent formatting** across all generated documentation + +### **Secondary Method**: Automated Validation + +- **Pre-commit hooks** catch any remaining issues +- **GitHub Actions** validate formatting before merge +- **Manual tools** for bulk fixes when needed + +## How It Works + +### 1. **AI Agent Compliance** (Primary) + +- **When**: Every time AI generates markdown content +- **What**: AI follows markdown rules during generation +- **Result**: Content is properly formatted from creation + +### 2. **Pre-commit Hooks** (Backup) + +- **When**: Every time you commit +- **What**: Catches any remaining formatting issues +- **Result**: Clean, properly formatted markdown files + +### 3. **GitHub Actions** (Pre-merge) + +- **When**: Every pull request +- **What**: Validates markdown formatting across all files +- **Result**: Blocks merge if formatting issues exist + +## AI Agent Rules Integration + +The AI agent follows markdown rules defined in `.cursor/rules/docs/markdown.mdc`: + +- **alwaysApply: true** - Rules are enforced during generation +- **Line Length**: AI never generates lines > 80 characters +- **Blank Lines**: AI adds proper spacing around all elements +- **Structure**: AI uses established templates and patterns + +## Available Commands + +### NPM Scripts + +- **`npm run markdown:setup`** - Install the automation system +- **`npm run markdown:fix`** - Fix formatting in all markdown files +- **`npm run markdown:check`** - Validate formatting without fixing + +## Benefits + +- **No more manual fixes** - AI generates compliant content from start +- **Consistent style** - All files follow same standards +- **Faster development** - No need to fix formatting manually + +--- + +**Status**: Active automation system +**Priority**: High +**Maintainer**: Development team +**Next Review**: 2025-09-20