proteum 2.2.8 → 2.3.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/AGENTS.md +5 -3
- package/README.md +50 -12
- package/agents/project/AGENTS.md +47 -10
- package/agents/project/CODING_STYLE.md +5 -1
- package/agents/project/client/AGENTS.md +2 -0
- package/agents/project/diagnostics.md +8 -5
- package/agents/project/optimizations.md +1 -0
- package/agents/project/root/AGENTS.md +18 -10
- package/agents/project/tests/AGENTS.md +6 -1
- package/agents/project/tests/e2e/AGENTS.md +13 -0
- package/agents/project/tests/e2e/REAL_WORLD_JOURNEY_TESTS.md +192 -0
- package/cli/commands/check.ts +21 -3
- package/cli/commands/configure.ts +1 -0
- package/cli/commands/connect.ts +40 -4
- package/cli/commands/diagnose.ts +136 -5
- package/cli/commands/doctor.ts +24 -4
- package/cli/commands/explain.ts +105 -6
- package/cli/commands/mcp.ts +16 -0
- package/cli/commands/orient.ts +66 -3
- package/cli/commands/perf.ts +118 -13
- package/cli/commands/runtime.ts +151 -0
- package/cli/commands/trace.ts +116 -21
- package/cli/mcp/provider.ts +365 -0
- package/cli/mcp/stdio.ts +16 -0
- package/cli/presentation/commands.ts +79 -22
- package/cli/presentation/devSession.ts +2 -0
- package/cli/runtime/commands.ts +95 -12
- package/cli/utils/agentOutput.ts +46 -0
- package/cli/utils/agents.ts +225 -48
- package/common/dev/inspection.ts +30 -9
- package/common/dev/mcpPayloads.ts +736 -0
- package/common/dev/mcpServer.ts +254 -0
- package/docs/agent-routing.md +126 -0
- package/docs/dev-commands.md +2 -0
- package/docs/dev-sessions.md +2 -1
- package/docs/diagnostics.md +68 -23
- package/docs/mcp.md +149 -0
- package/docs/migrate-from-2.1.3.md +15 -5
- package/docs/request-tracing.md +12 -6
- package/eslint.js +220 -0
- package/package.json +2 -1
- package/server/app/devMcp.ts +159 -0
- package/server/services/router/http/cache.ts +116 -0
- package/server/services/router/http/index.ts +94 -35
- package/server/services/router/index.ts +8 -11
- package/tests/agents-utils.test.cjs +89 -11
- package/tests/dev-transpile-watch.test.cjs +117 -8
- package/tests/eslint-rules.test.cjs +110 -0
- package/tests/inspection.test.cjs +67 -0
- package/tests/mcp.test.cjs +127 -0
- package/tests/router-cache-config.test.cjs +74 -0
package/AGENTS.md
CHANGED
|
@@ -31,11 +31,12 @@ After those optimization concerns, preserve explicit, typed, machine-readable co
|
|
|
31
31
|
cd <worktree path>
|
|
32
32
|
npx prisma migrate dev --config ./prisma.config.ts --name <migration name>
|
|
33
33
|
```
|
|
34
|
+
- After initializing any new framework worktree, immediately boot the required reference app dev servers with the elevated-permissions workflow below. Keep those servers running across subsequent changes and validation until the user explicitly asks to stop them, or until a retry, port change, stale-session cleanup, or conflicting live session requires a controlled stop.
|
|
34
35
|
- After implementing a framework feature or change, do not stop at code edits. Boot both reference apps, exercise browser-visible flows with the browser MCP or use the smallest real Proteum surface, run the relevant `proteum` diagnostics or perf commands, and confirm there is no meaningful regression in runtime behavior, performance, load size, SEO output, or coding-style expectations before finishing.
|
|
35
36
|
- When starting a long-lived reference app dev server for framework work, always request elevated permissions and run `npx proteum dev` outside the sandbox. Use an explicit thread-scoped session file such as `var/run/proteum/dev/framework-<app>-<task>.json`, inspect tracked sessions plus current listeners first, for example with `npx proteum dev list --json` and `lsof -nP -iTCP -sTCP:LISTEN`, then choose a port that is not currently used before starting `npx proteum dev --session-file <path> --port <port>`. After the server is ready, print the live server URL as a clickable Markdown link such as `[http://localhost:3100](http://localhost:3100)`.
|
|
36
37
|
- Do not use `--replace-existing` unless you are restarting the exact session file started by the current thread/task. Never replace another live session that belongs to a user, another thread, or an unknown owner.
|
|
37
38
|
- When a reference app uses local `file:` connected projects for the affected flow, boot every connected producer app as well, each on its own free port and thread-scoped session file, and run every one of those `proteum dev` processes with elevated permissions outside the sandbox before starting or validating the consumer app.
|
|
38
|
-
- Before retrying a boot on the same app, changing ports, or
|
|
39
|
+
- Before retrying a boot on the same app, changing ports, handling a conflicting live session, or when the user explicitly asks to stop servers, stop the relevant framework-started dev session with `npx proteum dev stop --session-file <path>` or clean stale sessions with `npx proteum dev stop --all --stale`. Do not stop healthy framework-started dev sessions merely because the current task is finished.
|
|
39
40
|
- If the task changed the dev workflow itself, verify the final cleanup path with `npx proteum dev list --json` before finishing.
|
|
40
41
|
- When you have finished your work, summarize in one top-level short (up to 100 characters) sentence ALL the changes you made since the beginning of the WHOLE conversation. Strictly use the Conventional Commits specification:
|
|
41
42
|
```
|
|
@@ -57,6 +58,7 @@ npx prisma migrate dev --config ./prisma.config.ts --name <migration name>
|
|
|
57
58
|
- `/Users/gaetan/Desktop/Projets/unique.domains/platform/apps/website`
|
|
58
59
|
- Inspect how both apps currently use the touched feature, runtime, API, compiler behavior, or generated output before proposing or implementing changes.
|
|
59
60
|
- Keep the developer-facing contract synchronized when framework work changes CLI commands, profiler capabilities, or the `proteum dev` banner. Update the live surfaces together in the same pass: CLI command/help definitions, profiler panels and dev-only endpoints, banner text/examples, and the most relevant agent docs that describe them, especially `AGENTS.md`, `agents/project/AGENTS.md`, `agents/project/root/AGENTS.md`, `agents/project/app-root/AGENTS.md`, `agents/project/diagnostics.md`, and any narrower `agents/project/**/AGENTS.md` file that mentions the changed workflow.
|
|
61
|
+
- Proteum MCP contract: `proteum mcp` is the read-only stdio server for compact agent diagnostics, and `proteum dev` exposes the same runtime-adjacent MCP contract at `/__proteum/mcp`. Keep MCP tools/resources compact, typed, capped, paginated for full trace detail, and read-only unless a future task explicitly expands the mutation contract. MCP payloads are compact single-line `proteum-mcp-v1` JSON, not pretty-printed human output. Do not implement MCP tools as thin CLI process wrappers when the data is available through manifest readers, tracked sessions, or dev runtime registries.
|
|
60
62
|
- Keep the same-system trace contract explicit when request instrumentation changes: `TRACE_*` controls the retained dev trace store plus the trace/perf CLI, dev-only HTTP endpoints, and bottom profiler, while `ENABLE_PROFILER` enables the reduced request-local `request.profiling` snapshot and `request.finished` hook payload without retaining finished requests globally unless dev trace is also enabled.
|
|
61
63
|
- Current CLI banner contract: only the bare `proteum build` and bare `proteum dev` commands print the welcome banner and include the active Proteum installation method. Any extra argument or option skips the banner. Only `proteum dev` clears the interactive terminal before rendering, exposes `CTRL+R` reload plus `CTRL+C` shutdown hotkeys in its session UI, and reports connected app names plus successful connected `/ping` checks in the ready banner. Every `proteum dev` start ensures tracked instruction files contain the current managed `# Proteum Instructions` section before the dev loop begins.
|
|
62
64
|
- Keep core changes aligned with the explicit controller/page architecture in `agents/project/root/AGENTS.md` and its standalone composition in `agents/project/AGENTS.md`.
|
|
@@ -79,12 +81,12 @@ Do not stop at static analysis for routing, controllers, generated code, SSR, cl
|
|
|
79
81
|
|
|
80
82
|
- Run `npx proteum dev --no-cache --session-file var/run/proteum/dev/framework-<app>.json --port <free-3xxx-port>` in both reference apps on explicit free ports and with elevated permissions outside the sandbox.
|
|
81
83
|
- If either reference app uses local `file:` connected projects for the affected flow, run those producer apps too on their own free ports before exercising the consumer.
|
|
82
|
-
- When validating a concrete route, controller path, or failing page on a running dev server, prefer `proteum diagnose <path> --port <port>` first. Use
|
|
84
|
+
- When validating a concrete route, controller path, or failing page on a running dev server, prefer `proteum diagnose <path> --port <port>` first. Use `proteum trace show <requestId> --events` only when you need lower-level event detail beyond the compact diagnose summary.
|
|
83
85
|
- When the issue is latency, CPU, SQL cost, render cost, or memory drift, inspect `proteum perf top`, `proteum perf request`, `proteum perf compare`, or `proteum perf memory` against the running dev server before adding custom instrumentation.
|
|
84
86
|
- When a framework change can affect shipped client code size, run `proteum build --prod --analyze` for static bundle artifacts or `proteum build --prod --analyze --analyze-serve --analyze-port auto` when you need a local analyzer URL.
|
|
85
87
|
- For protected browser or API flows in dev, prefer `npx proteum session <email> --role <role>` for browser MCP validation, or `npx proteum e2e --session-email <email> --session-role <role>` for automated end-to-end suites, instead of automating the login UI. Use the login UI only when login itself is the feature under test.
|
|
86
88
|
- When a task needs browser execution instead of the higher-level verifier, use the browser MCP. Keep Playwright inside `npx proteum e2e --port <port>` for targeted or full end-to-end suites. Keep auth sourced from Proteum session helpers, not UI login or shared browser state.
|
|
87
|
-
- For request-time behavior, arm traces with `proteum trace arm --capture deep`, reproduce once, then inspect `proteum trace latest` or `proteum trace show <requestId
|
|
89
|
+
- For request-time behavior, arm traces with `proteum trace arm --capture deep`, reproduce once, then inspect compact `proteum trace latest` or raw `proteum trace show <requestId> --events` only when needed.
|
|
88
90
|
- When the framework-facing workflow itself changed, verify the CLI surface too with `proteum verify framework-change --crosspath-port <port> --product-port <port> --website-port <port>`.
|
|
89
91
|
- Only the final verifier agent should usually run browser flows. Other agents should stay on `orient`, `verify owner`, `verify request`, and command-level checks unless browser execution is the only trustworthy surface.
|
|
90
92
|
- Open the real pages with the browser MCP.
|
package/README.md
CHANGED
|
@@ -192,6 +192,42 @@ export default class MyApp extends Application {
|
|
|
192
192
|
|
|
193
193
|
Proteum reads `server/index.ts` as the source of truth for installed root services and router plugins, and reads `server/config/*.ts` `Services.config(...)` exports for typed config such as service priority overrides.
|
|
194
194
|
|
|
195
|
+
## Router Cache Policy
|
|
196
|
+
|
|
197
|
+
Browser cache headers are configurable per app through the optional `routerBaseConfig.http.cache` object. Omit it to keep Proteum's defaults.
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
export const routerBaseConfig = {
|
|
201
|
+
currentDomain: AppContainer.Environment.router.currentDomain,
|
|
202
|
+
http: {
|
|
203
|
+
domain: 'example.com',
|
|
204
|
+
port: AppContainer.Environment.router.port,
|
|
205
|
+
ssl: true,
|
|
206
|
+
upload: { maxSize: '10mb' },
|
|
207
|
+
cache: {
|
|
208
|
+
html: {
|
|
209
|
+
dynamic: {
|
|
210
|
+
cacheControl: 'no-store, no-cache, must-revalidate, proxy-revalidate',
|
|
211
|
+
surrogateControl: 'no-store',
|
|
212
|
+
},
|
|
213
|
+
static: {
|
|
214
|
+
cacheControl: 'public, max-age=0, must-revalidate',
|
|
215
|
+
surrogateControl: false,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
publicAssets: {
|
|
219
|
+
dev: 'no-store',
|
|
220
|
+
versioned: 'public, max-age=31536000, immutable',
|
|
221
|
+
unversioned: 'public, max-age=0, must-revalidate',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
context: () => ({}),
|
|
226
|
+
} satisfies RouterBaseConfig;
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Default public asset validators depend on the environment: dev disables `ETag` and `Last-Modified`, while non-dev enables them. Use `etag: false` and `lastModified: false` when an app needs to fully disable browser cache for `/public` assets.
|
|
230
|
+
|
|
195
231
|
## Example: Page
|
|
196
232
|
|
|
197
233
|
Proteum pages are explicit SSR entrypoints.
|
|
@@ -342,6 +378,7 @@ Proteum ships with a compact CLI focused on the real app lifecycle:
|
|
|
342
378
|
| `proteum diagnose` | Combine owner lookup, diagnostics, trace data, and server logs for one concrete route or request target |
|
|
343
379
|
| `proteum perf` | Aggregate request-trace performance into hot paths, one-request waterfalls, regressions, and memory drift views |
|
|
344
380
|
| `proteum trace` | Inspect live dev-only request traces from the running SSR server |
|
|
381
|
+
| `proteum mcp` | Start the read-only MCP server for compact agent diagnostics and runtime reads |
|
|
345
382
|
| `proteum command` | Run a dev-only internal command locally or against a running dev server |
|
|
346
383
|
| `proteum session` | Mint a dev-only auth session token and Playwright-ready cookie payload |
|
|
347
384
|
| `proteum e2e` | Run Playwright with Proteum-managed `E2E_*` values instead of shell-leading env assignments |
|
|
@@ -383,6 +420,7 @@ proteum perf top --since today
|
|
|
383
420
|
proteum perf request /dashboard --port 3101
|
|
384
421
|
proteum perf compare --baseline yesterday --target today --group-by route
|
|
385
422
|
proteum perf memory --since 1h --group-by controller
|
|
423
|
+
proteum mcp --url http://localhost:3101
|
|
386
424
|
proteum command proteum/diagnostics/ping
|
|
387
425
|
proteum command proteum/diagnostics/ping --port 3101
|
|
388
426
|
proteum session admin@example.com --role ADMIN --port 3101
|
|
@@ -404,11 +442,11 @@ proteum create controller Founder/projects --method list
|
|
|
404
442
|
proteum create service Conversion/Plans
|
|
405
443
|
```
|
|
406
444
|
|
|
407
|
-
`proteum configure agents` embeds the full Proteum project instruction corpus into the managed `# Proteum Instructions` section of each tracked instruction file. It preserves content outside
|
|
445
|
+
`proteum configure agents` embeds the full Proteum project instruction corpus into the managed `# Proteum Instructions` section of each tracked instruction file. Standalone mode writes root documents into the app root; monorepo mode writes shared root documents such as `AGENTS.md`, `CODING_STYLE.md`, `diagnostics.md`, and `optimizations.md` into the chosen monorepo root and keeps only app-local instruction files in the Proteum app root. It preserves content outside managed sections and asks before replacing directories or foreign symlinks. If you decline, that path is left untouched.
|
|
408
446
|
|
|
409
447
|
Every `proteum dev` start runs the same idempotent instruction check. It updates missing or stale managed sections automatically and prompts only when a blocked path would need to be replaced.
|
|
410
448
|
|
|
411
|
-
`proteum connect`, `proteum explain`, `proteum doctor`, and `proteum
|
|
449
|
+
`proteum connect`, `proteum explain`, `proteum doctor`, `proteum diagnose`, and `proteum mcp` share the same generated manifest and contract state. `proteum perf` uses the same dev request-trace store as the profiler `Perf` tab. `proteum dev` also exposes the same read-only MCP contract at `/__proteum/mcp` for repeated agent reads against the live runtime. For the full diagnostics and tracing model, see [docs/diagnostics.md](docs/diagnostics.md), [docs/mcp.md](docs/mcp.md), and [docs/request-tracing.md](docs/request-tracing.md).
|
|
412
450
|
|
|
413
451
|
## Dev Commands
|
|
414
452
|
|
|
@@ -450,7 +488,7 @@ The CLI talks to the running app over the dev-only `__proteum/session/start` end
|
|
|
450
488
|
|
|
451
489
|
Proteum includes a dev-only in-memory request trace buffer for auth, routing, controller, context, SSR, API, Prisma SQL, and render debugging.
|
|
452
490
|
|
|
453
|
-
This is separate from `proteum explain` and `proteum doctor`: tracing is live request-time data, while explain/doctor are manifest-backed structure and diagnostics. `proteum perf` aggregates the same trace buffer into hot-path, waterfall, compare, and memory views. When you already know the failing path and want the fastest suspect list, start with `proteum diagnose`; when the issue is performance, start with `proteum perf`; then drop into raw trace output only if needed.
|
|
491
|
+
This is separate from `proteum explain` and `proteum doctor`: tracing is live request-time data, while explain/doctor are manifest-backed structure and diagnostics. `proteum perf` aggregates the same trace buffer into hot-path, waterfall, compare, and memory views. When you already know the failing path and want the fastest suspect list, start with `proteum diagnose`; when the issue is performance, start with `proteum perf`; then drop into raw trace output only if needed. When an agent needs repeated trace, perf, diagnose, status, or instruction-routing reads from the same running app, use `proteum mcp --url <dev-url>` or the dev-hosted `/__proteum/mcp` endpoint.
|
|
454
492
|
|
|
455
493
|
When diagnosing or testing against an app, first read the default port from `PORT` or `./.proteum/manifest.json` and check whether a server is already running there. If it is, inspect the existing traces before reproducing the issue so you can collect past errors and their context.
|
|
456
494
|
|
|
@@ -522,6 +560,7 @@ Proteum answers those questions with explicit artifacts:
|
|
|
522
560
|
- `proteum explain owner <query>` for fast ownership lookup over routes, controllers, files, and generated artifacts
|
|
523
561
|
- `proteum diagnose <path>` for a one-shot request diagnosis surface
|
|
524
562
|
- `proteum perf top|request|compare|memory` for request-trace performance rollups
|
|
563
|
+
- `proteum mcp` or `/__proteum/mcp` for repeated low-token agent reads over the same compact `proteum-mcp-v1` runtime/diagnostic contract
|
|
525
564
|
- the profiler `Explain`, `Doctor`, `Diagnose`, and `Perf` tabs for a human-readable view over the same diagnostics and trace-derived perf contracts
|
|
526
565
|
- `proteum command ...` plus the profiler `Commands` tab for dev-only internal execution
|
|
527
566
|
- `proteum session ...` for explicit authenticated dev browser or API bootstrapping without login UI automation
|
|
@@ -529,16 +568,15 @@ Proteum answers those questions with explicit artifacts:
|
|
|
529
568
|
|
|
530
569
|
If you are an LLM or automation agent, start here:
|
|
531
570
|
|
|
532
|
-
1.
|
|
533
|
-
2. Read
|
|
534
|
-
3.
|
|
535
|
-
4.
|
|
536
|
-
5.
|
|
537
|
-
6. Inspect `server/services
|
|
538
|
-
7.
|
|
539
|
-
8. If the task touches a protected route or controller in dev and login UX is not the feature under test, use `proteum e2e --session-email <email> --session-role <role>` for Playwright suites or `proteum session <email> --role <role>` before direct HTTP calls.
|
|
571
|
+
1. Run `proteum orient <query>` or MCP `orient` before broad source reads.
|
|
572
|
+
2. Read only the returned `instructions.mustRead` files, plus conditional docs for diagnostics, coding style, or optimization when they apply.
|
|
573
|
+
3. Run `proteum runtime status` once before starting a dev server; use MCP `runtime_status` for repeated status reads.
|
|
574
|
+
4. Use `proteum diagnose`, `proteum perf`, and compact `proteum trace` for reproducible command evidence.
|
|
575
|
+
5. Use `proteum mcp --url <dev-url>` or `/__proteum/mcp` for repeated live status, instruction, diagnose, trace, perf, and log reads.
|
|
576
|
+
6. Inspect `server/index.ts`, controllers, services, or pages only after the routing/diagnostic surfaces identify the relevant owner.
|
|
577
|
+
7. If the task touches a protected route or controller in dev and login UX is not the feature under test, use `proteum e2e --session-email <email> --session-role <role>` for Playwright suites or `proteum session <email> --role <role>` before direct HTTP calls.
|
|
540
578
|
|
|
541
|
-
For implementation rules in a real Proteum app, treat the local `AGENTS.md` files plus `proteum
|
|
579
|
+
For implementation rules in a real Proteum app, treat the routed local `AGENTS.md` files plus `proteum orient`, compact CLI diagnostics, and MCP repeated-read surfaces as the task contract. This README is the framework overview, not the project-local instruction layer.
|
|
542
580
|
|
|
543
581
|
## What Proteum Avoids
|
|
544
582
|
|
package/agents/project/AGENTS.md
CHANGED
|
@@ -23,6 +23,9 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
23
23
|
- re-print the complete list of suggested fixes, but strike the ones we already implemented or not necessary anymore
|
|
24
24
|
- If the user asks to implement a feature, first inspect the relevant existing surface and state any implementation problem, pain point, attention point, or question you see. If a concern is blocking, or it can materially change product behavior, API shape, architecture, data model, cost, privacy, security, or UX, ask before editing; otherwise state the assumption and continue implementing.
|
|
25
25
|
- If the task is ambiguous, generated, connected, or multi-repo, start with `npx proteum orient <query>` before reading large parts of the codebase.
|
|
26
|
+
- Treat Proteum CLI and MCP output as the workflow router. Read only the instruction files returned in `orient` `mustRead` or MCP `instructions_resolve`, plus conditional docs that match the current task. Do not read broad instruction folders or every managed instruction file up front.
|
|
27
|
+
- When a Proteum MCP client is available, prefer read-only MCP tools for repeated runtime/status/orientation/trace/perf/log reads. Use CLI commands when you need reproducible terminal validation, dev/build/check workflows, or output to share with a human.
|
|
28
|
+
- MCP payloads are compact single-line `proteum-mcp-v1` JSON with capped and paginated detail. Do not expand MCP output for human readability.
|
|
26
29
|
- If the user reports an issue, or the agent encounters one during exploration, implementation, verification, or runtime reproduction, load and follow root-level `diagnostics.md`.
|
|
27
30
|
- If the task touches client-side files, especially `client/**` and page files, load and apply root-level `optimizations.md` only after implementation for post-implementation checking and optimization. Skip it at task start and skip it for server-only, test-only, doc-only, and non-client refactor tasks unless the user explicitly asks for optimization work.
|
|
28
31
|
- If the task changes UX, copy, onboarding, pricing, product semantics, or commercial positioning, read the relevant files under `./docs/` first, especially `docs/PERSONAS.md`, `docs/PRODUCT.md`, and `docs/MARKETING.md` when they exist. If a dev server is already running, print the live dev server URL as a clickable Markdown link.
|
|
@@ -57,14 +60,14 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
57
60
|
- When starting a long-lived dev server for an agent task, always request elevated permissions and run `npx proteum dev` outside the sandbox. Use an explicit task/thread-scoped session file such as `var/run/proteum/dev/agents/<task>.json`, inspect `npx proteum dev list --json` plus current listeners first, for example with `lsof -nP -iTCP -sTCP:LISTEN`, then choose a port that is not currently used before starting `npx proteum dev --session-file <path> --port <port>`. After the server is ready, print the live server URL as a clickable Markdown link.
|
|
58
61
|
- Use `--replace-existing` only when restarting the exact session file started by the current thread/task. Never replace another live session that belongs to a user, another thread, or an unknown owner.
|
|
59
62
|
- If the current app depends on local `file:` connected projects, boot every connected producer app too, each with its own task-scoped session file and free port, and run every one of those `proteum dev` processes with elevated permissions outside the sandbox before starting or verifying the consumer app.
|
|
63
|
+
- During `npx proteum dev`, the app exposes the read-only Proteum MCP runtime endpoint at `/__proteum/mcp`; use it for repeated agent reads instead of spawning equivalent diagnostics commands.
|
|
60
64
|
- For browser validation, use the browser MCP against the running app. Keep Playwright inside `npx proteum e2e --port <port>` for targeted/full end-to-end suites. Bootstrap protected browser MCP state with `npx proteum session`; bootstrap protected E2E runs with `npx proteum e2e --session-email <email> --session-role <role>`.
|
|
61
65
|
- Current CLI banner contract: only the bare `proteum build` and bare `proteum dev` commands print the welcome banner and include the active Proteum installation method. Any extra argument or option skips the banner. Only `proteum dev` clears the interactive terminal before rendering, exposes `CTRL+R` reload plus `CTRL+C` shutdown hotkeys in its session UI, and reports connected app names plus successful connected `/ping` checks in the ready banner. Every `proteum dev` start ensures tracked instruction files contain the current managed `# Proteum Instructions` section before the dev loop begins.
|
|
62
66
|
|
|
63
67
|
### Before Finishing
|
|
64
68
|
|
|
65
69
|
- Before finishing, re-check touched files against root-level `CODING_STYLE.md` and any narrower area `AGENTS.md` that applied to the edit. Re-check against root-level `optimizations.md` only for touched client-side files. Re-check against root-level `diagnostics.md` only if the task involved an issue, diagnosis, runtime reproduction, or verification failure.
|
|
66
|
-
-
|
|
67
|
-
- After implementing UI-visible changes, once the required tests or verification pass, use the browser MCP to open the changed routes or states, capture screenshots focused on the changed areas, inspect them for obvious visual defects, and include or reference those screenshots in the final response as proof of the completed UI change.
|
|
70
|
+
- Run the full project `npx proteum check` before finishing each feature or change. Targeted lint, typecheck, diagnose, request, browser, or E2E runs are still useful while iterating, but they do not replace the final full check. After implementing a new feature or changing existing feature behavior, always update the end-to-end coverage for that behavior and run the full Playwright test suite before finishing. For docs-only, wording-only, type-only, test-only, generated-output cleanup, or clearly local non-runtime refactors, skip Playwright unless the user explicitly asks for it or verification reveals a real issue.
|
|
68
71
|
- Before finishing a task, stop every `proteum dev` session started during the task and confirm cleanup with `npx proteum dev list --json` or an explicit `npx proteum dev stop --session-file <path>`.
|
|
69
72
|
- When you have finished your work, ask the user whether they want a commit message. After providing a commit message or after creating a commit, immediately follow it with this exact prompt and obey it:
|
|
70
73
|
`Explain in short minimalistic and few bullet points what we changed in this thread, like you would do to your grandma. Start with a verb in the past.`
|
|
@@ -174,13 +177,12 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
174
177
|
|
|
175
178
|
Verify at the correct layer:
|
|
176
179
|
|
|
177
|
-
- Default: use the cheapest trustworthy verification for the changed surface first, then
|
|
180
|
+
- Default: use the cheapest trustworthy verification for the changed surface first, then run the full project `npx proteum check` before finishing.
|
|
178
181
|
- Route additions: boot the app and hit the real URL.
|
|
179
182
|
- Controller changes: exercise the generated client call or generated `/api/...` endpoint.
|
|
180
183
|
- SSR changes: use the browser MCP to load the real page and inspect rendered HTML plus browser console.
|
|
181
184
|
- Router or plugin changes: verify request context, auth, redirects, metrics, and validation on a running app.
|
|
182
|
-
- New features or feature-behavior changes: use the cheapest trustworthy verification while iterating, use the browser MCP for browser-visible validation, then update the relevant end-to-end coverage and finish by running the full Playwright suite
|
|
183
|
-
- UI-visible changes: after the required tests or verification, use the browser MCP to screenshot the changed areas and confirm the screenshots match the intended result.
|
|
185
|
+
- New features or feature-behavior changes: use the cheapest trustworthy verification while iterating, use the browser MCP for browser-visible validation, then update the relevant end-to-end coverage and finish by running the full Playwright suite plus the full project `npx proteum check`.
|
|
184
186
|
- Generated, connected, or ownership-ambiguous changes: start with `npx proteum orient <query>` and prefer `npx proteum verify owner <query>` before broad global checks.
|
|
185
187
|
- Browser-visible issues: use the browser MCP after request-level verification is insufficient. Use `npx proteum e2e --port <port> ...` only when automated end-to-end coverage or a Playwright suite is required.
|
|
186
188
|
- Raw browser execution outside end-to-end suites: use the browser MCP only. Keep Playwright in `npx proteum e2e --port <port>` for targeted/full end-to-end suites.
|
|
@@ -203,6 +205,7 @@ Verify at the correct layer:
|
|
|
203
205
|
- Do not create nested `catalogs/` folders under pages, components, services, tests, or other feature folders.
|
|
204
206
|
- Keep strong TypeScript typings across the project.
|
|
205
207
|
- Do not introduce `any` or `unknown`, including through casts, helper aliases, or fallback generic defaults.
|
|
208
|
+
- Do not use `Reflect.get`, bracket access, broad `in` checks, or local loose reader helpers to bypass missing typings for app-owned data; fix the type contract or normalize once with a typed adapter at the boundary.
|
|
206
209
|
- Fix typing issues only on code you wrote.
|
|
207
210
|
- Never cast with `as any` or `as unknown`; fix the contract or add an explicit typed adapter.
|
|
208
211
|
|
|
@@ -273,19 +276,24 @@ Project code should consume:
|
|
|
273
276
|
|
|
274
277
|
Prefer structured CLI surfaces over re-deriving framework facts from source:
|
|
275
278
|
|
|
276
|
-
- `npx proteum connect
|
|
279
|
+
- `npx proteum connect`
|
|
277
280
|
- `npx proteum connect --controllers --strict`
|
|
278
281
|
- `npx proteum orient <query>`
|
|
279
|
-
- `npx proteum
|
|
282
|
+
- `npx proteum runtime status`
|
|
283
|
+
- `npx proteum mcp`
|
|
284
|
+
- `npx proteum mcp --url http://localhost:<port>`
|
|
285
|
+
- `npx proteum explain`
|
|
286
|
+
- `npx proteum explain --manifest`
|
|
280
287
|
- `npx proteum explain --connected --controllers`
|
|
281
288
|
- `npx proteum explain owner <query>`
|
|
282
|
-
- `npx proteum doctor
|
|
283
|
-
- `npx proteum doctor --contracts
|
|
289
|
+
- `npx proteum doctor`
|
|
290
|
+
- `npx proteum doctor --contracts`
|
|
284
291
|
- `npx proteum diagnose <path> --port <port>`
|
|
285
292
|
- `npx proteum verify owner <query>`
|
|
286
293
|
- `npx proteum verify request <path>`
|
|
287
294
|
- `npx proteum perf ...`
|
|
288
|
-
- `npx proteum trace
|
|
295
|
+
- `npx proteum trace latest`
|
|
296
|
+
- `npx proteum trace show <requestId> --events`
|
|
289
297
|
- `npx proteum command ...`
|
|
290
298
|
- `npx proteum session ...`
|
|
291
299
|
- `npx proteum create ... --dry-run --json`
|
|
@@ -307,3 +315,32 @@ Edit these only when required, and keep changes minimal and explicit:
|
|
|
307
315
|
- `PORT`, `ENV_*`, `URL`, `TRACE_*`, and `ENABLE_PROFILER` env setup
|
|
308
316
|
- Prisma-generated files
|
|
309
317
|
- symbolic links
|
|
318
|
+
|
|
319
|
+
## Delivery Workflow
|
|
320
|
+
|
|
321
|
+
Agents working in generated Proteum projects must use this delivery workflow for production code changes:
|
|
322
|
+
|
|
323
|
+
1. BDD / ATDD: translate the requested behavior into acceptance scenarios before changing implementation code.
|
|
324
|
+
2. TDD: write or update the smallest failing unit/integration test that proves the next behavior.
|
|
325
|
+
3. Implementation: make the narrowest production change that satisfies the failing test while preserving Proteum boundaries.
|
|
326
|
+
4. Proteum check: refresh and validate generated framework contracts after route, page, controller, service, command, or config changes.
|
|
327
|
+
5. Validate unit + E2E: run the relevant unit tests and real-world journey E2E checks before calling the work complete.
|
|
328
|
+
|
|
329
|
+
Unit test expectation: production package and service logic should target 100% meaningful unit coverage for touched behavior. Any excluded generated files, migrations, framework shims, or unreachable defensive branches must be documented in the completion note.
|
|
330
|
+
|
|
331
|
+
E2E expectation: real-world journeys must follow the project-local instructions in `tests/e2e/REAL_WORLD_JOURNEY_TESTS.md`. These tests should model complete user workflows, role transitions, permissions, state changes, and cross-view consistency rather than isolated happy paths.
|
|
332
|
+
|
|
333
|
+
Recommended validation sequence:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
npm run refresh
|
|
337
|
+
npm run typecheck
|
|
338
|
+
npm run lint
|
|
339
|
+
npm run test
|
|
340
|
+
npm run test:integration
|
|
341
|
+
npx proteum check
|
|
342
|
+
npx proteum doctor --contracts --strict
|
|
343
|
+
npx proteum e2e --port <port>
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
When bundling, SSR, server startup, routing, or build-time behavior changes, also run the project build command before finishing.
|
|
@@ -8,7 +8,11 @@ This file is the source of truth for codex coding style instructions in Proteum-
|
|
|
8
8
|
- Write clean, consistent, readable code with a tab size of 4.
|
|
9
9
|
- Keep functions and methods short.
|
|
10
10
|
- Every time possible, create reusable functions and components instead of repeating.
|
|
11
|
-
- Before finishing a feature or change, review touched files against this document and run the
|
|
11
|
+
- Before finishing a feature or change, review touched files against this document and run the full project `npx proteum check`; coding-style regressions are defects, not optional cleanup.
|
|
12
|
+
|
|
13
|
+
## Type safety
|
|
14
|
+
|
|
15
|
+
- Do not use `Reflect.get`, bracket access, broad `in` checks, or local loose reader helpers to bypass missing typings for app-owned data; fix the type contract or normalize once with a typed adapter at the boundary.
|
|
12
16
|
|
|
13
17
|
## Formatting
|
|
14
18
|
|
|
@@ -24,6 +24,8 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
24
24
|
- Prefer generated app surfaces over direct `.proteum` implementation imports.
|
|
25
25
|
- Never depend on legacy `@app` imports on the client.
|
|
26
26
|
- Errors from controller calls should never be silently swallowed. Rethrow or surface them clearly.
|
|
27
|
+
- Caught frontend errors must always preserve the original failure. Never write `catch {}`, `.catch(() => ...)`, or a catch handler that only shows a generic toast/state without using the caught error.
|
|
28
|
+
- Valid frontend error handling includes rethrowing the error, passing it to `Router.app.handleError(error)`, logging/reporting it with the original error, or surfacing original detail such as `error.message` in user-visible feedback.
|
|
27
29
|
|
|
28
30
|
## Design
|
|
29
31
|
|
|
@@ -4,7 +4,10 @@ This file is the canonical source of truth for diagnostics, temporary instrument
|
|
|
4
4
|
|
|
5
5
|
## Initial Triage
|
|
6
6
|
|
|
7
|
-
- Start with machine-readable app state before reading large parts of the codebase: `npx proteum orient <query>`,
|
|
7
|
+
- Start with compact machine-readable app state before reading large parts of the codebase: `npx proteum orient <query>`, `npx proteum runtime status`, `npx proteum connect`, `npx proteum explain`, `npx proteum doctor`, and `npx proteum doctor --contracts` when generated artifacts or manifest-owned files may be stale.
|
|
8
|
+
- When a Proteum MCP client is available, prefer MCP `runtime_status`, `orient`, `instructions_resolve`, `diagnose`, `trace_latest`, `perf_top`, `perf_request`, and `logs_tail` for repeated reads of the same app/runtime state. Use compact CLI commands when you need a reproducible shell command, validation step, or CI-like output.
|
|
9
|
+
- MCP payloads are compact `proteum-mcp-v1` JSON and are capped/paginated by default. Do not request full detail until compact output identifies the missing data.
|
|
10
|
+
- Use full-detail escape hatches only after compact output identifies the missing detail: `npx proteum explain --manifest`, `npx proteum diagnose <target> --full`, `npx proteum trace show <requestId> --events`, or `npx proteum perf request <requestId> --full`.
|
|
8
11
|
- When the user pastes raw errors, reproduce locally before listing possible causes: identify the likely app, route, command, or request target from the error, boot or reuse the relevant dev server with the elevated-permissions workflow below, replay the failing surface once, and base the probability/why/how-to-fix list on local server output, browser console output, diagnostics, traces, or the smallest relevant command result. If there is not enough information to reproduce, state the missing context and ground the cause list in the local evidence that is available.
|
|
9
12
|
- When one app depends on another app's generated controllers, inspect `npx proteum connect --controllers`, `npx proteum explain --connected --controllers`, the producer `proteum.connected.json`, the consumer `proteum.config.ts` connected `source` value, and the producer `./.proteum/proteum.connected.d.ts` before assuming the contract is local.
|
|
10
13
|
- Use `rg -n` first to narrow the exact code path, then read only the relevant files.
|
|
@@ -16,6 +19,7 @@ This file is the canonical source of truth for diagnostics, temporary instrument
|
|
|
16
19
|
- For long-lived dev reproductions, always request elevated permissions and run `npx proteum dev` outside the sandbox. Use an explicit task/thread-scoped session file, inspect `npx proteum dev list --json` plus current listeners first, for example with `lsof -nP -iTCP -sTCP:LISTEN`, then choose a port that is not currently used before starting `npx proteum dev --session-file <path> --port <port>`. After the server is ready, print the live server URL as a clickable Markdown link.
|
|
17
20
|
- Use `--replace-existing` only when restarting the exact session file started by the current thread/task. Never replace another live session that belongs to a user, another thread, or an unknown owner.
|
|
18
21
|
- Only the bare `npx proteum build` and bare `npx proteum dev` commands print the welcome banner and active Proteum installation method. Any extra argument or option skips the banner. Only `npx proteum dev` clears the interactive terminal before rendering and reports connected app names plus successful connected `/ping` checks in the ready banner; keep that in mind when capturing or comparing command logs during diagnosis. Every `npx proteum dev` start ensures tracked instruction files contain the current managed `# Proteum Instructions` section before the dev loop begins.
|
|
22
|
+
- During `npx proteum dev`, the running app exposes the read-only Proteum MCP transport at `/__proteum/mcp`. Use it for runtime-adjacent agent reads instead of repeatedly spawning equivalent CLI diagnostics.
|
|
19
23
|
- For ownership or repo discovery questions, start with `npx proteum orient <query>` instead of jumping straight into source searches.
|
|
20
24
|
- For request-time issues in dev, start with `npx proteum diagnose <path> --port <port>` when you have a concrete failing route, page, controller path, or request target. It combines owner lookup, manifest diagnostics, contract diagnostics, matching trace data, and buffered server logs in one pass.
|
|
21
25
|
- Prefer focused verification before global checks: `npx proteum verify owner <query>`, `npx proteum verify request <path>`, and only then browser MCP validation when the bug is browser-visible. Use `npx proteum e2e --port <port> ...` only when automated end-to-end coverage or a Playwright suite is required.
|
|
@@ -26,7 +30,7 @@ This file is the canonical source of truth for diagnostics, temporary instrument
|
|
|
26
30
|
- For bundle-size inspection, use `npx proteum build --prod --analyze` to emit `bin/bundle-analysis/client.html` and `client-stats.json`, or add `--analyze-serve --analyze-port auto` when you want a local analyzer URL instead of a static HTML file.
|
|
27
31
|
- For request-time issues in dev, inspect traces before adding logs when the diagnose surface is still too coarse.
|
|
28
32
|
- If a server is already running on the default port from `PORT` or `./.proteum/manifest.json`, inspect existing traces before reproducing the issue.
|
|
29
|
-
- If existing traces are insufficient, arm `npx proteum trace arm --capture deep`, reproduce once, then inspect the new request with `npx proteum trace latest
|
|
33
|
+
- If existing traces are insufficient, arm `npx proteum trace arm --capture deep`, reproduce once, then inspect the new request with compact `npx proteum trace latest`; use `npx proteum trace show <requestId> --events` only when raw event detail is still required.
|
|
30
34
|
- Use the browser MCP to inspect browser console errors and warnings for frontend, SSR, hydration, and controller-call issues.
|
|
31
35
|
- Inspect server startup and runtime errors.
|
|
32
36
|
- For protected browser or API flows in dev, prefer `npx proteum session <email> --role <role>` over driving the login UI, then use that session for browser MCP validation. Use `npx proteum e2e --session-email <email> --session-role <role>` only when Playwright end-to-end suites need the auth token through the child process environment. Use the login UI only when auth UX itself is under test.
|
|
@@ -50,17 +54,16 @@ This file is the canonical source of truth for diagnostics, temporary instrument
|
|
|
50
54
|
## Verification And Testing
|
|
51
55
|
|
|
52
56
|
- Use the cheapest trustworthy verification that matches the failing layer.
|
|
53
|
-
- After implementing a change, verify
|
|
57
|
+
- After implementing a change, verify at the smallest trustworthy layer required by the changed surface first, then run the full project `npx proteum check` before finishing. Do not default to a running app, browser MCP, or Playwright while iterating when a narrower static or request-level verification is enough.
|
|
54
58
|
- For compile-time or type-safety issues, start with the relevant targeted typecheck or build command. Do not run them by default for unrelated runtime, copy, docs, or local refactor changes.
|
|
55
59
|
- For request/runtime issues, verify through the real page, route, generated controller call, or command on a running app.
|
|
56
60
|
- Start the smallest trustworthy runtime surface first: `npx proteum orient <query>`, then the relevant real URL, generated controller call, command, or `npx proteum diagnose <path> --port <port>`. Use browser MCP validation only when request-level verification is insufficient or the change is browser-visible.
|
|
57
61
|
- When automated browser assertions or suite coverage are required, use `npx proteum e2e --port <port>` for targeted or full Playwright suites. Do not use direct Playwright for browser validation outside the E2E wrapper, and do not launch raw browser automation against a shared persistent profile.
|
|
58
62
|
- Focused verification should treat unrelated global diagnostics as visible but non-blocking by default. Use `--strict-global` only when the task explicitly requires broad clean-room validation.
|
|
59
63
|
- For browser regressions, prefer a browser MCP repro first and add targeted Playwright E2E coverage only when the user asks for automated coverage, when a stable regression path needs automation, or when browser MCP verification is insufficient.
|
|
60
|
-
- For UI-visible fixes, after the required tests or verification pass, use the browser MCP to capture focused screenshots of the changed areas and inspect them before finalizing.
|
|
61
64
|
- Only the final verifier agent should usually run browser flows. Earlier agents should stay on `orient`, `verify owner`, `verify request`, `diagnose`, and command-level checks unless browser execution is the only trustworthy reproducer.
|
|
62
65
|
- Treat server startup failures, runtime errors, browser console errors or warnings, and Playwright failures as blocking unless they are clearly unrelated to the change.
|
|
63
|
-
- When the touched surface can affect coding-style enforcement, run the
|
|
66
|
+
- When the touched surface can affect coding-style enforcement, run the full project `npx proteum check` before finishing. Narrower lint or type checks are useful while iterating, but they do not replace the final full check.
|
|
64
67
|
- If the task started any long-lived `proteum dev` server, stop it explicitly with `npx proteum dev stop --session-file <path>` or `npx proteum dev stop --all --stale`, then confirm the remaining tracked sessions with `npx proteum dev list --json`.
|
|
65
68
|
- Add `data-testid` when stable selectors are missing instead of relying on brittle text or DOM-shape selectors.
|
|
66
69
|
- If an isolated test misses prerequisite state, run the smallest broader scope that reproduces the real setup.
|
|
@@ -19,6 +19,7 @@ When tradeoffs exist inside optimization work, optimize in this order:
|
|
|
19
19
|
- Prefer established, flexible, well-typed, widely adopted, actively maintained packages.
|
|
20
20
|
- Build custom or keep custom infrastructure only when packages would clearly hurt bundle size, SSR behavior, performance, typing quality, flexibility, licensing, explicit contracts, or long-term maintainability.
|
|
21
21
|
- If you choose custom over a package, state briefly why.
|
|
22
|
+
- For agent-facing repeated diagnostics, prefer the read-only Proteum MCP surface over adding broader CLI output. MCP should expose compact single-line `proteum-mcp-v1` JSON with capped, typed, paginated reads; the CLI should stay compact and reproducible.
|
|
22
23
|
|
|
23
24
|
## SSR And Page Size
|
|
24
25
|
|
|
@@ -14,6 +14,9 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
14
14
|
- If the user pastes raw errors without asking for a fix, do not implement changes yet. First run the task-safe local reproduction path: identify the likely app, route, command, or request from the error, boot or reuse the relevant dev server with the elevated-permissions workflow in `Task Lifecycle`, reproduce the failing surface locally, and inspect server output, browser console output, diagnostics, traces, or the smallest relevant command result. If the error does not identify enough context to reproduce, say what is missing and use the available local evidence before guessing. Then list likely causes and, for each one, give probability, why, and how to fix it.
|
|
15
15
|
- If the user asks to implement a feature, first inspect the relevant existing surface and state any implementation problem, pain point, attention point, or question you see. If a concern is blocking, or it can materially change product behavior, API shape, architecture, data model, cost, privacy, security, or UX, ask before editing; otherwise state the assumption and continue implementing.
|
|
16
16
|
- If the task is ambiguous, generated, connected, or multi-repo, start with `npx proteum orient <query>` before reading large parts of the codebase.
|
|
17
|
+
- Treat Proteum CLI and MCP output as the workflow router. Read only the instruction files returned in `orient` `mustRead` or MCP `instructions_resolve`, plus conditional docs that match the current task. Do not read broad instruction folders or every managed instruction file up front.
|
|
18
|
+
- When a Proteum MCP client is available, prefer read-only MCP tools for repeated runtime/status/orientation/trace/perf/log reads. Use CLI commands when you need reproducible terminal validation, dev/build/check workflows, or output to share with a human.
|
|
19
|
+
- MCP payloads are compact single-line `proteum-mcp-v1` JSON with capped and paginated detail. Do not expand MCP output for human readability.
|
|
17
20
|
- If the user reports an issue, or the agent encounters one during exploration, implementation, verification, or runtime reproduction, load and follow root-level `diagnostics.md`.
|
|
18
21
|
- If the task touches client-side files, especially `client/**` and page files, load and apply root-level `optimizations.md` only after implementation for post-implementation checking and optimization. Skip it at task start and skip it for server-only, test-only, doc-only, and non-client refactor tasks unless the user explicitly asks for optimization work.
|
|
19
22
|
- If the task needs new app or artifact boilerplate, prefer `npx proteum init ...` and `npx proteum create ...` before creating files by hand. Use `--dry-run --json` when an agent needs a machine-readable plan before writing files.
|
|
@@ -47,14 +50,14 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
47
50
|
- When starting a long-lived dev server for an agent task, always request elevated permissions and run `npx proteum dev` outside the sandbox. Use an explicit task/thread-scoped session file such as `var/run/proteum/dev/agents/<task>.json`, inspect `npx proteum dev list --json` plus current listeners first, for example with `lsof -nP -iTCP -sTCP:LISTEN`, then choose a port that is not currently used before starting `npx proteum dev --session-file <path> --port <port>`. After the server is ready, print the live server URL as a clickable Markdown link.
|
|
48
51
|
- Use `--replace-existing` only when restarting the exact session file started by the current thread/task. Never replace another live session that belongs to a user, another thread, or an unknown owner.
|
|
49
52
|
- If the current app depends on local `file:` connected projects, boot every connected producer app too, each with its own task-scoped session file and free port, and run every one of those `proteum dev` processes with elevated permissions outside the sandbox before starting or verifying the consumer app.
|
|
53
|
+
- During `npx proteum dev`, the app exposes the read-only Proteum MCP runtime endpoint at `/__proteum/mcp`; use it for repeated agent reads instead of spawning equivalent diagnostics commands.
|
|
50
54
|
- For browser validation, use the browser MCP against the running app. Keep Playwright inside `npx proteum e2e --port <port>` for targeted/full end-to-end suites. Bootstrap protected browser MCP state with `npx proteum session`; bootstrap protected E2E runs with `npx proteum e2e --session-email <email> --session-role <role>`.
|
|
51
55
|
- Current CLI banner contract: only the bare `proteum build` and bare `proteum dev` commands print the welcome banner and include the active Proteum installation method. Any extra argument or option skips the banner. Only `proteum dev` clears the interactive terminal before rendering, exposes `CTRL+R` reload plus `CTRL+C` shutdown hotkeys in its session UI, and reports connected app names plus successful connected `/ping` checks in the ready banner. Every `proteum dev` start ensures tracked instruction files contain the current managed `# Proteum Instructions` section before the dev loop begins.
|
|
52
56
|
|
|
53
57
|
### Before Finishing
|
|
54
58
|
|
|
55
59
|
- Before finishing, re-check touched files against root-level `CODING_STYLE.md` and any narrower area `AGENTS.md` that applied to the edit. Re-check against root-level `optimizations.md` only for touched client-side files. Re-check against root-level `diagnostics.md` only if the task involved an issue, diagnosis, runtime reproduction, or verification failure.
|
|
56
|
-
-
|
|
57
|
-
- After implementing UI-visible changes, once the required tests or verification pass, use the browser MCP to open the changed routes or states, capture screenshots focused on the changed areas, inspect them for obvious visual defects, and include or reference those screenshots in the final response as proof of the completed UI change.
|
|
60
|
+
- Run the full project `npx proteum check` before finishing each feature or change. Targeted lint, typecheck, diagnose, request, browser, or E2E runs are still useful while iterating, but they do not replace the final full check. After implementing a new feature or changing existing feature behavior, always update the end-to-end coverage for that behavior and run the full Playwright test suite before finishing. For docs-only, wording-only, type-only, test-only, generated-output cleanup, or clearly local non-runtime refactors, skip Playwright unless the user explicitly asks for it or verification reveals a real issue.
|
|
58
61
|
- Before finishing a task, stop every `proteum dev` session started during the task and confirm cleanup with `npx proteum dev list --json` or an explicit `npx proteum dev stop --session-file <path>`.
|
|
59
62
|
- When you have finished your work, ask the user whether they want a commit message. After providing a commit message or after creating a commit, immediately follow it with this exact prompt and obey it:
|
|
60
63
|
`Explain in short minimalistic and few bullet points what we changed in this thread, like you would do to your grandma. Start with a verb in the past.`
|
|
@@ -164,13 +167,12 @@ Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
|
164
167
|
|
|
165
168
|
Verify at the correct layer:
|
|
166
169
|
|
|
167
|
-
- Default: use the cheapest trustworthy verification for the changed surface first, then
|
|
170
|
+
- Default: use the cheapest trustworthy verification for the changed surface first, then run the full project `npx proteum check` before finishing.
|
|
168
171
|
- Route additions: boot the app and hit the real URL.
|
|
169
172
|
- Controller changes: exercise the generated client call or generated `/api/...` endpoint.
|
|
170
173
|
- SSR changes: use the browser MCP to load the real page and inspect rendered HTML plus browser console.
|
|
171
174
|
- Router or plugin changes: verify request context, auth, redirects, metrics, and validation on a running app.
|
|
172
|
-
- New features or feature-behavior changes: use the cheapest trustworthy verification while iterating, use the browser MCP for browser-visible validation, then update the relevant end-to-end coverage and finish by running the full Playwright suite
|
|
173
|
-
- UI-visible changes: after the required tests or verification, use the browser MCP to screenshot the changed areas and confirm the screenshots match the intended result.
|
|
175
|
+
- New features or feature-behavior changes: use the cheapest trustworthy verification while iterating, use the browser MCP for browser-visible validation, then update the relevant end-to-end coverage and finish by running the full Playwright suite plus the full project `npx proteum check`.
|
|
174
176
|
- Generated, connected, or ownership-ambiguous changes: start with `npx proteum orient <query>` and prefer `npx proteum verify owner <query>` before broad global checks.
|
|
175
177
|
- Browser-visible issues: use the browser MCP after request-level verification is insufficient. Use `npx proteum e2e --port <port> ...` only when automated end-to-end coverage or a Playwright suite is required.
|
|
176
178
|
- Raw browser execution outside end-to-end suites: use the browser MCP only. Keep Playwright in `npx proteum e2e --port <port>` for targeted/full end-to-end suites.
|
|
@@ -193,6 +195,7 @@ Verify at the correct layer:
|
|
|
193
195
|
- Do not create nested `catalogs/` folders under pages, components, services, tests, or other feature folders.
|
|
194
196
|
- Keep strong TypeScript typings across the project.
|
|
195
197
|
- Do not introduce `any` or `unknown`, including through casts, helper aliases, or fallback generic defaults.
|
|
198
|
+
- Do not use `Reflect.get`, bracket access, broad `in` checks, or local loose reader helpers to bypass missing typings for app-owned data; fix the type contract or normalize once with a typed adapter at the boundary.
|
|
196
199
|
- Fix typing issues only on code you wrote.
|
|
197
200
|
- Never cast with `as any` or `as unknown`; fix the contract or add an explicit typed adapter.
|
|
198
201
|
|
|
@@ -263,19 +266,24 @@ Project code should consume:
|
|
|
263
266
|
|
|
264
267
|
Prefer structured CLI surfaces over re-deriving framework facts from source:
|
|
265
268
|
|
|
266
|
-
- `npx proteum connect
|
|
269
|
+
- `npx proteum connect`
|
|
267
270
|
- `npx proteum connect --controllers --strict`
|
|
268
271
|
- `npx proteum orient <query>`
|
|
269
|
-
- `npx proteum
|
|
272
|
+
- `npx proteum runtime status`
|
|
273
|
+
- `npx proteum mcp`
|
|
274
|
+
- `npx proteum mcp --url http://localhost:<port>`
|
|
275
|
+
- `npx proteum explain`
|
|
276
|
+
- `npx proteum explain --manifest`
|
|
270
277
|
- `npx proteum explain --connected --controllers`
|
|
271
278
|
- `npx proteum explain owner <query>`
|
|
272
|
-
- `npx proteum doctor
|
|
273
|
-
- `npx proteum doctor --contracts
|
|
279
|
+
- `npx proteum doctor`
|
|
280
|
+
- `npx proteum doctor --contracts`
|
|
274
281
|
- `npx proteum diagnose <path> --port <port>`
|
|
275
282
|
- `npx proteum verify owner <query>`
|
|
276
283
|
- `npx proteum verify request <path>`
|
|
277
284
|
- `npx proteum perf ...`
|
|
278
|
-
- `npx proteum trace
|
|
285
|
+
- `npx proteum trace latest`
|
|
286
|
+
- `npx proteum trace show <requestId> --events`
|
|
279
287
|
- `npx proteum command ...`
|
|
280
288
|
- `npx proteum session ...`
|
|
281
289
|
- `npx proteum create ... --dry-run --json`
|
|
@@ -11,7 +11,6 @@ Diagnostics source of truth: root-level `diagnostics.md`.
|
|
|
11
11
|
- Test the current controller/page runtime model, not legacy `@Route` or `api.fetch(...)` behavior.
|
|
12
12
|
- Verify routing, controllers, SSR, and router plugins against a running app when behavior depends on real request handling.
|
|
13
13
|
- After implementing a new feature or changing existing feature behavior, update the end-to-end coverage for that behavior and run the full Playwright suite before finishing. Prefer `npx proteum e2e --port <port>` for Playwright runs so base URLs and auth tokens are passed through Proteum-managed child env instead of shell-leading environment assignments. Use a browser MCP repro against a running app during iteration when it is the fastest trustworthy loop.
|
|
14
|
-
- For UI-visible feature changes, after the required Playwright run passes, use the browser MCP to capture focused screenshots of the changed areas and inspect them for visual correctness before finishing.
|
|
15
14
|
- Exercise real URLs, generated controller calls, or real browser flows instead of re-deriving framework internals in tests.
|
|
16
15
|
- Organize end-to-end tests following the Crosspath platform layout under `tests/e2e/**`.
|
|
17
16
|
- Put runnable scenario entrypoints in `tests/e2e/features/**`, `tests/e2e/specs/<domain>/**`, or `tests/e2e/journeys/**` depending on scope.
|
|
@@ -24,3 +23,9 @@ Diagnostics source of truth: root-level `diagnostics.md`.
|
|
|
24
23
|
- Keep end-to-end tests clean, well organized, and non-redundant. Prefer extending or reshaping the most relevant existing scenario over duplicating coverage, and remove or consolidate overlap when the suite becomes repetitive.
|
|
25
24
|
- Reuse root catalog files from `/client/catalogs/**`, `/server/catalogs/**`, or `/common/catalogs/**` instead of duplicating catalog constants in tests.
|
|
26
25
|
- For protected dev flows, prefer `npx proteum e2e --session-email <email> --session-role <role>` or `npx proteum session <email> --role <role>` over automating login unless the login flow itself is under test.
|
|
26
|
+
|
|
27
|
+
### Real-World Journey E2E
|
|
28
|
+
|
|
29
|
+
End-to-end tests must follow the workflow in `tests/e2e/REAL_WORLD_JOURNEY_TESTS.md`.
|
|
30
|
+
|
|
31
|
+
Use E2E journeys for complete role-based flows, permissions, state transitions, derived metrics, filters, detail/edit surfaces, and cross-role visibility. Avoid replacing those journeys with isolated happy-path smoke checks when the feature has real workflow depth.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# E2E Journey Test Instructions
|
|
2
|
+
|
|
3
|
+
Follow `REAL_WORLD_JOURNEY_TESTS.md` in this directory when designing, implementing, extending, or reviewing end-to-end tests.
|
|
4
|
+
|
|
5
|
+
Required structure for substantial E2E work:
|
|
6
|
+
|
|
7
|
+
- `tests/e2e/journeys/`: real-world journey specs grouped by workflow or domain.
|
|
8
|
+
- `tests/e2e/pages/`: page objects or screen helpers that keep selectors stable.
|
|
9
|
+
- `tests/e2e/workflows/`: reusable multi-step role and business workflows.
|
|
10
|
+
- `tests/e2e/factories/`: deterministic test data builders and fixtures.
|
|
11
|
+
- `tests/e2e/utils/`: login, navigation, assertions, network, and cleanup helpers.
|
|
12
|
+
|
|
13
|
+
Do not reduce E2E coverage to one-screen smoke tests when the feature involves multiple roles, permissions, workflow states, derived KPIs, or cross-view consistency.
|