Skip to content

neru1234/rfd3assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

rfd3ass for Trae

A specialized assistant for RFD3 (RFdiffusion3) usage, providing guidance and support for protein design workflows.


1. What is this?

This repository provides context files, agent scripts, and knowledge packs that make GenAI tooling significantly more useful for RFD3 (RFdiffusion3) workflows. It is now available as a Trae skill for enhanced integration with the Trae IDE.

It is maintained as a specialized assistant for RFD3 usage, providing focused guidance and support for protein design workflows.


2. Goals

The key goals of this package are:

  1. Help researchers get productive with RFD3 (RFdiffusion3) quickly
  2. Provide reusable context, scripts, and rules for RFD3 workflows
  3. Simplify the use of RFD3 for protein design tasks
  4. Integrate seamlessly with Trae IDE for enhanced user experience

3. Directory Structure

rfd3ass/
├── scripts/        # Agent scripts (.script.md)
├── knowledge/      # RFD3-specific knowledge files
└── README.md       # Documentation

.trae/skills/rfd3ass/
├── SKILL.md        # Skill definition and usage
├── config.json     # Skill configuration
└── index.js        # Skill implementation

4. Setup

4.1 Prerequisites

  • Trae IDE
  • Node.js (for running the skill)
  • Python (for knowledge management modules)

4.2 Installation

  1. Clone the repository (if not already done):

    git clone <repository-url>
    cd rfd3ass
  2. Install dependencies:

    # For Node.js dependencies
    npm install
    
    # For Python dependencies
    pip install -r requirements.txt
  3. Configure the skill: The skill is automatically detected by Trae when placed in the .trae/skills/ directory.


5. Configuration

5.1 Skill Configuration

Edit .trae/skills/rfd3ass/config.json to customize skill settings:

{
  "config": {
    "directories": {
      "scripts": "../../rfd3ass/scripts",
      "knowledge": "../../rfd3ass/knowledge"
    },
    "commands": {
      "run": {
        "description": "Run a script",
        "usage": "run <script-name>",
        "handler": "run_script"
      }
    }
  }
}

6. Using the Skill

6.1 Basic Commands

List available scripts:

list scripts

Run a script:

run <script-name>

List knowledge files:

list knowledge

Search knowledge:

search knowledge <query>

6.2 Core Scripts

  • pdd – Prompt-Driven Development
  • code-assist – Coding + TDD assistant
  • technical-design-document-generator – Design doc generator
  • debug-service-issues – Production debugging

7. Knowledge Management

Teams can add domain knowledge under knowledge/ and the skill will automatically consume it. Knowledge files can be in Markdown (.md), JSON (.json), or YAML (.yaml/.yml) format.

7.1 Adding Knowledge Files

  1. Create a new file in the knowledge/ directory
  2. Use clear and descriptive naming conventions
  3. Include relevant metadata (for Markdown files, use YAML front matter)
  4. Organize content with logical headings

7.2 Example Knowledge File

---
title: AWS Lambda Best Practices
author: txtpower community
created: 2024-01-01
updated: 2024-01-02
tags:
  - aws
  - lambda
  - best-practices
---

# AWS Lambda Best Practices

## Overview

This document provides best practices for working with AWS Lambda functions...

8. Extending the Skill

8.1 Adding Custom Scripts

  1. Create a new .script.md file in the scripts/ directory
  2. Follow the script format used in existing scripts
  3. Test the script before sharing it with the team

8.2 Adding Custom Knowledge

  1. Create a new knowledge file in the knowledge/ directory
  2. Use appropriate format (Markdown, JSON, or YAML)
  3. Organize content logically with clear headings

9. Troubleshooting

9.1 Common Issues

Script not found

  • Issue: Script not found: <script-name>
  • Solution: Check that the script file exists in the scripts/ directory with the correct .script.md extension

Knowledge directory not found

  • Issue: Knowledge directory not found
  • Solution: Check that the knowledge/ directory exists and contains knowledge files

9.2 Logs

Skill execution logs are available in the Trae IDE console. For more detailed logs, check the Trae IDE's developer console.


10. Philosophy

Community-driven experimentation → standardization.

This package is maintained by the txtpower community, and we welcome contributions and feedback. Together, we can make GenAI tooling more effective for all developers.


11. Contributing

To contribute to this project:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Please ensure your contributions follow the existing code style and documentation conventions.


12. License

This project is licensed under the MIT License. See the LICENSE file for details.


13. Contact

For questions or feedback, please contact the txtpower community.


14. RFD3 智能代理

14.1 什么是 RFD3 智能代理?

RFD3 智能代理是一个基于 Trae 原生能力实现的智能助手,用于回答关于 RFD3 (RFdiffusion3) 的使用问题。它利用 Trae 的内置搜索和 AI 能力,无需部署额外模型,即可为用户提供关于 RFD3 的详细使用指导。

14.2 路径配置修改指南

当其他人使用这个技能时,需要修改 .trae/skills/rfd3ass 中的路径配置,以确保技能能够正确访问相关目录和 Foundry 项目。

14.2.1 需要修改的文件

.trae/skills/rfd3ass/config.json

此文件包含技能的配置信息,包括目录路径和命令定义。

14.2.2 具体修改项

  1. 脚本和知识库路径

    如果 rfd3ass 目录的位置发生变化,需要修改以下路径:

    "config": {
      "directories": {
        "scripts": "../../rfd3ass/scripts",  // 脚本目录路径
        "knowledge": "../../rfd3ass/knowledge",  // 知识库目录路径
        "foundry": "C:\\Users\\XXX\\foundry"  // Foundry 项目路径
      }
    }
  2. Foundry 项目路径

    这是最重要的修改项,需要将 Foundry 项目路径修改为您本地的 Foundry 项目路径:

    "foundry": "C:\\Users\\your-username\\foundry"  // 修改为您的 Foundry 项目路径

14.2.3 修改示例

修改前:

"config": {
  "directories": {
    "scripts": "../../rfd3ass/scripts",
    "knowledge": "../../rfd3ass/knowledge",
    "foundry": "C:\\Users\\XXX\\foundry"
  }
}

修改后:

"config": {
  "directories": {
    "scripts": "../../rfd3ass/scripts",  // 保持相对路径不变
    "knowledge": "../../rfd3ass/knowledge",  // 保持相对路径不变
    "foundry": "C:\\Users\\john\\foundry"  // 修改为新的 Foundry 路径
  }
}

14.2.4 验证路径配置

修改路径配置后,可以使用以下命令验证配置是否正确:

list knowledge

如果命令成功执行并列出知识库文件,则说明路径配置正确。

14.3 安装和配置

步骤 1:创建 RFD3 Agent 脚本文件

  1. 确保 rfd3ass/scripts/ 目录存在
  2. 创建 rfd3-agent.script.md 文件,内容如下:
# RFD3 使用智能代理(Trae 原生版)

## 目的
此脚本创建一个智能代理,利用 Trae 内置能力回答关于 RFD3 (RFdiffusion3) 的使用问题,无需部署额外模型。

## 工作流程

### 步骤 1:接收用户问题

用户问题: <user_question>


### 步骤 2:搜索知识库

使用 Trae 命令搜索知识库: search knowledge <user_question>


### 步骤 3:生成回答

基于搜索结果,生成对用户问题的详细回答: <user_question> <search_results>


### 步骤 4:处理后续追问

如果用户有后续追问,基于之前的对话生成回答: <follow_up_question> <previous_dialog> </previous_dialog>


## 使用示例

### 示例 1:安装问题

用户问题:如何安装 RFD3?

使用 Trae 命令搜索知识库: search knowledge 安装 RFD3

基于搜索结果,生成对用户问题的详细回答: 如何安装 RFD3? [搜索结果中的相关内容]


### 示例 2:使用 RFD3 问题

用户问题:如何使用 RFD3 运行推理?

使用 Trae 命令搜索知识库: search knowledge RFD3 运行推理

基于搜索结果,生成对用户问题的详细回答: 如何使用 RFD3 运行推理? [搜索结果中的相关内容]

步骤 2:更新配置文件,添加 rfd3 命令

  1. 打开 .trae/skills/rfd3ass/config.json 文件
  2. commands 部分添加 rfd3 命令配置:
"rfd3": {
  "description": "Ask RFD3 usage questions",
  "usage": "rfd3 <question>",
  "handler": "handle_rfd3_agent"
}

步骤 3:修改实现文件,添加 RFD3 Agent 命令处理函数

  1. 打开 .trae/skills/rfd3ass/index.js 文件
  2. 添加 handleRfd3Agent 函数和 generateRfd3Response 函数:
// 添加 RFD3 Agent 命令处理
function handleRfd3Agent(args) {
  const userQuestion = args.join(' ');
  console.log(`Processing RFD3 agent query: ${userQuestion}`);
  
  // 1. 搜索知识库(使用 Trae 内置的搜索能力)
  const searchResults = searchKnowledge(userQuestion);
  
  // 2. 提取相关信息
  let retrievedInformation = '';
  if (searchResults.success && searchResults.results) {
    searchResults.results.forEach(result => {
      retrievedInformation += `\n---\n**${result.path}**\n${result.preview}`;
    });
  }
  
  // 3. 生成回答(利用 Trae 内置的 AI 能力)
  const response = generateRfd3Response(userQuestion, retrievedInformation);
  
  return {
    success: true,
    message: `RFD3 agent response for: ${userQuestion}`,
    response: response,
    retrieved_information: retrievedInformation
  };
}

// 生成 RFD3 相关回答
function generateRfd3Response(question, information) {
  if (!information) {
    return `抱歉,我在知识库中没有找到与"${question}"相关的信息。请尝试更具体的问题,或检查知识库内容是否完整。`;
  }
  
  // 利用 Trae 内置的 AI 能力生成回答
  // 这里直接基于检索到的信息构建回答,无需外部模型
  return `基于 RFD3 知识库的信息,对您的问题"${question}"的回答如下:\n\n${information}\n\n希望这个回答对您有帮助!如果您有其他问题,请随时提问。`;
}
  1. handleCommand 函数中添加对 rfd3 命令的处理:
case 'rfd3':
  return handleRfd3Agent(args);
  1. module.exports 中导出 handleRfd3Agent 函数:
module.exports = {
  handleCommand,
  initialize,
  runScript,
  listResources,
  searchKnowledge,
  handleRfd3Agent
};

14.4 使用方法

基本命令

在 Trae IDE 中,您可以使用以下命令向 RFD3 智能代理提问:

rfd3 <问题>

使用示例

示例 1:安装问题

rfd3 如何安装 RFD3?

示例 2:使用 RFD3 问题

rfd3 如何使用 RFD3 运行推理?

示例 3:下载模型权重问题

rfd3 如何下载 RFD3 模型权重?

14.5 知识库管理

知识库文件

RFD3 智能代理使用以下知识库文件提供回答:

  • rfd3_overview.md – RFD3 项目概述
  • rfd3_usage.md – RFD3 使用指南
  • rfd3_parameters.md – RFD3 参数说明
  • rfd3_examples.md – RFD3 使用示例

添加新的知识库内容

  1. rfd3ass/knowledge/ 目录中创建新的 Markdown 文件
  2. 按照现有知识库文件的格式组织内容,重点关注 RFD3 的使用方法和参数
  3. 保存文件后,Trae 智能代理会自动使用新的知识库内容

14.6 故障排除

常见问题

问题Error: Unknown command: rfd3 解决方案:检查 config.json 文件中是否正确配置了 rfd3 命令

问题RFD3 agent response: 抱歉,我在知识库中没有找到与"..."相关的信息 解决方案:检查知识库文件是否存在,以及文件内容是否包含相关信息

问题:技能未初始化 解决方案:检查 index.js 文件是否正确实现了 initialize 函数,以及依赖项是否已安装

14.7 技术实现细节

RFD3 智能代理基于 Trae 原生能力实现,主要包括:

  1. 知识库搜索:使用 Trae 的内置搜索能力,在 rfd3ass/knowledge/ 目录中搜索相关信息
  2. 回答生成:利用 Trae 的内置 AI 能力,基于搜索到的信息生成详细回答
  3. 命令处理:通过 handleRfd3Agent 函数处理用户的 rfd3 命令请求

整个实现无需部署额外模型,完全基于 Trae 内置能力,确保了使用的便捷性和可靠性。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors