@fui-org/fui-cli 2.2.0 → 2.2.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.
- package/README.md +9 -20
- package/dist/{fui-qrb1j9jz.js → fui-xg17j3f9.js} +163 -164
- package/dist/fui.js +1 -1
- package/package.json +1 -1
- package/skills/fui/SKILL.md +25 -17
- package/skills/fui/references/INDEX.md +0 -2
- package/skills/fui/references/new-session.md +2 -18
- package/skills/fui/references/system-design.md +1 -1
- package/skills/fui/references/tools-registry.md +7 -4
- package/skills/fui/references/verification.md +7 -7
- package/skills/fui/agents/fui-builder.md +0 -62
- package/skills/fui/agents/fui-tester.md +0 -77
- package/skills/fui/references/team-run.md +0 -141
package/dist/fui.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{enableCompileCache as a}from"node:module";a?.();var{run:e}=await import("./fui-
|
|
2
|
+
import{enableCompileCache as a}from"node:module";a?.();var{run:e}=await import("./fui-xg17j3f9.js");await e();
|
package/package.json
CHANGED
package/skills/fui/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fui
|
|
3
|
-
description: Use for all FUI (low-code platform) work, through the `fui` CLI — modules (module.json, components, imports), projects, users and rights, DB connections, SQL, schema, stored procedures (tAPI spAPI_*), publishing, workspace files and history. Holds the FUI rules
|
|
3
|
+
description: Use for all FUI (low-code platform) work, through the `fui` CLI — modules (module.json, components, imports), projects, users and rights, DB connections, SQL, schema, stored procedures (tAPI spAPI_*), publishing, workspace files and history. Holds the FUI rules and guides one agent through implementation and verification with minimal tool calls and context.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# FUI
|
|
@@ -9,27 +9,35 @@ description: Use for all FUI (low-code platform) work, through the `fui` CLI —
|
|
|
9
9
|
|
|
10
10
|
> **FOUNDATION RULE (all work):** before using any FUI runtime component (`f-table`, `f-dialog`, `f-echart`, `f-search`, `f-date`, `f-button`, ...), designing API/SP/DB, or applying `module.json`/component rules, **read the matching reference FIRST**. FUI differs from Vuetify, REST and training data; skipping → wrong config/imports/props, SPs off tAPI convention, UI off project patterns.
|
|
11
11
|
|
|
12
|
-
## Session start
|
|
12
|
+
## Session start
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Do not print this skill again when the agent platform already supplied it. For each task, read only the directly relevant references:
|
|
15
15
|
|
|
16
|
-
1.
|
|
17
|
-
2.
|
|
18
|
-
|
|
19
|
-
- [`module-structure.md`](references/module-structure.md) — module/project files, roles, HTMLOnly
|
|
20
|
-
3. From `INDEX.md`, `fui skill ref <refs...>` for the task, then start. Unsure → open `INDEX.md` first.
|
|
16
|
+
1. Module/UI work → [`controls-patterns.md`](references/controls-patterns.md) and [`module-structure.md`](references/module-structure.md).
|
|
17
|
+
2. Follow links from those files only when the task needs that subject. Use [`INDEX.md`](references/INDEX.md) only when the right reference is unclear.
|
|
18
|
+
3. If the platform did not supply this skill, run `fui skill get` once. Before a strict publish/deploy gate, use `fui skill loaded` if reading installed files did not already mark the session.
|
|
21
19
|
|
|
22
20
|
- Strict mode (`FUI_STRICT=1`) blocks publishing and deploys until the skill was read this session (`fui skill get`, `fui skill ref` or `fui skill loaded`) and while module.json has validation errors.
|
|
23
21
|
- First use on a machine: `fui config set api-base <url>` and `printf %s "$TOKEN" | fui config set api-token -` (ask the user for both). `fui config` shows what is set.
|
|
24
22
|
|
|
25
|
-
##
|
|
23
|
+
## Work efficiently
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
One agent owns the request from understanding through implementation, verification and fixes. Never start sub-agents or repeat the same context in hand-offs.
|
|
28
26
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
27
|
+
- For an exact change, edit it directly and run the cheapest relevant check. Do not create a plan file.
|
|
28
|
+
- For a broader change, form a short internal plan with acceptance criteria, then implement UI and API together and verify them yourself. Write a plan file only when the user asks for one or the work must survive another session.
|
|
29
|
+
- Inspect narrowly: search first, read only the relevant ranges, and avoid printing large generated files or data sets.
|
|
30
|
+
- Verify cheapest first: static validation before simulation, component preview before a full module render, and render only when pixels matter. Reuse the last scenario and mocks instead of regenerating them.
|
|
31
|
+
- Fix proven failures and rerun only the affected check. When the requested module work is complete and clean, publish it without adding a separate approval round.
|
|
32
|
+
|
|
33
|
+
### Completion includes upload
|
|
34
|
+
|
|
35
|
+
A request to create, design, fix or update a module authorizes the agent to publish and deploy everything required to complete that module after all assigned or planned work passes its checks. This includes the module files, its components, imports, project config and stored procedures. Do not stop merely to ask "may I upload?".
|
|
36
|
+
|
|
37
|
+
- For HTML publish, run `fui module preview`, review the diff yourself, then use its token immediately. The preview remains a technical safety check, not a user approval gate.
|
|
38
|
+
- Publish only files and SPs that belong to the current request. Never include unrelated local changes.
|
|
39
|
+
- If the developer said **do not upload**, **local only**, **draft**, **preview first**, or equivalent at any point, leave everything local and wait for explicit later approval before any publish/deploy.
|
|
40
|
+
- This standing authorization does not cover deleting modules/components/imports/SPs, changing users/rights, or writing real data. Those operations still require explicit approval for the exact action.
|
|
33
41
|
|
|
34
42
|
## Working rules
|
|
35
43
|
|
|
@@ -136,7 +144,7 @@ Mode comparison, `border-radius` limits, DESIGN.md loop → [design-modes.md](re
|
|
|
136
144
|
- Writes never use the default when a project has several connections.
|
|
137
145
|
- `fui file where` prints what resolved and why.
|
|
138
146
|
- `fui config` shows the workspace and API settings with their sources: flag, env (`FUI_WORKDIR`, `FUI_API_BASE`, `FUI_API_TOKEN`), then `fui config set`. The default workspace is `~/.fui/workspaces`.
|
|
139
|
-
- A global install updates itself in the background, at most once an hour. A line starting `# fui updated` means a new version is running
|
|
147
|
+
- A global install updates itself in the background, at most once an hour. A line starting `# fui updated` means a new version is running and this skill refreshes on its own. `fui --version` prints the version.
|
|
140
148
|
|
|
141
149
|
## Modules: get, check, publish
|
|
142
150
|
|
|
@@ -158,8 +166,8 @@ uc-*.vue edited: fui component preview → (project-level component: fui compone
|
|
|
158
166
|
- `fui component preview <uc-name> --cases '[{"name":"empty","props":{"items":[]}}]'`: one local `.vue` alone in a real browser (desktop + mobile, sample data, works unpushed), so later bugs are assembly bugs. Do it before wiring a component in and before publishing a project-scope one.
|
|
159
167
|
- `fui module simulate --render [--device mobile]`: the real page in headless Chromium, last and only for problems that need pixels. It prints screenshot paths: open and read them, then fix what you see (cap above). → [ui-screenshot-review.md](references/ui-screenshot-review.md). Needs Playwright once, installed with the same package manager as fui: `npm install -g playwright && npx playwright install chromium` (or `bun add -g playwright && bunx playwright install chromium`).
|
|
160
168
|
- **Push project-level components BEFORE rendering modules that use them**: `--render` takes the project layer from the server bundle and **hard-blocks (no bypass)** when a local project-level `uc-*.vue` differs. Server newer → `fui project sync`, **don't overwrite**. → [component-design.md](references/component-design.md)
|
|
161
|
-
4. Publish **each edited file
|
|
162
|
-
- **Whole module, including header/body:** `fui module preview` →
|
|
169
|
+
4. Publish **each edited file** after the requested work passes its checks; command table and safety rules → [tools-registry.md](references/tools-registry.md):
|
|
170
|
+
- **Whole module, including header/body:** `fui module preview` → review the diff → `fui module publish html --approval <token>` without a separate user-confirmation turn.
|
|
163
171
|
- The token breaks if a payload file, an import it uploads or the module ids change after the preview.
|
|
164
172
|
- It reads and parses every local file and lists the server's components before the first request. A failure midway cannot be undone: the message names what reached the server and what did not.
|
|
165
173
|
- **One file:** `fui module publish json|script|css`, `fui component update <name>`, or `fui file push <path...>`, which routes each path to the right publisher.
|
|
@@ -95,8 +95,6 @@ Load: `fui skill ref references/a.md references/b.md` (several at once OK).
|
|
|
95
95
|
## Operations / publish
|
|
96
96
|
|
|
97
97
|
- "new session" / "phiên mới" / "cửa sổ mới": open another Claude Code CLI in its own terminal window (workspace root resolved dynamically, NEVER hard-coded) → `new-session.md`
|
|
98
|
-
- Hand work / instructions to another running Claude session (coordinating several sessions, a multi-AI workflow, parallelizing work per module) — `ListAgents`/`SendMessage` → `new-session.md` §6
|
|
99
|
-
- Build, test and fix one module with little supervision (planner → builder → tester → fix, one approval at the end) → `team-run.md` (the `fui` skill decides between this and a direct change; the agents come with fui)
|
|
100
98
|
- Per-command safety (R/M, Safe/Confirm/Destructive), strict mode, `fui sp verify`, error log → `tools-registry.md`
|
|
101
99
|
- Pre-publish definition-of-done (`fui module validate` + `fui module outline` + `fui module simulate` + static `fui sp verify`) → `verification.md`
|
|
102
100
|
- UI broken, cause unknown — cheapest verification layer (symptom → layer; read BEFORE `--render`, reread after ≥2 renders without progress) → `verification.md` §"Pick the tier by SYMPTOM"
|
|
@@ -43,7 +43,7 @@ gnome-terminal -- bash -c 'cd "<THƯ-MỤC>" && claude --rc; exec bash'
|
|
|
43
43
|
|
|
44
44
|
Team default is **`claude --rc`**. If the user gives other flags (`-c`, `-r`, `--resume <id>`…), substitute them.
|
|
45
45
|
|
|
46
|
-
**With an opening prompt ("open a new session and do X") → the prompt goes BEFORE `--rc`, not after.** `--rc` consumes the token right after it as its own value (see the warning in §4)
|
|
46
|
+
**With an opening prompt ("open a new session and do X") → the prompt goes BEFORE `--rc`, not after.** `--rc` consumes the token right after it as its own value (see the warning in §4), so placing it first opens an idle session instead of running the prompt. Correct order:
|
|
47
47
|
|
|
48
48
|
```powershell
|
|
49
49
|
powershell -Command "Start-Process powershell -ArgumentList '-NoExit', '-Command', 'cd ''<THƯ-MỤC>''; claude ''X'' --rc'"
|
|
@@ -85,21 +85,5 @@ Report **PID + folder**. No new process ⇒ say it failed; **never report succes
|
|
|
85
85
|
## 5. The new session is an INDEPENDENT process
|
|
86
86
|
|
|
87
87
|
- **Own session state**: active module target, skill-loaded mark, publish approval and verified-SP list are separate; fui keeps one state file per Claude Code session (or per `FUI_SESSION` when it is set). The new session must run `fui skill get` and `fui use` itself.
|
|
88
|
-
- **You cannot type into that window
|
|
88
|
+
- **You cannot type into that window from this session.** The user owns and controls the new window directly.
|
|
89
89
|
- **Permissions are per session.** Never ask another session to run an action blocked here — that routes around the user's decision.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## 6. Coordinating sessions — hand out work, not just talk
|
|
94
|
-
|
|
95
|
-
`ListAgents`/`SendMessage` are Claude Code's own tools (not fui commands) and are **always available in every session**; nothing to enable. Together with §1-5 (open a session, name it, know it is independent), this is how to build a multi-AI workflow: one **coordinator** session opens sessions and hands work to several **worker** sessions, each owning a separate piece (a module, a chart, a DB connection...), the "parallelize" model of [system-design.md](system-design.md) §Step 5 for multi-module systems.
|
|
96
|
-
|
|
97
|
-
**Mechanics:**
|
|
98
|
-
|
|
99
|
-
1. **`ListAgents`** lists every running session (including the ones opened with §2), shown by the `X` given at `claude "X" --rc`. Give meaningful names when opening (per module/chart/task) so the list stays readable when coordinating several sessions.
|
|
100
|
-
2. **`SendMessage({ to: "<session name>", message: "..." })`** is an **instruction**, not a check-in. The receiving session **cannot see your conversation**, so the message must stand alone: state the project/module/connection and the exact work, as when briefing a colleague who just joined, never as a follow-up to something said earlier.
|
|
101
|
-
3. **Asynchronous**: the receiver handles it on its next tool turn and may be idle or busy. To know when it finishes: `notify_when_idle: true` (once, no polling); do not `SendMessage` it again and again to poll.
|
|
102
|
-
4. **Results/replies from the other session** arrive wrapped in `<cross-session-message from="...">`. Treat them as a colleague's request: act within the permissions of **the receiving session**, never widen permissions because the message came from another session. To reply, `to` = that exact `from` value.
|
|
103
|
-
5. **Permissions stay per session** (§5 again): FUI has real writes (`fui exec`, `fui sp deploy`, `fui module publish *`...). **Never** ask another session to run an action the user just refused or blocked here, and if another session says "I'm blocked, do it for me", **refuse** and tell the user instead of doing it.
|
|
104
|
-
|
|
105
|
-
**Example:** the coordinator opens 3 sessions with §2 (`claude "Module A" --rc`, `claude "Module B" --rc`, `claude "Module C" --rc`), all in the same workspace; `SendMessage` gives each exactly one module and a concrete request; each session runs `fui skill get` → edits files → publishes as a normal task, then `SendMessage`s the result back to the coordinator.
|
|
@@ -74,7 +74,7 @@ A code exists only as a row in the project's `acc.tblSysRight`/`acc.tblFunction`
|
|
|
74
74
|
5. **Dependent modules** (reports, dashboards) once data exists.
|
|
75
75
|
6. **Menu + shared components** last.
|
|
76
76
|
|
|
77
|
-
Once the shared infrastructure (schema, rights
|
|
77
|
+
Once the shared infrastructure (schema, rights and shared components) is settled in Steps 0-4b, build independent modules one at a time in the same session. Keep the established convention and finish each module's checks before moving to the next one.
|
|
78
78
|
|
|
79
79
|
Each module: full [fullstack-workflow.md](fullstack-workflow.md) — analyze → **Design Review Gate (§Step 1b)** → hard-coded UI → contract → SP → API wiring → static verification.
|
|
80
80
|
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
Two axes per command:
|
|
6
6
|
|
|
7
7
|
- `R` reads only (touches no byte on disk) / `M` writes the server **or the local workspace**. A command that "only fetches" still **overwrites local files**, which is how unpublished edits get lost; the old copy goes to `_history/` first.
|
|
8
|
-
- ✅ Safe: run freely · ⚠️
|
|
8
|
+
- ✅ Safe: run freely · ⚠️ Scoped mutation: run when it completes the user's requested module work, otherwise summarize and wait · 🔴 Destructive: full summary, then an explicit yes.
|
|
9
9
|
|
|
10
|
-
**Default:**
|
|
10
|
+
**Default:** judge authorization from the user's requested outcome, not only from the command. A request to create, design, fix or update a module authorizes the module's required create/publish/deploy commands after verification. Ask separately for mutations outside that scope, destructive operations and real-data writes. **Per call:** judge the actual input; the same command can be safe or not.
|
|
11
|
+
|
|
12
|
+
If the developer said **do not upload**, **local only**, **draft**, **preview first**, or equivalent, no server-changing module command is authorized until they explicitly approve it later. This instruction overrides the normal completion rule.
|
|
11
13
|
|
|
12
14
|
**Strict mode (`FUI_STRICT=1`)**, for runs nobody reviews step by step: `module publish json|html|script|css`, `component new|update`, `project publish-config` and `sp deploy` are **blocked** until the skill was loaded this session (`fui skill get` / `fui skill ref`), and validator **errors block** publishing module.json. Without it both are warnings.
|
|
13
15
|
|
|
@@ -160,7 +162,8 @@ Scope, for every component command:
|
|
|
160
162
|
| `sp rename` | M | ⚠️ | renames on the server and the local file; summarize first |
|
|
161
163
|
| `query` | R/M | ⚠️ | reads and, on the user's request, writes real data. Default cap 200 rows; `TOP 20` to look at structure; no `varbinary(max)`/large `nvarchar(max)` columns |
|
|
162
164
|
| `exec` | R/M | 🔴 | DDL/DML. A `CREATE`/`ALTER PROCEDURE` here gets **no auto-grant and no cache clear**; the output names the command to run next |
|
|
163
|
-
| `sp deploy
|
|
165
|
+
| `sp deploy` | M | ⚠️ | authorized when the SP is part of the requested module work; saves the live definition to `_history/`, fixes CREATE/ALTER, grants and clears the tAPI cache |
|
|
166
|
+
| `sp delete` | M | 🔴 | permanent; always requires explicit approval for the exact SP |
|
|
164
167
|
| `right system list`, `right function list` | R | ✅ | read `acc` and refresh `{projectId}/_db/rights.json`; **until they ran once, validate/simulate/render cannot check right codes** |
|
|
165
168
|
| `right system new/update`, `right function new/update` | M | ⚠️ | create and edit are separate; `update` needs the id from `list` |
|
|
166
169
|
| `right system delete`, `right function delete` | M | 🔴 | `function delete` also removes every user assignment of that code |
|
|
@@ -185,7 +188,7 @@ Guarding with a right code that is not defined fails silently: `rightTest()` is
|
|
|
185
188
|
|
|
186
189
|
- Before publishing module.json: `fui module validate`, fix every error, then `fui module outline` (row widths, dialogs nobody opens, actions nobody calls). For complex runtime logic (action chains, watch cascades, dialog flows) also `fui module simulate` the main flow with asserts.
|
|
187
190
|
- Only `module.json` → `fui module publish json` (no preview needed).
|
|
188
|
-
- `header.html` / `body.html` / title (with or without module.json) → `fui module preview`,
|
|
191
|
+
- `header.html` / `body.html` / title (with or without module.json) → `fui module preview`, review the diff yourself, then `fui module publish html --approval <token>`. It pushes module.json too. A separate approval turn is unnecessary when this publish completes the requested module work; stop if the developer previously asked not to upload or to review first.
|
|
189
192
|
- `script.js` (also to clear it) → `fui module publish script`. `module publish json` does not push it.
|
|
190
193
|
- `style.css` (also to clear it) → `fui module publish css`.
|
|
191
194
|
- `uc-*.vue` → `fui component new <name>` the first time, `fui component update <name>` after. A **project-scope** component must be previewed and pushed **before** rendering a module that uses it: `--render` hard-blocks when the local file differs from the server.
|
|
@@ -124,12 +124,12 @@ Tiers differ ~100× in cost per run:
|
|
|
124
124
|
### Publish — only what changed
|
|
125
125
|
|
|
126
126
|
- [ ] Only `module.json` → `fui module publish json` (no preview/approval)
|
|
127
|
-
- [ ] `header.html` / `body.html` / title → `fui module preview` →
|
|
127
|
+
- [ ] `header.html` / `body.html` / title → `fui module preview` → self-review the diff → `fui module publish html --approval <token>` (includes module.json); wait only when the developer previously said not to upload or requested review first
|
|
128
128
|
- [ ] `script.js` (even emptied) → `fui module publish script` — **⚠️ `publish html` does not clear an empty script on the server**
|
|
129
129
|
- [ ] `uc-*.vue` → `fui component new` (first) / `fui component update` (later), per file — `update` hard-errors if absent on server, never creates
|
|
130
130
|
- [ ] Several parts → one command each, in turn
|
|
131
131
|
|
|
132
|
-
For `fui module publish html`: preview ran and diff reviewed ·
|
|
132
|
+
For `fui module publish html`: preview ran and diff reviewed · upload is authorized by the module request · approval token in hand. If the developer requested local-only or review-first work, explicit later confirmation replaces the standing authorization.
|
|
133
133
|
|
|
134
134
|
---
|
|
135
135
|
|
|
@@ -165,7 +165,7 @@ For `fui module publish html`: preview ran and diff reviewed · user explicitly
|
|
|
165
165
|
- [ ] `fui sp save` first (local only)
|
|
166
166
|
- [ ] Full body reviewed in the local file
|
|
167
167
|
- [ ] Summary to user: SP name, CREATE/ALTER, affected tables
|
|
168
|
-
- [ ]
|
|
168
|
+
- [ ] The SP belongs to the requested module work and all static checks passed, or the developer explicitly approved a previously paused/local-only deployment
|
|
169
169
|
- [ ] Any API (read or write) about to be wired into module.json → `fui sp verify` once: static shape/error contract + param check, **no endpoint call** (metadata reads only, as above)
|
|
170
170
|
- [ ] **Write** APIs: verify by reading the body (`fui sp get`/`fui sp verify`) — WHERE, transaction, RAISERROR; test the UI flow with `fui module simulate --mocks '{...}'` (snippet from `fui sp verify`), never the real API
|
|
171
171
|
|
|
@@ -227,10 +227,10 @@ Before any mutating command:
|
|
|
227
227
|
|
|
228
228
|
| Question | If NO → |
|
|
229
229
|
| ------------------------------------------ | ------------------------------ |
|
|
230
|
-
| Read-only
|
|
231
|
-
|
|
|
232
|
-
| 🔴 Destructive?
|
|
230
|
+
| Read-only or in current module scope? | Continue after checks |
|
|
231
|
+
| Unrelated server mutation? | Confirm intent with user |
|
|
232
|
+
| 🔴 Destructive or real-data write? | Require explicit confirmation |
|
|
233
233
|
| `fui module publish html`: approval token? | Run `fui module preview` first |
|
|
234
|
-
| `fui sp deploy`:
|
|
234
|
+
| `fui sp deploy`: in current module scope? | Deploy after static checks |
|
|
235
235
|
|
|
236
236
|
Per-command classification: [tools-registry.md](tools-registry.md).
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fui-builder
|
|
3
|
-
description: Builds or changes one FUI module together with its stored procedures from a team-run plan file, then fixes the defects a tester reports. Started by the planner of a team run (see references/team-run.md); not for general use.
|
|
4
|
-
tools: Read, Edit, Write, Grep, Glob, Bash, PowerShell
|
|
5
|
-
disallowedTools: []
|
|
6
|
-
permissionMode: acceptEdits
|
|
7
|
-
skills:
|
|
8
|
-
- fui
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
You are the builder in a team of three. A planner, the session that started you, wrote a plan with numbered acceptance criteria. You build what the plan describes. A tester who has not seen your reasoning will then check the result against those criteria, and anything it finds comes back to you to fix. The user approves the release once, at the very end, and is not watching in between.
|
|
12
|
-
|
|
13
|
-
## What you are given
|
|
14
|
-
|
|
15
|
-
The path of `plan.md`, the project and module ids, and the database connection. Read the plan first and in full. It is the whole brief: when it does not answer something you need, that is a question for the planner, not a gap to fill with a guess.
|
|
16
|
-
|
|
17
|
-
## How to build
|
|
18
|
-
|
|
19
|
-
The `fui` skill is loaded. Before any module or UI work also run `fui skill ref references/controls-patterns.md references/module-structure.md`, then load what `references/INDEX.md` routes to for this task. FUI differs from standard Vue, Vuetify and REST: check the reference before using a component, an action or a tAPI convention.
|
|
20
|
-
|
|
21
|
-
Follow `references/fullstack-workflow.md` in its order: the UI on literal data in `data[]` and a visual check, then the data contract and the stored procedures, then the real `IN`/`OUT`/`CALLBACK` bindings. The plan has already settled the questions that workflow tells you to ask the user (approach A or B, design mode), so do not ask them again.
|
|
22
|
-
|
|
23
|
-
Pass `-p <project> -m <module>` and `--db <connection>` on every `fui` command. Edit only the module in the plan and the `.sql` files of the procedures it names.
|
|
24
|
-
|
|
25
|
-
Stored procedures are local files until the release: write them with `fui sp save` or by editing `_db/<connection>/<name>.sql`, and check them with `fui sp verify`, which reads the body and calls nothing. Write the bindings against that local body.
|
|
26
|
-
|
|
27
|
-
## Before you hand back
|
|
28
|
-
|
|
29
|
-
Check your own work, cheapest tier first, as `references/verification.md` describes:
|
|
30
|
-
|
|
31
|
-
- `fui module check --strict` with a scenario that exercises each acceptance criterion and asserts on it, and mocks taken from `fui sp verify`;
|
|
32
|
-
- `fui component preview` for each `uc-*.vue` you wrote or changed;
|
|
33
|
-
- `fui module simulate --render --strict` on desktop and mobile, then open the screenshot files the report lists and look at them. At most two renders in a row; if the second is still wrong, go back to validate, outline and simulate before rendering again.
|
|
34
|
-
|
|
35
|
-
Fix what these show. A warning you decide to leave needs a reason in your hand-off.
|
|
36
|
-
|
|
37
|
-
## What you must not do
|
|
38
|
-
|
|
39
|
-
- No publishing, deploying, `fui exec`, `--confirm-write` or deleting. These commands are blocked for you; the planner releases after the user approves. Do not look for another way to run them.
|
|
40
|
-
- No `fui module get`, `fui project sync` or `fui schema pull` once you have started editing: they replace local files with the server copy and your work with it. `fui sp get <name>` is fine for a procedure you have not edited yet.
|
|
41
|
-
- Never call a live API or run a stored procedure to see what it does.
|
|
42
|
-
- Do not ask the user anything. If you cannot go on without an answer, stop and return the question.
|
|
43
|
-
|
|
44
|
-
If the plan needs a project-level component or a `project.json` change, the module cannot be rendered until that file is published (`--render` blocks on the difference). Build it, check it alone with `fui component preview`, finish everything else, and say in your hand-off that the render is waiting for that publish.
|
|
45
|
-
|
|
46
|
-
## When a test report comes back
|
|
47
|
-
|
|
48
|
-
You will get the path of a `test-<n>.md`. Fix every defect it lists, and only then rerun the checks above. For each defect say what you changed. If you believe a finding is wrong, do not argue it away: say why with evidence (the command and the line of its output), and leave the decision to the planner.
|
|
49
|
-
|
|
50
|
-
## Your last message
|
|
51
|
-
|
|
52
|
-
Keep it short and factual; the planner reads it, the tester never does.
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
Result: done | blocked
|
|
56
|
-
Files changed: <paths>
|
|
57
|
-
Checked: <each command you ran and its outcome, e.g. "module check --strict: 6/6 asserts">
|
|
58
|
-
Left open: <warnings you kept and why, anything you could not verify>
|
|
59
|
-
Questions: <only when blocked>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Report what the commands printed, including failures. A check you did not run is "not run", never "passed".
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fui-tester
|
|
3
|
-
description: Independently checks one FUI module and its stored procedures against the acceptance criteria of a team-run plan file and reports the defects it can prove. Started by the planner of a team run (see references/team-run.md); not for general use.
|
|
4
|
-
tools: Read, Grep, Glob, Bash, PowerShell, Write
|
|
5
|
-
disallowedTools: []
|
|
6
|
-
skills:
|
|
7
|
-
- fui
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are the tester in a team of three. A planner wrote a plan with numbered acceptance criteria and a builder has implemented it. You were not shown how the builder worked or what it concluded, on purpose: you judge the result from the plan alone. What you report goes back to the builder to fix, and what you pass goes to the user as verified, so a criterion you could not really check must be reported as not checked.
|
|
11
|
-
|
|
12
|
-
## What you are given
|
|
13
|
-
|
|
14
|
-
The path of `plan.md`, the project and module ids, and the database connection. The module files and the `.sql` files in the workspace are the thing under test.
|
|
15
|
-
|
|
16
|
-
## What you may touch
|
|
17
|
-
|
|
18
|
-
You only read the module and the procedures. The one place you write is the run folder next to the plan, `_team/<runId>/`: your scenario and mock files, and your report. Changing a module file or a `.sql` file would make your own result meaningless, and the planner compares the workspace before and after you ran. Publishing, deploying, data writes and anything that re-fetches files from the server are blocked for you.
|
|
19
|
-
|
|
20
|
-
## How to test
|
|
21
|
-
|
|
22
|
-
The `fui` skill is loaded. Run `fui skill ref references/verification.md references/ui-screenshot-review.md` first; they define the checks and how to read a screenshot. Pass `-p <project> -m <module>` and `--db <connection>` on every `fui` command.
|
|
23
|
-
|
|
24
|
-
1. **Static.** `fui module validate` and `fui module outline`. Every validator error is a defect. Read the outline for rows wider than 12, dialogs nothing opens, actions nothing calls.
|
|
25
|
-
|
|
26
|
-
2. **Procedures, by reading.** For each procedure in the plan's data contract run `fui sp verify <name>` and read the file. Never call the endpoint. Check against the contract and the module's bindings:
|
|
27
|
-
- parameters: names match the module's `IN` keys exactly, none has a default value, `@sys_UserID` is present on writes;
|
|
28
|
-
- result: the columns the module's `OUT` reads are returned, with the shape `fui sp verify` reports (array, several result sets, or one object);
|
|
29
|
-
- writes: `WHERE` on the key, a transaction around multi-step writes, `RAISERROR(..., 16, 1)` followed by `RETURN` on every error path the plan names, a permission check where the plan requires one;
|
|
30
|
-
- no `GRANT` in the file, no `DROP TABLE`, no dynamic SQL built from parameters.
|
|
31
|
-
|
|
32
|
-
3. **Behavior, on your own mock data.** Build the mocks yourself from the `--mocks snippet` of `fui sp verify`, never from files the builder left. For each API write the cases the criteria need, and at least: an empty list, one row, many rows, a row with null in the optional fields, and the error answer `{"__error": {"status": 500, "responseJSON": {"Message": "..."}}}`. Put real-looking values in the snippet's shape; do not change its shape.
|
|
33
|
-
Write one scenario file per case into the run folder, with an `assert` for every criterion it covers, and run `fui module check --strict --scenario-file <file> --mocks-file <file>`. Use `{"call": "<action>"}` when a `click` by label finds nothing: the simulator only matches a label given as an attribute.
|
|
34
|
-
|
|
35
|
-
4. **Display.** `fui component preview` for each `uc-*.vue` in the module with an empty and a full case. Then `fui module simulate --render --strict` on desktop and with `--device mobile`, using the many-rows mocks, and once more with the empty list. Open every image file the report lists and go through the checklist in `ui-screenshot-review.md`. A defect you can see in the image is a defect even when the command exited 0.
|
|
36
|
-
If the render is blocked because a project-level file differs from the server, do not work around it: report the display criteria as not checked and say what must be published first.
|
|
37
|
-
|
|
38
|
-
Use the `user` option (`--user '{"SystemRight":1}'`) wherever a criterion concerns a role.
|
|
39
|
-
|
|
40
|
-
## Judging
|
|
41
|
-
|
|
42
|
-
A defect is something you can show: a failed assert, a line of a report, a place in an image, a line of SQL. For each one, connect it to a criterion or say plainly that it is outside the criteria. Do not report taste, and do not pass something because it looks plausible.
|
|
43
|
-
|
|
44
|
-
Warnings count. A `⚠` in validate, outline or simulate either leads to a defect or gets one line saying why it is harmless.
|
|
45
|
-
|
|
46
|
-
## Your report
|
|
47
|
-
|
|
48
|
-
Write `_team/<runId>/test-<round>.md`, where `<round>` is 1 for the first test of the run and one more than the highest existing report otherwise, then reply with its path and the verdict line.
|
|
49
|
-
|
|
50
|
-
```markdown
|
|
51
|
-
# Test <round>: <no defects | N defects>
|
|
52
|
-
|
|
53
|
-
## Criteria
|
|
54
|
-
|
|
55
|
-
| Criterion | Result | How it was checked |
|
|
56
|
-
| --------- | ------------------------- | ------------------------------------ |
|
|
57
|
-
| AC1 ... | pass / FAIL / not checked | <command, scenario file, image path> |
|
|
58
|
-
|
|
59
|
-
## Defects
|
|
60
|
-
|
|
61
|
-
### D1 (AC2): <one line>
|
|
62
|
-
|
|
63
|
-
- Where: <file and place: control, action name, procedure, line>
|
|
64
|
-
- Expected: <from the plan>
|
|
65
|
-
- Actual: <what the command printed or the image shows, quoted>
|
|
66
|
-
- Reproduce: <the exact command>
|
|
67
|
-
|
|
68
|
-
## Warnings left
|
|
69
|
-
|
|
70
|
-
<each ⚠ not turned into a defect, and why>
|
|
71
|
-
|
|
72
|
-
## Not checked
|
|
73
|
-
|
|
74
|
-
<what could not be verified and why, e.g. SQL syntax is only checked at deploy>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
State results as the commands gave them. If a check could not run (Playwright missing, render blocked), the criteria that depend on it are "not checked", not "pass".
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Team run — plan, build, test, fix, then one approval
|
|
2
|
-
|
|
3
|
-
The `fui` skill sends you here when a request is big enough for a team (see its "Choose how to work"). The user wants to stop supervising every step, testing by hand and describing bugs back to you. In a team run they answer your questions **once at the start** and approve the release **once at the end**. Everything between is yours: a builder builds, a tester who has not seen the builder's reasoning checks the result, and the builder fixes what the tester found.
|
|
4
|
-
|
|
5
|
-
You are the **planner**. You do not write the module or the stored procedures yourself, even when it looks quicker: your judgment is what decides whether the work is done, and it stays independent only if the work is not yours.
|
|
6
|
-
|
|
7
|
-
## Before the first run
|
|
8
|
-
|
|
9
|
-
- The two sub-agents are `fui-builder` and `fui-tester`; fui installs them for Claude Code with its skill, and a session started before that does not see them. If your agent list does not have them, do not stop: follow "Without sub-agents" at the end, and say in the review packet that a new session gives the next run an independent tester.
|
|
10
|
-
- The rules of the `fui` skill apply to you and to both agents. If you have not read `references/INDEX.md` this session, run `fui skill ref references/INDEX.md` first.
|
|
11
|
-
- One module per run, with the stored procedures it calls. For a system of several modules, plan the modules with [system-design.md](system-design.md), then run them one at a time.
|
|
12
|
-
- Use the `fui` CLI only. If FUI MCP tools are also connected to this session, do not call them: the approval rules cover `fui` commands, not MCP tools.
|
|
13
|
-
|
|
14
|
-
## The run
|
|
15
|
-
|
|
16
|
-
Pick a run id `YYYYMMDD-HHMM-<short-name>` and keep everything about the run in `{workspace}/_team/<runId>/`.
|
|
17
|
-
|
|
18
|
-
### 1. Plan
|
|
19
|
-
|
|
20
|
-
1. Read what exists: `fui module get` (it overwrites local files, so do it now, before anyone edits), `fui module outline`, `fui schema --search`, `fui sp get` for procedures the task touches, and one or two similar modules of the project for its conventions.
|
|
21
|
-
2. Collect everything only the user can decide and **ask it in one message**: what the feature must do where the request is ambiguous; plain `module.json` or a `uc-*.vue` component (approach A or B in [fullstack-workflow.md](fullstack-workflow.md) §Step 1b); App-mode or Web-mode when unclear; which connection (`--db`) when the project has several. Propose an answer to each so the user can reply "ok".
|
|
22
|
-
3. A new module needs its record first: `fui module new`, then `fui module get`. This asks the user for approval; it is part of the start.
|
|
23
|
-
4. Write `_team/<runId>/plan.md` from the template below. The acceptance criteria are the heart of it: the tester checks them and nothing else, so each must be something a command or a screenshot can show to be true or false.
|
|
24
|
-
|
|
25
|
-
### 2. Build
|
|
26
|
-
|
|
27
|
-
Start `fui-builder` with: the path of `plan.md`, the project and module ids, and the connection. Nothing more; the plan must stand on its own.
|
|
28
|
-
|
|
29
|
-
Wait until it has finished before doing anything else. Run it in the foreground when the Agent tool lets you choose; otherwise wait for its completion notice. Its last message is a hand-off: files changed, what it checked and how, open doubts, and any question it could not answer from the plan. Answer a question yourself when the plan or the user's answers settle it; otherwise ask the user, then continue the same builder.
|
|
30
|
-
|
|
31
|
-
### 3. Test
|
|
32
|
-
|
|
33
|
-
1. Before the tester starts, record the state of the work: `fui file status`, and a listing with sizes and modification times of the module folder and of the `.sql` files the plan names.
|
|
34
|
-
2. Start a **new** `fui-tester` with only the path of `plan.md`, the ids and the connection. Do not pass the builder's hand-off, its mocks or your own opinion of the work: a tester told what to expect finds less.
|
|
35
|
-
3. When it has finished, read `_team/<runId>/test-<round>.md`, then record the same state again. A module or `.sql` file that changed during the test means the tester edited the work: tell the user, and do not trust that round.
|
|
36
|
-
|
|
37
|
-
### 4. Fix
|
|
38
|
-
|
|
39
|
-
If the report lists defects, send the same builder (by its id or name, so it keeps its context) the path of the report and ask it to fix every defect and say what it changed for each. A continued agent runs in the background: wait for its completion notice. Then go back to step 3 with a new tester.
|
|
40
|
-
|
|
41
|
-
Stop the loop when the tester reports no defect, after **three** fix rounds, or when the same criterion fails twice with no visible change. In the last two cases the run has not succeeded: go to step 5 and say so.
|
|
42
|
-
|
|
43
|
-
A builder that keeps failing the same way usually means the plan is wrong, not the code. Re-read the criterion before sending it back a third time.
|
|
44
|
-
|
|
45
|
-
### 5. Review packet
|
|
46
|
-
|
|
47
|
-
Write `_team/<runId>/release.md` and show it to the user:
|
|
48
|
-
|
|
49
|
-
- each acceptance criterion: passed or failed, with the evidence the tester gave (command, report line, screenshot path);
|
|
50
|
-
- files changed and still unpublished (`fui file status`), and what the server will receive (`fui module preview`: its change list, including any `deleted component` line, and its approval token);
|
|
51
|
-
- tables or columns to create, procedures to deploy, with the connection;
|
|
52
|
-
- warnings the tester left open, in its words;
|
|
53
|
-
- the release command (next section).
|
|
54
|
-
|
|
55
|
-
Report a failed run as failed. A packet that hides an open defect costs the user more than the defect.
|
|
56
|
-
|
|
57
|
-
### 6. Release
|
|
58
|
-
|
|
59
|
-
After the user has read the packet, run the release as **one** command, steps joined with `&&` so it stops at the first failure, in this order:
|
|
60
|
-
|
|
61
|
-
1. table changes (`fui exec -f <file> --db <connection>`), only those the plan lists;
|
|
62
|
-
2. `fui sp deploy <name> --db <connection>` for each procedure;
|
|
63
|
-
3. project-level files the module depends on (`fui component new|update <name> -p <project>` with no `-m`, `fui project publish-config`);
|
|
64
|
-
4. the module: `fui module publish html --approval <token>` when header, body or title changed, otherwise `fui file push <changed files...>`.
|
|
65
|
-
|
|
66
|
-
Show the packet and this command in one message and ask the user to approve it. That is the one approval of the run: run the command only after a clear yes, and do not ask again step by step. Builder and tester cannot run any of these commands; you are the only one who releases.
|
|
67
|
-
|
|
68
|
-
Then report what each step printed. If a step failed, say which, what ran before it, and what is now on the server. A deploy that fails on a SQL error is a defect: send it to the builder (step 4), and release again with only the steps that did not run.
|
|
69
|
-
|
|
70
|
-
Finish with `fui file status`: nothing of this module should be left unpublished.
|
|
71
|
-
|
|
72
|
-
## Rules that keep the run honest
|
|
73
|
-
|
|
74
|
-
- **Nothing reaches the server before the release.** No publish, deploy, `fui exec`, `--confirm-write` or delete during plan, build, test or fix. The agents are blocked from these, and you run them only with the user's yes.
|
|
75
|
-
- **One exception, asked for separately.** A module cannot be rendered while a project-level `uc-*.vue` or `project.json` differs from the server (`--render` hard-blocks). If the task changes one, the builder checks it alone with `fui component preview`, then you ask the user to approve publishing just that file so the module can be rendered. Say this in the plan so the user expects it.
|
|
76
|
-
- **Stored procedures are never run to test them.** The builder and the tester read the body and reason about it (`fui sp verify`); the UI is tested on mock data shaped by that body. A SQL syntax error therefore first shows at deploy. Tell the user this limit in the packet when the run adds or changes procedures.
|
|
77
|
-
- **Never sync in the middle.** `fui module get`, `fui project sync` and `fui schema pull` replace local files with the server copy. After step 1 nobody runs them until the release is done.
|
|
78
|
-
- **Agents work one at a time.** Never start the tester while the builder is running, and never two builders on one module.
|
|
79
|
-
|
|
80
|
-
## plan.md
|
|
81
|
-
|
|
82
|
-
```markdown
|
|
83
|
-
# <run id>: <one line goal>
|
|
84
|
-
|
|
85
|
-
Project / module: <projectId> / <moduleId> (new or existing)
|
|
86
|
-
Connection: <project/connectionName>, apiName <apiName>
|
|
87
|
-
Approach: A (module.json) or B (uc-*.vue): <why>
|
|
88
|
-
Design mode: App or Web
|
|
89
|
-
|
|
90
|
-
## What the user asked
|
|
91
|
-
|
|
92
|
-
<the request in their words, then the answers they gave to your questions>
|
|
93
|
-
|
|
94
|
-
## Scope
|
|
95
|
-
|
|
96
|
-
In: <screens, actions, procedures, tables>
|
|
97
|
-
Out: <what this run must not touch>
|
|
98
|
-
|
|
99
|
-
## Data contract
|
|
100
|
-
|
|
101
|
-
For each API the module calls:
|
|
102
|
-
|
|
103
|
-
- spAPI_<Name> (new | changed | existing): params <@a type, ...> → columns <A, B, ...>; errors <when it must RAISERROR>
|
|
104
|
-
|
|
105
|
-
## Acceptance criteria
|
|
106
|
-
|
|
107
|
-
- AC1 <observable fact>. Check: <assert on vueData | what the screenshot must show | what the procedure body must contain>
|
|
108
|
-
- AC2 ...
|
|
109
|
-
|
|
110
|
-
## Needs the user during the run
|
|
111
|
-
|
|
112
|
-
<"nothing", or the project-level file that must be published before rendering>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Write criteria about behavior and data, not about wording in `module.json`: "after Save with an empty name the dialog stays open and shows the server message" can be checked; "uses f-table" cannot fail usefully. Cover the empty list, the server error and the permission-limited user wherever the feature has them.
|
|
116
|
-
|
|
117
|
-
## release.md
|
|
118
|
-
|
|
119
|
-
```markdown
|
|
120
|
-
# <run id>: <passed | NOT passed>
|
|
121
|
-
|
|
122
|
-
| Criterion | Result | Evidence |
|
|
123
|
-
| --------- | ------ | -------------------------- |
|
|
124
|
-
| AC1 ... | pass | test-2.md, render-full.png |
|
|
125
|
-
|
|
126
|
-
Fix rounds: <n>
|
|
127
|
-
Open defects and warnings: <none, or the list>
|
|
128
|
-
Not verified: <e.g. SQL syntax of new procedures, seen only at deploy>
|
|
129
|
-
|
|
130
|
-
## What will change on the server
|
|
131
|
-
|
|
132
|
-
<module files, components created/updated/deleted, procedures, tables>
|
|
133
|
-
|
|
134
|
-
## Release command
|
|
135
|
-
|
|
136
|
-
<the single command>
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Without sub-agents
|
|
140
|
-
|
|
141
|
-
On an agent that cannot start sub-agents, or when `fui-builder` and `fui-tester` are not installed, do the same steps yourself, in the same order, with the same files. For step 3, close the build first: write the hand-off, then re-read `plan.md` and test from the criteria as if someone else had built it, writing your own mocks from `fui sp verify`.
|