') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - Dragoon0x/stackmd: Extract full product DNA from any live URL. Brand voice, UX patterns, content strategy, visual design, accessibility, SEO, performance, tech stack detection, CRO audit, design system maturity, PLG detection, enterprise readiness. 64 extraction passes. 20 intelligence engines. 138 tests. · GitHub
Skip to content

Repository files navigation

stackmd

Extract full product DNA from any live URL into a single STACK.md file.

npx stackmd https://example.com

stackmd crawls any URL and extracts the full product DNA: brand voice, UX patterns, content strategy, visual design, information architecture, component behavior, SEO structure, performance signals, and technology stack. 64 extraction passes. 20 intelligence engines. 30 output sections. 138 tests. Everything an AI agent needs to rebuild a product that works, feels, and thinks like the original.

This project is for educational and experimental purposes only. It reads publicly visible computed styles, content, and structure from rendered web pages. No ownership of any product identity is claimed. See Disclaimer.

What it extracts

STACK.md covers 30 sections. Every section gives an AI coding agent real context, not just tokens.

#SectionWhat it captures
1Product IdentityName, tagline, page type, detected frameworks, voice personality
2Product DNA Score0-100 across visual, voice, UX, accessibility, SEO, performance
3Brand Voice & TonePersonality traits, reading level, pronoun strategy, CTA patterns, vocabulary
4Content StrategyHeading hierarchy, form labels, placeholders, microcopy, writing density
5Visual Design SystemColors, typography, spacing grid, depth, dark mode
6Component StylingButtons, inputs, cards, navigation with full CSS per variant
7UX PatternsPage type, conversion strategy, hero, forms, social proof, sticky elements
8Information ArchitectureNavigation links, page sections, footer, structure stats
9Component BehaviorTooltips, modals, drawers, form validation, focus management
10Motion & AnimationTransition durations, easings, keyframe animations
11Responsive StrategyBreakpoints from @media rules
12Accessibility ProfileWCAG contrast, heading order, landmarks, ARIA, focus, reduced motion
13SEO & PerformanceTitle, meta, structured data, Open Graph, DOM nodes, lazy loading
14Technology StackReact/Next/Vue/Angular/Svelte, Tailwind/Bootstrap, analytics, hosting
15Icons & MediaIcon system, image treatments, font loading, gradients
16-20Deep ExtractionTypography, color context, layout, forms, navigation deep analysis
21Cookie & ConsentBanner type, position, compliance, dark pattern detection
22UI Component PatternsTabs, accordions, breadcrumbs, pagination, timelines, steppers
23Data DisplayTables, card variants, sortable/filterable, responsive
24Loading & StateSpinners, skeletons, shimmer, empty states, progress indicators
25Search & FilteringSearch type, autocomplete, filter controls, sort UI
26Social Proof & FAQTestimonials, ratings, FAQ schema, accordion types
27Code DisplaySyntax highlighting, copy buttons, themes, languages
28Security & PWAHTTPS, CSP, SRI, service worker, manifest, installability
29Above the FoldHeadline, primary CTA, hero section, render-blocking resources
30Intelligence ReportCRO audit, mobile UX, design system maturity, brand consistency, PLG, enterprise readiness, design trends

New in v0.2.0

  • 64 extraction passes (was 36)
  • 20 intelligence engines (was 11) — CRO audit, mobile UX, design system maturity, brand consistency, info hierarchy, PLG detection, enterprise readiness, design trends
  • 30 STACK.md sections (was 15)
  • 138 tests (was 117)
  • --html flag — visual HTML report with dark theme
  • --compare <url> flag — side-by-side comparison of two URLs
  • 6,342 lines of code (was 4,386)

How it works

  1. Puppeteer loads the page in a headless browser
  2. Every visible DOM element is scanned for computed styles
  3. All text content is analyzed for voice, tone, and reading level
  4. Navigation, sections, and page structure are mapped
  5. UX patterns (hero, CTAs, forms, social proof) are detected by heuristic
  6. Component behavior (modals, tooltips, validation) is inventoried
  7. Technology stack is identified from DOM signatures and CSS variable patterns
  8. SEO structure and performance signals are collected
  9. Everything is scored across 10 dimensions and output as a structured STACK.md

Install

npm install -g stackmd

Usage

stackmd https://example.com
stackmd https://example.com -o ./docs/product-dna.md
stackmd https://example.com --dark --json
stackmd https://example.com --wait 5000

Options

FlagDescriptionDefault
-o, --output <path>Output file path./STACK.md
--jsonOutput raw data as JSONfalse
--darkExtract dark mode tokensfalse
--wait <ms>Wait time for dynamic content3000

Programmatic API

import{stack}from"stackmd";constresult=awaitstack("https://example.com",{wait: 3000,extractDark: true,onProgress: (msg)=>console.log(msg),});result.markdown// STACK.md contentresult.data.brandVoice// personality, reading level, CTA patternsresult.data.uxAnalysis// page type, conversion strategy, patternsresult.data.designSystem// colors, fonts, spacing, componentsresult.data.techStack// frameworks, CSS framework, analyticsresult.data.dnaScore// 0-100 across 10 dimensions

Disclaimer

This tool is provided strictly for educational and experimental purposes. It reads publicly visible computed CSS values, text content, and DOM structure from rendered web pages, equivalent to what any browser's developer tools expose.

  • No proprietary code, assets, or non-public information is accessed
  • Extracted data represents publicly visible content and styling
  • No ownership of any product identity, brand, or design system is claimed
  • Users are responsible for ensuring compliance with applicable terms of service
  • This tool does not bypass any access controls, authentication, or rate limiting
  • Output should not be used to create confusingly similar products or infringe on trademarks

The author provides this tool as-is with no warranty. Use responsibly.

License

MIT

About

Extract full product DNA from any live URL. Brand voice, UX patterns, content strategy, visual design, accessibility, SEO, performance, tech stack detection, CRO audit, design system maturity, PLG detection, enterprise readiness. 64 extraction passes. 20 intelligence engines. 138 tests.

Topics

Resources

Stars

78 stars

Watchers

0 watching

Forks

Contributors

Languages