sync-sdk-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSync SDK Skill
同步SDK Skill
Synchronize the skill with the latest SDK source code from the Base44 SDK repository.
skills/base44-sdk/将 skill与Base44 SDK仓库中的最新SDK源代码同步。
skills/base44-sdk/Usage
使用方法
When activated, this command will ask for:
- SDK source folder path (required) - The local path to the Base44 SDK source code
- Documentation URL (optional) - URL to fetch additional documentation
激活此命令后,它将要求您提供:
- SDK源文件夹路径(必填)- Base44 SDK源代码的本地路径
- 文档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., or
~/projects/base44-sdk)/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:验证源文件夹
- Check that the provided path exists and contains SDK source code
- Look for these key indicators:
- with
package.jsonor similar SDK-related content@base44/sdk - directory with module implementations
src/ - 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.
- 检查提供的路径是否存在,且包含SDK源代码
- 查找以下关键标识:
- 包含或类似SDK相关内容的
@base44/sdkpackage.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:
-
Module files in directories like:
src/src/modules/lib/
-
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
-
Parse module definitions from:
- TypeScript interfaces and types
- Class definitions and methods
- JSDoc comments and annotations
- Export statements
-
Key modules to look for:
- - CRUD operations on data models
entities - - Login, register, user management
auth - - AI conversations and messages
agents - - Backend function invocation
functions - - AI, email, file uploads, custom APIs
integrations - - OAuth tokens (service role only)
connectors - - Track custom events
analytics - - Log user activity
appLogs - - User invitations
users - - Client creation and configuration
client
扫描SDK源文件夹以找到所有可用模块。查找:
-
模块文件所在的目录,例如:
src/src/modules/lib/
-
为每个模块提取以下信息:
- 模块名称和导出内容
- 可用方法及其签名
- 方法参数和类型
- 返回类型
- 使用示例(如果源代码或JSDoc中存在)
- 子模块(例如:、
integrations.Core)integrations.custom
-
从以下来源解析模块定义:
- TypeScript接口和类型
- 类定义和方法
- JSDoc注释和注解
- 导出语句
-
需要重点查找的关键模块:
- - 数据模型的CRUD操作
entities - - 登录、注册、用户管理
auth - - AI对话与消息
agents - - 后端函数调用
functions - - AI、邮件、文件上传、自定义API
integrations - - OAuth令牌(仅服务角色可用)
connectors - - 跟踪自定义事件
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.mdStep 5: Compare and Identify Changes
步骤5:对比并识别变更
Compare discovered SDK modules with existing skill documentation:
- New modules: Modules in source but not in skill references
- New methods: Methods added to existing modules
- Updated methods: Methods with changed signatures, parameters, or return types
- Deprecated methods: Methods marked as deprecated
- Removed methods: Methods in skill but not in source (verify before removing)
- New parameters: New options added to existing methods
Create a summary of changes to show the user before applying.
将发现的SDK模块与现有skill文档进行对比:
- 新模块:源代码中有但skill参考文档中没有的模块
- 新方法:添加到现有模块中的方法
- 更新方法:签名、参数或返回类型发生变化的方法
- 废弃方法:标记为已废弃的方法
- 移除方法:skill中有但源代码中没有的方法(移除前请先确认)
- 新参数:现有方法新增的选项
在应用变更前,创建变更摘要展示给用户。
Step 6: Fetch External Documentation (Optional)
步骤6:获取外部文档(可选)
If a documentation URL was provided:
- Fetch the documentation page
- Extract relevant module and method documentation
- Use this to supplement information from source code
- Cross-reference for accuracy
如果提供了文档URL:
- 获取文档页面
- 提取相关模块和方法的文档
- 用这些内容补充源代码中的信息
- 交叉验证确保准确性
Step 7: Update Skill Files
步骤7:更新Skill文件
For each change identified:
针对识别出的每一项变更:
Update Reference Files
更新参考文件
For each module, update or create :
references/{module-name}.mdmarkdown
undefined针对每个模块,更新或创建:
references/{module-name}.mdmarkdown
undefined{ModuleName} Module
{ModuleName} 模块
{Description from source}
{来自源代码的描述}
Overview
概述
{Brief explanation of what the module does}
{模块功能的简要说明}
Methods
方法
{methodName}(params)
{methodName}(params){methodName}(params)
{methodName}(params){Method description}
Parameters:
| Parameter | Type | Description | Required |
|---|---|---|---|
| | {description} | Yes |
| | {description} | No |
Returns:
Promise<{ReturnType}>Example:
javascript
const result = await base44.{module}.{methodName}({
param1: "value"
});{方法描述}
参数:
| 参数 | 类型 | 描述 | 必填 |
|---|---|---|---|
| | {描述} | 是 |
| | {描述} | 否 |
返回值:
Promise<{ReturnType}>示例:
javascript
const result = await base44.{module}.{methodName}({
param1: "value"
});Notes
注意事项
{Any important behavioral notes, frontend/backend availability, etc.}
undefined{任何重要的行为说明、前端/后端可用性等}
undefinedUpdate SKILL.md
更新SKILL.md
- Update the SDK Modules table if modules changed
- Update Quick Start if core patterns changed
- Update Module Selection section with new capabilities
- Update Common Patterns with new usage examples
- Update Frontend vs Backend table if availability changed
- Keep the existing structure and formatting
- Do NOT change the frontmatter description unless explicitly asked
- 如果模块发生变更,更新SDK模块表格
- 如果核心模式发生变更,更新快速开始部分
- 新增模块选择部分的功能说明
- 更新常见模式部分的使用示例
- 如果可用性发生变更,更新前端与后端表格
- 保留现有结构和格式
- 除非明确要求,否则不要修改前置元数据描述
Step 8: Present Summary
步骤8:展示变更摘要
After updates, present a summary to the user:
undefined更新完成后,向用户展示变更摘要:
undefinedSync 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 module: added
entitiesmethodbulkCreate() - Added new parameter to
options.cacheauth.me() - Deprecated
integrations.legacyMethod()
- 新增模块:
newModule - 更新模块:新增
entities方法bulkCreate() - 为新增参数
auth.me()options.cache - 标记为已废弃
integrations.legacyMethod()
Manual Review Recommended
建议手动检查
- [List any changes that need verification]
undefined- [列出任何需要验证的变更]
undefinedImportant 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,updatedelete - Include query filter syntax and operators
- Document for real-time updates
subscribe() - Note RLS/FLS security implications if applicable
- 记录CRUD方法:、
create、get、list、filter、updatedelete - 包含查询过滤语法和操作符
- 记录用于实时更新的
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 submodule methods (InvokeLLM, SendEmail, UploadFile, GenerateImage)
Core - Document for custom integrations
custom.call() - Include AI prompt examples
- 记录子模块的方法(InvokeLLM、SendEmail、UploadFile、GenerateImage)
Core - 记录用于自定义集成的
custom.call() - 包含AI提示示例
connectors.md
connectors.md
- Note this is service role / backend only
- Document for OAuth providers
getAccessToken()
- 注明此模块仅适用于服务角色/后端
- 记录用于OAuth提供商的
getAccessToken()
functions.md
functions.md
- Show both frontend invocation and backend implementation
- Include usage
createClientFromRequest() - Document access patterns
asServiceRole
- 展示前端调用和后端实现两种方式
- 包含的使用方法
createClientFromRequest() - 记录访问模式
asServiceRole
Troubleshooting
故障排除
| Issue | Solution |
|---|---|
| Can't find module files | Try searching for |
| Types not detected | Look for |
| Missing method descriptions | Check for JSDoc comments ( |
| Submodule structure | Modules like |
| Return types unclear | Check TypeScript generics and Promise wrappers |
| 问题 | 解决方案 |
|---|---|
| 找不到模块文件 | 尝试搜索 |
| 未检测到类型 | 查找 |
| 缺少方法描述 | 检查方法上方的JSDoc注释( |
| 子模块结构 | 类似 |
| 返回类型不明确 | 检查TypeScript泛型和Promise包装器 |