fusion-developer-app

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fusion App Development

Fusion应用开发

When to use

适用场景

Use this skill when developing features, components, hooks, services, or types for a Fusion Framework React application.
Typical triggers:
  • "Add a component for ..."
  • "Create a hook that ..."
  • "Wire up the API"
  • "Build a page for ..."
  • "Add a service to fetch ..."
  • "Configure a Fusion module"
  • "Which Fusion Framework hook should this app use?"
  • "What is the right package or module for this app integration?"
  • "Find the correct Fusion Framework example before implementing this app change"
  • "Persist this preference as an app setting"
  • "Add bookmark support for this view"
  • "Read runtime config or environment variables"
  • "Instrument this page with analytics"
  • "Add a feature flag to this app"
  • "How do I use the useFeature hook in a Fusion app?"
  • "Implement a feature for ..."
Implicit triggers:
  • The user asks to build something in
    src/
  • The user references Fusion Framework modules, EDS components, Fusion React components (
    @equinor/fusion-react-*
    ), or styled-components patterns
  • The user references app settings, bookmarks, analytics, or
    app.config.ts
  • The user wants to add a new route, page, or data-fetching layer
在为Fusion Framework React应用开发功能、组件、hooks、服务或类型时,使用本技能。
典型触发场景:
  • "为……添加一个组件"
  • "创建一个用于……的hook"
  • "连接API"
  • "为……构建一个页面"
  • "添加一个用于获取……的服务"
  • "配置Fusion模块"
  • "这个应用应该使用哪个Fusion Framework hook?"
  • "这个应用集成应该使用哪个合适的包或模块?"
  • "在实现这个应用变更前,找到正确的Fusion Framework示例"
  • "将此偏好设置为应用配置"
  • "为该视图添加书签支持"
  • "读取运行时配置或环境变量"
  • "为该页面添加分析埋点"
  • "为这个应用添加功能开关"
  • "如何在Fusion应用中使用useFeature hook?"
  • "为……实现一个功能"
隐含触发场景:
  • 用户要求在
    src/
    目录下构建内容
  • 用户提及Fusion Framework模块、EDS组件、Fusion React组件(
    @equinor/fusion-react-*
    )或styled-components模式
  • 用户提及应用配置、书签、分析或
    app.config.ts
  • 用户想要添加新路由、页面或数据获取层

When not to use

不适用场景

Do not use this skill for:
  • Issue authoring or triage (use
    fusion-issue-authoring
    )
  • Skill authoring (use
    fusion-skill-authoring
    )
  • Backend/service changes (separate repository)
  • CI/CD pipeline or deployment configuration
  • Architecture documentation (use ADR template)
When the request is primarily about Fusion Framework package ownership, hook behavior, or example discovery rather than app implementation, use the companion skill
fusion-research
first and then return here for code changes.
本技能不适用于:
  • 问题编写或分类(使用
    fusion-issue-authoring
  • 技能编写(使用
    fusion-skill-authoring
  • 后端/服务变更(单独仓库)
  • CI/CD流水线或部署配置
  • 架构文档(使用ADR模板)
当请求主要涉及Fusion Framework包归属、hook行为或示例查找而非应用实现时,先使用配套技能
fusion-research
,再返回此处进行代码变更。

Required inputs

必要输入

Mandatory

必填项

  • What to build: a clear description of the feature, component, hook, or service
  • Where it fits: which layer (component, hook, service, type) and any parent/sibling context
If the user's request is ambiguous or missing critical details, consult
assets/follow-up-questions.md
for domain-specific clarifying questions before implementing.
  • 构建内容:对功能、组件、hook或服务的清晰描述
  • 位置信息:所属层级(组件、hook、服务、类型)及任何父/同级上下文
如果用户的请求模糊或缺少关键细节,在实现前参考
assets/follow-up-questions.md
中的领域特定澄清问题。

Conditional

条件项

  • API endpoint details when the feature involves data fetching
  • Design/layout specifics when building visual components
  • Fusion module name when extending module configuration
  • Whether state should persist per-user, be shareable via bookmark, or stay runtime-only
  • 当功能涉及数据获取时,提供API端点详情
  • 构建可视化组件时,提供设计/布局细节
  • 扩展模块配置时,提供Fusion模块名称
  • 状态是否应按用户持久化、可通过书签共享或仅在运行时保留

Instructions

操作步骤

Step 1 — Discover project conventions

步骤1 — 了解项目约定

Before writing any code, inspect the target repository to learn its specific setup:
  1. Read
    package.json
    to identify the package manager (bun/pnpm/npm), available scripts, and installed dependencies.
  2. Read
    tsconfig.json
    to confirm TypeScript settings and path aliases.
  3. Scan
    src/
    to understand the current directory layout and layer structure.
  4. Check for ADRs (
    docs/adr/
    ) or a
    contribute/
    directory for project-specific code standards.
  5. Check for formatter/linter config (biome.json, .eslintrc, prettier config).
  6. Read
    app.config.ts
    and
    app.manifest.ts
    to understand existing endpoint and environment setup.
  7. If the implementation depends on uncertain Fusion Framework behavior, exact package ownership, or cookbook examples, delegate that research to
    fusion-research
    before writing code.
Adapt all subsequent steps to the conventions discovered here. The patterns in
references/
are defaults — defer to project-specific rules when they differ.
在编写任何代码前,检查目标仓库以了解其特定设置:
  1. 阅读
    package.json
    以确定包管理器(bun/pnpm/npm)、可用脚本和已安装依赖。
  2. 阅读
    tsconfig.json
    以确认TypeScript设置和路径别名。
  3. 扫描
    src/
    目录以理解当前目录结构和层级架构。
  4. 检查ADR(
    docs/adr/
    )或
    contribute/
    目录以获取项目特定代码标准。
  5. 检查格式化/检查器配置(biome.json, .eslintrc, prettier配置)。
  6. 阅读
    app.config.ts
    app.manifest.ts
    以了解现有端点和环境设置。
  7. 如果实现依赖于不确定的Fusion Framework行为、确切的包归属或示例代码,在编写代码前将调研工作委托给
    fusion-research
使后续所有步骤适配此处发现的约定。
references/
中的模式为默认值——当项目特定规则与之不同时,优先遵循项目规则。

Step 2 — Plan the implementation

步骤2 — 规划实现方案

If scaffolding a new app from scratch, use
assets/new-app-checklist.md
as a progress tracker.
  1. Break the work into discrete files/changes.
  2. Map each piece to the correct directory. A typical Fusion app uses:
    • src/components/
      — React components (presentation layer)
    • src/hooks/
      — Custom React hooks (state and side-effect logic)
    • src/api/
      — API clients, data transforms, business logic
    • src/types/
      — TypeScript interfaces, type aliases, enums
    • src/routes.ts
      — Route definitions (when using Fusion Router)
    • src/config.ts
      — Fusion module configuration
    • src/App.tsx
      — Root component, layout shell
  3. Identify shared types early — define them before referencing.
  4. If the project uses routing, follow
    references/using-router.md
    for the DSL and page patterns.
  5. If the project uses a different structure, follow it.
如果从头搭建新应用,使用
assets/new-app-checklist.md
作为进度跟踪工具。
  1. 将工作拆分为独立的文件/变更。
  2. 将每个部分映射到正确的目录。典型的Fusion应用使用:
    • src/components/
      — React组件(展示层)
    • src/hooks/
      — 自定义React hooks(状态和副作用逻辑)
    • src/api/
      — API客户端、数据转换、业务逻辑
    • src/types/
      — TypeScript接口、类型别名、枚举
    • src/routes.ts
      — 路由定义(使用Fusion Router时)
    • src/config.ts
      — Fusion模块配置
    • src/App.tsx
      — 根组件、布局外壳
  3. 尽早识别共享类型——先定义再引用。
  4. 如果项目使用路由,遵循
    references/using-router.md
    中的DSL和页面模式。
  5. 如果项目使用不同结构,遵循该结构。

Step 3 — Implement following code conventions

步骤3 — 遵循代码约定实现

Follow the project's code standards (discovered in Step 1). For all convention rules — naming, TSDoc, inline comments, type patterns, code style, and error handling — defer to the
fusion-code-conventions
skill.
When convention questions arise during implementation, invoke
fusion-code-conventions
directly. It routes to the correct language agent and returns the authoritative rule with an example.
遵循项目的代码标准(步骤1中发现的)。对于所有约定规则——命名、TSDoc、内联注释、类型模式、代码风格和错误处理——优先遵循
fusion-code-conventions
技能。
当实现过程中出现约定问题时,直接调用
fusion-code-conventions
。它会路由到正确的语言代理,并返回带示例的权威规则。

Step 4 — Style with styled-components, EDS, and Fusion React components

步骤4 — 使用styled-components、EDS和Fusion React组件进行样式设计

Follow
references/styled-components.md
,
references/styling-with-eds.md
, and
references/using-fusion-react-components.md
:
  • Use
    styled-components
    for custom styling — this is the Fusion ecosystem convention.
  • Do not introduce CSS Modules, global CSS files, Tailwind, or alternative CSS-in-JS unless the project explicitly uses them.
  • Use the
    Styled
    object pattern for co-located styled components.
  • Prefer EDS components from
    @equinor/eds-core-react
    as the base for standard UI elements.
  • Use EDS design tokens (CSS custom properties or
    @equinor/eds-tokens
    ) for colors, spacing, and typography.
  • Extend EDS components with
    styled()
    when customization is needed.
  • Use Fusion React components (
    @equinor/fusion-react-*
    ) for domain-specific needs not covered by EDS — person display/selection, Fusion side sheets, and progress indicators.
  • Inline
    style
    props are acceptable for one-off tweaks only.
遵循
references/styled-components.md
references/styling-with-eds.md
references/using-fusion-react-components.md
  • 使用
    styled-components
    进行自定义样式——这是Fusion生态系统的约定。
  • 除非项目明确使用,否则不要引入CSS Modules、全局CSS文件、Tailwind或其他CSS-in-JS方案。
  • 使用
    Styled
    对象模式实现同位置的styled组件。
  • 优先使用
    @equinor/eds-core-react
    中的EDS组件作为标准UI元素的基础。
  • 使用EDS设计令牌(CSS自定义属性或
    @equinor/eds-tokens
    )设置颜色、间距和排版。
  • 需要自定义时,使用
    styled()
    扩展EDS组件。
  • 使用Fusion React组件(
    @equinor/fusion-react-*
    )处理EDS未覆盖的领域特定需求——人员展示/选择、Fusion侧边栏和进度指示器。
  • 内联
    style
    属性仅适用于一次性调整。

Step 5 — Wire up data fetching (when applicable)

步骤5 — 连接数据获取(适用时)

Follow
references/configure-services.md
,
references/using-react-query.md
, and
references/configure-mocking.md
for data-fetching and local dev mocking patterns:
  • Register HTTP clients via
    configureHttpClient
    in
    config.ts
    or via
    app.config.ts
    endpoints.
  • Access clients in components with
    useHttpClient(name)
    from
    @equinor/fusion-framework-react-app/http
    .
  • Always prefer
    @equinor/fusion-framework-react-app/*
    hooks
    (
    useHttpClient
    ,
    useCurrentContext
    , etc.) over direct module access. Reserve
    framework.modules.*
    for non-React contexts like route loaders.
  • When the project uses React Query (
    @tanstack/react-query
    ), create thin custom hook wrappers around
    useQuery
    .
  • Use query keys derived from API path + parameters.
  • Keep client UI state in React state/context, not in server-state libraries.
遵循
references/configure-services.md
references/using-react-query.md
references/configure-mocking.md
中的数据获取和本地开发模拟模式:
  • config.ts
    中通过
    configureHttpClient
    app.config.ts
    端点注册HTTP客户端。
  • 在组件中使用
    @equinor/fusion-framework-react-app/http
    中的
    useHttpClient(name)
    访问客户端。
  • 始终优先使用
    @equinor/fusion-framework-react-app/*
    hooks
    useHttpClient
    useCurrentContext
    等)而非直接模块访问。仅在非React上下文(如路由加载器)中使用
    framework.modules.*
  • 当项目使用React Query(
    @tanstack/react-query
    )时,在
    useQuery
    周围创建轻量自定义hook包装器。
  • 使用从API路径+参数派生的查询键。
  • 将客户端UI状态保存在React状态/上下文中,而非服务器状态库中。

Step 6 — Configure Fusion modules (when applicable)

步骤6 — 配置Fusion模块(适用时)

Identify which module the user needs, then read only the matching reference:
NeedReference
HTTP clients / API integration
references/configure-services.md
Context module
references/using-context.md
Router and pages
references/using-router.md
AG Grid
references/using-ag-grid.md
EDS + Fusion React components
references/using-fusion-react-components.md
Settings
references/using-settings.md
Bookmarks
references/using-bookmarks.md
Analytics
references/using-analytics.md
Runtime config / environment
references/using-assets-and-environment.md
Feature flags
references/using-feature-flags.md
General framework modules
references/using-framework-modules.md
  • Add module setup in
    config.ts
    using the
    AppModuleInitiator
    callback.
  • Access modules in components via hooks:
    useAppModule
    ,
    useHttpClient
    ,
    useCurrentContext
    .
  • Register HTTP client endpoints in
    app.config.ts
    when adding new API integrations.
  • Enable navigation with
    enableNavigation
    in
    config.ts
    when the app uses routing.
  • Define routes using the Fusion Router DSL (
    layout
    ,
    index
    ,
    route
    ,
    prefix
    ) for automatic code splitting.
  • When the right framework API is unclear, use
    fusion-research
    to gather a source-backed answer before choosing an implementation pattern.
确定用户需要的模块,然后仅阅读匹配的参考文档:
需求参考文档
HTTP客户端/API集成
references/configure-services.md
上下文模块
references/using-context.md
路由器和页面
references/using-router.md
AG Grid
references/using-ag-grid.md
EDS + Fusion React组件
references/using-fusion-react-components.md
配置
references/using-settings.md
书签
references/using-bookmarks.md
分析
references/using-analytics.md
运行时配置/环境
references/using-assets-and-environment.md
功能开关
references/using-feature-flags.md
通用框架模块
references/using-framework-modules.md
  • config.ts
    中使用
    AppModuleInitiator
    回调添加模块设置。
  • 通过hooks在组件中访问模块:
    useAppModule
    useHttpClient
    useCurrentContext
  • 添加新API集成时,在
    app.config.ts
    中注册HTTP客户端端点。
  • 当应用使用路由时,在
    config.ts
    中启用
    enableNavigation
  • 使用Fusion Router DSL(
    layout
    index
    route
    prefix
    )定义路由以实现自动代码分割。
  • 当不确定正确的框架API时,在选择实现模式前使用
    fusion-research
    获取有来源支持的答案。

Step 7 — Validate

步骤7 — 验证

Use
assets/review-checklist.md
as a comprehensive post-generation checklist.
  1. Run the project's typecheck command (e.g.
    bun run typecheck
    or
    pnpm typecheck
    ) — zero errors required.
  2. Run the project's lint/format check — zero violations.
  3. Verify every new exported symbol has TSDoc.
  4. Confirm styling follows the project's conventions.
  5. Confirm no new dependencies unless justified or explicitly approved.
使用
assets/review-checklist.md
作为全面的生成后检查清单。
  1. 运行项目的类型检查命令(如
    bun run typecheck
    pnpm typecheck
    )——要求零错误。
  2. 运行项目的检查/格式化命令——要求零违规。
  3. 验证每个新导出符号都有TSDoc。
  4. 确认样式遵循项目约定。
  5. 确认没有新增依赖,除非有正当理由或明确批准。

Expected output

预期输出

  • New or modified source files in
    src/
    following the project's layer structure.
  • All files pass typecheck and lint.
  • Every exported function, component, hook, and type has TSDoc.
  • Styling follows project conventions (typically styled-components + EDS + Fusion React components where applicable).
  • A brief summary of what was created or changed and why.
  • src/
    目录下遵循项目层级结构的新文件或修改后的源文件。
  • 所有文件通过类型检查和代码检查。
  • 每个导出的函数、组件、hook和类型都有TSDoc。
  • 样式遵循项目约定(通常是styled-components + EDS + 适用时的Fusion React组件)。
  • 关于创建或变更内容及原因的简要说明。

Helper agents

辅助代理

This skill includes three optional helper agents in
agents/
. Use them for focused review after implementing changes, or consult them during implementation for specific guidance. If the runtime does not support skill-local agents, apply the same review criteria inline.
This skill also has a companion skill,
fusion-research
, for source-backed Fusion ecosystem research. Use it when implementation work is blocked by uncertainty about framework behavior, EDS component APIs, or skill catalog questions.
  • agents/framework.md
    — reviews Fusion Framework integration: module configuration, HTTP clients, bootstrap lifecycle, runtime config, settings, bookmarks, analytics, and hook usage. Prefers
    mcp_fusion_search_framework
    for API lookups; falls back to
    mcp_fusion_search_docs
    for general platform guidance. Consult when wiring up
    config.ts
    ,
    app.config.ts
    , or any component that accesses framework modules.
  • agents/styling.md
    — reviews EDS component selection, styled-components patterns, design token usage, and accessibility. Prefers
    mcp_fusion_search_eds
    for component docs, props, and examples. Consult when building or modifying visual components.
  • agents/code-quality.md
    — delegates convention checks (naming, TSDoc, TypeScript strictness, intent comments) to
    fusion-code-conventions
    , then aggregates findings in Fusion app context. Run on every new or modified file before finalizing.
本技能在
agents/
中包含三个可选辅助代理。在实现变更后使用它们进行重点审查,或在实现期间咨询特定指导。如果运行时不支持技能本地代理,直接应用相同的审查标准。
本技能还有一个配套技能
fusion-research
,用于基于来源的Fusion生态系统调研。当实现工作因框架行为、EDS组件API或技能目录问题的不确定性而受阻时使用它。
  • agents/framework.md
    — 审查Fusion Framework集成:模块配置、HTTP客户端、启动生命周期、运行时配置、设置、书签、分析和hook使用。**优先使用
    mcp_fusion_search_framework
    **进行API查找;回退到
    mcp_fusion_search_docs
    获取通用平台指导。在连接
    config.ts
    app.config.ts
    或任何访问框架模块的组件时咨询。
  • agents/styling.md
    — 审查EDS组件选择、styled-components模式、设计令牌使用和可访问性。**优先使用
    mcp_fusion_search_eds
    **获取组件文档、属性和示例。在构建或修改可视化组件时咨询。
  • agents/code-quality.md
    — 将约定检查(命名、TSDoc、TypeScript严格性、意图注释)委托给
    fusion-code-conventions
    ,然后在Fusion应用上下文中汇总结果。在最终确定前对每个新文件或修改后的文件运行。

Safety & constraints

安全与约束

  • No new dependencies without explicit user approval.
  • No direct DOM manipulation — use React patterns.
  • No
    any
    types
    — TypeScript strict mode is standard for Fusion apps.
  • No secrets or credentials in source files.
  • Conventional commits for all changes (
    feat:
    ,
    fix:
    ,
    refactor:
    , etc.).
  • Do not modify infrastructure files (docker-compose, CI config) unless explicitly asked.
  • 无新依赖,除非获得用户明确批准。
  • 无直接DOM操作 — 使用React模式。
  • any
    类型
    — TypeScript严格模式是Fusion应用的标准。
  • 源文件中无密钥或凭证
  • 所有变更使用约定式提交
    feat:
    fix:
    refactor:
    等)。
  • 除非明确要求,否则不要修改基础设施文件(docker-compose、CI配置)。