sync-sdk-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sync SDK Skill

同步SDK Skill

Synchronize the
skills/base44-sdk/
skill with the latest SDK source code from the Base44 SDK repository.
skills/base44-sdk/
skill与Base44 SDK仓库中的最新SDK源代码同步。

Usage

使用方法

When activated, this command will ask for:
  1. SDK source folder path (required) - The local path to the Base44 SDK source code
  2. Documentation URL (optional) - URL to fetch additional documentation
激活此命令后,它将要求您提供:
  1. SDK源文件夹路径(必填)- Base44 SDK源代码的本地路径
  2. 文档URL(可选)- 用于获取额外文档的URL

Steps

步骤

Step 1: Gather Input

步骤1:收集输入

Ask the user for the required inputs using the AskQuestion tool if available, otherwise ask conversationally:
Required:
  • SDK source folder path (e.g.,
    ~/projects/base44-sdk
    or
    /Users/me/base44-sdk
    )
Optional:
  • Documentation URL (e.g.,
    https://docs.base44.com/sdk
    )
If the user provided these in the initial prompt, use those values.
如果有AskQuestion工具可用,使用该工具向用户询问必填输入;否则以对话方式询问:
必填项:
  • SDK源文件夹路径(例如:
    ~/projects/base44-sdk
    /Users/me/base44-sdk
可选项:
  • 文档URL(例如:
    https://docs.base44.com/sdk
如果用户在初始提示中已提供这些值,请直接使用。

Step 2: Validate Source Folder

步骤2:验证源文件夹

  1. Check that the provided path exists and contains SDK source code
  2. Look for these key indicators:
    • package.json
      with
      @base44/sdk
      or similar SDK-related content
    • src/
      directory with module implementations
    • TypeScript/JavaScript files with SDK module exports (e.g.,
      entities.ts
      ,
      auth.ts
      ,
      client.ts
      )
If validation fails, ask the user to verify the path.
  1. 检查提供的路径是否存在,且包含SDK源代码
  2. 查找以下关键标识:
    • 包含
      @base44/sdk
      或类似SDK相关内容的
      package.json
    • 包含模块实现的
      src/
      目录
    • 包含SDK模块导出的TypeScript/JavaScript文件(例如:
      entities.ts
      auth.ts
      client.ts
如果验证失败,请要求用户检查路径。

Step 3: Discover SDK Modules

步骤3:发现SDK模块

Scan the SDK source folder to find all available modules. Look for:
  1. Module files in directories like:
    • src/
    • src/modules/
    • lib/
  2. For each module, extract:
    • Module name and exports
    • Available methods and their signatures
    • Method parameters and types
    • Return types
    • Usage examples (if present in source or JSDoc)
    • Submodules (e.g.,
      integrations.Core
      ,
      integrations.custom
      )
  3. Parse module definitions from:
    • TypeScript interfaces and types
    • Class definitions and methods
    • JSDoc comments and annotations
    • Export statements
  4. Key modules to look for:
    • entities
      - CRUD operations on data models
    • auth
      - Login, register, user management
    • agents
      - AI conversations and messages
    • functions
      - Backend function invocation
    • integrations
      - AI, email, file uploads, custom APIs
    • connectors
      - OAuth tokens (service role only)
    • analytics
      - Track custom events
    • appLogs
      - Log user activity
    • users
      - User invitations
    • client
      - Client creation and configuration
扫描SDK源文件夹以找到所有可用模块。查找:
  1. 模块文件所在的目录,例如:
    • src/
    • src/modules/
    • lib/
  2. 为每个模块提取以下信息:
    • 模块名称和导出内容
    • 可用方法及其签名
    • 方法参数和类型
    • 返回类型
    • 使用示例(如果源代码或JSDoc中存在)
    • 子模块(例如:
      integrations.Core
      integrations.custom
  3. 从以下来源解析模块定义:
    • TypeScript接口和类型
    • 类定义和方法
    • JSDoc注释和注解
    • 导出语句
  4. 需要重点查找的关键模块:
    • entities
      - 数据模型的CRUD操作
    • auth
      - 登录、注册、用户管理
    • agents
      - AI对话与消息
    • functions
      - 后端函数调用
    • integrations
      - AI、邮件、文件上传、自定义API
    • connectors
      - OAuth令牌(仅服务角色可用)
    • analytics
      - 跟踪自定义事件
    • appLogs
      - 记录用户活动
    • users
      - 用户邀请
    • client
      - 客户端创建与配置

Step 4: Read Existing Skill

步骤4:读取现有Skill

Read the current skill files to understand what needs updating:
skills/base44-sdk/
├── SKILL.md
└── references/
    ├── analytics.md
    ├── app-logs.md
    ├── auth.md
    ├── base44-agents.md
    ├── client.md
    ├── connectors.md
    ├── entities.md
    ├── functions.md
    ├── integrations.md
    └── users.md
读取当前skill文件,了解需要更新的内容:
skills/base44-sdk/
├── SKILL.md
└── references/
    ├── analytics.md
    ├── app-logs.md
    ├── auth.md
    ├── base44-agents.md
    ├── client.md
    ├── connectors.md
    ├── entities.md
    ├── functions.md
    ├── integrations.md
    └── users.md

Step 5: Compare and Identify Changes

步骤5:对比并识别变更

Compare discovered SDK modules with existing skill documentation:
  1. New modules: Modules in source but not in skill references
  2. New methods: Methods added to existing modules
  3. Updated methods: Methods with changed signatures, parameters, or return types
  4. Deprecated methods: Methods marked as deprecated
  5. Removed methods: Methods in skill but not in source (verify before removing)
  6. New parameters: New options added to existing methods
Create a summary of changes to show the user before applying.
将发现的SDK模块与现有skill文档进行对比:
  1. 新模块:源代码中有但skill参考文档中没有的模块
  2. 新方法:添加到现有模块中的方法
  3. 更新方法:签名、参数或返回类型发生变化的方法
  4. 废弃方法:标记为已废弃的方法
  5. 移除方法:skill中有但源代码中没有的方法(移除前请先确认)
  6. 新参数:现有方法新增的选项
在应用变更前,创建变更摘要展示给用户。

Step 6: Fetch External Documentation (Optional)

步骤6:获取外部文档(可选)

If a documentation URL was provided:
  1. Fetch the documentation page
  2. Extract relevant module and method documentation
  3. Use this to supplement information from source code
  4. Cross-reference for accuracy
如果提供了文档URL:
  1. 获取文档页面
  2. 提取相关模块和方法的文档
  3. 用这些内容补充源代码中的信息
  4. 交叉验证确保准确性

Step 7: Update Skill Files

步骤7:更新Skill文件

For each change identified:
针对识别出的每一项变更:

Update Reference Files

更新参考文件

For each module, update or create
references/{module-name}.md
:
markdown
undefined
针对每个模块,更新或创建
references/{module-name}.md
markdown
undefined

{ModuleName} Module

{ModuleName} 模块

{Description from source}
{来自源代码的描述}

Overview

概述

{Brief explanation of what the module does}
{模块功能的简要说明}

Methods

方法

{methodName}(params)

{methodName}(params)

{Method description}
Parameters:
ParameterTypeDescriptionRequired
param1
string
{description}Yes
options
object
{description}No
Returns:
Promise<{ReturnType}>
Example:
javascript
const result = await base44.{module}.{methodName}({
  param1: "value"
});
{方法描述}
参数:
参数类型描述必填
param1
string
{描述}
options
object
{描述}
返回值:
Promise<{ReturnType}>
示例:
javascript
const result = await base44.{module}.{methodName}({
  param1: "value"
});

Notes

注意事项

{Any important behavioral notes, frontend/backend availability, etc.}
undefined
{任何重要的行为说明、前端/后端可用性等}
undefined

Update SKILL.md

更新SKILL.md

  1. Update the SDK Modules table if modules changed
  2. Update Quick Start if core patterns changed
  3. Update Module Selection section with new capabilities
  4. Update Common Patterns with new usage examples
  5. Update Frontend vs Backend table if availability changed
  6. Keep the existing structure and formatting
  7. Do NOT change the frontmatter description unless explicitly asked
  1. 如果模块发生变更,更新SDK模块表格
  2. 如果核心模式发生变更,更新快速开始部分
  3. 新增模块选择部分的功能说明
  4. 更新常见模式部分的使用示例
  5. 如果可用性发生变更,更新前端与后端表格
  6. 保留现有结构和格式
  7. 除非明确要求,否则不要修改前置元数据描述

Step 8: Present Summary

步骤8:展示变更摘要

After updates, present a summary to the user:
undefined
更新完成后,向用户展示变更摘要:
undefined

Sync Summary

同步摘要

Files Updated

更新的文件

  • references/new-module.md (created)
  • references/entities.md (updated methods)
  • SKILL.md (updated module table)
  • references/new-module.md(已创建)
  • references/entities.md(已更新方法)
  • SKILL.md(已更新模块表格)

Changes Made

已做变更

  • Added new module:
    newModule
  • Updated
    entities
    module: added
    bulkCreate()
    method
  • Added new parameter
    options.cache
    to
    auth.me()
  • Deprecated
    integrations.legacyMethod()
  • 新增模块:
    newModule
  • 更新
    entities
    模块:新增
    bulkCreate()
    方法
  • auth.me()
    新增参数
    options.cache
  • 标记
    integrations.legacyMethod()
    为已废弃

Manual Review Recommended

建议手动检查

  • [List any changes that need verification]
undefined
  • [列出任何需要验证的变更]
undefined

Important Notes

重要注意事项

  • Preserve existing content: Don't remove detailed explanations, examples, or warnings unless they're outdated
  • Keep formatting consistent: Match the existing style of SKILL.md and reference files
  • Maintain progressive disclosure: Keep detailed docs in references, summaries in SKILL.md
  • Flag uncertainties: If source code is unclear, flag it for manual review
  • Document frontend/backend availability: Always note if a method is backend-only (e.g.,
    connectors
    ,
    asServiceRole
    )
  • Preserve type information: Include TypeScript types in method signatures
  • Keep examples practical: Examples should reflect real-world usage patterns
  • 保留现有内容:除非内容已过时,否则不要删除详细说明、示例或警告
  • 保持格式一致:匹配SKILL.md和参考文件的现有风格
  • 保持渐进式披露:详细文档放在参考文件中,摘要放在SKILL.md中
  • 标记不确定内容:如果源代码不清晰,标记出来以便手动检查
  • 记录前端/后端可用性:务必注明方法是否仅支持后端(例如:
    connectors
    asServiceRole
  • 保留类型信息:在方法签名中包含TypeScript类型
  • 示例要实用:示例应反映真实的使用模式

Module-Specific Guidelines

模块特定指南

entities.md

entities.md

  • Document CRUD methods:
    create
    ,
    get
    ,
    list
    ,
    filter
    ,
    update
    ,
    delete
  • Include query filter syntax and operators
  • Document
    subscribe()
    for real-time updates
  • Note RLS/FLS security implications if applicable
  • 记录CRUD方法:
    create
    get
    list
    filter
    update
    delete
  • 包含查询过滤语法和操作符
  • 记录用于实时更新的
    subscribe()
  • 如有必要,注明RLS/FLS安全影响

auth.md

auth.md

  • Cover all authentication methods (email/password, OAuth, etc.)
  • Document
    me()
    ,
    updateMe()
    ,
    logout()
  • Include redirect flow examples
  • Note token handling
  • 覆盖所有认证方法(邮箱/密码、OAuth等)
  • 记录
    me()
    updateMe()
    logout()
  • 包含重定向流程示例
  • 注明令牌处理方式

integrations.md

integrations.md

  • Document
    Core
    submodule methods (InvokeLLM, SendEmail, UploadFile, GenerateImage)
  • Document
    custom.call()
    for custom integrations
  • Include AI prompt examples
  • 记录
    Core
    子模块的方法(InvokeLLM、SendEmail、UploadFile、GenerateImage)
  • 记录用于自定义集成的
    custom.call()
  • 包含AI提示示例

connectors.md

connectors.md

  • Note this is service role / backend only
  • Document
    getAccessToken()
    for OAuth providers
  • 注明此模块仅适用于服务角色/后端
  • 记录用于OAuth提供商的
    getAccessToken()

functions.md

functions.md

  • Show both frontend invocation and backend implementation
  • Include
    createClientFromRequest()
    usage
  • Document
    asServiceRole
    access patterns
  • 展示前端调用和后端实现两种方式
  • 包含
    createClientFromRequest()
    的使用方法
  • 记录
    asServiceRole
    访问模式

Troubleshooting

故障排除

IssueSolution
Can't find module filesTry searching for
export class
or
export function
patterns
Types not detectedLook for
.d.ts
files or inline TypeScript annotations
Missing method descriptionsCheck for JSDoc comments (
/** ... */
) above methods
Submodule structureModules like
integrations.Core
may be in nested files
Return types unclearCheck TypeScript generics and Promise wrappers
问题解决方案
找不到模块文件尝试搜索
export class
export function
模式
未检测到类型查找
.d.ts
文件或内联TypeScript注解
缺少方法描述检查方法上方的JSDoc注释(
/** ... */
子模块结构类似
integrations.Core
的模块可能位于嵌套文件中
返回类型不明确检查TypeScript泛型和Promise包装器