Working with playground app

From PackmindHub/packmind · View interactive version

Working with playground app is an AI agent skill from the GitHub repository PackmindHub/packmind. This skill provides guidance for building UI/UX prototypes in the Packmind playground app. It should be used when creating a new prototype, iterating on an existing prototype, or working with files in apps/playground/. Triggers on mentions of "playground", "prototype", or direct work within the apps

How to use this skill

Skill file

Working With the Playground App

Overview

The playground app (apps/playground/) is a standalone Vite + React environment for iterating on UI/UX of Packmind features — both new and existing. Prototypes built here are meant to be easily convertible into production-ready code.

UX Design Thinking

Before writing any code, think like a UX designer. The playground exists to explore how a feature feels to use — not just how it looks. Apply these principles to every prototype:

Design All States First

Never prototype only the happy path. Before building, identify and plan for every state the user might encounter:

Prototype each state explicitly — use local state toggles or tabs to let reviewers switch between them.

Use Realistic, Varied Data

Mock data should stress-test the design, not just fill space:

Design for Interaction

Prototypes should be clickable and stateful, not static mockups:

Establish Visual Hierarchy

Guide the user's eye to what matters most:

Make Affordance Obvious

Users should understand what they can do without instructions:

Manage Information Density

Show enough to be useful, hide enough to avoid overwhelm:

Stay Consistent With the Product

Before designing something new, check how the existing product handles similar patterns:

Running the Playground

To start the playground dev server:

nx dev playground

The app runs on localhost:4300. It is not part of the Docker Compose setup — it runs in isolation via Vite's dev server.

Creating a New Prototype

1. Create the Prototype Directory

Each prototype lives under apps/playground/src/prototypes/. For non-trivial prototypes, create a dedicated folder organized by domain — mirroring the frontend app structure. Consult references/frontend-domain-structure.md for the domain folder list.

apps/playground/src/prototypes/
├── index.ts                          # Prototype registry
├── ButtonsPrototype.tsx              # Simple single-file prototype
└── my-feature/                       # Multi-component prototype
    ├── MyFeaturePrototype.tsx        # Root component (entry point)
    ├── components/
    │   ├── domain-a/
    │   │   ├── SomeComponent.tsx
    │   │   └── AnotherComponent.tsx
    │   └── domain-b/
    │       └── SomethingElse.tsx
    └── types.ts                      # Shared types for this prototype

For simple prototypes (e.g., showcasing a single component), a single file is acceptable.

2. Build the Prototype Component

Create a default-exported React component:

import { PMBox, PMHeading } from '@packmind/ui';

export default function MyFeaturePrototype() {
  return (
    <PMBox padding="6">
      <PMHeading size="lg">My Feature</PMHeading>
      {/* Prototype content */}
    </PMBox>
  );
}

3. Register the Prototype

Add the prototype to apps/playground/src/prototypes/index.ts:

import MyFeaturePrototype from './my-feature/MyFeaturePrototype';

export const prototypes: Prototype[] = [
  // ... existing prototypes
  {
    name: 'My Feature',
    description: 'Optional description',
    component: MyFeaturePrototype,
  },
];

The prototype will appear in the dropdown selector in the playground nav bar.

Mandatory Rules

Data

Dependencies

Reusing Existing Code

UI Components

Code Quality

Resources

references/

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.