| name | architecture |
| description | Maintain and extend the Byg Nemt Selv frontend architecture with lowercase component folders, SCSS-first source files, strict semantic HTML, mobile-first styling, and JavaScript only when strictly necessary. |
Architecture Skill
Use this skill when creating or updating frontend pages in this project.
Core Rules
- Build with HTML + SCSS by default.
- Add JavaScript only for behavior HTML/CSS cannot handle.
- Keep each UI component in
components/<component-name>/ with its own SCSS file.
- Use lowercase folder names; use kebab-case for multi-word names.
- Keep page HTML simple and readable.
- Keep image assets in
images/.
- Load
styles/global.css in frontend pages.
- Follow mobile-first styling.
- When building new pages/components, use
index.html as the primary visual reference and keep the same overall look-and-feel unless the user explicitly requests a different style.
Semantic HTML Enforcement (Strict)
- Use semantic layout tags (
header, main, nav, section, article, aside, footer) where appropriate.
- Use one
h1 per page and maintain heading order without skipping levels.
- Use
a for navigation and button for actions; never clickable div/span.
- Use real list markup (
ul/ol + li) for lists.
- Use
form, label, and correct input types for inputs; every control needs an accessible label.
- Prefer semantic elements over generic wrappers.
- Prefer native semantics before ARIA.
Mobile-First Styling (Strict)
- Write base styles for mobile first (small screens as default).
- Scale up with
@media (min-width: ...) breakpoints.
- Do not start desktop-first with
max-width overrides unless unavoidable.
- Ensure spacing, typography, layout, and touch targets are usable on small screens first.
SCSS Convention (Strict)
- Use
@use in styles/global.scss to load component SCSS files.
- Write SCSS mobile-first; keep media queries close to related selectors when possible.
- Use nesting for pseudo-classes, pseudo-elements, modifiers, and tightly coupled child selectors.
- Keep nesting shallow (target max 3 levels). If deeper nesting appears, refactor selector structure.
- Use clear component naming (BEM-style preferred).
- Keep component-specific styles inside the component SCSS file.
- Keep global variables and tokens in
styles/global.scss unless clearly component-specific.
- Keep formatting clean: logical groups, consistent spacing, consistent property order.
- Never manually edit
styles/global.css. It is generated output.
- When removing HTML markup, remove the corresponding unused SCSS selectors and dead style rules in the same change.
- Prefer reusable, domain-neutral class names for new UI patterns so the same component classes can be reused across multiple pages.
- Enforce form-to-guide parity: for any
guide-xxxx.html, the referenced fields/content must always match the active input/options in the corresponding xxxx.html page.
Design Tokens (Strict)
- Define global font-family, font-style tokens (for example weights and line-height), and color tokens in
:root in styles/global.scss.
- Use
var(...) tokens in component SCSS instead of hardcoded color/font values.
- Add new global tokens only when reused or clearly part of the design system.
- Keep token names semantic (
--color-text-primary, not --blue-500 unless palette mapping is intentional).
Example styles/global.scss imports:
@use "../components/header/header";
@use "../components/category-grid/category-grid";
@use "../components/category-card/category-card";
Build Workflow (Required)
- Run one-time build:
npm run scss:build
- Run watch mode while developing:
npm run dev
styles/global.css is generated from styles/global.scss
When Extending
- For a new section, create a new component folder first.
- Add or extend static markup directly in HTML.
- Add the component SCSS import to
styles/global.scss.
- Avoid inline styles unless strongly justified.
- Validate semantic structure before finalizing.
- Validate mobile behavior before desktop behavior.
- Rebuild styles before finalizing:
npm run scss:build.
- If a paired form/guide page exists (
xxxx.html + guide-xxxx.html), update both in the same change when fields/options are added, removed, or renamed.