@stayicon/drift-guard 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,8 +4,13 @@
4
4
 
5
5
  > When AI writes code, your design survives.
6
6
 
7
- [![npm version](https://badge.fury.io/js/drift-guard.svg)](https://www.npmjs.com/package/drift-guard)
7
+ [![npm version](https://img.shields.io/npm/v/@stayicon/drift-guard)](https://www.npmjs.com/package/@stayicon/drift-guard)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![Tests](https://img.shields.io/badge/tests-130%2F130-brightgreen)](https://github.com/Hwani-Net/drift-guard)
10
+
11
+ <p align="center">
12
+ <img src="docs/assets/cli-demo.png" alt="drift-guard CLI demo" width="680">
13
+ </p>
9
14
 
10
15
  ---
11
16
 
@@ -117,6 +122,30 @@ npx drift-guard snapshot update
117
122
  | 🌫️ Shadows | `box-shadow`, `text-shadow` | `box-shadow: 0 4px 6px rgba(0,0,0,0.1)` |
118
123
  | ⭕ Radius | `border-radius` | `border-radius: 8px` |
119
124
  | 📐 Layout | `display`, `flex-direction`, `justify-content`, `align-items` | `display: flex` |
125
+ | ✨ Effects | `backdrop-filter`, `filter`, `animation`, `transition` | `backdrop-filter: blur(10px)` |
126
+ | 🏗️ Structure | Semantic tags, DOM depth, layout hash, child sequence | `<header> → <nav> → <main> → <footer>` |
127
+
128
+ ### DOM Structure Detection (v0.2.0)
129
+
130
+ drift-guard now fingerprints your HTML structure — not just CSS tokens.
131
+
132
+ ```bash
133
+ # Initialize with structure tracking (on by default)
134
+ npx drift-guard init --from design.html
135
+
136
+ # Check detects structural changes too
137
+ npx drift-guard check
138
+ # 🏗️ Structure Drift:
139
+ # ⚠️ maxDepth: 6 → 4
140
+ # ⚠️ section count: 3 → 2
141
+ # ⚠️ layoutHash changed
142
+ ```
143
+
144
+ What it tracks:
145
+ - **Semantic tags**: `header`, `nav`, `main`, `section`, `article`, `aside`, `footer` counts
146
+ - **Max depth**: DOM nesting depth changes (AI flattening your layout)
147
+ - **Layout hash**: `display:flex/grid` element fingerprint
148
+ - **Child sequence**: Body direct children order changes
120
149
 
121
150
  ## Supported AI Tools
122
151
 
@@ -184,6 +213,7 @@ const rules = generateRules(snapshot, 'claude-md');
184
213
  | **AI-aware** | ✅ Generates agent rules | ❌ No AI integration |
185
214
  | **Speed** | < 1 second | Minutes (browser rendering) |
186
215
  | **Dependencies** | Zero (no browser) | Headless Chrome required |
216
+ | **Token overhead** | 0 tokens (CLI) | N/A |
187
217
  | **Cost** | Free, forever | Percy: $99+/mo for teams |
188
218
 
189
219
  ## Philosophy