Usage: /implement-ag-playbook PLAYBOOK_NAME [MODE]
Examples:
/implement-ag-playbook onboarding - Implement all available prompts
/implement-ag-playbook login 3-frameworks - Implement only PROMPT-3-FRAMEWORKS.md
/implement-ag-playbook login react - Implement only PROMPT-REACT.md
Implement the specified playbook based on its existing PROMPT specification files.
Playbook Structure Reference
Complete playbooks have this structure (see v2/playbooks/README.md):
v2/playbooks/[name]/
├── PROMPT-3-FRAMEWORKS.md # Builds → react-example/, vue-example/, lit-example/
├── PROMPT-REACT.md # Builds → react/
├── PROMPT-VUE.md # Builds → vue/
├── PROMPT-LIT.md # Builds → lit/
└── design/ # Shared assets (mockups, icons, images)
Single-Framework vs 3-Frameworks differences:
- Different fonts (e.g., Playfair Display vs Merriweather)
- Different social icons (e.g., Apple vs Facebook)
- Different asset filenames (e.g.,
logo.svg vs logo-3-frameworks.svg)
Phase 0: Validation
Verify playbook exists
- Check
v2/playbooks/$ARGUMENTS/ exists
- List available PROMPT files:
PROMPT-3-FRAMEWORKS.md
PROMPT-REACT.md
PROMPT-VUE.md
PROMPT-LIT.md
- If MODE specified, verify that PROMPT file exists
- If no MODE specified, ask user which to implement
Read the prompt specification
- Read the target PROMPT file(s)
- Extract:
- Required components (for
agnosticui-cli add)
- Design specifications
- Font requirements
- Asset copying instructions
- Framework-specific configurations
Phase 1: Project Scaffolding
Create Vite project(s)
- Navigate to
v2/playbooks/$ARGUMENTS/
- Create appropriate project(s):
For 3-frameworks mode:
npm create vite@latest react-example -- --template react-ts
npm create vite@latest vue-example -- --template vue-ts
npm create vite@latest lit-example -- --template lit-ts
For single-framework mode:
npm create vite@latest react -- --template react-ts # PROMPT-REACT.md
npm create vite@latest vue -- --template vue-ts # PROMPT-VUE.md
npm create vite@latest lit -- --template lit-ts # PROMPT-LIT.md
Install dependencies
- React:
npm install && npm install lucide-react lit
- Vue:
npm install && npm install lucide-vue-next lit
- Lit:
npm install && npm install lit
Initialize AgnosticUI CLI
npx agnosticui-cli init --framework [react|vue|lit] --skip-prompts
npx agnosticui-cli add [COMPONENTS from prompt]
Phase 2: Configuration
Copy design assets (if applicable)
- Check
design/ folder for assets beyond mockups
- Not all playbooks have assets to copy - some only have mockups (e.g.,
onboarding)
- If assets exist (icons, logos, background images), copy to each project's
public/ folder
- Follow asset instructions in the PROMPT file
Vue vite.config.ts
- Add custom element recognition for
ag-* tags:
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('ag-'),
},
},
})
Token imports
- Import in each project's entry point:
import './components/ag/styles/ag-tokens.css'
import './components/ag/styles/ag-tokens-dark.css'
Font setup
- Add Google Fonts link to each
index.html per PROMPT specification
TypeScript configuration (Vue)
- If CLI-generated code causes errors, relax
tsconfig.app.json:
"strict": false,
"noUnusedLocals": false,
"noUnusedParameters": false
Phase 3: Implementation
Implement each framework
- Follow the PROMPT specification exactly
- React:
src/App.tsx using React wrappers + lucide-react
- Vue:
src/App.vue using Vue wrappers + lucide-vue-next
- Lit: Custom element using core components + inline SVG icons
Verify builds
- Run
npm run build in each project
- Fix any TypeScript or build errors
- Test with
npm run dev
Phase 4: Verification
Visual verification
- Run each example
- Compare against design mockups in
design/
- Check responsive breakpoints
- Verify component interactions
Cross-framework consistency
- All implementations should behave identically
- State management works correctly
- Styling matches across frameworks
Phase 5: Commit
- Stage and commit
- Show
git diff --stat
- Commit with descriptive message
- WAIT FOR USER APPROVAL
Key Patterns
Icon Imports
- React:
import { Icon } from "lucide-react"
- Vue:
import { Icon } from "lucide-vue-next"
- Lit: Inline SVG templates (lucide doesn't work directly)
Component Imports
- React:
./components/ag/[Component]/react/
- Vue:
./components/ag/[Component]/vue/
- Lit:
./components/ag/[Component]/core/
Event Handling
- Selection components emit
selection-change events
- Event detail:
{ value, checked, selectedValues }
Common Issues & Fixes
| Issue |
Fix |
Vue ag-* warnings |
Add isCustomElement to vite.config.ts |
| TypeScript strict errors |
Relax tsconfig.app.json settings |
| Missing dark mode |
Import both ag-tokens.css AND ag-tokens-dark.css |
Button isDisabled prop |
Use disabled not isDisabled |
| Timeline connector misalignment |
Ensure core component has ::slotted(*) { box-sizing: border-box } |
Incomplete Playbook Warning
If a playbook is missing PROMPT files, notify the user:
Warning: The $ARGUMENTS playbook is incomplete.
Present: [list files]
Missing: [list files]
Complete playbooks should have:
PROMPT-3-FRAMEWORKS.md → react-example/, vue-example/, lit-example/
PROMPT-REACT.md → react/
PROMPT-VUE.md → vue/
PROMPT-LIT.md → lit/
Would you like to:
- Implement only the available prompts
- Generate the missing PROMPT files first
1---2name: implement-ag-playbook3description: Implement a playbook from its PROMPT specification files. Supports both single-framework (PROMPT-REACT.md, etc.) and 3-framework (PROMPT-3-FRAMEWORKS.md) modes.4---5
6**Usage:** `/implement-ag-playbook PLAYBOOK_NAME [MODE]`
7
8**Examples:**
9- `/implement-ag-playbook onboarding` - Implement all available prompts
10- `/implement-ag-playbook login 3-frameworks` - Implement only PROMPT-3-FRAMEWORKS.md
11- `/implement-ag-playbook login react` - Implement only PROMPT-REACT.md
12
13Implement the specified playbook based on its existing PROMPT specification files.
14
15---
16
17## Playbook Structure Reference
18
19Complete playbooks have this structure (see `v2/playbooks/README.md`):
20
21```
22v2/playbooks/[name]/
23├── PROMPT-3-FRAMEWORKS.md # Builds → react-example/, vue-example/, lit-example/
24├── PROMPT-REACT.md # Builds → react/
25├── PROMPT-VUE.md # Builds → vue/
26├── PROMPT-LIT.md # Builds → lit/
27└── design/ # Shared assets (mockups, icons, images)
28```
29
30**Single-Framework vs 3-Frameworks differences:**
31- Different fonts (e.g., Playfair Display vs Merriweather)
32- Different social icons (e.g., Apple vs Facebook)
33- Different asset filenames (e.g., `logo.svg` vs `logo-3-frameworks.svg`)
34
35---
36
37## Phase 0: Validation
38
391. **Verify playbook exists**
40 - Check `v2/playbooks/$ARGUMENTS/` exists
41 - List available PROMPT files:
42 - `PROMPT-3-FRAMEWORKS.md`
43 - `PROMPT-REACT.md`
44 - `PROMPT-VUE.md`
45 - `PROMPT-LIT.md`
46 - If MODE specified, verify that PROMPT file exists
47 - If no MODE specified, ask user which to implement
48
492. **Read the prompt specification**
50 - Read the target PROMPT file(s)
51 - Extract:
52 - Required components (for `agnosticui-cli add`)
53 - Design specifications
54 - Font requirements
55 - Asset copying instructions
56 - Framework-specific configurations
57
58---
59
60## Phase 1: Project Scaffolding
61
623. **Create Vite project(s)**
63 - Navigate to `v2/playbooks/$ARGUMENTS/`
64 - Create appropriate project(s):
65
66 **For 3-frameworks mode:**
67 ```bash
68 npm create vite@latest react-example -- --template react-ts
69 npm create vite@latest vue-example -- --template vue-ts
70 npm create vite@latest lit-example -- --template lit-ts
71 ```
72
73 **For single-framework mode:**
74 ```bash
75 npm create vite@latest react -- --template react-ts # PROMPT-REACT.md
76 npm create vite@latest vue -- --template vue-ts # PROMPT-VUE.md
77 npm create vite@latest lit -- --template lit-ts # PROMPT-LIT.md
78 ```
79
804. **Install dependencies**
81 - **React:** `npm install && npm install lucide-react lit`
82 - **Vue:** `npm install && npm install lucide-vue-next lit`
83 - **Lit:** `npm install && npm install lit`
84
855. **Initialize AgnosticUI CLI**
86 - For each project:
87 ```bash
88 npx agnosticui-cli init --framework [react|vue|lit] --skip-prompts
89 npx agnosticui-cli add [COMPONENTS from prompt]
90 ```
91
92---
93
94## Phase 2: Configuration
95
966. **Copy design assets (if applicable)**
97 - Check `design/` folder for assets beyond mockups
98 - **Not all playbooks have assets to copy** - some only have mockups (e.g., `onboarding`)
99 - If assets exist (icons, logos, background images), copy to each project's `public/` folder
100 - Follow asset instructions in the PROMPT file
101
1027. **Vue vite.config.ts**
103 - Add custom element recognition for `ag-*` tags:
104 ```typescript
105 vue({
106 template: {
107 compilerOptions: {
108 isCustomElement: (tag) => tag.startsWith('ag-'),
109 },
110 },
111 })
112 ```
113
1148. **Token imports**
115 - Import in each project's entry point:
116 ```typescript
117 import './components/ag/styles/ag-tokens.css'
118 import './components/ag/styles/ag-tokens-dark.css'
119 ```
120
1219. **Font setup**
122 - Add Google Fonts link to each `index.html` per PROMPT specification
123
12410. **TypeScript configuration (Vue)**
125 - If CLI-generated code causes errors, relax `tsconfig.app.json`:
126 ```json
127 "strict": false,
128 "noUnusedLocals": false,
129 "noUnusedParameters": false
130 ```
131
132---
133
134## Phase 3: Implementation
135
13611. **Implement each framework**
137 - Follow the PROMPT specification exactly
138 - **React:** `src/App.tsx` using React wrappers + lucide-react
139 - **Vue:** `src/App.vue` using Vue wrappers + lucide-vue-next
140 - **Lit:** Custom element using core components + inline SVG icons
141
14212. **Verify builds**
143 - Run `npm run build` in each project
144 - Fix any TypeScript or build errors
145 - Test with `npm run dev`
146
147---
148
149## Phase 4: Verification
150
15113. **Visual verification**
152 - Run each example
153 - Compare against design mockups in `design/`
154 - Check responsive breakpoints
155 - Verify component interactions
156
15714. **Cross-framework consistency**
158 - All implementations should behave identically
159 - State management works correctly
160 - Styling matches across frameworks
161
162---
163
164## Phase 5: Commit
165
16615. **Stage and commit**
167 - Show `git diff --stat`
168 - Commit with descriptive message
169 - **WAIT FOR USER APPROVAL**
170
171---
172
173## Key Patterns
174
175### Icon Imports
176- **React:** `import { Icon } from "lucide-react"`
177- **Vue:** `import { Icon } from "lucide-vue-next"`
178- **Lit:** Inline SVG templates (lucide doesn't work directly)
179
180### Component Imports
181- **React:** `./components/ag/[Component]/react/`
182- **Vue:** `./components/ag/[Component]/vue/`
183- **Lit:** `./components/ag/[Component]/core/`
184
185### Event Handling
186- Selection components emit `selection-change` events
187- Event detail: `{ value, checked, selectedValues }`
188
189---
190
191## Common Issues & Fixes
192
193| Issue | Fix |
194|-------|-----|
195| Vue `ag-*` warnings | Add `isCustomElement` to vite.config.ts |
196| TypeScript strict errors | Relax `tsconfig.app.json` settings |
197| Missing dark mode | Import both `ag-tokens.css` AND `ag-tokens-dark.css` |
198| Button `isDisabled` prop | Use `disabled` not `isDisabled` |
199| Timeline connector misalignment | Ensure core component has `::slotted(*) { box-sizing: border-box }` |
200
201---
202
203## Incomplete Playbook Warning
204
205If a playbook is missing PROMPT files, notify the user:
206
207> **Warning:** The `$ARGUMENTS` playbook is incomplete.
208>
209> **Present:** [list files]
210> **Missing:** [list files]
211>
212> Complete playbooks should have:
213> - `PROMPT-3-FRAMEWORKS.md` → `react-example/`, `vue-example/`, `lit-example/`
214> - `PROMPT-REACT.md` → `react/`
215> - `PROMPT-VUE.md` → `vue/`
216> - `PROMPT-LIT.md` → `lit/`
217>
218> Would you like to:
219> 1. Implement only the available prompts
220> 2. Generate the missing PROMPT files first
221
222---