alpine-js — Claude Code skill: what it does, how to install
Guidelines for building reactive Alpine.js interfaces with minimal JavaScript. Helps generate UI components paired with Tailwind CSS, Livewire, and Ghost CMS.
npx skills add Mindrally/skills --skill alpine-js -a claude-codeWhat alpine-js does
This skill guides AI coding assistants to produce clean, declarative Alpine.js markup. It details standard directives like x-data, x-model, x-show, and x-init. The instructions push complex inline code into Alpine.data() components and keep shared application state inside Alpine.store().
Integration recipes cover styling and backend frameworks. For styling, the prompt pairs x-transition and dynamic classes with Tailwind CSS utility classes. When working with Laravel and Livewire, it instructs the agent to handle client interactions locally and bind data via @entangle, leaving network requests to the server.
For rendering performance, the guidelines explicitly favour x-show over x-if where possible. Complex or heavy components require lazy loading and focus management with standard ARIA attributes.
What it helps with
- build accessible dropdowns with Tailwind transitions
- sync frontend state with Laravel Livewire using
@entangle - extract heavy inline logic into modular
Alpine.data()stores - validate forms dynamically without external JS bundles
Example prompts for the agent
- Create an Alpine.js dropdown menu with Tailwind CSS transitions and click-outside dismissal
- Implement form validation for an email field using x-model in Alpine.js
- Connect an Alpine.js interactive toggle to a Livewire property via @entangle
How to install alpine-js
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill alpine-js -a claude-code2Manually: put the files in place
~/.claude/skills/alpine-js/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/alpine-js/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill alpine-js -a codex2Manually: put the files in place
.agents/skills/alpine-js/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill alpine-js -a cursor2Manually: put the files in place
.cursor/skills/alpine-js/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills alpine-js2Manually: put the files in place
.github/skills/alpine-js/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill alpine-js -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path alpine-jsManually: put the files in place
.devin/skills/alpine-js/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill alpine-js -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about alpine-js
How to install alpine-js in Claude Code?
Run npx skills add Mindrally/skills --skill alpine-js -a claude-code. The file will be placed into ~/.claude/skills/alpine-js/SKILL.md.
What does the alpine-js skill do?
It provides architectural rules and directive patterns for Alpine.js development. The agent learns how to structure lightweight reactive interfaces alongside Tailwind CSS and backend stacks.
Why does the guide prefer x-show over x-if?
The skill recommends x-show over x-if to avoid frequent DOM insertion and removal, keeping component toggles faster.
Source text
SKILL.md · Apache-2.0
---
name: alpine-js
description: Alpine.js development guidelines for lightweight reactive interactions with Tailwind CSS and various backend frameworks.
metadata:
maintainer: Mindrally
source: https://github.com/Mindrally/skills
---
# Alpine.js Development
You are an expert in Alpine.js for building lightweight, reactive web interfaces.
## Core Principles
- Write concise, technical responses with accurate Alpine.js examples
- Use Alpine.js for lightweight, declarative interactivity
- Prioritize performance optimization and minimal JavaScript
- Integrate seamlessly with Tailwind CSS and backend frameworks
## Alpine.js Fundamentals
### Directives
- `x-data` - Define reactive data for a component
- `x-bind` - Bind attributes to expressions
- `x-on` - Attach event listeners
- `x-model` - Two-way data binding for inputs
- `x-show` / `x-if` - Conditional rendering
- `x-for` - Loop through arrays
- `x-text` / `x-html` - Set text or HTML content
- `x-ref` - Reference DOM elements
- `x-init` - Run code on initialization
### Component Pattern
```html
<div x-data="{ open: false, count: 0 }">
<button @click="open = !open">Toggle</button>
<div x-show="open" x-transition>
<p x-text="count"></p>
<button @click="count++">Increment</button>
</div>
</div>
```
## Integration Patterns
### With Tailwind CSS
- Use Tailwind for styling, Alpine for behavior
- Combine `x-bind:class` with Tailwind utilities
- Use transitions with `x-transition` and Tailwind
### With Laravel/Livewire (TALL Stack)
- Use Alpine for client-side interactivity
- Let Livewire handle server communication
- Use `@entangle` for two-way binding with Livewire
- Keep components focused and modular
### With Ghost CMS
- Use Alpine for dynamic content interactions
- Integrate with Ghost's content API
- Handle data fetching patterns appropriately
## Best Practices
### Performance
- Keep `x-data` objects small and focused
- Use `x-show` over `x-if` when possible for better performance
- Lazy load heavy components
- Minimize DOM manipulation
### Code Organization
- Extract reusable logic into Alpine.data() components
- Use Alpine.store() for shared state
- Keep inline expressions simple; move complex logic to methods
- Use meaningful variable names
### Accessibility
- Ensure keyboard navigation works
- Use proper ARIA attributes
- Test with screen readers
- Maintain focus management
## Common Patterns
### Dropdown Menu
```html
<div x-data="{ open: false }" @click.away="open = false">
<button @click="open = !open">Menu</button>
<div x-show="open" x-transition>
<!-- Menu items -->
</div>
</div>
```
### Form Validation
```html
<form x-data="{ email: '', isValid: false }" @submit.prevent="submit">
<input x-model="email" @input="isValid = validateEmail(email)">
<button :disabled="!isValid">Submit</button>
</form>
```
© Mindrally · Apache-2.0 · Mindrally/skills