home / skills / jackspace / claudeskillz / fluxwing-component-viewer

fluxwing-component-viewer skill

/skills/fluxwing-component-viewer

This skill helps you view detailed information about a uxscii component, including metadata, ASCII preview, and actionable context.

npx playbooks add skill jackspace/claudeskillz --skill fluxwing-component-viewer

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
8.3 KB
---
name: Fluxwing Component Viewer
description: View detailed information about a specific uxscii component including metadata, states, props, and ASCII preview. Use when working with .uxm files, when user wants to see, view, inspect, or get details about a .uxm component.
version: 0.0.1
author: Trabian
allowed-tools: Read, Glob, Grep
---

# Fluxwing Component Viewer

View detailed information about a specific uxscii component from any source.

## Data Location Rules

**READ from (bundled templates - reference only):**
- `{SKILL_ROOT}/../uxscii-component-creator/templates/` - 11 component templates
- `{SKILL_ROOT}/../uxscii-screen-scaffolder/templates/` - 2 screen examples (if available)

**READ from (project workspace):**
- `./fluxwing/components/` - Your created components
- `./fluxwing/library/` - Customized template copies
- `./fluxwing/screens/` - Your created screens

**NEVER write - this is a read-only viewer!**

## Your Task

Display comprehensive details about a single uxscii component, including metadata, ASCII template preview, and context-appropriate actions.

## Component Lookup Process

### 1. Parse Component Name
- Extract component name from user request
- If no name provided: Ask "Which component would you like to view?"
- Normalize name to lowercase with hyphens

### 2. Search Priority Order (Stop at First Match)
Search these locations in order and stop at the first match:

1. **Project Components**: `./fluxwing/components/[name].uxm`
   - User/agent-created custom components
   - Fully editable
   - Tag as: "Your Component"

2. **Project Library**: `./fluxwing/library/[name].uxm`
   - Customized copies of bundled templates
   - Fully editable
   - Tag as: "Your Library"

3. **Bundled Templates**: `{SKILL_ROOT}/../uxscii-component-creator/templates/[name].uxm`
   - Read-only reference templates
   - Must be copied to edit
   - Tag as: "Bundled Template"

**Important**: Stop searching after first match. If found in bundled templates, check if it also exists in user's project and add a note: "šŸ’” You also have a customized version in ./fluxwing/library/"

### 3. Read Component Files
For the matched component, read both files:
- `[name].uxm` - JSON metadata
- `[name].md` - ASCII template

## Display Format

### Concise View (Default)

Present component information in a clean, scannable format:

```
šŸ“„ PRIMARY-BUTTON
─────────────────────────────────────────────────────
šŸ“¦ Source: Bundled Template
šŸ“ Location: Component Creator Templates
ā±ļø  Modified: 2024-10-11 10:30:00
šŸ”– Version: 1.0.0

Description:
Standard clickable button with hover, focus, and disabled states

Component Details:
• Type: button
• Props: text (string), variant (string), disabled (boolean)
• States: default, hover, focus, disabled
• Accessibility: āœ“ Role (button), āœ“ Focusable, āœ“ Keyboard (Space, Enter)

ASCII Template Preview (first 20 lines):

Default State:
ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“
ā–“ {{text}} ā–“
ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“

Hover State:
ā–‘ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘
ā–‘ā–“ {{text}} ā–“ā–‘
ā–‘ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘

Disabled State:
ā”Œ ─ ─ ─ ─ ─┐
│ {{text}} │
ā”” ─ ─ ─ ─ ā”€ā”˜

[... 1 more state]

Template has 4 states total. View full template?
─────────────────────────────────────────────────────
```

### Format Guidelines

**Header Section:**
- Component name in CAPS
- Emoji indicators:
  - šŸ“¦ = Bundled Template
  - āœļø = Your Library
  - šŸŽØ = Your Component
- Full file path for clarity
- Last modified timestamp (if available)
- Version from metadata

**Description:**
- Use the `metadata.description` field from .uxm file
- Keep it concise (1-2 lines)

**Component Details:**
- **Type**: Direct from .uxm `type` field
- **Props**: List prop names with types in parentheses
  - Format: `propName (type)`
  - Example: `text (string), disabled (boolean)`
- **States**: Comma-separated list of state names
- **Accessibility**: Show checkmarks for present features
  - Role, Focusable, Keyboard shortcuts, ARIA labels

**ASCII Template Preview:**
- Show first 20 lines by default
- If template has multiple states, show state labels
- If template exceeds 20 lines, add: `[... N more states/lines]`
- Preserve exact spacing and box-drawing characters
- Show variables as `{{variableName}}`

### Truncation Logic

If `.md` template exceeds 20 lines:
1. Count total states/sections in template
2. Show first 2-3 states completely
3. Add summary line: `[... N more states]`
4. Offer: "View full template?" as interactive option

## Interactive Options

After displaying the component, offer context-appropriate actions:

### For Bundled Templates (read-only)

```
What would you like to do?

1ļøāƒ£ Copy to project library (makes it editable)
2ļøāƒ£ View full template file (all states)
3ļøāƒ£ View full metadata (complete .uxm)
4ļøāƒ£ Browse all components
```

**Action Details:**
- **Copy**: Copy both .uxm and .md to `./fluxwing/library/`
- **View full template**: Display complete .md file (no truncation)
- **View full metadata**: Display complete .uxm JSON
- **Browse**: Return to library browser

### For Project Files (./fluxwing/library/ or ./fluxwing/components/)

```
What would you like to do?

1ļøāƒ£ Edit component (modify .uxm and .md)
2ļøāƒ£ View full template file (all states)
3ļøāƒ£ View full metadata (complete .uxm)
4ļøāƒ£ Delete component (manual: remove files from filesystem)
5ļøāƒ£ Browse all components
```

**Action Details:**
- **Edit**: Open both .uxm and .md for editing
- **Delete**: Don't automatically delete - instruct user:
  ```
  To delete this component, remove these files from your filesystem:
    • ./fluxwing/components/[name].uxm
    • ./fluxwing/components/[name].md
  ```

## Error Handling

### No Component Name Provided

```
Which component would you like to view?

Example:
  "Show me primary-button"
  "View details for user-card"

View all available components: Ask me to "show me all components"
```

### Component Not Found

```
āœ— Component '[name]' not found.

Searched in:
- ./fluxwing/components/
- ./fluxwing/library/
- Bundled templates

Available components:
[List first 10 components found]

Did you mean one of these?
- primary-button
- submit-button
- user-card
```

**Fuzzy search**: If component name is close to an existing component, suggest it:
```
āœ— Component 'primry-button' not found.

Did you mean 'primary-button'?
```

### File Read Errors

```
āœ— Found component but couldn't read files.

Location: ./fluxwing/components/[name].uxm
Error: [specific error message]

Please check file permissions and try again.
```

## Example Interactions

### Example 1: View Bundled Template

```
User: Show me the primary-button

Skill: šŸ“„ PRIMARY-BUTTON
─────────────────────────────────────────────────────
šŸ“¦ Source: Bundled Template
šŸ“ Location: Component Creator Templates

Description:
Standard clickable button with hover, focus, and disabled states

Component Details:
• Type: button
• Props: text (string), variant (string), disabled (boolean)
• States: default, hover, focus, disabled
• Accessibility: āœ“ Full support

[ASCII preview shown...]

What would you like to do?
1ļøāƒ£ Copy to project library
2ļøāƒ£ View full template
3ļøāƒ£ View metadata
4ļøāƒ£ Browse all components
```

### Example 2: View User Component

```
User: What's in my submit-button component?

Skill: šŸ“„ SUBMIT-BUTTON
─────────────────────────────────────────────────────
šŸŽØ Source: Your Component
šŸ“ Location: ./fluxwing/components/submit-button.uxm
ā±ļø  Modified: 2024-10-15 14:23:00

Description:
Custom submit button for forms

Component Details:
• Type: button
• Props: text (string)
• States: default
• Accessibility: āœ“ Basic support

[ASCII preview shown...]

šŸ’” Tip: Add more states with "expand submit-button with hover and disabled"
```

## Resources

- **Core Concepts**: See `{SKILL_ROOT}/docs/02-core-concepts.md` for component fundamentals

You're helping users understand their uxscii components in detail!

Overview

This skill lets you inspect a single uxscii (.uxm/.md) component and view detailed metadata, prop lists, state names, accessibility checks, and an ASCII template preview. It reads components from your project and bundled templates and always operates in read-only mode unless you explicitly copy a bundled template into your library. The display is concise and scannable, with context-appropriate actions offered after the view.

How this skill works

You name the component to view; the skill normalizes the name and searches three locations in order: ./fluxwing/components/, ./fluxwing/library/, then bundled templates. On first match it reads the component's .uxm JSON metadata and the .md ASCII template, extracts type, props, states, accessibility flags, modified time and version, and renders a preview (first 20 lines or first 2–3 states). For bundled templates it notes read-only status and offers copy-to-library and view-full-template options; for project files it offers edit, view, metadata, and delete instructions.

When to use it

  • You want a quick, human-readable summary of a .uxm component before editing or using it.
  • You need to inspect props, states, or accessibility details for a component you found in the project.
  • You have a bundled template and want to copy it into your project library to customize.
  • You are troubleshooting missing or misconfigured states and need the ASCII template preview.
  • You want to confirm which source (project, library, or bundled) a component came from.

Best practices

  • Provide the exact component name; if unsure, ask to list available components first.
  • Rely on the .uxm description and props for integration details; use copy-to-library before editing bundled templates.
  • Use the preview to validate variable placeholders ({{varName}}) and spacing before rendering in screens.
  • If a component is in bundled templates and you plan to modify it, copy both .uxm and .md into ./fluxwing/library/ to keep the reference intact.
  • When deleting, remove files manually and follow the provided filesystem paths to avoid accidental loss.

Example use cases

  • Show me primary-button — inspect the button's props, states, accessibility, and ASCII preview.
  • View details for user-card — confirm which props the component exposes and see a truncated template preview.
  • Open submit-button in my project — view last modified time and decide whether to edit or keep as-is.
  • Find if a bundled template exists in my library — view the bundled template and copy it to ./fluxwing/library/ to edit.
  • Diagnose a rendering issue by viewing the full ASCII template to check spacing and placeholders.

FAQ

What if I don't provide a component name?

I'll prompt you: 'Which component would you like to view?' and offer examples and an option to list available components.

Can this skill modify files directly?

No. It is read-only by default; for bundled templates you can choose to copy files into ./fluxwing/library/ which makes them editable in your project.