@mpfrontend/ai-skills 0.0.0-stage → 0.1.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.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: mpfrontend-sync-design-tokens
3
+ description: Plan and apply reviewed light/dark/system token updates from an MP Frontend normalized candidate while preserving authored styles and withholding baseline acceptance until evidence passes.
4
+ ---
5
+
6
+ # Synchronize declared consumer tokens
7
+
8
+ Requires the reviewed CLI 0.1.0 cohort, an attached design source and a supplied/imported candidate. Read consumer instructions,
9
+ installed CLI `DESIGN-SYNC.md`, source provenance and the current accepted binding. The installed
10
+ import procedure describes acquisition; no Figma write or automatic watcher is part of this workflow.
11
+ Run `design status` first and stop on pending, disabled or drifted source state; do not bypass source
12
+ binding verification by invoking lifecycle commands against an unrelated binding.
13
+
14
+ Validate the exact candidate and inspect semantic diff by stable IDs. Names are not new identities.
15
+ Check all declared light/dark values, alias resolution/types, explicit consumer CSS mappings, brand
16
+ scope and system mode. Unsupported/unmapped tokens, aliases, missing modes or license issues are
17
+ prerequisites, not permission to guess or silently strip declarations. Review removals/renames for
18
+ authored usage and compatibility; never delete a custom product extension automatically.
19
+
20
+ Run `mpfrontend design plan --binding <file> --candidate <hash> --dry-run --json`, then persist a plan
21
+ only within implementation scope. Review its output hashes, tasks, diagnostics and required checks.
22
+ Apply the reviewed exact path first with dry-run, then through `design apply --plan <path> --json`.
23
+ If binding/source/CLI/output hashes changed, re-plan and re-review; there is no force bypass. A busy
24
+ or interrupted writer requires inspecting its owner/state before recovery, never age-based deletion.
25
+
26
+ Wire only the owned generated CSS into consumer composition and keep fonts/icons/structural overrides
27
+ authored. Run actual typecheck/unit and light/dark/system, right to left, keyboard/focus and contrast
28
+ checks on affected screens. Do not change source palette/Figma to hide a contrast conflict; record
29
+ the source token and reviewed consumer mapping. Preserve identity/preferences/drafts during switching.
30
+
31
+ Supply genuine reviewed artifacts in the documented evidence schema. CLI verifies identities/digests
32
+ but does not execute the reported commands or judge visual quality. Component/asset/migration tasks
33
+ remain open until authored code/tests and review satisfy them. Applying tokens is not full-DLS
34
+ acceptance. Only a request authorizing promotion allows `design accept`; afterwards run design check.
35
+ Report declared scope/results/gaps, and keep publication and owner visual approval separate.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: mpfrontend-table-from-api
3
+ description: Render a validated MP Frontend read model with ResourceTable and consumer-owned labels, formatting and detail navigation, with paging, sorting and filtering declared from the contract. Does not infer mutations, backend parameters or field permissions.
4
+ ---
5
+
6
+ # Render a selected read model
7
+
8
+ Read the consumer instructions, approved operation and pinned public exports. Use the installed
9
+ `mpfrontend-integrate-openapi` procedure if no generated read exists. Inspect the selected
10
+ operation, responseStatus and responsePath: metadata selects columns, but `parseRead` validates the
11
+ whole response. Do not cast an unvalidated payload into table rows or convert response fields into
12
+ form inputs. Missing success schemas require API/projection review, not fabricated examples.
13
+
14
+ Place generated parsing before state/rendering while preserving the consumer's authority and abort
15
+ fences. Extract rows from the validated model in an authored adapter. Use `ResourceTable` from
16
+ `@mpfrontend/ui`, a caption, localized labels, a value formatter and stable domain row keys when
17
+ available. When the page has an access snapshot, pass `access={useAccess()}` from `@mpfrontend/access-react`: a
18
+ column whose field the person may not view is removed with its header. Field access comes from the server's
19
+ snapshot; do not derive permissions from fields or role names. Keep authorized detail navigation consumer-owned
20
+ and render a detail link with `AccessLink`, which renders nothing when denied. Untrusted text stays React text, not
21
+ injected HTML. Do not reveal sensitive columns merely because the API describes them.
22
+
23
+ Paging, sorting and filtering follow the documented conventions. Declare how the operation encodes them as a
24
+ `ListProtocol` of `@mpfrontend/ftg-core` in the entity of the resource (parameter names and encodings, where the
25
+ answer holds the rows and the total) and keep its test, `checkListProtocol` against the captured contract, green:
26
+ send only parameters the operation declares, never an invented one. Define the URL state with `listUrlState` of
27
+ `@mpfrontend/data-react/shared`; the server screen reads it for the first render and the client binds it with
28
+ `useTableUrlState`. Read pages with `useScopedQuery` through the app's own route, which reads the same URL state and
29
+ calls the server boundary with `listSearchParams`. Give `ResourceTable` a declared `mode`: `server` when the backend
30
+ pages, sorts or filters (it never does so itself), `client` only when the whole data set is in hand; never mix
31
+ them. Its control texts come from the feature's catalog. Never put the scope, a token, a secret or a personal value
32
+ in the URL. Implement loading, error and empty states; do not pretend the table is a virtualized grid. Keep
33
+ horizontal overflow inside the table, not the viewport, and use logical alignment for right to left. Refresh must
34
+ not overwrite an unrelated editing draft.
35
+
36
+ Test the actual response adapter with malformed data, status mismatch, nullable/optional values,
37
+ empty results, meaningful row-key/detail behavior and, with an access snapshot, a column the person may not view.
38
+ Test the protocol against the contract, a link and a refresh that restore the list, back and forward, an invalid URL
39
+ value that falls back to its default, and a change of access scope while a page is loading. Prove the parser runs before protected data
40
+ is published and that an isolated parser-removal control fails a real assertion. Check labels,
41
+ number/date formatting, loading/retry and keyboard detail access left to right and right to left, light/dark and
42
+ mobile widths. Run the actual generated-check and Nx gates uncached.
43
+
44
+ Report the selected contract, the list protocol, rows actually observed and unresolved grid/access features.
45
+ No API exposure, business write, deployment or publication is authorized by this procedure.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: mpfrontend-upgrade-project
3
+ description: Upgrade an existing MP Frontend consumer as one reviewed package/CLI/skills cohort with dry-run, regeneration and rollback evidence. Use for an authorized bounded upgrade, never for automatic major migrations.
4
+ ---
5
+
6
+ # Upgrade a consumer cohort
7
+
8
+ Read repository instructions and inventory exact installed package, lockfile, CLI, skills-lock and
9
+ accepted design-candidate versions. Review the target changelog/compatibility notes and define one
10
+ bounded compatible cohort. Do not mix independently convenient package versions or rebuild a published
11
+ version with different contents.
12
+
13
+ Every `@mpfrontend` package carries one cohort version; pin all of them, and the CLI, the Nx plugin and the
14
+ workspace configuration, at that exact version, never a range. Keep the scope bound to the public registry in
15
+ `.npmrc` (`@mpfrontend:registry=https://registry.npmjs.org/`), so that no other registry can serve it. After the
16
+ install, compare the lockfile's integrity of each package with the release record (`docs/releases/<version>.md`)
17
+ and run `npm audit signatures` for the registry signatures and provenance. Read the release notes first: while the
18
+ major version is 0 a minor version may break, and its notes say how to move; a patch never breaks. Offline, install
19
+ the release's archives through pnpm overrides and lock the SHA-256 of the release record.
20
+
21
+ Before mutation, record the current working-tree diff and runnable gates. Use `mpfrontend skills update
22
+ --dry-run --json`, FTG/design dry-runs and package-manager resolution output to expose planned changes.
23
+ An authored skill, generated-output or design collision is a stop condition; never force it away. Git
24
+ history is useful rollback evidence but this skill does not authorize commits, resets or checkout.
25
+
26
+ Update manifests and lockfile together. Regenerate only outputs whose approved source/configuration or
27
+ generator version requires it, then prove authored overrides remain intact. Run offline/frozen install
28
+ when the distribution supports it, affected Nx `lint`, `typecheck`, `test`, `build`,
29
+ `generated-check`/`design-verify`, skills check and a clean packed-consumer check appropriate to the
30
+ change. Compare artifact identities and browser-critical behavior before and after.
31
+
32
+ The quality profile is part of the cohort: `@mpfrontend/workspace-config` moves with the other
33
+ packages, and its rules change only by upgrading it. A workspace created before the profile adopts it as
34
+ a bounded upgrade: create a scratch workspace and app with the upgraded CLI outside the repository, copy
35
+ the root `eslint.config.mjs`, `prettier.config.mjs`, `.prettierignore`, `check` script,
36
+ `tools/ci/check.sh` and the pinned devDependencies, then give each project the `format`, `format:check`,
37
+ `lint` and `test` targets and an `eslint.config.mjs` that spreads the root profile. Run `pnpm format` as
38
+ its own formatting-only change, then fix every lint finding; do not widen allowed paths or switch a rule
39
+ off to pass.
40
+
41
+ A consumer of the previous cohort that used its built-in `ar` locale keeps it by adding it in its own
42
+ repository, since MP Frontend now ships English only: register `ar: { direction: 'rtl' }` in the app's
43
+ locale registry; keep or add `messages/ar.ts` in every catalog set, listed in each set's `translations`,
44
+ with text for every key the set uses (the core messages no longer hold it), and run `catalog-check`; in
45
+ the Security BFF set `apiLocales: { supported: ['en', 'ar'], defaultLocale: 'en' }` and add `ar` to
46
+ `supportedUiLocales` and `preferenceCookie.locales`. A BFF without `apiLocales` now sends the default
47
+ locale upstream. Pass the app's registry to `formatNumber` and `formatValue`. Follow the upgrade note of
48
+ the nx-plugin README; never put the product's text into MP Frontend.
49
+
50
+ If a gate fails, preserve diagnostics and restore only files owned by this upgrade when the user's
51
+ authorized rollback is unambiguous; never overwrite unrelated local work. Report old/new cohort,
52
+ changed files, exact evidence and known migration gaps.
53
+
54
+ No major upgrade, auth replacement, accepted design-baseline change, Git publication, package
55
+ publication or deployment is implied. Those require explicit decisions and authority.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: mpfrontend-use-ui
3
+ description: Compose the existing neutral MP Frontend components (Button, Field, Select, Card, ResourceTable, ResourceForm, Dialog, OneTimeCodeField, ConfirmWithCode, Tree) with consumer-owned DLS styling. Not a complete Figma component library or design-sync workflow.
4
+ ---
5
+
6
+ # Use the neutral component boundary
7
+
8
+ Read the consumer instructions and installed `@mpfrontend/ui` types before implementation. The
9
+ current public kit has Button, Field, Select, Card, ResourceTable, ResourceForm, Dialog,
10
+ OneTimeCodeField, ConfirmWithCode and Tree.
11
+ Use those exports rather than private package internals or copying core into the product. Read and
12
+ request forms have different metadata; route to the installed table/form procedures when applicable.
13
+
14
+ The kit owns semantic markup and supported interaction states; the consumer owns product names,
15
+ assets, fonts, icons, CSS/token values and composed screens. Existing mp-* classes and variable-based
16
+ Tailwind hooks are styling interfaces, not evidence of a complete unstyled/headless widget system.
17
+ Do not add a product's brand/token registry to neutral core. Verify local font/asset rights before
18
+ public redistribution; missing proprietary fonts may use a licensed consumer fallback.
19
+
20
+ Use accessible labels and native semantics. Preserve Button loading/restricted/disabled states;
21
+ Field helper/error associations; Select's logical icon placement; and table captions/column scopes.
22
+ Set product-specific loading/error copy explicitly. Inspect actual types before assuming unsupported
23
+ slots, variants, modal behavior, widget registration or controlled-null semantics.
24
+
25
+ Verify real keyboard interaction, focus visibility, disabled submissions, error announcements,
26
+ long text and mobile overflow. Exercise left to right and right to left with logical spacing and light/dark tokens.
27
+ For API controls prove the consumer adapters and request/read guards, not only static rendering.
28
+ Run relevant UI and consumer lint/typecheck/test/build targets; save native browser evidence when
29
+ visual acceptance is required. A screenshot alone does not prove interaction or accessibility.
30
+
31
+ Frame every app with `@mpfrontend/app-layout`: `AppFrame` (skip link and focusable `main`), `AppHeader`
32
+ (brand, navigation slot, actions slot), `Navigation` and `PageFrame` (a section labelled by its title,
33
+ with an actions slot). Pass only the navigation items that the server allows; the shell decides nothing
34
+ about access, and every text is a prop. Import `@mpfrontend/ui/tailwind.css` and
35
+ `@mpfrontend/app-layout/tailwind.css` from the app's global stylesheet so that Tailwind v4 compiles the
36
+ structural classes, and verify a built rule such as `p-6` of Card. Take spacing and layout from the
37
+ components and utility classes; never add a layout stylesheet, a class rule to the global entry or a raw
38
+ colour, which the shared lint rules refuse.
39
+
40
+ For a sensitive action confirmed by a code sent to the person, use `ConfirmWithCode` (built on `Dialog` and
41
+ `OneTimeCodeField`): its `onConfirm` posts the code through the BFF with the CSRF token and an idempotency
42
+ key, and the server alone checks it. Never check a code in the browser, keep it in storage or put it in a
43
+ URL. Pass every label from the catalog; verify Tab, Shift+Tab, Escape and focus return in both directions.
44
+
45
+ For a hierarchy (menus and the elements under them, for example), use the controlled `Tree`, with
46
+ `columns` for a tree table. Keep `expanded` and the node states in the feature's state; write the state
47
+ rule (including any change over the current children) in the feature model and call it from
48
+ `onActivate`. The tree decides no access; the server's projection decides which nodes and states exist.
49
+
50
+ If a missing reusable component is requested, record its neutral behavioral contract and test it
51
+ before extending core; do not label an invented component as a verified Figma implementation.
52
+ Never alter Figma, publish a package or perform a live business mutation without that authority.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: mpfrontend-verify-frontend
3
+ description: Verify a bounded MP Frontend consumer change using existing Nx and FTG checks plus actual browser evidence. Report readiness gaps without treating a review as authority to fix, deploy or publish.
4
+ ---
5
+
6
+ # Verify a bounded change
7
+
8
+ Requires MP Frontend CLI `0.1.0`. Read the consumer's instructions, changed-file scope and
9
+ acceptance criteria. A review/diagnosis is read-only apart from normal diagnostic build/test artifacts;
10
+ fixes, restarts, business writes and release actions require the corresponding user request.
11
+
12
+ Check `pnpm exec mpfrontend --version` and `pnpm exec mpfrontend skills check --json`.
13
+ Find the actual Nx targets in `project.json`/workspace configuration; do not report success when Nx
14
+ says no tasks ran. Run the affected `format:check`, `lint`, `typecheck`, `test`, `build` and
15
+ `generated-check` targets uncached where defined, then `pnpm check --skip-nx-cache`. Lint carries the
16
+ shared quality profile: module boundaries, no raw colour outside the theme files, no hand-written CSS
17
+ outside the theme layer and logical properties instead of physical left and right. Report a rule switched off, an `eslint-disable` without a reason or a widened
18
+ allowed path as a finding, not as a pass. Verify frozen dependencies, consumer-authored override preservation and
19
+ the OpenAPI hash consumed by FTG/Swagger. Missing tests are a gap, not a passing test count.
20
+
21
+ For UI/API changes, verify the actual deployed surface, response status and failure state. Use the
22
+ available browser capability for the required locale/theme/viewport/keyboard states; unavailable
23
+ browser evidence stays unverified. Never substitute mock data for a failing real API without labeling
24
+ an explicitly approved demo mode. Use synthetic local identities only for authorized test journeys;
25
+ do not collect real credentials or real payment/location data.
26
+
27
+ For protected changes assess server authorization, CSRF/origin checks, stale authority, data projection,
28
+ session/store outage and realtime recovery as relevant. UI visibility is not an authorization boundary.
29
+ Record a failing control for the safety property being tested. Preserve unsaved drafts in recovery.
30
+
31
+ Report exact commands/counts, observed browser/API evidence and remaining acceptance gates.
32
+ Passing a build does not establish production HA, security, full journey acceptance or distribution
33
+ rights. Preparation and review never authorize GitHub/npm publication.