prototype
MAmattpocock/skills288k近 7 天新增 10,178 个 star
Also available at https://sacred.computer/llm/skills/port-sacred-terminal-ui-to-hostile-react-codebase/SKILL.md
Take a sacred React component (or a sacred screen that mirrors a Simulacrum CLI surface) and graft it into a foreign React codebase that already ships its own design system, build pipeline, and CSS toolchain — without breaking the host or polluting it with sacred-specific globals.
See
components/AGENTS.mdfor the canonical catalog of every sacred React component (props, theming tokens, CLI primitive equivalent). Read it to know which sacred component you are about to graft into the host.
Use this skill when the target repository:
vite, webpack, rollup, parcel, metro)global.css as-is because it would clobber the host's typography, color tokens, or layout primitivesno-default-export, no-css-modules, no-unused-vars on style props, etc.)If you control both repos and the host has no design system, prefer port-sacred-terminal-ui-to-react-using-same-conventions instead — it gives you the full sacred theming for free.
Isolate, don't inherit. Sacred's terminal aesthetic must be opt-in inside one container element, not bleed into the host. You will:
Every sacred selector must live under one root. Pick a host-friendly name:
<div className="sacred-root theme-dark tint-yellow">
<Card title="STATUS">...</Card>
</div>
Copy the relevant --ansi-*, --color-*, and --theme-* tokens from global.css into a host-controlled CSS file scoped to .sacred-root:
.sacred-root {
/* NOTE(your_github_username): Pinned ANSI palette — do not inherit host theme tokens. */
--color-black: #000000;
--color-white: #ffffff;
--color-brand: #e4f221;
--theme-background: var(--color-black);
--theme-text: var(--color-white);
--theme-border: #3a3a3a;
/* ... */
background: var(--theme-background);
color: var(--theme-text);
font-family: 'GeistMono-Regular', Consolas, monospace;
font-variant-numeric: tabular-nums lining-nums;
}
Sacred's tints (tint-green, tint-blue, etc.) work the same way — copy the OKLCH math from global.css and scope it under .sacred-root.theme-dark.tint-green.
Sacred uses Foo.module.css. If the host blocks CSS Modules, translate the rules into the host's equivalent:
| Host system | Translation strategy |
|---|---|
| Tailwind | Map each --theme-* token to a Tailwind theme extension, then use bg-[var(--theme-background)] etc. |
| vanilla-extract | Copy each .foo rule into a style({ ... }) block |
| Stitches/Emotion/styled-components | Wrap the CSS in styled.div\...`` blocks |
| Plain CSS | Inline the CSS Modules content into a single scoped stylesheet |
In every case, every selector must start with .sacred-root so the host's other components are unaffected.
Sacred React components import from @components/... via tsconfig.json paths. The host won't have that alias. Either:
tsconfig.json (cleanest), or@components/Card to a relative path inside the host's src/Sacred avoids runtime dependencies, so there is nothing else to port — no React Query, no Redux, no animation libraries.
Sacred's global.css resets box-sizing, margins, padding, and list styles for every element. Do not import global.css into the host. Re-create only the rules you need under the .sacred-root selector. The host's reset stays untouched.
Wrap your sacred container in a host-managed theme switcher and verify:
<div className={`sacred-root theme-${theme} tint-${tint}`}>
<Card title="STATUS">...</Card>
</div>
If the host already has dark mode, you have two options:
theme-dark from the host theme contextglobal.css into the host. It breaks body, ul, ol, and many other elements.Button, Input, or other primitives with the same name as a host primitive — you will collide. Prefix them: SacredButton, SacredInput.scripts/cli/lib/* into the React bundle. It is Node-only and uses process.stdout.git diff against the previous host build and confirm no host CSS rule changed.A useful "first port" is the Card + DataTable + Button triple. That gives you:
That's enough for a status console, an audit log, or a debugger overlay. Add more sacred primitives (BarLoader, BarProgress, Block, Text) one at a time, scoping each new selector under .sacred-root.
MAmattpocock/skills288k近 7 天新增 10,178 个 star
AFaffaan-m/ECC278k近 7 天新增 4,046 个 star
FIfirecrawl/firecrawl191k近 7 天新增 2,010 个 star
ANanthropics/skills181k近 7 天新增 1,119 个 star
用 React、Tailwind 和 shadcn/ui 构建多组件页面。
ANanthropics/skills181k近 7 天新增 1,119 个 star