Skip to content

Commit 43625fb

Browse files
committed
docs: update agent instructions and launch configs
1 parent 91f98bd commit 43625fb

2 files changed

Lines changed: 38 additions & 39 deletions

File tree

‎.claude/launch.json‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.0.1",
3+
"configurations": [
4+
{
5+
"name": "app-crm (example)",
6+
"runtimeExecutable": "pnpm",
7+
"runtimeArgs": ["--filter", "@objectstack/example-crm", "dev"],
8+
"port": 3000
9+
},
10+
{
11+
"name": "app-todo (example)",
12+
"runtimeExecutable": "pnpm",
13+
"runtimeArgs": ["--filter", "@example/app-todo", "dev", "--", "--port", "3001"],
14+
"port": 3001
15+
},
16+
{
17+
"name": "docs (next.js)",
18+
"runtimeExecutable": "pnpm",
19+
"runtimeArgs": ["--filter", "@objectstack/docs", "dev", "--", "-p", "3002"],
20+
"port": 3002
21+
}
22+
]
23+
}

‎AGENTS.md‎

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Primary AI instruction file for this repo. Mirrored at `.github/copilot-instructions.md` — keep both in sync.
44

5-
> **v5.0 breaking rename: `project` → `environment`.** The per-tenant business workspace (Org/Environment/Branch) is now `environment` everywhere: CLI (`--environment`/`-e`), HTTP (`/api/v1/environments/:environmentId/...`), header `X-Environment-Id`, env `OS_ENVIRONMENT_ID`, exports (`createSystemEnvironmentPlugin`, `SYSTEM_ENVIRONMENT_ID`), DB column `environment_id`, JSON `EnvironmentArtifact`. No aliases, no shims. See `.changeset/v5-project-to-environment-rename.md` and ADR-0006. "Project" only refers to the npm/monorepo sense.
5+
> **v5.0 breaking rename: `project` → `environment`** everywhere (CLI `-e`, `/api/v1/environments/:id`, header `X-Environment-Id`, `OS_ENVIRONMENT_ID`, DB column `environment_id`). No aliases. See ADR-0006. "Project" now only means the npm/monorepo sense.
66
77
---
88

@@ -18,50 +18,25 @@ pnpm docs:dev # docs site
1818

1919
### Running the dev server
2020

21-
Two distinct scenarios — pick the right one:
22-
23-
| Scenario | Command | Port | State | Cleanup |
24-
|:---|:---|:---|:---|:---|
25-
| **Frontend debugging** (UI in `../objectui` calls backend) | `PORT=3000 pnpm dev:crm` | **Must be 3000** — UI is hard-wired | Persistent (`<cwd>/.objectstack/`) | Leave running |
26-
| **Backend-only debugging** (API/protocols, no UI) | `pnpm dev:crm -- --fresh -p <random>` | Random high port (e.g. 38421) | **Ephemeral** tempdir, auto-seeded admin | **You must kill it** (`kill <PID>` via `lsof -ti tcp:<port>`) |
21+
| Scenario | Command | Notes |
22+
|:---|:---|:---|
23+
| **Frontend debug** (UI in `../objectui` calls backend) | `PORT=3000 pnpm dev:crm` | Port **must** be 3000 (UI hard-wired); persistent state; leave running |
24+
| **Backend-only debug** | `pnpm dev:crm -- --fresh -p <random>` | Random high port; ephemeral tempdir; **you must kill it** when done |
2725

28-
`--fresh` (added in `os dev`):
29-
- Creates a unique tempdir under the OS tempdir and points `OS_HOME` + `OS_DATABASE_URL` + `OS_STORAGE_ROOT` into it.
30-
- Auto-deletes the tempdir on normal exit.
31-
- Implies `--seed-admin` — after the server is ready, POSTs to `/api/v1/auth/sign-up/email` and prints the credentials:
32-
- default email: `admin@dev.local`
33-
- default password: `admin12345`
34-
- override with `--admin-email` / `--admin-password`; opt out with `--no-seed-admin`.
26+
`--fresh`: ephemeral tempdir (auto-deleted on exit) + `--seed-admin` (POSTs sign-up, prints creds — default `admin@dev.local` / `admin12345`, override via `--admin-email`/`--admin-password`).
3527

36-
Rules:
37-
- **Never start two backends on port 3000 simultaneously** — it collides with the UI dev session.
38-
- For backend-only tasks, always pick a random high port AND tear it down after the task — don't leak processes.
39-
- Use `pnpm dev:crm` (not raw `pnpm --filter ... dev`) so the example app is configured correctly. Flags after `--` are forwarded.
28+
Rules: never run two backends on port 3000; for backend tasks pick a random port and tear it down; always use `pnpm dev:crm` (flags after `--` are forwarded), not raw `pnpm --filter`.
4029

41-
Example (backend-only debugging session, clean environment):
4230
```bash
43-
pnpm dev:crm -- --fresh -p 38421 # start
44-
# ... debug via curl, http://localhost:38421 ...
45-
kill $(lsof -ti tcp:38421) # tear down — tempdir auto-deletes
31+
pnpm dev:crm -- --fresh -p 38421 # start; debug via curl
32+
kill $(lsof -ti tcp:38421) # tear down — tempdir auto-deletes
4633
```
4734

4835
### Frontend (Studio UI) — sibling repo `../objectui`
4936

50-
This framework repo ships **backend only** (protocols + services + REST). All Studio / Console UI work happens in the sibling repo `../objectui` (separate git repo, separate versions).
51-
52-
**Local dev workflow** (this is the assumed environment — `../objectui` is checked out next to `framework/`):
53-
54-
1. `cd ../objectui` — make UI changes there.
55-
2. Commit & push in `../objectui` (the refresh script pulls from its git state).
56-
3. Back in `framework/`, run:
57-
```bash
58-
pnpm objectui:refresh # = bump-objectui.sh + build-console.sh
59-
```
60-
This pulls the latest `../objectui` build into `packages/console/` so the backend serves the updated UI.
61-
62-
Related scripts: `pnpm objectui:bump` (pull only), `pnpm objectui:build` (rebuild console), `pnpm objectui:clean` (wipe cache).
37+
This repo ships **backend only**. All Studio/Console UI work happens in `../objectui` (separate repo, checked out next to `framework/`). Workflow: edit + commit + push in `../objectui`, then in `framework/` run `pnpm objectui:refresh` to pull its build into `packages/console/`.
6338

64-
⚠️ Never hand-edit files under `packages/console/dist/` or `.cache/objectui-*/` — they are regenerated.
39+
Other scripts: `objectui:bump` (pull only), `objectui:build`, `objectui:clean`. ⚠️ Never hand-edit `packages/console/dist/` or `.cache/objectui-*/` — regenerated.
6540

6641
---
6742

@@ -79,7 +54,7 @@ Related scripts: `pnpm objectui:bump` (pull only), `pnpm objectui:build` (rebuil
7954
6. **Object name = table name.** The object `name` is the canonical id everywhere (API, ObjectQL, REST, SDK, DB table). **Never** set `namespace` (deprecated) or `tableName` (always equals `name`). For module prefixes, embed in the name (`sys_user`, `ai_conversations`).
8055
7. **One Zod source per metadata type.** Each type (`view`, `flow`, `agent`, …) has exactly one schema in `packages/spec/src/{domain}/`. Org overlay opt-in lives only in `allowOrgOverride` on `DEFAULT_METADATA_TYPE_REGISTRY` — no parallel whitelists. See ADR-0005.
8156
8. **North Star alignment.** Read `content/docs/concepts/north-star.mdx` before structural changes. If a change doesn't advance §7 Built, shrink Drift, or unlock Missing — it probably shouldn't ship.
82-
9. **`OS_` env-var prefix.** All ObjectStack-owned environment variables MUST start with `OS_`. When renaming a legacy var, use `readEnvWithDeprecation('OS_NEW_NAME', 'LEGACY_NAME')` (or pass an array of legacy names) from `@objectstack/types` so the legacy name still works for one release with a one-shot deprecation warning. Documented third-party exceptions (NOT renamed): `NODE_ENV`, `HOME`, `OPENAI_API_KEY`, `TURSO_*`, OAuth `*_CLIENT_ID` / `*_CLIENT_SECRET`, `RESEND_API_KEY`, `POSTMARK_TOKEN`, `AI_GATEWAY_*`, `SMTP_*`. (`PORT`, `DATABASE_URL`, `BETTER_AUTH_URL`, `BETTER_AUTH_SECRET` were absorbed: `OS_PORT`, `OS_DATABASE_URL`, `OS_AUTH_URL`, `OS_AUTH_SECRET` are canonical with the legacy names as fallback.) See issue #1382.
57+
9. **`OS_` env-var prefix.** All ObjectStack-owned env vars MUST start with `OS_`. When renaming a legacy var, use `readEnvWithDeprecation('OS_NEW', 'LEGACY')` from `@objectstack/types` (keeps legacy working one release). Third-party exceptions kept as-is: `NODE_ENV`, `HOME`, `OPENAI_API_KEY`, `TURSO_*`, OAuth `*_CLIENT_ID/SECRET`, `RESEND_API_KEY`, `POSTMARK_TOKEN`, `AI_GATEWAY_*`, `SMTP_*`. See #1382.
8358

8459
---
8560

@@ -219,8 +194,9 @@ export default {
219194
## Post-Task Checklist
220195

221196
1. `pnpm test` — verify nothing broke.
222-
2. Update `CHANGELOG.md` / `ROADMAP.md` if user-facing or architectural.
223-
3. **Delete temporary artifacts** — screenshots, traces, scratch logs, `.playwright-mcp/`, throwaway `tmp*.ts`, ad-hoc scripts. Repo must look identical to before, minus intended changes.
197+
2. **Add a changeset for feature work.** When the change is a feature or functional improvement, run `pnpm changeset` (or add a `.changeset/*.md` entry) describing it before committing. Pure bug fixes do **not** require a changeset.
198+
3. Update `CHANGELOG.md` / `ROADMAP.md` if user-facing or architectural.
199+
4. **Delete temporary artifacts** — screenshots, traces, scratch logs, `.playwright-mcp/`, throwaway `tmp*.ts`, ad-hoc scripts. Repo must look identical to before, minus intended changes.
224200

225201
---
226202

0 commit comments

Comments
 (0)