create-jay 0.25.3 → 0.25.5
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/index.js +3 -5
- package/package.json +3 -2
- package/skills/jay/SKILL.md +140 -0
- package/templates/CLAUDE.md +19 -1
- package/templates/jay-skill.md +0 -123
package/dist/index.js
CHANGED
|
@@ -264,11 +264,9 @@ async function scaffoldProject(projectDir, name, selectedPlugins) {
|
|
|
264
264
|
writeFile(projectDir, ".jay", readTemplate("jay-config.yaml"));
|
|
265
265
|
writeFile(projectDir, "vite.config.ts", readTemplate("vite.config.ts"));
|
|
266
266
|
writeFile(projectDir, "tsconfig.json", readTemplate("tsconfig.json"));
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
writeFile(projectDir, "jay-skill.md", fs.readFileSync(jaySkillPath, "utf-8"));
|
|
271
|
-
}
|
|
267
|
+
const agentGuidance = readTemplate("CLAUDE.md");
|
|
268
|
+
writeFile(projectDir, "CLAUDE.md", agentGuidance);
|
|
269
|
+
writeFile(projectDir, "agents.md", agentGuidance);
|
|
272
270
|
const hasDesignValidator = selectedPlugins.some(
|
|
273
271
|
(p) => p.name === "@jay-framework/design-system-validator"
|
|
274
272
|
);
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-jay",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create a new Jay Stack project",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"bin": "./dist/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
-
"templates"
|
|
10
|
+
"templates",
|
|
11
|
+
"skills"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsup",
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jay
|
|
3
|
+
description: Create a new Jay Stack project from scratch — the preconditions to check first and the scaffolding command that generates a working project. Hands off to the in-project CLAUDE.md and agent-kit for actually building pages, components, and plugins.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create a new Jay project
|
|
7
|
+
|
|
8
|
+
A short, ordered playbook for scaffolding a brand-new Jay Stack project. Use it when there is **no Jay
|
|
9
|
+
project yet** and you need to bootstrap one.
|
|
10
|
+
|
|
11
|
+
**Scope — bootstrapping only.** This skill gets a project onto disk and running. It does **not** teach
|
|
12
|
+
how to build pages, components, contracts, or plugins — that guidance ships _inside_ the scaffolded
|
|
13
|
+
project as `CLAUDE.md` plus the generated `agent-kit/` (designer / developer / plugin / devops role
|
|
14
|
+
guides). After scaffolding, read those.
|
|
15
|
+
|
|
16
|
+
## 0 · Preconditions (check before scaffolding)
|
|
17
|
+
|
|
18
|
+
- **Node ≥ 20** — `node --version`. The scaffolder and CLI require it.
|
|
19
|
+
- **A package manager** — npm (bundled with Node) or Yarn. `npm create jay` auto-detects which one
|
|
20
|
+
invoked it and uses it for install.
|
|
21
|
+
- **For the AIditor (visual AI editor, included by default): Claude Code installed locally + an API
|
|
22
|
+
key.** The project ships with `@jay-framework/aiditor`, whose `/aiditor` route runs an agent
|
|
23
|
+
server-side via the Claude Agent SDK. Its authentication matches Claude Code: install the `claude`
|
|
24
|
+
CLI, then either set `ANTHROPIC_API_KEY` in the environment **or** run `claude login`. Without this
|
|
25
|
+
the project still scaffolds, builds, and runs — only the `/aiditor` route's agent won't run.
|
|
26
|
+
- **For any Wix plugin (`wix-stores` / `wix-members` / `wix-media` / `wix-data` / `wix-deploy`): a Wix
|
|
27
|
+
account + a browser login.** All Wix plugins share one credential owner,
|
|
28
|
+
`@jay-framework/wix-server-client`, which is pulled in automatically when you select any `wix-*`
|
|
29
|
+
plugin. Its setup is **interactive** — during `setup` it shells out to the Wix CLI
|
|
30
|
+
(`npx @wix/cli login`, opening a browser for OAuth) and, if the project isn't connected to a site yet,
|
|
31
|
+
runs `npm create @wix/new init` to connect one. From there it fetches the app secret and writes
|
|
32
|
+
`config/.wix.yaml` for you — you are **not** prompted for an API key, site ID, or client ID (those are
|
|
33
|
+
derived or fetched). Notes:
|
|
34
|
+
- This step **requires interactive mode.** In non-interactive / CI runs it is skipped with a
|
|
35
|
+
`needs-config` note; re-run `yarn setup` in a terminal to complete it.
|
|
36
|
+
- **`wix-deploy` additionally needs a live Wix login at deploy time** (`yarn wix:deploy`) — it uses
|
|
37
|
+
the Wix CLI session in `~/.wix`. If that session is missing it errors with "Run `wix login` first";
|
|
38
|
+
just run `npx @wix/cli login` again.
|
|
39
|
+
- **API key is optional / manual.** The default flow uses the auto-fetched app secret; only hand-edit
|
|
40
|
+
an `apiKey` into `config/.wix.yaml` if you deliberately choose the API-key strategy.
|
|
41
|
+
|
|
42
|
+
## 1 · Scaffold the project
|
|
43
|
+
|
|
44
|
+
**Interactive** (prompts for a project name and a plugin selection):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm create jay@latest
|
|
48
|
+
# or: yarn create jay
|
|
49
|
+
# or: npx create-jay
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- **Project name** — lowercase letters, numbers, and hyphens; must start and end with a letter or
|
|
53
|
+
number; at least 3 characters (e.g. `my-store`).
|
|
54
|
+
- **Plugins** — a checklist (UI Kit, validators, Wix Stores/Members/Media/Data, etc.). Defaults are
|
|
55
|
+
pre-checked; accept them or adjust.
|
|
56
|
+
|
|
57
|
+
**Non-interactive** (CI / scripted — pass a name and an explicit, possibly empty, plugin list):
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# a few plugins by package name (comma-separated):
|
|
61
|
+
npm create jay@latest -- --name my-store --plugins "@jay-framework/ui-kit,@jay-framework/wix-stores"
|
|
62
|
+
|
|
63
|
+
# no optional plugins:
|
|
64
|
+
npm create jay@latest -- --name my-site --plugins ""
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The scaffolder then, in order: creates `./<name>/`, installs dependencies, generates the agent-kit
|
|
68
|
+
(`npx jay-stack-cli agent-kit`), and runs plugin setup (`npx jay-stack-cli setup`). A step that can't
|
|
69
|
+
complete non-interactively (e.g. a plugin needing credentials) is skipped with a note and can be re-run
|
|
70
|
+
later with `yarn setup`.
|
|
71
|
+
|
|
72
|
+
### Completing setup non-interactively (agents / CI)
|
|
73
|
+
|
|
74
|
+
`jay-stack-cli setup` has three input modes:
|
|
75
|
+
|
|
76
|
+
- `--interactive` — prompts a human in the terminal.
|
|
77
|
+
- `--answers <file>` — reads answers from a YAML file (for agents).
|
|
78
|
+
- _(neither)_ — surfaces every needed answer instead of prompting.
|
|
79
|
+
|
|
80
|
+
When a plugin needs a value it can't get, setup does **not** hang or guess — it prints a structured,
|
|
81
|
+
machine-readable block and exits that plugin:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
setup-needs-answer:
|
|
85
|
+
plugin: @jay-framework/some-plugin
|
|
86
|
+
key: apiKey
|
|
87
|
+
type: input
|
|
88
|
+
message: "Enter your API key"
|
|
89
|
+
choices: # only present for select-type questions
|
|
90
|
+
- us: United States
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**The loop for an agent:** run `yarn setup` → for each `setup-needs-answer:` block, add a line
|
|
94
|
+
`<key>: "<value>"` to an `answers.yaml` → re-run `jay-stack-cli setup --answers answers.yaml`. Any value
|
|
95
|
+
still missing surfaces again as another `setup-needs-answer:`; repeat until none remain. The `key` is the
|
|
96
|
+
stable join field between the question and your answer.
|
|
97
|
+
|
|
98
|
+
**Exception — Wix login is not answerable via file.** The Wix plugins' credential setup shells out to
|
|
99
|
+
the Wix CLI for a browser-based OAuth login (`npx @wix/cli login`). In non-interactive mode it returns a
|
|
100
|
+
`needs-config` note ("requires interactive mode"), **not** a `setup-needs-answer:` — there is no key you
|
|
101
|
+
can put in `answers.yaml` for it. A human must run `yarn setup` in a real terminal once to complete the
|
|
102
|
+
Wix login; everything else (app secret, client ID, site ID) is fetched/derived automatically after that.
|
|
103
|
+
|
|
104
|
+
## 2 · What you get
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
my-store/
|
|
108
|
+
src/
|
|
109
|
+
pages/ # file-system routing — starts with a home page
|
|
110
|
+
page.jay-html
|
|
111
|
+
page.ts
|
|
112
|
+
page.jay-contract
|
|
113
|
+
styles/theme.css
|
|
114
|
+
.jay # project + plugin configuration
|
|
115
|
+
CLAUDE.md # in-project agent guidance — read this next
|
|
116
|
+
agent-kit/ # generated role guides + contract/plugin references
|
|
117
|
+
package.json # scripts: dev, setup, agent-kit, validate, build, serve
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 3 · First run
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cd my-store
|
|
124
|
+
yarn dev # or: npm run dev → dev server (and the /aiditor route)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
If plugin setup was skipped (missing credentials) run `yarn setup` to configure API keys, then
|
|
128
|
+
`yarn agent-kit` to refresh generated references.
|
|
129
|
+
|
|
130
|
+
## 4 · Hand-off — build inside the project
|
|
131
|
+
|
|
132
|
+
Scaffolding is done. To actually build the site, switch to the in-project guidance:
|
|
133
|
+
|
|
134
|
+
1. Read `CLAUDE.md` at the project root.
|
|
135
|
+
2. Read `agent-kit/plugins-index.yaml` to see what plugins and contracts are available.
|
|
136
|
+
3. Read the role guide that matches your task under `agent-kit/` — `designer/` (jay-html pages,
|
|
137
|
+
styling), `developer/` (`page.ts`, services, routing), `plugin/` (headless components, actions),
|
|
138
|
+
`devops/` (build, deploy, serve).
|
|
139
|
+
|
|
140
|
+
Run `yarn validate` after changes.
|
package/templates/CLAUDE.md
CHANGED
|
@@ -6,8 +6,26 @@ This is a Jay Stack project.
|
|
|
6
6
|
|
|
7
7
|
Run `yarn setup` then `yarn agent-kit` to generate the agent kit.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Plugin setup (credentials)
|
|
10
|
+
|
|
11
|
+
`yarn setup` configures each installed plugin. For agents/CI it is non-interactive: a plugin that needs
|
|
12
|
+
a value exits with a structured `setup-needs-answer:` block (`plugin`/`key`/`type`/`message`/`choices`).
|
|
13
|
+
Put each `<key>: "<value>"` into `answers.yaml` and re-run `jay-stack-cli setup --answers answers.yaml`;
|
|
14
|
+
repeat until every plugin reports `configured`. See `agent-kit/devops/INSTRUCTIONS.md` for the full loop.
|
|
15
|
+
|
|
16
|
+
**Wix plugins are the exception:** their login is a browser OAuth via the Wix CLI, so it can't be
|
|
17
|
+
answered from a file — run `yarn setup` once in a real terminal to complete it. Everything else (app
|
|
18
|
+
secret, client ID, site ID) is fetched automatically afterward.
|
|
19
|
+
|
|
20
|
+
Read `agent-kit/` for contracts, plugin references, and role guides — this is the authoritative
|
|
21
|
+
guidance for the agent kit structure, CLI commands, and project organization.
|
|
10
22
|
|
|
11
23
|
Before making changes, read `agent-kit/plugins-index.yaml` and the relevant role guide (`agent-kit/designer/`, `agent-kit/developer/`, etc.).
|
|
12
24
|
|
|
13
25
|
Run `yarn validate` after changes.
|
|
26
|
+
|
|
27
|
+
## Visual editing (AIditor)
|
|
28
|
+
|
|
29
|
+
This project includes the AIditor — a visual AI editor at the `/aiditor` route (`yarn dev`). It runs
|
|
30
|
+
an agent server-side via the Claude Agent SDK, so it **requires Claude Code installed locally with an
|
|
31
|
+
API key**: install the `claude` CLI, then either set `ANTHROPIC_API_KEY` or run `claude login`.
|
package/templates/jay-skill.md
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: jay
|
|
3
|
-
description: Getting started with Jay Stack projects. Covers plugin setup, agent-kit generation, the four roles (designer, developer, plugin, devops), and key CLI commands.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Jay Stack — Agent Skill
|
|
7
|
-
|
|
8
|
-
Jay Stack is a full-stack framework. Plugins provide headless components (data + logic, no UI). Designers build UI in jay-html templates that bind to plugin contracts. Developers write page logic and services.
|
|
9
|
-
|
|
10
|
-
## Getting Started with a Jay Project
|
|
11
|
-
|
|
12
|
-
### Step 1: Setup plugins
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
yarn jay-stack-cli setup
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
This configures plugins interactively — prompts for API keys and credentials, creates config files, validates services. Run this once when starting a new project or after adding a plugin. Use `--no-interactive` in CI/scripts to create config templates without prompting.
|
|
19
|
-
|
|
20
|
-
### Step 2: Generate the agent kit
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
yarn jay-stack-cli agent-kit
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
This materializes contracts, generates reference data, and copies role guides into `agent-kit/`. Run this after setup, or any time you need fresh contract data.
|
|
27
|
-
|
|
28
|
-
### Step 3: Read the agent kit
|
|
29
|
-
|
|
30
|
-
The agent kit is your entry point. Start here:
|
|
31
|
-
|
|
32
|
-
**`agent-kit/plugins-index.yaml`** — lists every plugin and what it provides:
|
|
33
|
-
|
|
34
|
-
```yaml
|
|
35
|
-
plugins:
|
|
36
|
-
- name: wix-stores
|
|
37
|
-
contracts:
|
|
38
|
-
- name: product-page
|
|
39
|
-
description: Product detail page with SSR
|
|
40
|
-
actions:
|
|
41
|
-
- name: searchProducts
|
|
42
|
-
description: Search the product catalog
|
|
43
|
-
services:
|
|
44
|
-
- name: products-db
|
|
45
|
-
description: Product catalog API
|
|
46
|
-
commands:
|
|
47
|
-
- name: sync-catalog
|
|
48
|
-
description: Sync product catalog from CMS
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Use this file to discover what's available before writing any code.
|
|
52
|
-
|
|
53
|
-
**`agent-kit/materialized-contracts/`** — the actual `.jay-contract` files. Read these to understand the data shapes, rendering phases, and refs for each component.
|
|
54
|
-
|
|
55
|
-
**`agent-kit/references/<plugin>/`** — pre-generated discovery data (product catalogs, collection schemas, etc.). Check here before running CLI commands — it's faster.
|
|
56
|
-
|
|
57
|
-
## The Four Roles
|
|
58
|
-
|
|
59
|
-
The agent kit contains guides organized by role. Read the role that matches your task:
|
|
60
|
-
|
|
61
|
-
| Folder | Role | When to read |
|
|
62
|
-
| ---------------------- | ---------------- | ----------------------------------------------------------------- |
|
|
63
|
-
| `agent-kit/designer/` | Designer | Creating or editing `.jay-html` pages, styling, template syntax |
|
|
64
|
-
| `agent-kit/developer/` | Developer | Writing `page.ts` components, services, state management, routing |
|
|
65
|
-
| `agent-kit/plugin/` | Plugin Developer | Creating headless components, contracts, actions, CLI commands |
|
|
66
|
-
| `agent-kit/devops/` | DevOps | Building, deploying, serving in production, invalidation |
|
|
67
|
-
|
|
68
|
-
Each folder has an `INSTRUCTIONS.md` that lists all available guides. Start there.
|
|
69
|
-
|
|
70
|
-
## Key CLI Commands
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Development
|
|
74
|
-
yarn jay-stack-cli dev # Start dev server
|
|
75
|
-
yarn jay-stack-cli dev -v # Verbose mode
|
|
76
|
-
|
|
77
|
-
# Validation
|
|
78
|
-
yarn jay-stack-cli validate # Validate all jay-html, contracts, actions
|
|
79
|
-
|
|
80
|
-
# Discovery
|
|
81
|
-
yarn jay-stack-cli agent-kit --list # List available contracts
|
|
82
|
-
yarn jay-stack-cli params <plugin>/<contract> # Discover URL params for a contract
|
|
83
|
-
yarn jay-stack-cli action <plugin>/<action> --input '{}' # Run a plugin action
|
|
84
|
-
|
|
85
|
-
# Plugin commands (admin/batch operations)
|
|
86
|
-
yarn jay-stack-cli run --list # List available plugin commands
|
|
87
|
-
yarn jay-stack-cli run <plugin>/<command> # Run a plugin command
|
|
88
|
-
|
|
89
|
-
# Production
|
|
90
|
-
yarn jay-stack-cli build # Build production artifacts
|
|
91
|
-
yarn jay-stack-cli serve # Start production server
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Project Structure
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
src/
|
|
98
|
-
pages/ # File-system routing
|
|
99
|
-
page.jay-html # Root page (/)
|
|
100
|
-
products/
|
|
101
|
-
page.jay-html # /products
|
|
102
|
-
[slug]/
|
|
103
|
-
page.jay-html # /products/:slug
|
|
104
|
-
page.ts # Page component (optional)
|
|
105
|
-
plugins/ # Local plugins
|
|
106
|
-
components/ # Headfull components
|
|
107
|
-
init.ts # Project service initialization
|
|
108
|
-
agent-kit/ # Generated by jay-stack agent-kit
|
|
109
|
-
plugins-index.yaml # Discovery index
|
|
110
|
-
designer/ # Designer role guides
|
|
111
|
-
developer/ # Developer role guides
|
|
112
|
-
plugin/ # Plugin developer guides
|
|
113
|
-
devops/ # DevOps guides
|
|
114
|
-
materialized-contracts/
|
|
115
|
-
references/
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Before Writing Code
|
|
119
|
-
|
|
120
|
-
1. Read `agent-kit/plugins-index.yaml` to see what plugins and contracts exist
|
|
121
|
-
2. Read the relevant contract file to understand the data shape
|
|
122
|
-
3. Read the role guide that matches your task (designer/developer/plugin/devops)
|
|
123
|
-
4. Check `agent-kit/references/<plugin>/` for pre-generated data before using CLI commands
|