@mpfrontend/ai-skills 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +24 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -0
- package/dist/skills.d.ts +47 -0
- package/dist/skills.js +221 -0
- package/dist/skills.js.map +1 -0
- package/package.json +29 -3
- package/skills/mpfrontend-apply-access/SKILL.md +45 -0
- package/skills/mpfrontend-configure-i18n/SKILL.md +52 -0
- package/skills/mpfrontend-configure-theme/SKILL.md +48 -0
- package/skills/mpfrontend-form-from-api/SKILL.md +44 -0
- package/skills/mpfrontend-implement-feature/SKILL.md +61 -0
- package/skills/mpfrontend-import-design-system/SKILL.md +38 -0
- package/skills/mpfrontend-integrate-auth/SKILL.md +59 -0
- package/skills/mpfrontend-integrate-openapi/SKILL.md +61 -0
- package/skills/mpfrontend-integrate-realtime/SKILL.md +30 -0
- package/skills/mpfrontend-prepare-release/SKILL.md +51 -0
- package/skills/mpfrontend-reconcile-design-components/SKILL.md +33 -0
- package/skills/mpfrontend-review-design-drift/SKILL.md +32 -0
- package/skills/mpfrontend-scaffold-app/SKILL.md +68 -0
- package/skills/mpfrontend-sync-design-tokens/SKILL.md +35 -0
- package/skills/mpfrontend-table-from-api/SKILL.md +45 -0
- package/skills/mpfrontend-upgrade-project/SKILL.md +57 -0
- package/skills/mpfrontend-use-ui/SKILL.md +52 -0
- package/skills/mpfrontend-verify-frontend/SKILL.md +33 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-configure-i18n
|
|
3
|
+
description: Configure the MP Frontend locale registry (English ships; a product adds its own locales, left to right or right to left, or replaces English, in its own repository), product-owned translations, right-to-left behavior, locale-aware digits and the locale the BFF sends upstream. Not automatic backend content translation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Configure locales
|
|
7
|
+
|
|
8
|
+
Read the consumer's locale policy, instructions and installed `@mpfrontend/i18n` exports. MP Frontend
|
|
9
|
+
ships English (`en`, left to right) only; every other language is the product's and lives in the product's
|
|
10
|
+
repository. `createLocaleRegistry({locales, defaultLocale})` configures the app's own set: each entry names
|
|
11
|
+
its direction (`ltr` or `rtl`) and, optionally, a `numberingSystem` for Intl digits. The default locale is
|
|
12
|
+
configured per app and is `en` when unset; a product may register only its own locale and make it the
|
|
13
|
+
default, and a registry without `en` names its default. Direction always comes from the registry; never
|
|
14
|
+
derive it from a list of codes in feature code. `Locale` is a plain locale code and
|
|
15
|
+
`LocaleOf<typeof registry>` types one registry's codes. `locale`, `direction`, `translator`, `formatValue`,
|
|
16
|
+
`formatNumber`, `negotiateLocale` and MessageKey remain the public helpers; the built-in registry behind
|
|
17
|
+
`locale` and `direction` knows English only, so pass the app's registry.
|
|
18
|
+
|
|
19
|
+
Keep the app's registry in `src/config/app.ts`, with the shared preference cookie
|
|
20
|
+
(`createPreferenceCookie({name, locales, themes})`) that carries the language and theme for the first paint
|
|
21
|
+
and for the identity provider's `ui_locales`. Validate a persisted or requested locale with the
|
|
22
|
+
registry's `locale`; an unknown value is the default. Set document `lang` and `dir` together from the
|
|
23
|
+
registry, and use logical CSS start/end rather than left/right. Preserve the existing persistence and
|
|
24
|
+
avoid SSR/hydration disagreement. Changing locale must not reset auth, cart or an editing draft.
|
|
25
|
+
|
|
26
|
+
Upstream language is an allowlist in the Security BFF: `apiLocales: {supported, defaultLocale}`. The BFF
|
|
27
|
+
negotiates the browser's Accept-Language against it and sends only an allowlisted token, the default
|
|
28
|
+
otherwise; without configuration it sends only `en`. A product lists the locales its backends answer in,
|
|
29
|
+
which may exclude English. The login `ui_locales` allowlist (`supportedUiLocales`) is separate.
|
|
30
|
+
|
|
31
|
+
Write every visible text as a catalog message. The app-wide set is `src/i18n/messages/<locale>.ts` and each
|
|
32
|
+
feature has `model/messages/<locale>.ts`: the default locale's file uses `defineMessages` and defines the
|
|
33
|
+
keys and their parameters; every other locale is typed `Translation<typeof base>`. Build translators with
|
|
34
|
+
`createMessages` (core messages are a separate set the catalog may override). Use ICU MessageFormat with
|
|
35
|
+
named parameters, `plural` and `select`; never join a translated message to other text or a value. Run the
|
|
36
|
+
app's `catalog-check` target: it fails on a key missing in a locale, an unused key, a key that code uses
|
|
37
|
+
and the base does not define, or differing parameters. The base catalog defines every key its code uses;
|
|
38
|
+
the core messages are not a fallback for a key the base lacks.
|
|
39
|
+
A key missing in a locale falls back, key by key, to the default locale at run time, but the check still
|
|
40
|
+
fails on it. Translate the files that a generator reports as `untranslated`. To add a locale, register it
|
|
41
|
+
and add `messages/<code>.ts` to every set, listed in the set's `translations`; to replace English, rename
|
|
42
|
+
every base catalog to the product's locale and set each set's `defaultLocale`. A product whose default is
|
|
43
|
+
not English never sees the English core text, so its catalogs define every key they use. Numbers use the
|
|
44
|
+
locale's digits through Intl (`formatNumber`, `formatValue`); a `numberingSystem` in the registry
|
|
45
|
+
overrides them, and `formatValue` takes the product's `labels` for booleans. Preserve identifiers and
|
|
46
|
+
machine payload values; never translate free text that users wrote. Fonts with glyph coverage for the
|
|
47
|
+
product's scripts, and their licences, are product-owned.
|
|
48
|
+
|
|
49
|
+
Test supported and unknown locales, matching lang/dir, catalog key parity, digits and the forwarded
|
|
50
|
+
Accept-Language for a crafted header. In the browser verify locale switching and reload, right-to-left
|
|
51
|
+
forms, tables and logical layout, and mixed-direction identifiers. Run actual Nx gates uncached and report
|
|
52
|
+
exactly which locales and surfaces passed.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-configure-theme
|
|
3
|
+
description: Bind consumer-owned light and dark CSS tokens to the MP Frontend light/dark/system mode helpers. Not a Figma importer, token compiler or automatic design synchronization.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bind consumer themes
|
|
7
|
+
|
|
8
|
+
Read the consumer instructions, its reviewed DLS tokens and installed `@mpfrontend/tokens` exports.
|
|
9
|
+
Core offers `validBrand`, `validMode`, `appearance` and Mode; it ships no product brand registry or
|
|
10
|
+
token values. Put product CSS, fonts, icons and assets in the consumer theme package. Keep a reviewed
|
|
11
|
+
snapshot identity/provenance when tokens originate in Figma; never modify Figma through this workflow.
|
|
12
|
+
|
|
13
|
+
Inspect the workspace design-source contract. An attached source and binding govern generated token
|
|
14
|
+
ownership. Pending source state must be resolved before claiming DLS parity; `none` permits an authored
|
|
15
|
+
code-first theme but not a claim that it implements either a private or public design system.
|
|
16
|
+
|
|
17
|
+
Provide an explicit consumer brand allowlist/fallback to `validBrand`. Parse user mode through
|
|
18
|
+
`validMode`; resolve system preference with `appearance`. Apply resolved light/dark selectors and
|
|
19
|
+
semantic CSS variables consistently to document and components. Use the existing persistence and
|
|
20
|
+
SSR initialization paths; clean up media-query listeners and avoid hydration disagreement. Explicit
|
|
21
|
+
light/dark must not change with OS preference; system mode must. Theme switching must preserve
|
|
22
|
+
locale, identity and active drafts.
|
|
23
|
+
|
|
24
|
+
The theme (light, dark or system) and the language travel in one shared preference cookie
|
|
25
|
+
(`createPreferenceCookie` of `@mpfrontend/i18n`, value `lang=<locale>&theme=<theme>`), which the identity
|
|
26
|
+
provider's pages may read on a common parent domain. The app's server reads it for the first paint and sets
|
|
27
|
+
`data-mode`, `lang` and `dir` before any script runs, so the page does not flash; an invalid value is
|
|
28
|
+
ignored. The brand stays an app cookie. Never put an identity claim in that cookie.
|
|
29
|
+
|
|
30
|
+
Each app has one theme file, `src/theme/theme.css`, that the global stylesheet imports after the neutral
|
|
31
|
+
fallback of `@mpfrontend/tokens` and the component styles. Set token values there, scoped to a brand of
|
|
32
|
+
`src/theme/config.ts` (for example `:root[data-brand='product'] { --mp-surface-canvas: ... }`), or import
|
|
33
|
+
the generated `tokens.gen.css` of an attached design source from it. Raw colours are allowed only in the
|
|
34
|
+
theme layer; lint refuses them elsewhere. `config.ts` keeps the brand registry.
|
|
35
|
+
|
|
36
|
+
Map surface, text, border, focus, disabled and feedback colors from reviewed consumer tokens;
|
|
37
|
+
include the mp-* CSS-variable interface used by the actual UI exports. Do not substitute a product
|
|
38
|
+
palette into neutral core or hard-code a separate color in every component. Asset/font rights and
|
|
39
|
+
readable contrast remain consumer acceptance work. Missing or unresolved tokens need an explicit
|
|
40
|
+
reviewed mapping/fallback, not a claim of automatic design fidelity.
|
|
41
|
+
|
|
42
|
+
Test mode parsing, allowed/rejected brands and system-dark transitions. In the actual browser check
|
|
43
|
+
switching, reload, long text, focus/errors/disabled/loading states, tables/forms and right to left in both
|
|
44
|
+
themes. Inspect resolved styles/contrast when visual acceptance is required; save native screenshots
|
|
45
|
+
alongside interaction evidence. Run consumer lint/typecheck/test/build targets uncached.
|
|
46
|
+
|
|
47
|
+
Report observed modes/surfaces and remaining visual gaps. This procedure does not import Figma,
|
|
48
|
+
diff semantic revisions, advance a design baseline, publish packages or certify a complete DLS.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-form-from-api
|
|
3
|
+
description: Bind a scalar MP Frontend ResourceForm to an explicitly generated required JSON request, with authored defaults and protected submission. Not response-to-form inference, nested widgets or guarded PATCH generation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bind a selected request form
|
|
7
|
+
|
|
8
|
+
Read the consumer instructions, pinned package exports and approved operation first. A review does
|
|
9
|
+
not authorize a mutation. This finite workflow needs compatible FTG request generation; use
|
|
10
|
+
`mpfrontend skills list --json` and the installed `mpfrontend-integrate-openapi` procedure when the
|
|
11
|
+
request is not yet generated. Do not invent a mutation or turn response fields into editable inputs.
|
|
12
|
+
|
|
13
|
+
Inspect the generated `requests` metadata and `RequestModels` for the exact named operation. The
|
|
14
|
+
supported default ResourceForm fields are string, boolean, number and integer. Author defaults,
|
|
15
|
+
labels, domain constraints and the payload adapter outside generated output. Refuse object/array
|
|
16
|
+
fields rather than serialize them into scalar controls. Nullable, enum and optional-field UX needs
|
|
17
|
+
an explicit authored adapter; the generic scalar form is not a complete schema widget registry.
|
|
18
|
+
|
|
19
|
+
Use `ResourceForm` from `@mpfrontend/ui`, with the selected request's fields, controlled values,
|
|
20
|
+
localized saveLabel, labels, helpers, errors and onChange. A required JSON boolean can validly be false: do not
|
|
21
|
+
interpret it as mandatory consent. When the page has an access snapshot, pass `access={useAccess()}` from
|
|
22
|
+
`@mpfrontend/access-react` and the loaded values as `original`: a field the person may not view is not rendered
|
|
23
|
+
(its label, helper and error with it) and leaves validation and the submitted values, a field they may not edit is
|
|
24
|
+
disabled, and `onSubmit` receives only the changed fields they may edit (`dirtyPatch`); a changed field they may
|
|
25
|
+
not edit throws `FORBIDDEN_FIELD` instead of being sent. Field access comes from the server's snapshot only, never
|
|
26
|
+
from the schema, a role name or a guess. Keep busy disabled states, empty-form rejection, integer/decimal behavior
|
|
27
|
+
and errors accessible. Remount or clear the draft when authority or the edited resource changes. A remote refresh
|
|
28
|
+
must not silently overwrite an active editing draft.
|
|
29
|
+
|
|
30
|
+
Construct the declared body in an authored adapter, call generated `parseRequest` immediately before
|
|
31
|
+
submission, then retain the existing protected transport, CSRF, idempotency and authority fencing.
|
|
32
|
+
Validate at the server boundary too; never trust a browser-only guard. Backend business rules and
|
|
33
|
+
permissions remain authoritative. Handle actual 200/201/202 response contracts independently;
|
|
34
|
+
no fallback success, read-derived partial PUT, guessed PATCH or field-access inference.
|
|
35
|
+
|
|
36
|
+
Test the actual adapter with valid and rejected inputs, unknown/read-only fields, disabled and
|
|
37
|
+
empty forms, both boolean values and relevant domain limits, and with an access snapshot a hidden field, a
|
|
38
|
+
field without edit and a save that sends only the changed editable fields. Prove invalid input never reaches
|
|
39
|
+
the transport; remove that guard only in an isolated negative-control fixture and require the
|
|
40
|
+
real assertion to fail. Verify labels and focus/error behavior left to right and right to left, and light/dark.
|
|
41
|
+
Run the consumer's actual generation/check, lint, typecheck, test and build targets uncached.
|
|
42
|
+
|
|
43
|
+
Report the selected operation, observed tests and remaining widget/access/concurrency gaps.
|
|
44
|
+
No live write, deployment, publication or complete production-form acceptance is implied.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-implement-feature
|
|
3
|
+
description: Implement one approved MP Frontend feature slice across an existing consumer app, generated API boundary and UI, then verify its real states. Use only when story, contract, access and design decisions already exist.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implement an approved feature slice
|
|
7
|
+
|
|
8
|
+
Requires the reviewed MP Frontend CLI `1.0.0` cohort. Read repository instructions, the approved
|
|
9
|
+
story and acceptance criteria before editing. Stop when the API contract, permission, tenant rule,
|
|
10
|
+
business transition or DLS behavior is absent or contradictory; never invent it to complete a screen.
|
|
11
|
+
|
|
12
|
+
Map the slice before coding: route and entry point, approved OpenAPI operations, generated read/request
|
|
13
|
+
models, authored domain transformations, access decisions, visual states and the smallest affected Nx
|
|
14
|
+
projects. Keep route files thin. Product rules and presentation stay consumer-owned. Treat generated
|
|
15
|
+
FTG outputs and accepted design artifacts as read-only; change their declared source/configuration and
|
|
16
|
+
regenerate instead of hand-editing them.
|
|
17
|
+
|
|
18
|
+
Create the structure with the generators, not by hand: `pnpm exec mpfrontend create feature --app
|
|
19
|
+
<app-directory> --name <feature> [--resource <ftg-resource>] --dry-run --json`, then without `--dry-run`,
|
|
20
|
+
and `mpfrontend create route` for each screen (a detail view is a child route, for example
|
|
21
|
+
`<feature>/[position]`). A feature keeps the view in `ui/`, workflow state in `model/` and `hooks/`,
|
|
22
|
+
requests and persistence in `api/` and small pure helpers in `utils/`; code outside it imports only its
|
|
23
|
+
`index.ts`, which lint enforces. Types and rules that several features of one entity share go in
|
|
24
|
+
`src/entities/<entity>/`; code that two apps need goes in a package from `mpfrontend create package`.
|
|
25
|
+
Never invent a contract or an endpoint to fill a generated file; a screen feature stays unbound until
|
|
26
|
+
an approved contract adapter exists. Every visible text of the feature is a message in its
|
|
27
|
+
`model/messages/<locale>.ts` catalogs, with named parameters placed by each message; translate the
|
|
28
|
+
locales the generator reports as `untranslated`, and keep `catalog-check` and the `no-literal-text` lint
|
|
29
|
+
rule passing. A sensitive write sends an `Idempotency-Key`; when the BFF answers `STEP_UP_REQUIRED`, keep
|
|
30
|
+
the person's input, run the step-up and resubmit only a request whose `resubmit` is `idempotent`, with the
|
|
31
|
+
same key. Never replay a write without a key automatically. A feature that uploads or downloads a file
|
|
32
|
+
uses the app's transfer route (`/api/transfer/...`), which relays a streamed BFF route as streams: send
|
|
33
|
+
the file as the request body with its Content-Type and Content-Length, the CSRF token and, for a
|
|
34
|
+
sensitive write, an idempotency key; read a download as a stream; handle 411, 413, 415, 401, 502 and 504
|
|
35
|
+
as states of the slice. Never read a whole file into memory to send it, and never invent a route,
|
|
36
|
+
media type or size that the BFF's approved stream policy does not declare.
|
|
37
|
+
|
|
38
|
+
Use `mpfrontend-integrate-openapi`, `form-from-api` or `table-from-api` only for selected finite contract
|
|
39
|
+
shapes. Every new route gets one entry in the app's page manifest (`definePageManifest`) with the capability its
|
|
40
|
+
page and menu entry need and its elements and fields, and the manifest test (`assertPageManifest` with
|
|
41
|
+
`appRoutes`) stays green. Read and write server data in client components only through `@mpfrontend/data-react` (`useScopedQuery`,
|
|
42
|
+
`useScopedMutation`, under the app's `QueryScope`), through the app's own routes or the BFF; never retry a write
|
|
43
|
+
automatically and never add a global client store. Keep page, sort, filter and similar screen state in the URL with
|
|
44
|
+
`listUrlState` and `useTableUrlState`, never the scope or a personal value. A list over a backend declares its
|
|
45
|
+
paging, sorting and filtering as a `ListProtocol` checked against the contract. Present access from the server's
|
|
46
|
+
snapshot with `@mpfrontend/access-react`
|
|
47
|
+
(`AccessProvider`, `AccessGuard`, `AccessLink`, `useCapability`, `useFieldState`) as `mpfrontend-apply-access`
|
|
48
|
+
describes; never from a role name. Publish protected asynchronous results through `@mpfrontend/access-core`
|
|
49
|
+
`AuthorityFence` (`useAccessCapture()` inside a provider) and keep backend/BFF authorization authoritative. Compose `@mpfrontend/ui` primitives through the
|
|
50
|
+
consumer DLS adapter; do not copy sample branding into neutral code.
|
|
51
|
+
|
|
52
|
+
Implement loading, empty, success, validation, denied and recoverable error states required by the
|
|
53
|
+
criteria. Preserve unsaved input across safe retries and refuse stale identity/tenant/role-revision
|
|
54
|
+
results. Locale, theme, responsive and keyboard behavior are part of the slice when the approved
|
|
55
|
+
design includes them.
|
|
56
|
+
|
|
57
|
+
Run affected Nx `lint`, `typecheck`, `test`, `build`, `generated-check` and `design-verify` targets
|
|
58
|
+
uncached where defined. Exercise positive and negative API/access states and inspect the actual browser
|
|
59
|
+
surface at required viewports/locales/themes. Report exact commands and counts plus any unverified
|
|
60
|
+
criteria. Implementation does not authorize Git operations, deployment, publication, Figma writes,
|
|
61
|
+
role creation or acceptance-baseline changes.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-import-design-system
|
|
3
|
+
description: Import a supplied normalized local DLS export as an immutable MP Frontend candidate with source provenance and explicit consumer mappings. Does not change Figma or accept the candidate baseline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Import a declared design export
|
|
7
|
+
|
|
8
|
+
Requires MP Frontend CLI 1.0.0 or the reviewed compatible cohort. Read the consumer instructions,
|
|
9
|
+
installed CLI `DESIGN-SYNC.md`, approved source and its distribution limits. Check the actual
|
|
10
|
+
`mpfrontend --version`. The CLI consumes a finite normalized export; it does not capture Figma.
|
|
11
|
+
Prefer supplied local evidence. If another authorized read connector is available, follow that
|
|
12
|
+
connector's instructions; missing access is a prerequisite, not permission to invent source details.
|
|
13
|
+
|
|
14
|
+
Run `mpfrontend design status --directory <consumer> --json` before import. A pending `existing` source
|
|
15
|
+
needs the approved consumer binding attached with `design attach --source existing`. The consumer owns
|
|
16
|
+
the Figma/DLS, export, mapping and rights; no public release manifest is accepted in the MVP. A `none`
|
|
17
|
+
workspace may transition to `existing` only when the implementation request and supplied provenance
|
|
18
|
+
identify a real consumer-owned source. Do not attach merely to make import pass.
|
|
19
|
+
|
|
20
|
+
Preserve the raw export and digest in the consumer. Record file/node IDs, available source revision,
|
|
21
|
+
actual capture/extractor identity and the declared scope. Unknown revision stays null; unavailable
|
|
22
|
+
behavior stays unknown. Review any mode/collection/type projection. The current profile supports
|
|
23
|
+
light/dark scalar tokens and aliases, declared component variants/properties/behavior and asset
|
|
24
|
+
metadata. Unsupported expressions, extra modes or raw export shapes need an explicit adapter/review;
|
|
25
|
+
never silently erase them to pass validation. A token-only export is not the complete DLS.
|
|
26
|
+
|
|
27
|
+
Create a consumer-owned root binding from the documented schema: explicit source IDs to CSS names,
|
|
28
|
+
brand/mode selector, adapter/test paths and reasoned exclusions. Keep product assets, snapshots,
|
|
29
|
+
fonts and palettes out of neutral core. Unknown asset rights do not become cleared by Figma access.
|
|
30
|
+
|
|
31
|
+
Run `mpfrontend design import --binding <file> --snapshot <export> --dry-run --json`, inspect its
|
|
32
|
+
candidate hash/diagnostics, then import only within the requested implementation scope. Re-import
|
|
33
|
+
must preserve immutable bytes. Run validate and diff with that exact candidate; report unmapped
|
|
34
|
+
tokens, unknown behavior and unsupported cases. Do not apply or accept a baseline under an import-only
|
|
35
|
+
request. Never force over an authored collision or delete another writer's marker.
|
|
36
|
+
|
|
37
|
+
Report provenance, scope, actual commands and what remains unresolved. No Figma write, watcher,
|
|
38
|
+
deployment, package publication or actual agent-parity acceptance follows from an import.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-integrate-auth
|
|
3
|
+
description: Integrate an existing consumer with the MP Frontend server-side OIDC BFF, opaque cookie session and explicit route policy. Use for approved identity-provider settings, not for creating realms, users, roles or credentials.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Integrate server-side authentication
|
|
7
|
+
|
|
8
|
+
Requires the reviewed MP Frontend CLI `1.0.0` cohort and `@mpfrontend/security-bff`. Read the
|
|
9
|
+
consumer instructions and obtain approved issuer, client, callback/logout URLs, audiences, route policy,
|
|
10
|
+
cookie domain and supported UI locales. Missing provider metadata or secret ownership is a prerequisite,
|
|
11
|
+
not permission to create identity data.
|
|
12
|
+
|
|
13
|
+
Configure authorization code plus PKCE through the server BFF. Keep access, refresh and ID tokens on
|
|
14
|
+
the server; the browser receives only the bounded opaque `HttpOnly`, `Secure` production cookie. Apply
|
|
15
|
+
same-origin and CSRF controls to state-changing BFF routes, validate state/nonce/issuer/audience/time,
|
|
16
|
+
and use explicit route/method/role allowlists. Forward only an allowlisted locale through standard
|
|
17
|
+
`ui_locales`; the identity provider remains responsible for translating its own forms. Configure
|
|
18
|
+
`apiLocales: {supported, defaultLocale}` for the Accept-Language that the BFF sends upstream (English
|
|
19
|
+
only by default; a product lists the locales its backends answer in); the BFF negotiates the browser's header against it
|
|
20
|
+
and never forwards the header as given. Project only the claims the UI needs into `/context` with
|
|
21
|
+
`contextClaims` (an allowlist; ID token by default, refreshed ID token at refresh); never project a token,
|
|
22
|
+
never write a claim into a cookie and never treat a projected claim as authorization. Configure
|
|
23
|
+
`preferenceCookie` with the shared language and theme cookie so that login pages receive `ui_locales`.
|
|
24
|
+
|
|
25
|
+
Use the in-memory session store only for local development. Beyond developer machines configure the
|
|
26
|
+
production profile, `production: {sessionVault, clientAuthentication, secureCookies: true}`, with a Redis
|
|
27
|
+
vault over `rediss:` with host-supplied credentials and key ring; the package refuses any unmet condition
|
|
28
|
+
by name (`PRODUCTION_PROFILE_REFUSED:...`). Resolve the named condition in the deployment; never bypass a
|
|
29
|
+
refusal or describe the profile as a production HA claim. Each front end is the confidential client of its
|
|
30
|
+
issuer: configure `clientAuthentication` with `private_key_jwt` (the host's private key and key id, or a
|
|
31
|
+
function returning the current one for rotation) or `client_secret_basic`; a public client must be declared
|
|
32
|
+
with `publicClient: true`. Keep the key or secret in the host's secret store; never put it in a file of the
|
|
33
|
+
repository, a log or an error. Set the session policy for the product's risk: a
|
|
34
|
+
`__Host-` session cookie (default in production), `sameSite: 'Strict'`, an idle timeout (default 30
|
|
35
|
+
minutes) and an absolute lifetime within their bounds; never shorten a lifetime the product owner set, and
|
|
36
|
+
expect 401 on an idle or expired session and a rotated session cookie after a role change. When the provider
|
|
37
|
+
must end sessions at once (an account disabled, a provider logout), enable `backChannelLogout` and route
|
|
38
|
+
`POST /backchannel-logout` only from the provider's network path; register that URL as the client's
|
|
39
|
+
back-channel logout URL in the provider without changing provider configuration yourself. For
|
|
40
|
+
sensitive operations give the route `authentication: {maxAge}` (and `acr` only when the product defines
|
|
41
|
+
levels in `acrValues`); handle the typed `STEP_UP_REQUIRED` answer by sending the person to its `login`
|
|
42
|
+
path with an allowlisted `return_to`, and list every return path in `returnPaths`. For files that pass
|
|
43
|
+
between the browser and a backend, give the route a `stream` policy with the product's approved request
|
|
44
|
+
and response media types, maximum size, response headers, idle and total timeouts and session check
|
|
45
|
+
interval; nothing has a default, so ask for each value rather than inventing it. Relay it from the
|
|
46
|
+
presentation application with `createRelay` of `@mpfrontend/presentation-server/relay` (the template's
|
|
47
|
+
`/api/transfer/...` route) and set `BFF_SESSION_COOKIE` to the BFF's session cookie name. A streamed
|
|
48
|
+
upload declares Content-Length; never parse, inspect or log a streamed body or a file name in the
|
|
49
|
+
presentation application. Never log tokens, authorization codes, cookies, client secrets or personal data.
|
|
50
|
+
|
|
51
|
+
Add focused tests for login/callback, state replay, nonce/issuer/audience/expiry rejection, logout,
|
|
52
|
+
refresh rotation/outage, CSRF/origin rejection, locale propagation and absence of browser token
|
|
53
|
+
exposure; for a streamed route also 411, 413 and 415 before any upstream call, a refused response type,
|
|
54
|
+
the headers that cross, and a transfer ended by logout, timeout and cancellation. Verify an actual browser sign-in and return URL without collecting real credentials. Record
|
|
55
|
+
the approved cookie/session settings and remaining HA/TLS/key-rotation work.
|
|
56
|
+
|
|
57
|
+
Do not create or mutate Keycloak realms, clients, users, roles, resources or grants through this skill.
|
|
58
|
+
Do not replace an existing auth architecture, weaken production guards, deploy or publish without a
|
|
59
|
+
separate explicit request.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-integrate-openapi
|
|
3
|
+
description: Integrate approved local OpenAPI 3.1 responses or explicitly selected required JSON requests with FTG models and standalone validators, preserving authored overrides. Does not invent APIs, authorize writes or infer form transforms.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Integrate an explicit API contract
|
|
7
|
+
|
|
8
|
+
Requires MP Frontend CLI `1.0.0`. Read the consumer instructions and the named API owner's
|
|
9
|
+
contract before edits. An implementation request permits scoped integration; a review alone does not.
|
|
10
|
+
|
|
11
|
+
Establish the public presentation boundary: browser paths, server operation bindings, auth/roles,
|
|
12
|
+
errors and the fields intentionally exposed. A backend URL, response example or DTO is not an
|
|
13
|
+
approved browser contract. Preserve the internal/private boundary and any existing exposure policy.
|
|
14
|
+
Record upstream identity/digest and explicit projection differences; do not fabricate missing success
|
|
15
|
+
schemas. Ask the API owner to correct its OpenAPI or get a reviewed projection before proceeding.
|
|
16
|
+
|
|
17
|
+
The current generator supports finite OpenAPI 3.1 object/array read shapes, required versus nullable,
|
|
18
|
+
primitive enums and scalar dictionaries. It rejects recursive/unsupported composed types, meaningful
|
|
19
|
+
reference siblings and mixed fixed/dictionary signatures. Unsupported diagnostics are prerequisites,
|
|
20
|
+
not permission to erase constraints. Response fields are always non-editable; a response cannot
|
|
21
|
+
become a write contract merely because it lacks readOnly annotations.
|
|
22
|
+
|
|
23
|
+
Configure a local `ftg.config.json` with `openapi`, `output` and explicit `resources` selections
|
|
24
|
+
(`name`, `operationId`, optional `responsePath` and explicit `responseStatus` 200/201/202; default 200).
|
|
25
|
+
`responsePath` selects table fields; generated `ReadModels` and `parseRead` validate the **whole
|
|
26
|
+
selected JSON response**, not just the selected row. Do not relabel a 201/202 operation as 200.
|
|
27
|
+
Use a new/owned generated output location, retaining all authored overrides separately.
|
|
28
|
+
|
|
29
|
+
For an authorized input integration, select a separate `requests` entry by its exact `name` and
|
|
30
|
+
`operationId`. The current profile requires a mutation operation with a required application/json
|
|
31
|
+
object body and explicitly closed objects at every level. `RequestModels`, `requests` metadata and
|
|
32
|
+
`parseRequest` validate this declared body: read-only fields are excluded/forbidden, write-only
|
|
33
|
+
inputs are included, and unknown fields/constraints are not stripped or coerced. An open or optional
|
|
34
|
+
body requires a reviewed contract/profile decision, not a guessed allowlist. Form defaults, widgets,
|
|
35
|
+
read-to-form mappings and dirty-field transforms remain authored. A complete PUT body is not a
|
|
36
|
+
guarded partial update; do not infer PATCH, concurrency or field permissions from these types.
|
|
37
|
+
|
|
38
|
+
Check `pnpm exec mpfrontend --version`. Run `pnpm exec ftg generate --config <config> --dry-run
|
|
39
|
+
--json`, inspect the plan, then generate only within the requested implementation scope. Run
|
|
40
|
+
`pnpm exec ftg check --config <config> --json`. A lock/collision/drift failure needs inspection of
|
|
41
|
+
its actual owner; never delete a live writer marker or use force overwrite.
|
|
42
|
+
|
|
43
|
+
Use the exact pinned Ajv/ajv-formats runtime-helper dependencies from the compatible template.
|
|
44
|
+
Generation compiles standalone validators; do not compile schemas dynamically in the browser or
|
|
45
|
+
weaken CSP with unsafe-eval. Call generated `parseRead` before protected results reach state/rendering,
|
|
46
|
+
while keeping the consumer's authority/abort fence. Its generic error must not log response payloads.
|
|
47
|
+
|
|
48
|
+
Verify valid and malformed actual-contract responses, nullable/optional fields, required values,
|
|
49
|
+
extra/write-only fields, formats and numeric/string/array limits as applicable. No coercion, default
|
|
50
|
+
insertion, field stripping or business mutation may hide an invalid read. Prove drift failure in an
|
|
51
|
+
isolated fixture and show that regeneration preserves authored overrides. Run actual Nx targets
|
|
52
|
+
uncached; compare the FTG manifest hash with the immutable contract served to Swagger.
|
|
53
|
+
|
|
54
|
+
For selected requests, also prove rejection of read-only/unknown fields, malformed nested inputs,
|
|
55
|
+
and missing write-only required values without logging them. Validate before the existing protected
|
|
56
|
+
server mutation path; generated validation never replaces CSRF, identity, roles or backend enforcement.
|
|
57
|
+
Prove unknown resource/request names cannot invoke inherited validator-object properties.
|
|
58
|
+
|
|
59
|
+
Report observed commands, counts, contract identities and gaps. Format/source installation does not
|
|
60
|
+
prove Codex/Claude behavioral parity. Do not change Figma, publish, deploy or claim production-ready
|
|
61
|
+
authorization, HA or complete write-model acceptance from generated read models.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-integrate-realtime
|
|
3
|
+
description: Integrate an approved realtime event contract with MP Frontend ticket admission, bounded browser recovery and authority revision checks. Use only when topic/event ownership and snapshot semantics are already defined.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Integrate an approved realtime stream
|
|
7
|
+
|
|
8
|
+
Requires the reviewed MP Frontend CLI `1.0.0` cohort and `@mpfrontend/realtime-core`. Read the
|
|
9
|
+
consumer instructions plus the approved event/topic schema, ordering/idempotency rules, admission
|
|
10
|
+
policy and snapshot endpoint. Stop rather than inventing event names, replay guarantees or recovery
|
|
11
|
+
semantics.
|
|
12
|
+
|
|
13
|
+
Issue short-lived one-use admission tickets server-side. Never place service tokens, broker credentials
|
|
14
|
+
or durable session material in the browser. Configure `useRealtime` with bounded resources, the current
|
|
15
|
+
authority revision, required `onSnapshot` recovery and a generic `onUnavailable` state. Treat realtime
|
|
16
|
+
messages as invalidations or declared events; after gaps, reconnects or uncertainty, recover from the
|
|
17
|
+
authoritative snapshot before publishing state.
|
|
18
|
+
|
|
19
|
+
Bound reconnect delay, jitter, attempt/rate budgets and cancellation. Coalesce duplicate invalidations,
|
|
20
|
+
discard messages and snapshots from stale sockets/subjects/tenants/role revisions, and preserve safe
|
|
21
|
+
unsaved drafts during recovery. Do not claim durable replay, exactly-once delivery or production HA
|
|
22
|
+
unless the approved server contract and deployment evidence provide it.
|
|
23
|
+
|
|
24
|
+
Test ticket admission and replay refusal, reconnect/backoff, quota `429`, snapshot failure/hang,
|
|
25
|
+
duplicate/coalesced events, revocation, identity/tenant change, stale socket delivery and successful
|
|
26
|
+
recovery. Include a failing control for the admission floor or stale-authority property. Verify the
|
|
27
|
+
actual browser state through an interruption.
|
|
28
|
+
|
|
29
|
+
Report commands/counts, observed recovery evidence and remaining infrastructure gates. Do not create
|
|
30
|
+
broker topics, alter production quotas, deploy or publish through this skill.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-prepare-release
|
|
3
|
+
description: Prepare a bounded MP Frontend source and package cohort for release by proving clean-consumer installation, packed contents, API policy and reference gates, then hand the owner the release workflow's rehearsal. Stops before commit, tag, push, registry, deployment or Figma publication.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Prepare release evidence
|
|
7
|
+
|
|
8
|
+
Obtain the approved release scope, versions, package/repository names, license choice, distribution
|
|
9
|
+
rights and acceptance criteria. A missing license, private asset right or repository name is a blocker,
|
|
10
|
+
not a default for the agent to choose. Read all repository instructions and inspect existing changes;
|
|
11
|
+
do not absorb unrelated work into the candidate.
|
|
12
|
+
|
|
13
|
+
Verify source for credentials/private keys, personal/product-only data, private design-library links,
|
|
14
|
+
provenance gaps and undeclared local dependencies. Run frozen installation plus the actual Nx `lint`,
|
|
15
|
+
`typecheck`, `test` and `build` gates, generated/design drift checks and repository skill validation.
|
|
16
|
+
Pack the declared cohort and inspect every manifest, export, executable and file list. Packed manifests
|
|
17
|
+
must contain no `workspace:` or checkout-only dependency and each immutable version must identify one
|
|
18
|
+
content set.
|
|
19
|
+
|
|
20
|
+
Install the packed artifacts into a fresh independent consumer and exercise real CLI init, skill
|
|
21
|
+
install/check, scaffold, FTG generation/drift, security/realtime controls and consumer build. Exercise
|
|
22
|
+
both MVP design-source init contracts. Prove `none` remains usable and `existing` attaches a
|
|
23
|
+
consumer-owned binding without public-release metadata. Prove the deferred `mpfrontend` public-template
|
|
24
|
+
mode is rejected rather than advertised without a shipped Community DLS. Run the approved
|
|
25
|
+
reference applications' artifact verification, frozen install and full gates. Confirm a clean-clone
|
|
26
|
+
consumer has an obtainable dependency path; ignored local tarballs alone are not a public release
|
|
27
|
+
strategy. Keep advisory-service uploads opt-in and report them as not run when unauthorized.
|
|
28
|
+
|
|
29
|
+
MP Frontend releases one cohort version for every package: the version that the root `package.json` and every
|
|
30
|
+
package declare, with every framework pin (the app template, the Nx plugin's cohort, the AI procedures) equal to it;
|
|
31
|
+
`node tools/distribution/release.mjs guard --version <v> --ref <ref>` and its `self-test` prove this offline. A version
|
|
32
|
+
the registry already holds is never built again: a corrected build takes the next version, and a bad version is
|
|
33
|
+
deprecated, never unpublished. Check the API against the policy of README "Versioning" with `pnpm check` (the
|
|
34
|
+
`api-check` of every package's `api-report.json` and of the published archives that
|
|
35
|
+
`tools/distribution/api-baseline.json` names); from 1.0.0 a break needs a new major version and release notes that
|
|
36
|
+
say how to move. After a release, move the baseline to it in a commit of its own with `node
|
|
37
|
+
tools/distribution/api-report.mjs baseline --record <release.json>`. Run `pnpm exec nx run distribution:registry-install` for the scope binding and
|
|
38
|
+
the exact pins against throw-away local registries. The owner then runs the release workflow
|
|
39
|
+
(`.github/workflows/release.yml`) without `publish` as a rehearsal, and with it only on main, as
|
|
40
|
+
docs/RELEASE-GUIDE.md describes.
|
|
41
|
+
|
|
42
|
+
Produce the exact candidate file/package/version list, hashes, commands/counts, known limitations and
|
|
43
|
+
separately named production gates such as HA/TLS/load/accessibility/security review. For a protected
|
|
44
|
+
deployment, show that the Security BFF and the presentation server start with their production profiles
|
|
45
|
+
in the target environment and record any `PRODUCTION_PROFILE_REFUSED:` reason as an open gate. Do not convert POC
|
|
46
|
+
evidence into a production claim.
|
|
47
|
+
|
|
48
|
+
Stop before `git init`, commit, tag, push, pull request, registry upload, a run of the release workflow,
|
|
49
|
+
deployment, release creation, Figma write/publication or baseline acceptance. Never publish from a workstation,
|
|
50
|
+
create an npm token or organization, or change a trusted-publisher or environment setting. Show the owner what would
|
|
51
|
+
be published and obtain explicit authority for each external action.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-reconcile-design-components
|
|
3
|
+
description: Reconcile declared added, changed or removed DLS components with MP Frontend consumer adapters and tests using reviewed semantic plans. Not automatic React generation or business-rule inference from Figma.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reconcile authored component behavior
|
|
7
|
+
|
|
8
|
+
Requires the reviewed CLI 1.0.0 cohort, an attached design source and a normalized candidate with explicit interaction evidence.
|
|
9
|
+
Read consumer instructions, installed CLI `DESIGN-SYNC.md`, approved source, adapter bindings and
|
|
10
|
+
the actual public UI types. Use stable IDs for component identity; display renames do not justify
|
|
11
|
+
creating duplicates. Core currently exposes six finite components, not the whole supplied DLS.
|
|
12
|
+
Run `design status` before planning; source drift or a pending/disabled source blocks reconciliation.
|
|
13
|
+
|
|
14
|
+
Run validate/diff/plan for the exact candidate. Inspect variants, props, documented behavior and assets
|
|
15
|
+
alongside affected usages. Unknown mapped behavior or unmapped IDs needs a designer/developer decision.
|
|
16
|
+
Figma visual/prototype information does not define auth, monetary semantics, validation or API writes.
|
|
17
|
+
Do not infer those business rules. Scope authored tasks to the requested product; use neutral exports
|
|
18
|
+
and consumer-owned tokens/assets. A missing reusable core behavior needs its own neutral contract/test.
|
|
19
|
+
|
|
20
|
+
Review the plan before apply. Generated components.gen.json is metadata, never implementation.
|
|
21
|
+
Implement approved adapter/interaction changes and regression tests outside owned outputs. For removals,
|
|
22
|
+
keep reconciliation bindings until migrations/deprecations are reviewed; do not delete authored code or
|
|
23
|
+
extensions automatically. Inspect disabled/loading, pointer/keyboard, focus restoration, errors,
|
|
24
|
+
reduced motion and long text as applicable, left to right and right to left, and light/dark/system.
|
|
25
|
+
|
|
26
|
+
Run actual feature/Nx/visual checks and record current adapter/test hashes in genuine reviewed task
|
|
27
|
+
evidence. Unchanged mapped adapters still need matching verification. A CLI evidence digest is not
|
|
28
|
+
proof that claimed behavior works; no synthetic fixture attestation may stand in for these runs.
|
|
29
|
+
Missing/failed/unimplemented tasks prevent acceptance. Re-plan after source/binding/CLI/output drift.
|
|
30
|
+
Promote only when the user authorized acceptance and all required evidence/review passes, then check.
|
|
31
|
+
|
|
32
|
+
Report mapped scope and unresolved states explicitly. No automatic Figma change, protected business
|
|
33
|
+
mutation, deployment or npm/public release authority is included.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-review-design-drift
|
|
3
|
+
description: Review an MP Frontend declared design candidate or accepted baseline for semantic, output and evidence drift without applying changes or promoting a baseline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Review declared design drift
|
|
7
|
+
|
|
8
|
+
Requires the reviewed CLI 1.0.0 cohort. Read consumer instructions, installed CLI `DESIGN-SYNC.md`,
|
|
9
|
+
accepted source/binding and any supplied candidate's provenance. A review request is read-only:
|
|
10
|
+
do not import, persist a plan, apply tokens, edit Figma, run a live write or accept a baseline.
|
|
11
|
+
If the candidate is not imported, an explicit import implementation request is a prerequisite.
|
|
12
|
+
|
|
13
|
+
Begin with the read-only `mpfrontend design status --directory <consumer> --json`. Report disabled or
|
|
14
|
+
pending source state as such. For `existing`, source distribution and provenance remain consumer-owned;
|
|
15
|
+
binding drift is distinct from candidate/output drift. Do not attach, switch modes or repair files
|
|
16
|
+
during a review request.
|
|
17
|
+
|
|
18
|
+
Run `mpfrontend design check --binding <file> --json` for the accepted declared scope. With a named
|
|
19
|
+
candidate, run validate and diff; a plan dry-run can identify affected owned outputs/authored tasks
|
|
20
|
+
without writing state. Inspect stable IDs, removals/renames, alias/mode/type changes, component
|
|
21
|
+
variants/props/behavior, assets and compatibility severity. Check declared omissions separately:
|
|
22
|
+
a token-only export cannot prove that unspecified components are unchanged.
|
|
23
|
+
|
|
24
|
+
Distinguish source drift from generated-output edits, stale CLI/binding/plans, changed evidence,
|
|
25
|
+
unmapped IDs, unknown interaction/rights and another active writer. Baseline import/apply is not
|
|
26
|
+
acceptance, and accepted output hashes do not prove a whole design system's visual fidelity.
|
|
27
|
+
The CLI checks reviewed artifact identity/current files, not truthfulness of external test claims.
|
|
28
|
+
|
|
29
|
+
Report the exact source/candidate/CLI identity, observed diagnostics and affected authored paths.
|
|
30
|
+
Suggest scoped re-plan, migration, tests or designer review without silently repairing files. Preserve
|
|
31
|
+
custom code and a writer's marker; recovery needs inspection and separate authority. Visual/source
|
|
32
|
+
conflicts need explicit resolution, not a hidden palette edit. Publication remains a separate gate.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mpfrontend-scaffold-app
|
|
3
|
+
description: Create an independent MP Frontend Next.js app with the installed CLI and verify its Nx build and generated API boundaries. Does not initialize a production deployment or invent product configuration.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scaffold an app
|
|
7
|
+
|
|
8
|
+
Requires MP Frontend CLI `1.0.0` and the compatible packaged Nx plugin. Read the consumer's
|
|
9
|
+
repository instructions before changing files; this skill grants no release or external-write authority.
|
|
10
|
+
|
|
11
|
+
Obtain the app name, new destination and an approved local OpenAPI projection. Do not choose a
|
|
12
|
+
product DLS, identity provider, role catalog or backend endpoint. Confirm `pnpm exec mpfrontend
|
|
13
|
+
--version`; unsupported versions need a bounded upgrade decision, not guessed flags.
|
|
14
|
+
|
|
15
|
+
Run `pnpm exec mpfrontend create app --name <name> --directory <new-directory> --dry-run --json`.
|
|
16
|
+
Inspect the proposed paths and run without `--dry-run` only within the user's implementation request.
|
|
17
|
+
An existing destination is a collision; never remove it or use a force overwrite to make scaffolding pass.
|
|
18
|
+
|
|
19
|
+
For an existing pnpm/Nx workspace, preserve its configuration and register its app glob only if missing.
|
|
20
|
+
For an explicitly requested new product workspace, choose the design-source contract from evidence:
|
|
21
|
+
`existing` for any consumer-owned DLS or `none` for a code-first product. The MVP does not ship or
|
|
22
|
+
require a public Figma Community DLS. Do not silently default a known design-backed
|
|
23
|
+
product to another source. Use `mpfrontend init --name <workspace-name> --directory
|
|
24
|
+
<new-workspace-directory> --design-source <existing|none> --dry-run --json`, inspect its paths, then apply the command
|
|
25
|
+
without dry-run only within the implementation request. The destination must not exist; do not
|
|
26
|
+
remove/overwrite it on refusal. Init does not install packages or configure a protected runtime.
|
|
27
|
+
Never initialize Git, deploy, publish or access/write Figma merely because scaffolding was requested.
|
|
28
|
+
|
|
29
|
+
For `existing`, report the pending state until an approved consumer binding is attached. For `none`,
|
|
30
|
+
continue code-first without pretending design acceptance. `design status` verifies the
|
|
31
|
+
recorded choice but neither imports a snapshot nor approves a baseline.
|
|
32
|
+
|
|
33
|
+
Place the approved contract at the path named by the
|
|
34
|
+
generated `ftg.config.json`; never fabricate business fields. Install dependencies and validate a frozen
|
|
35
|
+
install, then run the app's actual Nx `build`, `typecheck` and `generated-check` targets uncached.
|
|
36
|
+
|
|
37
|
+
Create app writes one list route and one detail route over the catalog example, a `preferences`
|
|
38
|
+
feature, `.env.example` with variable names only and `docs/overview.md` and `docs/api-contracts.md`;
|
|
39
|
+
init writes `CODEOWNERS` with placeholder owners and `.agents/skills/README.md`, the guide for the
|
|
40
|
+
workspace's own `project-*` and `domain-*` skills. Report the placeholder owners as a follow-up for the
|
|
41
|
+
user; never fill in real owners or environment values yourself. Add features, routes and shared packages
|
|
42
|
+
with `mpfrontend create feature`, `create route` and `create package`; see the CLI guide for what each
|
|
43
|
+
writes and refuses.
|
|
44
|
+
|
|
45
|
+
The app frame comes from `@mpfrontend/app-layout` (skip link, header, navigation slot, page frame); the
|
|
46
|
+
template passes its own navigation items. `src/app/globals.css` holds only imports and base element
|
|
47
|
+
rules: Tailwind v4, the UI and shell sources, the neutral tokens, the component styles and, last, the app
|
|
48
|
+
theme file `src/theme/theme.css`. Apps created before the shell keep their own stylesheet; moving them
|
|
49
|
+
to the shell replaces their hand-written layout classes with the shell components and utility classes.
|
|
50
|
+
|
|
51
|
+
Init writes the quality profile: root `eslint.config.mjs` and `prettier.config.mjs` that re-export
|
|
52
|
+
`@mpfrontend/workspace-config`, a `check` script, `tools/ci/check.sh` and a GitHub Actions workflow that
|
|
53
|
+
runs it. Create app gives the app `format`, `format:check`, `lint` and `test` targets and an app
|
|
54
|
+
`eslint.config.mjs` that spreads the workspace profile. Run `pnpm check --skip-nx-cache` on the new
|
|
55
|
+
workspace; it runs the format check, lint, typecheck, test, build, generated-check and catalog-check. A
|
|
56
|
+
lint failure on
|
|
57
|
+
module boundaries, raw colours, hand-written CSS or a physical left or right is fixed in the code, never by
|
|
58
|
+
switching a rule off.
|
|
59
|
+
|
|
60
|
+
Inspect exports and imports: the new app must consume published/packed core packages and its own
|
|
61
|
+
authored code, not the platform source checkout or a sample-only Nx target. Preserve authored
|
|
62
|
+
overrides and demonstrate FTG regeneration/check. Report the commands and observed output; a
|
|
63
|
+
generated directory alone is not a working app. If consumer libraries export build outputs, keep their
|
|
64
|
+
Nx graph edges and the app build's explicit `^build` prerequisite; a project-level dependsOn array
|
|
65
|
+
replaces the root default. Verify from an isolated checkout without pre-existing library dist so a
|
|
66
|
+
local build cannot conceal incorrect task ordering. Declare library dist as an Nx output for restore.
|
|
67
|
+
Missing contract or workspace configuration is a
|
|
68
|
+
specific prerequisite, not permission to invent production infrastructure.
|