Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f73ba32
feat: add dt-skills cli support
Jun 5, 2026
0403644
feat: introduce skillsStorageReady middleware to ensure storage readi…
Jun 14, 2026
f1e1ff6
feat: refactor SkillDetailContent and introduce new components for im…
Jun 14, 2026
f88128d
refactor: remove registry authentication flows
Jun 14, 2026
12cf830
fix: avoid misclassifying valid UTF-8 as binary
Jun 14, 2026
cb9cc15
fix: preserve all skill files during publish and update
Jun 14, 2026
ca80f0a
fix: cache skills storage initialization
Jun 14, 2026
7892215
fix: bundle skill fingerprint contract in dt-skill
Jun 14, 2026
b466c63
refactor(dt-skill): remove upstream package, sync, and clawdbot code
Jun 16, 2026
8d9567f
refactor: rename ClawHub protocol to dt-skill and skillsRegistry
Jun 16, 2026
a044ae4
chore: apply PR review fixes for version and SkillCard styles
Jun 17, 2026
9698930
style: drop satisfies in github.ts and run prettier across repo
Jun 18, 2026
25530d0
chore: clean up lint errors after prettier unblock
Jun 18, 2026
6dfe7ac
fix(skills): harden publish pipeline security and import UX
Jun 28, 2026
705488e
style(skills): widen package detail layout and add responsive max-width
Jul 1, 2026
288a697
chore: fix prettier and replace CLAUDE.md with symlink to AGENTS.md
Jul 1, 2026
ca6ba12
feat(skills): split agents definitions, add installer module, expand TUI
Jul 1, 2026
409d701
refactor(skills): deepen install pipeline, lockfile, schema, http seam
Jul 1, 2026
d493c0e
fix(skills): normalize file path in getSkillFileContent
Jul 1, 2026
0c29eb2
chore: fix prettier
Jul 2, 2026
637cce4
fix: pass prettier check for dt-skill
Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ app/view/
test.js

config/manifest.json

dt-skill/dist/
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,23 @@ app/view

# Research docs (working notes, not for commit)
docs/research

# Local Agent configuration & test skill folder
.agents/
test-cli-skill/

# Universal/Dev tools ignores
dist/
build/
*.log
.env*
.DS_Store
Thumbs.db
*.tmp
*.swp
.vscode/
.idea/


# lavish review artifacts
.lavish/
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ app/view/
public

config/manifest.json

# Build output and runtime data (already in .gitignore)
dt-skill/dist/
run/
2 changes: 2 additions & 0 deletions .serena/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/cache
/project.local.yml
133 changes: 133 additions & 0 deletions .serena/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# the name by which the project can be referenced within Serena
project_name: "doraemon"


# list of languages for which language servers are started; choose from:
# al angular ansible bash clojure
# cpp cpp_ccls crystal csharp csharp_omnisharp
# dart elixir elm erlang fortran
# fsharp go groovy haskell haxe
# hlsl html java json julia
# kotlin lean4 lua luau markdown
# matlab msl nix ocaml pascal
# perl php php_phpactor powershell python
# python_jedi python_ty r rego ruby
# ruby_solargraph rust scala scss solidity
# svelte swift systemverilog terraform toml
# typescript typescript_vts vue yaml zig
# (This list may be outdated. For the current list, see values of Language enum here:
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
# For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
# Note:
# - For C, use cpp
# - For JavaScript, use typescript
# - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root)
# - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm)
# - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three)
# - For Free Pascal/Lazarus, use pascal
# Special requirements:
# Some languages require additional setup/installations.
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
# When using multiple languages, the first language server that supports a given file will be used for that file.
# The first language is the default language and the respective language server will be used as a fallback.
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
languages:
- typescript

# the encoding used by text files in the project
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
encoding: "utf-8"

# line ending convention to use when writing source files.
# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
line_ending:

# The language backend to use for this project.
# If not set, the global setting from serena_config.yml is used.
# Valid values: LSP, JetBrains
# Note: the backend is fixed at startup. If a project with a different backend
# is activated post-init, an error will be returned.
language_backend:

# whether to use project's .gitignore files to ignore files
ignore_all_files_in_gitignore: true

# advanced configuration option allowing to configure language server-specific options.
# Maps the language key to the options.
# The settings are considered only if the project is trusted (see global configuration to define trusted projects).
# See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings
ls_specific_settings: {}

# list of additional workspace folder paths for cross-package reference support (e.g. in monorepos).
# Paths can be absolute or relative to the project root.
# Each folder is registered as an LSP workspace folder, enabling language servers to discover
# symbols and references across package boundaries.
# Currently supported for: TypeScript.
# Example:
# additional_workspace_folders:
# - ../sibling-package
# - ../shared-lib
additional_workspace_folders: []

# list of additional paths to ignore in this project.
# Same syntax as gitignore, so you can use * and **.
# Note: global ignored_paths from serena_config.yml are also applied additively.
ignored_paths: []

# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false

# list of tool names to exclude.
# This extends the existing exclusions (e.g. from the global configuration)
# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
excluded_tools: []

# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default).
# This extends the existing inclusions (e.g. from the global configuration).
# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
included_optional_tools: []

# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
fixed_tools: []

# list of mode names that are to be activated by default, overriding the setting in the global configuration.
# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
# If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply.
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
# Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply
# for this project.
# This setting can, in turn, be overridden by CLI parameters (--mode).
# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
default_modes:

# list of mode names to be activated additionally for this project, e.g. ["query-projects"]
# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
added_modes:

# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""

# time budget (seconds) per tool call for the retrieval of additional symbol information
# such as docstrings or parameter information.
# This overrides the corresponding setting in the global configuration; see the documentation there.
# If null or missing, use the setting from the global configuration.
symbol_info_budget:

# list of regex patterns which, when matched, mark a memory entry as read‑only.
# Extends the list from the global configuration, merging the two lists.
read_only_memory_patterns: []

# list of regex patterns for memories to completely ignore.
# Matching memories will not appear in list_memories or activate_project output
# and cannot be accessed via read_memory or write_memory.
# To access ignored memory files, use the read_file tool on the raw file path.
# Extends the list from the global configuration, merging the two lists.
# Example: ["_archive/.*", "_episodes/.*"]
ignored_memory_patterns: []
158 changes: 158 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# AGENTS.md

This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.

**项目**: dt-doraemon (哆啦A梦) — 开发者工具箱平台,包含代理服务、主机管理、配置中心、MCP 服务器注册中心、Skills 市场等模块。

**技术栈**: Egg.js 2.x + React 16 SSR + MySQL (Sequelize) + Webpack 4 + Redux + Socket.IO。

## 环境准备

项目使用 Node.js 18(`.nvmrc` 锁定为 `18.20.3`),依赖管理使用 Yarn。

```bash
# 切换到正确的 Node 版本
fnm use 18
# 或
nvm use

# 安装依赖
yarn install
```

## 常用命令

```bash
# 开发启动(Egg.js dev + Webpack HMR,访问 http://127.0.0.1:7001)
npm run dev

# 生产启动
npm start

# 构建前端资源
npm run build

# 代码检查
npm run lint # prettier + eslint + stylelint
npm run lint:fix # 自动修复
npm run check-types # TypeScript 类型检查(仅前端 app/web/)

# 单独运行测试(主项目使用 Node.js 内置 test runner)
node --test test/*.test.js

# dt-skill CLI 子项目(独立 npm 包)
cd dt-skill
npm run build
npm run test:src # vitest 测试
node bin/dt-skill.js --help
```

## 项目结构

```
app/
controller/ # Egg.js 控制器(路由处理)
service/ # Egg.js 服务层(业务逻辑)
model/ # Sequelize 模型定义
middleware/ # Egg.js 中间件(access, proxy)
schedule/ # Egg.js 定时任务
web/ # React 前端源码(SSR)
pages/ # 页面组件
router/ # React Router 配置
store/ # Redux store(thunk + devtools)
api/ # API 请求封装(基于 url + method 映射)
layouts/ # 布局组件(basicLayout, sider, header)
mcp/ # MCP 服务器生命周期管理逻辑
agent/ # Agent 进程 MCP 相关处理器
utils/ # 后端工具函数
config/
config.default.js # Egg.js 默认配置
config.local.js # 本地开发配置(含 MySQL、Webpack)
config.test.js # 测试环境配置
config.prod.js # 生产配置
plugin.js # Egg.js 插件注册(sequelize, reactssr, io, ssh)
dt-skill/ # ClawHub CLI 子项目(TypeScript + Vitest,独立包)
specs/ # 功能规格说明文档
sql/ # 数据库初始化 SQL(doraemon.sql)
test/ # 主项目测试文件(Node.js 内置 test runner)
```

## 后端架构

### Egg.js 应用结构
- **入口**: `app.js` (AppBootHook) 和 `agent.js` (Agent 进程生命周期)。
- **路由**: `app/router.js` 集中定义所有 RESTful 路由和代理路由 `/proxy/:id/*`。
- **MCP 生命周期**: Agent 进程 (`agent.js`) 负责 MCP 服务器的启动、停止、重启代理。Worker 进程通过 `app.messenger` 与 Agent 通信。
- **定时任务**: `app/schedule/` 包含文章订阅和 MCP 健康检查任务。
- **文件上传**: 使用 Egg.js multipart,临时文件存放于 `cache/uploads/`,大小限制 200MB,白名单允许所有类型。

### 数据库
- **ORM**: Sequelize(`egg-sequelize` 插件)。
- **配置位置**: `config/config.local.js`(本地默认数据库 `doraemon_test`,host `127.0.0.1`,用户名 `root`,密码 `123456`)。
- **生产配置**: 从 `env.json` 的 `mysql.prod` 读取。
- **初始化**: 导入 `sql/doraemon.sql` 到 MySQL。

### 关键配置
- `env.json`: 存放 webhook URL、MySQL 配置、MCP 端口(`mcpEndpointPort: 7005`,`mcpInspectorWebPort: 7003`,`mcpInspectorServerPort: 7004`)。
- CSRF 已全局禁用(`config.default.js`)。
- `app.utils` 在 `app.js` 启动时挂载为全局工具对象。

## 前端架构

### 技术栈
- React 16.9 + Redux + Redux-Thunk + React Router 4
- Ant Design 4.15.6 + 自定义主题 (`theme.js`)
- TypeScript(仅用于前端 `app/web/`,编译目标 ES5)
- SCSS / Less(`app/web/scss/`,`app/web/pages/*/style.scss`)

### 构建
- Webpack 4 通过 `easywebpack-react` 配置(`webpack.config.js`)。
- 开发时自动注入 CSS(`injectCss: true`)。
- DLL 预打包:react, redux, react-router, xterm 等。
- 路径别名:`@` -> `app/web/`,`@env` -> `env.json`。
- 全局变量:`EASY_ENV_IS_DEV` 用于区分开发/生产环境。

### 状态管理
- Redux store 在 `app/web/store/index.ts` 创建,使用 `redux-devtools-extension`(开发环境)。
- Thunk 注入 `{ API }` 作为 extraArgument,API 通过 `app/web/api/index.ts` 根据 `url.ts` 中的 URL + method 配置自动生成。

### 路由
- 前端路由定义在 `app/web/router/index.ts`,使用 `react-router-config` 风格配置。
- 所有页面路由前缀为 `/page/*`,SSR 布局为 `BasicLayout`。
- 部分页面使用 `react-loadable` 做代码分割(如 ConfigDetail, SwitchHostsEdit)。

## 子项目 dt-skill (ClawHub CLI)

- **位置**: `dt-skill/`,独立的 npm 包,ES Module(`"type": "module"`)。
- **用途**: 命令行工具,用于安装、搜索、发布 agent skills 和 OpenClaw 包。
- **入口**: `bin/dt-skill.js`。
- **构建**: `node ./scripts/build.mjs`,输出到 `dist/`。
- **测试**: Vitest,配置在 `vitest.config.ts`(测试 `src/**/*.test.ts`)。
- **Node 版本要求**: `>=20`(与主项目的 `>=18` 不同)。

## 测试

- **主项目**: 使用 Node.js 内置 `node:test` + `node:assert/strict`。测试文件在 `test/*.test.js`。
- **dt-skill**: 使用 Vitest。运行 `cd dt-skill && npm run test:src`。
- **原则**: 测试时不应该绕过待测组件用 curl 模拟。如果要测 CLI,运行真正的 CLI 命令;如果要测 API,通过客户端发请求。

## 代码规范

- ESLint 继承 `ko-lint-config`(`.eslintrc.js`)。
- Prettier 继承 `ko-lint-config/.prettierrc`(`.prettierrc.js`)。
- Stylelint 继承 `ko-lint-config/.stylelintrc`(`.stylelintrc.js`)。
- Git 提交使用 Commitizen(`cz-conventional-changelog`),commit message 需符合 conventional commits 规范,由 husky + commitlint 校验。

## CI/CD

- GitHub Actions: `.github/workflows/CI.yml`。
- 在 `push` 到 `master` 或任意 `pull_request` 时触发。
- 流程: 安装依赖 -> Prettier -> ESLint -> Stylelint -> check-types -> build。
- Node 版本: 18.x,需设置 `NODE_OPTIONS=--openssl-legacy-provider`。

## 分支规范(CONTRIBUTING.md)

- `master`: 主干分支,用于生产发布。
- `dev`: 主开发分支。
- `feat_版本号_xxx`: 新特性分支,从 `master` 切出,开发完 PR 到 `dev`。
- `hotfix_版本号_xxx`: Bug 修复分支,从 `master` 切出,修复完 PR 到 `dev`,验证后合并到 `master`。
1 change: 1 addition & 0 deletions CLAUDE.md
Loading
Loading