[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
Prerequisites: MUST READ before executing:
.claude/skills/shared/scan-and-update-reference-doc-protocol.md
.claude/skills/shared/understand-code-first-protocol.md
Quick Summary
Goal: Scan project stylesheets and populate docs/project-reference/scss-styling-guide.md with BEM methodology usage, SCSS architecture, mixins/variables inventory, theming patterns, responsive breakpoints, and design token conventions.
Workflow:
- Read — Load current target doc, detect init vs sync mode
- Scan — Discover styling patterns via parallel sub-agents
- Report — Write findings to external report file
- Generate — Build/update reference doc from report
- Verify — Validate file paths and variable names exist
Key Rules:
- Generic — works with any CSS methodology (SCSS, Less, CSS Modules, Tailwind, styled-components)
- Detect styling approach first, then scan for approach-specific patterns
- Every example must come from actual stylesheets with file:line references
- Focus on project conventions, not generic CSS tutorials
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Scan SCSS Styling
Phase 0: Read & Assess
- Read
docs/project-reference/scss-styling-guide.md
- Detect mode: init (placeholder) or sync (populated)
- If sync: extract existing sections and note what's already well-documented
Phase 1: Plan Scan Strategy
Detect styling approach:
*.scss files → SCSS/Sass (check for BEM patterns, mixins, variables)
*.less files → Less
*.module.css / *.module.scss → CSS Modules
tailwind.config.* → Tailwind CSS
styled-components / emotion in package.json → CSS-in-JS
- Multiple approaches → document each
Identify styling infrastructure:
- Global styles entry point (
styles.scss, global.css)
- Theme files (CSS custom properties, SCSS theme maps)
- Design token files (JSON tokens, CSS variables)
- Shared mixins/variables directories
Use docs/project-config.json styling section if available.
Phase 2: Execute Scan (Parallel Sub-Agents)
Launch 2 Explore agents in parallel:
Agent 1: SCSS Architecture & Variables
- Glob for
**/*.scss (or detected extension) to map stylesheet tree
- Find the main/global stylesheet entry points and their @import/@use chains
- Grep for SCSS variables (
$variable-name) — inventory the most-used ones
- Find mixin definitions (
@mixin) and their usage frequency
- Discover function definitions (
@function)
- Find design token files (CSS custom properties
--token-name, JSON token files)
- Look for breakpoint definitions and responsive mixins
Agent 2: BEM Patterns & Theming
- Grep for BEM class patterns in templates/HTML (
block__element--modifier)
- Find BEM naming conventions (separator style, nesting depth)
- Discover theming patterns (light/dark, CSS custom properties, theme switching)
- Find component-scoped vs global style patterns
- Look for z-index management (variables, scale)
- Find animation/transition conventions
- Identify color palette definitions and usage patterns
Write all findings to: plans/reports/scan-scss-styling-{YYMMDD}-{HHMM}-report.md
Phase 3: Analyze & Generate
Read the report. Build these sections:
Target Sections
| Section |
Content |
| BEM Methodology |
BEM naming convention used, nesting rules, examples from actual components |
| SCSS Architecture |
File organization, import chain, global vs component styles |
| Mixins & Variables |
Inventory table: mixin/variable name, purpose, file location, usage count |
| Theming |
Theme approach (CSS vars, SCSS maps, etc.), how to add/modify themes |
| Responsive Patterns |
Breakpoint definitions, responsive mixins, mobile-first vs desktop-first |
| Design Tokens |
Token naming convention, categories (color, spacing, typography), file locations |
| Color Palette |
Color variables/tokens with their hex values and semantic names |
| Z-Index Scale |
Z-index variable definitions and layering conventions |
Content Rules
- Show actual SCSS/CSS snippets (5-15 lines) from the project with
file:line references
- Include variable/mixin inventory tables with usage counts
- Use color swatches or hex values for color palette documentation
- Show BEM examples from real components (not fabricated)
Phase 4: Write & Verify
- Write updated doc with
<!-- Last scanned: YYYY-MM-DD --> at top
- Verify: 5 stylesheet file paths exist (Glob check)
- Verify: variable names in examples match actual SCSS definitions
- Report: sections updated, variables counted, theming approach documented
IMPORTANT Task Planning Notes (MUST FOLLOW)
- Always plan and break work into many small todo tasks using TaskCreate
- Always add a final review todo task to verify work quality and identify fixes/enhancements
1---2name: scan-scss-styling3description: [Documentation] Scan project and populate/sync docs/project-reference/scss-styling-guide.md with BEM methodology, SCSS architecture, mixins, variables, theming, and responsive patterns.4---5
6> **[IMPORTANT]** Use `TaskCreate` to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
7
8**Prerequisites:** **MUST READ** before executing:
9
10- `.claude/skills/shared/scan-and-update-reference-doc-protocol.md`
11- `.claude/skills/shared/understand-code-first-protocol.md`
12
13## Quick Summary
14
15**Goal:** Scan project stylesheets and populate `docs/project-reference/scss-styling-guide.md` with BEM methodology usage, SCSS architecture, mixins/variables inventory, theming patterns, responsive breakpoints, and design token conventions.
16
17**Workflow:**
18
191. **Read** — Load current target doc, detect init vs sync mode
202. **Scan** — Discover styling patterns via parallel sub-agents
213. **Report** — Write findings to external report file
224. **Generate** — Build/update reference doc from report
235. **Verify** — Validate file paths and variable names exist
24
25**Key Rules:**
26
27- Generic — works with any CSS methodology (SCSS, Less, CSS Modules, Tailwind, styled-components)
28- Detect styling approach first, then scan for approach-specific patterns
29- Every example must come from actual stylesheets with file:line references
30- Focus on project conventions, not generic CSS tutorials
31
32**Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).**
33
34# Scan SCSS Styling
35
36## Phase 0: Read & Assess
37
381. Read `docs/project-reference/scss-styling-guide.md`
392. Detect mode: init (placeholder) or sync (populated)
403. If sync: extract existing sections and note what's already well-documented
41
42## Phase 1: Plan Scan Strategy
43
44Detect styling approach:
45
46- `*.scss` files → SCSS/Sass (check for BEM patterns, mixins, variables)
47- `*.less` files → Less
48- `*.module.css` / `*.module.scss` → CSS Modules
49- `tailwind.config.*` → Tailwind CSS
50- `styled-components` / `emotion` in package.json → CSS-in-JS
51- Multiple approaches → document each
52
53Identify styling infrastructure:
54
55- Global styles entry point (`styles.scss`, `global.css`)
56- Theme files (CSS custom properties, SCSS theme maps)
57- Design token files (JSON tokens, CSS variables)
58- Shared mixins/variables directories
59
60Use `docs/project-config.json` styling section if available.
61
62## Phase 2: Execute Scan (Parallel Sub-Agents)
63
64Launch **2 Explore agents** in parallel:
65
66### Agent 1: SCSS Architecture & Variables
67
68- Glob for `**/*.scss` (or detected extension) to map stylesheet tree
69- Find the main/global stylesheet entry points and their @import/@use chains
70- Grep for SCSS variables (`$variable-name`) — inventory the most-used ones
71- Find mixin definitions (`@mixin`) and their usage frequency
72- Discover function definitions (`@function`)
73- Find design token files (CSS custom properties `--token-name`, JSON token files)
74- Look for breakpoint definitions and responsive mixins
75
76### Agent 2: BEM Patterns & Theming
77
78- Grep for BEM class patterns in templates/HTML (`block__element--modifier`)
79- Find BEM naming conventions (separator style, nesting depth)
80- Discover theming patterns (light/dark, CSS custom properties, theme switching)
81- Find component-scoped vs global style patterns
82- Look for z-index management (variables, scale)
83- Find animation/transition conventions
84- Identify color palette definitions and usage patterns
85
86Write all findings to: `plans/reports/scan-scss-styling-{YYMMDD}-{HHMM}-report.md`
87
88## Phase 3: Analyze & Generate
89
90Read the report. Build these sections:
91
92### Target Sections
93
94| Section | Content |
95| ----------------------- | -------------------------------------------------------------------------------- |
96| **BEM Methodology** | BEM naming convention used, nesting rules, examples from actual components |
97| **SCSS Architecture** | File organization, import chain, global vs component styles |
98| **Mixins & Variables** | Inventory table: mixin/variable name, purpose, file location, usage count |
99| **Theming** | Theme approach (CSS vars, SCSS maps, etc.), how to add/modify themes |
100| **Responsive Patterns** | Breakpoint definitions, responsive mixins, mobile-first vs desktop-first |
101| **Design Tokens** | Token naming convention, categories (color, spacing, typography), file locations |
102| **Color Palette** | Color variables/tokens with their hex values and semantic names |
103| **Z-Index Scale** | Z-index variable definitions and layering conventions |
104
105### Content Rules
106
107- Show actual SCSS/CSS snippets (5-15 lines) from the project with `file:line` references
108- Include variable/mixin inventory tables with usage counts
109- Use color swatches or hex values for color palette documentation
110- Show BEM examples from real components (not fabricated)
111
112## Phase 4: Write & Verify
113
1141. Write updated doc with `<!-- Last scanned: YYYY-MM-DD -->` at top
1152. Verify: 5 stylesheet file paths exist (Glob check)
1163. Verify: variable names in examples match actual SCSS definitions
1174. Report: sections updated, variables counted, theming approach documented
118
119---
120
121**IMPORTANT Task Planning Notes (MUST FOLLOW)**
122
123- Always plan and break work into many small todo tasks using TaskCreate
124- Always add a final review todo task to verify work quality and identify fixes/enhancements