create-restforge-skills 1.0.1 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-restforge-skills",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Install the RESTForge Agent Skill and MCP server configuration into Claude Code, Cursor, and OpenAI Codex.",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -89,6 +89,7 @@ everything missing, and say the user may leave the choice to the agent.
89
89
  | Dashboard endpoint | Widgets (metrics, SQL), `dash-` name | `codegen_get_dashboard_catalog` | write payload → `codegen_validate_dashboard_payload` → `codegen_create_dashboard` |
90
90
  | Background job / Kafka consumer | Name, topic for a consumer | `codegen_create_processor` / `codegen_create_kafka_consumer` | consumer → `runtime_generate_consumer_launcher` |
91
91
  | Frontend page | Source RDF and plugin (the existing app's plugin when there is one) | `codegen_migrate_payload` when an RDF exists | `designer_get_udf_catalog` → edit page → `designer_validate_payload` → `designer_preview_files` → `designer_generate` |
92
+ | Bring UDF changes into an existing app | Aggregator UDF, output folder | `designer_validate_payload` | `designer_generate` without `overwrite` (merge); exit 1 = conflicts to resolve → generate again |
92
93
  | Auth | Backend, frontend, or both; RBAC or not | references/auth.md § Choosing the mechanism | `project_auth` / plugin auth / `designer_auth_create` / `designer_auth_attach` |
93
94
  | JavaScript SDK | Project (endpoints already generated) | `project_sdk_generate` | user runs install / build / deploy |
94
95
  | Seed, export, or move rows | Tables or schema, config | references/data-seeding.md | `data_pull` / `data_push` |
@@ -125,6 +126,7 @@ Three layers co-exist and must not be conflated:
125
126
  regenerating the endpoint.
126
127
  - **UDF** — the frontend consuming the API. Derived from the RDF with
127
128
  `codegen_migrate_payload`, refined by hand, generated with `designer_generate`.
129
+ Re-generating merges into the existing app files, so edits there survive.
128
130
 
129
131
  When the user uses DDL terms (NOT NULL, UNIQUE, CHECK, REFERENCES, ALTER TABLE,
130
132
  CREATE INDEX), do not map them to payload validation automatically. Ask which
@@ -211,6 +213,8 @@ DESTRUCTIVE. Ask before:
211
213
  - `setup_validate_config` with `autoCreateDb: true` (runs CREATE DATABASE).
212
214
  - `codegen_migrate_payload` with `overwrite: true` (page customisations are
213
215
  discarded; without it pages are merged).
216
+ - `designer_generate` with `overwrite: true` (every app file is recreated and
217
+ its customisations are discarded; without it files are merged).
214
218
  - `codegen_create_endpoint` and `codegen_create_dashboard` overwrite by default
215
219
  but archive the previous files to `.restforge/archive/<run>/` (5 most recent
216
220
  runs kept), so a plain intent confirmation is enough. `force: false` finds out
@@ -248,9 +252,14 @@ column is an SDF change), report the cross-over and ask before expanding.
248
252
  Grounding-First Rules). This rule is about syntax; choosing the business fields
249
253
  of a table the user handed over is allowed (Guardrail 9).
250
254
 
251
- **7. Generated output is not edited by hand.** Change the definition file (SDF,
252
- RDF, UDF) and regenerate. Snapshots in `payload/.meta/` and
253
- `frontend/payload/.meta/pages/` are committed with their files and never edited.
255
+ **7. Know which generated output survives a regenerate.** Backend output
256
+ (`src/modules/`, `src/models/`, metadata) is overwritten by
257
+ `codegen_create_*` (archived first), so change the RDF instead of the code.
258
+ Frontend app files may be edited: `designer_generate` merges the edits
259
+ (references/frontend-pipeline.md § Regenerating an existing app). Snapshots in
260
+ `payload/.meta/`, `frontend/payload/.meta/pages/`, and
261
+ `frontend/apps/.meta/<project>/` (except `conflicts/`) are committed with their
262
+ files and never edited.
254
263
 
255
264
  **8. Execute through tools; never emulate them.** When a tool produces or
256
265
  validates an artifact (`codegen_generate_payload`, `codegen_dbschema_introspect`,
@@ -278,4 +287,5 @@ file "to be filled in later" unless the user asked for a draft.
278
287
  presence only.
279
288
  - A precondition that is not met is a next step or a question, not an error.
280
289
  - An exit code that the tool describes as a verdict (drift found, payload
281
- invalid, items skipped) is a result to relay, not a tool failure.
290
+ invalid, items skipped, merge conflicts) is a result to relay, not a tool
291
+ failure.
@@ -313,6 +313,11 @@ for a skeleton.
313
313
  SQL files use the `file:` prefix
314
314
  (e.g. `"datatablesQuery": "file:sql/orders.sql"`). Validating first turns a
315
315
  runtime 500 into an error message before the payload is even written.
316
+ A joined column must not reuse the name of a main table column
317
+ (`s.status_name AS status` when `status` is the FK column is rejected by
318
+ `codegen_validate_payload`, and `codegen_migrate_payload` then skips that
319
+ field). Select the main table column itself and give the joined column its
320
+ own name, e.g. `s.status_name`.
316
321
 
317
322
  > **"Add an uppercase / case constraint" is ambiguous — disambiguate first.**
318
323
  > In RESTForge `uppercase` is an RDF `fieldValidation` *normalization transform*
@@ -7,8 +7,9 @@ Read this file when the intent router in SKILL.md points to the frontend track
7
7
 
8
8
  1. [Pipeline (canonical)](#pipeline-canonical)
9
9
  2. [UDF decisions](#udf-decisions)
10
- 3. [Page type](#page-type)
11
- 4. [Plugin choice](#plugin-choice)
10
+ 3. [Regenerating an existing app](#regenerating-an-existing-app)
11
+ 4. [Page type](#page-type)
12
+ 5. [Plugin choice](#plugin-choice)
12
13
 
13
14
  ---
14
15
 
@@ -58,11 +59,13 @@ frontend can be defined and generated without the backend live.
58
59
  errors before generation. Run before preview or generate, every time.
59
60
 
60
61
  6. designer_preview_files
61
- Dry-run: list files that would be generated, without writing to disk.
62
- Use to verify scope before an overwrite.
62
+ Dry-run: list the files the generator produces, without writing to disk.
63
+ It does not read the output folder, so it cannot show which files a
64
+ re-generate will merge, keep, or skip.
63
65
 
64
66
  7. designer_generate
65
- Generate frontend HTML/JS/CSS from the aggregator. Writes output files.
67
+ Generate frontend HTML/JS/CSS from the aggregator. On an existing app it
68
+ merges into the files on disk (§ Regenerating an existing app).
66
69
  The agent STOPS here — the user opens the output in a browser.
67
70
  ```
68
71
 
@@ -108,6 +111,48 @@ tool, so step 2a runs in the backend project folder.
108
111
 
109
112
  ---
110
113
 
114
+ ## Regenerating an existing app
115
+
116
+ `designer_generate` without `overwrite` is the normal way to bring UDF changes
117
+ into an app that already exists, for scope `app` and `form` alike. The user may
118
+ edit the generated app files (`<page>.html`, `js/<page>.js`, `js/common.js`,
119
+ `js/config.js`, `sidebar.html`, assets); the edits survive.
120
+
121
+ - **Merge** — each text file is merged three-way against the snapshot of the
122
+ last generate in `<output parent>/.meta/<output folder>/` (for
123
+ `frontend/apps/<project>` that is `frontend/apps/.meta/<project>/`). User
124
+ edits are kept and UDF or template changes on untouched lines are applied.
125
+ The result lists a status per file: `written`, `merged`, `unchanged`, `kept`,
126
+ `conflict`, or `skipped`. Commit the `.meta` folder with the app, except
127
+ `conflicts/` (it has its own `.gitignore`); never edit it.
128
+ - **Conflict** — a file whose edits clash with the new output is left untouched;
129
+ the version with conflict markers is in `.meta/<project>/conflicts/<path>`.
130
+ All other files are still processed and the command exits 1. That is a result
131
+ to relay, not a tool failure: resolve the file (apply the conflict version and
132
+ keep the user's intent), then run generate again. Do not use `overwrite` as
133
+ the fix.
134
+ - **Managed lines** — `BACKEND_DATE_FORMAT` and `BACKEND_DATETIME_FORMAT` in
135
+ `js/common.js` (marked `restforge:managed`) always take the new value.
136
+ - **Assets** — a modified asset (CSS, vendor bundle, image) is kept with a
137
+ warning; the new version is in `conflicts/<path>`.
138
+ - **App generated before snapshots existed** — files that differ from the new
139
+ output are kept with a warning and the new version goes to `conflicts/<path>`.
140
+ The user merges by hand, or recreates one page with `scope: "form"`, `page`,
141
+ and `overwrite`.
142
+ - **`index.html`** — merged like the shared files when it carries the
143
+ `RESTForge-Designer:LandingGenerated` marker. Without the marker it is never
144
+ replaced, even with `overwrite`, and is reported as `skipped`; a new page then
145
+ does not appear on the homepage. Remove the file or add the marker line back,
146
+ then generate with scope `app`.
147
+ - **`overwrite: true`** recreates every file from scratch and discards the
148
+ customisations in all of them (each old file that differs is archived to
149
+ `.restforge/archive/`). Confirm with the user before using it.
150
+ - **Not handled** — files of a page removed from the UDF are not deleted, and a
151
+ clean text merge is not proof that the logic still works; test the result in
152
+ the browser.
153
+
154
+ ---
155
+
111
156
  ## Page type
112
157
 
113
158
  - **Standard CRUD page** → `pageType: "crud"` (default) with `apiPath`,
@@ -66,6 +66,9 @@ When `codegen_validate_dashboard_payload` is unavailable, the fallback is
66
66
  | UDF validation error on field type | Field type not supported by the active plugin | Run `designer_list_plugins` + `designer_get_udf_catalog` to verify supported types |
67
67
  | `constraints.format ... is not supported for type 'date'` (or `timestamp`) | Per-field date pattern in RDF | Remove `format`; the pattern comes from `DATEFORMAT` / `DATETIMEFORMAT` |
68
68
  | Frontend shows a different date than the backend stored | `appConfig.dateFormat` / `dateTimeFormat` differ from the backend config | Re-run `codegen_migrate_payload`, then `designer_generate` |
69
+ | `datatablesQuery ... selects joined column(s) ... under the name of a main table column` | A JOIN column is aliased to a main table column name | Select the main table column itself (`t.status`) and give the joined column another name |
70
+ | Frontend generate exits 1 with "Conflicts (file kept as-is)" | User edits and the new output touch the same lines | Resolve each file from `.meta/<project>/conflicts/<path>`, then generate again; see frontend-pipeline.md § Regenerating an existing app |
71
+ | New page missing from the homepage after generate | `index.html` has no `RESTForge-Designer:LandingGenerated` marker, so it is `skipped` | Remove the file or add the marker line back, then generate with scope `app` |
69
72
  | Hook rejection answered HTTP 400 with only the hook message | A component handler returned `{ success: false }` or threw | Expected behaviour; the handler name and path are in the server log |
70
73
 
71
74
  When an error is not in this table, do not guess a fix. Re-run the relevant