Skip to content

Commit ed61cd5

Browse files
authored
Merge pull request #3375 from objectstack-ai/claude/third-party-skills-review-2r4sj1
docs(getting-started): end-to-end verify all tutorial content; add per-domain skills catalog
2 parents 7d391e0 + ca60272 commit ed61cd5

6 files changed

Lines changed: 307 additions & 107 deletions

File tree

content/docs/getting-started/build-with-claude-code.mdx

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ hand-edits generated glue, and no metadata mistake reaches the browser unchecked
4141

4242
| You need | Why |
4343
|:---|:---|
44-
| **Node.js 18+** and **pnpm** | Runs the scaffolder and the dev server (see [prerequisites](/docs/getting-started#prerequisites)). |
44+
| **Node.js 18+** and npm (pnpm / yarn / bun also work) | Runs the scaffolder and the dev server (see [prerequisites](/docs/getting-started#prerequisites)). |
4545
| **[Claude Code](https://claude.com/claude-code)** (or Cursor / Copilot) | Your agent reads `AGENTS.md` + the ObjectStack skills and authors the metadata. |
4646

4747
## 1. Scaffold the project
@@ -63,10 +63,6 @@ The scaffolder does more than copy files. It:
6363
`npm run validate` after every metadata change*.
6464

6565
```
66-
╔═══════════════════════════════════╗
67-
║ ◆ Create ObjectStack v6.x ║
68-
╚═══════════════════════════════════╝
69-
7066
◆ New Environment
7167
────────────────────────────────────────
7268
Environment: support-desk
@@ -75,6 +71,12 @@ The scaffolder does more than copy files. It:
7571
7672
→ Installing AI skills for your coding agent...
7773
✓ Environment created!
74+
75+
Next steps:
76+
cd support-desk
77+
npm install
78+
npm run dev # Start development server
79+
npm run validate # Verify metadata: schema + predicates + bindings
7880
```
7981

8082
This is why AI authoring is reliable rather than a guessing game: **the agent
@@ -192,9 +194,20 @@ export const TicketViews = defineView({
192194
});
193195
```
194196

197+
The agent also **wires the new files into `objectstack.config.ts`** — the object
198+
through the `src/objects/index.ts` barrel, and the action and view via the
199+
`actions:` / `views:` arrays in `defineStack()`. There is no filename-suffix
200+
magic: metadata exists in the app only if the config imports it, so if a
201+
freshly-authored action doesn't show up, the wiring is the first thing to check.
202+
195203
This is the same metadata that powers the REST API, the Console UI, **and the MCP
196204
tools exposed to AI** — define it once, and ObjectStack derives the rest.
197205

206+
<Callout type="info">
207+
Every example on this page was authored against `@objectstack/spec` 16.x and
208+
passes `os validate` verbatim in a freshly scaffolded project.
209+
</Callout>
210+
198211
## 4. The gate: `os validate` catches AI mistakes
199212

200213
The most common way AI-authored metadata goes wrong is a mistake that **type-checks
@@ -289,6 +302,43 @@ tightening on each pass until the app is right. See
289302
[How AI development works](/docs/getting-started/how-ai-development-works) for why
290303
this stays fast and safe as the app grows.
291304

305+
<Callout type="tip">
306+
Beyond the pass/fail gate there's a **quality rubric**: `npx os lint --score`
307+
prints a 0–100 metadata-quality score (relationship patterns, missing options,
308+
roll-ups, name fields). Ask the agent to keep the project lint-clean — "run
309+
`os lint` and fix the warnings" is a perfectly good prompt.
310+
</Callout>
311+
312+
## Beyond the first app — one skill per metadata domain
313+
314+
The loop above never changes; what changes is **which skill the agent loads**.
315+
The bundle ships nine, one per metadata domain, and the agent picks by task
316+
context (the trigger table lives in your project's `AGENTS.md`). To grow the
317+
support desk into a full application, keep describing — each row is a real
318+
prompt you can give verbatim:
319+
320+
| You want | Skill the agent loads | Say something like |
321+
|:---|:---|:---|
322+
| Data model — objects, fields, relationships, validations, seeds | `objectstack-data` | "Add an `account` object and link tickets to it with a required lookup. Seed three demo accounts." |
323+
| Queries & reports over records | `objectstack-query` | "Show me the count of open tickets per priority, using an aggregation." |
324+
| Views, dashboards, apps, record pages | `objectstack-ui` | "Add a dashboard with a metric for open tickets and a bar chart of tickets by priority." |
325+
| Business automation — flows, approvals, schedules | `objectstack-automation` | "Every day at 9:00, escalate tickets that have been open more than 48 hours." |
326+
| Permissions & row-level security | `objectstack-data` (security sections) | "Members should only see their own tickets; support managers see everything." |
327+
| Formula / conditional-field logic (CEL) | `objectstack-formula` | "Make `resolved_at` required and visible only when status is resolved." |
328+
| AI agents & tools inside your app | `objectstack-ai` | "Add an AI skill that triages new tickets into a priority." |
329+
| REST/auth surface tuning | `objectstack-api` | "Restrict the ticket API to read-only for non-members." |
330+
| Translations | `objectstack-i18n` | "Add a zh-CN translation bundle for the ticket object and app navigation." |
331+
332+
Two habits keep this reliable as the app grows:
333+
334+
- **The gate applies to every domain.** Flows, dashboards, permissions, and
335+
translations all go through the same `npm run validate` — the agent should run
336+
it after each change, exactly as `AGENTS.md` instructs.
337+
- **Keep the skills current.** After upgrading `@objectstack/spec`, re-run
338+
`npx skills add objectstack-ai/framework/skills --all` so the agent authors
339+
against the schemas you actually run. The full catalog is documented in the
340+
[AI Skills Reference](/docs/ai/skills-reference).
341+
292342
## 7. Your app is natively AI-operable (MCP)
293343

294344
Here's the payoff that a hand-built CRUD app doesn't give you for free: because

content/docs/getting-started/cli.mdx

Lines changed: 60 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ os generate flow onboarding # Add an automation flow
4242
os dev --ui
4343
```
4444

45-
Open [http://localhost:3000/_console/](http://localhost:3000/_console/) — you'll see the Console UI with a data browser, metadata explorer, and API documentation.
45+
Open [http://localhost:3000/_console/](http://localhost:3000/_console/) — you'll see the Console UI with a data browser, metadata explorer, and API documentation. Sign in with the seeded dev admin (`admin@objectos.ai` / `admin123`) — `os dev` provisions it automatically on an empty database. The boot banner also prints the app's MCP endpoint (`/api/v1/mcp`) so a coding agent can connect to the running app.
4646

4747
### Validate & Build
4848

@@ -138,8 +138,14 @@ os dev --database file:./data/test.db --auth-secret $(openssl rand -hex 32)
138138
| `-p, --port <n>` | `OS_PORT` / `PORT` | Listen port (default `3000`). In dev a busy port auto-hops to the next free one; the banner shows the actual port. |
139139
| `--ui` || Force Console UI on (already on by default in dev) |
140140
| `--compile` || Force compiling `objectstack.config.ts``dist/objectstack.json` before starting (auto when the artifact is missing; ignored with `--artifact`) |
141+
| `--fresh` || Ephemeral `OS_HOME` in the OS tempdir (clean DB, uploads, storage), auto-deleted on exit; implies `--seed-admin` |
142+
| `--seed-admin` / `--no-seed-admin` || Seed a dev admin (`admin@objectos.ai` / `admin123`) on an empty DB — default on; override with `--admin-email` / `--admin-password` |
141143
| `-v, --verbose` || Verbose output |
142144

145+
By default `os dev` keeps your data between restarts in a project-local SQLite
146+
file at `.objectstack/data/dev.db` (created on first run). Pass `--database`,
147+
set `OS_DATABASE_URL`, or use `--fresh` for a throwaway run.
148+
143149
With a file-backed SQLite database, dev also provisions a sibling
144150
`<db>.telemetry.<ext>` file registered as the `telemetry` datasource —
145151
lifecycle-classed system data (activity streams, job runs, notifications,
@@ -194,7 +200,8 @@ only gate the **automatic** registration of optional plugins.
194200

195201
The `auth` tier requires `OS_AUTH_SECRET` to be set; otherwise `AuthPlugin`
196202
is skipped with a yellow warning and the `/api/v1/auth/*` endpoints will
197-
return 404. To take full control, set `tiers` on the stack config:
203+
return 404. (In `--dev` mode the CLI falls back to an insecure local secret so
204+
login works out of the box.) To take full control, set `tiers` on the stack config:
198205

199206
```typescript
200207
import { defineStack } from '@objectstack/spec';
@@ -250,17 +257,19 @@ exploration, package management, and runtime metadata diagnostics.
250257
└─────────────────────────────────────────┘
251258
```
252259

253-
In this framework repo the prebuilt console bundle is served at `/_console/`.
254-
For source-level Console UI work, run the sibling `../objectui` Vite server and
255-
point it at a backend on port 3000.
260+
The prebuilt Console bundle ships with the framework packages and is served at
261+
`/_console/` — no separate frontend install or build step is needed.
256262

257263
### Production
258264

259265
#### `os start`
260266

261267
Boots a production server **directly from a compiled `objectstack.json` artifact** — no
262268
`objectstack.config.ts` required. This is the canonical "deploy a built ObjectStack app"
263-
command: hand a server one JSON file (or a URL pointing at one) and it runs.
269+
command: hand a server one JSON file (or a URL pointing at one) and it runs. When the cwd
270+
*does* contain an `objectstack.config.ts` and no artifact exists yet, `os start`
271+
auto-compiles it first; with no config and no artifact at all it boots an **empty kernel**
272+
with the Console + marketplace, so you can install apps interactively.
264273

265274
```bash
266275
# Quick start — load ./dist/objectstack.json with sqlite at file:<home>/data/objectstack.db
@@ -297,7 +306,8 @@ os start
297306
| `-d, --database <url>` | `OS_DATABASE_URL` | `file:…` / `libsql://` / `postgres://` / `mongodb://` / `memory://` |
298307
| `--database-driver <kind>` | `OS_DATABASE_DRIVER` | Force `sqlite` \| `turso` \| `postgres` \| `mongodb` \| `memory` when the URL is ambiguous |
299308
| `--database-auth-token <token>` | `OS_DATABASE_AUTH_TOKEN` | Auth token for libsql/Turso |
300-
| `--auth-secret <secret>` | `OS_AUTH_SECRET` | Secret for `@objectstack/plugin-auth`; without it `/api/v1/auth/*` is skipped (server still runs) |
309+
| `--auth-secret <secret>` | `OS_AUTH_SECRET` / `AUTH_SECRET` | Secret for `@objectstack/plugin-auth`. If neither the flag nor the env var is set, `os start` **auto-generates one** and persists it at `<home>/auth-secret` |
310+
| `--home <dir>` | `OS_HOME` | Home directory for persistent state (default `<cwd>/.objectstack` when an `objectstack.config.ts` is present, otherwise `~/.objectstack`) |
301311
| `--environment-id <id>` | `OS_ENVIRONMENT_ID` | Environment identifier (default `env_local`) |
302312
| `-p, --port <port>` | `OS_PORT` / `PORT` | Listen port (default `3000`). **Production fails loudly if the port is busy** — see note below. |
303313
| `--ui` / `--no-ui` || Mount the Console portal at `/_console/`. Enabled by default (so you can install marketplace apps); pass `--no-ui` to disable it. |
@@ -310,7 +320,7 @@ os start
310320
> (CORS). **Pin the port explicitly** (`OS_PORT=8080 os start`) and keep
311321
> `OS_AUTH_URL` / `OS_TRUSTED_ORIGINS` in sync when you change it.
312322
313-
**Resolution priority (artifact):** `--artifact` > `OS_ARTIFACT_PATH` > `<cwd>/dist/objectstack.json`.
323+
**Resolution priority (artifact):** `--artifact` > `OS_ARTIFACT_PATH` > `<cwd>/dist/objectstack.json` > `<home>/dist/objectstack.json` > auto-compile from `objectstack.config.ts` (when present) > empty kernel.
314324
**Resolution priority (database):** `--database` > `OS_DATABASE_URL` > `DATABASE_URL` (legacy) > `file:<home>/data/objectstack.db`.
315325

316326
**What it boots:**
@@ -320,7 +330,11 @@ os start
320330
- Runs standalone boot mode with one active environment.
321331

322332
**Authentication:**
323-
The `auth` capability is auto-loaded only when both (1) the artifact declares `requires: [..., 'auth']` **and** (2) a secret is provided via `--auth-secret` or `OS_AUTH_SECRET`. Without a secret, `AuthPlugin` is **silently skipped with a warning** — the server still boots and serves data/REST routes, only `/api/v1/auth/*` (login/register) is omitted. This is intentional: `os start` is happy to run an unauthenticated, internal-network deployment.
333+
`os start` always resolves an auth secret — `--auth-secret` > `OS_AUTH_SECRET` /
334+
`AUTH_SECRET` env > a secret **auto-generated and persisted** at `<home>/auth-secret`
335+
on first run — so `/api/v1/auth/*` (login/register) and the Console's login flow work
336+
out of the box, without any manual secret provisioning. Set the env var (or flag)
337+
explicitly when you deploy across multiple nodes or want to rotate the secret.
324338

325339
<Callout type="info">
326340
**`os start` vs `os serve`:** `os serve` boots from `objectstack.config.ts` (TypeScript source).
@@ -335,6 +349,7 @@ shape they accept. See [Source vs Artifact](#source-vs-artifact) below.
335349
| Command | Description |
336350
|---------|-------------|
337351
| `os compile [config]` | Compile configuration to a JSON artifact (`dist/objectstack.json`) |
352+
| `os build [config]` | Alias for `os compile` (scaffolded projects wire it as `npm run build`) |
338353
| `os validate [config]` | Validate schema, CEL predicates, and widget bindings — the same gates as `os compile`/`os build`, no artifact emitted |
339354
| `os info [config]` | Display metadata summary (objects, fields, apps, agents, etc.) |
340355

@@ -358,17 +373,24 @@ os compile --json # JSON output for CI pipelines
358373
────────────────────────────────────────
359374
→ Loading configuration...
360375
Config: objectstack.config.ts
361-
Load time: 104ms
376+
Load time: 57ms
377+
→ Normalizing stack definition...
378+
→ Lowering inline handlers...
362379
→ Validating protocol compliance...
380+
→ Validating expressions (ADR-0032)...
381+
→ Checking dashboard widget bindings (ADR-0021)...
382+
→ Checking SDUI styling (ADR-0065)...
383+
→ Checking security posture (ADR-0090 D7)...
384+
→ Collecting package docs (ADR-0046)...
363385
→ Writing artifact...
364386
365-
✓ Build complete (312ms)
387+
✓ Build complete (74ms)
366388
367-
Data: 10 Objects 217 Fields
368-
UI: 1 Apps 3 Dashboards 8 Reports 10 Actions
369-
Logic: 5 Flows 5 Agents 2 APIs
389+
Data: 2 Objects 6 Fields
390+
UI: 1 Views 1 Actions
391+
Runtime: 3 plugins
370392
371-
Artifact: dist/objectstack.json (48.2 KB)
393+
Artifact: dist/objectstack.json (7.6 KB)
372394
```
373395

374396
The resulting `dist/objectstack.json` is a **portable, self-describing deployment unit**
@@ -434,21 +456,21 @@ os info --json # JSON output for tooling
434456
◆ Info
435457
────────────────────────────────────────
436458
437-
Enterprise CRM v3.0.0
438-
com.example.crm
439-
Namespace: crm
440-
Type: app
459+
My App v0.1.0
460+
my-app
461+
Minimal ObjectStack environment — a clean slate for building.
462+
Namespace: my_app
463+
Type: app
441464
442-
Data: 10 Objects 217 Fields
443-
UI: 1 Apps 3 Dashboards 8 Reports 10 Actions
444-
Logic: 5 Flows 5 Agents 2 APIs
465+
Data: 2 Objects 6 Fields
466+
UI: 1 Views 1 Actions
467+
Runtime: 3 plugins
445468
446469
Objects:
447-
account (16 fields, user) — Account
448-
contact (24 fields, user) — Contact
449-
...
470+
my_app_note (2 fields, user) — Note
471+
my_app_ticket (4 fields, user) — Ticket
450472
451-
Loaded in 90ms
473+
Loaded in 59ms
452474
```
453475

454476
### Schema migrations
@@ -552,9 +574,21 @@ os create example my-app # Create examples/my-app
552574

553575
| Command | Description |
554576
|---------|-------------|
577+
| `os lint [config]` | Check metadata for style and convention issues (beyond `validate`'s hard gates) |
555578
| `os test [files]` | Run Quality Protocol test scenarios against a running server |
556579
| `os doctor` | Check development environment health |
557580

581+
#### `os lint`
582+
583+
Style and convention checks on top of `os validate` — naming, labels, translation coverage — with a 0-100 quality score:
584+
585+
```bash
586+
os lint # Style / convention checks
587+
os lint --score # Append a 0-100 metadata quality score (letter-graded)
588+
os lint --fix # Show what would be fixed (dry-run)
589+
os lint --json # JSON output for CI
590+
```
591+
558592
#### `os test`
559593

560594
Runs Quality Protocol test scenarios (JSON-based BDD) against a running ObjectStack server.

0 commit comments

Comments
 (0)