@flisk-sh/flisk 1.4.5 → 1.4.7

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.
Files changed (117) hide show
  1. package/README.md +37 -14
  2. package/cli/dist/agent-runtimes/custom.js +94 -13
  3. package/cli/dist/commands/agent.js +144 -123
  4. package/cli/dist/commands/doctor.js +62 -12
  5. package/cli/dist/commands/down.js +33 -1
  6. package/cli/dist/commands/logs.js +107 -3
  7. package/cli/dist/commands/project.js +27 -0
  8. package/cli/dist/commands/resource.js +3 -1
  9. package/cli/dist/commands/status.js +82 -34
  10. package/cli/dist/commands/ui.js +41 -2
  11. package/cli/dist/commands/up.js +173 -12
  12. package/cli/dist/commands/upgrade.js +2 -2
  13. package/cli/dist/components/DetailPanel.js +23 -3
  14. package/cli/dist/mcp/tools.js +9 -6
  15. package/cli/dist/types/index.js +0 -2
  16. package/cli/dist/utils/agent-format.js +18 -0
  17. package/cli/dist/utils/agent-sessions.js +122 -0
  18. package/cli/dist/utils/agent-skills.js +64 -0
  19. package/cli/dist/utils/bun-requirement.js +7 -4
  20. package/cli/dist/utils/cold-preflight.js +55 -32
  21. package/cli/dist/utils/doctor-fix-first.js +93 -0
  22. package/cli/dist/utils/doctor-native.js +96 -0
  23. package/cli/dist/utils/doctor-report.js +3 -0
  24. package/cli/dist/utils/native-project.js +41 -0
  25. package/cli/dist/utils/native-runtime.js +516 -0
  26. package/cli/dist/utils/native-service.js +95 -0
  27. package/cli/dist/utils/native-up.js +156 -0
  28. package/cli/dist/utils/platform.js +1 -1
  29. package/cli/dist/utils/project-templates.js +1 -1
  30. package/cli/dist/utils/service-manifest.js +10 -1
  31. package/cli/dist/utils/services.js +11 -1
  32. package/cli/dist/utils/startup-report.js +45 -3
  33. package/cli/dist/utils/status-groups.js +23 -0
  34. package/cli/dist/utils/tilt-logs.js +8 -0
  35. package/cli/dist/utils/up-hints.js +42 -0
  36. package/cli/dist/utils/up-progress.js +117 -0
  37. package/cli/dist/utils/up-readiness.js +5 -0
  38. package/cli/dist-bundle/{chunk-Z5QEE4SW.js → chunk-6OW2GVQV.js} +1 -1
  39. package/cli/dist-bundle/chunk-B2JOM3HN.js +35 -0
  40. package/cli/dist-bundle/{chunk-VMVTECCK.js → chunk-F2DLIM75.js} +1 -1
  41. package/cli/dist-bundle/chunk-L6O7TT3K.js +18 -0
  42. package/cli/dist-bundle/chunk-MFY7RZ76.js +130 -0
  43. package/cli/dist-bundle/{chunk-SFOFTVYM.js → chunk-MYAYJF4Q.js} +1 -1
  44. package/cli/dist-bundle/{chunk-LUUJ4JB7.js → chunk-P7GZ6NGM.js} +1 -1
  45. package/cli/dist-bundle/{chunk-BP2M4OJ4.js → chunk-QEBN6ZVQ.js} +1 -1
  46. package/cli/dist-bundle/{chunk-4J2FLFUA.js → chunk-T44DEEL6.js} +1 -1
  47. package/cli/dist-bundle/{chunk-U42XZWXB.js → chunk-TIPSERWO.js} +1 -1
  48. package/cli/dist-bundle/{chunk-V36PT2HF.js → chunk-VYPB7MY5.js} +1 -1
  49. package/cli/dist-bundle/{chunk-TIYTGN5R.js → chunk-XHENT4KO.js} +1 -1
  50. package/cli/dist-bundle/{chunk-CGTWXWBU.js → chunk-YTBTCAWY.js} +1 -1
  51. package/cli/dist-bundle/cli.js +486 -396
  52. package/cli/dist-bundle/cold-preflight-DQVJUGBB.js +2 -0
  53. package/cli/dist-bundle/{demo-stage-G4W23BXW.js → demo-stage-F4YA7UL2.js} +1 -1
  54. package/cli/dist-bundle/{open-HQFT6WDC.js → open-ZUSSVPD3.js} +1 -1
  55. package/cli/dist-bundle/project-JFCTPRP5.js +2 -0
  56. package/cli/dist-bundle/{project-templates-IMJ3OX5I.js → project-templates-2VQPUBSQ.js} +1 -1
  57. package/cli/dist-bundle/{services-GLFKZBBZ.js → services-DOHDHOCT.js} +1 -1
  58. package/cli/dist-bundle/{tilt-port-owner-PJN4MPYE.js → tilt-port-owner-XODQHXHX.js} +1 -1
  59. package/cli/package.json +1 -1
  60. package/cli/templates/agent-skills/flisk-agent-ops/SKILL.md +39 -0
  61. package/cli/templates/agent-skills/flisk-build/SKILL.md +85 -0
  62. package/cli/templates/agent-skills/flisk-doctor/SKILL.md +28 -0
  63. package/cli/templates/agent-skills/flisk-recipe-ai-agent/SKILL.md +45 -0
  64. package/cli/templates/agent-skills/flisk-recipe-blog/SKILL.md +36 -0
  65. package/cli/templates/agent-skills/flisk-recipe-saas/SKILL.md +39 -0
  66. package/cli/templates/agent-skills/flisk-recipe-shop/SKILL.md +41 -0
  67. package/cli/templates/agent-skills/flisk-recipe-starters/SKILL.md +46 -0
  68. package/cli/templates/agent-skills/flisk-resource/SKILL.md +27 -0
  69. package/cli/templates/agent-skills/flisk-status/SKILL.md +25 -0
  70. package/cli/templates/agent-skills/flisk-troubleshoot/SKILL.md +227 -0
  71. package/cli/templates/agent-skills/flisk-up/SKILL.md +37 -0
  72. package/examples/{tdk-example → flisk-example}/README.md +2 -2
  73. package/package.json +2 -2
  74. package/runtime/discovery/AGENTS.md +1 -1
  75. package/runtime/discovery/TILT_DISCOVERY.star +1 -1
  76. package/runtime/discovery/deterministic.star +1 -1
  77. package/runtime/engine/AGENTS.md +3 -3
  78. package/runtime/engine/README.md +1 -1
  79. package/runtime/engine/REFACTORING_MANIFEST_SYSTEM.md +1 -1
  80. package/runtime/engine/assets/docker/wake-gateway/decide.ts +1 -1
  81. package/runtime/engine/assets/docker/wake-gateway/server.ts +2 -2
  82. package/runtime/engine/assets/scripts/mac-m1-resource-monitor.sh +6 -6
  83. package/runtime/engine/schemas/service-schema.json +87 -21
  84. package/runtime/engine/scripts/debug-container.sh +1 -1
  85. package/runtime/engine/scripts/generate-manifest.sh +2 -2
  86. package/runtime/engine/topologies/platform/docker/compose/traefik_standalone.star +19 -4
  87. package/runtime/engine/topologies/platform/docker/constants.star +2 -2
  88. package/runtime/engine/topologies/platform/docker/networking/traefik_static_routes.star +2 -2
  89. package/runtime/engine/topologies/tilt/manifest/mapper.star +1 -1
  90. package/runtime/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +8 -2
  91. package/runtime/ext/ide-components/README.md +1 -1
  92. package/runtime/ext/ui-enhancements/extension.yaml +2 -2
  93. package/runtime/specs/specs/TILT_SERVICE_DEFAULTS.star +1 -1
  94. package/runtime/specs/specs/TILT_TECH_STACK.star +1 -1
  95. package/cli/dist-bundle/chunk-BMHPPX2Q.js +0 -35
  96. package/cli/dist-bundle/chunk-PEZQEZVV.js +0 -17
  97. package/cli/dist-bundle/chunk-ULMQVD7J.js +0 -122
  98. package/cli/dist-bundle/cold-preflight-3BNDOLGS.js +0 -2
  99. package/cli/dist-bundle/project-JZO2CPZZ.js +0 -2
  100. /package/examples/{tdk-example → flisk-example}/LICENSE +0 -0
  101. /package/examples/{tdk-example → flisk-example}/TILT_SERVICE_DEFAULTS.star +0 -0
  102. /package/examples/{tdk-example → flisk-example}/TILT_TECH_STACK.star +0 -0
  103. /package/examples/{tdk-example → flisk-example}/Tiltfile +0 -0
  104. /package/examples/{tdk-example → flisk-example}/services/platform/messaging/docker-compose.yml +0 -0
  105. /package/examples/{tdk-example → flisk-example}/services/shop/orders-api/package.json +0 -0
  106. /package/examples/{tdk-example → flisk-example}/services/shop/orders-api/service.json +0 -0
  107. /package/examples/{tdk-example → flisk-example}/services/shop/orders-api/src/index.ts +0 -0
  108. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/index.html +0 -0
  109. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/package.json +0 -0
  110. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/public/.gitkeep +0 -0
  111. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/service.json +0 -0
  112. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/src/main.tsx +0 -0
  113. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/src/orders.tsx +0 -0
  114. /package/examples/{tdk-example → flisk-example}/services/shop/orders-app/src/style.css +0 -0
  115. /package/examples/{tdk-example → flisk-example}/services/shop/orders-worker/package.json +0 -0
  116. /package/examples/{tdk-example → flisk-example}/services/shop/orders-worker/service.json +0 -0
  117. /package/examples/{tdk-example → flisk-example}/services/shop/orders-worker/src/index.ts +0 -0
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: flisk-troubleshoot
3
+ description: Diagnose and fix Flisk local-dev problems with verified commands. Covers `flisk doctor`, `flisk up` or `flisk down` failing or hanging, "Docker daemon is not responding", red Tilt resources (pull access denied for golden images, missing shared-platform-engineering files, TS2688 bun types, run-only "No such image"), Postgres crash loops, services never reaching healthy, a machine overloaded by many services, Docker image size vs memory questions, and benchmarking how many services fit on a machine. Use this whenever someone works in flisk or a Flisk project (flisk-erp-system, flisk-saas-starter, flisk-restaurant-example, auth-user) and anything about flisk, Tilt, or Docker is broken, slow, or being measured, even if they never say "troubleshoot".
4
+ license: MIT
5
+ compatibility: Requires the flisk CLI, Docker and Tilt on the local machine. Does not deploy.
6
+ metadata:
7
+ author: flisk-sh
8
+ version: "1.0"
9
+ ---
10
+
11
+ # Flisk troubleshooting
12
+
13
+ This skill comes from a long session on 2026-09-25. It brought `flisk-erp-system` (107 services) up, measured it, and wasted a lot of the user's time along the way. Everything below marked **measured** or **verified** was run on the user's 16 GB MacBook Air (Docker VM: 8 CPUs, 7,934 MiB). Anything else is labelled as unknown.
14
+
15
+ ## How to work (the expensive lessons)
16
+
17
+ - **Say what you measured, what you estimated, and what you don't know, in that order.** Most of the frustration came from confident claims that a later measurement contradicted, such as "memory is ~16 MiB/container" (`docker stats`, which undercounts) and "112 s boot" (actually the launcher script). "I don't know yet, here is how I'd find out" is a good answer.
18
+ - **Check machine load before blaming Docker, Tilt or the code.** An overloaded Mac makes every tool look broken.
19
+ - **Before anything that runs longer than about 5 minutes or starts dozens of containers, say so and give an estimate.** A full ERP `flisk up` froze this machine once. Ask first.
20
+ - **Give short status lines while waiting.** Silence during long builds reads as "nothing works".
21
+ - **Don't polish a proxy metric.** Shrinking images didn't touch the real bottleneck. Ask what actually hurts (time, CPU, a freeze) and measure that.
22
+
23
+ ## First 60 seconds: triage
24
+
25
+ ```bash
26
+ sysctl -n vm.loadavg; top -l 1 -n 0 | grep -E "CPU usage|PhysMem"
27
+ time docker ps -q | wc -l
28
+ pgrep -fl "tilt up"
29
+ docker info --format 'CPUs={{.NCPU}} MemTotal={{.MemTotal}}'
30
+ ```
31
+
32
+ - **`docker ps` taking more than about 5 s means overload, not breakage.** Measured: 6–13 s with 110 ERP containers plus Tilt running, load average 28–43, 99 MB free RAM. `flisk doctor` and `flisk down` both fail their own 10 s Docker check in that state.
33
+ - **A `tilt up` process still running recreates any container you `docker stop`** within seconds. Stop Tilt first.
34
+ - **Other Flisk projects share the `*-autogenerated-*` container naming** (for example kitchen, guest, operations and auth from the restaurant and auth projects). Filter by stack name before stopping anything.
35
+
36
+ ## Symptoms, causes and fixes (verified)
37
+
38
+ ### "Docker daemon is not responding (`docker ps` hung for 10s)"
39
+
40
+ **Cause:** overload, as above. `flisk down` is blocked by the same check.
41
+
42
+ **Fix:** stop Tilt, then stop the project's containers directly.
43
+
44
+ ```bash
45
+ pkill -TERM -f "tilt up -f $PWD/.flisk/.flisk-out/Tiltfile"
46
+ docker ps --format '{{.Names}}' | grep -E '^(finance|hr|sales|inventory|manufacturing|supply_chain|analytics)-autogenerated-' | xargs docker stop
47
+ ```
48
+
49
+ ### Postgres restarting with "Database is uninitialized and superuser password is not specified"
50
+
51
+ **Cause:** the container was created while `DB_PASSWORD` was empty. Environment variables are fixed when a container is created, so fixing `.env` later doesn't help.
52
+
53
+ **Check:**
54
+
55
+ ```bash
56
+ docker inspect <project>_postgres --format '{{range .Config.Env}}{{println .}}{{end}}' | grep POSTGRES_PASSWORD
57
+ ```
58
+
59
+ **Fix:** recreate the container (Tilt or compose `up` recreates it). The data volume survives.
60
+
61
+ ### Tilt build error `pull access denied ... docker.io/library/<project>-l4-backend:latest`
62
+
63
+ **Cause:** the golden layers aren't built yet (the `golden-layers-build` resource is still running).
64
+
65
+ **Fix:** wait for it to finish. Tilt does **not** retry resources that failed before it finished, so trigger every errored resource yourself.
66
+
67
+ ```bash
68
+ tilt get uiresources -o json | python3 -c 'import json,sys; [print(i["metadata"]["name"]) for i in json.load(sys.stdin)["items"] if i.get("status",{}).get("updateStatus")=="error"]' | xargs -n1 tilt trigger
69
+ ```
70
+
71
+ ### `*-run-only` resources fail with `No such image: <stack>_<svc>:dev`
72
+
73
+ **Cause:** they ran `docker compose up --no-build` before the image existed.
74
+
75
+ **Fix:** once the image builds, `tilt trigger` them.
76
+
77
+ ### Missing generated files in the build context
78
+
79
+ The build fails with `"/shared-platform-engineering/docker-templates/<x>.sh": not found` or `"/package.json": not found`.
80
+
81
+ **Cause:** the project is missing its generated runtime assets.
82
+
83
+ **Fix:**
84
+ - `flisk project --yes` copies `shared-platform-engineering/docker-templates` (verified).
85
+ - If the root `package.json` is still missing, add a Bun workspace manifest. This is what fixed ERP:
86
+
87
+ ```json
88
+ { "name": "<project>", "private": true, "type": "module", "workspaces": ["services/*/*"] }
89
+ ```
90
+
91
+ - `flisk doctor` now reports both (`checkGeneratedProjectRuntimeAssets`).
92
+
93
+ ### `bun run build` fails with `TS2688: Cannot find type definition file for 'bun'`
94
+
95
+ **Cause:** the generated tsconfig sets `"types": ["bun"]`, but the service's `package.json` has no `@types/bun`.
96
+
97
+ **Fix:** add `"@types/bun": "^1.4.2"` to `devDependencies`. `flisk doctor` now reports this (`checkTypeScriptTypeDependencies`).
98
+
99
+ ### `flisk up <stack>` queues every stack
100
+
101
+ **Observed, not root-caused:** `flisk up finance` left 129 resources pending across all stacks.
102
+
103
+ **Protect the machine:** check the counts, then disable the other stacks.
104
+
105
+ ```bash
106
+ tilt get uiresources -o json | python3 -c 'import json,sys,collections; print(collections.Counter(i.get("status",{}).get("updateStatus") for i in json.load(sys.stdin)["items"]))'
107
+ tilt disable <other-stack-resource> <...>
108
+ ```
109
+
110
+ ### Engine edits have no effect
111
+
112
+ **Cause:** projects run a vendored copy of the engine at `.flisk/.flisk-out/flisk-cli-ext/`. The installed `/usr/local/bin/flisk` vendors **its own bundled engine**, so it can silently overwrite your local one.
113
+
114
+ **Fix:** re-vendor from your local checkout, then check the copy matches.
115
+
116
+ ```bash
117
+ (cd <core>/cli && bun run build)
118
+ FLISK_EXTENSION_SOURCE=<core> node <core>/cli/bin/flisk.js project --yes
119
+ diff -rq <core>/engine/topologies/platform/docker .flisk/.flisk-out/flisk-cli-ext/engine/topologies/platform/docker
120
+ ```
121
+
122
+ ### Reading Tilt state
123
+
124
+ - Use the CLI. The HTTP API (`localhost:10350/api/view`) returns 403 "missing session token".
125
+ - `tilt get uiresources <name> -o json` shows a resource's state. **`buildHistory[0]` is the newest build**; reading `[-1]` shows a stale error and misleads you.
126
+ - `tilt logs <resource>` gives the full build log.
127
+
128
+ ## ERP project layout
129
+
130
+ | Thing | Value |
131
+ |---|---|
132
+ | Service manifests | `services/<stack>/<svc>/service.json` |
133
+ | Image names | `<stack>_<svc>:dev` |
134
+ | Compose project | `<stack>-autogenerated` |
135
+ | Compose file | `services/<stack>/.autogenerated/docker-compose.app.autogenerated.yml` |
136
+ | Postgres | `services/platform/database-management/docker-compose.yml` |
137
+ | Traefik | `.flisk/.flisk-out/docker-compose.traefik.yml` |
138
+ | Databases | `<project>_<stack>`, created with `createdb` |
139
+ | Golden images | `<project>-l1`, `-l2`, `-l3-*`, `-l4-*` |
140
+
141
+ ## Measuring without fooling yourself
142
+
143
+ ### Image size is disk, not RAM
144
+
145
+ - `docker images` counts shared layers once per image. Real disk use is `docker system df`. The 107 ERP images add up to 26 GB listed, but all 151 images on the machine together use 6 GB on disk.
146
+ - See what fills an image, layer by layer:
147
+
148
+ ```bash
149
+ docker history <img> --format '{{.Size}}\t{{.CreatedBy}}'
150
+ ```
151
+
152
+ - **Measured:** ERP backends are 176–276 MB each, but only 4.5–8.8 MB is service-specific. The rest is shared: Bun binary 93 MB, Alpine 9 MB, L1 packages 30 MB.
153
+ - **Measured:** `auth_auth-api-backend:dev` is 826 MB on disk, yet uses 33 MiB of RAM when running. Of the 826 MB, two copies of `node_modules` take 199 MB each, and hugo takes 57 MB. The duplicate-copy fix is only on branch `autoresearch/sep25`. The hugo removal is on `main`. Both need a rebuild to take effect.
154
+
155
+ ### RAM: `docker stats` undercounts
156
+
157
+ It leaves out Docker's per-container overhead in the VM (containerd shims and the init process). Use the change in the Docker VM's own memory instead:
158
+
159
+ ```bash
160
+ docker run --rm alpine awk '/MemTotal/{t=$2}/MemAvailable/{a=$2}END{printf "%d MiB used\n",(t-a)/1024}' /proc/meminfo
161
+ ```
162
+
163
+ - **Measured:** 100 idle ERP containers cost **2,076 MiB real (about 21 MiB each)**. `docker stats` reported 1,693 MiB for the same containers.
164
+ - The VM measurement is noisy for small counts: the same 20-container setup read 442 MiB one time and 214 MiB the next. Use 100 containers, or repeat the run and report the range.
165
+
166
+ ### Time: start containers in parallel, as Tilt does
167
+
168
+ A serial `docker run` loop measures the launcher, not the services. For parallel starts on macOS:
169
+
170
+ ```bash
171
+ tr '\n' '\0' < cmds.txt | xargs -0 -n1 -P8 sh -c
172
+ ```
173
+
174
+ - **Measured:** 100 ERP containers were all healthy in **31.7 s** starting 8 at a time, with 0 crashes. Starting the containers took 26.6 s of that.
175
+ - The website claims "full boot in under 5 seconds". Measured, that only holds for about 5 services (4.5 s).
176
+
177
+ ### North-star math: 100 services in 16 GB
178
+
179
+ (Docker VM MemTotal − 512 MiB for infrastructure) ÷ 100 = the per-service budget. On this Mac that's (7,934 − 512) ÷ 100 ≈ **74 MiB per service**. The measured 21 MiB fits, but only for idle containers answering `/health`. It hasn't been measured under real load.
180
+
181
+ ## Tools in this repo and how far to trust them
182
+
183
+ | Tool | Status |
184
+ |---|---|
185
+ | `bun scripts/benchmark/container-scale.ts --synthetic` | **Verified** for 5 to 100 containers. Starts containers serially, so "all healthy" is about the launch time. |
186
+ | `container-scale.ts` default (compose) mode | **Verified at tier 5** (2026-09-26): real generated compose files, real Postgres, real Traefik, 5/5 requests through Traefik returned 200, all healthy in 4.9s. Not yet run at 100 — that's the one that answers the north star. Its first run hung indefinitely (`Bun.spawn()` + a `Bun.sleepSync()` poll on `exitCode` never observes the exit, because `sleepSync` blocks the event loop Bun needs to record it) — fixed by launching with `spawnSync` instead. If you see a `container-scale.ts` run sit for minutes with 0% CPU while its containers are already healthy, this bug is back; check for `Bun.spawn` + `sleepSync` polling anywhere in the file. |
187
+ | `scripts/autoresearch/layer-eval.sh` with the `layer-autoresearch` skill | **Verified** (4 runs). Run it from a worktree outside `~/Developer/Codex`. |
188
+ | `scripts/measure-idle-footprint.sh <container>` | Written but **never run**. |
189
+ | `tilt alpha tiltfile-result -f <Tiltfile>` | Runs Starlark without starting anything. `print` output is swallowed, so return data with `fail('RESULT' + encode_json(r))`. `load()` needs a literal path. |
190
+ | `tests/tilt-engine/test_runtime_container_footprint.py` | Runs the real generators through Tilt. |
191
+
192
+ ## Environment traps
193
+
194
+ - **`.flisk/.project-id` is not gitignored by default and is easy to accidentally stage.** It's created the first time anything checks a Premium license (`getOrCreateProjectId` in `cli/src/generator/extension-fetch.ts`) - a random UUID sent alongside `FLISK_LICENSE_KEY` to the license server for per-project tracking, not itself a secret credential, but it's local machine state that has no business in a shared repo. Found staged (`git status`, not yet committed - caught before it reached `origin/main`) in `flisk-erp-system` on 2026-09-26; `flisk-saas-starter` and `flisk-restaurant-example` had the same `.gitignore` gap with no file yet; `flisk-user-management` has **no `.gitignore` at all** (currently harmless - only 35 minimal tracked files, nothing sensitive - but unprotected the moment real development starts there). The CLI has no `.gitignore` template of its own to fix at the source (`flisk project` doesn't generate one; each starter repo ships its own) - check every project's `.gitignore` for `.flisk/.project-id` individually, and `git status`/`git log --all -- .flisk/.project-id` before assuming it's fine.
195
+
196
+ - **Auto-commit tool.** Something outside Claude commits and pushes edits in `~/Developer/Codex/*` repos to `origin/main` within about a minute, with messages like "skill" or "specs". Do experiments in a worktree outside that folder:
197
+
198
+ ```bash
199
+ git worktree add ~/Developer/<name> <branch>
200
+ ```
201
+
202
+ - **macOS shell:**
203
+ - There's no `timeout` command.
204
+ - `xargs -I` has a 255-character limit, so use the `-0` form above.
205
+ - System `python3` is 3.9: add `from __future__ import annotations` before using `X | None` types.
206
+ - Bash is version 3.2.
207
+ - **Lint only the files you touched:**
208
+
209
+ ```bash
210
+ cd cli && ./node_modules/.bin/biome check <files>
211
+ ```
212
+
213
+ `bun run lint -- <files>` still lints the whole repo, which has many pre-existing errors.
214
+ - **Failures that aren't yours:**
215
+ - pytest `test_docker_generator_bugs.py::test_expose_line_must_be_numeric_port` and `test_health_endpoints.py::test_overall_health_endpoint_structure` also fail on the unmodified code.
216
+ - vitest `saas-starter-integration` and `stack-features-e2e` time out when Docker is busy.
217
+
218
+ ## Resolved since the first version of this skill
219
+
220
+ - **`flisk up <stack>` queuing every stack — fixed and verified (2026-09-26).** `flisk up finance` computed the right 16-service list but passed it to Tilt as bare positional args. The generated Tiltfile's focus filter (`Config.apply_focus` / `apply_focus_filter` in `profiles.star`) only reads the `--focus` flag - the positional-args catch-all it also defines (`cfg['args']`) is never read anywhere. So every stack-scoped `flisk up` silently fell back to Tilt's default "pre-alpha" phase and enabled every stack in it (verified: 247 enabled resources instead of 16-40). Fix: `buildTiltUpArgs` (`cli/src/utils/tilt.ts`) now passes `--focus=<stackName>`, reusing the Tiltfile's own dependency-aware domain expansion. **Argument order matters**: `--focus=...` must come after a `--` separator (`tilt up -f <path> -- --focus=finance <names>`) - `tilt up` rejects `--focus` as an unrecognized top-level flag otherwise (`tilt up --help` lists its real flags; custom Tiltfile config flags only reach `config.parse()` via `--`). Verified end-to-end: `tilt get uiresources` showed 402 Disabled / 24 Enabled for `flisk up finance` after the fix, and the 24 enabled were exactly finance's services plus required infra.
221
+
222
+ - **What actually overloads a real full `flisk up` at 100+ services — tested and it held (2026-09-26).** Ran a real, uncapped `flisk up` (no stack filter, all 107 services, Tilt doing real builds and reconciliation - not the synthetic/capped benchmark) with a self-killing watchdog sampling load/free-memory/`docker ps` latency every 5s. Result: **110/110 containers reached healthy, zero crashes, zero danger-threshold strikes**, over an 18-minute run. Load peaked around 20 during the busiest build phase (~20-30 containers starting at once) and then *settled back down* to 11-16 as more services came online, finishing at 11.45 with all 110 up. `docker ps` occasionally spiked to 2-6s under load but never approached the 10s `flisk doctor` timeout for long. This is the same scenario that froze the machine on 2026-09-25 (load 28-43, 99 MB free, `docker ps` 6-13s) - it did not recur. Caveat: this is one run on one machine state, and it isn't certain which fix (or whether the host simply had less competing load this time) made the difference; the single-process-CMD image rebuild only covered a minority of services (finance + a couple of supply_chain ones) at the time of this run, so a full image rebuild wasn't a factor. Re-run with the watchdog pattern above (`sysctl -n vm.loadavg`, `vm_stat` free pages, timed `docker ps`) before trusting a "it's fine now" claim on a different machine or after further engine changes.
223
+
224
+ ## Still unknown
225
+
226
+ - **Whether Bun `--smol` (`BUN_OPTIONS=--smol`) saves memory.** Bun does read the variable, but the A/B test was inconclusive.
227
+ - **Why auth's production `node_modules` is 199 MB.**
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: flisk-up
3
+ description: Start a Flisk stack with `flisk up`, preview it first with `flisk up <stack> --dry-run`, and confirm the healthy URLs. Use when the user asks to run, start, or bring up their local services, or after changing service.json files.
4
+ license: MIT
5
+ compatibility: Requires the flisk CLI. Services that declare a `command` need only their own runtime; other services need Docker and Tilt. Does not deploy.
6
+ metadata:
7
+ author: flisk-sh
8
+ version: "1.0"
9
+ ---
10
+
11
+ # Flisk up
12
+
13
+ Start local services from `service.json` manifests. Flisk writes the Docker and Tilt configuration; do not write Dockerfiles, Tiltfiles, or routes by hand.
14
+
15
+ ## Workflow
16
+
17
+ 1. Run `flisk doctor` if the machine has not been checked yet. Stop on unresolved errors.
18
+ 2. Preview the stack: `flisk up <stack> --dry-run`. Show the user which services and URLs will start.
19
+ 3. Start it: `flisk up <stack>`. Omit `<stack>` to start every stack.
20
+ 4. Confirm health with `flisk status --json`. Report each service's URL only after it reports healthy.
21
+ 5. If `flisk up` refuses to start because generated files differ from `service.json`, regenerate from the source manifest. Use `--ignore-drift` only when the user asks to start anyway.
22
+
23
+ ## Services that run without Docker
24
+
25
+ A service whose `service.json` declares `command` (for example `"command": "node server.js"`, with `appName`, `appType`, `port`, `dependsOn` and an optional `healthCheckPath`) runs as a local process. When every selected service has one, `flisk up` needs no Docker and no Tilt: it starts them in `dependsOn` order, prints `http://localhost:<port>` for each, prefixes their output, and restarts a service that exits. It stays in the foreground; `flisk down` stops it from another terminal.
26
+
27
+ - Prefer `command` services for a simple app (an API, a website, a worker). Use Docker services when the app needs a database, one gateway URL, or the container it deploys.
28
+ - Do not mix the two in one project: `flisk up` refuses with `MIXED_RUNTIME`.
29
+ - `flisk up --json` reports `"runtime": "native"` and each service's URL. Read output with `flisk logs --service <name>`.
30
+ - Guide: docs/run-without-docker.md.
31
+
32
+ ## Guardrails
33
+
34
+ - Ask before starting a large stack or one likely to build many images; cold builds can take several minutes.
35
+ - Use `flisk up -f` only when the user agrees to kill the existing Tilt process.
36
+ - Do not edit `.autogenerated/` or other generated output. Change `service.json` instead.
37
+ - Flisk runs locally. Do not use it to deploy to a cluster.
@@ -10,10 +10,10 @@ flisk project --yes
10
10
  flisk up
11
11
  ```
12
12
 
13
- Open `http://app.tdk-example.localhost/orders-app/` and create an order, or use the routed API:
13
+ Open `http://app.flisk-example.localhost/orders-app/` and create an order, or use the routed API:
14
14
 
15
15
  ```sh
16
- curl -fsS -X POST http://api.tdk-example.localhost/api/orders \
16
+ curl -fsS -X POST http://api.flisk-example.localhost/api/orders \
17
17
  -H 'content-type: application/json' -d '{"item":"coffee"}'
18
18
  ```
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flisk-sh/flisk",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Flisk CLI — start services on your machine.",
5
5
  "homepage": "https://flisk.sh",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "!runtime/**/*.spec.*",
30
30
  "!runtime/**/test_*.py",
31
31
  "!runtime/**/*_test.py",
32
- "examples/tdk-example",
32
+ "examples/flisk-example",
33
33
  "cli/bin",
34
34
  "cli/dist/**/*.js",
35
35
  "cli/dist-bundle/**/*.js",
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- This folder contains the **service discovery system** for Flisk Landscape's Tilt infrastructure. It scans the repository for service manifests and creates Tilt resources.
5
+ This folder contains the **service discovery system** for Flisk's Tilt infrastructure. It scans the repository for service manifests and creates Tilt resources.
6
6
 
7
7
  ## Architecture: Two-Layer Scanning with Validation
8
8
 
@@ -8,7 +8,7 @@
8
8
  # ⚠️ DEVELOPER NOTICE: This is a SYSTEM CONFIG file.
9
9
  # For human-friendly docs, see: TILT_CONFIG.md
10
10
  #
11
- # This file defines service discovery settings for the Flisk Landscape platform.
11
+ # This file defines service discovery settings for the Flisk platform.
12
12
  # Discovery automatically finds and registers services from the filesystem.
13
13
  #
14
14
  # 📖 TO EDIT DISCOVERY SETTINGS:
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2026 Flisk Landscape contributors
2
2
  # SPDX-License-Identifier: MIT
3
- # Deterministic Tilt Configuration for Flisk Landscape
3
+ # Deterministic Tilt Configuration for Flisk
4
4
  # Inspired by Mira Murati's "Defeating Nondeterminism" philosophy
5
5
  # Goal: Same filesystem state + same environment = identical Tilt output
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  disable: false
3
- description: Topology specialist for Flisk Landscape - expert in Tilt/Starlark, manifest-driven architecture, service discovery, and the complete local development orchestration system. Masters the infrastructure topology that enables 120+ services.
3
+ description: Topology specialist for Flisk - expert in Tilt/Starlark, manifest-driven architecture, service discovery, and the complete local development orchestration system. Masters the infrastructure topology that enables 120+ services.
4
4
  mode: subagent
5
5
  tools:
6
6
  - write
@@ -13,7 +13,7 @@ created: 2026-03-31
13
13
  updated: 2026-04-04
14
14
  ---
15
15
 
16
- You are a senior topology engineer specialized in the Flisk Landscape Tilt infrastructure. You are the definitive expert on the manifest-driven architecture, Starlark topology modules, service discovery, and the complete local development orchestration system.
16
+ You are a senior topology engineer specialized in the Flisk Tilt infrastructure. You are the definitive expert on the manifest-driven architecture, Starlark topology modules, service discovery, and the complete local development orchestration system.
17
17
 
18
18
  ## Core Identity: The Infrastructure Cartographer
19
19
 
@@ -539,7 +539,7 @@ load('./my_custom_extension.star', 'my_function')
539
539
  # Load from parent directory
540
540
  load('../common/utils.star', 'helper')
541
541
 
542
- # Load from topologies (Flisk Landscape pattern)
542
+ # Load from topologies (Flisk pattern)
543
543
  load('../../../platform/docker/index.star', 'Docker')
544
544
  ```
545
545
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Tilt Platform Framework Code**
6
6
 
7
- This directory contains the Flisk Landscape Tilt infrastructure framework - the code that powers our local development orchestration.
7
+ This directory contains the Flisk Tilt infrastructure framework - the code that powers our local development orchestration.
8
8
 
9
9
  ## What's Here
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Executive Summary
4
4
 
5
- This document outlines a comprehensive refactoring of the manifest parsing and validation system in the Flisk Landscape Tilt infrastructure. The goal is to move from scattered inline logic to a clean, modular, well-tested architecture.
5
+ This document outlines a comprehensive refactoring of the manifest parsing and validation system in the Flisk Tilt infrastructure. The goal is to move from scattered inline logic to a clean, modular, well-tested architecture.
6
6
 
7
7
  **Current State:**
8
8
  - Manifest parsing scattered across `discovery.star`, `registry.star`, and multiple generator files
@@ -38,7 +38,7 @@ export interface WakeAction {
38
38
  * only queues the resource: with Tilt's build slots busy (e.g. 100+
39
39
  * resources rebuilding after a re-vendor), a triggered resource waited
40
40
  * behind them and the request timed out (observed live against
41
- * tdk-erp-system, see tasks.md 7.2). server.ts falls back to `tilt trigger`
41
+ * flisk-erp-system, see tasks.md 7.2). server.ts falls back to `tilt trigger`
42
42
  * when no image exists yet to start from.
43
43
  */
44
44
  useComposeStart: boolean;
@@ -19,12 +19,12 @@
19
19
  * the resource name; Compose derives it as
20
20
  * <project>-<service>-<replica>, confirmed empirically
21
21
  * against a live Flisk container, e.g.
22
- * "tdk-erp-system-analytics-autogenerated-data-governance-api-1"
22
+ * "flisk-erp-system-analytics-autogenerated-data-governance-api-1"
23
23
  * for the "data-governance-api" resource).
24
24
  * X-Wake-Deps Comma-separated "resourceName=containerName" pairs
25
25
  * for required dependencies (task 1.5: Tilt never
26
26
  * cascades a trigger to these on its own).
27
- * X-Wake-Compose-Project The resource's Compose project (e.g. "tdk-erp-system-analytics-autogenerated").
27
+ * X-Wake-Compose-Project The resource's Compose project (e.g. "flisk-erp-system-analytics-autogenerated").
28
28
  * X-Wake-Compose-Files Comma-separated absolute compose file paths, the
29
29
  * same ones Tilt's `<resource>-run-only` resource
30
30
  * passes. The project root is mounted into this
@@ -2,7 +2,7 @@
2
2
  # Copyright (c) 2026 Flisk Landscape contributors
3
3
  # SPDX-License-Identifier: MIT
4
4
 
5
- # Flisk Landscape Mac M1 Resource Monitor
5
+ # Flisk Mac M1 Resource Monitor
6
6
  # Monitors Docker container resource usage and provides optimization recommendations
7
7
 
8
8
  set -e
@@ -14,7 +14,7 @@ YELLOW='\033[1;33m'
14
14
  BLUE='\033[0;34m'
15
15
  NC='\033[0m' # No Color
16
16
 
17
- echo -e "${BLUE}🍎 Flisk Landscape Mac M1 Resource Monitor${NC}"
17
+ echo -e "${BLUE}🍎 Flisk Mac M1 Resource Monitor${NC}"
18
18
  echo "=================================================="
19
19
 
20
20
  # Check if Docker is running
@@ -33,19 +33,19 @@ echo -e "${BLUE}💻 System Memory:${NC} $SYSTEM_MEMORY"
33
33
 
34
34
  echo ""
35
35
 
36
- # Check running Flisk Landscape containers
36
+ # Check running Flisk containers
37
37
  PROJECT_CONTAINERS=$(docker ps --format "{{.Names}}" | grep -E "(postgres|redis|nats|kafka|traefik|clickhouse|elasticsearch|verdaccio|infisical)" | sort)
38
38
 
39
39
  if [ -z "$PROJECT_CONTAINERS" ]; then
40
- echo -e "${YELLOW}⚠️ No Flisk Landscape containers are currently running${NC}"
40
+ echo -e "${YELLOW}⚠️ No Flisk containers are currently running${NC}"
41
41
  echo "Run 'tilt up' to start services"
42
42
  exit 0
43
43
  fi
44
44
 
45
- echo -e "${GREEN}📊 Running Flisk Landscape Containers:${NC}"
45
+ echo -e "${GREEN}📊 Running Flisk Containers:${NC}"
46
46
  echo "=================================================="
47
47
 
48
- # Get detailed stats for Flisk Landscape containers
48
+ # Get detailed stats for Flisk containers
49
49
  TOTAL_MEMORY_MB=0
50
50
  HIGH_CPU_COUNT=0
51
51
  HIGH_MEMORY_COUNT=0
@@ -12,7 +12,12 @@
12
12
  },
13
13
  "required": [
14
14
  "appType"
15
- ]
15
+ ],
16
+ "not": {
17
+ "required": [
18
+ "command"
19
+ ]
20
+ }
16
21
  },
17
22
  "then": {
18
23
  "properties": {
@@ -35,7 +40,12 @@
35
40
  },
36
41
  "required": [
37
42
  "appType"
38
- ]
43
+ ],
44
+ "not": {
45
+ "required": [
46
+ "command"
47
+ ]
48
+ }
39
49
  },
40
50
  "then": {
41
51
  "properties": {
@@ -55,7 +65,12 @@
55
65
  },
56
66
  "required": [
57
67
  "appType"
58
- ]
68
+ ],
69
+ "not": {
70
+ "required": [
71
+ "command"
72
+ ]
73
+ }
59
74
  },
60
75
  "then": {
61
76
  "properties": {
@@ -79,7 +94,12 @@
79
94
  },
80
95
  "required": [
81
96
  "appType"
82
- ]
97
+ ],
98
+ "not": {
99
+ "required": [
100
+ "command"
101
+ ]
102
+ }
83
103
  },
84
104
  "then": {
85
105
  "properties": {
@@ -92,9 +112,54 @@
92
112
  "port"
93
113
  ]
94
114
  }
115
+ },
116
+ {
117
+ "if": {
118
+ "required": [
119
+ "command"
120
+ ]
121
+ },
122
+ "then": {
123
+ "required": [
124
+ "appName",
125
+ "appType"
126
+ ],
127
+ "not": {
128
+ "anyOf": [
129
+ {
130
+ "required": [
131
+ "image"
132
+ ]
133
+ },
134
+ {
135
+ "required": [
136
+ "dockerfile"
137
+ ]
138
+ }
139
+ ]
140
+ }
141
+ },
142
+ "else": {
143
+ "required": [
144
+ "appName",
145
+ "stack"
146
+ ],
147
+ "anyOf": [
148
+ {
149
+ "required": [
150
+ "appType"
151
+ ]
152
+ },
153
+ {
154
+ "required": [
155
+ "type"
156
+ ]
157
+ }
158
+ ]
159
+ }
95
160
  }
96
161
  ],
97
- "description": "Configuration for Flisk resources. Drives Tilt orchestration, Docker Compose generation, and dependency resolution. Supports both explicit service.json files and synthesis from directory structure.",
162
+ "description": "Configuration for Flisk resources. Drives Tilt orchestration, Docker Compose generation, and dependency resolution. Supports both explicit service.json files and synthesis from directory structure. A service runs from exactly one source: a container (image, dockerfile, or a generated Dockerfile) or a local command.",
98
163
  "properties": {
99
164
  "$schema": {
100
165
  "description": "JSON Schema reference for IDE validation",
@@ -144,7 +209,7 @@
144
209
  },
145
210
  "databaseName": {
146
211
  "description": "Override auto-generated DB name.\nDefault: FLISK_{stack}",
147
- "pattern": "^Flisk_[a-z_]+$",
212
+ "pattern": "^FLISK_[a-z_]+$",
148
213
  "type": "string"
149
214
  },
150
215
  "dependencies": {
@@ -513,25 +578,26 @@
513
578
  "default": "files"
514
579
  }
515
580
  }
581
+ },
582
+ "command": {
583
+ "description": "Run the service as a local process with this shell command instead of a container, for example \"node server.js\" or \"uvicorn main:app --port $PORT\". It runs from the service directory with PORT set to port. No image, Dockerfile or generated files: flisk up starts, supervises and restarts it without Docker or Tilt. Cannot be combined with image or dockerfile.",
584
+ "minLength": 1,
585
+ "type": "string"
586
+ },
587
+ "env": {
588
+ "additionalProperties": {
589
+ "type": "string"
590
+ },
591
+ "description": "Environment variables for a command service. Values may reference ${VAR} (or ${VAR:-default}) from the project .env or the shell.",
592
+ "propertyNames": {
593
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
594
+ },
595
+ "type": "object"
516
596
  }
517
597
  },
518
598
  "required": [
519
- "appName",
520
- "stack",
521
599
  "schemaVersion"
522
600
  ],
523
601
  "title": "Flisk Resource Configuration",
524
- "type": "object",
525
- "anyOf": [
526
- {
527
- "required": [
528
- "appType"
529
- ]
530
- },
531
- {
532
- "required": [
533
- "type"
534
- ]
535
- }
536
- ]
602
+ "type": "object"
537
603
  }
@@ -157,7 +157,7 @@ diagnostics_menu() {
157
157
  case $choice in
158
158
  1)
159
159
  echo -e "${BLUE}Testing network connectivity...${NC}"
160
- run_command "$resource_name" "nc -zv registry.npmjs.org 443 && nc -zv Flisk Landscape-verdaccio 4873"
160
+ run_command "$resource_name" "nc -zv registry.npmjs.org 443 && nc -zv flisk-verdaccio 4873"
161
161
  ;;
162
162
  2)
163
163
  echo -e "${BLUE}Viewing configuration files...${NC}"
@@ -2,7 +2,7 @@
2
2
  # Copyright (c) 2026 Flisk Landscape contributors
3
3
  # SPDX-License-Identifier: MIT
4
4
  # =============================================================================
5
- # 🎯 Flisk Landscape - RESOURCE MANIFEST GENERATOR
5
+ # 🎯 Flisk - RESOURCE MANIFEST GENERATOR
6
6
  # =============================================================================
7
7
  # Usage: ./generate-manifest.sh <stack> <resource-name> <type> [port]
8
8
  #
@@ -37,7 +37,7 @@ PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
37
37
  print_usage() {
38
38
  cat << EOF
39
39
  ${BLUE}╔═══════════════════════════════════════════════════════════════════╗
40
- ║ 🎯 Flisk Landscape RESOURCE MANIFEST GENERATOR ║
40
+ ║ 🎯 Flisk RESOURCE MANIFEST GENERATOR ║
41
41
  ╚═══════════════════════════════════════════════════════════════════╝${NC}
42
42
 
43
43
  ${YELLOW}Usage:${NC}