agentleFS
MicrosoftKnown publishermicrosoft/fluentui-react-native/packages/framework-base/AGENTS.md

fluentui-react-native / framework-base

AGENTS.md1.4k starsChanged 6 months agoMITView on GitHub

These instructions apply to packages/framework-base and its descendants. Read src/component-patterns/README.md before adding or changing a component pattern. - Use directComponent only for hook-free prop and render transformations. - Use phasedComponent when hooks, context, state, tokens, or slots are needed. - Create slots in the first phase and return a hook-free directComponent for the final render when practical. - Use a normal React component when a distinct React boundary is intentional. - Do not add new uses of legacyDirectComponent or stagedComponent.

Trending

Quiet since March.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/fluentui-react-native repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/fluentui-react-native

The biggest 5 of 24 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 24

Talked about on GitHub and Bluesky (24 times).

On GitHub · 23

18 more on GitHub

On Bluesky · 1

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use directComponent only for hook-free prop and render transformations.

    line 10
  2. Very specific:

    Use phasedComponent when hooks, context, state, tokens, or slots are needed.

    line 11
  3. Very specific:

    Create slots in the first phase and return a hook-free directComponent for the final render when practical.

    line 12
  4. Distinctive:

    Use a normal React component when a distinct React boundary is intentional.

    line 14
  5. Very specific:

    Do not add new uses of legacyDirectComponent or stagedComponent.

    line 15
  6. Very specific:

    Put / @jsxImportSource @fluentui-react-native/framework-base */ on the first line of component files using these patterns.

    line 19
  7. Distinctive:

    Keep children in props for modern direct and phased render functions.

    line 21
  8. Very specific:

    Never call hooks from a directComponent or from the render phase returned by phasedComponent.

    line 22
  9. Very specific:

    Prefer inferred calls such as useSlot(View, props) so native ref types are preserved.

    line 26
  10. Very specific:

    Use useSlot for required slots and useOptionalSlot for optional slots.

    line 28
  11. Very specific:

    Ensure an as replacement accepts the declared props and forwards a compatible ref when the slot is referenced.

    line 32
  12. Distinctive:

    Add compile-time type assertions for public type behavior and runtime tests for rendering, prop merging, children, keys, and refs affected …

    line 39
  13. Distinctive:

    Read its authoring instructions before adding an abstraction.

    line 45
  14. Distinctive:

    Use the common focus instructions and their platform breakouts when adding focus-target or interaction abstractions.

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Framework Base component authoring

These instructions apply to packages/framework-base and its descendants.

Read src/component-patterns/README.md before adding or changing a component pattern.

Pattern selection

  • Use directComponent only for hook-free prop and render transformations.
  • Use phasedComponent when hooks, context, state, tokens, or slots are needed.
  • Create slots in the first phase and return a hook-free directComponent for the final render when practical.
  • Use a normal React component when a distinct React boundary is intentional.
  • Do not add new uses of legacyDirectComponent or stagedComponent.

Authoring rules

  • Put /** @jsxImportSource @fluentui-react-native/framework-base */ on the first line of component files using these patterns.
  • Keep children in props for modern direct and phased render functions.
  • Never call hooks from a directComponent or from the render phase returned by phasedComponent.
  • Declare slots from component types, for example Slot<typeof View> and OptionalSlot<typeof Text>.
  • Prefer inferred calls such as useSlot(View, props) so native ref types are preserved.
  • Use useSlot for required slots and useOptionalSlot for optional slots. Both accept raw props, shorthand children, and as customization.
  • For useOptionalSlot, treat null as explicitly hidden and use renderByDefault to control whether undefined renders.
  • Ensure an as replacement accepts the declared props and forwards a compatible ref when the slot is referenced.
  • Render ref-bearing callable slots through the custom JSX runtime. React 18's classic React.createElement path does not forward refs through function slots.

Coverage

Add compile-time type assertions for public type behavior and runtime tests for rendering, prop merging, children, keys, and refs affected by a change.

Accessibility

Universal non-styling accessibility helpers belong in src/accessibility. Read its authoring instructions before adding an abstraction. Use resolveAccessibilityAction for the demonstrated toggle/select transport contract rather than duplicating platform constants, action-list merging, and event-name decisions in consumers. Keep component state transitions and handler composition local, and preserve the generic entrypoint's React-only import safety.

Focus and native refs

Use the common focus instructions and their platform breakouts when adding focus-target or interaction abstractions. Reuse slot ref composition and cleanup; preserve this package's older React compatibility while agentic components use React 19 ref props. Keep proposed native services opt-in and do not add a design/components dependency here.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.