create-restforge-skills 1.0.0 → 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/cli/index.js +250 -250
- package/cli/mcp.js +103 -94
- package/package.json +2 -1
- package/skills/restforge/SKILL.md +230 -773
- package/skills/restforge/agents/openai.yaml +4 -4
- package/skills/restforge/references/auth.md +185 -145
- package/skills/restforge/references/backend-pipeline.md +388 -0
- package/skills/restforge/references/data-seeding.md +27 -0
- package/skills/restforge/references/dbschema-catalog.md +2 -2
- package/skills/restforge/references/field-validation.md +6 -4
- package/skills/restforge/references/frontend-pipeline.md +178 -0
- package/skills/restforge/references/rdf-advanced.md +1 -1
- package/skills/restforge/references/troubleshooting.md +144 -0
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
| `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` |
|
|
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 |
|
|
73
|
+
|
|
74
|
+
When an error is not in this table, do not guess a fix. Re-run the relevant
|
|
75
|
+
`*_validate_*` tool, read its message, and ground against the catalog before
|
|
76
|
+
changing the definition.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Tools outside the pipelines
|
|
81
|
+
|
|
82
|
+
These MCP tools exist and are callable, but they are not steps of the backend or
|
|
83
|
+
frontend pipeline. They are listed here so their absence from the pipelines reads
|
|
84
|
+
as a decision, not an omission — call them when the user asks for exactly that,
|
|
85
|
+
not as part of a generation run.
|
|
86
|
+
|
|
87
|
+
| Tool | Why it is outside the pipeline |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `health_ping` | Transport smoke test — answers "is the MCP server itself responsive", touches nothing in RESTForge |
|
|
90
|
+
| `key_generate`, `key_list`, `key_revoke` | API key bookkeeping inside `.env` files; independent of definition files and code generation |
|
|
91
|
+
| `project_list` | Registry inventory (endpoint count, database type, creation date) — useful for orientation, never a prerequisite of a later step |
|
|
92
|
+
|
|
93
|
+
`license deactivate` has no MCP tool at all, on purpose: it frees a machine slot
|
|
94
|
+
across machines, so the user runs it manually. `license_info` (read-only) is the
|
|
95
|
+
wrapped half of that pair.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Commands not wrapped as tools
|
|
100
|
+
|
|
101
|
+
These commands are deliberately not MCP tools. Explain what they do and give the
|
|
102
|
+
user the exact command to run in their own terminal; do not run them through a
|
|
103
|
+
shell on the user's behalf.
|
|
104
|
+
|
|
105
|
+
- **New project scaffolding** — `npx create-restforge-app <name>` creates the
|
|
106
|
+
folder, installs `@restforgejs/platform` locally, and bundles the designer
|
|
107
|
+
binary in one step. Point the user to it when they ask how to start. The
|
|
108
|
+
granular tools (`setup_create_folder` → `setup_install_package` →
|
|
109
|
+
`setup_init_config`) are the alternative when the agent must build the project
|
|
110
|
+
step by step.
|
|
111
|
+
- **`fast-track`** — `npx restforge fast-track --project=<name>
|
|
112
|
+
--schema-path=<dir> [--config=<file>] [--license=<KEY>] [--overwrite]`. One
|
|
113
|
+
interactive flow from an SDF to a running API (and optionally the frontend):
|
|
114
|
+
write env → validate `--auto-create-db` → config set-default → schema migrate →
|
|
115
|
+
payload generate → payload sync `--expand-fk` → endpoint create, then (frontend
|
|
116
|
+
scope) migrate RDF → UDF → designer generate, and finally a server-start
|
|
117
|
+
launcher. It prompts for license, database, scope, and confirmation, so the
|
|
118
|
+
agent cannot drive it. Suggest it for the fastest path; `--overwrite` drops
|
|
119
|
+
tables and regenerates, so warn before suggesting it. The same pipeline can be
|
|
120
|
+
reproduced step by step with the MCP tools.
|
|
121
|
+
- **`license deactivate`** — `npx restforge license deactivate`. Frees this
|
|
122
|
+
machine's activation seat on the license server, an effect that spans machines
|
|
123
|
+
and cannot be undone from here. Show the current activation with
|
|
124
|
+
`license_info` first, then let the user run it.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Runtime lifecycle
|
|
129
|
+
|
|
130
|
+
Starting, stopping, or restarting the RESTForge server or a Kafka consumer is
|
|
131
|
+
always the user's action. A process spawned from the agent session becomes its
|
|
132
|
+
child and dies when the session closes.
|
|
133
|
+
|
|
134
|
+
- **Run the server** → `runtime_detect_project` → `runtime_detect_config` →
|
|
135
|
+
`runtime_validate_preflight` → `runtime_generate_launcher`, then tell the user
|
|
136
|
+
to execute the generated script.
|
|
137
|
+
- **Run a consumer** → `runtime_generate_consumer_launcher` (mode `host` writes
|
|
138
|
+
consumer-start/consumer-stop, mode `pm2` writes the deploy files under
|
|
139
|
+
`./deploy/`). The consumer is a separate binary; `config` is mandatory.
|
|
140
|
+
- **Stop or restart** → give the user the exact command or file (`server-stop.bat`,
|
|
141
|
+
`pm2 restart <project>`). Read-only checks (`runtime_check_status`, the PID
|
|
142
|
+
file, `pm2 jlist`) are allowed.
|
|
143
|
+
- **User insists on a one-off background run** → state plainly that the process
|
|
144
|
+
ends with this session, and comply only as a last resort.
|