proteum 2.1.9-5 → 2.1.9-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -5
- package/README.md +3 -0
- package/agents/project/AGENTS.md +22 -13
- package/agents/project/app-root/AGENTS.md +16 -0
- package/agents/project/client/AGENTS.md +5 -5
- package/agents/project/client/pages/AGENTS.md +3 -3
- package/agents/project/diagnostics.md +3 -1
- package/agents/project/root/AGENTS.md +292 -0
- package/agents/project/server/routes/AGENTS.md +2 -2
- package/agents/project/server/services/AGENTS.md +2 -2
- package/agents/project/tests/AGENTS.md +1 -1
- package/cli/commands/configure.ts +180 -0
- package/cli/commands/dev.ts +0 -2
- package/cli/compiler/client/index.ts +24 -1
- package/cli/compiler/common/files/style.ts +47 -2
- package/cli/presentation/commands.ts +23 -1
- package/cli/presentation/help.ts +1 -1
- package/cli/runtime/commands.ts +20 -0
- package/cli/scaffold/index.ts +2 -2
- package/cli/utils/agents.ts +231 -58
- package/package.json +1 -1
- package/scripts/update-codex-agents.ts +2 -2
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Proteum Core
|
|
2
2
|
|
|
3
|
-
This file governs work in the Proteum framework repository itself. For downstream app rules, use `agents/project/AGENTS.md
|
|
3
|
+
This file governs work in the Proteum framework repository itself. For downstream app rules, use `agents/project/AGENTS.md` for the standalone app-root contract, or split between `agents/project/root/AGENTS.md` and `agents/project/app-root/AGENTS.md` in a monorepo.
|
|
4
4
|
Role: keep only framework-repo instructions here.
|
|
5
5
|
Keep here: core-repo priorities, framework change workflow, reference-app validation, and framework-specific constraints.
|
|
6
6
|
Do not put here: downstream app implementation contracts, area-specific app rules, or repeated content that belongs in `agents/project/**`.
|
|
@@ -32,7 +32,9 @@ cd <worktree path>
|
|
|
32
32
|
npx prisma migrate dev --config ./prisma.config.ts --name <migration name>
|
|
33
33
|
```
|
|
34
34
|
- After implementing a framework feature or change, do not stop at code edits. Boot both reference apps, exercise the affected flow with Playwright or 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
|
-
- When starting a long-lived reference app dev server for framework work,
|
|
35
|
+
- 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>`.
|
|
36
|
+
- 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
|
+
- 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.
|
|
36
38
|
- Before retrying a boot on the same app, changing ports, or finishing the task, stop every framework-started dev session with `npx proteum dev stop --session-file <path>` or `npx proteum dev stop --all --stale`.
|
|
37
39
|
- If the task changed the dev workflow itself, verify the final cleanup path with `npx proteum dev list --json` before finishing.
|
|
38
40
|
- 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:
|
|
@@ -51,9 +53,9 @@ npx prisma migrate dev --config ./prisma.config.ts --name <migration name>
|
|
|
51
53
|
- `/Users/gaetan/Desktop/Projets/unique.domains/platform/apps/product`
|
|
52
54
|
- `/Users/gaetan/Desktop/Projets/unique.domains/platform/apps/website`
|
|
53
55
|
- Inspect how both apps currently use the touched feature, runtime, API, compiler behavior, or generated output before proposing or implementing changes.
|
|
54
|
-
- 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/diagnostics.md`, and any narrower `agents/project/**/AGENTS.md` file that mentions the changed workflow.
|
|
56
|
+
- 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.
|
|
55
57
|
- 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.
|
|
56
|
-
- Keep core changes aligned with the explicit controller/page architecture in `agents/project/AGENTS.md`.
|
|
58
|
+
- 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`.
|
|
57
59
|
- Prefer removing framework magic when the same result can be expressed with explicit contracts, generated code, or typed context.
|
|
58
60
|
- Apply the pruning rules from `agents/project/optimizations.md`, especially for webpack plugins, Babel plugins, aliases, helpers, runtime services, and npm packages that are not meaningfully used by both apps.
|
|
59
61
|
- Remove dead docs, flags, helper files, and compatibility branches in the same pass when safe.
|
|
@@ -71,7 +73,8 @@ npx prisma migrate dev --config ./prisma.config.ts --name <migration name>
|
|
|
71
73
|
|
|
72
74
|
Do not stop at static analysis for routing, controllers, generated code, SSR, client runtime, services, webpack, Babel, or emitted assets.
|
|
73
75
|
|
|
74
|
-
- Run `npx proteum dev --no-cache --
|
|
76
|
+
- 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.
|
|
77
|
+
- 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.
|
|
75
78
|
- When validating a concrete route, controller path, or failing page on a running dev server, prefer `proteum diagnose <path> --port <port>` first. Use raw `proteum trace ...` output when you need lower-level event detail beyond the diagnose summary.
|
|
76
79
|
- 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.
|
|
77
80
|
- 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.
|
package/README.md
CHANGED
|
@@ -336,6 +336,7 @@ Proteum ships with a compact CLI focused on the real app lifecycle:
|
|
|
336
336
|
| `proteum session` | Mint a dev-only auth session token and Playwright-ready cookie payload |
|
|
337
337
|
| `proteum verify` | Validate framework-facing workflows across one or more running dev apps; `framework-change` is the built-in cross-reference-app check |
|
|
338
338
|
| `proteum init` | Scaffold a new Proteum app with built-in deterministic templates |
|
|
339
|
+
| `proteum configure agents` | Interactively configure Proteum-managed instruction symlinks for standalone or monorepo apps |
|
|
339
340
|
| `proteum create` | Scaffold a page, controller, command, route, or root service inside an app |
|
|
340
341
|
|
|
341
342
|
Recommended daily workflow:
|
|
@@ -385,6 +386,7 @@ Useful scaffolding commands:
|
|
|
385
386
|
```bash
|
|
386
387
|
proteum init my-app --name "My App"
|
|
387
388
|
proteum init my-app --name "My App" --dry-run --json
|
|
389
|
+
proteum configure agents
|
|
388
390
|
proteum create page marketing/faq --route /faq
|
|
389
391
|
proteum create controller Founder/projects --method list
|
|
390
392
|
proteum create service Conversion/Plans
|
|
@@ -578,6 +580,7 @@ Then use the normal workflow:
|
|
|
578
580
|
|
|
579
581
|
```bash
|
|
580
582
|
npm install
|
|
583
|
+
npx proteum configure agents
|
|
581
584
|
npx proteum dev
|
|
582
585
|
npx proteum check
|
|
583
586
|
npx proteum build --prod
|
package/agents/project/AGENTS.md
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
# Proteum Project Contract
|
|
2
2
|
|
|
3
|
-
This is the canonical contract for Proteum-based projects shipped with Proteum. Narrower `AGENTS.md` files in this folder add area-specific rules on top of this file.
|
|
4
|
-
|
|
3
|
+
This is the canonical standalone-app contract for Proteum-based projects shipped with Proteum. Narrower `AGENTS.md` files in this folder add area-specific rules on top of this file.
|
|
4
|
+
When splitting instructions across a monorepo, put the Proteum-wide rules in the monorepo-root `AGENTS.md` and keep only app-root-specific additions in each Proteum app root `AGENTS.md`.
|
|
5
|
+
Role: keep only project-wide app rules here when one root `AGENTS.md` must carry both the reusable Proteum contract and the app-root addendum.
|
|
5
6
|
Keep here: cross-cutting project workflow, architecture contracts, shared typing rules, and rules that apply across client, server, pages, and tests.
|
|
6
7
|
Do not put here: detailed diagnostics workflow, optimization checklists, coding-style details, or narrow area-specific instructions that belong in `diagnostics.md`, `optimizations.md`, `CODING_STYLE.md`, `client/AGENTS.md`, `client/pages/AGENTS.md`, `server/routes/AGENTS.md`, `server/services/AGENTS.md`, or `tests/AGENTS.md`.
|
|
7
8
|
|
|
8
|
-
Optimization source of truth:
|
|
9
|
-
Diagnostics source of truth:
|
|
10
|
-
Coding style source of truth:
|
|
9
|
+
Optimization source of truth: root-level `optimizations.md`.
|
|
10
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
11
|
+
Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
11
12
|
|
|
12
13
|
## Fast Triggers
|
|
13
14
|
|
|
15
|
+
- If you are working in a newly created Proteum worktree, before following the rest of these instructions:
|
|
16
|
+
- Copy `.env` from the main worktree.
|
|
17
|
+
- Run `npx proteum refresh`.
|
|
18
|
+
- Read and acknowledge the applicable `AGENTS.md` files.
|
|
19
|
+
- Run `npm i`.
|
|
20
|
+
- Run the dev server with the task-safe elevated-permissions launch workflow from `Task Lifecycle`, and keep it running so user can see the results by himself.
|
|
14
21
|
- If the user pastes raw errors without asking for a fix, do not implement changes. List likely causes and, for each one, give probability, why, and how to fix it.
|
|
15
22
|
- If the task is ambiguous, generated, connected, or multi-repo, start with `npx proteum orient <query>` before reading large parts of the codebase.
|
|
16
|
-
- If the user reports an issue, or the agent encounters one during exploration, implementation, verification, or runtime reproduction, load and follow
|
|
17
|
-
- If the task touches client-side files, especially `client/**` and page files, load and apply
|
|
23
|
+
- 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`.
|
|
24
|
+
- 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.
|
|
18
25
|
- 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 dev server URL.
|
|
19
26
|
- 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.
|
|
20
27
|
- If you changed `schema.prisma`, do not start testing or validation yet. Ask the user to run the following command in the affected worktree directory, replacing the placeholders, and wait for the user to reply exactly `continue` before resuming validation or tests:
|
|
@@ -37,19 +44,20 @@ Coding style source of truth: project-root `CODING_STYLE.md`.
|
|
|
37
44
|
|
|
38
45
|
### Before Editing
|
|
39
46
|
|
|
40
|
-
- Before changing any file, load
|
|
47
|
+
- Before changing any file, load root-level `CODING_STYLE.md` and any narrower area `AGENTS.md` that applies to the touched files. Do not spend response space explicitly acknowledging those reads unless the user asks.
|
|
41
48
|
|
|
42
49
|
### During Implementation
|
|
43
50
|
|
|
44
51
|
- After running `npx proteum create ...`, adapt the generated code to the real feature instead of leaving placeholder logic in place.
|
|
45
|
-
- When starting a long-lived dev server for an agent task,
|
|
46
|
-
-
|
|
52
|
+
- 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>`.
|
|
53
|
+
- 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.
|
|
54
|
+
- 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.
|
|
47
55
|
- For raw browser automation, use `npx proteum verify browser` when it matches the task, or direct Playwright with a disposable profile when lower-level control is required. Bootstrap protected browser state through `npx proteum session`.
|
|
48
56
|
- 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.
|
|
49
57
|
|
|
50
58
|
### Before Finishing
|
|
51
59
|
|
|
52
|
-
- Before finishing, re-check touched files against
|
|
60
|
+
- 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.
|
|
53
61
|
- Do not default to project-wide typecheck, `npx proteum check`, or Playwright after every change. Run them only when the user asks for them, when the changed surface specifically requires them, or when a real issue discovered during verification justifies escalation.
|
|
54
62
|
- 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>`.
|
|
55
63
|
- When you have finished your work, ask the user whether they want a commit message.
|
|
@@ -98,6 +106,7 @@ Coding style source of truth: project-root `CODING_STYLE.md`.
|
|
|
98
106
|
- Declare connected namespaces in `proteum.config.ts` with explicit values such as `connect: { Product: { source: PRODUCT_CONNECTED_SOURCE, urlInternal: PRODUCT_URL_INTERNAL } }`.
|
|
99
107
|
- Proteum does not infer connected env key names from the namespace. The source and internal URL must be provided explicitly in `proteum.config.ts`.
|
|
100
108
|
- Use `npx proteum connect` to inspect configured connect values, cached contract state, and imported controllers for the current app.
|
|
109
|
+
- Before launching a consumer app that depends on local `file:` connected sources, launch every connected producer app too, assign each one a free port, run each `proteum dev` outside the sandbox with elevated permissions, and make sure `connect.<Namespace>.urlInternal` resolves to those live producer URLs.
|
|
101
110
|
- `file:` connected sources point at another Proteum app root and keep strong connected typings.
|
|
102
111
|
- Non-local connected sources provide runtime helper generation but are intentionally typed loosely.
|
|
103
112
|
|
|
@@ -165,7 +174,7 @@ Verify at the correct layer:
|
|
|
165
174
|
- Generated, connected, or ownership-ambiguous changes: start with `npx proteum orient <query>` and prefer `npx proteum verify owner <query>` before broad global checks.
|
|
166
175
|
- Browser-visible issues: prefer `npx proteum verify browser <path>` or the narrowest targeted Playwright pass only after request-level verification is insufficient.
|
|
167
176
|
- Raw browser execution beyond `npx proteum verify browser`: use direct Playwright with a disposable profile, and keep that step for the final verifier agent unless a narrower surface cannot reproduce the issue.
|
|
168
|
-
- For trace-first reproduction, session-based auth setup, temporary logs, and post-fix surface checks, follow
|
|
177
|
+
- For trace-first reproduction, session-based auth setup, temporary logs, and post-fix surface checks, follow root-level `diagnostics.md`.
|
|
169
178
|
|
|
170
179
|
## Implementation Rules
|
|
171
180
|
|
|
@@ -174,7 +183,7 @@ Verify at the correct layer:
|
|
|
174
183
|
- Before implementing a feature or change, first check whether the repo already includes a suitable dependency.
|
|
175
184
|
- If not, search npm before building a new utility, abstraction, component primitive, parser, formatter, or integration from scratch.
|
|
176
185
|
- Prefer the most popular, flexible, maintained packages that fit the project constraints.
|
|
177
|
-
- When the task explicitly involves client-side optimization work, use
|
|
186
|
+
- When the task explicitly involves client-side optimization work, use root-level `optimizations.md` to decide whether custom infrastructure is justified over an existing package.
|
|
178
187
|
- When you choose custom over a package, explain the reason briefly.
|
|
179
188
|
|
|
180
189
|
### Catalogs And Typing
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Proteum App-Root Addendum
|
|
2
|
+
|
|
3
|
+
This file is the app-root-only addendum for a Proteum app that lives inside a larger monorepo.
|
|
4
|
+
Keep the reusable Proteum contract in the nearest ancestor root `AGENTS.md`, and keep this file only for instructions that depend on the current directory being the Proteum app root.
|
|
5
|
+
Role: keep only app-root workflow and local project-semantic rules here.
|
|
6
|
+
Do not put here: reusable Proteum architecture contracts, shared verification rules, diagnostics workflow, optimization checklists, coding-style details, or area-specific rules already covered by broader `AGENTS.md` files or the root-level `diagnostics.md`, `optimizations.md`, and `CODING_STYLE.md`.
|
|
7
|
+
|
|
8
|
+
## App-Root Triggers
|
|
9
|
+
|
|
10
|
+
- If you are working in a newly created Proteum worktree, before following the rest of these instructions:
|
|
11
|
+
- Copy `.env` from the main worktree.
|
|
12
|
+
- Run `npx proteum refresh`.
|
|
13
|
+
- Read and acknowledge the applicable `AGENTS.md` files.
|
|
14
|
+
- Run `npm i`.
|
|
15
|
+
- Run the dev server with the task-safe elevated-permissions launch workflow from the reusable root `AGENTS.md`, and keep it running so user can see the results by himself.
|
|
16
|
+
- 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 dev server URL.
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
This is the canonical client-area contract for Proteum-based projects.
|
|
4
4
|
Role: keep only client-area rules here.
|
|
5
5
|
Keep here: client component, hook, design-system, accessibility, and client-context usage rules that apply beyond a single page.
|
|
6
|
-
Do not put here: page `setup` and route-registration details, server/service rules, or generic project workflow already covered by
|
|
6
|
+
Do not put here: page `setup` and route-registration details, server/service rules, or generic project workflow already covered by broader ancestor `AGENTS.md` files.
|
|
7
7
|
|
|
8
|
-
Optimization source of truth:
|
|
9
|
-
Diagnostics source of truth:
|
|
10
|
-
Coding style source of truth:
|
|
8
|
+
Optimization source of truth: root-level `optimizations.md`.
|
|
9
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
10
|
+
Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
11
11
|
|
|
12
12
|
## Stack
|
|
13
13
|
|
|
@@ -39,4 +39,4 @@ Coding style source of truth: project-root `CODING_STYLE.md`.
|
|
|
39
39
|
- Keep one component per file.
|
|
40
40
|
- Load data and define handlers in the directly concerned component when that keeps ownership clearer.
|
|
41
41
|
- Keep curated lists, option registries, and UI copy catalogs under `/client/catalogs/**`.
|
|
42
|
-
- Follow the section-comment format from the
|
|
42
|
+
- Follow the section-comment format from the root-level `CODING_STYLE.md`.
|
|
@@ -5,9 +5,9 @@ Role: keep only page-file rules here.
|
|
|
5
5
|
Keep here: `Router.page(...)` registration, SSR `setup` and `render` contracts, page payload shape, and page-local typing rules.
|
|
6
6
|
Do not put here: generic component rules, server/service implementation details, or app-wide workflow already covered by broader AGENTS files.
|
|
7
7
|
|
|
8
|
-
Optimization source of truth:
|
|
9
|
-
Diagnostics source of truth:
|
|
10
|
-
Coding style source of truth:
|
|
8
|
+
Optimization source of truth: root-level `optimizations.md`.
|
|
9
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
10
|
+
Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
11
11
|
|
|
12
12
|
## Router.page Usage
|
|
13
13
|
|
|
@@ -12,11 +12,13 @@ This file is the canonical source of truth for diagnostics, temporary instrument
|
|
|
12
12
|
|
|
13
13
|
## Runtime Diagnostics
|
|
14
14
|
|
|
15
|
-
- For long-lived dev reproductions,
|
|
15
|
+
- 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>`.
|
|
16
|
+
- 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.
|
|
16
17
|
- 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.
|
|
17
18
|
- For ownership or repo discovery questions, start with `npx proteum orient <query>` instead of jumping straight into source searches.
|
|
18
19
|
- 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.
|
|
19
20
|
- Prefer focused verification before global checks: `npx proteum verify owner <query>`, `npx proteum verify request <path>`, and only then `npx proteum verify browser <path>` or targeted Playwright when the bug is browser-visible.
|
|
21
|
+
- When diagnosing a consumer app that depends on local `file:` connected projects, boot every connected producer app too, each on its own free port and task-scoped session file, and run every one of those `proteum dev` processes with elevated permissions outside the sandbox before reproducing the consumer issue.
|
|
20
22
|
- For connected-project failures, confirm the consumer app resolves the expected `connect.<Namespace>.source` and `connect.<Namespace>.urlInternal` values, the producer app exposes `GET /api/__proteum/connected/ping`, and the imported controller entries show `scope=connected` in `proteum explain`.
|
|
21
23
|
- Use `npx proteum explain owner <query>` when you need a fast ownership graph for a route, controller path, source file, or generated artifact before reading code.
|
|
22
24
|
- For performance issues or regressions in dev, use `npx proteum perf top --since <window>` to rank hot paths, `npx proteum perf request <requestId|path>` for one request waterfall plus chain attribution and SQL fingerprints, `npx proteum perf compare --baseline <window> --target <window>` for regressions, and `npx proteum perf memory --since <window>` for heap or RSS drift.
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Proteum Root Contract
|
|
2
|
+
|
|
3
|
+
This is the reusable Proteum-wide contract that is safe to place at the root of a monorepo above one or more Proteum apps.
|
|
4
|
+
Pair this file with an app-root `AGENTS.md` inside each Proteum app when local workflow or product-context instructions depend on the current directory being the app root.
|
|
5
|
+
Role: keep only reusable Proteum workflow, architecture contracts, shared typing rules, and cross-surface verification rules here.
|
|
6
|
+
Do not put here: app-root bootstrap steps, local product-doc reading rules, detailed diagnostics workflow, optimization checklists, coding-style details, or narrow area-specific instructions that belong in `diagnostics.md`, `optimizations.md`, `CODING_STYLE.md`, `client/AGENTS.md`, `client/pages/AGENTS.md`, `server/routes/AGENTS.md`, `server/services/AGENTS.md`, or `tests/AGENTS.md`.
|
|
7
|
+
|
|
8
|
+
Optimization source of truth: root-level `optimizations.md`.
|
|
9
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
10
|
+
Coding style source of truth: root-level `CODING_STYLE.md`.
|
|
11
|
+
|
|
12
|
+
## Fast Triggers
|
|
13
|
+
|
|
14
|
+
- If the user pastes raw errors without asking for a fix, do not implement changes. List likely causes and, for each one, give probability, why, and how to fix it.
|
|
15
|
+
- If the task is ambiguous, generated, connected, or multi-repo, start with `npx proteum orient <query>` before reading large parts of the codebase.
|
|
16
|
+
- 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`.
|
|
17
|
+
- 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.
|
|
18
|
+
- 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.
|
|
19
|
+
- If you changed `schema.prisma`, do not start testing or validation yet. Ask the user to run the following command in the affected worktree directory, replacing the placeholders, and wait for the user to reply exactly `continue` before resuming validation or tests:
|
|
20
|
+
```
|
|
21
|
+
cd <worktree path>
|
|
22
|
+
npx prisma migrate dev --config ./prisma.config.ts --name <migration name>
|
|
23
|
+
```
|
|
24
|
+
- If you encounter `runtime/provider-hook-outside-provider`, `runtime/client-only-hook-in-ssr`, `runtime/router-context-outside-router`, or `runtime/connected-boundary-mismatch`, treat it as a framework contract failure first. Fix the provider, SSR/client, router, or connected boundary before assuming a local leaf-component bug.
|
|
25
|
+
- If the change is runtime-visible, request-time, router, SSR, browser-visible, or controller-behavior, use running-app verification.
|
|
26
|
+
- If the change is docs-only, wording-only, type-only, test-only, generated-output cleanup, or a clearly local non-runtime refactor, use static verification only unless the user explicitly asks for runtime verification or the agent finds a real issue.
|
|
27
|
+
- If the user replies exactly `commit`, generate one top-level short (up to 100 characters) sentence covering all changes made since the last `commit` and, if there has been no prior `commit`, since the beginning of the whole conversation, strictly using the Conventional Commits specification:
|
|
28
|
+
```
|
|
29
|
+
<type>[optional scope]: <description>
|
|
30
|
+
|
|
31
|
+
[optional body]
|
|
32
|
+
```
|
|
33
|
+
Then use that generated message, stage the task-related changed files with `git add` while avoiding unrelated user changes or incidental untracked files, and create the commit by running `git commit`. Do not stop at only suggesting the message.
|
|
34
|
+
|
|
35
|
+
## Task Lifecycle
|
|
36
|
+
|
|
37
|
+
### Before Editing
|
|
38
|
+
|
|
39
|
+
- Before changing any file, load root-level `CODING_STYLE.md` and any narrower area `AGENTS.md` that applies to the touched files. Do not spend response space explicitly acknowledging those reads unless the user asks.
|
|
40
|
+
|
|
41
|
+
### During Implementation
|
|
42
|
+
|
|
43
|
+
- After running `npx proteum create ...`, adapt the generated code to the real feature instead of leaving placeholder logic in place.
|
|
44
|
+
- 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>`.
|
|
45
|
+
- 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.
|
|
46
|
+
- 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.
|
|
47
|
+
- For raw browser automation, use `npx proteum verify browser` when it matches the task, or direct Playwright with a disposable profile when lower-level control is required. Bootstrap protected browser state through `npx proteum session`.
|
|
48
|
+
- 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.
|
|
49
|
+
|
|
50
|
+
### Before Finishing
|
|
51
|
+
|
|
52
|
+
- 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.
|
|
53
|
+
- Do not default to project-wide typecheck, `npx proteum check`, or Playwright after every change. Run them only when the user asks for them, when the changed surface specifically requires them, or when a real issue discovered during verification justifies escalation.
|
|
54
|
+
- 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>`.
|
|
55
|
+
- When you have finished your work, ask the user whether they want a commit message.
|
|
56
|
+
|
|
57
|
+
## Core Contracts
|
|
58
|
+
|
|
59
|
+
- Client pages live in `client/pages/**` and register routes with top-level `Router.page(...)` or `Router.error(...)`.
|
|
60
|
+
- Page URLs come from the explicit `Router.page('/path', ...)` call, not from the file path.
|
|
61
|
+
- Callable app APIs live only in `server/controllers/**/*.ts` files that extend `Controller`.
|
|
62
|
+
- Dev-only internal execution lives only in `commands/**/*.ts` files that extend `Commands`.
|
|
63
|
+
- Manual HTTP endpoints live only in `server/routes/**`.
|
|
64
|
+
- Controllers call `this.input(schema)` inside the method body, at most once per method.
|
|
65
|
+
- Request-scoped state lives only on `this.request` and manual-route/router context objects.
|
|
66
|
+
- Keep one class or one React/Preact component per file.
|
|
67
|
+
- Prefer a deep tree grouped by business concern instead of long file names.
|
|
68
|
+
- Use the default `*.ts` or `*.tsx` file unless an `*.ssr.ts` or `*.ssr.tsx` variant is truly required.
|
|
69
|
+
- Never edit generated files under `.proteum`.
|
|
70
|
+
- When a task changes database structure, edit the app's `schema.prisma` only.
|
|
71
|
+
- Never create or edit migration files manually.
|
|
72
|
+
- Use `@generated/client/*`, `@generated/common/*`, and `@generated/server/*` for generated surfaces.
|
|
73
|
+
- Client context is typically imported from `@/client/context`.
|
|
74
|
+
- Normal service methods do not read request state directly.
|
|
75
|
+
- Do not import runtime values from `@models`.
|
|
76
|
+
- Do not use `@request` runtime globals.
|
|
77
|
+
- Do not use `@app` on the client.
|
|
78
|
+
- Prefer type inference rooted in the explicit application graph in `server/index.ts`.
|
|
79
|
+
|
|
80
|
+
## Surface Contracts
|
|
81
|
+
|
|
82
|
+
### App Bootstrap And Services
|
|
83
|
+
|
|
84
|
+
- `server/index.ts` default-exports the app `Application` subclass and is the canonical type root.
|
|
85
|
+
- Root services are public class fields instantiated with `new ServiceClass(this, config, this)`.
|
|
86
|
+
- Typed root-service config lives in `server/config/*.ts` via `Services.config(ServiceClass, { ... })`.
|
|
87
|
+
- Router plugins are instantiated explicitly inside the `Router` config `plugins` object.
|
|
88
|
+
- Root business services live in `server/services/<Feature>/index.ts`.
|
|
89
|
+
- Root-service config lives in `server/config/*.ts` when the service needs config.
|
|
90
|
+
- Business logic lives in classes that extend `Service` and use `this.services`, `this.models`, and `this.app`.
|
|
91
|
+
- Keep auth, input parsing, locale, cookies, and request-derived values in controllers, then pass explicit typed arguments into services.
|
|
92
|
+
- Split growing features into explicit subservices.
|
|
93
|
+
- Companion client-callable entrypoints live in `server/controllers/**`.
|
|
94
|
+
- `proteum create service ...` scaffolds the service file, a typed config export under `server/config/*.ts`, and the root registration in `server/index.ts`; review and adapt the generated names before committing.
|
|
95
|
+
|
|
96
|
+
### Connected Projects
|
|
97
|
+
|
|
98
|
+
- Declare connected namespaces in `proteum.config.ts` with explicit values such as `connect: { Product: { source: PRODUCT_CONNECTED_SOURCE, urlInternal: PRODUCT_URL_INTERNAL } }`.
|
|
99
|
+
- Proteum does not infer connected env key names from the namespace. The source and internal URL must be provided explicitly in `proteum.config.ts`.
|
|
100
|
+
- Use `npx proteum connect` to inspect configured connect values, cached contract state, and imported controllers for the current app.
|
|
101
|
+
- Before launching a consumer app that depends on local `file:` connected sources, launch every connected producer app too, assign each one a free port, run each `proteum dev` outside the sandbox with elevated permissions, and make sure `connect.<Namespace>.urlInternal` resolves to those live producer URLs.
|
|
102
|
+
- `file:` connected sources point at another Proteum app root and keep strong connected typings.
|
|
103
|
+
- Non-local connected sources provide runtime helper generation but are intentionally typed loosely.
|
|
104
|
+
|
|
105
|
+
### Controllers
|
|
106
|
+
|
|
107
|
+
- Files live under `server/controllers/**/*.ts` and default-export a class extending `Controller`.
|
|
108
|
+
- Methods with bodies become generated client-callable endpoints.
|
|
109
|
+
- Route path comes from the controller file path plus the method name.
|
|
110
|
+
- `export const controllerPath = 'Custom/path'` can override the base path.
|
|
111
|
+
- Generated client calls use `POST`.
|
|
112
|
+
- Prefer `proteum create controller ...` for new controller boilerplate, then adapt the generated method to real service calls.
|
|
113
|
+
|
|
114
|
+
### Commands
|
|
115
|
+
|
|
116
|
+
- Files live under `commands/**/*.ts` and default-export a class extending `Commands` from `@server/app/commands`.
|
|
117
|
+
- Methods with bodies become generated dev commands.
|
|
118
|
+
- Command path comes from the file path plus the method name.
|
|
119
|
+
- `export const commandPath = 'Custom/path'` can override the base path.
|
|
120
|
+
- Commands are for dev-only internal execution through `proteum command ...` or the profiler `Commands` tab.
|
|
121
|
+
- Keep command logic internal; do not turn it into a normal controller unless it is a real app API.
|
|
122
|
+
- Prefer `proteum create command ...` for new command boilerplate.
|
|
123
|
+
|
|
124
|
+
### Client Pages
|
|
125
|
+
|
|
126
|
+
- Proteum scans page files for top-level `Router.page(...)` and `Router.error(...)` calls.
|
|
127
|
+
- File path controls chunk identity and layout discovery; route path comes from the explicit `Router.page(...)` string.
|
|
128
|
+
- Supported page signatures are `Router.page(path, render)`, `Router.page(path, setup, render)`, `Router.page(path, options, render)`, and `Router.page(path, options, setup, render)`.
|
|
129
|
+
- For new work, prefer `Router.page(path, setup, render)` or `Router.page(path, options, setup, render)`.
|
|
130
|
+
- `setup` returns one flat object. Reserved keys like `_auth`, `_layout`, `_static`, and `_redirectLogged` are route options; all other keys are SSR data.
|
|
131
|
+
- Controller fetchers and promises returned from `setup` resolve before render.
|
|
132
|
+
- `render` consumes resolved setup data and uses generated controller methods from render args or `@/client/context`.
|
|
133
|
+
- Use `api.reload(...)` or `api.set(...)` only when intentionally mutating active page setup state.
|
|
134
|
+
- Error pages use `Router.error(code, options, render)` in `client/pages/_messages/**`.
|
|
135
|
+
- Prefer `proteum create page ...` for new page boilerplate, then review the explicit route path and setup payload.
|
|
136
|
+
|
|
137
|
+
### Manual Routes
|
|
138
|
+
|
|
139
|
+
- Use `server/routes/**` only for explicit HTTP behavior that should not be a generated controller action.
|
|
140
|
+
- Good fits include redirects, sitemap or RSS output, OAuth callbacks, webhooks, and public resources with custom semantics.
|
|
141
|
+
- Import server-side app services from `@app` and use route handler context for `request`, `response`, router plugins, and custom router context.
|
|
142
|
+
- If the route is a normal app API, prefer a controller.
|
|
143
|
+
- Prefer `proteum create route ...` for new manual-route boilerplate.
|
|
144
|
+
|
|
145
|
+
### Models And Aliases
|
|
146
|
+
|
|
147
|
+
- Use Prisma typings from `@models/types`.
|
|
148
|
+
- Use runtime models through `this.models` or `this.app.Models.client`.
|
|
149
|
+
- Keep Prisma runtime access inside services when possible and prefer explicit `select` or narrow `include`.
|
|
150
|
+
- Do not import runtime values from `@models` or edit generated Prisma client files.
|
|
151
|
+
- Aliases:
|
|
152
|
+
- `@/client/...`, `@/server/...`, `@/common/...`: app code
|
|
153
|
+
- `@client/...`, `@server/...`, `@common/...`: Proteum core modules
|
|
154
|
+
- `@app`: server-side application services for manual routes only
|
|
155
|
+
- `@generated/*`: generated app surfaces
|
|
156
|
+
|
|
157
|
+
## Verification Matrix
|
|
158
|
+
|
|
159
|
+
Verify at the correct layer:
|
|
160
|
+
|
|
161
|
+
- Default: use the cheapest trustworthy verification for the changed surface first, then escalate only if the changed surface justifies it.
|
|
162
|
+
- Route additions: boot the app and hit the real URL.
|
|
163
|
+
- Controller changes: exercise the generated client call or generated `/api/...` endpoint.
|
|
164
|
+
- SSR changes: load the real page and inspect rendered HTML plus browser console.
|
|
165
|
+
- Router or plugin changes: verify request context, auth, redirects, metrics, and validation on a running app.
|
|
166
|
+
- Generated, connected, or ownership-ambiguous changes: start with `npx proteum orient <query>` and prefer `npx proteum verify owner <query>` before broad global checks.
|
|
167
|
+
- Browser-visible issues: prefer `npx proteum verify browser <path>` or the narrowest targeted Playwright pass only after request-level verification is insufficient.
|
|
168
|
+
- Raw browser execution beyond `npx proteum verify browser`: use direct Playwright with a disposable profile, and keep that step for the final verifier agent unless a narrower surface cannot reproduce the issue.
|
|
169
|
+
- For trace-first reproduction, session-based auth setup, temporary logs, and post-fix surface checks, follow root-level `diagnostics.md`.
|
|
170
|
+
|
|
171
|
+
## Implementation Rules
|
|
172
|
+
|
|
173
|
+
### Dependency Selection
|
|
174
|
+
|
|
175
|
+
- Before implementing a feature or change, first check whether the repo already includes a suitable dependency.
|
|
176
|
+
- If not, search npm before building a new utility, abstraction, component primitive, parser, formatter, or integration from scratch.
|
|
177
|
+
- Prefer the most popular, flexible, maintained packages that fit the project constraints.
|
|
178
|
+
- When the task explicitly involves client-side optimization work, use root-level `optimizations.md` to decide whether custom infrastructure is justified over an existing package.
|
|
179
|
+
- When you choose custom over a package, explain the reason briefly.
|
|
180
|
+
|
|
181
|
+
### Catalogs And Typing
|
|
182
|
+
|
|
183
|
+
- Keep one canonical catalog or registry file and import it everywhere else.
|
|
184
|
+
- Client-only catalogs live in `/client/catalogs/**`, server-only catalogs in `/server/catalogs/**`, and shared catalogs in `/common/catalogs/**`.
|
|
185
|
+
- Do not create nested `catalogs/` folders under pages, components, services, tests, or other feature folders.
|
|
186
|
+
- Keep strong TypeScript typings across the project.
|
|
187
|
+
- Do not introduce `any` or `unknown`, including through casts, helper aliases, or fallback generic defaults.
|
|
188
|
+
- Fix typing issues only on code you wrote.
|
|
189
|
+
- Never cast with `as any` or `as unknown`; fix the contract or add an explicit typed adapter.
|
|
190
|
+
|
|
191
|
+
### Design Rules
|
|
192
|
+
|
|
193
|
+
- Prefer explicit `server/index.ts` bootstrap over hidden registration.
|
|
194
|
+
- Prefer controller-backed app APIs over ad hoc manual `/api/...` routes.
|
|
195
|
+
- Prefer service classes over server helpers with hidden dependencies.
|
|
196
|
+
- Keep one canonical source of truth for catalogs, registries, and shared types.
|
|
197
|
+
- Reuse shared Shadcn-based UI primitives when the project already provides them.
|
|
198
|
+
|
|
199
|
+
### Discouraged Patterns
|
|
200
|
+
|
|
201
|
+
- request-scoped state inside normal service methods
|
|
202
|
+
- hiding route registration behind abstractions that remove the top-level `Router.page(...)` call
|
|
203
|
+
- editing `.proteum` directly
|
|
204
|
+
|
|
205
|
+
## Hard Stops
|
|
206
|
+
|
|
207
|
+
- Never run schema-mutating SQL such as `ALTER TABLE`, `CREATE TABLE`, `DROP TABLE`, or `CREATE INDEX` to change database structure.
|
|
208
|
+
- Do not run `prisma *` yourself. If a schema change requires migration, ask the user to run `npx prisma migrate dev --config ./prisma.config.ts --name <migration name>` and wait for `continue`.
|
|
209
|
+
- Do not run `git restore` or `git reset`.
|
|
210
|
+
- Do not run write-mode git commands by default. The built-in exception is an exact `commit` reply, which allows only task-scoped `git add` and `git commit`. Any other write-mode git action requires an explicit user request.
|
|
211
|
+
|
|
212
|
+
## Appendix
|
|
213
|
+
|
|
214
|
+
### Project Shape
|
|
215
|
+
|
|
216
|
+
This is a TypeScript, Node.js, Preact, Proteum monolith:
|
|
217
|
+
|
|
218
|
+
- `/client`: assets, catalogs, components, hooks, pages
|
|
219
|
+
- `/common`: shared functions, constants, types, and catalogs
|
|
220
|
+
- `/server`: catalogs, config, services, routes, lib
|
|
221
|
+
- `/tests`
|
|
222
|
+
|
|
223
|
+
### Source Of Truth
|
|
224
|
+
|
|
225
|
+
Proteum reads:
|
|
226
|
+
|
|
227
|
+
- `package.json`
|
|
228
|
+
- `identity.config.ts` for app identity via `Application.identity({ ... })`
|
|
229
|
+
- `proteum.config.ts` for compiler setup via `Application.setup({ transpile, connect })`
|
|
230
|
+
- `process.env` via `PORT`, `ENV_*`, `URL`, `URL_INTERNAL`, any app-chosen connected-project values referenced by `proteum.config.ts`, and `TRACE_*`
|
|
231
|
+
- `server/config/*.ts`
|
|
232
|
+
- `server/index.ts`
|
|
233
|
+
- `commands/**/*.ts`
|
|
234
|
+
- `server/controllers/**/*.ts`
|
|
235
|
+
- `server/routes/**/*.ts`
|
|
236
|
+
- `client/pages/**/*.ts(x)`
|
|
237
|
+
- `client/pages/**/_layout/index.tsx`
|
|
238
|
+
- `public/**`
|
|
239
|
+
|
|
240
|
+
Proteum owns:
|
|
241
|
+
|
|
242
|
+
- `.proteum/manifest.json`
|
|
243
|
+
- `.proteum/client/*`
|
|
244
|
+
- `.proteum/common/*`
|
|
245
|
+
- `.proteum/server/*`
|
|
246
|
+
|
|
247
|
+
Project code should consume:
|
|
248
|
+
|
|
249
|
+
- `@generated/client/*`
|
|
250
|
+
- `@generated/common/*`
|
|
251
|
+
- `@generated/server/*`
|
|
252
|
+
- `@/client/context` as the generated client context entrypoint
|
|
253
|
+
|
|
254
|
+
### Useful Commands
|
|
255
|
+
|
|
256
|
+
Prefer structured CLI surfaces over re-deriving framework facts from source:
|
|
257
|
+
|
|
258
|
+
- `npx proteum connect --json`
|
|
259
|
+
- `npx proteum connect --controllers --strict`
|
|
260
|
+
- `npx proteum orient <query>`
|
|
261
|
+
- `npx proteum explain --json`
|
|
262
|
+
- `npx proteum explain --connected --controllers`
|
|
263
|
+
- `npx proteum explain owner <query>`
|
|
264
|
+
- `npx proteum doctor --json`
|
|
265
|
+
- `npx proteum doctor --contracts --json`
|
|
266
|
+
- `npx proteum diagnose <path> --port <port>`
|
|
267
|
+
- `npx proteum verify owner <query>`
|
|
268
|
+
- `npx proteum verify request <path>`
|
|
269
|
+
- `npx proteum verify browser <path>`
|
|
270
|
+
- `npx proteum perf ...`
|
|
271
|
+
- `npx proteum trace ...`
|
|
272
|
+
- `npx proteum command ...`
|
|
273
|
+
- `npx proteum session ...`
|
|
274
|
+
- `npx proteum create ... --dry-run --json`
|
|
275
|
+
- `npx proteum dev list --json`
|
|
276
|
+
- `npx proteum dev stop --session-file <path>`
|
|
277
|
+
|
|
278
|
+
Prefer scaffold commands before hand-writing boilerplate:
|
|
279
|
+
|
|
280
|
+
- `npx proteum init <directory> --name <name>`
|
|
281
|
+
- `npx proteum init ... --dry-run --json`
|
|
282
|
+
- `npx proteum create page|controller|command|route|service <target>`
|
|
283
|
+
- `npx proteum create ... --dry-run --json`
|
|
284
|
+
|
|
285
|
+
### High-Impact Files
|
|
286
|
+
|
|
287
|
+
Edit these only when required, and keep changes minimal and explicit:
|
|
288
|
+
|
|
289
|
+
- `tsconfig*.json`
|
|
290
|
+
- `PORT`, `ENV_*`, `URL`, and `TRACE_*` env setup
|
|
291
|
+
- Prisma-generated files
|
|
292
|
+
- symbolic links
|
|
@@ -5,8 +5,8 @@ Role: keep only manual-route rules here.
|
|
|
5
5
|
Keep here: explicit HTTP route guidance, public/crawlable endpoint rules, absolute URL generation, and route-specific catalog placement.
|
|
6
6
|
Do not put here: controller contracts, service-layer business logic, page SSR rules, or broad project workflow already defined elsewhere.
|
|
7
7
|
|
|
8
|
-
Optimization source of truth:
|
|
9
|
-
Diagnostics source of truth:
|
|
8
|
+
Optimization source of truth: root-level `optimizations.md`.
|
|
9
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
10
10
|
|
|
11
11
|
- Use `server/routes/**` only for explicit HTTP behavior that should not be generated from controllers.
|
|
12
12
|
- If the endpoint is a normal app API, prefer `server/controllers/**/*.ts`.
|
|
@@ -5,8 +5,8 @@ Role: keep only service-layer rules here.
|
|
|
5
5
|
Keep here: service placement, service responsibilities, model access, query-shaping, return-type guidance, and service error-handling rules.
|
|
6
6
|
Do not put here: request parsing, page/render rules, controller transport details, or broad project workflow already defined in higher-level AGENTS files.
|
|
7
7
|
|
|
8
|
-
Optimization source of truth:
|
|
9
|
-
Diagnostics source of truth:
|
|
8
|
+
Optimization source of truth: root-level `optimizations.md`.
|
|
9
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
10
10
|
|
|
11
11
|
## Placement
|
|
12
12
|
|
|
@@ -5,7 +5,7 @@ Role: keep only test-area rules here.
|
|
|
5
5
|
Keep here: runtime verification guidance, selector strategy, test-specific reuse rules, and authenticated test-flow expectations.
|
|
6
6
|
Do not put here: production implementation rules, page/service architecture contracts, or duplicated project workflow that belongs in broader AGENTS files.
|
|
7
7
|
|
|
8
|
-
Diagnostics source of truth:
|
|
8
|
+
Diagnostics source of truth: root-level `diagnostics.md`.
|
|
9
9
|
|
|
10
10
|
- Understand the real user flow and the main feature branches before writing tests.
|
|
11
11
|
- Test the current controller/page runtime model, not legacy `@Route` or `api.fetch(...)` behavior.
|