create-restforge-skills 0.4.0 → 1.0.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.
@@ -0,0 +1,141 @@
1
+ # Reference: Prerequisites, Errors, and Commands Outside MCP
2
+
3
+ Read this file when a tool fails, a prerequisite is missing, or the user asks
4
+ for something no MCP tool wraps.
5
+
6
+ ## Table of Contents
7
+
8
+ 1. [Prerequisites and common errors](#prerequisites-and-common-errors)
9
+ 2. [Tools outside the pipelines](#tools-outside-the-pipelines)
10
+ 3. [Commands not wrapped as tools](#commands-not-wrapped-as-tools)
11
+ 4. [Runtime lifecycle](#runtime-lifecycle)
12
+
13
+ ---
14
+
15
+ ## Prerequisites and common errors
16
+
17
+ ### Environment prerequisites
18
+
19
+ - Node.js ≥ 18.
20
+ - A reachable database matching the configured `DB_TYPE` (PostgreSQL, MySQL,
21
+ Oracle, or SQLite).
22
+ - A valid RESTForge license for `codegen_*`, `runtime_*`, and
23
+ `setup_validate_config`. Designer tools do not require a license.
24
+ - The RESTForge MCP server registered in the client
25
+ (`npm install -g @restforgejs/mcp-server`, then registered as the `restforge`
26
+ MCP server). Without it, none of the tools below exist.
27
+ - Redis if using cache, distributed lock, or live sync.
28
+ - Kafka if using a Kafka consumer (`KAFKA_ENABLED=true`).
29
+
30
+ ### Required backend config parameters
31
+
32
+ Nine of the full parameter set are mandatory before `setup_validate_config` can
33
+ pass:
34
+
35
+ `LICENSE`, `SERVER_ADDRESS`, `SERVER_PORT`, `DB_TYPE`, `DB_HOST`, `DB_PORT`,
36
+ `DB_USER`, `DB_PASSWORD`, `DB_NAME`.
37
+
38
+ → references/config-schema.md for the full parameter list, and
39
+ `setup_get_config_schema` for the live version of it.
40
+
41
+ ### Tools that depend on the installed platform version
42
+
43
+ Two tools wrap CLI sub-commands that old platform releases do not have. Current
44
+ releases have both. On an old project they fail in a recognisable way, so treat
45
+ the failure as a version answer, not a payload problem:
46
+
47
+ | Tool | Requirement | Symptom on an older platform |
48
+ |---|---|---|
49
+ | `codegen_validate_sql` | a platform providing `query validate` | `Unknown command: query` |
50
+ | `codegen_validate_dashboard_payload` | a platform providing `dashboard create --validate-only` | `Unknown flag: --validate-only`; the tool reports it as an upgrade requirement |
51
+
52
+ When `codegen_validate_dashboard_payload` is unavailable, the fallback is
53
+ `codegen_create_dashboard` itself — it runs the same validator before writing.
54
+
55
+ ### Common error patterns
56
+
57
+ | Symptom | Cause | Recovery |
58
+ |---|---|---|
59
+ | Tool not found / no `codegen_*` tools available | MCP server not registered in the client | Install `@restforgejs/mcp-server`, register it as the `restforge` MCP server, restart the client |
60
+ | "authenticity check failed" / HTTP 401 | License not active or expired | Set `LICENSE` in `config/db-connection.env`, run `setup_validate_config` |
61
+ | HTTP 429 from license server | Rate limit (10 req/min/IP) | Expected since v5.1.15 — the client falls back to cache; wait or retry |
62
+ | DB connection failed | Wrong DB config or DB not running | Check `DB_HOST`, `DB_PORT`, `DB_USER`, `DB_PASSWORD`, `DB_NAME`; verify the DB is running |
63
+ | "softDelete contract violation" | Contract columns missing or wrong type | Fix the SDF declaration, run `codegen_dbschema_validate` |
64
+ | "Widget uses undeclared placeholder" | `:paramName` in SQL not in `params` | Add the entry to `params` in the dashboard payload |
65
+ | "tableName and widgets conflict" | Payload contains both | Dashboard uses `widgets`; CRUD uses `tableName` — remove the wrong one |
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
+ | `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
+ | 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
+ | 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
+
71
+ When an error is not in this table, do not guess a fix. Re-run the relevant
72
+ `*_validate_*` tool, read its message, and ground against the catalog before
73
+ changing the definition.
74
+
75
+ ---
76
+
77
+ ## Tools outside the pipelines
78
+
79
+ These MCP tools exist and are callable, but they are not steps of the backend or
80
+ frontend pipeline. They are listed here so their absence from the pipelines reads
81
+ as a decision, not an omission — call them when the user asks for exactly that,
82
+ not as part of a generation run.
83
+
84
+ | Tool | Why it is outside the pipeline |
85
+ |---|---|
86
+ | `health_ping` | Transport smoke test — answers "is the MCP server itself responsive", touches nothing in RESTForge |
87
+ | `key_generate`, `key_list`, `key_revoke` | API key bookkeeping inside `.env` files; independent of definition files and code generation |
88
+ | `project_list` | Registry inventory (endpoint count, database type, creation date) — useful for orientation, never a prerequisite of a later step |
89
+
90
+ `license deactivate` has no MCP tool at all, on purpose: it frees a machine slot
91
+ across machines, so the user runs it manually. `license_info` (read-only) is the
92
+ wrapped half of that pair.
93
+
94
+ ---
95
+
96
+ ## Commands not wrapped as tools
97
+
98
+ These commands are deliberately not MCP tools. Explain what they do and give the
99
+ user the exact command to run in their own terminal; do not run them through a
100
+ shell on the user's behalf.
101
+
102
+ - **New project scaffolding** — `npx create-restforge-app <name>` creates the
103
+ folder, installs `@restforgejs/platform` locally, and bundles the designer
104
+ binary in one step. Point the user to it when they ask how to start. The
105
+ granular tools (`setup_create_folder` → `setup_install_package` →
106
+ `setup_init_config`) are the alternative when the agent must build the project
107
+ step by step.
108
+ - **`fast-track`** — `npx restforge fast-track --project=<name>
109
+ --schema-path=<dir> [--config=<file>] [--license=<KEY>] [--overwrite]`. One
110
+ interactive flow from an SDF to a running API (and optionally the frontend):
111
+ write env → validate `--auto-create-db` → config set-default → schema migrate →
112
+ payload generate → payload sync `--expand-fk` → endpoint create, then (frontend
113
+ scope) migrate RDF → UDF → designer generate, and finally a server-start
114
+ launcher. It prompts for license, database, scope, and confirmation, so the
115
+ agent cannot drive it. Suggest it for the fastest path; `--overwrite` drops
116
+ tables and regenerates, so warn before suggesting it. The same pipeline can be
117
+ reproduced step by step with the MCP tools.
118
+ - **`license deactivate`** — `npx restforge license deactivate`. Frees this
119
+ machine's activation seat on the license server, an effect that spans machines
120
+ and cannot be undone from here. Show the current activation with
121
+ `license_info` first, then let the user run it.
122
+
123
+ ---
124
+
125
+ ## Runtime lifecycle
126
+
127
+ Starting, stopping, or restarting the RESTForge server or a Kafka consumer is
128
+ always the user's action. A process spawned from the agent session becomes its
129
+ child and dies when the session closes.
130
+
131
+ - **Run the server** → `runtime_detect_project` → `runtime_detect_config` →
132
+ `runtime_validate_preflight` → `runtime_generate_launcher`, then tell the user
133
+ to execute the generated script.
134
+ - **Run a consumer** → `runtime_generate_consumer_launcher` (mode `host` writes
135
+ consumer-start/consumer-stop, mode `pm2` writes the deploy files under
136
+ `./deploy/`). The consumer is a separate binary; `config` is mandatory.
137
+ - **Stop or restart** → give the user the exact command or file (`server-stop.bat`,
138
+ `pm2 restart <project>`). Read-only checks (`runtime_check_status`, the PID
139
+ file, `pm2 jlist`) are allowed.
140
+ - **User insists on a one-off background run** → state plainly that the process
141
+ ends with this session, and comply only as a last resort.