From 4838b91defc2abaabb3b8b5f1d7e184a2a581120 Mon Sep 17 00:00:00 2001 From: "sayurinana(vm)" Date: Wed, 17 Dec 2025 04:12:10 +0800 Subject: [PATCH] =?UTF-8?q?[aide]=20impl:=20=E5=AD=90=E8=AE=A1=E5=88=923?= =?UTF-8?q?=20=E6=96=87=E6=A1=A3=E5=92=8CSkill=E6=9B=B4=E6=96=B0=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .aide/flow-status.json | 12 ++++++-- .aide/flow-status.lock | 2 +- CHANGELOG.md | 15 ++++++++++ .../aide-plugin/docs/skill/aide.md | 19 +++++++++++++ aide-program/docs/commands/flow.md | 28 ++++++++++++++++++- 5 files changed, 72 insertions(+), 4 deletions(-) diff --git a/.aide/flow-status.json b/.aide/flow-status.json index e88e097..ff20634 100644 --- a/.aide/flow-status.json +++ b/.aide/flow-status.json @@ -1,7 +1,7 @@ { "task_id": "2025-12-17T03-13-17", "current_phase": "impl", - "current_step": 10, + "current_step": 11, "started_at": "2025-12-17T03:13:17+08:00", "history": [ { @@ -81,7 +81,15 @@ "action": "next-step", "phase": "impl", "step": 10, - "summary": "子计划2 任务中断恢复和细则确认机制更新完成" + "summary": "子计划2 任务中断恢复和细则确认机制更新完成", + "git_commit": "c3881a94711c4a1e6c2519fd0c18bf9a84b36641" + }, + { + "timestamp": "2025-12-17T04:12:10+08:00", + "action": "next-step", + "phase": "impl", + "step": 11, + "summary": "子计划3 文档和Skill更新完成" } ] } diff --git a/.aide/flow-status.lock b/.aide/flow-status.lock index dd29037..071bcb9 100755 --- a/.aide/flow-status.lock +++ b/.aide/flow-status.lock @@ -1 +1 @@ -27130 \ No newline at end of file +27537 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d901e65..4196a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ ## 2025-12-17 +### 新增功能 + +**aide flow 自动 Git 分支管理** +- 任务开始时自动创建 `aide/NNN` 分支(三位递增编号) +- 任务结束时自动合并并压缩提交 +- 分支概况文档(JSON + MD 双格式) +- 安全合并策略(检测源分支变更,必要时创建临时分支) + +### 变更 + +**command/run 流程更新** +- 智能续接判断逻辑:检查任务细则文档,判断是否符合当前任务 +- 待定项处理强制执行 +- 任务细则生成后强制确认(使用 AskUserQuestion) + ### 优化 **/aide:docs 命令强化完整性覆盖** diff --git a/aide-marketplace/aide-plugin/docs/skill/aide.md b/aide-marketplace/aide-plugin/docs/skill/aide.md index 08aa289..ab64863 100644 --- a/aide-marketplace/aide-plugin/docs/skill/aide.md +++ b/aide-marketplace/aide-plugin/docs/skill/aide.md @@ -286,6 +286,25 @@ aide flow error "数据库连接失败,无法继续" 1. `git add .` 2. `git commit -m "[aide] <环节>: <总结>"` +#### Git 分支管理(自动) + +aide flow 命令会自动管理 Git 分支: + +**任务开始时**: +- 检查 git 状态,必要时自动提交保存 +- 创建任务分支 `aide/NNN`(三位递增编号) +- 自动切换到任务分支 +- 输出示例: `✓ 任务开始: task-optimize (分支: aide/001)` + +**任务结束时**: +- 将任务分支合并回源分支 +- 使用软重置生成压缩提交 +- 如果源分支有新提交,会创建临时分支并警告 + +**分支概况文档**: +- `.aide/branches.json` - 程序读取 +- `.aide/branches.md` - 人工查阅 + #### 流程校验 aide flow 会自动校验环节跳转是否合理: diff --git a/aide-program/docs/commands/flow.md b/aide-program/docs/commands/flow.md index 7ec355a..ffeb417 100644 --- a/aide-program/docs/commands/flow.md +++ b/aide-program/docs/commands/flow.md @@ -324,6 +324,9 @@ FlowStatus: current_step: int # 当前步骤序号 started_at: str # 开始时间(ISO格式) history: list[HistoryEntry] # 历史记录 + source_branch: str | None # 源分支名(分支管理) + start_commit: str | None # 起始提交(分支管理) + task_branch: str | None # 任务分支名(分支管理) HistoryEntry: timestamp: str # 时间戳 @@ -334,7 +337,30 @@ HistoryEntry: git_commit: str | None # git commit hash(无变更可提交/未启用 git 时为空) ``` -### 5.2 方法签名原型 +### 5.2 分支概况文件格式 + +位置:`.aide/branches.json` 和 `.aide/branches.md` + +``` +BranchesData: + next_number: int # 下一个分支编号 + branches: list[BranchInfo] # 分支记录列表 + +BranchInfo: + number: int # 分支编号 + branch_name: str # 分支名(aide/NNN) + source_branch: str # 源分支名 + start_commit: str # 起始提交 + end_commit: str | None # 结束提交 + task_id: str # 任务 ID + task_summary: str # 任务摘要 + started_at: str # 开始时间 + finished_at: str | None # 结束时间 + status: str # 状态(active/finished/merged-to-temp) + temp_branch: str | None # 临时分支名(仅安全合并时) +``` + +### 5.3 方法签名原型 ``` class FlowTracker: