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.cssin frontend pages. - •Follow mobile-first styling.
- •When building new pages/components, use
index.htmlas 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
h1per page and maintain heading order without skipping levels. - •Use
afor navigation andbuttonfor actions; never clickablediv/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-widthoverrides unless unavoidable. - •Ensure spacing, typography, layout, and touch targets are usable on small screens first.
SCSS Convention (Strict)
- •Use
@useinstyles/global.scssto 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.scssunless 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.
Design Tokens (Strict)
- •Define global font-family, font-style tokens (for example weights and line-height), and color tokens in
:rootinstyles/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-500unless palette mapping is intentional).
Example styles/global.scss imports:
scss
@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.cssis generated fromstyles/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.