From 979ae93b17753055c31f4b83674e5aed9f4a1fe0 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sat, 6 Dec 2025 18:35:17 +0100 Subject: [PATCH] feat: add frontend architecture rules FE-001 to FE-004 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add rules to enforce consistent frontend component usage: - FE-001 (warning): Use pagination macro instead of inline HTML - FE-002 (warning): Use $icon() helper instead of inline SVGs - FE-003 (info): Use table macros for consistent styling - FE-004 (info): Use form macros for consistent styling Update validate_architecture.py to check FE-001 and FE-002 anti-patterns in templates, with exceptions for macro definitions and the components showcase page. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .architecture-rules.yaml | 86 +++++++++++++++++++++++++++++ scripts/validate_architecture.py | 95 ++++++++++++++++++++++++++++++-- 2 files changed, 175 insertions(+), 6 deletions(-) diff --git a/.architecture-rules.yaml b/.architecture-rules.yaml index ba41ab2d..6c858f24 100644 --- a/.architecture-rules.yaml +++ b/.architecture-rules.yaml @@ -600,6 +600,92 @@ template_rules: file_pattern: "app/templates/**/*.html" recommended_pattern: '' +# ============================================================================ +# FRONTEND COMPONENT RULES +# ============================================================================ + +frontend_component_rules: + + - id: "FE-001" + name: "Use pagination macro instead of inline HTML" + severity: "warning" + description: | + Use the shared pagination macro instead of duplicating pagination HTML. + Import from shared/macros/pagination.html. + + WRONG (inline pagination): +
+ + Showing ... + +