Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BaselAshraf81/holystitch/llms.txt
Use this file to discover all available pages before exploring further.
The contribution philosophy
HolyStitch is a compiler, not a prompt. The HTML-to-JSX transformation inpackages/mcp-server/src/pipeline/compiler.ts is deterministic: given the same Stitch HTML input, it always produces the same JSX output.
That means the most valuable contribution is a failing test case — a snippet of Stitch HTML that the compiler converts incorrectly, paired with what the correct output should look like. A good test case is a precise, reproducible bug report. It tells you exactly where the regex or attribute-transform logic breaks down, and it gives anyone fixing the bug an instant pass/fail verification.
How the compiler works
The compiler (compiler.ts) is a two-phase pipeline:
- Pre-processing — pattern-specific transforms that cannot be done safely with a single regex pass (Material Icons text stripping, curly brace escaping in
<pre>blocks). - Tag and attribute rewriting — a regex pass over the HTML that rewrites every opening tag: attribute renames, style string conversion, void-element self-closing, and event-handler camelCasing.
<>…</>).
Because the compiler is regex-based, it can go wrong in a few predictable ways:
- A regex doesn’t match an unexpected variant of valid HTML (e.g. attributes with single-quoted values, attributes with no value at all)
- An attribute rename is missing from
ATTR_MAPorEVENT_MAP - A CSS value contains a construct the style-parser hasn’t seen before (nested
calc(), custom property fallbacks,font-variation-settings) - The Material Icons regex doesn’t match a new icon class variant Stitch emits
Patterns the compiler handles
Understanding what the compiler already covers helps you identify what might be missing.Attribute renames
Standard HTML attributes are renamed to their JSX equivalents. The full mapping is inATTR_MAP in compiler.ts.
Inline style conversion
CSS style strings are converted to JSX style objects. Hyphenated property names are camelCased. Complex values likeurl(), calc(), and var() are preserved as strings.
Material Symbols / Icons text stripping
Stitch emits the icon name as both adata-icon attribute and as text content. The Material Symbols font renders the glyph via CSS class — if the text content is left in place, the icon name appears as visible text. The compiler strips it.
data-icon attribute is dropped entirely (it is a Stitch artifact with no use in React).
data-alt → alt promotion
Stitch uses data-alt on <img> elements instead of the standard alt attribute. The compiler promotes data-alt to a real alt prop and removes the data-alt. If both alt and data-alt are present, data-alt wins (it is the more descriptive value Stitch provides).
<pre><code> curly brace escaping
Stitch code examples contain raw { and } characters. JSX treats bare curly braces as expression delimiters, which causes a parse error. The compiler replaces them with HTML entities inside every <pre> block.
Fragment wrapping for multiple root elements
JSX requires a single root element. If the compiled output has more than one root, the compiler wraps the entire output in a fragment.What a good test case looks like
A good test case has three parts:- The Stitch HTML snippet — the smallest fragment that reproduces the problem. Trim it down to the relevant element if possible.
- The wrong JSX — what the compiler currently outputs.
- The expected JSX — what it should output.
Opening a bug report
Reproduce the problem
Build the project locally (
npm install && npm run build) and run a conversion that triggers the bad output. Copy the relevant fragment from the stitch-source/ directory that HolyStitch writes alongside every conversion.Trim the snippet
Reduce the HTML to the smallest fragment that still shows the wrong output. A 3-line snippet is easier to act on than a 300-line screen.
Open an issue
Go to github.com/BaselAshraf81/holystitch/issues and open a new issue. Include:
- The HTML input
- The current (wrong) JSX output
- The expected JSX output
- The Stitch screen or component name if relevant
Opening a pull request
Locate the relevant code
Almost all HTML-to-JSX logic lives in two files:
packages/mcp-server/src/pipeline/compiler.ts— attribute transforms, style parsing, pre-processingpackages/mcp-server/src/pipeline/parser.ts— Stitch HTML parsing, component extraction, Tailwind config extraction
compiler.ts for attribute or style issues. Start with parser.ts for component-boundary or structure issues.Make your fix
Edit the relevant file. For a new attribute rename, add an entry to
ATTR_MAP. For a new Material Icons class variant, extend the regex in preProcessHTML. For a style-parsing issue, update splitCssDeclarations or styleStringToObject.There is no automated test suite at this time. Verification is manual: build the project, point your MCP host at the local
dist/index.js, run a conversion, and confirm the output is correct. See Local development for setup instructions.