View Structure Contract

ID 7
UUID 88efede4-ddbb-4d2f-8390-827b3a29c266
Version 2.0
Status active
Scope Gilt für CRUD-Ressourcen mit Standard-Views (index, show, new, edit)
Erstellt 2025-12-20 10:59:58 von migration
Aktualisiert 2025-12-22 09:45:10

YAML-Inhalt

contract:
  name: "view-structure-standards"
  version: "2.0"
  status: "active"
  description: "CRUD-Views folgen einheitlicher Struktur (index, show, new, edit)"
  created: "2025-12-20"
  author: "migration"

  scope:
    paths:
      - "/src/View/tasks/*.php"
      - "/src/View/content/*.php"
    excludes:
      - "/src/View/docs/**/*.php"
      - "/src/View/chat/**/*.php"
      - "/src/View/home/**/*.php"
      - "/src/View/layout.php"

  principles:
    - KISS
    - DRY
    - REST
    - SRP

  rules:
    # URL-Regeln
    - id: "url-no-create"
      check_type: "forbidden_pattern"
      patterns:
        - "/create"
      in_files: "**/*.php"
      severity: "critical"
      description: "Keine /create URLs - verwende /new"

    - id: "url-no-update-delete"
      check_type: "forbidden_pattern"
      patterns:
        - "/update"
        - "/delete"
      in_files: "**/*.php"
      severity: "critical"
      description: "Keine /update oder /delete URLs - verwende HTTP-Methoden"

    # View-Struktur
    - id: "no-page-container"
      check_type: "forbidden_pattern"
      patterns:
        - "page-container"
      in_files: "View/**/*.php"
      severity: "critical"
      description: "Kein page-container Wrapper"

    - id: "no-card-wrapper"
      check_type: "forbidden_pattern"
      patterns:
        - '<div class="card">'
      in_files: "View/**/*.php"
      severity: "critical"
      description: "Keine Cards als Wrapper um Formulare"

    - id: "no-form-section"
      check_type: "forbidden_pattern"
      patterns:
        - "form-section"
      in_files: "View/**/*.php"
      severity: "critical"
      description: "Keine verschachtelten form-section Strukturen"

    - id: "no-page-header"
      check_type: "forbidden_pattern"
      patterns:
        - "page-header"
      in_files: "View/**/*.php"
      severity: "critical"
      description: "Verwende breadcrumb + h1 separat"

    - id: "breadcrumb-first"
      check_type: "required_pattern"
      patterns:
        - '<nav class="breadcrumb">'
      in_files: "View/**/show.php"
      severity: "critical"
      description: "Breadcrumb als erstes Element in show/new/edit"

    - id: "form-max-width"
      check_type: "required_pattern"
      patterns:
        - 'max-width'
      in_files: "View/**/new.php"
      severity: "major"
      description: "Formular mit max-width Style"

    - id: "table-sortable"
      check_type: "required_pattern"
      patterns:
        - "data-sortable"
      in_files: "View/**/index.php"
      severity: "major"
      description: "Tabellen haben data-sortable Attribut"

  pass_threshold:
    critical_max: 0
    major_max: 2
    minor_max: 5

  reference_files:
    index: "/src/View/tasks/index.php"
    show: "/src/View/tasks/show.php"
    new: "/src/View/tasks/new.php"
    edit: "/src/View/tasks/edit.php"

  restful_urls:
    pattern:
      index: "/{resource}"
      show: "/{resource}/{id}"
      new: "/{resource}/new"
      edit: "/{resource}/{id}/edit"

  css_classes:
    layout:
      - breadcrumb
      - stats-grid
      - stat-card
      - page-actions
      - action-bar
      - filters
      - links-bar
      - result-box
    forms:
      - form
      - form-group
      - form-input
      - form-textarea
      - form-select
      - form-actions
      - form-message
    buttons:
      - btn
      - btn--primary
      - btn--success
      - btn--danger
      - btn--light
      - btn--info

Aktionen

Bearbeiten

Versionshistorie

Version Geändert am Von Beschreibung
2.0 (aktuell) 2025-12-22 09:45:10 - -
1.0 2025-12-22 09:45:10 claude Migration auf Meta-Schema v2.0: scope.includes → scope.paths, Rules in check_type-Format konvertiert, Struktur vereinheitlicht

Letzte Validierungen

Datum Ergebnis Critical Major Minor Dauer
2025-12-20 11:07:52 passed 0 0 0 15ms

← Zurück zur Übersicht