Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
build:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,4 +19,6 @@ jobs:
- run: pnpm install --no-frozen-lockfile
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
- run: pnpm typecheck
- run: pnpm verify
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: publish

on:
workflow_dispatch:
release:
types: [published]

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.15.4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: npm install --global npm@latest
- run: pnpm install --no-frozen-lockfile
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
- run: pnpm verify
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
- run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50 changes: 50 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Publishing Creative UI

The public npm package is **`creative-ui-agent`**. The installed binary is **`creative-ui`** (with `creative-ui-agent` as an alias).

## First publication

The first npm publication needs to establish ownership of the package name. From a trusted local machine:

```bash
npm login
pnpm install
pnpm verify
npm publish --access public
```

If npm requires an OTP, complete the normal 2FA challenge.

After the first version exists on npm, configure **Trusted Publishing** for future releases:

- npm package: `creative-ui-agent`
- provider: GitHub Actions
- GitHub owner: `johkker`
- repository: `creative-ui`
- workflow filename: `publish.yml`
- allow direct `npm publish`

The workflow uses GitHub OIDC (`id-token: write`) so future releases do not need a long-lived npm publishing token.

## Future releases

1. Bump `version` in the root `package.json` and the CLI version displayed in `packages/cli/src/index.tsx`.
2. Merge the release change to `main`.
3. Create/publish a GitHub Release.
4. `.github/workflows/publish.yml` verifies and publishes the package to npm.

You can also run the workflow manually from GitHub Actions.

## Emergency token fallback

The publish workflow also accepts `NODE_AUTH_TOKEN` through an optional `NPM_TOKEN` repository secret. This is intended only as a bootstrap/fallback path. Trusted Publishing is preferred because it uses short-lived OIDC credentials instead of a reusable write token.

## Package validation

Before every publish:

```bash
pnpm verify
```

This runs package builds, TypeScript checks, the public CLI bundle build, and `npm pack --dry-run` so accidental workspace dependencies or missing files are caught before publication.
113 changes: 81 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,73 @@ The project separates **design intent** from implementation. Users define a Desi

> Status: experimental v0.1. Target projects do **not** need React, TSX, Tailwind or any specific framework.

## Quick start

Run it directly in any frontend project:

```bash
npx creative-ui-agent init
```

or with pnpm:

```bash
pnpm dlx creative-ui-agent init
```

This writes:

```text
.creative-ui/
├── design-dna.json
└── DESIGN.md
```

Then generate agent rules:

```bash
npx creative-ui-agent install-rules
```

If you prefer a global command:

```bash
npm install -g creative-ui-agent
creative-ui init
```

## Typical workflow

```bash
# 1. Define the visual DNA
npx creative-ui-agent init

# 2. Open the browser-based art-direction studio
npx creative-ui-agent studio

# 3. Explore human visual-language references
npx creative-ui-agent lineage recommend
npx creative-ui-agent lineage list --query "Brazil print"
npx creative-ui-agent lineage add constructivism --weight 0.4 --borrow composition,geometry,typography
npx creative-ui-agent lineage synthesize

# 4. Install rules for coding agents
npx creative-ui-agent install-rules

# 5. Review an existing frontend
npx creative-ui-agent critique .
npx creative-ui-agent unslop .

# 6. Capture responsive screenshots + DOM metrics
npx creative-ui-agent capture http://localhost:3000
```

The `capture` command uses Playwright. Install Chromium once if needed:

```bash
npx playwright install chromium
```

## Implemented

- framework-agnostic Design DNA schema
Expand All @@ -23,7 +90,9 @@ The project separates **design intent** from implementation. Users define a Desi
- agent adapters for `AGENTS.md`, `CLAUDE.md` and Cursor rules
- agent-facing Creative UI skill

## Packages
## Packages inside the monorepo

The npm distribution is intentionally a **single package** (`creative-ui-agent`) for easy use. Internally the repository remains modular:

- `@creative-ui/core` — schema, DNA, brief generation, critique and anti-slop heuristics
- `@creative-ui/lineage` — catalog, search, recommendation and synthesis
Expand All @@ -33,37 +102,7 @@ The project separates **design intent** from implementation. Users define a Desi
- `@creative-ui/adapters` — agent instruction integrations
- `skill/` — reusable agent-facing methodology

## Start

```bash
pnpm install
pnpm build
pnpm creative-ui init
```

The Design Director writes `.creative-ui/design-dna.json` and generated `.creative-ui/DESIGN.md`.

## Commands

```bash
pnpm creative-ui init
pnpm creative-ui inspect
pnpm creative-ui studio
pnpm creative-ui lineage list --query "Brazil print"
pnpm creative-ui lineage recommend
pnpm creative-ui lineage add constructivism --weight 0.4 --borrow composition,geometry,typography
pnpm creative-ui lineage synthesize
pnpm creative-ui critique .
pnpm creative-ui unslop .
pnpm creative-ui capture http://localhost:3000
pnpm creative-ui install-rules
```

For browser capture, install Chromium once:

```bash
pnpm exec playwright install chromium
```
The internal workspace packages are bundled into the public CLI and are not required in target projects.

## Visual lineage, not themes

Expand All @@ -89,6 +128,16 @@ Creative UI distributes experimentation rather than maximizing it everywhere. Hi

Static heuristics cannot tell whether a design is actually good. They exist to catch repeated defaults, not to replace art direction.

## Local development

```bash
git clone https://github.com/johkker/creative-ui.git
cd creative-ui
pnpm install
pnpm verify
pnpm creative-ui init
```

## Philosophy

Creativity should be intentional, not random. Accessibility, responsiveness and usability are not enemies of experimentation. The system should know **where it is allowed to be strange** and where convention is useful.
Expand Down
66 changes: 60 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,69 @@
{
"name": "creative-ui",
"name": "creative-ui-agent",
"version": "0.1.0",
"private": false,
"description": "Framework-agnostic art direction, visual lineage and anti-slop tooling for AI coding agents.",
"license": "MIT",
"type": "module",
"packageManager": "pnpm@9.15.4",
"bin": {
"creative-ui": "dist/index.js",
"creative-ui-agent": "dist/index.js"
},
"files": [
"dist",
"skill",
"README.md",
"ARCHITECTURE.md",
"LICENSE"
],
"engines": {
"node": ">=20"
},
"repository": {
"type": "git",
"url": "git+https://github.com/johkker/creative-ui.git"
},
"homepage": "https://github.com/johkker/creative-ui#readme",
"bugs": {
"url": "https://github.com/johkker/creative-ui/issues"
},
"keywords": [
"ai",
"agents",
"frontend",
"design",
"art-direction",
"creative-coding",
"codex",
"claude-code",
"cursor",
"cli",
"design-system",
"ui",
"visual-lineage"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "pnpm -r build",
"typecheck": "pnpm build && pnpm -r typecheck",
"verify": "pnpm typecheck",
"build:packages": "pnpm -r build",
"build:publish": "tsup --config tsup.publish.config.ts",
"build": "pnpm build:packages && pnpm build:publish",
"typecheck": "pnpm build:packages && pnpm -r typecheck",
"verify": "pnpm typecheck && pnpm build:publish && npm pack --dry-run",
"prepublishOnly": "pnpm verify",
"creative-ui": "pnpm --filter @creative-ui/cli dev --",
"dev": "pnpm creative-ui init"
},
"devDependencies": { "tsup": "^8.3.5", "typescript": "^5.7.2" }
"dependencies": {
"commander": "^12.1.0",
"ink": "^5.2.1",
"playwright": "^1.49.1",
"react": "^18.3.1",
"zod": "^3.23.8"
},
"devDependencies": {
"tsup": "^8.3.5",
"typescript": "^5.7.2"
}
}
16 changes: 16 additions & 0 deletions tsup.publish.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: { index: "packages/cli/src/index.tsx" },
outDir: "dist",
format: ["esm"],
platform: "node",
target: "node20",
bundle: true,
splitting: false,
sourcemap: true,
clean: true,
dts: false,
noExternal: [/^@creative-ui\//],
external: ["playwright"],
});
Loading