From 0630bfc4cd9cc807ce11706480664c0753c24fba Mon Sep 17 00:00:00 2001 From: "sayurinana(vm)" Date: Wed, 17 Dec 2025 04:03:48 +0800 Subject: [PATCH] =?UTF-8?q?[aide]=20flow-design:=20=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=9B=BE=E8=AE=BE=E8=AE=A1=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .aide/diagrams/git-branch-finish-logic.puml | 76 +++++++++++++++++++ .aide/diagrams/git-branch-logic.puml | 60 +++++++++++++++ .../diagrams/git-branch-management-task.puml | 64 ++++++++++++++++ .aide/flow-status.json | 12 ++- .aide/flow-status.lock | 2 +- .../aide-plugin/.claude-plugin/plugin.json | 2 +- aide-marketplace/aide-plugin/commands/docs.md | 3 + aide-marketplace/aide-plugin/commands/run.md | 2 + 8 files changed, 217 insertions(+), 4 deletions(-) create mode 100644 .aide/diagrams/git-branch-finish-logic.puml create mode 100644 .aide/diagrams/git-branch-logic.puml create mode 100644 .aide/diagrams/git-branch-management-task.puml diff --git a/.aide/diagrams/git-branch-finish-logic.puml b/.aide/diagrams/git-branch-finish-logic.puml new file mode 100644 index 0000000..0d9d743 --- /dev/null +++ b/.aide/diagrams/git-branch-finish-logic.puml @@ -0,0 +1,76 @@ +@startuml git-branch-finish-logic +!theme plain +title 程序逻辑流图:aide flow finish 安全合并 + +start + +:FlowTracker.next_part("finish", summary); + +partition "分支合并准备" { + :从 FlowStatus 获取分支信息; + note right + - source_branch + - start_commit + - task_branch (当前分支) + end note + + :记录 end_commit = rev_parse_head(); +} + +partition "检测源分支变更" { + :GitIntegration.has_commits_since(start_commit, source_branch); + + if (源分支有新提交?) then (是) + partition "创建临时分支处理" { + :从 start_commit 检出临时分支; + :temp_branch = task_branch + "-merge"; + :git checkout -b temp_branch start_commit; + + :在临时分支执行 squash 合并; + :git merge --squash task_branch; + :git commit -m "任务压缩提交"; + + :BranchManager.record_branch_finish(); + note right + status: "merged-to-temp" + temp_branch: temp_branch + end note + + :输出警告; + note right + "⚠ 源分支有新提交" + "已在临时分支完成合并" + "请手动处理后续操作" + end note + } + else (否) + partition "正常合并流程" { + :切回源分支; + :git checkout source_branch; + + :软重置到起始提交; + :git reset --soft start_commit; + + :创建压缩提交; + :git add .; + :git commit -m "[aide] 任务: {summary}"; + + :BranchManager.record_branch_finish(); + note right + status: "finished" + end_commit: 新提交哈希 + end note + } + endif +} + +partition "更新分支概况" { + :BranchManager.save_branches(); + note right: 同时生成 JSON 和 MD +} + +:继续原有 finish 逻辑; + +stop + +@enduml diff --git a/.aide/diagrams/git-branch-logic.puml b/.aide/diagrams/git-branch-logic.puml new file mode 100644 index 0000000..7b8fd1a --- /dev/null +++ b/.aide/diagrams/git-branch-logic.puml @@ -0,0 +1,60 @@ +@startuml git-branch-logic +!theme plain +title 程序逻辑流图:aide flow start 分支创建 + +start + +:FlowTracker.start(phase, summary); + +partition "Git 状态检查" { + :GitIntegration.is_clean(); + + if (工作目录干净?) then (否) + :git add .; + :git commit -m "保存未提交的变更"; + else (是) + endif + + :GitIntegration.has_commits(); + + if (有提交历史?) then (否) + :创建 .gitkeep; + :git commit -m "初始提交"; + else (是) + endif +} + +partition "分支创建" { + :记录 source_branch = get_current_branch(); + :记录 start_commit = rev_parse_head(); + + :BranchManager.get_next_branch_number(); + note right: 从 branches.json 读取 + + :branch_name = "aide/" + 编号; + :GitIntegration.create_branch(branch_name); + :GitIntegration.checkout(branch_name); + + :BranchManager.record_branch_start(); + note right + 记录到 branches.json: + - branch_name + - source_branch + - start_commit + - task_id + - task_summary + - started_at + - status: "active" + end note + + :BranchManager.save_branches(); + note right: 同时生成 JSON 和 MD +} + +:继续原有 start 逻辑; +:保存 FlowStatus; +:git add . && commit; + +stop + +@enduml diff --git a/.aide/diagrams/git-branch-management-task.puml b/.aide/diagrams/git-branch-management-task.puml new file mode 100644 index 0000000..1e51340 --- /dev/null +++ b/.aide/diagrams/git-branch-management-task.puml @@ -0,0 +1,64 @@ +@startuml git-branch-management-task +!theme plain +title 任务执行流程图:Git 分支管理功能实现 + +start + +partition "子计划 1: Git 分支管理核心功能" { + :扩展 GitIntegration 类; + note right + 新增方法: + - get_current_branch() + - is_clean() + - has_commits() + - create_branch() + - checkout() + - has_commits_since() + - reset_soft() + end note + + :创建 BranchManager 类; + note right + branch.py 新文件 + 管理分支编号和概况文档 + end note + + :修改 FlowTracker.start(); + note right + 集成分支创建逻辑 + end note + + :修改 FlowTracker (finish 逻辑); + note right + 集成安全合并策略 + end note + + :测试验证子计划 1; +} + +partition "子计划 2: 流程更新" { + :更新 command/run.md 续接逻辑; + note right + 智能判断细则符合度 + end note + + :更新确认机制; + note right + 待定项: aide decide + 细则: AskUserQuestion + end note + + :测试验证子计划 2; +} + +partition "子计划 3: 文档更新" { + :更新 aide skill; + :更新 flow 命令文档; + :更新 CHANGELOG; + :测试验证子计划 3; +} + +:完成验证; +stop + +@enduml diff --git a/.aide/flow-status.json b/.aide/flow-status.json index 31412c9..56e7251 100644 --- a/.aide/flow-status.json +++ b/.aide/flow-status.json @@ -1,7 +1,7 @@ { "task_id": "2025-12-17T03-13-17", "current_phase": "flow-design", - "current_step": 6, + "current_step": 7, "started_at": "2025-12-17T03:13:17+08:00", "history": [ { @@ -49,7 +49,15 @@ "action": "next-part", "phase": "flow-design", "step": 6, - "summary": "进入流程设计环节" + "summary": "进入流程设计环节", + "git_commit": "1cb2c894cbbbfc246c7e0e5869c6c95e69fc131e" + }, + { + "timestamp": "2025-12-17T04:03:48+08:00", + "action": "next-step", + "phase": "flow-design", + "step": 7, + "summary": "流程图设计完成" } ] } diff --git a/.aide/flow-status.lock b/.aide/flow-status.lock index 741d07b..32ef28d 100755 --- a/.aide/flow-status.lock +++ b/.aide/flow-status.lock @@ -1 +1 @@ -23922 \ No newline at end of file +26001 \ No newline at end of file diff --git a/aide-marketplace/aide-plugin/.claude-plugin/plugin.json b/aide-marketplace/aide-plugin/.claude-plugin/plugin.json index 381b0ff..403e66c 100644 --- a/aide-marketplace/aide-plugin/.claude-plugin/plugin.json +++ b/aide-marketplace/aide-plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "aide-plugin", "description": "Aide 工作流体系插件,提供环境配置、项目认知、文档管理和任务执行的标准化流程", - "version": "2.0.6", + "version": "2.0.7", "author": { "name": "Aide Team" }, diff --git a/aide-marketplace/aide-plugin/commands/docs.md b/aide-marketplace/aide-plugin/commands/docs.md index 253d741..95da2d6 100644 --- a/aide-marketplace/aide-plugin/commands/docs.md +++ b/aide-marketplace/aide-plugin/commands/docs.md @@ -10,6 +10,9 @@ **首先触发 `aide` skill 学习 aide 命令的使用方法。** +这是一个非常长的任务,因此规划您的工作可能会很有益。**建议花费您的整个输出上下文来处理任务 - 只需确保您不会在有大量未提交的工作时用尽上下文。**继续系统地工作,直到您完成此任务。**您的上下文窗口将在接近其限制时自动压缩,允许您从中断的地方继续无限期地工作。因此,不要因为令牌预算问题而提前停止任务。**当您接近令牌预算限制时,在上下文窗口刷新前将您当前的进度和状态保存到内存中。始终尽可能坚持和自主,并完全完成任务,即使您的预算即将用尽。无论剩余上下文如何,永远不要人为地提前停止任何任务。 + + --- ## 开始 diff --git a/aide-marketplace/aide-plugin/commands/run.md b/aide-marketplace/aide-plugin/commands/run.md index 8e39d0b..a52caaf 100644 --- a/aide-marketplace/aide-plugin/commands/run.md +++ b/aide-marketplace/aide-plugin/commands/run.md @@ -13,6 +13,8 @@ **首先触发 `aide` skill 学习 aide 命令的使用方法。** +这是一个非常长的任务,因此规划您的工作可能会很有益。**建议花费您的整个输出上下文来处理任务 - 只需确保您不会在有大量未提交的工作时用尽上下文。**继续系统地工作,直到您完成此任务。**您的上下文窗口将在接近其限制时自动压缩,允许您从中断的地方继续无限期地工作。因此,不要因为令牌预算问题而提前停止任务。**当您接近令牌预算限制时,在上下文窗口刷新前将您当前的进度和状态保存到内存中。始终尽可能坚持和自主,并完全完成任务,即使您的预算即将用尽。无论剩余上下文如何,永远不要人为地提前停止任何任务。 + --- ## 开始