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
133 changes: 133 additions & 0 deletions .claude/skills/create-alpha-packages/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
name: create-alpha-packages
description: Cut an alpha release of this monorepo by appending `-alpha.1` to the `version` field in every workspace package.json (root + apps/* + packages/*), removing `package-lock.json`, and running `npm run reinstall` from the repo root. Triggered by "create alpha packages", "bump alpha", or `/create-alpha-packages`.
---

# create-alpha-packages

Bumps the `version` field in every workspace `package.json` from the current shared release like `6.1.84` to `6.1.84-alpha.1`, then refreshes the lockfile and `node_modules`. Mirrors the historical pattern from commits like `1727748c` ("chore: bump monorepo packages to 6.1.79-alpha.1").

This is **not** a dependency bump. For bumping external `@uniformdev/*` deps, use the separate `update-uniform-packages` skill.

## When to invoke

- "create alpha packages"
- "bump alpha" / "alpha bump" / "alpha release"
- `/create-alpha-packages`

## Conventions enforced

- All workspace `version` fields stay in **lockstep** (enforced by `manypkg check` via the root `workspace:check` script). If drift is detected, stop and surface it — do not silently fix.
- Postfix is **always `-alpha.1`**. Never increment to `-alpha.2`. If you need a new alpha after one was already cut, the base version itself should be bumped first (separate operation).
- **All** workspaces are touched, including private ones under the `@repo/*` scope.

## Workspace package.json files (reference snapshot — discover at runtime)

At authoring time the workspaces were:

```
package.json (root, name: csk-packages)
apps/csk/package.json (@uniformdev/component-starter-kit)
apps/csk-marketing-site/package.json (@uniformdev/csk-marketing-site)
apps/csk-storybook/package.json (@uniformdev/csk-storybook)
packages/csk-cli/package.json (@uniformdev/csk-cli)
packages/csk-components/package.json (@uniformdev/csk-components)
packages/csk-recipes/package.json (@uniformdev/csk-recipes)
packages/design-extensions-tools/package.json (@uniformdev/design-extensions-tools)
packages/eslint-config/package.json (@repo/eslint-config)
packages/internal-scripts/package.json (@repo/internal-scripts)
packages/typescript-config/package.json (@repo/typescript-config)
```

Always re-discover from the filesystem; do not hard-code.

## Steps

### 1. Read current version from root + every workspace

```bash
node -e "const fs=require('fs'),p=require('path');const files=['package.json'];for(const r of ['apps','packages']){if(!fs.existsSync(r))continue;for(const d of fs.readdirSync(r)){const f=p.join(r,d,'package.json');if(fs.existsSync(f))files.push(f);}}for(const f of files){const j=JSON.parse(fs.readFileSync(f,'utf8'));console.log(j.version+'\\t'+f);}"
```

### 2. Verify lockstep

Every printed line must share the same `version`. If any differs, **stop** and report:

```
Workspace version drift detected:
6.1.84 package.json
6.1.84 apps/csk/package.json
6.1.83 packages/csk-components/package.json <-- mismatch
Run `npm run workspace:fix` (manypkg fix) to resolve drift before re-running this skill.
```

Do not proceed.

### 3. Compute target version

Let `current` be the root's current `version`. Strip any prerelease tag (everything from the first `-` onward), then append `-alpha.1`.

| Current | Target |
|---|---|
| `6.1.84` | `6.1.84-alpha.1` |
| `6.1.84-alpha.1` | `6.1.84-alpha.1` (no-op, files won't change) |
| `6.1.84-rc.2` | `6.1.84-alpha.1` |

If `current === target` for every file, tell the user "Already at <target> — nothing to do" and stop (do not delete the lockfile or reinstall).

### 4. Edit each package.json

For every file from step 1, use the `Edit` tool to replace exactly:

- `old_string`: `"version": "<current>",`
- `new_string`: `"version": "<target>",`

The top-level `version` line is unique near the top of each `package.json` (lines 2–3), so the match is unambiguous. Do **not** use `replace_all`. Do **not** touch `dependencies`, `devDependencies`, or `peerDependencies`, even if a workspace name appears there.

### 5. Print summary

```
Bumped 11 files: 6.1.84 → 6.1.84-alpha.1
package.json
apps/csk/package.json
apps/csk-marketing-site/package.json
apps/csk-storybook/package.json
packages/csk-cli/package.json
packages/csk-components/package.json
packages/csk-recipes/package.json
packages/design-extensions-tools/package.json
packages/eslint-config/package.json
packages/internal-scripts/package.json
packages/typescript-config/package.json
```

### 6. Remove the lockfile

```bash
rm -f package-lock.json
```

The root `reinstall` script does not delete the lockfile itself; we remove it explicitly so npm re-resolves from scratch.

### 7. Run reinstall from the repo root

```bash
npm run reinstall
```

This is the existing root script — it wipes all `node_modules` plus build artifacts (`.turbo`, `.next`, `dist`, `storybook-static`) and runs `npm install`. Stream output; do not background. Expect a couple of minutes.

### 8. Report final state

One-line confirmation: "Alpha cut: 6.1.84 → 6.1.84-alpha.1. Lockfile regenerated. Reinstall OK." Surface any reinstall failure verbatim and stop — do not attempt to "fix" it.

## Do NOT

- Do not increment past `-alpha.1` (use `-alpha.1` every time; the base version is what differs across runs).
- Do not modify any field other than the top-level `version` in each package.json.
- Do not touch `dependencies` / `devDependencies` / `peerDependencies`, even when a workspace name like `@uniformdev/csk-components` appears there with a `workspace:*` or version range.
- Do not "fix" workspace version drift silently — surface it and let the user resolve via `npm run workspace:fix`.
- Do not edit `package-lock.json` by hand; let `npm install` regenerate it.
- Do not commit, tag, push, or open a PR.
- Do not run `npm run build`, `lint`, or tests after reinstall unless asked.
- Do not switch package managers or edit `packageManager`.
10 changes: 10 additions & 0 deletions .cursor/rules/create-alpha-packages.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: Cut an alpha release of this monorepo by appending `-alpha.1` to the `version` field in every workspace package.json (root + apps/* + packages/*), removing `package-lock.json`, and running `npm run reinstall` from the repo root. Triggered by phrases like "create alpha packages", "bump alpha", or "alpha release".
alwaysApply: false
---

When the user asks to "create alpha packages", "bump alpha", "alpha release", or runs `/create-alpha-packages`, follow the canonical workflow:

@.claude/skills/create-alpha-packages/SKILL.md

That file is the source of truth. Do not deviate; do not improvise the steps. If anything is unclear, ask the user.
11 changes: 11 additions & 0 deletions .cursor/rules/uniform-concepts.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: Uniform CMS core concepts — compositions, components, slots, patterns, naming, parameter/field types. Reference loaded when editing Uniform-aware code in apps/ or packages/csk-*.
globs: apps/**/*.{ts,tsx}, packages/csk-components/**, packages/csk-recipes/**, packages/design-extensions-tools/**
alwaysApply: false
---

When working in Uniform-consuming code (component definitions, registrations, composition rendering, patterns, slots), follow the canonical reference:

@docs/uniform/concepts.md

That file is the source of truth. Do not improvise Uniform modeling rules; consult it for slot allowability, pattern semantics, naming conventions, parameter types, and what MCP/AI can and cannot do.
11 changes: 11 additions & 0 deletions .cursor/rules/uniform-sdk.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: Uniform SDK / CLI / MCP usage — env vars, uniform.config.ts, sync push/pull, MCP-vs-CLI rules, App Router catch-all route wiring. Reference loaded when editing Uniform SDK setup, content sync, or routing.
globs: apps/*/uniform.config.ts, apps/*/content/**, apps/*/.env*, apps/*/src/app/**
alwaysApply: false
---

When wiring or maintaining the Uniform SDK in this repo (CLI scripts, env vars, catch-all routes, content sync, MCP usage), follow the canonical reference:

@docs/uniform/sdk.md

Critical rules from that doc: never hand-edit files under `apps/*/content/`; never use `uniform:push` to write entities (use Uniform MCP or the web app); always run `npm run uniform:pull` in the affected app after MCP changes.
10 changes: 10 additions & 0 deletions .cursor/rules/update-uniform-packages.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: Bump every external @uniformdev/* dependency in this monorepo to its latest npm version, leaving the local @uniformdev/* workspace packages untouched, then wipe the lockfile and run `npm run reinstall`. Triggered by phrases like "update uniform packages" or "bump uniform".
alwaysApply: false
---

When the user asks to "update uniform packages", "bump uniform", or runs `/update-uniform-packages`, follow the canonical workflow:

@.claude/skills/update-uniform-packages/SKILL.md

That file is the source of truth. Do not deviate; do not improvise the steps. If anything is unclear, ask the user.
71 changes: 71 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# AGENTS.md

Guidance for AI coding agents working in this repository. Plain markdown, no enforced schema. Deep reference material lives in [`docs/uniform/`](docs/uniform/) and is loaded selectively (Cursor via `.cursor/rules/*.mdc` globs; other agents follow the links below when relevant). This file stays slim and always-applicable.

## Project overview

This is the **Uniform Component Starter Kit (CSK)** monorepo — an npm workspaces project with workspaces under [`apps/*`](apps/) and [`packages/*`](packages/). All workspaces keep their `version` field in lockstep (enforced by `manypkg check`). External `@uniformdev/*` packages come from npm; several `@uniformdev/*` packages are produced *by* this repo (workspace packages) and must not be confused with the npm-published ones.

Package manager: **npm 11.x**. Node: `^18.18.0 || ^19.8.0 || >= 20.0.0`. Stack: **Next.js App Router**.

## Common scripts (run from repo root)

| Command | What it does |
|---|---|
| `npm run build` | Full build via Turbo across all workspaces. **Use this to verify changes** — workspace-level checks can miss runtime errors that the full root build catches. |
| `npm run lint` / `npm run lint:fix` | Turbo lint across all workspaces |
| `npm run format` | Turbo format |
| `npm run workspace:check` | `manypkg check` — verifies workspace versions are in lockstep |
| `npm run workspace:fix` | `manypkg fix` — resolves workspace version drift |
| `npm run reinstall` | Wipe `node_modules` + build artifacts everywhere, then `npm install` |

## Workflows (project-level skills)

Deterministic, repeatable chores — follow the canonical procedure in the linked file, don't improvise:

- **Update Uniform packages** → bump every external `@uniformdev/*` dependency to its latest npm version (skipping the local workspace `@uniformdev/*` packages), wipe the lockfile, run reinstall. Triggered by "update uniform packages" / "bump uniform" / `/update-uniform-packages`. Procedure: [`.claude/skills/update-uniform-packages/SKILL.md`](.claude/skills/update-uniform-packages/SKILL.md).
- **Create alpha packages** → bump every workspace's `version` field from `X.Y.Z` to `X.Y.Z-alpha.1` (all workspaces stay in lockstep), wipe the lockfile, run reinstall. Triggered by "create alpha packages" / "bump alpha" / "alpha release" / `/create-alpha-packages`. Procedure: [`.claude/skills/create-alpha-packages/SKILL.md`](.claude/skills/create-alpha-packages/SKILL.md).

## House rules

- **Never bump the local workspace `@uniformdev/*` packages to npm registry versions.** The packages with `@uniformdev/*` *names* under `apps/*` and `packages/*` are produced by this repo and resolved via npm workspaces; they are not the same as the npm-published `@uniformdev/*` SDK packages.
- **Workspace versions stay in lockstep.** Don't bump one workspace's `version` without bumping them all. Use `npm run workspace:fix` if drift is detected.
- **Do not commit, tag, push, or open PRs autonomously.** Leave that to the human.
- **Do not skip git hooks** (`--no-verify`, `--no-gpg-sign`, etc.) unless the human explicitly asks.
- **Do not run `build` / `lint` / tests automatically after a reinstall** unless asked.
- **Lockfile**: don't hand-edit `package-lock.json`. If a workflow requires regenerating it, delete it and run `npm run reinstall`.
- **Verification**: prefer `npm run build` from the repo root over workspace-scoped checks — the root build catches RSC runtime errors that scoped checks miss.

## Coding standards

- Generate clean code; remove unused code so the linter and TypeScript checks pass automatically.
- **Package manager: npm.** This repo uses npm workspaces with `package-lock.json`. Do not introduce `pnpm` or `yarn`; do not commit alternative lockfiles.
- You are a senior front-end engineer — follow current Next.js / React / TailwindCSS best practices. Do not re-invent the wheel.
- Do not over-deliver. Make the minimum changes the user asked for; do not create more components, files, or abstractions than requested.
- **Verification: `npm run build` from the repo root** is the canonical post-change check — it catches RSC runtime errors that workspace-scoped checks (typecheck/lint) miss. Do **not** run a build *concurrently* with `npm run dev` — stop the dev server first, since they share build artifact directories.

## Environment variables

Always wire up when working with Uniform:

- `UNIFORM_API_KEY` — server-side API key (read-published-compositions permission minimum, more for CLI usage).
- `UNIFORM_PROJECT_ID` — server-side project ID.
- `NEXT_PUBLIC_UNIFORM_PROJECT_ID` — client-exposed mirror (already used across `packages/csk-components` etc.).
- `UNIFORM_PREVIEW_SECRET=hello-world` — default value when setting up locally so preview works out of the box.

## Deep references (load when relevant)

These docs are linked, not inlined — consult them when working on the matching surface area. Cursor auto-attaches them via globs in `.cursor/rules/`; Claude Code and other agents should read them on demand from these links.

- **[docs/uniform/concepts.md](docs/uniform/concepts.md)** — Uniform CMS modeling: compositions, components, slots, patterns, naming, parameter/field types, MCP unsupported features. Consult when designing or describing Uniform entities. Cursor auto-attach globs: `apps/**/*.{ts,tsx}`, `packages/csk-components/**`, `packages/csk-recipes/**`, `packages/design-extensions-tools/**`.
- **[docs/uniform/sdk.md](docs/uniform/sdk.md)** — Uniform SDK / CLI / MCP usage: `uniform.config.ts`, sync push/pull, App Router catch-all route wiring, MCP-vs-CLI rules, the "never hand-edit `apps/*/content/`" rule. Consult when wiring or maintaining the SDK. Cursor auto-attach globs: `apps/*/uniform.config.ts`, `apps/*/content/**`, `apps/*/.env*`, `apps/*/src/app/**`.

## How agents discover these workflows

| Agent | Always-on | Loaded selectively |
|---|---|---|
| Claude Code | [`CLAUDE.md`](CLAUDE.md) → `@AGENTS.md` | [`docs/uniform/*.md`](docs/uniform/) via markdown links when relevant; [`.claude/skills/<name>/SKILL.md`](.claude/skills/) for workflows |
| Cursor | this `AGENTS.md` (natively read per Cursor docs as an alternative to `.cursor/rules`) | [`.cursor/rules/uniform-concepts.mdc`](.cursor/rules/uniform-concepts.mdc) + [`.cursor/rules/uniform-sdk.mdc`](.cursor/rules/uniform-sdk.mdc) auto-attach via globs; workflow `.mdc` files trigger on intent |
| Codex / Aider / Copilot / Zed / JetBrains Junie / Warp / Devin / Google Jules / others | this `AGENTS.md` | `docs/uniform/*.md` via the markdown links above |

If you're editing always-on rules, edit **this file only**. If you're editing Uniform deep reference, edit the relevant `docs/uniform/*.md` only. If you're editing a workflow procedure, edit the `SKILL.md` only — entry-point files pick up changes automatically.
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Claude Code project memory

This project's agent guidance is consolidated in [AGENTS.md](AGENTS.md) — that file is the single source of truth, read by every agent that works in this repo (Cursor reads it natively; Codex / Aider / Copilot / Zed / JetBrains Junie / others read it via the open AGENTS.md convention).

For Claude Code, the line below imports AGENTS.md into project memory so its rules apply automatically.

@AGENTS.md
2 changes: 1 addition & 1 deletion apps/csk-marketing-site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uniformdev/csk-marketing-site",
"version": "6.1.84",
"version": "6.1.85",
"private": true,
"engines": {
"yarn": "please-use-npm",
Expand Down
2 changes: 1 addition & 1 deletion apps/csk-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uniformdev/csk-storybook",
"version": "6.1.84",
"version": "6.1.85",
"description": "CSK vNext Storybook is an interactive Storybook build showcasing components from the CSK vNext component starter kit. It provides detailed documentation, live previews, and testing capabilities for easy integration into your projects.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/csk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uniformdev/component-starter-kit",
"version": "6.1.84",
"version": "6.1.85",
"private": true,
"engines": {
"yarn": "please-use-npm",
Expand Down
Loading
Loading