diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index c6d7c7bd..87ca1398 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -119,6 +119,7 @@ export default withMermaid(defineConfig({ { text: 'Workflow', link: '/commands/claude/workflow' }, { text: 'Session', link: '/commands/claude/session' }, { text: 'Issue', link: '/commands/claude/issue' }, + { text: 'IDAW', link: '/commands/claude/idaw' }, { text: 'Memory', link: '/commands/claude/memory' }, { text: 'CLI', link: '/commands/claude/cli' }, { text: 'UI Design', link: '/commands/claude/ui-design' } @@ -378,6 +379,7 @@ export default withMermaid(defineConfig({ { text: '工作流', link: '/zh/commands/claude/workflow' }, { text: '会话管理', link: '/zh/commands/claude/session' }, { text: 'Issue', link: '/zh/commands/claude/issue' }, + { text: 'IDAW', link: '/zh/commands/claude/idaw' }, { text: 'Memory', link: '/zh/commands/claude/memory' }, { text: 'CLI', link: '/zh/commands/claude/cli' }, { text: 'UI 设计', link: '/zh/commands/claude/ui-design' } diff --git a/docs/.vitepress/theme/components/HeroAnimation.vue b/docs/.vitepress/theme/components/HeroAnimation.vue index 024d59d2..3112028e 100644 --- a/docs/.vitepress/theme/components/HeroAnimation.vue +++ b/docs/.vitepress/theme/components/HeroAnimation.vue @@ -39,14 +39,22 @@ - + - - - - + + + + + + + + + + + + CCW diff --git a/docs/.vitepress/theme/components/ThemeLogo.vue b/docs/.vitepress/theme/components/ThemeLogo.vue index 846621ba..1cdb022a 100644 --- a/docs/.vitepress/theme/components/ThemeLogo.vue +++ b/docs/.vitepress/theme/components/ThemeLogo.vue @@ -1,52 +1,47 @@ - - @@ -56,9 +51,4 @@ onUnmounted(() => { height: 24px; color: var(--vp-c-text-1); } - -.theme-logo circle { - fill: var(--vp-c-primary); - transition: fill 0.3s ease; -} diff --git a/docs/.vitepress/theme/composables/useDynamicIcon.ts b/docs/.vitepress/theme/composables/useDynamicIcon.ts index 92094aab..36941526 100644 --- a/docs/.vitepress/theme/composables/useDynamicIcon.ts +++ b/docs/.vitepress/theme/composables/useDynamicIcon.ts @@ -77,17 +77,22 @@ export function getStatusColor(isDark: boolean): string { } /** - * Generate favicon SVG with dynamic colors (line style) + * Generate favicon SVG with orbital design */ export function generateFaviconSvg(theme: ThemeName, isDark: boolean): string { - const lineColor = getThemeColor(theme, isDark) - const dotColor = getThemeColor(theme, isDark) // Dot follows theme color + const orbitColor = getThemeColor(theme, isDark) - return ` - - - - + return ` + + + + + + + + + + ` } diff --git a/docs/commands/claude/idaw.md b/docs/commands/claude/idaw.md new file mode 100644 index 00000000..bcdcffb3 --- /dev/null +++ b/docs/commands/claude/idaw.md @@ -0,0 +1,350 @@ +# IDAW Commands + +## One-Liner + +**IDAW (Independent Development Autonomous Workflow) is the batch task execution engine** — queue development tasks, execute skill chains serially with per-task git checkpoints, and resume from interruptions. + +## Core Concepts + +| Concept | Description | Location | +|---------|-------------|----------| +| **Task** | Independent JSON task definition | `.workflow/.idaw/tasks/IDAW-*.json` | +| **Session** | Execution session with progress tracking | `.workflow/.idaw/sessions/IDA-*/` | +| **Skill Chain** | Ordered sequence of skills per task type | Mapped from `SKILL_CHAIN_MAP` | +| **Checkpoint** | Per-task git commit after successful execution | Automatic `git add -A && git commit` | + +## IDAW vs Issue System + +| Aspect | Issue System | IDAW | +|--------|-------------|------| +| **Granularity** | Fine-grained, multi-step orchestration | Coarse-grained, batch autonomous | +| **Pipeline** | new → plan → queue → execute | add → run (all-in-one) | +| **Execution** | DAG parallel | Serial with checkpoints | +| **Storage** | `.workflow/issues.jsonl` | `.workflow/.idaw/tasks/IDAW-*.json` | +| **Use Case** | Individual issue resolution | Batch task queue, unattended execution | + +## Command List + +| Command | Function | Syntax | +|---------|----------|--------| +| [`add`](#add) | Create tasks manually or import from issue | `/idaw:add [-y] [--from-issue ] "description" [--type ] [--priority 1-5]` | +| [`run`](#run) | Execute task queue with git checkpoints | `/idaw:run [-y] [--task ] [--dry-run]` | +| [`status`](#status) | View task and session progress | `/idaw:status [session-id]` | +| [`resume`](#resume) | Resume interrupted session | `/idaw:resume [-y] [session-id]` | + +## Command Details + +### add + +**Function**: Create IDAW tasks manually or import from existing ccw issues. + +**Syntax**: +```bash +/idaw:add [-y|--yes] [--from-issue [,,...]] "description" [--type ] [--priority <1-5>] +``` + +**Options**: +- `--from-issue `: Import from ccw issue (comma-separated for multiple) +- `--type `: Explicit task type (see [Task Types](#task-types)) +- `--priority 1-5`: Priority (1=critical, 5=low, default=3) + +**Modes**: + +| Mode | Trigger | Behavior | +|------|---------|----------| +| Manual | No `--from-issue` | Parse description, generate task | +| Import | `--from-issue` | Fetch issue, freeze snapshot, create task | + +**Examples**: +```bash +# Manual creation +/idaw:add "Fix login timeout bug" --type bugfix --priority 2 +/idaw:add "Add rate limiting to API endpoints" --priority 1 +/idaw:add "Refactor auth module to use strategy pattern" + +# Import from ccw issue +/idaw:add --from-issue ISS-20260128-001 +/idaw:add --from-issue ISS-20260128-001,ISS-20260128-002 + +# Auto mode (skip clarification) +/idaw:add -y "Quick fix for typo in header" +``` + +**Output**: +``` +Created IDAW-001: Fix login timeout bug + Type: bugfix | Priority: 2 | Source: manual + → Next: /idaw:run or /idaw:status +``` + +--- + +### run + +**Function**: Main orchestrator — execute task skill chains serially with git checkpoints. + +**Syntax**: +```bash +/idaw:run [-y|--yes] [--task [,,...]] [--dry-run] +``` + +**Options**: +- `--task `: Execute specific tasks (default: all pending) +- `--dry-run`: Show execution plan without running +- `-y`: Auto mode — skip confirmations, auto-skip on failure + +**6-Phase Execution**: + +``` +Phase 1: Load Tasks + └─ Glob IDAW-*.json → filter → sort by priority ASC, ID ASC + +Phase 2: Session Setup + └─ Create session.json + progress.md + TodoWrite + +Phase 3: Startup Protocol + ├─ Check running sessions → offer resume or fresh + └─ Check git status → stash/continue/abort + +Phase 4: Main Loop (serial) + For each task: + ├─ Resolve: skill_chain || SKILL_CHAIN_MAP[task_type || inferred] + ├─ Execute each skill (retry once on failure) + └─ On error: skip (autoYes) or ask (interactive) + +Phase 5: Checkpoint (per task) + ├─ git add -A && git commit + ├─ Update task.json + session.json + └─ Append to progress.md + +Phase 6: Report + └─ Summary: completed/failed/skipped counts + git commits +``` + +**Examples**: +```bash +# Execute all pending tasks (auto mode) +/idaw:run -y + +# Execute specific tasks +/idaw:run --task IDAW-001,IDAW-003 + +# Preview execution plan +/idaw:run --dry-run +``` + +--- + +### status + +**Function**: Read-only view of IDAW task queue and session progress. + +**Syntax**: +```bash +/idaw:status [session-id] +``` + +**View Modes**: + +| Mode | Trigger | Output | +|------|---------|--------| +| Overview | No arguments | All tasks table + latest session summary | +| Session Detail | Session ID provided | Task × status × commit table + progress.md | + +**Examples**: +```bash +# Overview +/idaw:status + +# Specific session +/idaw:status IDA-auth-fix-20260301 +``` + +**Output Example**: +``` +# IDAW Tasks + +| ID | Title | Type | Priority | Status | +|----------|--------------------------|---------|----------|-----------| +| IDAW-001 | Fix auth token refresh | bugfix | 1 | completed | +| IDAW-002 | Add rate limiting | feature | 2 | pending | +| IDAW-003 | Refactor payment module | refactor| 3 | pending | + +Total: 3 | Pending: 2 | Completed: 1 | Failed: 0 +``` + +--- + +### resume + +**Function**: Resume an interrupted IDAW session from the last checkpoint. + +**Syntax**: +```bash +/idaw:resume [-y|--yes] [session-id] +``` + +**Options**: +- `session-id`: Resume specific session (default: latest running) +- `-y`: Auto-skip interrupted task, continue with remaining + +**Recovery Flow**: +``` +1. Find session with status=running +2. Handle interrupted task (in_progress): + ├─ autoYes → mark as skipped + └─ interactive → ask: Retry or Skip +3. Build remaining task queue +4. Execute Phase 4-6 from /idaw:run +``` + +**Examples**: +```bash +# Resume most recent running session +/idaw:resume + +# Resume specific session +/idaw:resume IDA-auth-fix-20260301 + +# Resume with auto mode +/idaw:resume -y +``` + +## Task Types + +IDAW supports 10 task types, each mapping to a specific skill chain: + +| Task Type | Skill Chain | Use Case | +|-----------|-------------|----------| +| `bugfix` | lite-plan → test-fix | Standard bug fixes | +| `bugfix-hotfix` | lite-plan (--hotfix) | Urgent production fixes | +| `feature` | lite-plan → test-fix | New features | +| `feature-complex` | plan → execute → test-fix | Multi-module features | +| `refactor` | refactor-cycle | Code restructuring | +| `tdd` | tdd-plan → execute | Test-driven development | +| `test` | test-fix | Test generation | +| `test-fix` | test-fix | Fix failing tests | +| `review` | review-cycle | Code review | +| `docs` | lite-plan | Documentation | + +**Type Resolution**: Explicit `task_type` field takes priority. When null, the type is inferred from title and description using keyword matching at execution time. + +## Task Schema + +```json +{ + "id": "IDAW-001", + "title": "Fix auth token refresh race condition", + "description": "Detailed problem/goal description...", + "status": "pending", + "priority": 2, + "task_type": "bugfix", + "skill_chain": null, + "context": { + "affected_files": ["src/auth/token-manager.ts"], + "acceptance_criteria": ["No concurrent refresh requests"], + "constraints": [], + "references": [] + }, + "source": { + "type": "manual", + "issue_id": null, + "issue_snapshot": null + }, + "execution": { + "session_id": null, + "started_at": null, + "completed_at": null, + "skill_results": [], + "git_commit": null, + "error": null + }, + "created_at": "2026-03-01T10:00:00Z", + "updated_at": "2026-03-01T10:00:00Z" +} +``` + +**Key Fields**: +- `task_type`: Optional — inferred from title/description when null +- `skill_chain`: Optional — overrides automatic mapping when set +- `source.type`: `manual` or `import-issue` +- `source.issue_snapshot`: Frozen copy of original issue data (import only) +- `execution`: Runtime state populated by `/idaw:run` + +## Task Lifecycle + +```mermaid +graph TD + A["/idaw:add"] --> B["pending"] + B --> C["/idaw:run"] + C --> D["in_progress"] + D --> E{"Skill Chain"} + E -->|Success| F["completed (git commit)"] + E -->|Retry once| G{"Retry"} + G -->|Success| F + G -->|Fail| H{"autoYes?"} + H -->|Yes| I["failed (skip)"] + H -->|No| J["Ask: Skip/Abort"] + J -->|Skip| I + J -->|Abort| K["Session failed"] + + L["/idaw:resume"] --> M{"Interrupted task"} + M -->|Retry| B + M -->|Skip| N["skipped"] +``` + +## Directory Structure + +``` +.workflow/.idaw/ +├── tasks/ # Task definitions (persist across sessions) +│ ├── IDAW-001.json +│ ├── IDAW-002.json +│ └── IDAW-003.json +└── sessions/ # Execution sessions + └── IDA-{slug}-YYYYMMDD/ + ├── session.json # Session state + task queue + └── progress.md # Human-readable progress log +``` + +## Error Handling + +| Error | Resolution | +|-------|------------| +| No tasks found | Suggest `/idaw:add` | +| Task JSON parse error | Skip malformed task, log warning | +| Task type unresolvable | Default to `feature` chain | +| Skill failure | Retry once → skip (autoYes) or ask (interactive) | +| Git commit fails (no changes) | Record `no-commit`, continue | +| Dirty git tree | autoYes: proceed; interactive: ask | +| Session ID collision | Append `-2` suffix | +| Issue fetch fails (import) | Log error, skip issue | +| Duplicate import (same issue_id) | Warn and skip | +| No resumable sessions | Suggest `/idaw:run` | + +## Typical Workflow + +```bash +# 1. Queue tasks +/idaw:add "Fix login timeout bug" --type bugfix --priority 1 +/idaw:add "Add rate limiting to API" --priority 2 +/idaw:add --from-issue ISS-20260128-001,ISS-20260128-002 + +# 2. Preview execution plan +/idaw:run --dry-run + +# 3. Execute all (unattended) +/idaw:run -y + +# 4. Check progress +/idaw:status + +# 5. Resume if interrupted +/idaw:resume -y +``` + +## Related Documentation + +- [Issue Commands](./issue.md) — Fine-grained issue management +- [Core Orchestration](./core-orchestration.md) — `/ccw` main orchestrator +- [Workflow Commands](./workflow.md) — Individual workflow skills diff --git a/docs/commands/claude/index.md b/docs/commands/claude/index.md index 18d3fdb2..a8302ec1 100644 --- a/docs/commands/claude/index.md +++ b/docs/commands/claude/index.md @@ -12,6 +12,7 @@ | **Workflow** | 20+ | Planning, execution, review, TDD, testing workflows | | **Session Management** | 6 | Session creation, listing, resuming, completion | | **Issue Workflow** | 8 | Issue discovery, planning, queue, execution | +| **IDAW** | 4 | Batch autonomous task execution with git checkpoints | | **Memory** | 8 | Memory capture, update, document generation | | **CLI Tools** | 2 | CLI initialization, Codex review | | **UI Design** | 10 | UI design prototype generation, style extraction | @@ -69,7 +70,16 @@ | [`/issue:execute`](./issue.md#execute) | Execute queue | Intermediate | | [`/issue:convert-to-plan`](./issue.md#convert-to-plan) | Convert planning artifact to issue solution | Intermediate | -### 5. Memory Commands +### 5. IDAW Commands + +| Command | Function | Difficulty | +|---------|----------|------------| +| [`/idaw:add`](./idaw.md#add) | Create tasks manually or import from ccw issue | Beginner | +| [`/idaw:run`](./idaw.md#run) | Execute task queue with skill chains and git checkpoints | Intermediate | +| [`/idaw:status`](./idaw.md#status) | View task and session progress | Beginner | +| [`/idaw:resume`](./idaw.md#resume) | Resume interrupted session from last checkpoint | Intermediate | + +### 6. Memory Commands | Command | Function | Difficulty | |---------|----------|------------| @@ -82,14 +92,14 @@ | [`/memory:docs-related-cli`](./memory.md#docs-related-cli) | Generate documentation for git-changed modules | Intermediate | | [`/memory:style-skill-memory`](./memory.md#style-skill-memory) | Generate SKILL memory package from style reference | Intermediate | -### 6. CLI Tool Commands +### 7. CLI Tool Commands | Command | Function | Difficulty | |---------|----------|------------| | [`/cli:cli-init`](./cli.md#cli-init) | Generate configuration directory and settings files | Intermediate | | [`/cli:codex-review`](./cli.md#codex-review) | Interactive code review using Codex CLI | Intermediate | -### 7. UI Design Commands +### 8. UI Design Commands | Command | Function | Difficulty | |---------|----------|------------| diff --git a/docs/commands/index.md b/docs/commands/index.md index 5f5b8a86..52502186 100644 --- a/docs/commands/index.md +++ b/docs/commands/index.md @@ -19,6 +19,7 @@ - [Workflow](/commands/claude/workflow) - workflow series commands - [Session Management](/commands/claude/session) - session series commands - [Issue](/commands/claude/issue) - issue series commands +- [IDAW](/commands/claude/idaw) - batch autonomous task execution - [Memory](/commands/claude/memory) - memory series commands - [CLI](/commands/claude/cli) - cli series commands - [UI Design](/commands/claude/ui-design) - ui-design series commands diff --git a/docs/public/favicon.svg b/docs/public/favicon.svg index 16dba03c..54c48feb 100644 --- a/docs/public/favicon.svg +++ b/docs/public/favicon.svg @@ -1,12 +1,12 @@ - - - - - - - - + + + + + + + + + + + diff --git a/docs/public/logo.svg b/docs/public/logo.svg index 059e874d..fe72b0a5 100644 --- a/docs/public/logo.svg +++ b/docs/public/logo.svg @@ -1,8 +1,17 @@ - - - - - - - + + + + + + + + + + + + + + + + diff --git a/docs/zh/commands/claude/idaw.md b/docs/zh/commands/claude/idaw.md new file mode 100644 index 00000000..ace0c646 --- /dev/null +++ b/docs/zh/commands/claude/idaw.md @@ -0,0 +1,315 @@ +# IDAW 命令 + +## 一句话定位 + +**IDAW(Independent Development Autonomous Workflow)是批量任务自治执行引擎** — 攒任务、串行执行 Skill 链、每个任务自动 git checkpoint、中断可恢复。 + +## 核心概念 + +| 概念 | 说明 | 存储位置 | +|------|------|----------| +| **Task** | 独立 JSON 任务定义 | `.workflow/.idaw/tasks/IDAW-*.json` | +| **Session** | 执行会话与进度追踪 | `.workflow/.idaw/sessions/IDA-*/` | +| **Skill Chain** | 按任务类型的有序 Skill 序列 | 由 `SKILL_CHAIN_MAP` 映射 | +| **Checkpoint** | 每个任务成功后的 git commit | 自动 `git add -A && git commit` | + +## IDAW vs Issue 系统 + +| 对比维度 | Issue 系统 | IDAW | +|----------|-----------|------| +| **粒度** | 精细粒度、多步编排 | 粗粒度、批量自治 | +| **流水线** | new → plan → queue → execute | add → run(一站式) | +| **执行方式** | DAG 并行 | 串行 + checkpoint | +| **存储** | `.workflow/issues.jsonl` | `.workflow/.idaw/tasks/IDAW-*.json` | +| **场景** | 单个 issue 精细解决 | 批量任务队列、无人值守执行 | + +## 命令列表 + +| 命令 | 功能 | 语法 | +|------|------|------| +| [`add`](#add) | 手动创建或从 issue 导入任务 | `/idaw:add [-y] [--from-issue ] "描述" [--type <类型>] [--priority 1-5]` | +| [`run`](#run) | 串行执行任务队列并 git checkpoint | `/idaw:run [-y] [--task ] [--dry-run]` | +| [`status`](#status) | 查看任务和会话进度 | `/idaw:status [session-id]` | +| [`resume`](#resume) | 从断点恢复中断的会话 | `/idaw:resume [-y] [session-id]` | + +## 命令详情 + +### add + +**功能**:手动创建 IDAW 任务或从现有 ccw issue 导入。 + +**语法**: +```bash +/idaw:add [-y|--yes] [--from-issue [,,...]] "描述" [--type ] [--priority <1-5>] +``` + +**参数**: +- `--from-issue `:从 ccw issue 导入(逗号分隔多个) +- `--type `:显式指定任务类型(见[任务类型](#任务类型)) +- `--priority 1-5`:优先级(1=紧急,5=低,默认=3) + +**模式**: + +| 模式 | 触发条件 | 行为 | +|------|----------|------| +| 手动 | 无 `--from-issue` | 解析描述、生成任务 | +| 导入 | `--from-issue` | 获取 issue、冻结快照、创建任务 | + +**示例**: +```bash +# 手动创建 +/idaw:add "修复登录超时 Bug" --type bugfix --priority 2 +/idaw:add "为 API 添加限流" --priority 1 +/idaw:add "重构 auth 模块为策略模式" + +# 从 ccw issue 导入 +/idaw:add --from-issue ISS-20260128-001 +/idaw:add --from-issue ISS-20260128-001,ISS-20260128-002 + +# 自动模式 +/idaw:add -y "修复 header 拼写错误" +``` + +--- + +### run + +**功能**:主编排器 — 串行执行任务 Skill 链,每个任务完成后自动 git commit。 + +**语法**: +```bash +/idaw:run [-y|--yes] [--task [,,...]] [--dry-run] +``` + +**参数**: +- `--task `:执行特定任务(默认:所有 pending) +- `--dry-run`:预览执行计划,不实际执行 +- `-y`:自动模式 — 跳过确认,失败自动跳过 + +**6 阶段执行流程**: + +``` +Phase 1: 加载任务 + └─ Glob IDAW-*.json → 过滤 → 按优先级 ASC、ID ASC 排序 + +Phase 2: 创建会话 + └─ 创建 session.json + progress.md + TodoWrite + +Phase 3: 启动检查 + ├─ 检查运行中的会话 → 提供恢复或新建选项 + └─ 检查 git 状态 → stash/继续/中止 + +Phase 4: 主循环(串行) + 每个任务: + ├─ 解析: skill_chain || SKILL_CHAIN_MAP[task_type || 推断] + ├─ 执行每个 skill(失败重试一次) + └─ 错误处理: skip (autoYes) 或 ask (交互) + +Phase 5: Checkpoint(每个任务) + ├─ git add -A && git commit + ├─ 更新 task.json + session.json + └─ 追加 progress.md + +Phase 6: 报告 + └─ 汇总: 完成/失败/跳过数量 + git commits +``` + +**示例**: +```bash +# 执行所有 pending 任务(自动模式) +/idaw:run -y + +# 执行特定任务 +/idaw:run --task IDAW-001,IDAW-003 + +# 预览执行计划 +/idaw:run --dry-run +``` + +--- + +### status + +**功能**:只读查看 IDAW 任务队列和会话进度。 + +**语法**: +```bash +/idaw:status [session-id] +``` + +**视图模式**: + +| 模式 | 触发 | 输出 | +|------|------|------| +| 概览 | 无参数 | 所有任务表格 + 最新会话摘要 | +| 会话详情 | 指定 session-id | 任务 × 状态 × commit 表格 + progress.md | + +**示例**: +```bash +/idaw:status +/idaw:status IDA-auth-fix-20260301 +``` + +--- + +### resume + +**功能**:从最后一个 checkpoint 恢复中断的 IDAW 会话。 + +**语法**: +```bash +/idaw:resume [-y|--yes] [session-id] +``` + +**参数**: +- `session-id`:恢复指定会话(默认:最新 running 会话) +- `-y`:自动跳过中断任务,继续执行剩余任务 + +**恢复流程**: +``` +1. 查找 status=running 的会话 +2. 处理中断任务 (in_progress): + ├─ autoYes → 标记为 skipped + └─ 交互 → 询问: 重试或跳过 +3. 构建剩余任务队列 +4. 执行 /idaw:run 的 Phase 4-6 +``` + +**示例**: +```bash +/idaw:resume +/idaw:resume IDA-auth-fix-20260301 +/idaw:resume -y +``` + +## 任务类型 + +IDAW 支持 10 种任务类型,每种映射到特定的 Skill 链: + +| 任务类型 | Skill 链 | 使用场景 | +|----------|----------|----------| +| `bugfix` | lite-plan → test-fix | 常规 Bug 修复 | +| `bugfix-hotfix` | lite-plan (--hotfix) | 紧急生产修复 | +| `feature` | lite-plan → test-fix | 新功能 | +| `feature-complex` | plan → execute → test-fix | 多模块功能 | +| `refactor` | refactor-cycle | 代码重构 | +| `tdd` | tdd-plan → execute | 测试驱动开发 | +| `test` | test-fix | 测试生成 | +| `test-fix` | test-fix | 修复失败测试 | +| `review` | review-cycle | 代码审查 | +| `docs` | lite-plan | 文档 | + +**类型解析**:显式 `task_type` 字段优先。为 null 时,执行时从标题和描述通过关键字匹配推断。 + +## 任务 Schema + +```json +{ + "id": "IDAW-001", + "title": "修复 auth token 刷新竞态", + "description": "详细的问题/目标描述...", + "status": "pending", + "priority": 2, + "task_type": "bugfix", + "skill_chain": null, + "context": { + "affected_files": ["src/auth/token-manager.ts"], + "acceptance_criteria": ["无并发刷新请求"], + "constraints": [], + "references": [] + }, + "source": { + "type": "manual", + "issue_id": null, + "issue_snapshot": null + }, + "execution": { + "session_id": null, + "started_at": null, + "completed_at": null, + "skill_results": [], + "git_commit": null, + "error": null + }, + "created_at": "2026-03-01T10:00:00Z", + "updated_at": "2026-03-01T10:00:00Z" +} +``` + +## 任务生命周期 + +```mermaid +graph TD + A["/idaw:add"] --> B["pending"] + B --> C["/idaw:run"] + C --> D["in_progress"] + D --> E{"Skill Chain"} + E -->|成功| F["completed (git commit)"] + E -->|重试一次| G{"重试"} + G -->|成功| F + G -->|失败| H{"autoYes?"} + H -->|是| I["failed (跳过)"] + H -->|否| J["询问: 跳过/中止"] + J -->|跳过| I + J -->|中止| K["Session failed"] + + L["/idaw:resume"] --> M{"中断的任务"} + M -->|重试| B + M -->|跳过| N["skipped"] +``` + +## 目录结构 + +``` +.workflow/.idaw/ +├── tasks/ # 任务定义(跨会话持久化) +│ ├── IDAW-001.json +│ ├── IDAW-002.json +│ └── IDAW-003.json +└── sessions/ # 执行会话 + └── IDA-{slug}-YYYYMMDD/ + ├── session.json # 会话状态 + 任务队列 + └── progress.md # 可读的进度日志 +``` + +## 错误处理 + +| 错误 | 处理方式 | +|------|----------| +| 无任务 | 提示 `/idaw:add` | +| 任务 JSON 解析错误 | 跳过并记录警告 | +| 任务类型无法解析 | 默认 `feature` 链 | +| Skill 失败 | 重试一次 → skip (autoYes) 或 ask (交互) | +| Git commit 无变更 | 记录 `no-commit`,继续 | +| Git 工作区脏 | autoYes: 继续; 交互: 询问 | +| Session ID 冲突 | 追加 `-2` 后缀 | +| Issue 获取失败(导入) | 记录错误,跳过 | +| 重复导入 | 警告并跳过 | +| 无可恢复会话 | 提示 `/idaw:run` | + +## 典型使用流程 + +```bash +# 1. 攒任务 +/idaw:add "修复登录超时 Bug" --type bugfix --priority 1 +/idaw:add "为 API 添加限流" --priority 2 +/idaw:add --from-issue ISS-20260128-001,ISS-20260128-002 + +# 2. 预览执行计划 +/idaw:run --dry-run + +# 3. 全自动执行(无人值守) +/idaw:run -y + +# 4. 查看进度 +/idaw:status + +# 5. 中断后恢复 +/idaw:resume -y +``` + +## 相关文档 + +- [Issue 命令](./issue.md) — 精细粒度 Issue 管理 +- [核心编排](./core-orchestration.md) — `/ccw` 主编排器 +- [工作流命令](./workflow.md) — 各个工作流 Skill diff --git a/docs/zh/commands/claude/index.md b/docs/zh/commands/claude/index.md index 284083aa..e9c95102 100644 --- a/docs/zh/commands/claude/index.md +++ b/docs/zh/commands/claude/index.md @@ -12,6 +12,7 @@ | **工作流** | 20+ | 规划、执行、审查、TDD、测试等工作流 | | **会话管理** | 6 | 会话创建、列表、恢复、完成等 | | **Issue 工作流** | 7 | Issue 发现、规划、队列、执行 | +| **IDAW** | 4 | 批量任务自治执行引擎 | | **Memory** | 8 | 记忆捕获、更新、文档生成 | | **CLI 工具** | 2 | CLI 初始化、Codex 审查 | | **UI 设计** | 10 | UI 设计原型生成、样式提取 | @@ -67,7 +68,16 @@ | [`/issue:execute`](./issue.md#execute) | 执行队列 | Intermediate | | [`/issue:convert-to-plan`](./issue.md#convert-to-plan) | 转换规划工件为 Issue 解决方案 | Intermediate | -### 5. Memory 命令 +### 5. IDAW 命令 + +| 命令 | 功能 | 难度 | +| --- | --- | --- | +| [`/idaw:add`](./idaw.md#add) | 手动创建或从 issue 导入任务 | Beginner | +| [`/idaw:run`](./idaw.md#run) | 串行执行任务 Skill 链并 git checkpoint | Intermediate | +| [`/idaw:status`](./idaw.md#status) | 查看任务和会话进度 | Beginner | +| [`/idaw:resume`](./idaw.md#resume) | 从断点恢复中断的会话 | Intermediate | + +### 6. Memory 命令 | 命令 | 功能 | 难度 | | --- | --- | --- | @@ -80,14 +90,14 @@ | [`/memory:docs-related-cli`](./memory.md#docs-related-cli) | 生成 git 变更模块文档 | Intermediate | | [`/memory:style-skill-memory`](./memory.md#style-skill-memory) | 从样式参考生成 SKILL 记忆包 | Intermediate | -### 6. CLI 工具命令 +### 7. CLI 工具命令 | 命令 | 功能 | 难度 | | --- | --- | --- | | [`/cli:cli-init`](./cli.md#cli-init) | 生成配置目录和设置文件 | Intermediate | | [`/cli:codex-review`](./cli.md#codex-review) | 使用 Codex CLI 进行交互式代码审查 | Intermediate | -### 7. UI 设计命令 +### 8. UI 设计命令 | 命令 | 功能 | 难度 | | --- | --- | --- | diff --git a/docs/zh/commands/index.md b/docs/zh/commands/index.md index 77ce8210..f528c28e 100644 --- a/docs/zh/commands/index.md +++ b/docs/zh/commands/index.md @@ -19,6 +19,7 @@ - [工作流](/commands/claude/workflow) - workflow 系列命令 - [会话管理](/commands/claude/session) - session 系列命令 - [Issue](/commands/claude/issue) - issue 系列命令 +- [IDAW](/commands/claude/idaw) - 批量任务自治执行 - [Memory](/commands/claude/memory) - memory 系列命令 - [CLI](/commands/claude/cli) - cli 系列命令 - [UI 设计](/commands/claude/ui-design) - ui-design 系列命令 diff --git a/package-lock.json b/package-lock.json index 7d14edea..63966031 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "claude-code-workflow", - "version": "7.0.6", + "version": "7.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "claude-code-workflow", - "version": "7.0.6", + "version": "7.0.9", "hasInstallScript": true, "license": "MIT", "workspaces": [