agentic-component-optimization
Analyze and optimize packages/agentic/components as a whole when repeated patterns, dependency direction, or extraction boundaries cross components.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1.4k
- Forks
- 179
01 前言 Front Matter
- name
- agentic-component-optimization
- license
- MIT
- description
- Analyze and optimize packages/agentic/components as a whole when repeated patterns, dependency direction, or extraction boundaries cross components.
03 SKILL.md 正文
Agentic component optimization
Use this skill when a change is about the package as a system, not a single component fix. It helps decide whether repeated code
belongs in src/common, @fluentui-react-native/framework-base, or @fluentui-react-native/design/styling, and whether a
primitive or helper should exist at all.
Read first
- Read the package instructions and the source boundaries reference.
- Read the higher-order component or
primitive reference and the colocated
SPEC.mdorCONTRACT.mdfiles for the affected area. - Inspect the canonical implementations:
packages/agentic/components/src/components/buttonandpackages/agentic/components/src/primitives/icon.
Audit checklist
1. Dependency direction
Apply the source boundaries: production
dependencies, where generalizable hooks and styling helpers belong, and what stays in src/common.
2. Repetition and ownership
Look for repeated:
- types and discriminated unions
- constants and default tables
- state routines and prop normalization
- slot wiring or subtree assembly
- primitive behaviors or structural contracts
Prefer extraction only when the repeated shape is stable and shared across multiple components.
3. Validate extraction payoff
Before extracting, confirm that the change:
- reduces repeated logic without widening public APIs
- preserves component-qualified exports and call sites
- improves dependency direction instead of hiding it
- keeps the resulting abstraction smaller than the duplication it replaces
4. Do-not-extract criteria
Do not extract when the code is:
- one-off component behavior
- a styling decision that belongs in the owning component
- a public prop contract or display-specific variant
- a thin wrapper around a single native element
- easier to read in place than through another helper
Output
Return a short recommendation with:
- what to keep local
- what to move to shared package/common code
- whether the extraction is worth doing now
- any public API or dependency risks
If the work is just a tiny component edit, stop at the component instructions and do not run a whole-package audit.
04 同仓库更多 Skills
review-component
Review component code or changes of any generation (v0, v1, agentic, primitive, or native-backed) without editing files. Classifies each changed surface, applies the matching checklists and native overlay, and reports evidence-backed findings with validation status.
maintain-v0-v1-component
Fix or maintain existing v0 (foundation-compose) or v1 (framework compose/compressible) components, including their platform variants. Classifies the generation first and loads only its recipe. Not for new components, agentic components, read-only reviews, or native-only changes.
maintain-desktop-testing
Change, review, or plan source changes to desktop-driver, desktop-test, storybook-desktop, or storybook-desktop-runtime, including native helpers. Applies package invariants, documentation, native and consumer validation, and changesets.
implement-native-component
Implement or change native components, TurboModules, native services, codegen specs, or native-backed platform wrappers (Swift, Objective-C, C++/WinRT, podspecs, Windows projects). Also supplies the native overlay checklist for v0, v1, and agentic work. Not for Storybook toolchain failures.
fix-security-issues
Audit and remediate dependency security advisories while respecting package age policy, removing unused vulnerable capabilities, deduplicating Yarn resolutions, and validating affected tooling.
desktop-testing
Configure, run, or troubleshoot native desktop tests using desktop-test, desktop-driver, and storybook-desktop, including app targets and suites, helpers, permissions, WDIO suites, Storybook story tests and smoke runs, reports, and CI. Not for package source changes or the Storybook app build toolchain.