@cronus-ui/ai-kit 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-kit.d.ts +1 -1
- package/dist/ai-kit.js +2 -1
- package/package.json +2 -2
- package/templates/AGENTS.base.md +15 -0
- package/templates/claude/skills/compose/SKILL.md +5 -10
- package/templates/claude/skills/theme/SKILL.md +12 -4
- package/templates/claude/skills/upgrade/SKILL.md +100 -0
- package/templates/cursor/rules/10-cronus-ui.mdc +2 -2
package/dist/ai-kit.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const DOCTRINE_PRESETS: readonly ["standard", "fintech", "saas",
|
|
|
14
14
|
export type DoctrinePreset = (typeof DOCTRINE_PRESETS)[number];
|
|
15
15
|
export declare const DEFAULT_PRESET: DoctrinePreset;
|
|
16
16
|
/** The curated Claude Code skills that ship with the kit. */
|
|
17
|
-
export declare const SKILLS: readonly ["ui-add", "theme", "compose", "code-review", "ship-pr", "evidence-check"];
|
|
17
|
+
export declare const SKILLS: readonly ["ui-add", "theme", "compose", "upgrade", "code-review", "ship-pr", "evidence-check"];
|
|
18
18
|
export type Skill = (typeof SKILLS)[number];
|
|
19
19
|
export declare const DEFAULT_SKILLS: readonly Skill[];
|
|
20
20
|
export interface AiKitOptions {
|
package/dist/ai-kit.js
CHANGED
|
@@ -21,12 +21,13 @@ export const SKILLS = [
|
|
|
21
21
|
"ui-add",
|
|
22
22
|
"theme",
|
|
23
23
|
"compose",
|
|
24
|
+
"upgrade",
|
|
24
25
|
"code-review",
|
|
25
26
|
"ship-pr",
|
|
26
27
|
"evidence-check",
|
|
27
28
|
];
|
|
28
29
|
export const DEFAULT_SKILLS = SKILLS;
|
|
29
|
-
const CRONUS_UI_SKILLS = new Set(["ui-add", "theme", "compose"]);
|
|
30
|
+
const CRONUS_UI_SKILLS = new Set(["ui-add", "theme", "compose", "upgrade"]);
|
|
30
31
|
/** Replace template tokens (currently just the app name) in file content. */
|
|
31
32
|
function applyTokens(content, name) {
|
|
32
33
|
return content.replaceAll("__APP_NAME__", name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronus-ui/ai-kit",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "The Cronus UI AI Kit — an engineering doctrine, skills, and per-assistant config, scaffolded into your project.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prepublishOnly": "tsc -p tsconfig.json"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cronus-ui/tokens": "0.6.
|
|
48
|
+
"@cronus-ui/tokens": "0.6.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^22.10.0",
|
package/templates/AGENTS.base.md
CHANGED
|
@@ -33,6 +33,21 @@ Read `DESIGN.md` (and `DESIGN.compact.md` when stuffing a prompt) before generat
|
|
|
33
33
|
That file is Cronus taste: Aurora vs Neutral, looks, one primary CTA, hairline elevation.
|
|
34
34
|
Do not invent a parallel visual language. MCP: `get_design_context`.
|
|
35
35
|
|
|
36
|
+
## Cronus UI product loop
|
|
37
|
+
|
|
38
|
+
If this repo uses Cronus UI (`cronus-ui.json`):
|
|
39
|
+
|
|
40
|
+
- **Start:** `npx create-cronus-app <name> --template saas`. Never omit `--template`
|
|
41
|
+
(CLI default is an empty starter). Other composed templates: `store`, `landing`.
|
|
42
|
+
- **Grow:** `npx cronus-ui add-page` — pages are installed blocks stacked in `<main>`.
|
|
43
|
+
- **Theme:** palettes via `npx cronus-ui theme set` (`aurora` | `neutral` | `midnight` |
|
|
44
|
+
`sunset` | `emerald`). Looks (`default` | `brutalist` | `glass`) are
|
|
45
|
+
`data-cronus-look` on `<html>` or a subtree — not a theme name; there is no
|
|
46
|
+
`theme set glass`.
|
|
47
|
+
- **Upgrade:** `npx cronus-ui upgrade --all --dry-run`, then `--all`. Never
|
|
48
|
+
`compose --overwrite` to pull updates.
|
|
49
|
+
- Never run shadcn init or write a shadcn `components.json`.
|
|
50
|
+
|
|
36
51
|
## Evidence levels
|
|
37
52
|
|
|
38
53
|
Report the quality of your evidence when it matters. Do not present a guess as a fact.
|
|
@@ -21,14 +21,9 @@ Request: `$ARGUMENTS`
|
|
|
21
21
|
4. **One piece** — `npx cronus-ui add <slug>` / MCP `install_component` (the `ui-add` skill).
|
|
22
22
|
5. **Hand-roll** only if the registry has no matching component or block — then with semantic tokens.
|
|
23
23
|
6. **Never** inline a Tailwind palette class (`bg-zinc-900`) or a raw hex.
|
|
24
|
-
7. **Upgrade** — `npx cronus-ui upgrade --all --dry-run`
|
|
25
|
-
`npx cronus-ui upgrade --all`.
|
|
26
|
-
|
|
27
|
-
Do NOT run `compose --overwrite` / `compose -o` to "upgrade" an existing app —
|
|
28
|
-
that wipes page edits. `--overwrite` is only for a fresh re-compose the user
|
|
29
|
-
asked to replace. MCP: `upgrade_components { "dryRun": true }` first, then
|
|
30
|
-
without dryRun. When the app was composed with `--manifest`, include
|
|
31
|
-
`"manifest": "path/to.json"`. Never `shadcn add` or overwrite blindly.
|
|
24
|
+
7. **Upgrade / maintain** — use the `upgrade` skill. `npx cronus-ui upgrade --all --dry-run`
|
|
25
|
+
first, then `npx cronus-ui upgrade --all`. Do NOT run `compose --overwrite` / `compose -o`
|
|
26
|
+
to "upgrade" an existing app.
|
|
32
27
|
|
|
33
28
|
If the cronus-ui MCP server is connected, prefer its write tools (`compose_app`,
|
|
34
29
|
`add_page`, `set_theme`, `upgrade_components`) over shelling out. They spawn the same pinned CLI.
|
|
@@ -126,7 +121,7 @@ Generated pages are **only** imports of installed blocks plus a `<main>` that st
|
|
|
126
121
|
them. Do **not** invent a new page architecture, extra layout chrome, or hand-written
|
|
127
122
|
sections beside the blocks. Every visible pixel comes from a registry item.
|
|
128
123
|
|
|
129
|
-
After compose / add-page, switch
|
|
124
|
+
After compose / add-page, switch palette via the `theme` skill (`theme set`, not a look):
|
|
130
125
|
|
|
131
126
|
```sh
|
|
132
127
|
npx cronus-ui theme set sunset --mode dark
|
|
@@ -135,7 +130,7 @@ npx cronus-ui theme set sunset --mode dark
|
|
|
135
130
|
## Keep using Cronus (AI Kit)
|
|
136
131
|
|
|
137
132
|
If the project does not yet have the AI Kit (`AGENTS.md`, compose / ui-add /
|
|
138
|
-
theme skills, MCP):
|
|
133
|
+
theme / upgrade skills, MCP):
|
|
139
134
|
|
|
140
135
|
```sh
|
|
141
136
|
npx cronus-ui ai
|
|
@@ -15,9 +15,16 @@ Request: `$ARGUMENTS`
|
|
|
15
15
|
|
|
16
16
|
## Presets and modes
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
**`emerald`**.
|
|
18
|
+
- Themes (palettes): **`aurora`** (default), **`neutral`**, **`midnight`**,
|
|
19
|
+
**`sunset`**, **`emerald`**. Switch with `theme set` / MCP `set_theme`.
|
|
20
20
|
- Modes: **`light`**, **`dark`** (default `dark`).
|
|
21
|
+
- Looks (material): **`default`**, **`brutalist`**, **`glass`**. Apply with
|
|
22
|
+
`data-cronus-look` on `<html>` or a subtree. Looks are **not** theme names —
|
|
23
|
+
there is no `theme set glass` and no `theme set brutalist`.
|
|
24
|
+
|
|
25
|
+
MCP `get_design_context` accepts `look` (`default` | `brutalist` | `glass`) as
|
|
26
|
+
well as `theme`. Do not invent look-forked components (`ButtonGlass`,
|
|
27
|
+
`ButtonBrutalist`).
|
|
21
28
|
|
|
22
29
|
## Switch a baked-in preset (do this first)
|
|
23
30
|
|
|
@@ -31,8 +38,9 @@ npx cronus-ui theme set neutral --mode light
|
|
|
31
38
|
the choice in `cronus-ui.json`.
|
|
32
39
|
|
|
33
40
|
MCP: `set_theme { "name": "sunset", "mode": "dark" }`. Use this for the five shipped
|
|
34
|
-
presets. Before generating screens, call `get_design_context`
|
|
35
|
-
so the palette and look stay Cronus.
|
|
41
|
+
presets — never a look name. Before generating screens, call `get_design_context`
|
|
42
|
+
(or read `DESIGN.md`) so the palette and look stay Cronus. Pass `look` when the
|
|
43
|
+
subtree is not Default.
|
|
36
44
|
|
|
37
45
|
## Apply a Create Studio theme
|
|
38
46
|
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upgrade
|
|
3
|
+
description: Pull upstream Cronus UI components and composed pages into __APP_NAME__ without losing local edits. Use when the user wants to update, refresh, or sync installed Cronus items — not when they want a new app, page, or theme.
|
|
4
|
+
argument-hint: "[--all|component…]"
|
|
5
|
+
allowed-tools: Bash, Read, Edit, Write
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Upgrade Cronus UI without losing local edits
|
|
9
|
+
|
|
10
|
+
Installed Cronus files are source you own. Pulling a newer registry is a **3-way
|
|
11
|
+
merge** of base + local + upstream — local edits survive. This is the maintain
|
|
12
|
+
step of the product loop (compose → add-page → theme → upgrade).
|
|
13
|
+
|
|
14
|
+
Request: `$ARGUMENTS`
|
|
15
|
+
|
|
16
|
+
Requires `cronus-ui.json`. New apps, new routes, and palette/look changes belong
|
|
17
|
+
to `compose` / `add-page` / `theme`.
|
|
18
|
+
|
|
19
|
+
## Protocol
|
|
20
|
+
|
|
21
|
+
Inspect, dry-run, then write. Always in that order:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npx cronus-ui diff
|
|
25
|
+
npx cronus-ui upgrade --all --dry-run
|
|
26
|
+
npx cronus-ui upgrade --all
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- `diff` reports which installed files drifted from the current registry. Writes
|
|
30
|
+
nothing.
|
|
31
|
+
- `--dry-run` prints the per-file plan (`fast-forward` / `merge` / `conflict`)
|
|
32
|
+
and writes nothing.
|
|
33
|
+
- `--all` upgrades every recorded component **and** 3-way-merges composed
|
|
34
|
+
pages/layouts against `.cronus-ui/base`. Named `upgrade button` upgrades that
|
|
35
|
+
component only — it does **not** touch composed pages.
|
|
36
|
+
|
|
37
|
+
If the cronus-ui MCP server is connected, prefer its write tool over shelling
|
|
38
|
+
out. Dry-run first:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
upgrade_components { "dryRun": true }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
then `upgrade_components` without `dryRun` (defaults to `--all` when `names` is
|
|
45
|
+
omitted). Named `upgrade_components { "names": ["button"] }` does not upgrade
|
|
46
|
+
composed pages.
|
|
47
|
+
|
|
48
|
+
When the app was composed with `--manifest`, re-supply it:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npx cronus-ui upgrade --all --dry-run --manifest path/to.json
|
|
52
|
+
npx cronus-ui upgrade --all --manifest path/to.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
MCP: `upgrade_components { "dryRun": true, "manifest": "path/to.json" }`.
|
|
56
|
+
|
|
57
|
+
## How the merge works
|
|
58
|
+
|
|
59
|
+
Each file is merged as base (the release recorded in `cronus-ui.json` /
|
|
60
|
+
`.cronus-ui/base/<template>/`) + local (the file on disk) + upstream (the
|
|
61
|
+
current registry) via `git merge-file --diff3`. Clean merges are written.
|
|
62
|
+
Conflicts are never silently clobbered.
|
|
63
|
+
|
|
64
|
+
- Markers are the `git merge-file --diff3` form (`LOCAL (your edits)`,
|
|
65
|
+
`BASE (…)`, `UPSTREAM (…)`).
|
|
66
|
+
- Unresolved files get a ready-to-paste agent prompt in `CRONUS-UPGRADE.md`.
|
|
67
|
+
Read that file, resolve markers, keep local intent and upstream fixes, then
|
|
68
|
+
delete the report.
|
|
69
|
+
|
|
70
|
+
`-y` / `--yes` writes conflict markers without asking. Do not pass it unless
|
|
71
|
+
the user wants markers on disk.
|
|
72
|
+
|
|
73
|
+
## Real flags (do not invent others)
|
|
74
|
+
|
|
75
|
+
- `-a, --all` — every recorded component **and** composed pages/layouts.
|
|
76
|
+
- `--dry-run` — print the plan, write nothing.
|
|
77
|
+
- `-y, --yes` — write conflict markers / confirmed overwrites without asking.
|
|
78
|
+
- `-o, --overwrite` — only for files installed before the manifest existed
|
|
79
|
+
(legacy 2-way replace). Not how you pull template updates.
|
|
80
|
+
- `-m, --manifest <file>` — required when the app was composed with `--manifest`.
|
|
81
|
+
- `-r, --registry <source>` · `-c, --cwd <dir>`.
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
npx cronus-ui upgrade button
|
|
85
|
+
npx cronus-ui upgrade button card
|
|
86
|
+
npx cronus-ui upgrade --all --yes
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The named forms do **not** refresh composed pages. Use `--all` when the user
|
|
90
|
+
wants components **and** pages.
|
|
91
|
+
|
|
92
|
+
## Never
|
|
93
|
+
|
|
94
|
+
- Do **not** run `compose --overwrite` / `compose -o` to "upgrade". That
|
|
95
|
+
replaces generated pages and wipes local edits. `--overwrite` on compose is
|
|
96
|
+
only for a fresh re-compose the user asked to replace.
|
|
97
|
+
- Do **not** run `shadcn add` or `shadcn init`. Never write a shadcn
|
|
98
|
+
`components.json`.
|
|
99
|
+
- Do **not** use `cronus-ui add --overwrite` / MCP `install_component` with
|
|
100
|
+
`overwrite` to pull upstream — that is a 2-way replace. Prefer this skill.
|
|
@@ -8,8 +8,8 @@ Cronus UI product loop for __APP_NAME__. See AGENTS.md at the repo root if prese
|
|
|
8
8
|
- New app: `npx create-cronus-app <name> --template saas`. Never omit `--template` (CLI default is an empty starter). Other composed templates: `store`, `landing`.
|
|
9
9
|
- New route: `npx cronus-ui add-page` or MCP `add_page`. Pages are installed blocks stacked in `<main>` — do not invent a parallel page architecture.
|
|
10
10
|
- One primitive: `npx cronus-ui add <slug>` (MCP `install_component`).
|
|
11
|
-
- Theme: `npx cronus-ui theme set` / `useTheme`. Never `bg-zinc-*` or palette utilities (`bg-zinc-900`).
|
|
12
|
-
- Upgrade: `npx cronus-ui upgrade --all --dry-run`, then `--all`. Refreshes installed items and composed pages. MCP `upgrade_components`. Never overwrite blindly.
|
|
11
|
+
- Theme: palettes via `npx cronus-ui theme set` (`aurora` | `neutral` | `midnight` | `sunset` | `emerald`) / `useTheme`. Looks (`default` | `brutalist` | `glass`) are `data-cronus-look` on `<html>` or a subtree — not a theme name; there is no `theme set glass`. Never `bg-zinc-*` or palette utilities (`bg-zinc-900`).
|
|
12
|
+
- Upgrade: `npx cronus-ui upgrade --all --dry-run`, then `--all`. Refreshes installed items and composed pages. MCP `upgrade_components`. Never overwrite blindly. Never `compose --overwrite` to pull updates.
|
|
13
13
|
- Never run shadcn init or write a shadcn `components.json`.
|
|
14
14
|
|
|
15
15
|
Token and a11y rules for TypeScript/React UI work:
|