diff --git a/.aide/diagrams/00-overall-flow.puml b/.aide/diagrams/00-overall-flow.puml new file mode 100644 index 0000000..5e6bcd6 --- /dev/null +++ b/.aide/diagrams/00-overall-flow.puml @@ -0,0 +1,56 @@ +@startuml overall-flow +!theme plain +title Aide 工作流体系重构 - 总体执行流程 + +start + +:读取任务细则; +note right: .aide/task-spec.md + +partition "子计划 1: 配置系统增强" { + :修改 config.py; + :自文档化配置模板; + :复制 plantuml.jar; + :更新 aide init 逻辑; +} + +partition "子计划 2: aide flow 状态查看" { + :设计 flow 状态数据格式; + :实现 flow status; + :实现 flow list; + :实现 flow show; + :更新 skill 文档; +} + +partition "子计划 3: aide flow 流程图集成" { + :创建 plantuml 环境模块; + :实现校验功能; + :实现构建功能; + :集成到 flow 逻辑; +} + +partition "子计划 4: 项目文档体系" { + :设计文档结构规范; + :设计创建/更新流程; + :创建 /aide:docs command; +} + +partition "子计划 5: Commands 重组" { + :创建 /aide:setup; + :创建 /aide:load; + :重构 /aide:run; + :更新 plugin.json; +} + +partition "子计划 6: 任务分析增强" { + :复杂度评估指导原则; + :子计划结构设计; + :循环执行机制; +} + +:验证所有功能; +:更新文档; +:清理收尾; + +stop +@enduml diff --git a/.aide/diagrams/01-subplan1-config.puml b/.aide/diagrams/01-subplan1-config.puml new file mode 100644 index 0000000..7946f63 --- /dev/null +++ b/.aide/diagrams/01-subplan1-config.puml @@ -0,0 +1,66 @@ +@startuml subplan1-config +!theme plain +title 子计划 1: 配置系统增强 + +start + +:读取当前 config.py; +note right: aide-program/aide/core/config.py + +partition "1. 新增配置项支持" { + :添加 [general] 节; + note right + gitignore_aide = true/false + end note + + :添加 [docs] 节; + note right + path = "..." + block_plan_path = "..." + end note + + :添加 [flow] 节扩展; + note right + diagram_path = "..." + end note + + :添加 [plantuml] 节; + note right + jar_path = "lib/plantuml.jar" + end note +} + +partition "2. 自文档化配置模板" { + :编写 DEFAULT_CONFIG; + :添加完整 TOML 注释; + :所有配置项含说明; + :提供示例值; +} + +partition "3. 复制 plantuml.jar" { + :创建 lib/ 目录; + :复制 jar 文件; + note right + 从: /home/user/env-hub/jar/plantuml.jar + 到: aide-program/lib/plantuml.jar + end note +} + +partition "4. 修改 aide init 逻辑" { + :读取 gitignore_aide 配置; + if (gitignore_aide == true?) then (是) + :添加 .aide/ 到 .gitignore; + else (否) + :不修改 .gitignore; + endif +} + +partition "5. 更新设计文档" { + :更新 formats/config.md; + :更新 README.md; +} + +:验证配置功能; + +stop +@enduml diff --git a/.aide/diagrams/02-subplan2-flow-status.puml b/.aide/diagrams/02-subplan2-flow-status.puml new file mode 100644 index 0000000..ad437cd --- /dev/null +++ b/.aide/diagrams/02-subplan2-flow-status.puml @@ -0,0 +1,69 @@ +@startuml subplan2-flow-status +!theme plain +title 子计划 2: aide flow 状态查看功能 + +start + +partition "1. 设计数据存储格式" { + :分析现有 flow-status.json; + :设计任务列表索引; + note right + .aide/flow-index.json + 记录所有任务的 task_id 和概要 + end note + :设计归档命名规则; +} + +partition "2. 实现 flow status" { + :读取 flow-status.json; + if (文件存在?) then (是) + :解析当前状态; + :输出格式化信息; + note right + 环节: impl + 步骤: 3 + 简述: xxx + 时间: 2025-12-15 10:30 + 提交: abc1234 + end note + else (否) + :输出 "当前无活跃任务"; + endif +} + +partition "3. 实现 flow list" { + :读取 flow-index.json; + :读取 logs/ 目录下归档文件; + :合并任务列表; + :按时间倒序排列; + :输出任务列表; + note right + [1] 20251215-103000 Aide重构 (finish) + [2] 20251214-090000 贪吃蛇游戏 (impl) + end note +} + +partition "4. 实现 flow show" { + :接收 task_id 参数; + :查找对应状态文件; + if (找到?) then (是) + :解析历史记录; + :格式化输出; + note right + 输出每个历史条目: + 环节、简述、时间戳、git提交 + end note + else (否) + :输出错误 "任务不存在"; + endif +} + +partition "5. 更新相关文档" { + :更新 aide skill SKILL.md; + :更新 flow 设计文档; +} + +:测试新命令; + +stop +@enduml diff --git a/.aide/diagrams/03-subplan3-plantuml.puml b/.aide/diagrams/03-subplan3-plantuml.puml new file mode 100644 index 0000000..8d14b57 --- /dev/null +++ b/.aide/diagrams/03-subplan3-plantuml.puml @@ -0,0 +1,81 @@ +@startuml subplan3-plantuml +!theme plain +title 子计划 3: aide flow 流程图集成 + +start + +partition "1. 创建 plantuml 环境模块" { + :创建 env/modules/plantuml.py; + :继承 BaseModule; + :实现 check() 方法; + note right + 检查: + - java 命令可用 + - jar 文件存在 + end note + :注册到 registry; +} + +partition "2. 实现校验功能" { + :创建 flow/plantuml.py; + :实现 validate_puml(file_path); + note right + 调用: java -jar plantuml.jar -checkonly file.puml + 返回: (success, error_message) + end note + :实现 validate_all(directory); + note right + 遍历目录下所有 .puml 文件 + 返回: [(file, success, error)] + end note +} + +partition "3. 实现构建功能" { + :实现 build_puml(file_path); + note right + 调用: java -jar plantuml.jar -tpng file.puml + 生成: file.png + end note + :实现 build_all(directory); + note right + 遍历目录下所有 .puml 文件 + 批量生成 PNG + end note +} + +partition "4. 集成到 flow 逻辑" { + :修改 hooks.py; + + :修改 next-step 钩子; + if (当前环节 == flow-design?) then (是) + :校验流程图目录; + if (校验通过?) then (是) + :继续执行; + else (否) + :记录问题到 git; + :返回错误提示; + endif + endif + + :修改 next-part impl 钩子; + if (从 flow-design 进入?) then (是) + :校验所有 .puml 文件; + if (校验通过?) then (是) + :批量构建 PNG; + :继续执行; + else (否) + :记录问题到 git; + :返回错误提示; + endif + endif +} + +partition "5. 更新设计文档" { + :更新 hooks 设计文档; + :更新 flow 设计文档; +} + +:测试集成功能; + +stop +@enduml diff --git a/.aide/diagrams/04-subplan4-docs-system.puml b/.aide/diagrams/04-subplan4-docs-system.puml new file mode 100644 index 0000000..9651f40 --- /dev/null +++ b/.aide/diagrams/04-subplan4-docs-system.puml @@ -0,0 +1,109 @@ +@startuml subplan4-docs-system +!theme plain +title 子计划 4: 项目文档体系设计与实现 + +start + +partition "1. 设计文档结构规范" { + :设计总导览文档格式; + note right + # 项目导览 + ## 项目简介 + ## 架构概述 + ## 区块索引 + - [区块A](./blocks/a.md) + - [区块B](./blocks/b.md) + end note + + :设计子区块文档格式; + note right + # 区块名称 + ## 概述 + ## 文件清单 + ## 核心组件 + ## 接口说明 + ## 依赖关系 + end note + + :制定区块划分规则; + note right + 1. 按目录结构自然划分 + 2. 按功能模块语义划分 + 3. 单个区块不超过 5000 行 + 4. 保持区块间低耦合 + end note +} + +partition "2. 设计文档创建流程" { + :目录探索; + note right + 遍历目录结构 + 统计文件数量和大小 + 识别 .gitignore 排除项 + end note + + :初步区块划分; + note right + 根据目录结构和文件类型 + 生成初步区块计划 + end note + + :区块验证; + note right + 浅层探索各区块 + 验证划分合理性 + 调整区块边界 + end note + + :逐区块深度了解; + note right + 每个区块完整阅读 + 提取核心信息 + 生成文档 + end note + + :进度检查点; + note right + 记录进度到区块计划文档 + 支持多对话续接 + end note +} + +partition "3. 设计文档更新流程" { + :分区块验证; + note right + 对比文档与代码 + 识别差异 + end note + + :差异检测; + note right + 标记需要更新的部分 + end note + + :增量更新; + note right + 只更新有变化的区块 + 更新导览索引 + end note +} + +partition "4. 创建 /aide:docs command" { + :创建 commands/docs.md; + :定义命令流程; + note right + - 检查文档目录配置 + - 首次创建/更新逻辑 + - 区块进度追踪 + - 多对话续接支持 + end note + :强制触发 aide skill; +} + +partition "5. 更新相关文档" { + :创建文档规范文档; + :更新 plugin 设计文档; +} + +stop +@enduml diff --git a/.aide/diagrams/05-subplan5-commands.puml b/.aide/diagrams/05-subplan5-commands.puml new file mode 100644 index 0000000..764577b --- /dev/null +++ b/.aide/diagrams/05-subplan5-commands.puml @@ -0,0 +1,109 @@ +@startuml subplan5-commands +!theme plain +title 子计划 5: Commands 重组 + +start + +partition "1. 创建 /aide:setup" { + :创建 commands/setup.md; + + :定义职责; + note right + 独立运行的环境管理命令 + 专注: 分析、配置、检测、修复 + end note + + :定义流程; + note right + 1. 强制触发 env-config skill + 2. 运行 aide env ensure --runtime + 3. 分析项目依赖 + 4. 配置环境模块 + 5. 运行 aide env ensure + 6. 处理问题(重试或询问) + end note +} + +partition "2. 创建 /aide:load" { + :创建 commands/load.md; + + :定义职责; + note right + 项目文档按需载入 + 由 /aide:run 调用 + end note + + :定义流程; + note right + 1. 检查项目文档目录配置 + 2. 读取总导览文档 + 3. 建立项目脉络认知 + 4. 支持后续按需深入 + end note + + :处理文档不存在; + note right + 提示用户先执行 /aide:docs + 或按需创建文档 + end note +} + +partition "3. 重构 /aide:run" { + :创建 commands/run.md; + + :强制触发 aide skill; + + :检查 flow 状态; + if (flow 为空或已 finish?) then (是) + :启动新 flow; + note right + aide flow start task-optimize "..." + end note + :执行 task-optimize 阶段; + :处理待定项; + :生成任务细则; + else (否) + :分析当前进度; + :调用 /aide:load 载入文档; + :续接任务; + endif + + :执行 flow-design 阶段; + note right + 创建流程图 + end note + + :执行 impl 阶段; + :执行 verify 阶段; + :执行 docs 阶段; + :执行 finish 阶段; +} + +partition "4. 处理旧命令" { + :重命名 init.md → _deprecated_init.md; + :重命名 prep.md → _deprecated_prep.md; + :重命名 exec.md → _deprecated_exec.md; + note right + 保留旧文件便于参考 + 但不再注册到 plugin + end note +} + +partition "5. 更新 plugin.json" { + :移除旧命令注册; + :添加新命令注册; + note right + /aide:setup + /aide:load + /aide:docs + /aide:run + end note +} + +partition "6. 更新设计文档" { + :更新 docs/commands/; + :更新 docs/README.md; +} + +stop +@enduml diff --git a/.aide/diagrams/06-subplan6-task-analysis.puml b/.aide/diagrams/06-subplan6-task-analysis.puml new file mode 100644 index 0000000..2982369 --- /dev/null +++ b/.aide/diagrams/06-subplan6-task-analysis.puml @@ -0,0 +1,99 @@ +@startuml subplan6-task-analysis +!theme plain +title 子计划 6: 任务分析阶段增强 + +start + +partition "1. 复杂度评估指导原则" { + :整理评估维度; + note right + 结构维度: 模块数、文件数、依赖关系 + 逻辑维度: 业务复杂度、状态管理 + 集成维度: 外部依赖、数据格式 + 风险维度: 技术风险、影响范围 + end note + + :定义复杂度等级; + note right + 简单: 直接执行 + 中等: 直接执行,注意顺序 + 复杂: 必须拆分子计划 + 超大: 拆分为独立任务 + end note + + :制定拆分标准; + note right + 1. 涉及 3+ 独立模块 + 2. 自然分为多个阶段 + 3. 存在高风险环节 + 4. 明确的前后依赖 + 5. 需要多次对话 + end note +} + +partition "2. 设计子计划结构" { + :设计任务导览格式; + note right + # 任务导览 + ## 任务概述 + ## 子计划列表 + | 序号 | 名称 | 状态 | 依赖 | + ## 当前进度 + end note + + :设计子计划细则格式; + note right + # 子计划 N: 名称 + ## 目标 + ## 成功标准 + ## 执行步骤 + ## 交付物 + end note +} + +partition "3. 实现拆分逻辑" { + :修改 /aide:run 的 task-optimize; + + :任务分析; + :复杂度评估; + + if (复杂度 >= 复杂?) then (是) + :识别可独立交付阶段; + :按依赖关系排序; + :生成任务导览文档; + :生成各子计划细则; + else (否) + :生成单一任务细则; + endif +} + +partition "4. 实现循环执行机制" { + :修改 /aide:run 执行逻辑; + + :读取任务导览; + :确定当前子计划; + + while (还有未完成的子计划?) is (是) + :执行 flow-design; + :执行 impl; + :执行 verify; + :执行 docs; + :标记子计划完成; + :更新任务导览; + endwhile (否) + + :执行 finish; +} + +partition "5. 更新 /aide:run command" { + :整合上述逻辑; + :更新命令文档; +} + +partition "6. 更新设计文档" { + :创建复杂度评估指南; + :更新 run command 文档; +} + +stop +@enduml diff --git a/.aide/diagrams/overall-flow.png b/.aide/diagrams/overall-flow.png new file mode 100644 index 0000000..a91df36 Binary files /dev/null and b/.aide/diagrams/overall-flow.png differ diff --git a/.aide/diagrams/subplan1-config.png b/.aide/diagrams/subplan1-config.png new file mode 100644 index 0000000..73a3100 Binary files /dev/null and b/.aide/diagrams/subplan1-config.png differ diff --git a/.aide/diagrams/subplan2-flow-status.png b/.aide/diagrams/subplan2-flow-status.png new file mode 100644 index 0000000..51b1f2b Binary files /dev/null and b/.aide/diagrams/subplan2-flow-status.png differ diff --git a/.aide/diagrams/subplan3-plantuml.png b/.aide/diagrams/subplan3-plantuml.png new file mode 100644 index 0000000..9a045c1 Binary files /dev/null and b/.aide/diagrams/subplan3-plantuml.png differ diff --git a/.aide/diagrams/subplan4-docs-system.png b/.aide/diagrams/subplan4-docs-system.png new file mode 100644 index 0000000..6036fec Binary files /dev/null and b/.aide/diagrams/subplan4-docs-system.png differ diff --git a/.aide/diagrams/subplan5-commands.png b/.aide/diagrams/subplan5-commands.png new file mode 100644 index 0000000..3ebcf79 Binary files /dev/null and b/.aide/diagrams/subplan5-commands.png differ diff --git a/.aide/diagrams/subplan6-task-analysis.png b/.aide/diagrams/subplan6-task-analysis.png new file mode 100644 index 0000000..4bd3e19 Binary files /dev/null and b/.aide/diagrams/subplan6-task-analysis.png differ diff --git a/.aide/flow-status.json b/.aide/flow-status.json index ae04c5f..382fd00 100644 --- a/.aide/flow-status.json +++ b/.aide/flow-status.json @@ -1,7 +1,7 @@ { "task_id": "2025-12-15T17-28-53", - "current_phase": "task-optimize", - "current_step": 7, + "current_phase": "flow-design", + "current_step": 8, "started_at": "2025-12-15T17:28:53+08:00", "history": [ { @@ -58,6 +58,14 @@ "step": 7, "summary": "任务准备完成", "git_commit": "dbd2323a045312d03c018bffaa24b6c8c030ae7f" + }, + { + "timestamp": "2025-12-15T17:51:56+08:00", + "action": "next-part", + "phase": "flow-design", + "step": 8, + "summary": "进入流程设计环节", + "git_commit": "7e1f0263a9e74ee40a3680a407a7fc26b58041e6" } ] } diff --git a/.aide/flow-status.lock b/.aide/flow-status.lock index 71906b2..a705e3f 100755 --- a/.aide/flow-status.lock +++ b/.aide/flow-status.lock @@ -1 +1 @@ -109573 \ No newline at end of file +113019 \ No newline at end of file