Skip to content

Commit 6db3ef8

Browse files
committed
chore: 更新 ESLint 和 Prettier 配置,新增 lint-staged 配置文件,更新 .gitignore 文件以排除不必要的文件,增强 CI/CD 流程,添加 Husky 钩子以确保代码质量
1 parent 1de7a6c commit 6db3ef8

58 files changed

Lines changed: 2088 additions & 1677 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
{
22
"parser": "@typescript-eslint/parser",
3-
"extends": [
4-
"eslint:recommended"
5-
],
3+
"extends": ["eslint:recommended"],
64
"plugins": ["@typescript-eslint"],
75
"parserOptions": {
86
"ecmaVersion": 2022,
97
"sourceType": "module"
108
},
119
"rules": {
1210
"@typescript-eslint/no-unused-vars": "error",
13-
"@typescript-eslint/no-explicit-any": "warn",
14-
"prefer-const": "error"
11+
"@typescript-eslint/no-explicit-any": "off",
12+
"prefer-const": "error",
13+
"no-control-regex": "off"
1514
},
1615
"env": {
1716
"node": true,
1817
"es2022": true
1918
}
20-
}
19+
}

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
name: Test on Node.js ${{ matrix.node-version }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 20.x, 22.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 8
26+
27+
- name: Setup Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'pnpm'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Type check
37+
run: pnpm run type-check
38+
39+
- name: Lint
40+
run: pnpm run lint
41+
42+
- name: Format check
43+
run: pnpm run format:check
44+
45+
- name: Test
46+
run: pnpm run test:coverage
47+
48+
- name: Build
49+
run: pnpm run build
50+
51+
- name: Upload coverage to Codecov
52+
if: matrix.node-version == '20.x'
53+
uses: codecov/codecov-action@v4
54+
with:
55+
file: ./coverage/lcov.info
56+
flags: unittests
57+
name: codecov-umbrella
58+
fail_ci_if_error: false

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ temp/
4444
# WaveForge specific
4545
.wave/current-task.md
4646

47+
# Husky
48+
.husky/_
49+
50+
# Coverage reports
51+
coverage/
52+
*.lcov
53+
54+
# Test results
55+
test-results/
56+
junit.xml
57+
4758
# TypeScript cache
4859
*.tsbuildinfo
4960

.husky/pre-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# 运行 lint-staged 进行代码检查和格式化
5+
pnpm exec lint-staged
6+
7+
# 运行类型检查
8+
pnpm run type-check
9+
10+
# 运行所有测试
11+
pnpm test

.lintstagedrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"*.{ts,js,json,md}": ["prettier --write"],
3+
"*.{ts,js}": ["eslint --fix"],
4+
"src/**/*.ts": ["vitest related --run"]
5+
}

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"printWidth": 80,
66
"tabWidth": 2,
77
"useTabs": false
8-
}
8+
}

CHANGLOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Added
1919

20-
- Initial project structure for the `WaveForge` methodology
21-
- Complete Chinese documentation (`.cursor-zh`) including roles, templates, rules, and examples.
22-
- Complete English translation (`.cursor-en`) of all methodology documents and examples.
20+
- Initial project structure for the `WaveForge` methodology
21+
- Complete Chinese documentation (`.cursor-zh`) including roles, templates, rules, and examples.
22+
- Complete English translation (`.cursor-en`) of all methodology documents and examples.
2323

2424
### Changed
2525

26-
- Overhauled the main `README.md` for a more professional and visually appealing layout, including a new logo, badges, and a Star History chart.
27-
- Clarified the project's vision and its deep integration with the Cursor editor in the `README.md`.
26+
- Overhauled the main `README.md` for a more professional and visually appealing layout, including a new logo, badges, and a Star History chart.
27+
- Clarified the project's vision and its deep integration with the Cursor editor in the `README.md`.

README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ WaveForge is in active design and development. The core design for its MCP-based
2525
## ✨ Feature Highlights
2626

2727
- **Intelligent Task System**
28-
- **Two-Level Task Model**: Easily manage complex tasks with a structure of "Overall Plans" and "Specific Steps." Get a high-level overview while focusing on the immediate task, unifying macro and micro perspectives.
29-
- **Automation-Driven Workflow**: When the last step of a plan is completed, the system automatically completes the plan and prompts the AI to generate steps for the next one. This "relay race" style of automation makes task progression seamless.
28+
- **Two-Level Task Model**: Easily manage complex tasks with a structure of "Overall Plans" and "Specific Steps." Get a high-level overview while focusing on the immediate task, unifying macro and micro perspectives.
29+
- **Automation-Driven Workflow**: When the last step of a plan is completed, the system automatically completes the plan and prompts the AI to generate steps for the next one. This "relay race" style of automation makes task progression seamless.
3030
- **Seamless Multi-Agent & Cross-Tool Collaboration**
31-
- **Unique Project Identifier**: A revolutionary project-binding mechanism eliminates dependency on the current working directory (CWD) or editor workspace. No matter which tool (Cursor, VSCode, Kiro) or terminal you're in, all agents are guaranteed to collaborate within the same project context.
32-
- **Real-Time Sync Guarantee**: Ensures data consistency and avoids state conflicts during parallel operations by multiple agents through file locking and state versioning.
31+
- **Unique Project Identifier**: A revolutionary project-binding mechanism eliminates dependency on the current working directory (CWD) or editor workspace. No matter which tool (Cursor, VSCode, Kiro) or terminal you're in, all agents are guaranteed to collaborate within the same project context.
32+
- **Real-Time Sync Guarantee**: Ensures data consistency and avoids state conflicts during parallel operations by multiple agents through file locking and state versioning.
3333
- **Developer Experience First**
34-
- **Zero-Config Start & Self-Healing**: On its first run, it automatically and idempotently creates the necessary directory structure, templates, and configuration files. Ready to use out-of-the-box with no tedious setup.
35-
- **One-Click Devlog Generation**: Upon task completion, a single confirmation automatically generates two styles of development logs from a template: `timeline` (a faithful record of the execution trace) and `narrative` (story-like storytelling). The logs aggregate Git commits, file changes, test results, and key discussions, making documentation effortless.
36-
- **Comprehensive Traceability (Provenance)**: Automatically collects and organizes all task-related information, including Git commit ranges, PR/Issue links, requirement document paths, and meeting notes, to build a complete traceable information view.
34+
- **Zero-Config Start & Self-Healing**: On its first run, it automatically and idempotently creates the necessary directory structure, templates, and configuration files. Ready to use out-of-the-box with no tedious setup.
35+
- **One-Click Devlog Generation**: Upon task completion, a single confirmation automatically generates two styles of development logs from a template: `timeline` (a faithful record of the execution trace) and `narrative` (story-like storytelling). The logs aggregate Git commits, file changes, test results, and key discussions, making documentation effortless.
36+
- **Comprehensive Traceability (Provenance)**: Automatically collects and organizes all task-related information, including Git commit ranges, PR/Issue links, requirement document paths, and meeting notes, to build a complete traceable information view.
3737

3838
## 🚀 Getting Started
3939

@@ -44,32 +44,35 @@ For detailed instructions on installation, configuration, and usage, please see
4444
We are actively working on implementing the following core features. Feel free to join the discussion or contribute!
4545

4646
### Core Framework
47+
4748
- [ ] **Project Binding & Environment Self-Healing**
48-
- [ ] `project_bind`: Implement unique binding between a project and the MCP service, eliminating CWD dependency.
49-
- [ ] `project_info`: Get information about the currently bound project.
50-
- [ ] **Initialization & Self-Healing**: Automatically create the `.wave` directory structure, templates, and config files on the first run.
49+
- [ ] `project_bind`: Implement unique binding between a project and the MCP service, eliminating CWD dependency.
50+
- [ ] `project_info`: Get information about the currently bound project.
51+
- [ ] **Initialization & Self-Healing**: Automatically create the `.wave` directory structure, templates, and config files on the first run.
5152

5253
### Task Management (MCP Tools)
54+
5355
- [ ] **Two-Level Task Model**
54-
- [ ] `current_task_init`: Initialize a new task, defining its `goal` and `overall_plan`.
55-
- [ ] `current_task_modify`: Dynamically adjust tasks, including the `plan`, `steps`, `goal`, or adding `hints` for the AI.
56-
- [ ] `current_task_update`: Update the status of a `plan` or `step`.
56+
- [ ] `current_task_init`: Initialize a new task, defining its `goal` and `overall_plan`.
57+
- [ ] `current_task_modify`: Dynamically adjust tasks, including the `plan`, `steps`, `goal`, or adding `hints` for the AI.
58+
- [ ] `current_task_update`: Update the status of a `plan` or `step`.
5759
- [ ] **Task Lifecycle**
58-
- [ ] `current_task_read`: Read the full context of the current task to sync between clients.
59-
- [ ] `current_task_complete`: Mark a task as complete and trigger Devlog generation.
60-
- [ ] `task_list`: View a list of historical tasks.
61-
- [ ] `task_switch`: Switch between different tasks.
60+
- [ ] `current_task_read`: Read the full context of the current task to sync between clients.
61+
- [ ] `current_task_complete`: Mark a task as complete and trigger Devlog generation.
62+
- [ ] `task_list`: View a list of historical tasks.
63+
- [ ] `task_switch`: Switch between different tasks.
6264
- [ ] **Process Logging & Traceability**
63-
- [ ] `current_task_log`: Log key discussions, decisions, or exceptions during development.
64-
- [ ] **Provenance**: Automatically associate Git commits, PR/Issue links, and other artifacts.
65+
- [ ] `current_task_log`: Log key discussions, decisions, or exceptions during development.
66+
- [ ] **Provenance**: Automatically associate Git commits, PR/Issue links, and other artifacts.
6567

6668
### Automation & Doc Generation
69+
6770
- [ ] **Automated Workflow**
68-
- [ ] Automatically mark a plan as completed when all its steps are done.
69-
- [ ] Prompt the AI to generate steps when starting a new plan.
71+
- [ ] Automatically mark a plan as completed when all its steps are done.
72+
- [ ] Prompt the AI to generate steps when starting a new plan.
7073
- [ ] **Devlog Auto-Generation**
71-
- [ ] `devlog_prepare_context`: Prepare the context needed for Devlog generation.
72-
- [ ] `generate_devlog`: Populate `timeline` and `narrative` devlogs from templates using task snapshots, logs, and Git history.
74+
- [ ] `devlog_prepare_context`: Prepare the context needed for Devlog generation.
75+
- [ ] `generate_devlog`: Populate `timeline` and `narrative` devlogs from templates using task snapshots, logs, and Git history.
7376

7477
## Workflow: From Idea to Implementation
7578

README.zh-CN.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ WaveForge 正处于活跃的设计与开发阶段,核心的 MCP 任务管理
2626
## ✨ 亮点功能
2727

2828
- **智能任务系统**
29-
- **双层级任务模型**:通过“整体计划 (Plan)”和“具体步骤 (Step)”的结构,轻松驾驭复杂任务。既能总览全局,又能聚焦当下,实现宏观与微观的统一。
30-
- **自动化流程驱动**:当计划的最后一步完成时,系统会自动完成该计划并提示 AI 为下一个计划生成步骤。这种“接力棒”式的自动化,让任务推进如丝般顺滑。
29+
- **双层级任务模型**:通过“整体计划 (Plan)”和“具体步骤 (Step)”的结构,轻松驾驭复杂任务。既能总览全局,又能聚焦当下,实现宏观与微观的统一。
30+
- **自动化流程驱动**:当计划的最后一步完成时,系统会自动完成该计划并提示 AI 为下一个计划生成步骤。这种“接力棒”式的自动化,让任务推进如丝般顺滑。
3131
- **无缝的多 Agent 与跨工具协作**
32-
- **项目唯一标识**:革命性的项目绑定机制,彻底摆脱对当前工作目录 (CWD) 或编辑器工作区的依赖。无论你在哪个工具(Cursor, VSCode, Kiro)或终端中,都能确保所有 Agent 在同一个项目上下文中协作,不再有“找不着北”的烦恼。
33-
- **实时同步保障**:通过文件锁和状态版本控制,确保多个 Agent 并行操作时的数据一致性,避免状态冲突。
32+
- **项目唯一标识**:革命性的项目绑定机制,彻底摆脱对当前工作目录 (CWD) 或编辑器工作区的依赖。无论你在哪个工具(Cursor, VSCode, Kiro)或终端中,都能确保所有 Agent 在同一个项目上下文中协作,不再有“找不着北”的烦恼。
33+
- **实时同步保障**:通过文件锁和状态版本控制,确保多个 Agent 并行操作时的数据一致性,避免状态冲突。
3434
- **开发者体验至上**
35-
- **零配置启动与自愈**:首次运行自动创建所需目录结构、模板和配置文件,并具备幂等性。开箱即用,无需繁琐配置。
36-
- **一键生成 Devlog**:任务完成后,只需一步确认,即可基于模板自动生成两种风格的开发日志:`timeline`(忠实记录执行轨迹)和 `narrative`(故事化叙事)。日志内容自动聚合 Git 提交、文件变更、测试结果和关键讨论,将繁琐的文档工作化为无形。
37-
- **全面的可追溯性 (Provenance)**:自动采集和整理与任务相关的一切信息,包括 Git 提交范围、PR/Issue 链接、需求文档路径、会议纪要等,构建完整的可溯源信息视图。
35+
- **零配置启动与自愈**:首次运行自动创建所需目录结构、模板和配置文件,并具备幂等性。开箱即用,无需繁琐配置。
36+
- **一键生成 Devlog**:任务完成后,只需一步确认,即可基于模板自动生成两种风格的开发日志:`timeline`(忠实记录执行轨迹)和 `narrative`(故事化叙事)。日志内容自动聚合 Git 提交、文件变更、测试结果和关键讨论,将繁琐的文档工作化为无形。
37+
- **全面的可追溯性 (Provenance)**:自动采集和整理与任务相关的一切信息,包括 Git 提交范围、PR/Issue 链接、需求文档路径、会议纪要等,构建完整的可溯源信息视图。
3838

3939
## 🚀 快速上手
4040

@@ -45,36 +45,39 @@ WaveForge 正处于活跃的设计与开发阶段,核心的 MCP 任务管理
4545
我们正在积极推进以下核心功能的实现,欢迎你加入讨论或贡献代码!
4646

4747
### 核心框架
48+
4849
- [ ] **项目绑定与环境自愈**
49-
- [ ] `project_bind`: 实现项目与 MCP 服务的唯一绑定,摆脱对 CWD 的依赖。
50-
- [ ] `project_info`: 获取当前绑定的项目信息。
51-
- [ ] **初始化与自愈**:首次运行时自动创建 `.wave` 目录结构、模板及配置文件。
50+
- [ ] `project_bind`: 实现项目与 MCP 服务的唯一绑定,摆脱对 CWD 的依赖。
51+
- [ ] `project_info`: 获取当前绑定的项目信息。
52+
- [ ] **初始化与自愈**:首次运行时自动创建 `.wave` 目录结构、模板及配置文件。
5253

5354
### 任务管理工具 (MCP Tools)
55+
5456
- [ ] **双层级任务模型**
55-
- [ ] `current_task_init`: 初始化新任务,定义目标 (`goal`) 和宏观计划 (`overall_plan`)。
56-
- [ ] `current_task_modify`: 动态调整任务,支持:
57-
- `plan`: 整体调整计划。
58-
- `steps`: 为当前计划生成或修改具体步骤。
59-
- `goal`: 微调验收标准。
60-
- `hints`: 为 AI 添加上下文提示。
61-
- [ ] `current_task_update`: 更新计划 (`plan`) 或步骤 (`step`) 的状态。
57+
- [ ] `current_task_init`: 初始化新任务,定义目标 (`goal`) 和宏观计划 (`overall_plan`)。
58+
- [ ] `current_task_modify`: 动态调整任务,支持:
59+
- `plan`: 整体调整计划。
60+
- `steps`: 为当前计划生成或修改具体步骤。
61+
- `goal`: 微调验收标准。
62+
- `hints`: 为 AI 添加上下文提示。
63+
- [ ] `current_task_update`: 更新计划 (`plan`) 或步骤 (`step`) 的状态。
6264
- [ ] **任务生命周期**
63-
- [ ] `current_task_read`: 读取当前任务的完整上下文,便于在不同客户端间同步。
64-
- [ ] `current_task_complete`: 标记任务完成,并触发开发日志 (Devlog) 生成。
65-
- [ ] `task_list`: 查看历史任务列表。
66-
- [ ] `task_switch`: 在不同任务间切换。
65+
- [ ] `current_task_read`: 读取当前任务的完整上下文,便于在不同客户端间同步。
66+
- [ ] `current_task_complete`: 标记任务完成,并触发开发日志 (Devlog) 生成。
67+
- [ ] `task_list`: 查看历史任务列表。
68+
- [ ] `task_switch`: 在不同任务间切换。
6769
- [ ] **过程记录与追溯**
68-
- [ ] `current_task_log`: 记录开发过程中的关键讨论、决策或异常。
69-
- [ ] **可追溯性 (Provenance)**: 自动关联 Git 提交、PR/Issue 链接等信息。
70+
- [ ] `current_task_log`: 记录开发过程中的关键讨论、决策或异常。
71+
- [ ] **可追溯性 (Provenance)**: 自动关联 Git 提交、PR/Issue 链接等信息。
7072

7173
### 自动化与文档生成
74+
7275
- [ ] **自动化流程**
73-
- [ ] 当计划的所有步骤完成后,自动将计划标记为完成。
74-
- [ ] 当进入新计划时,提示 AI 生成具体步骤。
76+
- [ ] 当计划的所有步骤完成后,自动将计划标记为完成。
77+
- [ ] 当进入新计划时,提示 AI 生成具体步骤。
7578
- [ ] **Devlog 自动生成**
76-
- [ ] `devlog_prepare_context`: 准备生成 Devlog 所需的上下文。
77-
- [ ] `generate_devlog`: 基于模板,将任务快照、日志、Git 历史等信息填充为 `timeline``narrative` 两种风格的开发日志。
79+
- [ ] `devlog_prepare_context`: 准备生成 Devlog 所需的上下文。
80+
- [ ] `generate_devlog`: 基于模板,将任务快照、日志、Git 历史等信息填充为 `timeline``narrative` 两种风格的开发日志。
7881

7982
## 协作流程:从灵感到实现
8083

USAGE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pnpm start
5050
Checks the server's health status, returning uptime, memory usage, etc.
5151

5252
**Schema:**
53+
5354
```json
5455
{
5556
"name": "health",
@@ -67,6 +68,7 @@ Checks the server's health status, returning uptime, memory usage, etc.
6768
Tests the server connection and can optionally echo a message.
6869

6970
**Schema:**
71+
7072
```json
7173
{
7274
"name": "ping",
@@ -96,7 +98,6 @@ Tests the server connection and can optionally echo a message.
9698
| `WF_DEVLOG_TEMPLATE` | Path to the Devlog template | `.wave/templates/devlog-template.md` |
9799
| `WF_DEBUG` | Debug mode (`true` or `false`) | `false` |
98100

99-
100101
### MCP Client Configuration
101102

102103
Add the following to your MCP client configuration:
@@ -113,4 +114,4 @@ Add the following to your MCP client configuration:
113114
}
114115
}
115116
}
116-
```
117+
```

0 commit comments

Comments
 (0)