From 5a4a31ac10619d6cfa8e66fe51bdc895c4238823 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Wed, 22 Jul 2026 09:35:04 +1000 Subject: [PATCH] refactor: replace Yaegi CSS/HTML gate plugins with stylelint + htmlhint --- .agents/skills/archie-wf-frontend/SKILL.md | 59 +++--- .../archie-wf-frontend/plugins/css-gate.go | 180 ---------------- .../archie-wf-frontend/plugins/html-gate.go | 193 ------------------ 3 files changed, 24 insertions(+), 408 deletions(-) delete mode 100644 .agents/skills/archie-wf-frontend/plugins/css-gate.go delete mode 100644 .agents/skills/archie-wf-frontend/plugins/html-gate.go diff --git a/.agents/skills/archie-wf-frontend/SKILL.md b/.agents/skills/archie-wf-frontend/SKILL.md index e4c5d4c00..3b93b7195 100644 --- a/.agents/skills/archie-wf-frontend/SKILL.md +++ b/.agents/skills/archie-wf-frontend/SKILL.md @@ -1,54 +1,43 @@ --- name: archie-wf-frontend description: > - Validates HTML, CSS, and JS in the worktree before commit. Runs as a - gate stage: parses CSS for syntax errors, checks HTML structure, and - verifies responsive requirements. Use in any project with web assets. -version: 1.0.0 + Runs frontend quality checks: stylelint for CSS, htmlhint for HTML. + Gate stage runs these after Go vet/build/test. Use in any project + with web assets to catch syntax errors, broken selectors, and + structural issues before they reach a PR. +version: 1.1.0 metadata: archie: workflow: frontend - tools: [go] + tools: [stylelint, htmlhint] engine: any - plugins: - - plugins/css-gate.go - - plugins/html-gate.go ---- # Frontend Quality Gate ## When this runs -This skill registers a `frontend` workflow. Repos that include web assets -(HTML, CSS, JS) can opt into it by labelling issues `frontend` or declaring -`workflow: frontend` in their SKILL.md frontmatter. +This skill adds frontend linting to the gate stage. After Go checks pass, +the gate runs: -The bundled plugins run during the gate stage: +1. `stylelint "**/*.css"` — catches syntax errors, invalid properties, + duplicate selectors, calc() misuse, missing units +2. `htmlhint "**/*.html"` — catches unclosed tags, mismatched pairs, + duplicate IDs, inline style abuse, missing viewport meta -- `css-gate.go` — parses all .css files and ` blocks. - styleRE := regexp.MustCompile(`(?s)]*>(.*?)`) - matches := styleRE.FindAllStringSubmatch(file, -1) - - for _, m := range matches { - if len(m) < 2 { - continue - } - // Check the style content the same way we check .css files. - // Write to a temp approach: just run the same checks on the content. - lines := strings.Split(m[1], "\n") - inBlock := 0 - for i, line := range lines { - for _, ch := range line { - if ch == '{' { - inBlock++ - } - if ch == '}' { - inBlock-- - } - } - if inBlock <= 0 && orphanLine.MatchString(line) { - findings = append(findings, gate.Finding{ - Level: "error", - File: relPath, - Line: i + 1, - Message: fmt.Sprintf("orphaned CSS in