Get the FREE Ultimate OpenClaw Setup Guide →

implement-ag-playbook

Scanned
npx machina-cli add skill AgnosticUI/agnosticui/implement-ag-playbook --openclaw
Files (1)
SKILL.md
6.6 KB

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

  1. 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
  2. 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

  1. 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
    
  2. 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
  3. Initialize AgnosticUI CLI

    • For each project:
    npx agnosticui-cli init --framework [react|vue|lit] --skip-prompts
    npx agnosticui-cli add [COMPONENTS from prompt]
    

Phase 2: Configuration

  1. 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
  2. Vue vite.config.ts

    • Add custom element recognition for ag-* tags:
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag.startsWith('ag-'),
        },
      },
    })
    
  3. Token imports

    • Import in each project's entry point:
    import './components/ag/styles/ag-tokens.css'
    import './components/ag/styles/ag-tokens-dark.css'
    
  4. Font setup

    • Add Google Fonts link to each index.html per PROMPT specification
  5. TypeScript configuration (Vue)

    • If CLI-generated code causes errors, relax tsconfig.app.json:
    "strict": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false
    

Phase 3: Implementation

  1. 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
  2. Verify builds

    • Run npm run build in each project
    • Fix any TypeScript or build errors
    • Test with npm run dev

Phase 4: Verification

  1. Visual verification

    • Run each example
    • Compare against design mockups in design/
    • Check responsive breakpoints
    • Verify component interactions
  2. Cross-framework consistency

    • All implementations should behave identically
    • State management works correctly
    • Styling matches across frameworks

Phase 5: Commit

  1. 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

IssueFix
Vue ag-* warningsAdd isCustomElement to vite.config.ts
TypeScript strict errorsRelax tsconfig.app.json settings
Missing dark modeImport both ag-tokens.css AND ag-tokens-dark.css
Button isDisabled propUse disabled not isDisabled
Timeline connector misalignmentEnsure 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.mdreact-example/, vue-example/, lit-example/
  • PROMPT-REACT.mdreact/
  • PROMPT-VUE.mdvue/
  • PROMPT-LIT.mdlit/

Would you like to:

  1. Implement only the available prompts
  2. Generate the missing PROMPT files first

Source

git clone https://github.com/AgnosticUI/agnosticui/blob/master/.claude/skills/implement-ag-playbook/SKILL.mdView on GitHub

Overview

This skill reads the PROMPT specification files for a playbook (PROMPT-REACT.md, PROMPT-VUE.md, PROMPT-LIT.md, or PROMPT-3-FRAMEWORKS.md) and builds the corresponding Vite project scaffolds. It supports both single-framework and 3-framework modes, validating existence, extracting design and asset requirements, and provisioning framework-specific configurations.

How This Skill Works

It validates the playbook path, reads the target PROMPT file(s), and extracts required components, design specs, fonts, and asset-copy instructions. It then scaffolds Vite projects for the selected mode (single framework or three frameworks), installs dependencies, and configures the AgnosticUI CLI setup and assets per the prompt.

When to Use It

  • You need to implement a complete onboarding playbook using the 3-frameworks mode to build react-example, vue-example, and lit-example projects.
  • You want to implement only PROMPT-REACT.md for a single-framework setup.
  • You need to validate that a playbook exists and the required PROMPT files are available before scaffolding.
  • You must scaffold multiple projects (react, vue, and lit) in 3-frameworks mode to cover all frameworks.
  • You need to copy design assets and apply font configurations as specified by the PROMPT files.

Quick Start

  1. Step 1: Identify the playbook name and mode (single-framework or 3-frameworks) and run the validation to read the PROMPT files.
  2. Step 2: Create Vite projects for the target mode (e.g., react-example, vue-example, lit-example) and install dependencies.
  3. Step 3: Initialize the AGN CLI, apply components from the PROMPT, copy design assets, and configure fonts per the design specs.

Best Practices

  • Validate the playbook folder exists under v2/playbooks and that the requested PROMPT file(s) exist before proceeding.
  • Read the PROMPT file thoroughly to extract required components, design specs, fonts, and asset-copy instructions.
  • Follow the exact scaffolding commands for the selected mode (single or 3-frameworks) to ensure consistent project templates.
  • Keep assets located in design/ and copy to each project's public/ folder as instructed by the PROMPT.
  • Test builds for each framework and verify the AgnosticUI CLI initialization steps complete without errors.

Example Use Cases

  • Implement onboarding using PROMPT-3-FRAMEWORKS.md to produce react-example, vue-example, and lit-example projects.
  • Implement login with PROMPT-REACT.md to generate a single React-based project.
  • Copy design assets from design/ into public/ for each generated project as per the PROMPT.
  • Add component prompts via npx agnosticui-cli init and npx agnosticui-cli add using the prompt's components.
  • Configure Vue's vite.config.ts to recognize ag-* custom elements as described in the PROMPT design.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers