feat: 添加项目规则、环境配置示例及开发文档
This commit is contained in:
93
.claude/commands/ceshi.md
Normal file
93
.claude/commands/ceshi.md
Normal file
@@ -0,0 +1,93 @@
|
||||
---
|
||||
description: ceshi
|
||||
---
|
||||
```mermaid
|
||||
flowchart TD
|
||||
start_node_default([Start])
|
||||
syntax_check[syntax-check]
|
||||
issues_check{If/Else:<br/>Conditional Branch}
|
||||
fix_issues[fix-issues]
|
||||
module_division[module-division]
|
||||
frontend_check{AskUserQuestion:<br/>这是前端项目吗?}
|
||||
unit_test_planning[unit-test-planning]
|
||||
playwright_testing[[MCP: playwright_navigate]]
|
||||
backend_unit_testing[backend-unit-testing]
|
||||
test_verification{If/Else:<br/>Conditional Branch}
|
||||
end_node_default([End])
|
||||
|
||||
start_node_default --> syntax_check
|
||||
syntax_check --> issues_check
|
||||
issues_check -->|发现问题| fix_issues
|
||||
fix_issues --> syntax_check
|
||||
issues_check -->|未发现问题| module_division
|
||||
module_division --> frontend_check
|
||||
frontend_check -->|是| unit_test_planning
|
||||
unit_test_planning --> playwright_testing
|
||||
playwright_testing --> test_verification
|
||||
frontend_check -->|否| backend_unit_testing
|
||||
backend_unit_testing --> test_verification
|
||||
test_verification -->|测试通过| end_node_default
|
||||
```
|
||||
|
||||
## Workflow Execution Guide
|
||||
|
||||
Follow the Mermaid flowchart above to execute the workflow. Each node type has specific execution methods as described below.
|
||||
|
||||
### Execution Methods by Node Type
|
||||
|
||||
- **Rectangle nodes**: Execute Sub-Agents using the Task tool
|
||||
- **Diamond nodes (AskUserQuestion:...)**: Use the AskUserQuestion tool to prompt the user and branch based on their response
|
||||
- **Diamond nodes (Branch/Switch:...)**: Automatically branch based on the results of previous processing (see details section)
|
||||
- **Rectangle nodes (Prompt nodes)**: Execute the prompts described in the details section below
|
||||
|
||||
## MCP Tool Nodes
|
||||
|
||||
#### playwright_testing(playwright_navigate)
|
||||
|
||||
**Description**: 导航到URL进行前端测试
|
||||
|
||||
**MCP Server**: playwright
|
||||
|
||||
**Tool Name**: playwright_navigate
|
||||
|
||||
**Validation Status**: valid
|
||||
|
||||
**Configured Parameters**:
|
||||
|
||||
- `url` (string): http://localhost:3000
|
||||
|
||||
**Available Parameters**:
|
||||
|
||||
- `url` (string) (required): 要导航到的测试URL
|
||||
|
||||
This node invokes an MCP (Model Context Protocol) tool. When executing this workflow, use the configured parameters to call the tool via the MCP server.
|
||||
|
||||
### AskUserQuestion Node Details
|
||||
|
||||
Ask the user and proceed based on their choice.
|
||||
|
||||
#### frontend_check(这是前端项目吗?)
|
||||
|
||||
**Selection mode:** Single Select (branches based on the selected option)
|
||||
|
||||
**Options:**
|
||||
- **是**: 需要浏览器测试的前端项目
|
||||
- **否**: 只需要单元测试的后端项目
|
||||
|
||||
### If/Else Node Details
|
||||
|
||||
#### issues_check(Binary Branch (True/False))
|
||||
|
||||
**Branch conditions:**
|
||||
- **未发现问题**: 未检测到编译或语法问题
|
||||
- **发现问题**: 检测到编译或语法问题
|
||||
|
||||
**Execution method**: Evaluate the results of the previous processing and automatically select the appropriate branch based on the conditions above.
|
||||
|
||||
#### test_verification(Binary Branch (True/False))
|
||||
|
||||
**Branch conditions:**
|
||||
- **测试通过**: 所有单元测试通过且逻辑符合预期
|
||||
- **测试失败**: 部分单元测试失败或逻辑不符合预期
|
||||
|
||||
**Execution method**: Evaluate the results of the previous processing and automatically select the appropriate branch based on the conditions above.
|
||||
90
.claude/commands/code.md
Normal file
90
.claude/commands/code.md
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
description: code
|
||||
---
|
||||
```mermaid
|
||||
flowchart TD
|
||||
start_node_default([Start])
|
||||
check_docs_1[[MCP: read_file]]
|
||||
if_docs_exist{If/Else:<br/>Conditional Branch}
|
||||
error_no_docs[error-no-docs]
|
||||
end_error([End])
|
||||
extract_steps_1[extract-steps-1]
|
||||
foreach_loop_start[foreach-loop-start]
|
||||
develop_step_1[develop-step-1]
|
||||
verify_step_1[verify-step-1]
|
||||
if_step_passed{If/Else:<br/>Conditional Branch}
|
||||
step_complete[step-complete]
|
||||
fix_bugs_1[fix-bugs-1]
|
||||
loop_back[loop-back]
|
||||
end_success([End])
|
||||
|
||||
start_node_default --> check_docs_1
|
||||
check_docs_1 --> if_docs_exist
|
||||
if_docs_exist -->|无文档| error_no_docs
|
||||
if_docs_exist -->|存在文档| extract_steps_1
|
||||
error_no_docs --> end_error
|
||||
extract_steps_1 --> foreach_loop_start
|
||||
foreach_loop_start --> develop_step_1
|
||||
develop_step_1 --> verify_step_1
|
||||
verify_step_1 --> if_step_passed
|
||||
if_step_passed -->|通过| step_complete
|
||||
if_step_passed -->|失败| fix_bugs_1
|
||||
step_complete --> end_success
|
||||
fix_bugs_1 --> loop_back
|
||||
loop_back --> develop_step_1
|
||||
```
|
||||
|
||||
## Workflow Execution Guide
|
||||
|
||||
Follow the Mermaid flowchart above to execute the workflow. Each node type has specific execution methods as described below.
|
||||
|
||||
### Execution Methods by Node Type
|
||||
|
||||
- **Rectangle nodes**: Execute Sub-Agents using the Task tool
|
||||
- **Diamond nodes (AskUserQuestion:...)**: Use the AskUserQuestion tool to prompt the user and branch based on their response
|
||||
- **Diamond nodes (Branch/Switch:...)**: Automatically branch based on the results of previous processing (see details section)
|
||||
- **Rectangle nodes (Prompt nodes)**: Execute the prompts described in the details section below
|
||||
|
||||
## MCP Tool Nodes
|
||||
|
||||
#### check_docs_1(read_file)
|
||||
|
||||
**Description**: 读取步骤文档文件
|
||||
|
||||
**MCP Server**: filesystem
|
||||
|
||||
**Tool Name**: read_file
|
||||
|
||||
**Validation Status**: valid
|
||||
|
||||
**Configured Parameters**:
|
||||
|
||||
- `file_path` (string): ./step_documentation.md
|
||||
|
||||
**Available Parameters**:
|
||||
|
||||
- `file_path` (string) (required): 步骤文档文件路径
|
||||
|
||||
This node invokes an MCP (Model Context Protocol) tool. When executing this workflow, use the configured parameters to call the tool via the MCP server.
|
||||
|
||||
### If/Else Node Details
|
||||
|
||||
#### if_docs_exist(Binary Branch (True/False))
|
||||
|
||||
**Evaluation Target**: file_content
|
||||
|
||||
**Branch conditions:**
|
||||
- **存在文档**: 文件存在且包含内容
|
||||
- **无文档**: 文件不存在或为空
|
||||
|
||||
**Execution method**: Evaluate the results of the previous processing and automatically select the appropriate branch based on the conditions above.
|
||||
|
||||
#### if_step_passed(Binary Branch (True/False))
|
||||
|
||||
**Evaluation Target**: verification_result
|
||||
|
||||
**Branch conditions:**
|
||||
- **通过**: 验证成功
|
||||
- **失败**: 验证失败
|
||||
|
||||
**Execution method**: Evaluate the results of the previous processing and automatically select the appropriate branch based on the conditions above.
|
||||
85
.claude/commands/req.md
Normal file
85
.claude/commands/req.md
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
description: req
|
||||
---
|
||||
```mermaid
|
||||
flowchart TD
|
||||
start_node_default([Start])
|
||||
prompt_requirements[请描述您的需求细节]
|
||||
analyze_project[analyze-project]
|
||||
compare_requirements[compare-requirements]
|
||||
confirm_details{AskUserQuestion:<br/>是否需要确认细节?}
|
||||
confirm_questions[提出需要确认的问题清单]
|
||||
check_complexity{If/Else:<br/>Conditional Branch}
|
||||
plan_steps[plan-steps]
|
||||
create_doc[生成步骤文档,包含所有可验证的修改步骤]
|
||||
modify_direct[modify-direct]
|
||||
end_node_default([End])
|
||||
|
||||
start_node_default --> prompt_requirements
|
||||
prompt_requirements --> analyze_project
|
||||
analyze_project --> compare_requirements
|
||||
compare_requirements --> confirm_details
|
||||
confirm_details -->|是| confirm_questions
|
||||
confirm_questions --> check_complexity
|
||||
confirm_details -->|否| check_complexity
|
||||
check_complexity -->|复杂| plan_steps
|
||||
plan_steps --> create_doc
|
||||
check_complexity -->|简单| modify_direct
|
||||
modify_direct --> end_node_default
|
||||
create_doc --> end_node_default
|
||||
```
|
||||
|
||||
## Workflow Execution Guide
|
||||
|
||||
Follow the Mermaid flowchart above to execute the workflow. Each node type has specific execution methods as described below.
|
||||
|
||||
### Execution Methods by Node Type
|
||||
|
||||
- **Rectangle nodes**: Execute Sub-Agents using the Task tool
|
||||
- **Diamond nodes (AskUserQuestion:...)**: Use the AskUserQuestion tool to prompt the user and branch based on their response
|
||||
- **Diamond nodes (Branch/Switch:...)**: Automatically branch based on the results of previous processing (see details section)
|
||||
- **Rectangle nodes (Prompt nodes)**: Execute the prompts described in the details section below
|
||||
|
||||
### Prompt Node Details
|
||||
|
||||
#### prompt_requirements(请描述您的需求细节)
|
||||
|
||||
```
|
||||
请描述您的需求细节
|
||||
```
|
||||
|
||||
#### confirm_questions(提出需要确认的问题清单)
|
||||
|
||||
```
|
||||
提出需要确认的问题清单
|
||||
```
|
||||
|
||||
#### create_doc(生成步骤文档,包含所有可验证的修改步骤)
|
||||
|
||||
```
|
||||
生成步骤文档,包含所有可验证的修改步骤
|
||||
```
|
||||
|
||||
### AskUserQuestion Node Details
|
||||
|
||||
Ask the user and proceed based on their choice.
|
||||
|
||||
#### confirm_details(是否需要确认细节?)
|
||||
|
||||
**Selection mode:** Single Select (branches based on the selected option)
|
||||
|
||||
**Options:**
|
||||
- **是**: 需要确认细节后再继续
|
||||
- **否**: 不需要确认,直接进行比对
|
||||
|
||||
### If/Else Node Details
|
||||
|
||||
#### check_complexity(Binary Branch (True/False))
|
||||
|
||||
**Evaluation Target**: modificationComplexity
|
||||
|
||||
**Branch conditions:**
|
||||
- **复杂**: 修改复杂度高,需要多步骤
|
||||
- **简单**: 修改相对简单,可直接进行
|
||||
|
||||
**Execution method**: Evaluate the results of the previous processing and automatically select the appropriate branch based on the conditions above.
|
||||
Reference in New Issue
Block a user