@syntica/mcp 2.0.0
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/README.md +290 -0
- package/dist/index.js +61729 -0
- package/package.json +32 -0
- package/skills/.claude-plugin/marketplace.json +15 -0
- package/skills/.claude-plugin/plugin.json +11 -0
- package/skills/README.md +68 -0
- package/skills/skills/pre-commit-validation/SKILL.md +79 -0
- package/skills/skills/syntica-debug/SKILL.md +152 -0
- package/skills/skills/syntica-deploy/SKILL.md +167 -0
- package/skills/skills/syntica-manage/SKILL.md +144 -0
- package/skills/skills/syntica-onboard/SKILL.md +586 -0
- package/skills/skills/syntica-security/SKILL.md +54 -0
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: syntica-onboard
|
|
3
|
+
description: "Set up an existing project on Syntica for the first time — authenticate by email code, create the application, add the git remote, scaffold docker-compose.yml if missing, configure secrets and instance size, and push. Use when the user wants to get a local project online, host or deploy it somewhere for the first time, or mentions Syntica setup. Run this before syntica-deploy."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Syntica Onboard
|
|
7
|
+
|
|
8
|
+
Announce at start: "I'm using syntica-onboard to set up your project on syntica."
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
The Syntica MCP server must be configured in Claude Code. If the MCP tools are not available, tell the user to run `npx @syntica/mcp setup` and restart Claude Code — that installs the plugin, which registers both the MCP server and these skills.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Step 1 — Check existing auth
|
|
17
|
+
|
|
18
|
+
Session credentials live **outside the project**, in `~/.syntica/credentials.json`. Project
|
|
19
|
+
state (which app, which environment, which remote) lives in `.syntica/config.json` in the
|
|
20
|
+
repo. The token is never written into the project directory: that directory is the one an agent
|
|
21
|
+
reads on every invocation, so a token sitting in it is one prompt-injected "read this file" away
|
|
22
|
+
from being exfiltrated (#488).
|
|
23
|
+
|
|
24
|
+
**Migrating from the old `.vibetocloud` path structure:** this skill used to read and write
|
|
25
|
+
`~/.vibetocloud/credentials.json` and `.vibetocloud/config.json`. If `~/.syntica/credentials.json`
|
|
26
|
+
does not exist but `~/.vibetocloud/credentials.json` does, move it:
|
|
27
|
+
```bash
|
|
28
|
+
mkdir -p ~/.syntica && chmod 700 ~/.syntica
|
|
29
|
+
mv ~/.vibetocloud/credentials.json ~/.syntica/credentials.json
|
|
30
|
+
```
|
|
31
|
+
Likewise, if `.syntica/config.json` does not exist but `.vibetocloud/config.json` does, move it
|
|
32
|
+
with the Bash tool (`mkdir -p .syntica && mv .vibetocloud/config.json .syntica/config.json`) and
|
|
33
|
+
add `.syntica/` to `.gitignore` if it is not already covered. Leave `.vibetocloud/` itself alone
|
|
34
|
+
if anything else remains in it. Running this skill again later re-does this check, so a user who
|
|
35
|
+
still has an environment with the old path structure is caught the next time they onboard.
|
|
36
|
+
|
|
37
|
+
Read `~/.syntica/credentials.json` using the Read tool. Read `.syntica/config.json` too
|
|
38
|
+
if it exists — that is where `appId`, `environment` and `remote` come from.
|
|
39
|
+
|
|
40
|
+
**Migrating an older setup:** if `.syntica/config.json` contains a non-empty `token` field,
|
|
41
|
+
it was written by a previous version of this skill. Move it:
|
|
42
|
+
|
|
43
|
+
1. Write it to `~/.syntica/credentials.json` using the Bash step below.
|
|
44
|
+
2. Remove the `token` field from `.syntica/config.json` (keep every other field) and write
|
|
45
|
+
the file back.
|
|
46
|
+
3. Tell the user: "Moved your session token out of the project directory to
|
|
47
|
+
`~/.syntica/credentials.json`. Consider signing out and back in if that repository was
|
|
48
|
+
ever pushed while the token was in it."
|
|
49
|
+
|
|
50
|
+
Then:
|
|
51
|
+
|
|
52
|
+
- If a non-empty `token` is available (from either location): call `org_authenticate` with it.
|
|
53
|
+
- If `org_authenticate` succeeds: skip to **Step 2**.
|
|
54
|
+
- If it fails (token expired): proceed to authenticate below.
|
|
55
|
+
- If no token is available: proceed to authenticate below.
|
|
56
|
+
|
|
57
|
+
**Authenticate:**
|
|
58
|
+
|
|
59
|
+
Use the AskUserQuestion tool with options `["Yes", "No"]` to ask:
|
|
60
|
+
"Would you like to pre-approve all syntica MCP tools so Claude Code stops asking for permission on every call?"
|
|
61
|
+
|
|
62
|
+
**If Yes:** Read `~/.claude/settings.json` using the Read tool. Add `"mcp__syntica__*"` to the `permissions.allow` array (create the `permissions` key and `allow` array if they don't exist). Write the updated file back. Tell the user: "syntica tools pre-approved. You won't be prompted again."
|
|
63
|
+
|
|
64
|
+
Use the AskUserQuestion tool with options `["Login", "Register"]` to ask:
|
|
65
|
+
"Do you already have a syntica account, or are you signing up for the first time?"
|
|
66
|
+
|
|
67
|
+
**If Login:**
|
|
68
|
+
|
|
69
|
+
Ask the user: "What is your email address?"
|
|
70
|
+
|
|
71
|
+
Call `org_request_otp` with:
|
|
72
|
+
```json
|
|
73
|
+
{ "email": "<user email>" }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If the call fails, tell the user the error and stop.
|
|
77
|
+
|
|
78
|
+
Tell the user: "A one-time code has been sent to your email. Please enter it."
|
|
79
|
+
|
|
80
|
+
Ask the user for the code, then call `org_verify_otp` with:
|
|
81
|
+
```json
|
|
82
|
+
{ "email": "<user email>", "code": "<entered code>" }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
If the call fails, tell the user the error and stop.
|
|
86
|
+
|
|
87
|
+
**If Register:**
|
|
88
|
+
|
|
89
|
+
Ask the user for:
|
|
90
|
+
- Full name
|
|
91
|
+
- Email address
|
|
92
|
+
- Organisation name
|
|
93
|
+
|
|
94
|
+
Call `org_register` with:
|
|
95
|
+
```json
|
|
96
|
+
{ "name": "<full name>", "email": "<email>", "orgName": "<org name>" }
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If the call fails, tell the user the error and stop.
|
|
100
|
+
|
|
101
|
+
Tell the user: "Account created! Sending a one-time code to verify your email."
|
|
102
|
+
|
|
103
|
+
Call `org_request_otp` with:
|
|
104
|
+
```json
|
|
105
|
+
{ "email": "<user email>" }
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If the call fails, tell the user the error and stop.
|
|
109
|
+
|
|
110
|
+
Tell the user: "A one-time code has been sent to your email. Please enter it."
|
|
111
|
+
|
|
112
|
+
Ask the user for the code, then call `org_verify_otp` with:
|
|
113
|
+
```json
|
|
114
|
+
{ "email": "<user email>", "code": "<entered code>" }
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
If the call fails, tell the user the error and stop.
|
|
118
|
+
|
|
119
|
+
**After successful verify (both flows):**
|
|
120
|
+
|
|
121
|
+
On success the response contains `{ token, userId, orgId, userName, orgName }`.
|
|
122
|
+
|
|
123
|
+
**Write the credentials outside the project.** Use the Bash tool, not the Write tool — `umask 077`
|
|
124
|
+
creates the file already private, where writing it first and `chmod`-ing after leaves a window in
|
|
125
|
+
which it is world-readable:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
mkdir -p ~/.syntica && chmod 700 ~/.syntica
|
|
129
|
+
(umask 077 && cat > ~/.syntica/credentials.json <<'JSON'
|
|
130
|
+
{
|
|
131
|
+
"token": "<token from response>",
|
|
132
|
+
"orgId": "<orgId from response>"
|
|
133
|
+
}
|
|
134
|
+
JSON
|
|
135
|
+
)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
If that fails (a read-only home directory, a filesystem without permission bits), do **not** stop
|
|
139
|
+
the onboarding: tell the user the credentials could not be stored privately, name the path, and
|
|
140
|
+
carry on. Where their credentials live on their own machine is their call, not the platform's.
|
|
141
|
+
|
|
142
|
+
Write `.syntica/config.json` using the Write tool — project state only, **no token**:
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"orgId": "<orgId from response>",
|
|
146
|
+
"appId": "",
|
|
147
|
+
"environment": "",
|
|
148
|
+
"remote": ""
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Add **both** `.syntica/` and `.vibetocloud.json` to `.gitignore` — read the current `.gitignore` first, then append whichever lines are missing.
|
|
153
|
+
|
|
154
|
+
Both, not just the first: a `.syntica/` pattern matches a *directory* of that name and does **not** match the legacy file `.vibetocloud.json` (#596). Older runs of this skill, and the MCP tools before they were corrected, wrote the session token there — so a user upgrading can be left with a plaintext JWT in their repository that `git status` will happily offer to commit. `.syntica/config.json` no longer holds a token, but it does identify the org and application, which is reason enough to ignore it too.
|
|
155
|
+
|
|
156
|
+
Tell the user: "Welcome, <userName>! You're signed in to org <orgName>."
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Step 2 — App setup
|
|
161
|
+
|
|
162
|
+
Call `app_list` with:
|
|
163
|
+
```json
|
|
164
|
+
{ "token": "<token>", "orgId": "<orgId>" }
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Build an options list from the response: one option per existing app (label = app name), plus a final option `"Create new app"`.
|
|
168
|
+
|
|
169
|
+
Use the AskUserQuestion tool with those options to ask:
|
|
170
|
+
"Is this project already registered on syntica, or should I create a new one?"
|
|
171
|
+
|
|
172
|
+
**If an existing app is selected:** save its `id` as `appId` in `.syntica/config.json`.
|
|
173
|
+
|
|
174
|
+
**If "Create new app":** ask the user for a name (lowercase letters, numbers and hyphens only — suggest the current directory name lowercased with spaces replaced by hyphens). Call `app_create` with:
|
|
175
|
+
```json
|
|
176
|
+
{ "token": "<token>", "name": "<app name>", "orgId": "<orgId>" }
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The response contains `{ id, name, gitUrl, ... }`. Save `id` as `appId` and `gitUrl` in `.syntica/config.json`.
|
|
180
|
+
|
|
181
|
+
Save `"dev"` as `environment` in `.syntica/config.json`.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Step 3 — Git remote
|
|
186
|
+
|
|
187
|
+
Run the Bash tool:
|
|
188
|
+
```bash
|
|
189
|
+
git remote -v
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Case A — no remotes:** Run:
|
|
193
|
+
```bash
|
|
194
|
+
git remote add origin <gitUrl from config>
|
|
195
|
+
```
|
|
196
|
+
Save `"origin"` as `remote` in `.syntica/config.json`. Tell the user: "syntica set as origin."
|
|
197
|
+
|
|
198
|
+
**Case B — `origin` exists pointing to an external host:**
|
|
199
|
+
|
|
200
|
+
Three options here. The first keeps their repository as the source of truth and needs no pushes to syntica at all; the other two push to the platform-hosted repository.
|
|
201
|
+
|
|
202
|
+
Use the AskUserQuestion tool with options
|
|
203
|
+
`["Deploy from my existing repository (paid feature)", "Make syntica my new origin", "Keep my current origin and push to syntica too"]` to ask:
|
|
204
|
+
"Your origin points to an external host. How should syntica get your code?"
|
|
205
|
+
|
|
206
|
+
If **Deploy from my existing repository**: go to *Step 3b* below. Do **not** add a syntica remote.
|
|
207
|
+
|
|
208
|
+
For either of the other two, first run:
|
|
209
|
+
```bash
|
|
210
|
+
git remote add syntica <gitUrl from config>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
If **Make syntica my new origin**:
|
|
214
|
+
```bash
|
|
215
|
+
git remote rename origin origin-backup
|
|
216
|
+
git remote rename syntica origin
|
|
217
|
+
```
|
|
218
|
+
Save `"origin"` as `remote` in `.syntica/config.json`. Tell the user: "syntica is now origin. Your previous origin is saved as origin-backup."
|
|
219
|
+
|
|
220
|
+
If **Keep my current origin**: Save `"syntica"` as `remote` in `.syntica/config.json`. Tell the user: "All skill pushes will target the `syntica` remote explicitly."
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Step 3b — Deploy from the user's own repository (optional)
|
|
225
|
+
|
|
226
|
+
Only for the first option in Case B. The platform fetches from the user's repository on each deploy and keeps a read-only mirror, so **Step 6 (First push) is skipped entirely**.
|
|
227
|
+
|
|
228
|
+
This is a **paid** capability. If it is not on the org's subscription every call below fails with `EXTERNAL_REPO_ENTITLEMENT_MISSING` — tell the user to add it in the dashboard under Settings → Repositories, and offer one of the other Case B options instead.
|
|
229
|
+
|
|
230
|
+
A repository connection stores the credential for a **host**, and applications are then bound to a path on that host. Create the connection first; it is reusable for every repository on that host.
|
|
231
|
+
|
|
232
|
+
**1. Look for an existing connection.** Call `org_list_git_connections` with `{ "token": "<token>", "orgId": "<orgId>" }`. Match one on the host of their `origin` URL.
|
|
233
|
+
|
|
234
|
+
**2. If none matches, create one.** Call `org_add_git_connection`:
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"token": "<token>",
|
|
238
|
+
"orgId": "<orgId>",
|
|
239
|
+
"url": "https://<host from their origin>",
|
|
240
|
+
"username": "<see below>",
|
|
241
|
+
"accessToken": "<read-scoped token>"
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
Ask the user for a read-scoped token. The `username` is provider-specific and getting it wrong returns a plain `401`:
|
|
245
|
+
- **GitHub** — fine-grained PAT with Contents: Read; leave `username` out.
|
|
246
|
+
- **GitLab** — project or personal access token with `read_repository`; leave `username` out.
|
|
247
|
+
- **Bitbucket** — three credential types, each different: a repository/project/workspace **access token** needs no `username`; an **app password** needs the Atlassian *username*; an Atlassian **API token** needs the account *email address*.
|
|
248
|
+
- **Self-hosted** — pass `provider: "generic"` plus whatever username the host expects.
|
|
249
|
+
|
|
250
|
+
**3. Bind the application.** Call `app_set_upstream`:
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"token": "<token>",
|
|
254
|
+
"applicationId": "<appId>",
|
|
255
|
+
"connectionId": "<id from step 1 or 2>",
|
|
256
|
+
"path": "<owner/repo within that host>",
|
|
257
|
+
"branch": "<branch to deploy>"
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
`path` is the repository path only — not a full URL, since the host comes from the connection. It returns the branch list, so on `GIT_UPSTREAM_BRANCH_MISSING` re-ask using the branches it names.
|
|
261
|
+
|
|
262
|
+
**Before calling it, warn the user and get confirmation:** on the next deploy the platform force-fetches their repository over the platform-hosted mirror, so any commit that exists only in the platform-hosted repository is lost. Afterwards pushes to the platform-hosted repository are refused and templates can no longer be applied — they push to their own repository instead.
|
|
263
|
+
|
|
264
|
+
Save `"upstream"` as `remote` in `.syntica/config.json` so later steps know not to push. Then continue at Step 4; **skip Step 6**.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Step 4 — docker-compose.yml
|
|
269
|
+
|
|
270
|
+
Check whether `docker-compose.yml` or `compose.yaml` exists in the project root using the Read tool.
|
|
271
|
+
|
|
272
|
+
**If found:** tell the user "Found docker-compose.yml." Continue to Step 5.
|
|
273
|
+
|
|
274
|
+
**If not found:**
|
|
275
|
+
|
|
276
|
+
Detect project type by checking for these files in order:
|
|
277
|
+
1. `package.json` → Node.js
|
|
278
|
+
2. `requirements.txt` or `pyproject.toml` → Python
|
|
279
|
+
3. `Dockerfile` → custom image
|
|
280
|
+
4. None of the above → use the AskUserQuestion tool with options `["Node.js", "Python", "Other (Dockerfile)"]` to ask: "What runtime does your application use?"
|
|
281
|
+
|
|
282
|
+
Generate a `docker-compose.yml` appropriate for the detected type.
|
|
283
|
+
|
|
284
|
+
**Node.js template:**
|
|
285
|
+
```yaml
|
|
286
|
+
services:
|
|
287
|
+
app:
|
|
288
|
+
build: .
|
|
289
|
+
ports:
|
|
290
|
+
- "3000:3000"
|
|
291
|
+
env_file:
|
|
292
|
+
- .env
|
|
293
|
+
environment:
|
|
294
|
+
- NODE_ENV=production
|
|
295
|
+
restart: unless-stopped
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Python template:**
|
|
299
|
+
```yaml
|
|
300
|
+
services:
|
|
301
|
+
app:
|
|
302
|
+
build: .
|
|
303
|
+
ports:
|
|
304
|
+
- "8000:8000"
|
|
305
|
+
env_file:
|
|
306
|
+
- .env
|
|
307
|
+
environment:
|
|
308
|
+
- PYTHONUNBUFFERED=1
|
|
309
|
+
restart: unless-stopped
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Custom image (has Dockerfile):**
|
|
313
|
+
```yaml
|
|
314
|
+
services:
|
|
315
|
+
app:
|
|
316
|
+
build: .
|
|
317
|
+
ports:
|
|
318
|
+
- "8080:8080"
|
|
319
|
+
env_file:
|
|
320
|
+
- .env
|
|
321
|
+
restart: unless-stopped
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Show the generated file to the user and use the AskUserQuestion tool with options `["Looks good", "I want to make changes"]` to ask: "Does this docker-compose.yml look correct?"
|
|
325
|
+
|
|
326
|
+
If **"I want to make changes"**: ask the user to describe the changes and update the file accordingly before writing.
|
|
327
|
+
|
|
328
|
+
After confirmed, write `docker-compose.yml` using the Write tool.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Step 5 — Pre-flight check
|
|
333
|
+
|
|
334
|
+
Read `docker-compose.yml` (or `compose.yaml`) and run both checks before pushing.
|
|
335
|
+
|
|
336
|
+
> **How secrets reach your containers:** at deploy time syntica writes all configured secrets to a `.env` file in your app directory. Docker Compose loads this file automatically when each service declares `env_file: - .env`. This means you do **not** need `${VAR}` references in your compose file — just add `env_file: - .env` to each service and the variables will be available at runtime.
|
|
337
|
+
|
|
338
|
+
If `docker-compose.yml` does not already have `env_file: - .env` on each service, tell the user and use the AskUserQuestion tool with options `["Yes — add it now", "No — I'll add it manually"]` to ask: "Would you like me to add `env_file: - .env` to your docker-compose.yml services now?"
|
|
339
|
+
|
|
340
|
+
If Yes, add `env_file:\n - .env` under each service in `docker-compose.yml`.
|
|
341
|
+
|
|
342
|
+
Also check `.gitignore` for a `.env` entry. If missing, append it — the `.env` file is generated at deploy time and must never be committed.
|
|
343
|
+
|
|
344
|
+
### Check 1 — Build method
|
|
345
|
+
|
|
346
|
+
For each service, inspect the `image:` and `build:` keys.
|
|
347
|
+
|
|
348
|
+
**Supported:**
|
|
349
|
+
- `build: .` or `build: <path>` — builds from a local Dockerfile ✅
|
|
350
|
+
- `image: <public-image>` with no `${...}` references and no private registry hostname ✅ (e.g. `redis:alpine`, `postgres:15`)
|
|
351
|
+
|
|
352
|
+
**Not supported:**
|
|
353
|
+
- `image:` containing `${...}` — image name uses an unresolved environment variable ❌
|
|
354
|
+
- `image:` referencing a private registry — any URL containing `.dkr.ecr.`, `gcr.io`, `ghcr.io`, `azurecr.io`, or any hostname-style prefix ❌
|
|
355
|
+
|
|
356
|
+
If any service uses an unsupported build method, **stop** and tell the user what was found, then use the AskUserQuestion tool with options `["Yes — create a Dockerfile", "No — I'll handle it myself"]` to ask:
|
|
357
|
+
"syntica cannot pull this image. Would you like me to create a Dockerfile so syntica can build it directly?"
|
|
358
|
+
|
|
359
|
+
If Yes, help them create a suitable Dockerfile and update the service in `docker-compose.yml` to use `build: .` instead. Then re-run both checks. If No, stop — do not push until this is resolved.
|
|
360
|
+
|
|
361
|
+
### Check 2 — Unresolved environment variables
|
|
362
|
+
|
|
363
|
+
Scan the full `docker-compose.yml` for `${VARIABLE_NAME}` patterns. Collect all unique variable names referenced.
|
|
364
|
+
|
|
365
|
+
Remove from the list:
|
|
366
|
+
- Variables that have an inline default in the compose file (`${VAR:-default}`)
|
|
367
|
+
- Common platform-provided variables: `PORT`, `NODE_ENV`, `PYTHONUNBUFFERED`, `HOST`, `TZ`
|
|
368
|
+
|
|
369
|
+
If any variables remain unaccounted for, tell the user which ones, then use the AskUserQuestion tool with options `["Yes — add them now", "No — continue anyway"]` to ask:
|
|
370
|
+
"These environment variables are referenced in docker-compose.yml but not configured as secrets. The application may fail to start if they are required. Would you like to add them now?"
|
|
371
|
+
|
|
372
|
+
If Yes, collect the values one at a time as `NAME=value`. For each, ask whether it is sensitive, then call `app_create_config` with:
|
|
373
|
+
```json
|
|
374
|
+
{
|
|
375
|
+
"token": "<token>",
|
|
376
|
+
"applicationId": "<appId>",
|
|
377
|
+
"kind": "value",
|
|
378
|
+
"scope": "app_env",
|
|
379
|
+
"environment": "<environment>",
|
|
380
|
+
"name": "<NAME>",
|
|
381
|
+
"value": "<value>"
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
Use `"kind": "secret"` for anything sensitive (API keys, passwords, tokens, connection strings) — that encrypts the value at rest and it **cannot be read back afterwards**. Use `"kind": "value"` for ordinary configuration such as `LOG_LEVEL` or a feature flag, which stays readable so the user can check what was set.
|
|
385
|
+
|
|
386
|
+
Note: names must be uppercase with underscores (e.g. `DATABASE_URL`). Convert lowercase automatically.
|
|
387
|
+
Tell the user: "⚠️ Secret values are encrypted and cannot be retrieved — make sure you have them saved elsewhere."
|
|
388
|
+
|
|
389
|
+
If No, continue with a warning.
|
|
390
|
+
|
|
391
|
+
### Check 3 — Environment variables used in application code
|
|
392
|
+
|
|
393
|
+
Scan the source files for environment variable references using the Bash tool.
|
|
394
|
+
|
|
395
|
+
**Determine the scan command based on the detected project type:**
|
|
396
|
+
|
|
397
|
+
Node.js / TypeScript (`.js`, `.ts`, `.jsx`, `.tsx`):
|
|
398
|
+
```bash
|
|
399
|
+
grep -rh --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" \
|
|
400
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build --exclude-dir=.next \
|
|
401
|
+
--exclude-dir=coverage --exclude-dir=.git \
|
|
402
|
+
-oP 'process\.env\.([A-Z0-9_]+)' . | sort -u
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
Python (`.py`):
|
|
406
|
+
```bash
|
|
407
|
+
grep -rh --include="*.py" \
|
|
408
|
+
--exclude-dir=__pycache__ --exclude-dir=.venv --exclude-dir=venv --exclude-dir=.git \
|
|
409
|
+
-oP '(?:os\.environ(?:\.get)?\(["\x27])([A-Z0-9_a-z]+)|(?:os\.getenv\(["\x27])([A-Z0-9_a-z]+)' . \
|
|
410
|
+
| grep -oP '[A-Z0-9_a-z]+$' | sort -u
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
If neither pattern yields results, skip this check.
|
|
414
|
+
|
|
415
|
+
**Also check for dynamic references** (values that cannot be extracted):
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
grep -rn --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" \
|
|
419
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build \
|
|
420
|
+
'process\.env\[' .
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
If any dynamic references are found, warn the user:
|
|
424
|
+
> "⚠️ Your code contains dynamic environment variable references (e.g. `process.env[someVar]`) in the files listed above. These cannot be checked automatically — make sure any variables accessed this way are configured as secrets."
|
|
425
|
+
|
|
426
|
+
**Build the list of variables found in code**, then remove:
|
|
427
|
+
- Variables already added as secrets during Check 2
|
|
428
|
+
- Variables with inline defaults in docker-compose (`${VAR:-default}`)
|
|
429
|
+
- Common platform-provided variables: `PORT`, `NODE_ENV`, `PYTHONUNBUFFERED`, `HOST`, `TZ`, `PATH`, `HOME`, `USER`
|
|
430
|
+
|
|
431
|
+
If any variables remain, tell the user which ones were found and in which files (re-run grep without `-h` to get filenames), then use the AskUserQuestion tool with options `["Yes — add them now", "No — continue anyway"]` to ask:
|
|
432
|
+
"These environment variables are used in your application code but not configured as secrets. Would you like to add them now?"
|
|
433
|
+
|
|
434
|
+
If Yes, collect the values one at a time as `NAME=value` and call `app_create_config` for each (same call as in Check 2 above). For any entry stored with `"kind": "secret"`, tell the user: "⚠️ Secret values are encrypted and cannot be retrieved — make sure you have them saved elsewhere." If No, continue with a warning.
|
|
435
|
+
|
|
436
|
+
### Check 4 — NODE_ENV for Node.js apps
|
|
437
|
+
|
|
438
|
+
If the project has a `package.json`, scan `docker-compose.yml` for `NODE_ENV=production`:
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
grep "NODE_ENV" docker-compose.yml 2>/dev/null || true
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
If `NODE_ENV=production` is not present in any service's `environment:` block, warn the user:
|
|
445
|
+
|
|
446
|
+
> "⚠️ `NODE_ENV=production` is not set in your docker-compose.yml. Node.js apps often disable static file serving, enable production error handling, and trust proxies only when this variable is set. Without it your app may fail the health check or behave unexpectedly in production."
|
|
447
|
+
|
|
448
|
+
Use the AskUserQuestion tool with options `["Yes — add it now", "No — I'll add it manually"]` to ask: "Would you like me to add `NODE_ENV=production` to your main app service?"
|
|
449
|
+
|
|
450
|
+
If Yes, add `NODE_ENV=production` under the `environment:` key of the first service that has a `build:` directive in `docker-compose.yml`. If no `environment:` key exists on that service, add one.
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
### Check 5 — .dockerignore audit
|
|
455
|
+
|
|
456
|
+
Check whether `.dockerignore` exists using the Read tool. If it does not exist, skip this check.
|
|
457
|
+
|
|
458
|
+
If it exists, read it and flag any line that would exclude a file critical to the build. Dangerous patterns include:
|
|
459
|
+
- `package.json`, `**/package.json`, or `*.json` globs at any path level
|
|
460
|
+
- `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
|
|
461
|
+
- `requirements.txt`, `pyproject.toml`
|
|
462
|
+
- `Dockerfile`
|
|
463
|
+
|
|
464
|
+
For each flagged line, explain the risk. For example: "`client/*.json` would exclude `client/package.json` from the build context, causing any `COPY client/package.json` instruction in your Dockerfile to fail."
|
|
465
|
+
|
|
466
|
+
Use the AskUserQuestion tool with options `["Yes — remove flagged lines", "No — I know what I'm doing"]` to ask: "These .dockerignore patterns may exclude files needed during the Docker build. Would you like me to remove them?"
|
|
467
|
+
|
|
468
|
+
If Yes, remove the flagged lines from `.dockerignore` and write the file back using the Write tool.
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
If all checks pass with no issues, tell the user: "✅ Pre-flight check passed — build method is supported, environment variables are accounted for, and your Docker configuration looks clean."
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## Step 5b — Node tier (instance size)
|
|
479
|
+
|
|
480
|
+
An environment needs a node tier before it can be deployed. Ask; never pick one
|
|
481
|
+
silently — the tier decides what the customer is billed.
|
|
482
|
+
|
|
483
|
+
Call `app_list_node_tiers` with `{ "token": "<token>", "orgId": "<orgId>" }`.
|
|
484
|
+
|
|
485
|
+
- If `mustAsk` is `false` (free plan), the free tier is the only option. Set it
|
|
486
|
+
without asking and tell the user which one you used.
|
|
487
|
+
- If `mustAsk` is `true` (Pay-as-you-go, or the plan could not be determined),
|
|
488
|
+
use the AskUserQuestion tool listing the `selectable` tiers by `name`, with
|
|
489
|
+
`instanceType` and `storageGb` as the description so the user can compare. Do
|
|
490
|
+
not offer the free tier — it is not selectable on a paid plan, and the
|
|
491
|
+
organisation is allowed only one free instance in total.
|
|
492
|
+
|
|
493
|
+
Then call `app_set_node_tier`:
|
|
494
|
+
```json
|
|
495
|
+
{
|
|
496
|
+
"token": "<token>",
|
|
497
|
+
"applicationId": "<appId>",
|
|
498
|
+
"environment": "<environment>",
|
|
499
|
+
"nodeTierId": "<id the user chose>"
|
|
500
|
+
}
|
|
501
|
+
```
|
|
502
|
+
Omit `regionId` — it defaults to the environment's existing region, or the first
|
|
503
|
+
active one.
|
|
504
|
+
|
|
505
|
+
If it fails with `NODE_TIER_REJECTED`, show the message to the user: it names the
|
|
506
|
+
real obstacle (free-tier limit already used, environment not in the plan, or a
|
|
507
|
+
paid tier without the Pay-as-you-go plan) and let them pick again or fix billing.
|
|
508
|
+
|
|
509
|
+
## Step 6 — First push
|
|
510
|
+
|
|
511
|
+
**Skip this entire step if `remote` in `.syntica/config.json` is `"upstream"`** (Step 3b — the application deploys from the user's own repository). Pushes to the platform-hosted repository are refused in that mode. Tell the user to commit and push to their own repository as usual, then continue to Step 7.
|
|
512
|
+
|
|
513
|
+
Stage and commit any newly created files:
|
|
514
|
+
```bash
|
|
515
|
+
git add -A
|
|
516
|
+
git status
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
If there are uncommitted changes, run:
|
|
520
|
+
```bash
|
|
521
|
+
git commit -m "chore: add syntica configuration"
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
Get the current branch:
|
|
525
|
+
```bash
|
|
526
|
+
git rev-parse --abbrev-ref HEAD
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**If the current branch is not `main` or `master`:**
|
|
530
|
+
|
|
531
|
+
Use the AskUserQuestion tool with options `["Yes — merge into main", "No — push this branch as-is"]` to ask:
|
|
532
|
+
"You're on branch `<branch>`. syntica deploys from `main`. Would you like to merge this branch into `main` now?"
|
|
533
|
+
|
|
534
|
+
**If Yes:**
|
|
535
|
+
```bash
|
|
536
|
+
git checkout main
|
|
537
|
+
git pull <remote from config> main --no-edit
|
|
538
|
+
git merge <feature branch> --no-edit
|
|
539
|
+
git push <remote from config> main
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
If any of these fail, show the error and ask the user to resolve it manually before continuing.
|
|
543
|
+
|
|
544
|
+
Tell the user: "Branch merged. Deploying from `main`."
|
|
545
|
+
|
|
546
|
+
**If No:** warn the user: "⚠️ You are pushing branch `<branch>` — remember to merge it into `main` before deploying, or deploy will target this branch."
|
|
547
|
+
|
|
548
|
+
Push to the platform:
|
|
549
|
+
```bash
|
|
550
|
+
git push <remote from config> HEAD:<current branch>
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
If the push fails due to no upstream tracking branch, run:
|
|
554
|
+
```bash
|
|
555
|
+
git push --set-upstream <remote from config> <current branch>
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
Tell the user: "✅ Your code is on syntica. Run `/syntica-deploy` to trigger your first deployment."
|
|
559
|
+
|
|
560
|
+
---
|
|
561
|
+
|
|
562
|
+
## Step 7 — Write CLAUDE.md
|
|
563
|
+
|
|
564
|
+
Check whether `CLAUDE.md` exists in the project root using the Read tool.
|
|
565
|
+
|
|
566
|
+
If it exists, read it and check whether it already contains a "Syntica" section. If it does, skip this step.
|
|
567
|
+
|
|
568
|
+
If it does not exist, or exists but has no Syntica section, append the following block (create the file if needed):
|
|
569
|
+
|
|
570
|
+
```markdown
|
|
571
|
+
## Syntica development
|
|
572
|
+
|
|
573
|
+
This project is deployed on Syntica. The `docker-compose.yml` defines how the application runs **in the cloud** — you do not need Docker locally and should never run `docker compose up`.
|
|
574
|
+
|
|
575
|
+
Use the Syntica MCP skills to work with the project:
|
|
576
|
+
- Push code and deploy: `/vibe`
|
|
577
|
+
- Debug running services: `/syntica-debug`
|
|
578
|
+
|
|
579
|
+
All interaction with running containers happens through the MCP tools, not locally.
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
Commit the CLAUDE.md if it was created or changed:
|
|
583
|
+
```bash
|
|
584
|
+
git add CLAUDE.md
|
|
585
|
+
git diff --cached --quiet || git commit -m "chore: add Syntica development instructions to CLAUDE.md"
|
|
586
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: syntica-security
|
|
3
|
+
description: Manage your organisation's validation/security prompts on syntica — view what runs, and add/edit/delete your own custom prompts at organisation, application, or environment scope. Use when the user wants to see, add, change, or remove validation prompts (not to run them — that's pre-commit-validation).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Syntica Security — Prompt Management
|
|
7
|
+
|
|
8
|
+
Announce at start: "I'm using syntica-security to manage your validation prompts."
|
|
9
|
+
|
|
10
|
+
This skill **manages** the prompt registry. To actually run the checks against a
|
|
11
|
+
diff, use `pre-commit-validation`.
|
|
12
|
+
|
|
13
|
+
## Concepts
|
|
14
|
+
|
|
15
|
+
- **Platform-standard prompts** — curated by syntica, always run, and cannot
|
|
16
|
+
be edited or deleted here. They show up in listings as `owned: false`.
|
|
17
|
+
- **Your custom prompts** — owned by your org, applied **additively** on top of
|
|
18
|
+
the standard ones, at one of three scopes:
|
|
19
|
+
- `org` — every application in your organisation
|
|
20
|
+
- `application` — one application (needs its `applicationId`)
|
|
21
|
+
- `environment` — one environment of one application (needs `applicationId` + `environment`)
|
|
22
|
+
|
|
23
|
+
## View what runs
|
|
24
|
+
|
|
25
|
+
Call `validation_list_prompts`. It returns platform-standard prompts plus your
|
|
26
|
+
org's own, with `scope` and targeting. Summarise grouped by scope.
|
|
27
|
+
|
|
28
|
+
## Add a custom prompt
|
|
29
|
+
|
|
30
|
+
Call `validation_add_prompt` with `name`, `content`, and `scope`:
|
|
31
|
+
|
|
32
|
+
- For `application`/`environment` scope you must supply `applicationId` (and
|
|
33
|
+
`environment` for environment scope). If the user hasn't given them, ask.
|
|
34
|
+
- Write `content` as an **instruction to the reviewing agent** — what to look
|
|
35
|
+
for, and to report each finding as ERROR or WARNING with `file:line`. If the
|
|
36
|
+
user's request is vague, draft the content and read it back before creating.
|
|
37
|
+
|
|
38
|
+
## Edit a prompt
|
|
39
|
+
|
|
40
|
+
Call `validation_update_prompt` with the `id` (from the list) and the new
|
|
41
|
+
`name`/`content`. Only your org's prompts can be edited — platform-standard ones
|
|
42
|
+
will be rejected.
|
|
43
|
+
|
|
44
|
+
## Delete a prompt
|
|
45
|
+
|
|
46
|
+
Deletion is destructive — **confirm with the user first**, showing the prompt's
|
|
47
|
+
name and scope. Then call `validation_delete_prompt` with its `id`.
|
|
48
|
+
|
|
49
|
+
## Notes
|
|
50
|
+
|
|
51
|
+
- All writes are scoped to the caller's organisation by the backend: you cannot
|
|
52
|
+
see, edit, or delete another org's prompts, and attempts return 403.
|
|
53
|
+
- These changes are shared across your org and persist for future sessions and
|
|
54
|
+
teammates — they are not local to this session.
|