Skip to content

Commit 24be698

Browse files
JasonVMoCopilot
andauthored
Pivot agentic component specs and align implementations (#4296)
* component spec updates * component fixes and shared concepts * fix framework-base shared loop platform resolution Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix agentic tests after theme merge Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4157768 commit 24be698

282 files changed

Lines changed: 11368 additions & 12313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@fluentui-react-native/components": minor
3+
"@fluentui-react-native/framework-base": minor
4+
---
5+
6+
Add TabList group coordination, shared focus-modality and animation hooks, and align component behavior with the ratified React Native contracts.

.github/skills/agentic-component-authoring/SKILL.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,46 @@ authoring rule in one always-loaded instruction file.
2525

2626
## Load focused references
2727

28-
| Work | Reference |
29-
| ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
30-
| Public props, slots, state types, native prop exposure, or exports | [Types and slots](references/types-and-slots.md) |
31-
| Defaults, derived state, interaction hooks, accessibility, or slot construction | [State and accessibility](references/state-and-accessibility.md) |
32-
| Tokens, style factories, theme caching, state precedence, or slot style application | [Styles and tokens](references/styles-and-tokens.md) |
33-
| Pure slot rendering, component assembly, or display names | [Rendering and assembly](references/rendering.md) |
34-
| Runtime tests, type tests, snapshots, Storybook stories, or validation | [Tests and stories](references/tests-and-stories.md) |
35-
| Native React Native Windows Fabric components, codegen, registration, or UIA | [Windows Fabric native components](references/windows-fabric-native-components.md) |
36-
| Cross-component duplication, shared helper extraction, or dependency hygiene | [Package optimization](../agentic-component-optimization/SKILL.md) |
28+
| Work | Reference |
29+
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
30+
| Flex component source resolution, React Native contract adaptation, provenance, or divergences | [Flex source adaptation](references/spec-source-adaptation.md) |
31+
| Public props, slots, state types, native prop exposure, or exports | [Types and slots](references/types-and-slots.md) |
32+
| Defaults, derived state, interaction hooks, accessibility, or slot construction | [State and accessibility](references/state-and-accessibility.md) |
33+
| Tokens, style factories, theme caching, state precedence, or slot style application | [Styles and tokens](references/styles-and-tokens.md) |
34+
| Pure slot rendering, component assembly, or display names | [Rendering and assembly](references/rendering.md) |
35+
| Runtime tests, type tests, snapshots, Storybook stories, or validation | [Tests and stories](references/tests-and-stories.md) |
36+
| Native React Native Windows Fabric components, codegen, registration, or UIA | [Windows Fabric native components](references/windows-fabric-native-components.md) |
37+
| Cross-component duplication, shared helper extraction, or dependency hygiene | [Package optimization](../agentic-component-optimization/SKILL.md) |
3738

3839
A new higher-order component normally needs every reference. A focused fix should load only the affected reference and
3940
its immediate neighbors. Keep the component's colocated `SPEC.md` and companion files authoritative for its contract.
4041

4142
## Workflow
4243

43-
1. Read the repository and package instructions, the component `SPEC.md`, and every companion file referenced by the
44-
spec. Use the package-wide optimization guidance only when the change clearly involves repeated patterns or shared
45-
dependency boundaries.
46-
2. Inspect the closest canonical implementation. Use
44+
1. For a higher-order component, start Agency with the repository's
45+
`flex-authoring` profile, invoke `flex-components:<name>`, and follow the
46+
[Flex source adaptation](references/spec-source-adaptation.md) reference.
47+
Record source identities without copying source bodies.
48+
2. Read the repository and package instructions, the component `SPEC.md`,
49+
`spec/source.json`, and every React Native companion referenced by the
50+
spec. For a new component, draft and review those local contract files
51+
before implementation. Use the package-wide optimization guidance only when
52+
the change clearly involves repeated patterns or shared dependency
53+
boundaries.
54+
3. Inspect the closest canonical implementation. Use
4755
[`components/button`](../../../packages/agentic/components/src/components/button) for a styled higher-order component
4856
and [`primitives/icon`](../../../packages/agentic/components/src/primitives/icon) for a direct primitive.
49-
3. Establish the public contract before implementation: variants, slots, native props, accessibility, interaction
57+
4. Establish the public contract before implementation: variants, slots, native props, accessibility, interaction
5058
states, and platform behavior.
51-
4. Implement in dependency order: types and slots, state and accessibility, styles and slot props, pure rendering,
59+
5. Implement in dependency order: types and slots, state and accessibility, styles and slot props, pure rendering,
5260
component assembly, and explicit exports.
53-
5. Preserve the specification. Record a genuine token or platform gap rather than substituting an unrelated value or
61+
6. Preserve the specification. Record a genuine token or platform gap rather than substituting an unrelated value or
5462
web-only behavior.
55-
6. Add focused tests and stories that exercise the public API and the resolved native output.
56-
7. Run the smallest declared validation command while iterating. Finish with package format, lint, build, and tests; run
63+
7. Add focused tests and stories that exercise the public API and the resolved native output.
64+
8. Reconcile and ratify the local contract against the realized public types,
65+
tests, stories, and platform evidence. Upstream changes require explicit
66+
re-review and never overwrite the local contract.
67+
9. Run the smallest declared validation command while iterating. Finish with package format, lint, build, and tests; run
5768
the Storybook bundle for story changes and the root build when public types, manifests, or project references change.
5869

5970
Do not divide one component implementation into separate sub-agent or sub-skill phases. Its types, state, styling, and
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Flex source adaptation
2+
3+
Use this reference when creating or revising a higher-order component contract.
4+
Flex skills provide design evidence; local React Native documents define FURN
5+
behavior.
6+
7+
## Resolve one immutable source set
8+
9+
Start Agency with the repository's `flex-authoring` profile and invoke
10+
`flex-components:<name>`. Confirm that `flex-components`, `flex-system`, and
11+
`flex-tokens` resolve to the release in
12+
`packages/agentic/components/spec-source-lock.json`.
13+
14+
Read the component's shared skill and usage material plus its web companions.
15+
Read mobile companions only when that component provides them. A platform never
16+
falls back to another platform's files, and files from different revisions must
17+
not be combined.
18+
19+
Do not copy source prose or token tables into the public repository. Record
20+
only identifiers and digests in `spec/source.json`.
21+
22+
## Draft the React Native contract
23+
24+
Before implementation, classify every relevant axis, slot, behavior, and token
25+
along two dimensions:
26+
27+
1. Source surface: shared, web, mobile, Flex system, or an existing FURN
28+
implementation.
29+
2. Disposition: adopted, adapted, intentional divergence, not applicable, or
30+
deferred.
31+
32+
Consult the local Flex token map and the closest Win32, macOS, or Windows V1
33+
implementation. Do not use iOS as the desktop compatibility reference.
34+
35+
Write an original local contract:
36+
37+
- public props, slots, defaults, and state ownership in `SPEC.md`;
38+
- actual FURN token bindings in `spec/tokens.yaml`;
39+
- React Native accessibility and UIA/AX behavior in
40+
`spec/accessibility.md`;
41+
- keyboard, pointer, focus, and motion behavior in `spec/interaction.md`;
42+
- FURN usage and examples in `spec/usage.md`.
43+
44+
Give contract requirements stable IDs and map each one to existing or planned
45+
types, tests, stories, or platform evidence in the Conformance table. Record
46+
every divergence in `SPEC.md` with a stable ID, disposition, rationale, status,
47+
and issue when follow-up work is required.
48+
49+
Translate platform concepts deliberately:
50+
51+
| Flex evidence | React Native contract |
52+
| ------------------------------------ | ---------------------------------------------------------------------------------- |
53+
| ARIA attributes or native elements | `accessibilityRole`, `accessibilityState`, labels, and UIA/AX expectations |
54+
| CSS pseudo-classes | explicit interaction state and precedence |
55+
| browser focus selectors and outlines | persistent `FocusVisual`; never conditional `outline*` or native RNW focus visuals |
56+
| CSS pixel or layout rules | React Native layout units, minimum targets, and platform behavior |
57+
| unsupported browser capability | explicit divergence, dependency, or blocker |
58+
59+
Review the draft contract before writing code.
60+
61+
Use `contract-draft` with `review-required` while authoring. A pre-code review
62+
moves the lifecycle to `contract-reviewed`, records only the source surfaces
63+
the reviewer actually consulted, and adds the review date. Planned evidence
64+
paths may remain unrealized at this stage.
65+
66+
## Implement and ratify
67+
68+
Implement the component through the normal types, state, styles, render, and
69+
assembly stages. Derive tests and stories from the requirement IDs. After
70+
validation, reconcile the draft against the realized public types and native
71+
output. Change the contract only through an explicit review; do not make an
72+
accidental implementation choice authoritative after the fact.
73+
74+
Generating or repinning `spec/source.json` requires access to the private
75+
Marketplace and x3 repositories. Set lifecycle to `implemented` and
76+
conformance to `reviewed` only when the contract, implementation, and declared
77+
evidence agree. Updating
78+
the immutable source lock or its recorded file identities clears that review
79+
until each delta is adopted, adapted, rejected, or deferred. Drift at mutable
80+
Marketplace or x3 HEAD is a candidate proposal and does not invalidate a
81+
contract ratified against the pinned release.

agency.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[profiles.flex-authoring]
2+
3+
[[profiles.flex-authoring.plugins.default]]
4+
plugin = "market:flex-components@curated#206c4996205b027f4d806ac4ac7366f1f0ab0d5a"
5+
cache_policy = "no-refresh"
6+
7+
[[profiles.flex-authoring.plugins.default]]
8+
plugin = "market:flex-system@curated#206c4996205b027f4d806ac4ac7366f1f0ab0d5a"
9+
cache_policy = "no-refresh"
10+
11+
[[profiles.flex-authoring.plugins.default]]
12+
plugin = "market:flex-tokens@curated#206c4996205b027f4d806ac4ac7366f1f0ab0d5a"
13+
cache_policy = "no-refresh"

lage.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const config = {
1212
clean: {
1313
cache: false,
1414
},
15+
'check:spec-contracts': {
16+
cache: false,
17+
},
1518
lint: {
1619
inputs: ['*', 'src/**/*'],
1720
outputs: [],
@@ -22,7 +25,7 @@ const config = {
2225
// which doesn't exist, so lage silently drops the edge. Point at the
2326
// specific root target with the packageName#task syntax so every
2427
// package's tests wait for the whole-repo build to finish.
25-
dependsOn: ['@fluentui-react-native/root#root-build'],
28+
dependsOn: ['@fluentui-react-native/root#root-build', 'check:spec-contracts'],
2629
inputs: [],
2730
outputs: [],
2831
},

packages/agentic/components/AGENTS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ invariants; detailed authoring recipes live in the
1919

2020
## Package invariants
2121

22-
- Read the component `SPEC.md` and all referenced companions before changing its contract.
22+
- For a higher-order component contract, start Agency with the
23+
`flex-authoring` profile, invoke `flex-components:<name>`, and follow the
24+
[Flex source adaptation reference](../../../.github/skills/agentic-component-authoring/references/spec-source-adaptation.md).
25+
- Follow [SPEC-SOURCE.md](./SPEC-SOURCE.md) for provenance fields, contract
26+
lifecycle, review state, and drift commands.
27+
- Read the component `SPEC.md`, `spec/source.json`, and all referenced React
28+
Native companions before changing its contract.
2329
- Use `src/components/button` as the canonical higher-order implementation and `src/primitives/icon` as the canonical
2430
primitive.
2531
- Keep public props and slots small, typed, and spec-driven.
@@ -30,3 +36,6 @@ invariants; detailed authoring recipes live in the
3036
behind variables, spreads, functions, or computed values.
3137
- Use package scripts for format, lint, build, tests, and snapshots.
3238
- Do not copy web-only APIs, CSS behavior, or DOM assumptions into React Native.
39+
- Do not copy or mechanically transform private Flex skill bodies into this
40+
public package. Record source identifiers and digests, then author the local
41+
React Native contract.

0 commit comments

Comments
 (0)