agents/vite-react-ts-convex-tailwind/.opencode/skill/vite-shadcn-tailwind4/SKILL.md
Initialize shadcn/ui + Tailwind CSS v4 in Vite projects (Vite-specific, not Next.js/Remix). Use proactively for Vite project setup, shadcn component installation, or Tailwind v4 configuration. Examples: - user: "Setup shadcn in my Vite project" → install deps, configure tailwind v4 CSS-first, init shadcn, verify components work - user: "Add shadcn to existing Vite app" → check existing config, install CLI, add components.json, update CSS imports - user: "Use Tailwind v4 with shadcn" → configure @import with @theme, remove v3 config, setup custom tokens - user: "Create Vite + React + shadcn project" → scaffold Vite, install shadcn, configure theme, add sample components
npx skillsauth add igorwarzocha/opencode-workflows vite-shadcn-tailwind4Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
For Next.js, Remix, or other frameworks, You MUST use their respective shadcn installation guides.
<question_tool>
(Recommended).If prerequisites are missing, You MUST help the user set up Tailwind v4 first. </phase>
<phase name="fix-typescript-aliases"> ## Step 2: Fix TypeScript Aliases The shadcn CLI fails if paths aren't in the root `tsconfig.json`. Vite uses a solution-style config with references, but shadcn doesn't parse those.Action: You MUST update tsconfig.json to include compilerOptions:
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
</phase>
<phase name="verify-vite-config">
## Step 3: Verify Vite Config
You MUST confirm `vite.config.ts` has the Tailwind plugin and path alias:
import tailwindcss from "@tailwindcss/vite";
import path from "path";
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});
</phase>
<phase name="initialize-shadcn">
## Step 4: Initialize Shadcn
You MUST instruct the user to run:
```bash
npx shadcn@latest init
```
You SHOULD recommend these settings:
You MUST wait for user confirmation before continuing. </phase>
<phase name="add-components"> ## Step 5: Add Components You MUST instruct the user to run: ```bash npx shadcn@latest add ```You SHOULD instruct them to select all components (a then Enter).
You MUST wait for user confirmation before continuing. </phase>
<phase name="add-extensions"> ## Step 6: Add Extensions (Optional) If user wants AI elements, You MUST instruct them to run: ```bash npx shadcn@latest add @ai-elements/all ```You SHOULD instruct them to answer NO to all overwrite prompts.
You MUST wait for user confirmation before continuing. </phase>
<phase name="install-missing-dependencies"> ## Step 7: Install Missing Dependencies The CLI MAY miss dependencies. You MUST check `package.json` and install any missing.Required packages:
tw-animate-css (devDep) - v4 replacement for tailwindcss-animatetailwind-merge (dep) - used by cn() utilityclsx (dep) - used by cn() utilityclass-variance-authority (dep) - used by shadcn componentsYou MUST run if any are missing:
npm install tailwind-merge clsx class-variance-authority
npm install -D tw-animate-css
</phase>
<phase name="clean-css">
## Step 8: Clean CSS for v4 Compliance
You MUST rewrite `src/index.css` to match strict v4 structure:
@import "tailwindcss";
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
@theme inline {
/* Variable mappings: --color-X: var(--X); */
}
:root {
/* Token definitions using oklch() */
}
.dark {
/* Dark mode tokens using oklch() */
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
You MUST remove these if present:
@media (prefers-color-scheme) blocks@theme blocks (keep only @theme inline)@config directives
</phase>
You MUST fix any TypeScript errors before marking setup complete. </phase>
</workflow>development
Handle structured co-authoring of professional documentation. Use for proposals, technical specs, and RFCs. Use proactively when a collaborative drafting process (Gathering -> Refinement -> Testing) is needed. Examples: - user: "Draft a technical RFC for the new API" -> follow Stage 1 context gathering - user: "Refine the introduction of this proposal" -> use iterative surgical edits - user: "Test if this document is clear for readers" -> run reader testing workflow
development
Handle Word document (.docx) creation, editing, and analysis with high-fidelity visual review. Use for professional reports, legal documents, and tracked changes. Use proactively when quality and precise formatting are critical. Examples: - user: "Create a professional report in Word" -> use python-docx with render loops - user: "Draft a legal contract with redlines" -> use ooxml redlining workflow - user: "Extract text from this DOCX while preserving structure" -> use pandoc markdown conversion
testing
Apply professional visual themes to documents and presentations. Use for styling artifacts with consistent color palettes and font pairings. Use proactively to quickly improve the aesthetic quality of deliverables. Examples: - user: "Apply a modern theme to this deck" -> use Modern Minimalist theme - user: "I want a tech aesthetic for this doc" -> apply Tech Innovation theme - user: "Create a custom theme for my project" -> generate new color/font specification
tools
Guide for creating effective opencode skills. Use for creating or updating skills that extend agent capabilities with specialized knowledge, workflows, or tool integrations. Examples: - user: "Create a skill for git workflows" → define SKILL.md with instructions and examples - user: "Add examples to my skill" → follow the user: "query" → action pattern - user: "Update skill description" → use literal block scalar and trigger contexts - user: "Structure a complex skill" → organize with scripts/ and references/ directories - user: "Validate my skill" → check structure, frontmatter, and discovery triggers