Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f794b92
up version
ipconfiger May 10, 2026
fbf9a08
fix
ipconfiger May 20, 2026
3d9ead0
archive: 改为 gzip 归档 + 全代码 phrases → phases 重命名
ipconfiger Jun 1, 2026
de845e2
chore: 把 .omc/state/、.omc/sessions/ 加入 .gitignore
ipconfiger Jun 1, 2026
2da762e
chore: untrack OMC runtime state files from git index
ipconfiger Jun 1, 2026
bc6a816
chore: ignore .omc/project-memory.json
ipconfiger Jun 1, 2026
477d99b
chore: 清理所有 warning(0 build / 0 clippy)
ipconfiger Jun 5, 2026
ba2d4ea
feat: 阶段流转改为自动执行,不再询问用户(v0.1.4)
ipconfiger Jun 6, 2026
adda32e
feat: audit prompt 同样改为自动执行 accept(v0.1.4 续)
ipconfiger Jun 6, 2026
fc1e56c
feat(setup): setup_opencode 同步生成 .opencode/skills/ddd-*.md
ipconfiger Jun 6, 2026
5d7ff14
refactor(commands): create lib.rs for integration test support
ipconfiger Jun 6, 2026
b748841
fix(prompts): enhance render validation and fix anem typo
ipconfiger Jun 6, 2026
8be2dda
refactor(commands): define DddCommand trait, CommandResult, and Comma…
ipconfiger Jun 6, 2026
bf2bbd7
refactor(commands): migrate all 11 commands to DddCommand trait
ipconfiger Jun 6, 2026
5695e00
refactor(commands): rewrite dispatch to use trait object registry
ipconfiger Jun 6, 2026
a56f826
refactor(commands): setup auto-traverses registry for generation
ipconfiger Jun 6, 2026
08a3d23
refactor(commands): move command_prompt/skill_prompt to each command …
ipconfiger Jun 6, 2026
79537b5
feat(commands): add is_cli_visible property to control CLI subcommand…
ipconfiger Jun 6, 2026
3480eac
refactor(commands): add name param to command_prompt/skill_prompt tra…
ipconfiger Jun 6, 2026
318c2b2
refactor(commands): remove dead run()/do_run() functions and unused i…
ipconfiger Jun 6, 2026
c2b0e07
fix(setup): sync file generation with new Skill loading mode
ipconfiger Jun 6, 2026
1096dfc
docs: add project docs, AGENTS.md, and planning artifacts
ipconfiger Jun 6, 2026
77dec75
refactor(commands): migrate to Skill loading mode + cleanup
ipconfiger Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .codegraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CodeGraph data files
# These are local to each machine and should not be committed

# Database
*.db
*.db-wal
*.db-shm

# Cache
cache/

# Logs
*.log

# Hook markers
.dirty
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
target/
.worktrees/
.opencode/
.claude/
.idea/
.omc/state/
.omc/sessions/
.omc/project-memory.json
2 changes: 1 addition & 1 deletion .omc/plans/2026-04-19-001-init-phase-planning.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- 基于 `roadmap.json` 声明式状态机的文档驱动开发框架
- 封装核心流命令:`init`, `prepare`, `exec`, `verify`, `fix-plan`, `fix-exec`, `archive`, `report`, `sync`
- 内部状态触发命令:`gen-phrase`, `set-issuse`, `finish-fix`, `finish-phrase`
- 内部状态触发命令:`gen-phase`, `set-issuse`, `finish-fix`, `finish-phase`
- 辅助工具命令:`setup`, `help`, `version`, `study`, `resume`

## 接受标准
Expand Down
6 changes: 3 additions & 3 deletions .omc/plans/2026-04-19-setup-command-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `setup` command initializes project-level command/skill registration for Cla
| Command | Description |
|---------|-------------|
| `init` | Initialize project with context |
| `prepare` | Prepare phrases from specs |
| `prepare` | Prepare phases from specs |
| `exec` | Execute development phase |
| `verify` | Verify phase成果 |
| `fix-plan` | Generate fix plan |
Expand All @@ -22,7 +22,7 @@ The `setup` command initializes project-level command/skill registration for Cla
| `sync` | Sync code to docs |
| `resume` | Resume interrupted workflow |

**Note:** Internal commands (`gen-phrase`, `set-issue`, `finish-fix`, `finish-phrase`) are NOT registered as they are called via `!ddd` from prompts internally.
**Note:** Internal commands (`gen-phase`, `set-issue`, `finish-fix`, `finish-phase`) are NOT registered as they are called via `!ddd` from prompts internally.

---

Expand Down Expand Up @@ -91,7 +91,7 @@ use std::path::Path;

const PUBLIC_COMMANDS: &[(&str, &str)] = &[
("init", "Initialize project with context"),
("prepare", "Prepare phrases from specs"),
("prepare", "Prepare phases from specs"),
("exec", "Execute development phase"),
("verify", "Verify phase成果"),
("fix-plan", "Generate fix plan"),
Expand Down
26 changes: 13 additions & 13 deletions .omc/plans/2026-04-20-prepare-crates-io.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements Summary

修复 `exec.rs` 中的构建错误(`state.phases` → `state.phrases`),并完善 `Cargo.toml` 元数据以满足 crates.io 发布要求。
修复 `exec.rs` 中的构建错误(`state.phases` → `state.phases`),并完善 `Cargo.toml` 元数据以满足 crates.io 发布要求。

## Acceptance Criteria

Expand All @@ -17,22 +17,22 @@

**文件**: `src/commands/exec.rs`

将 `state.phases` 和 `new_state.phases` 全部替换为 `state.phrases` 和 `new_state.phrases`(共 5 处)
将 `state.phases` 和 `new_state.phases` 全部替换为 `state.phases` 和 `new_state.phases`(共 5 处)

```diff
- state.phases.iter().find(|p| &p.name == name)
+ state.phrases.iter().find(|p| &p.name == name)
+ state.phases.iter().find(|p| &p.name == name)

- state.phases.first()
+ state.phrases.first()
+ state.phases.first()

- state.phases.iter().position(...)
- idx.and_then(|i| state.phases.get(i + 1))
+ state.phrases.iter().position(...)
+ idx.and_then(|i| state.phrases.get(i + 1))
+ state.phases.iter().position(...)
+ idx.and_then(|i| state.phases.get(i + 1))

- new_state.phases.iter_mut().find(...)
+ new_state.phrases.iter_mut().find(...)
+ new_state.phases.iter_mut().find(...)
```

### Step 2: 完善 Cargo.toml 元数据
Expand Down Expand Up @@ -77,20 +77,20 @@ cargo test
## Risks and Mitigations

- **风险**: 字段名修改影响其他模块
- **缓解**: grep 确认只有 exec.rs 使用 `.phases`,其他模块已用 `.phrases`
- **缓解**: grep 确认只有 exec.rs 使用 `.phases`,其他模块已用 `.phases`

## ADR

**Decision**: 修复 exec.rs 的 `phases` → `phrases`,不重命名 `RoadmapState.phrases` 字段
**Decision**: 修复 exec.rs 的 `phases` → `phases`,不重命名 `RoadmapState.phases` 字段

**Drivers**:
- spec 文档 (`docs/new_spec_v2.md`) 使用 `phrases` 作为字段名
- `RoadmapState` 定义在 `roadmap.rs` 中使用 `phrases`
- 其他所有命令模块(verify, fix_plan, internal 等)已正确使用 `phrases`
- spec 文档 (`docs/new_spec_v2.md`) 使用 `phases` 作为字段名
- `RoadmapState` 定义在 `roadmap.rs` 中使用 `phases`
- 其他所有命令模块(verify, fix_plan, internal 等)已正确使用 `phases`
- exec.rs 是唯一错误引用 `phases` 的文件

**Alternatives considered**:
- 重命名 `RoadmapState.phrases` → `phases`:工作量大,需要修改 roadmap.rs 和所有引用处
- 重命名 `RoadmapState.phases` → `phases`:工作量大,需要修改 roadmap.rs 和所有引用处
- 保持 exec.rs 不变:无法通过编译

**Why chosen**: 最少改动,最大一致。exec.rs 的 `phases` 明显是笔误。
Expand Down
134 changes: 134 additions & 0 deletions .omc/plans/2026-05-09-docs-reverse-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# 文档反向同步计划

## 任务概述

根据当前代码实现,反向更新所有文档,确保文档与代码一致。

## 发现的主要差异

### 1. 命令差异

| 类别 | 文档有但代码无 | 代码有但文档无 |
|------|---------------|---------------|
| 核心命令 | `fix-plan`, `fix-exec` | `audit`, `confirm`, `final`, `accept` |
| 内部触发器 | `gen-phase`, `set-issuse`, `finish-fix`, `finish-phase` | (同上) |
| 辅助命令 | `resume`, `help`, `version`, `study` | — |

### 2. 状态机差异

- **代码有但文档无:** `verifying` 状态 (verify.rs:48)
- **文档有但代码无:** `issue_found`, `fixing` 状态
- **代码验证的状态:** `["init", "dev", "verifying", "finished"]` (roadmap.rs:17-18)

### 3. 目录名不一致

- `prepare.rs` → `project_docs/phases/`
- `internal.rs` → `project_docs/phases/` (注意 'a')
- 文档混用 `phases/` 和 `phases/`

### 4. Prompt 差异

- `init`: 文档说用 `@Plan` agent,实际是 MVP/KISS 原则
- `prepare`: 文档说调用 `!ddd gen_phase`,实际提示 `/ddd-accept`
- `verify`: 文档说调用 `finish_phase`,实际提示 `/ddd-confirm`
- `exec`: 文档说建议 `/ddd-exec`,实际建议 `/ddd-confirm`

---

## 更新计划

### 步骤 1: 更新 SPEC_CORE (spec_core.md)

**文件:** `project_docs/specs/spec_core.md`

更新内容:
- [ ] 确认 `init`, `prepare`, `exec`, `verify`, `archive`, `report`, `sync` 命令列表
- [ ] 补充 `audit`, `confirm`, `final`, `accept` 命令
- [ ] 移除不存在的命令: `fix-plan`, `fix-exec`, `gen-phase`, `set-issuse`, `finish-fix`, `finish-phase`, `resume`, `help`, `version`, `study`

### 步骤 2: 更新 SPEC_COMMANDS (spec_commands.md)

**文件:** `project_docs/specs/spec_commands.md`

更新内容:
- [ ] 更新所有命令描述和 prompt 为实际代码内容
- [ ] `init` prompt 改为 MVP/KISS 版本
- [ ] `prepare` 改为提示 `/ddd-accept`
- [ ] `verify` 改为提示 `/ddd-confirm`
- [ ] `exec` 改为建议 `/ddd-confirm`
- [ ] 添加 `audit`, `confirm`, `final`, `accept` 命令定义
- [ ] 移除 `fix-plan`, `fix-exec`, `gen-phase` 等未实现命令
- [ ] 统一目录名为 `phases/` 或 `phases/` (需决定统一哪个)

### 步骤 3: 更新 SPEC_STATE_MACHINE (spec_state_machine.md)

**文件:** `project_docs/specs/spec_state_machine.md`

更新内容:
- [ ] 阶段状态改为: `["init", "dev", "verifying", "finished"]`
- [ ] 移除 `issue_found`, `fixing` 状态
- [ ] 添加 `verifying` 状态说明
- [ ] 更新 Fix 状态流程 (或标记为未实现)

### 步骤 4: 更新 SPEC_DATA_FLOW (spec_data_flow.md)

**文件:** `project_docs/specs/spec_data_flow.md`

更新内容:
- [ ] 统一目录引用为 `phases/` 或 `phases/`
- [ ] 更新 prompt 参数映射

### 步骤 5: 更新 NEW_SPEC_V2 (docs/new_spec_v2.md)

**文件:** `docs/new_spec_v2.md`

更新内容:
- [ ] 同步所有命令变更
- [ ] 更新状态机定义
- [ ] 更新 prompt 内容
- [ ] 添加新命令描述

### 步骤 6: 更新 OPENCODE 命令文档

**文件:** `.opencode/commands/*.md`

这些文件目前只是代理到 CLI,需要检查是否需要补充命令描述。

### 步骤 7: 更新 README.md (如需要)

**文件:** `README.md`

检查并更新项目描述是否与当前实现一致。

---

## 待确认问题

1. **目录名统一:** `phases/` 还是 `phases/`?
- `prepare.rs` 使用 `phases/`
- `internal.rs` 使用 `phases/`
- 建议统一为 `phases/` (更常用)

2. **Fix 状态流程:** 文档中的 fix-plan/fix-exec 流程是应该实现还是从文档移除?

3. **内部触发器:** `set-issuse`, `finish_fix` 等是否应该实现?

---

## 验收标准

- [ ] `spec_commands.md` 与实际命令一致
- [ ] `spec_state_machine.md` 与 roadmap.rs 中的状态一致
- [ ] 所有命令的 prompt 与代码中的实际 prompt 一致
- [ ] 目录引用统一
- [ ] 新增命令 (audit, confirm, final, accept) 已添加到相关文档

## 涉及文件

- `project_docs/specs/spec_core.md`
- `project_docs/specs/spec_commands.md`
- `project_docs/specs/spec_state_machine.md`
- `project_docs/specs/spec_data_flow.md`
- `docs/new_spec_v2.md`
- `.opencode/commands/*.md`
- `README.md`
Loading
Loading