Compare commits

..

57 Commits

Author SHA1 Message Date
catlog22
5114a942dc chore: bump version to 6.1.4
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 22:32:58 +08:00
catlog22
edef937822 feat(v6.1.4): dashboard lite-fix enhancements and workflow docs update
- fix(dashboard): enhance lite-fix session parsing and plan rendering
- docs(workflow): add task status update command example for ccw dashboard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 22:32:39 +08:00
catlog22
faa86eded0 docs: add changelog entries for 6.1.2 and 6.1.3
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 15:53:15 +08:00
catlog22
44fa6e0a42 chore: bump version to 6.1.3
- Update README version badge and release notes
- Published to npm with simplified edit_file CLI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 15:52:43 +08:00
catlog22
be9a1c76d4 refactor(tool): simplify edit_file to parameter-based input only
- Remove JSON input support, use CLI parameters only
- Remove line mode, keep text replacement only
- Add sed as line operation alternative in tool-strategy.md
- Update documentation to English

Usage: ccw tool exec edit_file --path file.txt --old "old" --new "new"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 15:50:35 +08:00
catlog22
fcc811d6a1 docs(readme): update to v6.1.2 and simplify installation
- Update version badge and release notes to v6.1.2
- Remove one-click script install section (npm only)
- Update changelog highlights for latest release

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 15:41:39 +08:00
catlog22
906404f075 feat(server): add API endpoint for version check 2025-12-09 14:39:07 +08:00
catlog22
1267c8d0f4 feat(dashboard): add npm version update notification
- Add /api/version-check endpoint to check npm registry for updates
- Create version-check.js component with update banner UI
- Add CSS styles for version update banner
- Fix hook manager button event handling (use e.currentTarget)
- Bump version to 6.1.2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 14:38:55 +08:00
catlog22
eb1093128e docs(skill): fix project name from "Claude DMS3" to "Claude Code Workflow"
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 14:38:55 +08:00
catlog22
4ddeb6551e Merge pull request #36 from gurdasnijor/smithery/add-badge
Add "Run in Smithery" badge
2025-12-09 10:30:05 +08:00
Gurdas Nijor
7252c2ff3d Add Smithery badge 2025-12-08 16:10:45 -08:00
catlog22
8dee45c0a3 chore: bump version to 6.1.1
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 00:04:17 +08:00
catlog22
99ead8b165 fix(tool): add smart JSON parser with Windows path handling
- Auto-fix Windows backslash paths in JSON input
- Provide helpful hints when path escaping errors occur

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 00:03:23 +08:00
catlog22
0c7f13d9a4 docs: update README to v6.1.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 00:01:13 +08:00
catlog22
ed32b95de1 chore: bump version to 6.1.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 23:52:14 +08:00
catlog22
beacc2e26b Fix icon duplications and add navigation color scheme
- Add color variables for navigation items (info, indigo, orange)
- Apply distinct colors to navigation items:
  * Active: green
  * Archived: blue
  * Lite Plan: indigo
  * Lite Fix: orange
- Fix icon conflicts in review session:
  * Change Dimensions icon from 📋 to 🎯
  * Change Location icon from 📄 to 📍
  * Change Root Cause icon from 🔍 to 🎯
- Add active state styles for each navigation item type
- Support both light and dark themes
2025-12-08 23:50:50 +08:00
catlog22
389621c954 fix(dashboard): replace emoji icons in tabs-context and tabs-other components
- tabs-context.js: package, clipboard-list, building-2, code-2, file-code, link, flask-conical, eye icons
- tabs-other.js: file-text, ruler, eye, blocks, package, git-branch, plug icons for exploration sections
- Update all empty state icons to use Lucide
- Update asset category icons (documentation, source code, tests)
- Update exploration titles with Lucide icons
2025-12-08 23:34:14 +08:00
catlog22
2ba7756d13 fix(dashboard): replace task status emoji icons with Lucide icons in session-detail
- Replace ✓/○/⟳ with check-circle/circle/loader-2 icons
- Update formatStatusLabel() to return HTML with Lucide icons
- Update task stats bar and bulk action buttons
- Simplify toast messages to avoid HTML in text content
- Add lucide.createIcons() call in updateTaskStatsBar()
2025-12-08 23:31:01 +08:00
catlog22
02f77c0a51 fix(dashboard): add missing Lucide icon initialization in project-overview and session-detail views 2025-12-08 23:24:17 +08:00
catlog22
5aa8d37cd0 fix(dashboard): ensure Lucide icons are initialized after all dynamic content renders
- Add lucide.createIcons() calls in renderSessions, renderProjectOverview, renderMcpManager, renderHookManager, renderLiteTasks, showSessionDetailPage
- Fixes issue where icons would not appear after page render
2025-12-08 23:23:40 +08:00
catlog22
a7b8ffc716 feat(explorer): async task execution, CLI selector fix, WebSocket frame handling
- Task queue now executes tasks in parallel using Promise.all
- addFolderToQueue uses selected CLI tool instead of hardcoded 'gemini'
- Added CSS styles for queue-cli-selector toolbar
- Force refresh notification list after all tasks complete
- Fixed WebSocket frame parsing to handle Ping/Pong control frames
- Respond to Ping with Pong, ignore other control frames
- Eliminates garbled characters in WebSocket logs
2025-12-08 23:21:47 +08:00
catlog22
b0bc53646e feat(dashboard): complete icon unification across all views
- Update home.js: inbox, calendar, list-checks icons
- Update project-overview.js: code-2, blocks, component, git-branch, sparkles, bug, wrench, book-open icons
- Update session-detail.js: list-checks, package, file-text, ruler, scale, search icons for tabs
- Update lite-tasks.js: zap, file-edit, wrench, calendar, list-checks, ruler, package, file-text icons
- Update mcp-manager.js: plug, building-2, user, map-pin, check-circle, x-circle, circle-dashed, lock icons
- Update hook-manager.js: webhook, pencil, trash-2, clock, check-circle, bell, octagon-x icons
- Add getHookEventIconLucide() helper function
- Initialize Lucide icons after dynamic content rendering

All emoji icons replaced with consistent Lucide SVG icons
2025-12-08 23:14:48 +08:00
catlog22
5f31c9ad7e feat(dashboard): unify icons with Lucide Icons library
- Introduce Lucide Icons via CDN for consistent SVG icons
- Replace emoji icons with Lucide SVG icons in sidebar navigation
- Fix Sessions/Explorer icon confusion (📁/📂 → history/folder-tree)
- Update top bar icons (logo, theme toggle, search, refresh)
- Update stats section icons with colored Lucide icons
- Add icon animations support (animate-spin for loading states)
- Update Explorer view with Lucide folder/file icons
- Support dark/light theme icon adaptation

Icon mapping:
- Explorer: folder-tree (was 📂)
- Sessions: history (was 📁)
- Overview: bar-chart-3
- Active: play-circle
- Archived: archive
- Lite Plan: file-edit
- Lite Fix: wrench
- MCP Servers: plug
- Hooks: webhook
2025-12-08 22:58:42 +08:00
catlog22
818d9f3f5d Add enhanced styles for the review tab, including layout, buttons, and responsive design 2025-12-08 22:11:14 +08:00
catlog22
1c3c070db4 fix(tools): 修复CLI工具多行prompt的shell转义问题
修复文件:
- update-module-claude.js
- generate-module-docs.js

主要修复:
- 使用临时文件+stdin管道传递prompt,避免shell转义问题
- 添加Windows PowerShell兼容性支持
- 添加执行日志输出便于调试
- 添加临时文件清理逻辑

技术细节:
- gemini/qwen: 使用 cat file | tool 方式
- codex: 使用 \ 命令替换
- Windows: 使用 Get-Content -Raw | tool
2025-12-08 21:56:41 +08:00
catlog22
91e4792aa9 feat(ccw): 添加 ccw tool exec 工具系统
新增工具:
- edit_file: AI辅助文件编辑 (update/line模式)
- get_modules_by_depth: 项目结构分析
- update_module_claude: CLAUDE.md文档生成
- generate_module_docs: 模块文档生成
- detect_changed_modules: Git变更检测
- classify_folders: 文件夹分类
- discover_design_files: 设计文件发现
- convert_tokens_to_css: 设计token转CSS
- ui_generate_preview: UI预览生成
- ui_instantiate_prototypes: 原型实例化

使用方式:
  ccw tool list              # 列出所有工具
  ccw tool exec <name> '{}'  # 执行工具

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 21:10:31 +08:00
catlog22
813bfa8f97 fix(claude): 修复 ccw tool exec 命令格式 - 位置参数改为JSON格式
修复内容:
- 将位置参数格式改为JSON格式: ccw tool exec tool '{"param":"value"}'
- 修复双引号字符串内的JSON引号转义问题
- 更新deprecated脚本的使用示例

受影响文件:
- commands/memory/update-full.md, docs-full-cli.md, docs-related-cli.md, update-related.md
- commands/workflow/ui-design/generate.md, import-from-code.md
- scripts/*.sh (9个deprecated脚本)
- skills/command-guide/reference/* (通过analyze_commands.py自动同步)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 21:09:21 +08:00
catlog22
8b29f6bb7c chore: bump version to 6.0.5 2025-12-08 10:29:10 +08:00
catlog22
27273405f7 feat: CCW Dashboard 增强 - 停止命令、浏览器修复和MCP多源配置
- 新增 ccw stop 命令支持优雅停止和强制终止 (--force)
- 修复 ccw view 服务器检测时浏览器无法打开的问题
- MCP 配置现在从多个源读取:
  - ~/.claude.json (项目级)
  - ~/.claude/settings.json 和 settings.local.json (全局)
  - 各工作空间的 .claude/settings.json (工作空间级)
- 新增全局 MCP 服务器显示区域
- 修复路径选择模态框样式问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 10:28:07 +08:00
catlog22
f4299457fb fix(package): 调整依赖项顺序以提高可读性 2025-12-08 10:00:42 +08:00
catlog22
06983a35ad fix(dashboard): 添加路径选择弹窗样式
- 修复 path-modal 样式丢失问题
- 添加完整的弹窗样式定义

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 09:59:15 +08:00
catlog22
a80953527b feat(ccw): 智能识别运行中的服务器,支持工作空间切换
- ccw view 自动检测服务器是否已运行
- 已运行时切换工作空间并打开浏览器,无需重启服务器
- 新增 /api/switch-path 和 /api/health 端点
- Dashboard 支持 URL path 参数加载指定工作空间

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 09:56:35 +08:00
catlog22
0f469e225b fix: 添加 ccw/package.json 到发布文件列表 2025-12-07 22:59:43 +08:00
catlog22
5dca69fbec chore: bump version to 6.0.1 2025-12-07 21:42:50 +08:00
catlog22
ac626e5895 feat: Review Session增加Fix进度跟踪卡片,移除独立Dashboard模板
- 新增Fix Progress跟踪卡片(走马灯样式)显示修复进度
- 添加/api/file端点支持读取fix-plan.json
- 移除review-fix/module-cycle/session-cycle中的独立dashboard生成
- 删除废弃的workflow-dashboard.html和review-cycle-dashboard.html模板
- 统一使用ccw view命令查看进度

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 21:41:43 +08:00
catlog22
cb78758839 docs: 更新 README 添加 npm 安装和 ccw CLI 说明
- 版本更新到 v6.0.0
- 添加 npm badge 和安装说明
- 新增 CCW CLI Tool 章节,说明所有命令
- 更新 description 为 JSON-driven multi-agent framework
- 修复 package.json 循环依赖

安装: npm install -g claude-code-workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:56:58 +08:00
catlog22
844a2412b2 chore: 配置 npm 发布 @dyw1234/claude-code-workflow@6.0.0
- 添加 package.json 到项目根目录
- 配置 scoped package @dyw1234/claude-code-workflow
- 添加 .npmignore 排除不必要文件
- 发布 v6.0.0 到 npm registry

安装方式: npm install -g @dyw1234/claude-code-workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:42:23 +08:00
catlog22
650d877430 feat: Dashboard 增强 - MCP管理器、Review Session 和 UI 改进
- 添加 MCP Manager 组件,支持服务器状态管理
- 增强 Review Session 视图,添加 conflict/review tabs
- 新增 _conflict_tab.js 和 _review_tab.js 组件
- 改进 carousel、tabs-other 等组件
- 大量 CSS 样式更新和优化
- home.js 添加新功能支持

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:07:29 +08:00
catlog22
f459061ad5 refactor: 简化 ccw 安装流程,移除远程下载功能
- 删除 version-fetcher.js,移除 GitHub API 依赖
- install.js: 移除远程版本选择,只保留本地安装
- upgrade.js: 重写为本地升级,比对包版本与已安装版本
- cli.js: 移除 -v/-t/-b 等版本相关选项
- 添加 CLAUDE.md 复制到 .claude 目录的逻辑

版本管理统一到 npm:npm install -g ccw@版本号

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:03:10 +08:00
catlog22
a6f9701679 Add exploration field rendering helpers for dynamic content display
- Implemented `renderExpField` to handle various data types for exploration fields.
- Created `renderExpArray` to format arrays, including support for objects with specific properties.
- Developed `renderExpObject` for recursive rendering of object values, filtering out private keys.
- Introduced HTML escaping for safe rendering of user-generated content.
2025-12-07 18:07:28 +08:00
catlog22
26a325efff feat: 添加最近路径管理功能,包括删除路径的API和前端交互 2025-12-07 17:35:10 +08:00
catlog22
0a96ee16a8 Add tool strategy documentation with triggering mechanisms and text processing references
- Introduced auto and manual triggering mechanisms for Exa.
- Added quick reference guides for sed and awk text processing.
- Established a fallback strategy for handling edit failures.
2025-12-07 17:09:07 +08:00
catlog22
43c962b48b feat: Add Notifications Component with WebSocket and Auto Refresh
- Implemented a Notifications component for real-time updates using WebSocket.
- Added silent refresh functionality to update data without notification bubbles.
- Introduced auto-refresh mechanism to periodically check for changes in workflow data.
- Enhanced data handling with session and task updates, ensuring UI reflects the latest state.

feat: Create Hook Manager View for Managing Hooks

- Developed a Hook Manager view to manage project and global hooks.
- Added functionality to create, edit, and delete hooks with a user-friendly interface.
- Implemented quick install templates for common hooks to streamline user experience.
- Included environment variables reference for hooks to assist users in configuration.

feat: Implement MCP Manager View for Server Management

- Created an MCP Manager view for managing MCP servers within projects.
- Enabled adding and removing servers from projects with a clear UI.
- Displayed available servers from other projects for easy access and management.
- Provided an overview of all projects and their associated MCP servers.

feat: Add Version Fetcher Utility for GitHub Releases

- Implemented a version fetcher utility to retrieve release information from GitHub.
- Added functions to fetch the latest release, recent releases, and latest commit details.
- Included functionality to download and extract repository zip files.
- Ensured cleanup of temporary directories after downloads to maintain system hygiene.
2025-12-07 15:48:39 +08:00
catlog22
724545ebd6 Remove backup HTML template for workflow dashboard 2025-12-07 12:59:59 +08:00
catlog22
a9a2004d4a feat(dashboard): add context sections for assets, dependencies, test context, and conflict detection 2025-12-06 21:04:50 +08:00
catlog22
5b14c8a832 feat: add project overview section and enhance task item styles
- Introduced a new project overview section in the dashboard, displaying project details, technology stack, architecture, key components, and development history.
- Updated the server logic to include project overview data.
- Enhanced task item styles with status-based background colors for better visual distinction.
- Improved markdown modal functionality for viewing context and implementation plan with normalized line endings.
- Refactored task rendering logic to simplify task item display and improve performance.
2025-12-06 20:50:23 +08:00
catlog22
e2c5a514cb fix(data-aggregator): remove extra closing brace causing syntax error
- Fixed loadDimensionData function that had duplicate closing brace
- This was preventing review session dimension data from being parsed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 16:59:45 +08:00
catlog22
296761a34e style(dashboard): enhance step numbers and mod-point card styling
- Change step numbers from circles to rounded rectangles
- Add shadow to step number badges for depth
- Enhance mod-point-card with full border and stronger left accent
- Add hover effect with elevated shadow on mod-point-card

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 16:52:36 +08:00
catlog22
1d3436d51b feat(dashboard): simplify lite task list and add dedicated drawer
- Remove META/CONTEXT/FLOW_CONTROL collapsible sections from task list
- Add compact task item with action/scope/mods/steps badges
- Create dedicated renderLiteTaskDrawerContent for plan.json parsing
- Add Overview tab with description, scope, acceptance, dependencies
- Add Implementation tab with steps and modification points
- Add proper file list extraction from modification_points
- Add CSS styles for lite task badges and drawer components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:51:37 +08:00
catlog22
60bb11c315 feat(dashboard): simplify lite task UI and add exploration context support
- Remove status indicators from lite task cards (progress bars, percentages)
- Remove status icons and badges from task detail items
- Remove stats bar showing completed/in-progress/pending counts
- Add Plan tab in drawer for plan.json data display
- Add exploration-*.json parsing for context tab
- Add collapsible sections for architecture, dependencies, patterns
- Fix currentPath selector bug causing TypeError

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:47:49 +08:00
catlog22
72fe6195af fix: update Codex multiplier to reflect new time allocation guidelines 2025-12-05 11:14:42 +08:00
catlog22
04fb3b7ee3 feat(dashboard): add plan data loading and lite task detail styling
- Add plan.json data loading to getSessionDetailData function for lite tasks
- Implement plan tab content styling with summary and approach sections
- Add plan metadata grid layout for displaying task planning information
- Create lite task detail page styles with task stats bar and status indicators
- Add context tab content styling with improved section hierarchy
- Implement path tags and JSON content display styles for plan details
- Add collapsible sections for organizing plan information
- Create comprehensive styling for context fields, modification points, and implementation steps
- Add array and nested object rendering styles for JSON data visualization
- Implement button styles for JSON view toggle functionality
2025-12-04 22:55:56 +08:00
catlog22
942fca7ad8 refactor(dashboard): optimize template structure and enhance data aggregation
- Reorder CSS and JS file loading in dashboard-generator.js for consistency
- Simplify dashboard.css by removing redundant styles and consolidating to Tailwind-based approach
- Add backup files for dashboard.html, dashboard.css, and review-cycle-dashboard.html
- Create new Tailwind-based dashboard template (dashboard_tailwind.html) and test variant
- Add tailwind.config.js for Tailwind CSS configuration
- Enhance data-aggregator.js to load full task data for archived sessions (previously only counted)
- Add meta, context, and flow_control fields to task objects for richer data representation
- Implement review data loading for archived sessions to match active session behavior
- Improve task sorting consistency across active and archived sessions
- Reduce CSS file size by ~70% through Tailwind utility consolidation while maintaining visual parity
2025-12-04 21:41:30 +08:00
catlog22
39df995e37 Refactor code structure for improved readability and maintainability 2025-12-04 17:22:25 +08:00
catlog22
efaa8b6620 fix: Refine action-planning-agent documentation for clarity and structure 2025-12-04 09:47:53 +08:00
catlog22
35bd0aa8f6 feat: Add workflow dashboard template and utility functions
- Implemented a new HTML template for the workflow dashboard, featuring a responsive design with dark/light theme support, session statistics, and task management UI.
- Created a browser launcher utility to open HTML files in the default browser across platforms.
- Developed file utility functions for safe reading and writing of JSON and text files.
- Added path resolver utilities to validate and resolve file paths, ensuring security against path traversal attacks.
- Introduced UI utilities for displaying styled messages and banners in the console.
2025-12-04 09:40:12 +08:00
catlog22
0f9adc59f9 docs: Remove deprecated CLI commands, clarify semantic invocation
Addresses issue #33 - /cli:mode:bug-diagnosis command not found

Changes:
- Remove deprecated /cli:* commands (/cli:analyze, /cli:chat, /cli:execute,
  /cli:codex-execute, /cli:discuss-plan, /cli:mode:*) from documentation
- Only /cli:cli-init remains as the sole CLI command
- Update all references to use /workflow:lite-plan, /workflow:lite-fix
- Clarify that CLI tools are now invoked through semantic invocation
  (natural language) - Claude auto-selects Gemini/Qwen/Codex with templates
- Update COMMAND_SPEC.md, COMMAND_REFERENCE.md, GETTING_STARTED*.md,
  FAQ.md, WORKFLOW_DECISION_GUIDE*.md, workflow-architecture.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 23:05:40 +08:00
174 changed files with 38081 additions and 4604 deletions

View File

@@ -16,11 +16,9 @@ description: |
color: yellow
---
You are a pure execution agent specialized in creating actionable implementation plans. You receive requirements and control flags from the command layer and execute planning tasks without complex decision-making logic.
## Overview
**Agent Role**: Transform user requirements and brainstorming artifacts into structured, executable implementation plans with quantified deliverables and measurable acceptance criteria.
**Agent Role**: Pure execution agent that transforms user requirements and brainstorming artifacts into structured, executable implementation plans with quantified deliverables and measurable acceptance criteria. Receives requirements and control flags from the command layer and executes planning tasks without complex decision-making logic.
**Core Capabilities**:
- Load and synthesize context from multiple sources (session metadata, context packages, brainstorming artifacts)
@@ -33,7 +31,7 @@ You are a pure execution agent specialized in creating actionable implementation
---
## 1. Execution Process
## 1. Input & Execution
### 1.1 Input Processing
@@ -50,7 +48,7 @@ You are a pure execution agent specialized in creating actionable implementation
- **Control flags**: DEEP_ANALYSIS_REQUIRED, etc.
- **Task requirements**: Direct task description
### 1.2 Two-Phase Execution Flow
### 1.2 Execution Flow
#### Phase 1: Context Loading & Assembly
@@ -88,6 +86,27 @@ You are a pure execution agent specialized in creating actionable implementation
6. Assess task complexity (simple/medium/complex)
```
**MCP Integration** (when `mcp_capabilities` available):
```javascript
// Exa Code Context (mcp_capabilities.exa_code = true)
mcp__exa__get_code_context_exa(
query="TypeScript OAuth2 JWT authentication patterns",
tokensNum="dynamic"
)
// Integration in flow_control.pre_analysis
{
"step": "local_codebase_exploration",
"action": "Explore codebase structure",
"commands": [
"bash(rg '^(function|class|interface).*[task_keyword]' --type ts -n --max-count 15)",
"bash(find . -name '*[task_keyword]*' -type f | grep -v node_modules | head -10)"
],
"output_to": "codebase_structure"
}
```
**Context Package Structure** (fields defined by context-search-agent):
**Always Present**:
@@ -169,30 +188,6 @@ if (contextPackage.brainstorm_artifacts?.role_analyses?.length > 0) {
5. Update session state for execution readiness
```
### 1.3 MCP Integration Guidelines
**Exa Code Context** (`mcp_capabilities.exa_code = true`):
```javascript
// Get best practices and examples
mcp__exa__get_code_context_exa(
query="TypeScript OAuth2 JWT authentication patterns",
tokensNum="dynamic"
)
```
**Integration in flow_control.pre_analysis**:
```json
{
"step": "local_codebase_exploration",
"action": "Explore codebase structure",
"commands": [
"bash(rg '^(function|class|interface).*[task_keyword]' --type ts -n --max-count 15)",
"bash(find . -name '*[task_keyword]*' -type f | grep -v node_modules | head -10)"
],
"output_to": "codebase_structure"
}
```
---
## 2. Output Specifications
@@ -213,7 +208,11 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
```
**Field Descriptions**:
- `id`: Task identifier (format: `IMPL-N`)
- `id`: Task identifier
- Single module format: `IMPL-N` (e.g., IMPL-001, IMPL-002)
- Multi-module format: `IMPL-{prefix}{seq}` (e.g., IMPL-A1, IMPL-B1, IMPL-C1)
- Prefix: A, B, C... (assigned by module detection order)
- Sequence: 1, 2, 3... (per-module increment)
- `title`: Descriptive task name summarizing the work
- `status`: Task state - `pending` (not started), `active` (in progress), `completed` (done), `blocked` (waiting on dependencies)
- `context_package_path`: Path to smart context package containing project structure, dependencies, and brainstorming artifacts catalog
@@ -225,7 +224,8 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
"meta": {
"type": "feature|bugfix|refactor|test-gen|test-fix|docs",
"agent": "@code-developer|@action-planning-agent|@test-fix-agent|@universal-executor",
"execution_group": "parallel-abc123|null"
"execution_group": "parallel-abc123|null",
"module": "frontend|backend|shared|null"
}
}
```
@@ -234,6 +234,7 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
- `type`: Task category - `feature` (new functionality), `bugfix` (fix defects), `refactor` (restructure code), `test-gen` (generate tests), `test-fix` (fix failing tests), `docs` (documentation)
- `agent`: Assigned agent for execution
- `execution_group`: Parallelization group ID (tasks with same ID can run concurrently) or `null` for sequential tasks
- `module`: Module identifier for multi-module projects (e.g., `frontend`, `backend`, `shared`) or `null` for single-module
**Test Task Extensions** (for type="test-gen" or type="test-fix"):
@@ -391,7 +392,7 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
// Pattern: Project structure analysis
{
"step": "analyze_project_architecture",
"commands": ["bash(~/.claude/scripts/get_modules_by_depth.sh)"],
"commands": ["bash(ccw tool exec get_modules_by_depth '{}')"],
"output_to": "project_architecture"
},
@@ -604,10 +605,42 @@ Agent determines CLI tool usage per-step based on user semantics and task nature
- Analysis results (technical approach, architecture decisions)
- Brainstorming artifacts (role analyses, guidance specifications)
**Multi-Module Format** (when modules detected):
When multiple modules are detected (frontend/backend, etc.), organize IMPL_PLAN.md by module:
```markdown
# Implementation Plan
## Module A: Frontend (N tasks)
### IMPL-A1: [Task Title]
[Task details...]
### IMPL-A2: [Task Title]
[Task details...]
## Module B: Backend (N tasks)
### IMPL-B1: [Task Title]
[Task details...]
### IMPL-B2: [Task Title]
[Task details...]
## Cross-Module Dependencies
- IMPL-A1 → IMPL-B1 (Frontend depends on Backend API)
- IMPL-A2 → IMPL-B2 (UI state depends on Backend service)
```
**Cross-Module Dependency Notation**:
- During parallel planning, use `CROSS::{module}::{pattern}` format
- Example: `depends_on: ["CROSS::B::api-endpoint"]`
- Integration phase resolves to actual task IDs: `CROSS::B::api → IMPL-B1`
### 2.3 TODO_LIST.md Structure
Generate at `.workflow/active/{session_id}/TODO_LIST.md`:
**Single Module Format**:
```markdown
# Tasks: {Session Topic}
@@ -621,30 +654,54 @@ Generate at `.workflow/active/{session_id}/TODO_LIST.md`:
- `- [x]` = Completed task
```
**Multi-Module Format** (hierarchical by module):
```markdown
# Tasks: {Session Topic}
## Module A (Frontend)
- [ ] **IMPL-A1**: [Task Title] → [📋](./.task/IMPL-A1.json)
- [ ] **IMPL-A2**: [Task Title] → [📋](./.task/IMPL-A2.json)
## Module B (Backend)
- [ ] **IMPL-B1**: [Task Title] → [📋](./.task/IMPL-B1.json)
- [ ] **IMPL-B2**: [Task Title] → [📋](./.task/IMPL-B2.json)
## Cross-Module Dependencies
- IMPL-A1 → IMPL-B1 (Frontend depends on Backend API)
## Status Legend
- `- [ ]` = Pending task
- `- [x]` = Completed task
```
**Linking Rules**:
- Todo items → task JSON: `[📋](./.task/IMPL-XXX.json)`
- Completed tasks → summaries: `[✅](./.summaries/IMPL-XXX-summary.md)`
- Consistent ID schemes: IMPL-XXX
- Consistent ID schemes: `IMPL-N` (single) or `IMPL-{prefix}{seq}` (multi-module)
### 2.4 Complexity-Based Structure Selection
### 2.4 Complexity & Structure Selection
Use `analysis_results.complexity` or task count to determine structure:
**Simple Tasks** (≤5 tasks):
- Flat structure: IMPL_PLAN.md + TODO_LIST.md + task JSONs
- All tasks at same level
**Single Module Mode**:
- **Simple Tasks** (≤5 tasks): Flat structure
- **Medium Tasks** (6-12 tasks): Flat structure
- **Complex Tasks** (>12 tasks): Re-scope required (maximum 12 tasks hard limit)
**Medium Tasks** (6-12 tasks):
- Flat structure: IMPL_PLAN.md + TODO_LIST.md + task JSONs
- All tasks at same level
**Multi-Module Mode** (N+1 parallel planning):
- **Per-module limit**: ≤9 tasks per module
- **Total limit**: Sum of all module tasks ≤27 (3 modules × 9 tasks)
- **Task ID format**: `IMPL-{prefix}{seq}` (e.g., IMPL-A1, IMPL-B1)
- **Structure**: Hierarchical by module in IMPL_PLAN.md and TODO_LIST.md
**Complex Tasks** (>12 tasks):
- **Re-scope required**: Maximum 12 tasks hard limit
- If analysis_results contains >12 tasks, consolidate or request re-scoping
**Multi-Module Detection Triggers**:
- Explicit frontend/backend separation (`src/frontend`, `src/backend`)
- Monorepo structure (`packages/*`, `apps/*`)
- Context-package dependency clustering (2+ distinct module groups)
---
## 3. Quality & Standards
## 3. Quality Standards
### 3.1 Quantification Requirements (MANDATORY)
@@ -670,47 +727,46 @@ Use `analysis_results.complexity` or task count to determine structure:
- [ ] Each implementation step has its own acceptance criteria
**Examples**:
- GOOD: `"Implement 5 commands: [cmd1, cmd2, cmd3, cmd4, cmd5]"`
- BAD: `"Implement new commands"`
- GOOD: `"5 files created: verify by ls .claude/commands/*.md | wc -l = 5"`
- BAD: `"All commands implemented successfully"`
- GOOD: `"Implement 5 commands: [cmd1, cmd2, cmd3, cmd4, cmd5]"`
- BAD: `"Implement new commands"`
- GOOD: `"5 files created: verify by ls .claude/commands/*.md | wc -l = 5"`
- BAD: `"All commands implemented successfully"`
### 3.2 Planning Principles
### 3.2 Planning & Organization Standards
**Planning Principles**:
- Each stage produces working, testable code
- Clear success criteria for each deliverable
- Dependencies clearly identified between stages
- Incremental progress over big bangs
### 3.3 File Organization
**File Organization**:
- Session naming: `WFS-[topic-slug]`
- Task IDs: IMPL-XXX (flat structure only)
- Directory structure: flat task organization
### 3.4 Document Standards
- Task IDs:
- Single module: `IMPL-N` (e.g., IMPL-001, IMPL-002)
- Multi-module: `IMPL-{prefix}{seq}` (e.g., IMPL-A1, IMPL-B1)
- Directory structure: flat task organization (all tasks in `.task/`)
**Document Standards**:
- Proper linking between documents
- Consistent navigation and references
---
## 4. Key Reminders
### 3.3 Guidelines Checklist
**ALWAYS:**
- **Apply Quantification Requirements**: All requirements, acceptance criteria, and modification points MUST include explicit counts and enumerations
- **Load IMPL_PLAN template**: Read(~/.claude/workflows/cli-templates/prompts/workflow/impl-plan-template.txt) before generating IMPL_PLAN.md
- **Use provided context package**: Extract all information from structured context
- **Respect memory-first rule**: Use provided content (already loaded from memory/file)
- **Follow 6-field schema**: All task JSONs must have id, title, status, context_package_path, meta, context, flow_control
- **Map artifacts**: Use artifacts_inventory to populate task.context.artifacts array
- **Add MCP integration**: Include MCP tool steps in flow_control.pre_analysis when capabilities available
- **Validate task count**: Maximum 12 tasks hard limit, request re-scope if exceeded
- **Use session paths**: Construct all paths using provided session_id
- **Link documents properly**: Use correct linking format (📋 for JSON, ✅ for summaries)
- **Run validation checklist**: Verify all quantification requirements before finalizing task JSONs
- **Apply 举一反三 principle**: Adapt pre-analysis patterns to task-specific needs dynamically
- **Follow template validation**: Complete IMPL_PLAN.md template validation checklist before finalization
- Apply Quantification Requirements to all requirements, acceptance criteria, and modification points
- Load IMPL_PLAN template: `Read(~/.claude/workflows/cli-templates/prompts/workflow/impl-plan-template.txt)` before generating IMPL_PLAN.md
- Use provided context package: Extract all information from structured context
- Respect memory-first rule: Use provided content (already loaded from memory/file)
- Follow 6-field schema: All task JSONs must have id, title, status, context_package_path, meta, context, flow_control
- Map artifacts: Use artifacts_inventory to populate task.context.artifacts array
- Add MCP integration: Include MCP tool steps in flow_control.pre_analysis when capabilities available
- Validate task count: Maximum 12 tasks hard limit, request re-scope if exceeded
- Use session paths: Construct all paths using provided session_id
- Link documents properly: Use correct linking format (📋 for JSON, ✅ for summaries)
- Run validation checklist: Verify all quantification requirements before finalizing task JSONs
- Apply 举一反三 principle: Adapt pre-analysis patterns to task-specific needs dynamically
- Follow template validation: Complete IMPL_PLAN.md template validation checklist before finalization
**NEVER:**
- Load files directly (use provided context package instead)

View File

@@ -67,7 +67,7 @@ Score = 0
**1. Project Structure**:
```bash
~/.claude/scripts/get_modules_by_depth.sh
ccw tool exec get_modules_by_depth '{}'
```
**2. Content Search**:

View File

@@ -67,7 +67,7 @@ Phase 4: Output Generation
```bash
# Project structure
~/.claude/scripts/get_modules_by_depth.sh
ccw tool exec get_modules_by_depth '{}'
# Pattern discovery (adapt based on language)
rg "^export (class|interface|function) " --type ts -n

View File

@@ -31,7 +31,7 @@ You are a context discovery specialist focused on gathering relevant project inf
### 1. Reference Documentation (Project Standards)
**Tools**:
- `Read()` - Load CLAUDE.md, README.md, architecture docs
- `Bash(~/.claude/scripts/get_modules_by_depth.sh)` - Project structure
- `Bash(ccw tool exec get_modules_by_depth '{}')` - Project structure
- `Glob()` - Find documentation files
**Use**: Phase 0 foundation setup
@@ -82,7 +82,7 @@ mcp__code-index__set_project_path(process.cwd())
mcp__code-index__refresh_index()
// 2. Project Structure
bash(~/.claude/scripts/get_modules_by_depth.sh)
bash(ccw tool exec get_modules_by_depth '{}')
// 3. Load Documentation (if not in memory)
if (!memory.has("CLAUDE.md")) Read(CLAUDE.md)

View File

@@ -8,7 +8,7 @@ You are a documentation update coordinator for complex projects. Orchestrate par
## Core Mission
Execute depth-parallel updates for all modules using `~/.claude/scripts/update_module_claude.sh`. **Every module path must be processed**.
Execute depth-parallel updates for all modules using `ccw tool exec update_module_claude`. **Every module path must be processed**.
## Input Context
@@ -42,12 +42,12 @@ TodoWrite([
# 3. Launch parallel jobs (max 4)
# Depth 5 example (Layer 3 - use multi-layer):
~/.claude/scripts/update_module_claude.sh "multi-layer" "./.claude/workflows/cli-templates/prompts/analysis" "gemini" &
~/.claude/scripts/update_module_claude.sh "multi-layer" "./.claude/workflows/cli-templates/prompts/development" "gemini" &
ccw tool exec update_module_claude '{"strategy":"multi-layer","path":"./.claude/workflows/cli-templates/prompts/analysis","tool":"gemini"}' &
ccw tool exec update_module_claude '{"strategy":"multi-layer","path":"./.claude/workflows/cli-templates/prompts/development","tool":"gemini"}' &
# Depth 1 example (Layer 2 - use single-layer):
~/.claude/scripts/update_module_claude.sh "single-layer" "./src/auth" "gemini" &
~/.claude/scripts/update_module_claude.sh "single-layer" "./src/api" "gemini" &
ccw tool exec update_module_claude '{"strategy":"single-layer","path":"./src/auth","tool":"gemini"}' &
ccw tool exec update_module_claude '{"strategy":"single-layer","path":"./src/api","tool":"gemini"}' &
# ... up to 4 concurrent jobs
# 4. Wait for all depth jobs to complete

View File

@@ -191,7 +191,7 @@ target/
### Step 2: Workspace Analysis (MANDATORY FIRST)
```bash
# Analyze workspace structure
bash(~/.claude/scripts/get_modules_by_depth.sh json)
bash(ccw tool exec get_modules_by_depth '{"format":"json"}')
```
### Step 3: Technology Detection

View File

@@ -101,10 +101,10 @@ src/ (depth 1) → SINGLE STRATEGY
Bash({command: "pwd && basename \"$(pwd)\" && git rev-parse --show-toplevel 2>/dev/null || pwd", run_in_background: false});
// Get module structure with classification
Bash({command: "~/.claude/scripts/get_modules_by_depth.sh list | ~/.claude/scripts/classify-folders.sh", run_in_background: false});
Bash({command: "ccw tool exec get_modules_by_depth '{\"format\":\"list\"}' | ccw tool exec classify_folders '{}'", run_in_background: false});
// OR with path parameter
Bash({command: "cd <target-path> && ~/.claude/scripts/get_modules_by_depth.sh list | ~/.claude/scripts/classify-folders.sh", run_in_background: false});
Bash({command: "cd <target-path> && ccw tool exec get_modules_by_depth '{\"format\":\"list\"}' | ccw tool exec classify_folders '{}'", run_in_background: false});
```
**Parse output** `depth:N|path:<PATH>|type:<code|navigation>|...` to extract module paths, types, and count.
@@ -200,7 +200,7 @@ for (let layer of [3, 2, 1]) {
let strategy = module.depth >= 3 ? "full" : "single";
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/generate_module_docs.sh "${strategy}" "." "${project_name}" "${tool}"`,
command: `cd ${module.path} && ccw tool exec generate_module_docs '{"strategy":"${strategy}","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -263,7 +263,7 @@ MODULES:
TOOLS (try in order): {{tool_1}}, {{tool_2}}, {{tool_3}}
EXECUTION SCRIPT: ~/.claude/scripts/generate_module_docs.sh
EXECUTION SCRIPT: ccw tool exec generate_module_docs
- Accepts strategy parameter: full | single
- Accepts folder type detection: code | navigation
- Tool execution via direct CLI commands (gemini/qwen/codex)
@@ -273,7 +273,7 @@ EXECUTION FLOW (for each module):
1. Tool fallback loop (exit on first success):
for tool in {{tool_1}} {{tool_2}} {{tool_3}}; do
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "{{strategy}}" "." "{{project_name}}" "${tool}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"{{strategy}}","sourcePath":".","projectName":"{{project_name}}","tool":"${tool}"}'`,
run_in_background: false
})
exit_code=$?
@@ -322,7 +322,7 @@ let project_root = get_project_root();
report("Generating project README.md...");
for (let tool of tool_order) {
Bash({
command: `cd ${project_root} && ~/.claude/scripts/generate_module_docs.sh "project-readme" "." "${project_name}" "${tool}"`,
command: `cd ${project_root} && ccw tool exec generate_module_docs '{"strategy":"project-readme","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -335,7 +335,7 @@ for (let tool of tool_order) {
report("Generating ARCHITECTURE.md and EXAMPLES.md...");
for (let tool of tool_order) {
Bash({
command: `cd ${project_root} && ~/.claude/scripts/generate_module_docs.sh "project-architecture" "." "${project_name}" "${tool}"`,
command: `cd ${project_root} && ccw tool exec generate_module_docs '{"strategy":"project-architecture","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -350,7 +350,7 @@ if (bash_result.stdout.includes("API_FOUND")) {
report("Generating HTTP API documentation...");
for (let tool of tool_order) {
Bash({
command: `cd ${project_root} && ~/.claude/scripts/generate_module_docs.sh "http-api" "." "${project_name}" "${tool}"`,
command: `cd ${project_root} && ccw tool exec generate_module_docs '{"strategy":"http-api","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {

View File

@@ -51,7 +51,7 @@ Orchestrates context-aware documentation generation/update for changed modules u
Bash({command: "pwd && basename \"$(pwd)\" && git rev-parse --show-toplevel 2>/dev/null || pwd", run_in_background: false});
// Detect changed modules
Bash({command: "~/.claude/scripts/detect_changed_modules.sh list", run_in_background: false});
Bash({command: "ccw tool exec detect_changed_modules '{\"format\":\"list\"}'", run_in_background: false});
// Cache git changes
Bash({command: "git add -A 2>/dev/null || true", run_in_background: false});
@@ -123,7 +123,7 @@ for (let depth of sorted_depths.reverse()) { // N → 0
return async () => {
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/generate_module_docs.sh "single" "." "${project_name}" "${tool}"`,
command: `cd ${module.path} && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -207,21 +207,21 @@ EXECUTION:
For each module above:
1. Try tool 1:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "single" "." "{{project_name}}" "{{tool_1}}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"{{project_name}}","tool":"{{tool_1}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} docs generated with {{tool_1}}", proceed to next module
→ Failure: Try tool 2
2. Try tool 2:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "single" "." "{{project_name}}" "{{tool_2}}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"{{project_name}}","tool":"{{tool_2}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} docs generated with {{tool_2}}", proceed to next module
→ Failure: Try tool 3
3. Try tool 3:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "single" "." "{{project_name}}" "{{tool_3}}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"{{project_name}}","tool":"{{tool_3}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} docs generated with {{tool_3}}", proceed to next module

View File

@@ -64,12 +64,17 @@ Lightweight planner that analyzes project structure, decomposes documentation wo
```bash
# Get target path, project name, and root
bash(pwd && basename "$(pwd)" && git rev-parse --show-toplevel 2>/dev/null || pwd && date +%Y%m%d-%H%M%S)
```
# Create session directories (replace timestamp)
bash(mkdir -p .workflow/active/WFS-docs-{timestamp}/.{task,process,summaries})
```javascript
// Create docs session (type: docs)
SlashCommand(command="/workflow:session:start --type docs --new \"{project_name}-docs-{timestamp}\"")
// Parse output to get sessionId
```
# Create workflow-session.json (replace values)
bash(echo '{"session_id":"WFS-docs-{timestamp}","project":"{project} documentation","status":"planning","timestamp":"2024-01-20T14:30:22+08:00","path":".","target_path":"{target_path}","project_root":"{project_root}","project_name":"{project_name}","mode":"full","tool":"gemini","cli_execute":false}' | jq '.' > .workflow/active/WFS-docs-{timestamp}/workflow-session.json)
```bash
# Update workflow-session.json with docs-specific fields
bash(jq '. + {"target_path":"{target_path}","project_root":"{project_root}","project_name":"{project_name}","mode":"full","tool":"gemini","cli_execute":false}' .workflow/active/{sessionId}/workflow-session.json > tmp.json && mv tmp.json .workflow/active/{sessionId}/workflow-session.json)
```
### Phase 2: Analyze Structure
@@ -80,10 +85,10 @@ bash(echo '{"session_id":"WFS-docs-{timestamp}","project":"{project} documentati
```bash
# 1. Run folder analysis
bash(~/.claude/scripts/get_modules_by_depth.sh | ~/.claude/scripts/classify-folders.sh)
bash(ccw tool exec get_modules_by_depth '{}' | ccw tool exec classify_folders '{}')
# 2. Get top-level directories (first 2 path levels)
bash(~/.claude/scripts/get_modules_by_depth.sh | ~/.claude/scripts/classify-folders.sh | awk -F'|' '{print $1}' | sed 's|^\./||' | awk -F'/' '{if(NF>=2) print $1"/"$2; else if(NF==1) print $1}' | sort -u)
bash(ccw tool exec get_modules_by_depth '{}' | ccw tool exec classify_folders '{}' | awk -F'|' '{print $1}' | sed 's|^\./||' | awk -F'/' '{if(NF>=2) print $1"/"$2; else if(NF==1) print $1}' | sort -u)
# 3. Find existing docs (if directory exists)
bash(if [ -d .workflow/docs/\${project_name} ]; then find .workflow/docs/\${project_name} -type f -name "*.md" ! -path "*/README.md" ! -path "*/ARCHITECTURE.md" ! -path "*/EXAMPLES.md" ! -path "*/api/*" 2>/dev/null; fi)

View File

@@ -109,7 +109,7 @@ Task(
1. **Project Structure**
\`\`\`bash
bash(~/.claude/scripts/get_modules_by_depth.sh)
bash(ccw tool exec get_modules_by_depth '{}')
\`\`\`
2. **Core Documentation**

View File

@@ -99,10 +99,10 @@ src/ (depth 1) → SINGLE-LAYER STRATEGY
Bash({command: "git add -A 2>/dev/null || true", run_in_background: false});
// Get module structure
Bash({command: "~/.claude/scripts/get_modules_by_depth.sh list", run_in_background: false});
Bash({command: "ccw tool exec get_modules_by_depth '{\"format\":\"list\"}'", run_in_background: false});
// OR with --path
Bash({command: "cd <target-path> && ~/.claude/scripts/get_modules_by_depth.sh list", run_in_background: false});
Bash({command: "cd <target-path> && ccw tool exec get_modules_by_depth '{\"format\":\"list\"}'", run_in_background: false});
```
**Parse output** `depth:N|path:<PATH>|...` to extract module paths and count.
@@ -185,7 +185,7 @@ for (let layer of [3, 2, 1]) {
let strategy = module.depth >= 3 ? "multi-layer" : "single-layer";
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/update_module_claude.sh "${strategy}" "." "${tool}"`,
command: `cd ${module.path} && ccw tool exec update_module_claude '{"strategy":"${strategy}","path":".","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -244,7 +244,7 @@ MODULES:
TOOLS (try in order): {{tool_1}}, {{tool_2}}, {{tool_3}}
EXECUTION SCRIPT: ~/.claude/scripts/update_module_claude.sh
EXECUTION SCRIPT: ccw tool exec update_module_claude
- Accepts strategy parameter: multi-layer | single-layer
- Tool execution via direct CLI commands (gemini/qwen/codex)
@@ -252,7 +252,7 @@ EXECUTION FLOW (for each module):
1. Tool fallback loop (exit on first success):
for tool in {{tool_1}} {{tool_2}} {{tool_3}}; do
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "{{strategy}}" "." "${tool}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"{{strategy}}","path":".","tool":"${tool}"}'`,
run_in_background: false
})
exit_code=$?

View File

@@ -41,7 +41,7 @@ Orchestrates context-aware CLAUDE.md updates for changed modules using batched a
```javascript
// Detect changed modules
Bash({command: "~/.claude/scripts/detect_changed_modules.sh list", run_in_background: false});
Bash({command: "ccw tool exec detect_changed_modules '{\"format\":\"list\"}'", run_in_background: false});
// Cache git changes
Bash({command: "git add -A 2>/dev/null || true", run_in_background: false});
@@ -102,7 +102,7 @@ for (let depth of sorted_depths.reverse()) { // N → 0
return async () => {
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "${tool}"`,
command: `cd ${module.path} && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -184,21 +184,21 @@ EXECUTION:
For each module above:
1. Try tool 1:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "{{tool_1}}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"{{tool_1}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} updated with {{tool_1}}", proceed to next module
→ Failure: Try tool 2
2. Try tool 2:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "{{tool_2}}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"{{tool_2}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} updated with {{tool_2}}", proceed to next module
→ Failure: Try tool 3
3. Try tool 3:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "{{tool_3}}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"{{tool_3}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} updated with {{tool_3}}", proceed to next module

View File

@@ -67,7 +67,9 @@ Phase 4: Execution Strategy & Task Execution
├─ Get next in_progress task from TodoWrite
├─ Lazy load task JSON
├─ Launch agent with task context
├─ Mark task completed
├─ Mark task completed (update IMPL-*.json status)
│ # Quick fix: Update task status for ccw dashboard
│ # TS=$(date -Iseconds) && jq --arg ts "$TS" '.status="completed" | .status_history=(.status_history // [])+[{"from":"in_progress","to":"completed","changed_at":$ts}]' IMPL-X.json > tmp.json && mv tmp.json IMPL-X.json
└─ Advance to next task
Phase 5: Completion

View File

@@ -92,7 +92,7 @@ Analyze project for workflow initialization and generate .workflow/project.json.
## MANDATORY FIRST STEPS
1. Execute: cat ~/.claude/workflows/cli-templates/schemas/project-json-schema.json (get schema reference)
2. Execute: ~/.claude/scripts/get_modules_by_depth.sh (get project structure)
2. Execute: ccw tool exec get_modules_by_depth '{}' (get project structure)
## Task
Generate complete project.json with:

View File

@@ -177,7 +177,7 @@ Execute **${angle}** diagnosis for bug root cause analysis. Analyze codebase fro
## MANDATORY FIRST STEPS (Execute by Agent)
**You (cli-explore-agent) MUST execute these steps in order:**
1. Run: ~/.claude/scripts/get_modules_by_depth.sh (project structure)
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
2. Run: rg -l "{error_keyword_from_bug}" --type ts (locate relevant files)
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/diagnosis-json-schema.json (get output schema reference)

View File

@@ -170,7 +170,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
## MANDATORY FIRST STEPS (Execute by Agent)
**You (cli-explore-agent) MUST execute these steps in order:**
1. Run: ~/.claude/scripts/get_modules_by_depth.sh (project structure)
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
2. Run: rg -l "{keyword_from_task}" --type ts (locate relevant files)
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/explore-json-schema.json (get output schema reference)

View File

@@ -46,8 +46,7 @@ Automated fix orchestrator with **two-phase architecture**: AI-powered planning
1. **Intelligent Planning**: AI-powered analysis identifies optimal grouping and execution strategy
2. **Multi-stage Coordination**: Supports complex parallel + serial execution with dependency management
3. **Conservative Safety**: Mandatory test verification with automatic rollback on failure
4. **Real-time Visibility**: Dashboard shows planning progress, stage timeline, and active agents
5. **Resume Support**: Checkpoint-based recovery for interrupted sessions
4. **Resume Support**: Checkpoint-based recovery for interrupted sessions
### Orchestrator Boundary (CRITICAL)
- **ONLY command** for automated review finding fixes
@@ -59,14 +58,14 @@ Automated fix orchestrator with **two-phase architecture**: AI-powered planning
```
Phase 1: Discovery & Initialization
└─ Validate export file, create fix session structure, initialize state files → Generate fix-dashboard.html
└─ Validate export file, create fix session structure, initialize state files
Phase 2: Planning Coordination (@cli-planning-agent)
├─ Analyze findings for patterns and dependencies
├─ Group by file + dimension + root cause similarity
├─ Determine execution strategy (parallel/serial/hybrid)
├─ Generate fix timeline with stages
└─ Output: fix-plan.json (dashboard auto-polls for status)
└─ Output: fix-plan.json
Phase 3: Execution Orchestration (Stage-based)
For each timeline stage:
@@ -198,12 +197,10 @@ if (result.passRate < 100%) {
- Session creation: Generate fix-session-id (`fix-{timestamp}`)
- Directory structure: Create `{review-dir}/fixes/{fix-session-id}/` with subdirectories
- State files: Initialize active-fix-session.json (session marker)
- Dashboard generation: Create fix-dashboard.html from template (see Dashboard Generation below)
- TodoWrite initialization: Set up 4-phase tracking
**Phase 2: Planning Coordination**
- Launch @cli-planning-agent with findings data and project context
- Monitor planning progress (dashboard shows "Planning fixes..." indicator)
- Validate fix-plan.json output (schema conformance, includes metadata with session status)
- Load plan into memory for execution phase
- TodoWrite update: Mark planning complete, start execution
@@ -216,7 +213,6 @@ if (result.passRate < 100%) {
- Assign agent IDs (agents update their fix-progress-{N}.json)
- Handle agent failures gracefully (mark group as failed, continue)
- Advance to next stage only when current stage complete
- Dashboard polls and aggregates fix-progress-{N}.json files for display
**Phase 4: Completion & Aggregation**
- Collect final status from all fix-progress-{N}.json files
@@ -224,7 +220,7 @@ if (result.passRate < 100%) {
- Update fix-history.json with new session entry
- Remove active-fix-session.json
- TodoWrite completion: Mark all phases done
- Output summary to user with dashboard link
- Output summary to user
**Phase 5: Session Completion (Optional)**
- If all findings fixed successfully (no failures):
@@ -234,53 +230,12 @@ if (result.passRate < 100%) {
- Output: "Some findings failed. Review fix-summary.md before completing session."
- Do NOT auto-complete session
### Dashboard Generation
**MANDATORY**: Dashboard MUST be generated from template during Phase 1 initialization
**Template Location**: `~/.claude/templates/fix-dashboard.html`
**⚠️ POST-GENERATION**: Orchestrator and agents MUST NOT read/write/modify fix-dashboard.html after creation
**Generation Steps**:
```bash
# 1. Copy template to fix session directory
cp ~/.claude/templates/fix-dashboard.html ${sessionDir}/fixes/${fixSessionId}/fix-dashboard.html
# 2. Replace SESSION_ID placeholder
sed -i "s|{{SESSION_ID}}|${sessionId}|g" ${sessionDir}/fixes/${fixSessionId}/fix-dashboard.html
# 3. Replace REVIEW_DIR placeholder
sed -i "s|{{REVIEW_DIR}}|${reviewDir}|g" ${sessionDir}/fixes/${fixSessionId}/fix-dashboard.html
# 4. Start local server and output dashboard URL
cd ${sessionDir}/fixes/${fixSessionId} && python -m http.server 8766 --bind 127.0.0.1 &
echo "🔧 Fix Dashboard: http://127.0.0.1:8766/fix-dashboard.html"
echo " (Press Ctrl+C to stop server when done)"
```
**Dashboard Features**:
- Real-time progress tracking via JSON polling (3-second interval)
- Stage timeline visualization with parallel/serial execution modes
- Active groups and agents monitoring
- Flow control steps tracking for each agent
- Fix history drawer with session summaries
- Consumes new JSON structure (fix-plan.json with metadata + fix-progress-{N}.json)
**JSON Consumption**:
- `fix-plan.json`: Reads metadata field for session info, timeline stages, groups configuration
- `fix-progress-{N}.json`: Polls all progress files to aggregate real-time status
- `active-fix-session.json`: Detects active session on load
- `fix-history.json`: Loads historical fix sessions
### Output File Structure
```
.workflow/active/WFS-{session-id}/.review/
├── fix-export-{timestamp}.json # Exported findings (input)
└── fixes/{fix-session-id}/
├── fix-dashboard.html # Interactive dashboard (generated once, auto-polls JSON)
├── fix-plan.json # Planning agent output (execution plan with metadata)
├── fix-progress-1.json # Group 1 progress (planning agent init → agent updates)
├── fix-progress-2.json # Group 2 progress (planning agent init → agent updates)
@@ -291,10 +246,8 @@ echo " (Press Ctrl+C to stop server when done)"
```
**File Producers**:
- **Orchestrator**: `fix-dashboard.html` (generated once from template during Phase 1)
- **Planning Agent**: `fix-plan.json` (with metadata), all `fix-progress-*.json` (initial state)
- **Execution Agents**: Update assigned `fix-progress-{N}.json` in real-time
- **Dashboard (Browser)**: Reads `fix-plan.json` + all `fix-progress-*.json`, aggregates in-memory every 3 seconds via JavaScript polling
### Agent Invocation Template
@@ -347,7 +300,7 @@ For each group (G1, G2, G3, ...), generate fix-progress-{N}.json following templ
- Flow control: Empty implementation_approach array
- Errors: Empty array
**CRITICAL**: Ensure complete template structure for Dashboard consumption - all fields must be present.
**CRITICAL**: Ensure complete template structure - all fields must be present.
## Analysis Requirements
@@ -419,7 +372,7 @@ Task({
description: `Fix ${group.findings.length} issues: ${group.group_name}`,
prompt: `
## Task Objective
Execute fixes for code review findings in group ${group.group_id}. Update progress file in real-time with flow control tracking for dashboard visibility.
Execute fixes for code review findings in group ${group.group_id}. Update progress file in real-time with flow control tracking.
## Assignment
- Group ID: ${group.group_id}
@@ -549,7 +502,6 @@ When all findings processed:
### Progress File Updates
- **MUST update after every significant action** (before/after each step)
- **Dashboard polls every 3 seconds** - ensure writes are atomic
- **Always maintain complete structure** - never write partial updates
- **Use ISO 8601 timestamps** - e.g., "2025-01-25T14:36:00Z"
@@ -638,9 +590,17 @@ TodoWrite({
1. **Trust AI Planning**: Planning agent's grouping and execution strategy are based on dependency analysis
2. **Conservative Approach**: Test verification is mandatory - no fixes kept without passing tests
3. **Parallel Efficiency**: Default 3 concurrent agents balances speed and resource usage
4. **Monitor Dashboard**: Real-time stage timeline and agent status provide execution visibility
5. **Resume Support**: Fix sessions can resume from checkpoints after interruption
6. **Manual Review**: Always review failed fixes manually - may require architectural changes
7. **Incremental Fixing**: Start with small batches (5-10 findings) before large-scale fixes
4. **Resume Support**: Fix sessions can resume from checkpoints after interruption
5. **Manual Review**: Always review failed fixes manually - may require architectural changes
6. **Incremental Fixing**: Start with small batches (5-10 findings) before large-scale fixes
## Related Commands
### View Fix Progress
Use `ccw view` to open the workflow dashboard in browser:
```bash
ccw view
```

View File

@@ -51,14 +51,12 @@ Independent multi-dimensional code review orchestrator with **hybrid parallel-it
2. **Session-Integrated**: Review results tracked within workflow session for unified management
3. **Comprehensive Coverage**: Same 7 specialized dimensions as session review
4. **Intelligent Prioritization**: Automatic identification of critical issues and cross-cutting concerns
5. **Real-time Visibility**: JSON-based progress tracking with interactive HTML dashboard
6. **Unified Archive**: Review results archived with session for historical reference
5. **Unified Archive**: Review results archived with session for historical reference
### Orchestrator Boundary (CRITICAL)
- **ONLY command** for independent multi-dimensional module review
- Manages: dimension coordination, aggregation, iteration control, progress tracking
- Delegates: Code exploration and analysis to @cli-explore-agent, dimension-specific reviews via Deep Scan mode
- **⚠️ DASHBOARD CONSTRAINT**: Dashboard is generated ONCE during Phase 1 initialization. After initialization, orchestrator and agents MUST NOT read, write, or modify dashboard.html - it remains static for user interaction only.
## How It Works
@@ -66,7 +64,7 @@ Independent multi-dimensional code review orchestrator with **hybrid parallel-it
```
Phase 1: Discovery & Initialization
└─ Resolve file patterns, validate paths, initialize state, create output structure → Generate dashboard.html
└─ Resolve file patterns, validate paths, initialize state, create output structure
Phase 2: Parallel Reviews (for each dimension)
├─ Launch 7 review agents simultaneously
@@ -90,7 +88,7 @@ Phase 4: Iterative Deep-Dive (optional)
└─ Loop until no critical findings OR max iterations
Phase 5: Completion
└─ Finalize review-progress.json → Output dashboard path
└─ Finalize review-progress.json
```
### Agent Roles
@@ -188,8 +186,8 @@ const CATEGORIES = {
**Step 1: Session Creation**
```javascript
// Create workflow session for this review
SlashCommand(command="/workflow:session:start \"Code review for [target_pattern]\"")
// Create workflow session for this review (type: review)
SlashCommand(command="/workflow:session:start --type review \"Code review for [target_pattern]\"")
// Parse output
const sessionId = output.match(/SESSION_ID: (WFS-[^\s]+)/)[1];
@@ -219,37 +217,9 @@ done
**Step 4: Initialize Review State**
- State initialization: Create `review-state.json` with metadata, dimensions, max_iterations, resolved_files (merged metadata + state)
- Progress tracking: Create `review-progress.json` for dashboard polling
- Progress tracking: Create `review-progress.json` for progress tracking
**Step 5: Dashboard Generation**
**Constraints**:
- **MANDATORY**: Dashboard MUST be generated from template: `~/.claude/templates/review-cycle-dashboard.html`
- **PROHIBITED**: Direct creation or custom generation without template
- **POST-GENERATION**: Orchestrator and agents MUST NOT read/write/modify dashboard.html after creation
**Generation Commands** (3 independent steps):
```bash
# Step 1: Copy template to output location
cp ~/.claude/templates/review-cycle-dashboard.html ${sessionDir}/.review/dashboard.html
# Step 2: Replace SESSION_ID placeholder
sed -i "s|{{SESSION_ID}}|${sessionId}|g" ${sessionDir}/.review/dashboard.html
# Step 3: Replace REVIEW_TYPE placeholder
sed -i "s|{{REVIEW_TYPE}}|module|g" ${sessionDir}/.review/dashboard.html
# Step 4: Replace REVIEW_DIR placeholder
sed -i "s|{{REVIEW_DIR}}|${reviewDir}|g" ${sessionDir}/.review/dashboard.html
# Output: Start local server and output dashboard URL
# Use Python HTTP server (available on most systems)
cd ${sessionDir}/.review && python -m http.server 8765 --bind 127.0.0.1 &
echo "📊 Dashboard: http://127.0.0.1:8765/dashboard.html"
echo " (Press Ctrl+C to stop server when done)"
```
**Step 6: TodoWrite Initialization**
**Step 5: TodoWrite Initialization**
- Set up progress tracking with hierarchical structure
- Mark Phase 1 completed, Phase 2 in_progress
@@ -280,7 +250,6 @@ echo " (Press Ctrl+C to stop server when done)"
- Finalize review-progress.json with completion statistics
- Update review-state.json with completion_time and phase=complete
- TodoWrite completion: Mark all tasks done
- Output: Dashboard path to user
@@ -301,12 +270,11 @@ echo " (Press Ctrl+C to stop server when done)"
├── iterations/ # Deep-dive results
│ ├── iteration-1-finding-{uuid}.json
│ └── iteration-2-finding-{uuid}.json
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
└── dashboard.html # Interactive dashboard (primary output)
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
```
**Session Context**:
@@ -772,23 +740,25 @@ TodoWrite({
3. **Use Glob Wisely**: `src/auth/**` is more efficient than `src/**` with lots of irrelevant files
4. **Trust Aggregation Logic**: Auto-selection based on proven heuristics
5. **Monitor Logs**: Check reports/ directory for CLI analysis insights
6. **Dashboard Polling**: Refresh every 5 seconds for real-time updates
7. **Export Results**: Use dashboard export for external tracking tools
## Related Commands
### View Review Progress
Use `ccw view` to open the review dashboard in browser:
```bash
ccw view
```
### Automated Fix Workflow
After completing a module review, use the dashboard to select findings and export them for automated fixing:
After completing a module review, use the generated findings JSON for automated fixing:
```bash
# Step 1: Complete review (this command)
/workflow:review-module-cycle src/auth/**
# Step 2: Open dashboard, select findings, and export
# Dashboard generates: fix-export-{timestamp}.json
# Step 3: Run automated fixes
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/fix-export-{timestamp}.json
# Step 2: Run automated fixes using dimension findings
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/
```
See `/workflow:review-fix` for automated fixing with smart grouping, parallel execution, and test verification.

View File

@@ -45,13 +45,11 @@ Session-based multi-dimensional code review orchestrator with **hybrid parallel-
1. **Comprehensive Coverage**: 7 specialized dimensions analyze all quality aspects simultaneously
2. **Intelligent Prioritization**: Automatic identification of critical issues and cross-cutting concerns
3. **Actionable Insights**: Deep-dive iterations provide step-by-step remediation plans
4. **Real-time Visibility**: JSON-based progress tracking with interactive HTML dashboard
### Orchestrator Boundary (CRITICAL)
- **ONLY command** for comprehensive multi-dimensional review
- Manages: dimension coordination, aggregation, iteration control, progress tracking
- Delegates: Code exploration and analysis to @cli-explore-agent, dimension-specific reviews via Deep Scan mode
- **⚠️ DASHBOARD CONSTRAINT**: Dashboard is generated ONCE during Phase 1 initialization. After initialization, orchestrator and agents MUST NOT read, write, or modify dashboard.html - it remains static for user interaction only.
## How It Works
@@ -59,7 +57,7 @@ Session-based multi-dimensional code review orchestrator with **hybrid parallel-
```
Phase 1: Discovery & Initialization
└─ Validate session, initialize state, create output structure → Generate dashboard.html
└─ Validate session, initialize state, create output structure
Phase 2: Parallel Reviews (for each dimension)
├─ Launch 7 review agents simultaneously
@@ -83,7 +81,7 @@ Phase 4: Iterative Deep-Dive (optional)
└─ Loop until no critical findings OR max iterations
Phase 5: Completion
└─ Finalize review-progress.json → Output dashboard path
└─ Finalize review-progress.json
```
### Agent Roles
@@ -199,36 +197,9 @@ git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u
**Step 5: Initialize Review State**
- State initialization: Create `review-state.json` with metadata, dimensions, max_iterations (merged metadata + state)
- Progress tracking: Create `review-progress.json` for dashboard polling
- Progress tracking: Create `review-progress.json` for progress tracking
**Step 6: Dashboard Generation**
**Constraints**:
- **MANDATORY**: Dashboard MUST be generated from template: `~/.claude/templates/review-cycle-dashboard.html`
- **PROHIBITED**: Direct creation or custom generation without template
- **POST-GENERATION**: Orchestrator and agents MUST NOT read/write/modify dashboard.html after creation
**Generation Commands** (3 independent steps):
```bash
# Step 1: Copy template to output location
cp ~/.claude/templates/review-cycle-dashboard.html ${sessionDir}/.review/dashboard.html
# Step 2: Replace SESSION_ID placeholder
sed -i "s|{{SESSION_ID}}|${sessionId}|g" ${sessionDir}/.review/dashboard.html
# Step 3: Replace REVIEW_TYPE placeholder
sed -i "s|{{REVIEW_TYPE}}|session|g" ${sessionDir}/.review/dashboard.html
# Step 4: Replace REVIEW_DIR placeholder
sed -i "s|{{REVIEW_DIR}}|${reviewDir}|g" ${sessionDir}/.review/dashboard.html
# Output: Start local server and output dashboard URL
cd ${sessionDir}/.review && python -m http.server 8765 --bind 127.0.0.1 &
echo "📊 Dashboard: http://127.0.0.1:8765/dashboard.html"
echo " (Press Ctrl+C to stop server when done)"
```
**Step 7: TodoWrite Initialization**
**Step 6: TodoWrite Initialization**
- Set up progress tracking with hierarchical structure
- Mark Phase 1 completed, Phase 2 in_progress
@@ -259,7 +230,6 @@ echo " (Press Ctrl+C to stop server when done)"
- Finalize review-progress.json with completion statistics
- Update review-state.json with completion_time and phase=complete
- TodoWrite completion: Mark all tasks done
- Output: Dashboard path to user
@@ -280,12 +250,11 @@ echo " (Press Ctrl+C to stop server when done)"
├── iterations/ # Deep-dive results
│ ├── iteration-1-finding-{uuid}.json
│ └── iteration-2-finding-{uuid}.json
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
└── dashboard.html # Interactive dashboard (primary output)
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
```
**Session Context**:
@@ -782,23 +751,25 @@ TodoWrite({
2. **Parallel Execution**: ~60 minutes for full initial review (7 dimensions)
3. **Trust Aggregation Logic**: Auto-selection based on proven heuristics
4. **Monitor Logs**: Check reports/ directory for CLI analysis insights
5. **Dashboard Polling**: Refresh every 5 seconds for real-time updates
6. **Export Results**: Use dashboard export for external tracking tools
## Related Commands
### View Review Progress
Use `ccw view` to open the review dashboard in browser:
```bash
ccw view
```
### Automated Fix Workflow
After completing a review, use the dashboard to select findings and export them for automated fixing:
After completing a review, use the generated findings JSON for automated fixing:
```bash
# Step 1: Complete review (this command)
/workflow:review-session-cycle
# Step 2: Open dashboard, select findings, and export
# Dashboard generates: fix-export-{timestamp}.json
# Step 3: Run automated fixes
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/fix-export-{timestamp}.json
# Step 2: Run automated fixes using dimension findings
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/
```
See `/workflow:review-fix` for automated fixing with smart grouping, parallel execution, and test verification.

View File

@@ -1,11 +1,13 @@
---
name: start
description: Discover existing sessions or start new workflow session with intelligent session management and conflict detection
argument-hint: [--auto|--new] [optional: task description for new session]
argument-hint: [--type <workflow|review|tdd|test|docs>] [--auto|--new] [optional: task description for new session]
examples:
- /workflow:session:start
- /workflow:session:start --auto "implement OAuth2 authentication"
- /workflow:session:start --new "fix login bug"
- /workflow:session:start --type review "Code review for auth module"
- /workflow:session:start --type tdd --auto "implement user authentication"
- /workflow:session:start --type test --new "test payment flow"
---
# Start Workflow Session (/workflow:session:start)
@@ -17,6 +19,23 @@ Manages workflow sessions with three operation modes: discovery (manual), auto (
1. **Project-level initialization** (first-time only): Creates `.workflow/project.json` for feature registry
2. **Session-level initialization** (always): Creates session directory structure
## Session Types
The `--type` parameter classifies sessions for CCW dashboard organization:
| Type | Description | Default For |
|------|-------------|-------------|
| `workflow` | Standard implementation (default) | `/workflow:plan` |
| `review` | Code review sessions | `/workflow:review-module-cycle` |
| `tdd` | TDD-based development | `/workflow:tdd-plan` |
| `test` | Test generation/fix sessions | `/workflow:test-fix-gen` |
| `docs` | Documentation sessions | `/memory:docs` |
**Validation**: If `--type` is provided with invalid value, return error:
```
ERROR: Invalid session type. Valid types: workflow, review, tdd, test, docs
```
## Step 0: Initialize Project State (First-time Only)
**Executed before all modes** - Ensures project-level state file exists by calling `/workflow:init`.
@@ -86,8 +105,8 @@ bash(mkdir -p .workflow/active/WFS-implement-oauth2-auth/.process)
bash(mkdir -p .workflow/active/WFS-implement-oauth2-auth/.task)
bash(mkdir -p .workflow/active/WFS-implement-oauth2-auth/.summaries)
# Create metadata
bash(echo '{"session_id":"WFS-implement-oauth2-auth","project":"implement OAuth2 auth","status":"planning"}' > .workflow/active/WFS-implement-oauth2-auth/workflow-session.json)
# Create metadata (include type field, default to "workflow" if not specified)
bash(echo '{"session_id":"WFS-implement-oauth2-auth","project":"implement OAuth2 auth","status":"planning","type":"workflow","created_at":"2024-12-04T08:00:00Z"}' > .workflow/active/WFS-implement-oauth2-auth/workflow-session.json)
```
**Output**: `SESSION_ID: WFS-implement-oauth2-auth`
@@ -143,7 +162,8 @@ bash(mkdir -p .workflow/active/WFS-fix-login-bug/.summaries)
### Step 3: Create Metadata
```bash
bash(echo '{"session_id":"WFS-fix-login-bug","project":"fix login bug","status":"planning"}' > .workflow/active/WFS-fix-login-bug/workflow-session.json)
# Include type field from --type parameter (default: "workflow")
bash(echo '{"session_id":"WFS-fix-login-bug","project":"fix login bug","status":"planning","type":"workflow","created_at":"2024-12-04T08:00:00Z"}' > .workflow/active/WFS-fix-login-bug/workflow-session.json)
```
**Output**: `SESSION_ID: WFS-fix-login-bug`

View File

@@ -1,352 +0,0 @@
---
name: workflow:status
description: Generate on-demand views for project overview and workflow tasks with optional task-id filtering for detailed view
argument-hint: "[optional: --project|task-id|--validate|--dashboard]"
---
# Workflow Status Command (/workflow:status)
## Overview
Generates on-demand views from project and session data. Supports multiple modes:
1. **Project Overview** (`--project`): Shows completed features and project statistics
2. **Workflow Tasks** (default): Shows current session task progress
3. **HTML Dashboard** (`--dashboard`): Generates interactive HTML task board with active and archived sessions
No synchronization needed - all views are calculated from current JSON state.
## Usage
```bash
/workflow:status # Show current workflow session overview
/workflow:status --project # Show project-level feature registry
/workflow:status impl-1 # Show specific task details
/workflow:status --validate # Validate workflow integrity
/workflow:status --dashboard # Generate HTML dashboard board
```
## Execution Process
```
Input Parsing:
└─ Decision (mode detection):
├─ --project flag → Project Overview Mode
├─ --dashboard flag → Dashboard Mode
├─ task-id argument → Task Details Mode
└─ No flags → Workflow Session Mode (default)
Project Overview Mode:
├─ Check project.json exists
├─ Read project data
├─ Parse and display overview + features
└─ Show recent archived sessions
Workflow Session Mode (default):
├─ Find active session
├─ Load session data
├─ Scan task files
└─ Display task progress
Dashboard Mode:
├─ Collect active sessions
├─ Collect archived sessions
├─ Generate HTML from template
└─ Write dashboard.html
```
## Implementation Flow
### Mode Selection
**Check for --project flag**:
- If `--project` flag present → Execute **Project Overview Mode**
- Otherwise → Execute **Workflow Session Mode** (default)
## Project Overview Mode
### Step 1: Check Project State
```bash
bash(test -f .workflow/project.json && echo "EXISTS" || echo "NOT_FOUND")
```
**If NOT_FOUND**:
```
No project state found.
Run /workflow:session:start to initialize project.
```
### Step 2: Read Project Data
```bash
bash(cat .workflow/project.json)
```
### Step 3: Parse and Display
**Data Processing**:
```javascript
const projectData = JSON.parse(Read('.workflow/project.json'));
const features = projectData.features || [];
const stats = projectData.statistics || {};
const overview = projectData.overview || null;
// Sort features by implementation date (newest first)
const sortedFeatures = features.sort((a, b) =>
new Date(b.implemented_at) - new Date(a.implemented_at)
);
```
**Output Format** (with extended overview):
```
## Project: ${projectData.project_name}
Initialized: ${projectData.initialized_at}
${overview ? `
### Overview
${overview.description}
**Technology Stack**:
${overview.technology_stack.languages.map(l => `- ${l.name}${l.primary ? ' (primary)' : ''}: ${l.file_count} files`).join('\n')}
Frameworks: ${overview.technology_stack.frameworks.join(', ')}
**Architecture**:
Style: ${overview.architecture.style}
Patterns: ${overview.architecture.patterns.join(', ')}
**Key Components** (${overview.key_components.length}):
${overview.key_components.map(c => `- ${c.name} (${c.path})\n ${c.description}`).join('\n')}
---
` : ''}
### Completed Features (${stats.total_features})
${sortedFeatures.map(f => `
- ${f.title} (${f.timeline?.implemented_at || f.implemented_at})
${f.description}
Tags: ${f.tags?.join(', ') || 'none'}
Session: ${f.traceability?.session_id || f.session_id}
Archive: ${f.traceability?.archive_path || 'unknown'}
${f.traceability?.commit_hash ? `Commit: ${f.traceability.commit_hash}` : ''}
`).join('\n')}
### Project Statistics
- Total Features: ${stats.total_features}
- Total Sessions: ${stats.total_sessions}
- Last Updated: ${stats.last_updated}
### Quick Access
- View session details: /workflow:status
- Archive query: jq '.archives[] | select(.session_id == "SESSION_ID")' .workflow/archives/manifest.json
- Documentation: .workflow/docs/${projectData.project_name}/
### Query Commands
# Find by tag
cat .workflow/project.json | jq '.features[] | select(.tags[] == "auth")'
# View archive
cat ${feature.traceability.archive_path}/IMPL_PLAN.md
# List all tags
cat .workflow/project.json | jq -r '.features[].tags[]' | sort -u
```
**Empty State**:
```
## Project: ${projectData.project_name}
Initialized: ${projectData.initialized_at}
No features completed yet.
Complete your first workflow session to add features:
1. /workflow:plan "feature description"
2. /workflow:execute
3. /workflow:session:complete
```
### Step 4: Show Recent Sessions (Optional)
```bash
# List 5 most recent archived sessions
bash(ls -1t .workflow/archives/WFS-* 2>/dev/null | head -5 | xargs -I {} basename {})
```
**Output**:
```
### Recent Sessions
- WFS-auth-system (archived)
- WFS-payment-flow (archived)
- WFS-user-dashboard (archived)
Use /workflow:session:complete to archive current session.
```
## Workflow Session Mode (Default)
### Step 1: Find Active Session
```bash
find .workflow/active/ -name "WFS-*" -type d 2>/dev/null | head -1
```
### Step 2: Load Session Data
```bash
cat .workflow/active/WFS-session/workflow-session.json
```
### Step 3: Scan Task Files
```bash
find .workflow/active/WFS-session/.task/ -name "*.json" -type f 2>/dev/null
```
### Step 4: Generate Task Status
```bash
cat .workflow/active/WFS-session/.task/impl-1.json | jq -r '.status'
```
### Step 5: Count Task Progress
```bash
find .workflow/active/WFS-session/.task/ -name "*.json" -type f | wc -l
find .workflow/active/WFS-session/.summaries/ -name "*.md" -type f 2>/dev/null | wc -l
```
### Step 6: Display Overview
```markdown
# Workflow Overview
**Session**: WFS-session-name
**Progress**: 3/8 tasks completed
## Active Tasks
- [IN PROGRESS] impl-1: Current task in progress
- [ ] impl-2: Next pending task
## Completed Tasks
- [COMPLETED] impl-0: Setup completed
```
## Dashboard Mode (HTML Board)
### Step 1: Check for --dashboard flag
```bash
# If --dashboard flag present → Execute Dashboard Mode
```
### Step 2: Collect Workflow Data
**Collect Active Sessions**:
```bash
# Find all active sessions
find .workflow/active/ -name "WFS-*" -type d 2>/dev/null
# For each active session, read metadata and tasks
for session in $(find .workflow/active/ -name "WFS-*" -type d 2>/dev/null); do
cat "$session/workflow-session.json"
find "$session/.task/" -name "*.json" -type f 2>/dev/null
done
```
**Collect Archived Sessions**:
```bash
# Find all archived sessions
find .workflow/archives/ -name "WFS-*" -type d 2>/dev/null
# Read manifest if exists
cat .workflow/archives/manifest.json 2>/dev/null
# For each archived session, read metadata
for archive in $(find .workflow/archives/ -name "WFS-*" -type d 2>/dev/null); do
cat "$archive/workflow-session.json" 2>/dev/null
# Count completed tasks
find "$archive/.task/" -name "*.json" -type f 2>/dev/null | wc -l
done
```
### Step 3: Process and Structure Data
**Build data structure for dashboard**:
```javascript
const dashboardData = {
activeSessions: [],
archivedSessions: [],
generatedAt: new Date().toISOString()
};
// Process active sessions
for each active_session in active_sessions:
const sessionData = JSON.parse(Read(active_session/workflow-session.json));
const tasks = [];
// Load all tasks for this session
for each task_file in find(active_session/.task/*.json):
const taskData = JSON.parse(Read(task_file));
tasks.push({
task_id: taskData.task_id,
title: taskData.title,
status: taskData.status,
type: taskData.type
});
dashboardData.activeSessions.push({
session_id: sessionData.session_id,
project: sessionData.project,
status: sessionData.status,
created_at: sessionData.created_at || sessionData.initialized_at,
tasks: tasks
});
// Process archived sessions
for each archived_session in archived_sessions:
const sessionData = JSON.parse(Read(archived_session/workflow-session.json));
const taskCount = bash(find archived_session/.task/*.json | wc -l);
dashboardData.archivedSessions.push({
session_id: sessionData.session_id,
project: sessionData.project,
archived_at: sessionData.completed_at || sessionData.archived_at,
taskCount: parseInt(taskCount),
archive_path: archived_session
});
```
### Step 4: Generate HTML from Template
**Load template and inject data**:
```javascript
// Read the HTML template
const template = Read("~/.claude/templates/workflow-dashboard.html");
// Prepare data for injection
const dataJson = JSON.stringify(dashboardData, null, 2);
// Replace placeholder with actual data
const htmlContent = template.replace('{{WORKFLOW_DATA}}', dataJson);
// Ensure .workflow directory exists
bash(mkdir -p .workflow);
```
### Step 5: Write HTML File
```bash
# Write the generated HTML to .workflow/dashboard.html
Write({
file_path: ".workflow/dashboard.html",
content: htmlContent
})
```
### Step 6: Display Success Message
```markdown
Dashboard generated successfully!
Location: .workflow/dashboard.html
Open in browser:
file://$(pwd)/.workflow/dashboard.html
Features:
- 📊 Active sessions overview
- 📦 Archived sessions history
- 🔍 Search and filter
- 📈 Progress tracking
- 🎨 Dark/light theme
Refresh data: Re-run /workflow:status --dashboard
```

View File

@@ -44,7 +44,7 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
**Step 1.1: Dispatch** - Session discovery and initialization
```javascript
SlashCommand(command="/workflow:session:start --auto \"TDD: [structured-description]\"")
SlashCommand(command="/workflow:session:start --type tdd --auto \"TDD: [structured-description]\"")
```
**TDD Structured Format**:

View File

@@ -159,19 +159,19 @@ Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
```javascript
// Session Mode - Include original task description to enable semantic CLI selection
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
SlashCommand(command="/workflow:session:start --type test --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
// Prompt Mode - User's description already contains their intent
SlashCommand(command="/workflow:session:start --new \"Test generation for: [description]\"")
SlashCommand(command="/workflow:session:start --type test --new \"Test generation for: [description]\"")
```
**Input**: User argument (session ID, description, or file path)
**Expected Behavior**:
- Creates new session: `WFS-test-[slug]`
- Writes `workflow-session.json` metadata:
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`, description with original user intent
- **Prompt Mode**: Includes `workflow_type: "test_session"` only (user's description already contains intent)
- Writes `workflow-session.json` metadata with `type: "test"`
- **Session Mode**: Additionally includes `source_session_id: "[sourceId]"`, description with original user intent
- **Prompt Mode**: Uses user's description (already contains intent)
- Returns new session ID
**Parse Output**:
@@ -579,11 +579,11 @@ WFS-test-[session]/
**File**: `workflow-session.json`
**Session Mode** includes:
- `workflow_type: "test_session"`
- `type: "test"` (set by session:start --type test)
- `source_session_id: "[sourceSessionId]"` (enables automatic cross-session context)
**Prompt Mode** includes:
- `workflow_type: "test_session"`
- `type: "test"` (set by session:start --type test)
- No `source_session_id` field
### Execution Flow Diagram

View File

@@ -135,7 +135,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
## MANDATORY FIRST STEPS (Execute by Agent)
**You (cli-explore-agent) MUST execute these steps in order:**
1. Run: ~/.claude/scripts/get_modules_by_depth.sh (project structure)
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
2. Run: rg -l "{keyword_from_task}" --type ts (locate relevant files)
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/explore-json-schema.json (get output schema reference)

View File

@@ -14,8 +14,8 @@ Generate implementation planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.
## Core Philosophy
- **Planning Only**: Generate planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) - does NOT implement code
- **Agent-Driven Document Generation**: Delegate plan generation to action-planning-agent
- **N+1 Parallel Planning**: Auto-detect multi-module projects, enable parallel planning (2+1 or 3+1 mode)
- **Progressive Loading**: Load context incrementally (Core → Selective → On-Demand) due to analysis.md file size
- **Two-Phase Flow**: Discovery (context gathering) → Output (planning document generation)
- **Memory-First**: Reuse loaded documents from conversation memory
- **Smart Selection**: Load synthesis_output OR guidance + relevant role analyses, NOT all role analyses
- **MCP-Enhanced**: Use MCP tools for advanced code analysis and research
@@ -28,22 +28,38 @@ Input Parsing:
├─ Parse flags: --session
└─ Validation: session_id REQUIRED
Phase 1: Context Preparation (Command)
Phase 1: Context Preparation & Module Detection (Command)
├─ Assemble session paths (metadata, context package, output dirs)
─ Provide metadata (session_id, execution_mode, mcp_capabilities)
─ Provide metadata (session_id, execution_mode, mcp_capabilities)
├─ Auto-detect modules from context-package + directory structure
└─ Decision:
├─ modules.length == 1 → Single Agent Mode (Phase 2A)
└─ modules.length >= 2 → Parallel Mode (Phase 2B + Phase 3)
Phase 2: Planning Document Generation (Agent)
Phase 2A: Single Agent Planning (Original Flow)
├─ Load context package (progressive loading strategy)
├─ Generate Task JSON Files (.task/IMPL-*.json)
├─ Create IMPL_PLAN.md
└─ Generate TODO_LIST.md
Phase 2B: N Parallel Planning (Multi-Module)
├─ Launch N action-planning-agents simultaneously (one per module)
├─ Each agent generates module-scoped tasks (IMPL-{prefix}{seq}.json)
├─ Task ID format: IMPL-A1, IMPL-A2... / IMPL-B1, IMPL-B2...
└─ Each module limited to ≤9 tasks
Phase 3: Integration (+1 Coordinator, Multi-Module Only)
├─ Collect all module task JSONs
├─ Resolve cross-module dependencies (CROSS::{module}::{pattern} → actual ID)
├─ Generate unified IMPL_PLAN.md (grouped by module)
└─ Generate TODO_LIST.md (hierarchical: module → tasks)
```
## Document Generation Lifecycle
### Phase 1: Context Preparation (Command Responsibility)
### Phase 1: Context Preparation & Module Detection (Command Responsibility)
**Command prepares session paths and metadata for planning document generation.**
**Command prepares session paths, metadata, and detects module structure.**
**Session Path Structure**:
```
@@ -52,8 +68,12 @@ Phase 2: Planning Document Generation (Agent)
├── .process/
│ └── context-package.json # Context package with artifact catalog
├── .task/ # Output: Task JSON files
├── IMPL_PLAN.md # Output: Implementation plan
└── TODO_LIST.md # Output: TODO list
├── IMPL-A1.json # Multi-module: prefixed by module
│ ├── IMPL-A2.json
│ ├── IMPL-B1.json
│ └── ...
├── IMPL_PLAN.md # Output: Implementation plan (grouped by module)
└── TODO_LIST.md # Output: TODO list (hierarchical)
```
**Command Preparation**:
@@ -66,9 +86,40 @@ Phase 2: Planning Document Generation (Agent)
- `session_id`
- `mcp_capabilities` (available MCP tools)
3. **Auto Module Detection** (determines single vs parallel mode):
```javascript
function autoDetectModules(contextPackage, projectRoot) {
// Priority 1: Explicit frontend/backend separation
if (exists('src/frontend') && exists('src/backend')) {
return [
{ name: 'frontend', prefix: 'A', paths: ['src/frontend'] },
{ name: 'backend', prefix: 'B', paths: ['src/backend'] }
];
}
// Priority 2: Monorepo structure
if (exists('packages/*') || exists('apps/*')) {
return detectMonorepoModules(); // Returns 2-3 main packages
}
// Priority 3: Context-package dependency clustering
const modules = clusterByDependencies(contextPackage.dependencies?.internal);
if (modules.length >= 2) return modules.slice(0, 3);
// Default: Single module (original flow)
return [{ name: 'main', prefix: '', paths: ['.'] }];
}
```
**Decision Logic**:
- `modules.length == 1` → Phase 2A (Single Agent, original flow)
- `modules.length >= 2` → Phase 2B + Phase 3 (N+1 Parallel)
**Note**: CLI tool usage is now determined semantically by action-planning-agent based on user's task description, not by flags.
### Phase 2: Planning Document Generation (Agent Responsibility)
### Phase 2A: Single Agent Planning (Original Flow)
**Condition**: `modules.length == 1` (no multi-module detected)
**Purpose**: Generate IMPL_PLAN.md, task JSONs, and TODO_LIST.md - planning documents only, NOT code implementation.
@@ -148,4 +199,93 @@ Hard Constraints:
)
```
### Phase 2B: N Parallel Planning (Multi-Module)
**Condition**: `modules.length >= 2` (multi-module detected)
**Purpose**: Launch N action-planning-agents simultaneously, one per module, for parallel task generation.
**Parallel Agent Invocation**:
```javascript
// Launch N agents in parallel (one per module)
const planningTasks = modules.map(module =>
Task(
subagent_type="action-planning-agent",
description=`Plan ${module.name} module`,
prompt=`
## SCOPE
- Module: ${module.name} (${module.type})
- Focus Paths: ${module.paths.join(', ')}
- Task ID Prefix: IMPL-${module.prefix}
- Task Limit: ≤9 tasks
- Other Modules: ${otherModules.join(', ')}
- Cross-module deps format: "CROSS::{module}::{pattern}"
## SESSION PATHS
Input:
- Context Package: .workflow/active/{session-id}/.process/context-package.json
Output:
- Task Dir: .workflow/active/{session-id}/.task/
## INSTRUCTIONS
- Generate tasks ONLY for ${module.name} module
- Use task ID format: IMPL-${module.prefix}1, IMPL-${module.prefix}2, ...
- For cross-module dependencies, use: depends_on: ["CROSS::B::api-endpoint"]
- Maximum 9 tasks per module
`
)
);
// Execute all in parallel
await Promise.all(planningTasks);
```
**Output Structure** (direct to .task/):
```
.task/
├── IMPL-A1.json # Module A (e.g., frontend)
├── IMPL-A2.json
├── IMPL-B1.json # Module B (e.g., backend)
├── IMPL-B2.json
└── IMPL-C1.json # Module C (e.g., shared)
```
**Task ID Naming**:
- Format: `IMPL-{prefix}{seq}.json`
- Prefix: A, B, C... (assigned by detection order)
- Sequence: 1, 2, 3... (per-module increment)
### Phase 3: Integration (+1 Coordinator, Multi-Module Only)
**Condition**: Only executed when `modules.length >= 2`
**Purpose**: Collect all module tasks, resolve cross-module dependencies, generate unified documents.
**Integration Logic**:
```javascript
// 1. Collect all module task JSONs
const allTasks = glob('.task/IMPL-*.json').map(loadJson);
// 2. Resolve cross-module dependencies
for (const task of allTasks) {
if (task.depends_on) {
task.depends_on = task.depends_on.map(dep => {
if (dep.startsWith('CROSS::')) {
// CROSS::B::api-endpoint → find matching IMPL-B* task
const [, targetModule, pattern] = dep.match(/CROSS::(\w+)::(.+)/);
return findTaskByModuleAndPattern(allTasks, targetModule, pattern);
}
return dep;
});
}
}
// 3. Generate unified IMPL_PLAN.md (grouped by module)
generateIMPL_PLAN(allTasks, modules);
// 4. Generate TODO_LIST.md (hierarchical structure)
generateTODO_LIST(allTasks, modules);
```
**Note**: IMPL_PLAN.md and TODO_LIST.md structure definitions are in `action-planning-agent.md`.

View File

@@ -320,7 +320,7 @@ Read({base_path}/prototypes/{target}-style-{style_id}-layout-{layout_id}.html)
### Step 1: Run Preview Generation Script
```bash
bash(~/.claude/scripts/ui-generate-preview.sh "{base_path}/prototypes")
bash(ccw tool exec ui_generate_preview '{"prototypesDir":"{base_path}/prototypes"}')
```
**Script generates**:
@@ -432,7 +432,7 @@ bash(test -f {base_path}/prototypes/compare.html && echo "exists")
bash(mkdir -p {base_path}/prototypes)
# Run preview script
bash(~/.claude/scripts/ui-generate-preview.sh "{base_path}/prototypes")
bash(ccw tool exec ui_generate_preview '{"prototypesDir":"{base_path}/prototypes"}')
```
## Output Structure
@@ -467,7 +467,7 @@ ERROR: Agent assembly failed
→ Check inputs exist, validate JSON structure
ERROR: Script permission denied
chmod +x ~/.claude/scripts/ui-generate-preview.sh
Verify ccw tool is available: ccw tool list
```
### Recovery Strategies

View File

@@ -106,7 +106,7 @@ echo " Output: $base_path"
# 3. Discover files using script
discovery_file="${intermediates_dir}/discovered-files.json"
~/.claude/scripts/discover-design-files.sh "$source" "$discovery_file"
ccw tool exec discover_design_files '{"sourceDir":"'"$source"'","outputPath":"'"$discovery_file"'"}'
echo " Output: $discovery_file"
```

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec classify_folders '{"path":".","outputFormat":"json"}'
# This file will be removed in a future version.
# Classify folders by type for documentation generation
# Usage: get_modules_by_depth.sh | classify-folders.sh
# Output: folder_path|folder_type|code:N|dirs:N

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec convert_tokens_to_css '{"inputPath":"design-tokens.json","outputPath":"tokens.css"}'
# This file will be removed in a future version.
# Convert design-tokens.json to tokens.css with Google Fonts import and global font rules
# Usage: cat design-tokens.json | ./convert_tokens_to_css.sh > tokens.css
# Or: ./convert_tokens_to_css.sh < design-tokens.json > tokens.css

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec detect_changed_modules '{"baseBranch":"main","format":"list"}'
# This file will be removed in a future version.
# Detect modules affected by git changes or recent modifications
# Usage: detect_changed_modules.sh [format]
# format: list|grouped|paths (default: paths)
@@ -154,4 +158,4 @@ detect_changed_modules() {
# Execute function if script is run directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
detect_changed_modules "$@"
fi
fi

View File

@@ -1,4 +1,8 @@
#!/usr/bin/env bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec discover_design_files '{"sourceDir":".","outputPath":"output.json"}'
# This file will be removed in a future version.
# discover-design-files.sh - Discover design-related files and output JSON
# Usage: discover-design-files.sh <source_dir> <output_json>

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec generate_module_docs '{"path":".","strategy":"single-layer","tool":"gemini"}'
# This file will be removed in a future version.
# Generate documentation for modules and projects with multiple strategies
# Usage: generate_module_docs.sh <strategy> <source_path> <project_name> [tool] [model]
# strategy: full|single|project-readme|project-architecture|http-api

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec get_modules_by_depth '{"format":"list","path":"."}' OR ccw tool exec get_modules_by_depth '{}'
# This file will be removed in a future version.
# Get modules organized by directory depth (deepest first)
# Usage: get_modules_by_depth.sh [format]
# format: list|grouped|json (default: list)
@@ -163,4 +167,4 @@ get_modules_by_depth() {
# Execute function if script is run directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
get_modules_by_depth "$@"
fi
fi

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec ui_generate_preview '{"designPath":"design-run-1","outputDir":"preview"}'
# This file will be removed in a future version.
#
# UI Generate Preview v2.0 - Template-Based Preview Generation
# Purpose: Generate compare.html and index.html using template substitution

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec ui_instantiate_prototypes '{"designPath":"design-run-1","outputDir":"output"}'
# This file will be removed in a future version.
# UI Prototype Instantiation Script with Preview Generation (v3.0 - Auto-detect)
# Purpose: Generate S × L × P final prototypes from templates + interactive preview files

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# ⚠️ DEPRECATED: This script is deprecated.
# Please use: ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"gemini"}'
# This file will be removed in a future version.
# Update CLAUDE.md for modules with two strategies
# Usage: update_module_claude.sh <strategy> <module_path> [tool] [model]
# strategy: single-layer|multi-layer

View File

@@ -1,13 +1,13 @@
---
name: command-guide
description: Workflow command guide for Claude DMS3 (78 commands). Search/browse commands, get next-step recommendations, view documentation, report issues. Triggers "CCW-help", "CCW-issue", "ccw-help", "ccw-issue", "ccw"
description: Workflow command guide for Claude Code Workflow (78 commands). Search/browse commands, get next-step recommendations, view documentation, report issues. Triggers "CCW-help", "CCW-issue", "ccw-help", "ccw-issue", "ccw"
allowed-tools: Read, Grep, Glob, AskUserQuestion
version: 5.8.0
---
# Command Guide Skill
Comprehensive command guide for Claude DMS3 workflow system covering 78 commands across 5 categories (workflow, cli, memory, task, general).
Comprehensive command guide for Claude Code Workflow (CCW) system covering 78 commands across 5 categories (workflow, cli, memory, task, general).
## 🆕 What's New in v5.8.0
@@ -385,4 +385,4 @@ This SKILL documentation is kept in sync with command implementations through a
- 4 issue templates for standardized problem reporting
- CLI-assisted complex query analysis with gemini/qwen integration
**Maintainer**: Claude DMS3 Team
**Maintainer**: CCW Team

View File

@@ -509,24 +509,13 @@
"name": "start",
"command": "/workflow:session:start",
"description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection",
"arguments": "[--auto|--new] [optional: task description for new session]",
"arguments": "[--type <workflow|review|tdd|test|docs>] [--auto|--new] [optional: task description for new session]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",
"difficulty": "Intermediate",
"file_path": "workflow/session/start.md"
},
{
"name": "workflow:status",
"command": "/workflow:status",
"description": "Generate on-demand views for project overview and workflow tasks with optional task-id filtering for detailed view",
"arguments": "[optional: --project|task-id|--validate|--dashboard]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"file_path": "workflow/status.md"
},
{
"name": "tdd-plan",
"command": "/workflow:tdd-plan",

View File

@@ -358,17 +358,6 @@
"difficulty": "Intermediate",
"file_path": "workflow/review.md"
},
{
"name": "workflow:status",
"command": "/workflow:status",
"description": "Generate on-demand views for project overview and workflow tasks with optional task-id filtering for detailed view",
"arguments": "[optional: --project|task-id|--validate|--dashboard]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"file_path": "workflow/status.md"
},
{
"name": "tdd-plan",
"command": "/workflow:tdd-plan",
@@ -597,7 +586,7 @@
"name": "start",
"command": "/workflow:session:start",
"description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection",
"arguments": "[--auto|--new] [optional: task description for new session]",
"arguments": "[--type <workflow|review|tdd|test|docs>] [--auto|--new] [optional: task description for new session]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",

View File

@@ -224,7 +224,7 @@
"name": "start",
"command": "/workflow:session:start",
"description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection",
"arguments": "[--auto|--new] [optional: task description for new session]",
"arguments": "[--type <workflow|review|tdd|test|docs>] [--auto|--new] [optional: task description for new session]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",
@@ -713,17 +713,6 @@
"usage_scenario": "session-management",
"difficulty": "Intermediate",
"file_path": "workflow/session/resume.md"
},
{
"name": "workflow:status",
"command": "/workflow:status",
"description": "Generate on-demand views for project overview and workflow tasks with optional task-id filtering for detailed view",
"arguments": "[optional: --project|task-id|--validate|--dashboard]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"file_path": "workflow/status.md"
}
],
"testing": [

View File

@@ -43,22 +43,11 @@
"difficulty": "Intermediate",
"file_path": "workflow/execute.md"
},
{
"name": "workflow:status",
"command": "/workflow:status",
"description": "Generate on-demand views for project overview and workflow tasks with optional task-id filtering for detailed view",
"arguments": "[optional: --project|task-id|--validate|--dashboard]",
"category": "workflow",
"subcategory": null,
"usage_scenario": "session-management",
"difficulty": "Beginner",
"file_path": "workflow/status.md"
},
{
"name": "start",
"command": "/workflow:session:start",
"description": "Discover existing sessions or start new workflow session with intelligent session management and conflict detection",
"arguments": "[--auto|--new] [optional: task description for new session]",
"arguments": "[--type <workflow|review|tdd|test|docs>] [--auto|--new] [optional: task description for new session]",
"category": "workflow",
"subcategory": "session",
"usage_scenario": "general",

View File

@@ -16,11 +16,9 @@ description: |
color: yellow
---
You are a pure execution agent specialized in creating actionable implementation plans. You receive requirements and control flags from the command layer and execute planning tasks without complex decision-making logic.
## Overview
**Agent Role**: Transform user requirements and brainstorming artifacts into structured, executable implementation plans with quantified deliverables and measurable acceptance criteria.
**Agent Role**: Pure execution agent that transforms user requirements and brainstorming artifacts into structured, executable implementation plans with quantified deliverables and measurable acceptance criteria. Receives requirements and control flags from the command layer and executes planning tasks without complex decision-making logic.
**Core Capabilities**:
- Load and synthesize context from multiple sources (session metadata, context packages, brainstorming artifacts)
@@ -33,7 +31,7 @@ You are a pure execution agent specialized in creating actionable implementation
---
## 1. Execution Process
## 1. Input & Execution
### 1.1 Input Processing
@@ -50,7 +48,7 @@ You are a pure execution agent specialized in creating actionable implementation
- **Control flags**: DEEP_ANALYSIS_REQUIRED, etc.
- **Task requirements**: Direct task description
### 1.2 Two-Phase Execution Flow
### 1.2 Execution Flow
#### Phase 1: Context Loading & Assembly
@@ -88,6 +86,27 @@ You are a pure execution agent specialized in creating actionable implementation
6. Assess task complexity (simple/medium/complex)
```
**MCP Integration** (when `mcp_capabilities` available):
```javascript
// Exa Code Context (mcp_capabilities.exa_code = true)
mcp__exa__get_code_context_exa(
query="TypeScript OAuth2 JWT authentication patterns",
tokensNum="dynamic"
)
// Integration in flow_control.pre_analysis
{
"step": "local_codebase_exploration",
"action": "Explore codebase structure",
"commands": [
"bash(rg '^(function|class|interface).*[task_keyword]' --type ts -n --max-count 15)",
"bash(find . -name '*[task_keyword]*' -type f | grep -v node_modules | head -10)"
],
"output_to": "codebase_structure"
}
```
**Context Package Structure** (fields defined by context-search-agent):
**Always Present**:
@@ -169,30 +188,6 @@ if (contextPackage.brainstorm_artifacts?.role_analyses?.length > 0) {
5. Update session state for execution readiness
```
### 1.3 MCP Integration Guidelines
**Exa Code Context** (`mcp_capabilities.exa_code = true`):
```javascript
// Get best practices and examples
mcp__exa__get_code_context_exa(
query="TypeScript OAuth2 JWT authentication patterns",
tokensNum="dynamic"
)
```
**Integration in flow_control.pre_analysis**:
```json
{
"step": "local_codebase_exploration",
"action": "Explore codebase structure",
"commands": [
"bash(rg '^(function|class|interface).*[task_keyword]' --type ts -n --max-count 15)",
"bash(find . -name '*[task_keyword]*' -type f | grep -v node_modules | head -10)"
],
"output_to": "codebase_structure"
}
```
---
## 2. Output Specifications
@@ -213,7 +208,11 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
```
**Field Descriptions**:
- `id`: Task identifier (format: `IMPL-N`)
- `id`: Task identifier
- Single module format: `IMPL-N` (e.g., IMPL-001, IMPL-002)
- Multi-module format: `IMPL-{prefix}{seq}` (e.g., IMPL-A1, IMPL-B1, IMPL-C1)
- Prefix: A, B, C... (assigned by module detection order)
- Sequence: 1, 2, 3... (per-module increment)
- `title`: Descriptive task name summarizing the work
- `status`: Task state - `pending` (not started), `active` (in progress), `completed` (done), `blocked` (waiting on dependencies)
- `context_package_path`: Path to smart context package containing project structure, dependencies, and brainstorming artifacts catalog
@@ -225,7 +224,8 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
"meta": {
"type": "feature|bugfix|refactor|test-gen|test-fix|docs",
"agent": "@code-developer|@action-planning-agent|@test-fix-agent|@universal-executor",
"execution_group": "parallel-abc123|null"
"execution_group": "parallel-abc123|null",
"module": "frontend|backend|shared|null"
}
}
```
@@ -234,6 +234,7 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
- `type`: Task category - `feature` (new functionality), `bugfix` (fix defects), `refactor` (restructure code), `test-gen` (generate tests), `test-fix` (fix failing tests), `docs` (documentation)
- `agent`: Assigned agent for execution
- `execution_group`: Parallelization group ID (tasks with same ID can run concurrently) or `null` for sequential tasks
- `module`: Module identifier for multi-module projects (e.g., `frontend`, `backend`, `shared`) or `null` for single-module
**Test Task Extensions** (for type="test-gen" or type="test-fix"):
@@ -391,7 +392,7 @@ Generate individual `.task/IMPL-*.json` files with the following structure:
// Pattern: Project structure analysis
{
"step": "analyze_project_architecture",
"commands": ["bash(~/.claude/scripts/get_modules_by_depth.sh)"],
"commands": ["bash(ccw tool exec get_modules_by_depth '{}')"],
"output_to": "project_architecture"
},
@@ -604,10 +605,42 @@ Agent determines CLI tool usage per-step based on user semantics and task nature
- Analysis results (technical approach, architecture decisions)
- Brainstorming artifacts (role analyses, guidance specifications)
**Multi-Module Format** (when modules detected):
When multiple modules are detected (frontend/backend, etc.), organize IMPL_PLAN.md by module:
```markdown
# Implementation Plan
## Module A: Frontend (N tasks)
### IMPL-A1: [Task Title]
[Task details...]
### IMPL-A2: [Task Title]
[Task details...]
## Module B: Backend (N tasks)
### IMPL-B1: [Task Title]
[Task details...]
### IMPL-B2: [Task Title]
[Task details...]
## Cross-Module Dependencies
- IMPL-A1 → IMPL-B1 (Frontend depends on Backend API)
- IMPL-A2 → IMPL-B2 (UI state depends on Backend service)
```
**Cross-Module Dependency Notation**:
- During parallel planning, use `CROSS::{module}::{pattern}` format
- Example: `depends_on: ["CROSS::B::api-endpoint"]`
- Integration phase resolves to actual task IDs: `CROSS::B::api → IMPL-B1`
### 2.3 TODO_LIST.md Structure
Generate at `.workflow/active/{session_id}/TODO_LIST.md`:
**Single Module Format**:
```markdown
# Tasks: {Session Topic}
@@ -621,30 +654,54 @@ Generate at `.workflow/active/{session_id}/TODO_LIST.md`:
- `- [x]` = Completed task
```
**Multi-Module Format** (hierarchical by module):
```markdown
# Tasks: {Session Topic}
## Module A (Frontend)
- [ ] **IMPL-A1**: [Task Title] → [📋](./.task/IMPL-A1.json)
- [ ] **IMPL-A2**: [Task Title] → [📋](./.task/IMPL-A2.json)
## Module B (Backend)
- [ ] **IMPL-B1**: [Task Title] → [📋](./.task/IMPL-B1.json)
- [ ] **IMPL-B2**: [Task Title] → [📋](./.task/IMPL-B2.json)
## Cross-Module Dependencies
- IMPL-A1 → IMPL-B1 (Frontend depends on Backend API)
## Status Legend
- `- [ ]` = Pending task
- `- [x]` = Completed task
```
**Linking Rules**:
- Todo items → task JSON: `[📋](./.task/IMPL-XXX.json)`
- Completed tasks → summaries: `[✅](./.summaries/IMPL-XXX-summary.md)`
- Consistent ID schemes: IMPL-XXX
- Consistent ID schemes: `IMPL-N` (single) or `IMPL-{prefix}{seq}` (multi-module)
### 2.4 Complexity-Based Structure Selection
### 2.4 Complexity & Structure Selection
Use `analysis_results.complexity` or task count to determine structure:
**Simple Tasks** (≤5 tasks):
- Flat structure: IMPL_PLAN.md + TODO_LIST.md + task JSONs
- All tasks at same level
**Single Module Mode**:
- **Simple Tasks** (≤5 tasks): Flat structure
- **Medium Tasks** (6-12 tasks): Flat structure
- **Complex Tasks** (>12 tasks): Re-scope required (maximum 12 tasks hard limit)
**Medium Tasks** (6-12 tasks):
- Flat structure: IMPL_PLAN.md + TODO_LIST.md + task JSONs
- All tasks at same level
**Multi-Module Mode** (N+1 parallel planning):
- **Per-module limit**: ≤9 tasks per module
- **Total limit**: Sum of all module tasks ≤27 (3 modules × 9 tasks)
- **Task ID format**: `IMPL-{prefix}{seq}` (e.g., IMPL-A1, IMPL-B1)
- **Structure**: Hierarchical by module in IMPL_PLAN.md and TODO_LIST.md
**Complex Tasks** (>12 tasks):
- **Re-scope required**: Maximum 12 tasks hard limit
- If analysis_results contains >12 tasks, consolidate or request re-scoping
**Multi-Module Detection Triggers**:
- Explicit frontend/backend separation (`src/frontend`, `src/backend`)
- Monorepo structure (`packages/*`, `apps/*`)
- Context-package dependency clustering (2+ distinct module groups)
---
## 3. Quality & Standards
## 3. Quality Standards
### 3.1 Quantification Requirements (MANDATORY)
@@ -670,47 +727,46 @@ Use `analysis_results.complexity` or task count to determine structure:
- [ ] Each implementation step has its own acceptance criteria
**Examples**:
- GOOD: `"Implement 5 commands: [cmd1, cmd2, cmd3, cmd4, cmd5]"`
- BAD: `"Implement new commands"`
- GOOD: `"5 files created: verify by ls .claude/commands/*.md | wc -l = 5"`
- BAD: `"All commands implemented successfully"`
- GOOD: `"Implement 5 commands: [cmd1, cmd2, cmd3, cmd4, cmd5]"`
- BAD: `"Implement new commands"`
- GOOD: `"5 files created: verify by ls .claude/commands/*.md | wc -l = 5"`
- BAD: `"All commands implemented successfully"`
### 3.2 Planning Principles
### 3.2 Planning & Organization Standards
**Planning Principles**:
- Each stage produces working, testable code
- Clear success criteria for each deliverable
- Dependencies clearly identified between stages
- Incremental progress over big bangs
### 3.3 File Organization
**File Organization**:
- Session naming: `WFS-[topic-slug]`
- Task IDs: IMPL-XXX (flat structure only)
- Directory structure: flat task organization
### 3.4 Document Standards
- Task IDs:
- Single module: `IMPL-N` (e.g., IMPL-001, IMPL-002)
- Multi-module: `IMPL-{prefix}{seq}` (e.g., IMPL-A1, IMPL-B1)
- Directory structure: flat task organization (all tasks in `.task/`)
**Document Standards**:
- Proper linking between documents
- Consistent navigation and references
---
## 4. Key Reminders
### 3.3 Guidelines Checklist
**ALWAYS:**
- **Apply Quantification Requirements**: All requirements, acceptance criteria, and modification points MUST include explicit counts and enumerations
- **Load IMPL_PLAN template**: Read(~/.claude/workflows/cli-templates/prompts/workflow/impl-plan-template.txt) before generating IMPL_PLAN.md
- **Use provided context package**: Extract all information from structured context
- **Respect memory-first rule**: Use provided content (already loaded from memory/file)
- **Follow 6-field schema**: All task JSONs must have id, title, status, context_package_path, meta, context, flow_control
- **Map artifacts**: Use artifacts_inventory to populate task.context.artifacts array
- **Add MCP integration**: Include MCP tool steps in flow_control.pre_analysis when capabilities available
- **Validate task count**: Maximum 12 tasks hard limit, request re-scope if exceeded
- **Use session paths**: Construct all paths using provided session_id
- **Link documents properly**: Use correct linking format (📋 for JSON, ✅ for summaries)
- **Run validation checklist**: Verify all quantification requirements before finalizing task JSONs
- **Apply 举一反三 principle**: Adapt pre-analysis patterns to task-specific needs dynamically
- **Follow template validation**: Complete IMPL_PLAN.md template validation checklist before finalization
- Apply Quantification Requirements to all requirements, acceptance criteria, and modification points
- Load IMPL_PLAN template: `Read(~/.claude/workflows/cli-templates/prompts/workflow/impl-plan-template.txt)` before generating IMPL_PLAN.md
- Use provided context package: Extract all information from structured context
- Respect memory-first rule: Use provided content (already loaded from memory/file)
- Follow 6-field schema: All task JSONs must have id, title, status, context_package_path, meta, context, flow_control
- Map artifacts: Use artifacts_inventory to populate task.context.artifacts array
- Add MCP integration: Include MCP tool steps in flow_control.pre_analysis when capabilities available
- Validate task count: Maximum 12 tasks hard limit, request re-scope if exceeded
- Use session paths: Construct all paths using provided session_id
- Link documents properly: Use correct linking format (📋 for JSON, ✅ for summaries)
- Run validation checklist: Verify all quantification requirements before finalizing task JSONs
- Apply 举一反三 principle: Adapt pre-analysis patterns to task-specific needs dynamically
- Follow template validation: Complete IMPL_PLAN.md template validation checklist before finalization
**NEVER:**
- Load files directly (use provided context package instead)

View File

@@ -67,7 +67,7 @@ Score = 0
**1. Project Structure**:
```bash
~/.claude/scripts/get_modules_by_depth.sh
ccw tool exec get_modules_by_depth '{}'
```
**2. Content Search**:

View File

@@ -67,7 +67,7 @@ Phase 4: Output Generation
```bash
# Project structure
~/.claude/scripts/get_modules_by_depth.sh
ccw tool exec get_modules_by_depth '{}'
# Pattern discovery (adapt based on language)
rg "^export (class|interface|function) " --type ts -n

View File

@@ -119,17 +119,6 @@ This agent processes **simplified inline [FLOW_CONTROL]** format from brainstorm
- No dependency management
- Used for temporary context preparation
### NOT Handled by This Agent
**JSON format** (used by code-developer, test-fix-agent):
```json
"flow_control": {
"pre_analysis": [...],
"implementation_approach": [...]
}
```
This complete JSON format is stored in `.task/IMPL-*.json` files and handled by implementation agents, not conceptual-planning-agent.
### Role-Specific Analysis Dimensions
@@ -146,14 +135,14 @@ This complete JSON format is stored in `.task/IMPL-*.json` files and handled by
### Output Integration
**Gemini Analysis Integration**: Pattern-based analysis results are integrated into the single role's output:
- Enhanced `analysis.md` with codebase insights and architectural patterns
**Gemini Analysis Integration**: Pattern-based analysis results are integrated into role output documents:
- Enhanced analysis documents with codebase insights and architectural patterns
- Role-specific technical recommendations based on existing conventions
- Pattern-based best practices from actual code examination
- Realistic feasibility assessments based on current implementation
**Codex Analysis Integration**: Autonomous analysis results provide comprehensive insights:
- Enhanced `analysis.md` with autonomous development recommendations
- Enhanced analysis documents with autonomous development recommendations
- Role-specific strategy based on intelligent system understanding
- Autonomous development approaches and implementation guidance
- Self-guided optimization and integration recommendations
@@ -229,26 +218,23 @@ Generate documents according to loaded role template specifications:
**Output Location**: `.workflow/WFS-[session]/.brainstorming/[assigned-role]/`
**Required Files**:
- **analysis.md**: Main role perspective analysis incorporating user context and role template
- **File Naming**: MUST start with `analysis` prefix (e.g., `analysis.md`, `analysis-1.md`, `analysis-2.md`)
**Output Files**:
- **analysis.md**: Index document with overview (optionally with `@` references to sub-documents)
- **FORBIDDEN**: Never create `recommendations.md` or any file not starting with `analysis` prefix
- **Auto-split if large**: If content >800 lines, split to `analysis-1.md`, `analysis-2.md` (max 3 files: analysis.md, analysis-1.md, analysis-2.md)
- **Content**: Includes both analysis AND recommendations sections within analysis files
- **[role-deliverables]/**: Directory for specialized role outputs as defined in planning role template (optional)
- **analysis-{slug}.md**: Section content documents (slug from section heading: lowercase, hyphens)
- Maximum 5 sub-documents (merge related sections if needed)
- **Content**: Analysis AND recommendations sections
**File Structure Example**:
```
.workflow/WFS-[session]/.brainstorming/system-architect/
├── analysis.md # Main system architecture analysis with recommendations
├── analysis-1.md # (Optional) Continuation if content >800 lines
── deliverables/ # (Optional) Additional role-specific outputs
├── technical-architecture.md # System design specifications
├── technology-stack.md # Technology selection rationale
└── scalability-plan.md # Scaling strategy
├── analysis.md # Index with overview + @references
├── analysis-architecture-assessment.md # Section content
── analysis-technology-evaluation.md # Section content
├── analysis-integration-strategy.md # Section content
└── analysis-recommendations.md # Section content (max 5 sub-docs total)
NOTE: ALL brainstorming output files MUST start with 'analysis' prefix
FORBIDDEN: recommendations.md, recommendations-*.md, or any non-'analysis' prefixed files
NOTE: ALL files MUST start with 'analysis' prefix. Max 5 sub-documents.
```
## Role-Specific Planning Process
@@ -268,14 +254,10 @@ FORBIDDEN: recommendations.md, recommendations-*.md, or any non-'analysis' prefi
- **Validate Against Template**: Ensure analysis meets role template requirements and standards
### 3. Brainstorming Documentation Phase
- **Create analysis.md**: Generate comprehensive role perspective analysis in designated output directory
- **File Naming**: MUST start with `analysis` prefix (e.g., `analysis.md`, `analysis-1.md`, `analysis-2.md`)
- **FORBIDDEN**: Never create `recommendations.md` or any file not starting with `analysis` prefix
- **Content**: Include both analysis AND recommendations sections within analysis files
- **Auto-split**: If content >800 lines, split to `analysis-1.md`, `analysis-2.md` (max 3 files total)
- **Generate Role Deliverables**: Create specialized outputs as defined in planning role template (optional)
- **Create analysis.md**: Main document with overview (optionally with `@` references)
- **Create sub-documents**: `analysis-{slug}.md` for major sections (max 5)
- **Validate Output Structure**: Ensure all files saved to correct `.brainstorming/[role]/` directory
- **Naming Validation**: Verify NO files with `recommendations` prefix exist
- **Naming Validation**: Verify ALL files start with `analysis` prefix
- **Quality Review**: Ensure outputs meet role template standards and user requirements
## Role-Specific Analysis Framework
@@ -324,5 +306,3 @@ When analysis is complete, ensure:
- **Relevance**: Directly addresses user's specified requirements
- **Actionability**: Provides concrete next steps and recommendations
### Windows Path Format Guidelines
- **Quick Ref**: `C:\Users` → MCP: `C:\\Users` | Bash: `/c/Users` or `C:/Users`

View File

@@ -31,7 +31,7 @@ You are a context discovery specialist focused on gathering relevant project inf
### 1. Reference Documentation (Project Standards)
**Tools**:
- `Read()` - Load CLAUDE.md, README.md, architecture docs
- `Bash(~/.claude/scripts/get_modules_by_depth.sh)` - Project structure
- `Bash(ccw tool exec get_modules_by_depth '{}')` - Project structure
- `Glob()` - Find documentation files
**Use**: Phase 0 foundation setup
@@ -82,7 +82,7 @@ mcp__code-index__set_project_path(process.cwd())
mcp__code-index__refresh_index()
// 2. Project Structure
bash(~/.claude/scripts/get_modules_by_depth.sh)
bash(ccw tool exec get_modules_by_depth '{}')
// 3. Load Documentation (if not in memory)
if (!memory.has("CLAUDE.md")) Read(CLAUDE.md)
@@ -449,7 +449,12 @@ Calculate risk level based on:
{
"path": "system-architect/analysis.md",
"type": "primary",
"content": "# System Architecture Analysis\n\n## Overview\n..."
"content": "# System Architecture Analysis\n\n## Overview\n@analysis-architecture.md\n@analysis-recommendations.md"
},
{
"path": "system-architect/analysis-architecture.md",
"type": "supplementary",
"content": "# Architecture Assessment\n\n..."
}
]
}

View File

@@ -8,7 +8,7 @@ You are a documentation update coordinator for complex projects. Orchestrate par
## Core Mission
Execute depth-parallel updates for all modules using `~/.claude/scripts/update_module_claude.sh`. **Every module path must be processed**.
Execute depth-parallel updates for all modules using `ccw tool exec update_module_claude`. **Every module path must be processed**.
## Input Context
@@ -42,12 +42,12 @@ TodoWrite([
# 3. Launch parallel jobs (max 4)
# Depth 5 example (Layer 3 - use multi-layer):
~/.claude/scripts/update_module_claude.sh "multi-layer" "./.claude/workflows/cli-templates/prompts/analysis" "gemini" &
~/.claude/scripts/update_module_claude.sh "multi-layer" "./.claude/workflows/cli-templates/prompts/development" "gemini" &
ccw tool exec update_module_claude '{"strategy":"multi-layer","path":"./.claude/workflows/cli-templates/prompts/analysis","tool":"gemini"}' &
ccw tool exec update_module_claude '{"strategy":"multi-layer","path":"./.claude/workflows/cli-templates/prompts/development","tool":"gemini"}' &
# Depth 1 example (Layer 2 - use single-layer):
~/.claude/scripts/update_module_claude.sh "single-layer" "./src/auth" "gemini" &
~/.claude/scripts/update_module_claude.sh "single-layer" "./src/api" "gemini" &
ccw tool exec update_module_claude '{"strategy":"single-layer","path":"./src/auth","tool":"gemini"}' &
ccw tool exec update_module_claude '{"strategy":"single-layer","path":"./src/api","tool":"gemini"}' &
# ... up to 4 concurrent jobs
# 4. Wait for all depth jobs to complete

View File

@@ -191,7 +191,7 @@ target/
### Step 2: Workspace Analysis (MANDATORY FIRST)
```bash
# Analyze workspace structure
bash(~/.claude/scripts/get_modules_by_depth.sh json)
bash(ccw tool exec get_modules_by_depth '{"format":"json"}')
```
### Step 3: Technology Detection

View File

@@ -101,10 +101,10 @@ src/ (depth 1) → SINGLE STRATEGY
Bash({command: "pwd && basename \"$(pwd)\" && git rev-parse --show-toplevel 2>/dev/null || pwd", run_in_background: false});
// Get module structure with classification
Bash({command: "~/.claude/scripts/get_modules_by_depth.sh list | ~/.claude/scripts/classify-folders.sh", run_in_background: false});
Bash({command: "ccw tool exec get_modules_by_depth '{\"format\":\"list\"}' | ccw tool exec classify_folders '{}'", run_in_background: false});
// OR with path parameter
Bash({command: "cd <target-path> && ~/.claude/scripts/get_modules_by_depth.sh list | ~/.claude/scripts/classify-folders.sh", run_in_background: false});
Bash({command: "cd <target-path> && ccw tool exec get_modules_by_depth '{\"format\":\"list\"}' | ccw tool exec classify_folders '{}'", run_in_background: false});
```
**Parse output** `depth:N|path:<PATH>|type:<code|navigation>|...` to extract module paths, types, and count.
@@ -200,7 +200,7 @@ for (let layer of [3, 2, 1]) {
let strategy = module.depth >= 3 ? "full" : "single";
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/generate_module_docs.sh "${strategy}" "." "${project_name}" "${tool}"`,
command: `cd ${module.path} && ccw tool exec generate_module_docs '{"strategy":"${strategy}","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -263,7 +263,7 @@ MODULES:
TOOLS (try in order): {{tool_1}}, {{tool_2}}, {{tool_3}}
EXECUTION SCRIPT: ~/.claude/scripts/generate_module_docs.sh
EXECUTION SCRIPT: ccw tool exec generate_module_docs
- Accepts strategy parameter: full | single
- Accepts folder type detection: code | navigation
- Tool execution via direct CLI commands (gemini/qwen/codex)
@@ -273,7 +273,7 @@ EXECUTION FLOW (for each module):
1. Tool fallback loop (exit on first success):
for tool in {{tool_1}} {{tool_2}} {{tool_3}}; do
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "{{strategy}}" "." "{{project_name}}" "${tool}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"{{strategy}}","sourcePath":".","projectName":"{{project_name}}","tool":"${tool}"}'`,
run_in_background: false
})
exit_code=$?
@@ -322,7 +322,7 @@ let project_root = get_project_root();
report("Generating project README.md...");
for (let tool of tool_order) {
Bash({
command: `cd ${project_root} && ~/.claude/scripts/generate_module_docs.sh "project-readme" "." "${project_name}" "${tool}"`,
command: `cd ${project_root} && ccw tool exec generate_module_docs '{"strategy":"project-readme","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -335,7 +335,7 @@ for (let tool of tool_order) {
report("Generating ARCHITECTURE.md and EXAMPLES.md...");
for (let tool of tool_order) {
Bash({
command: `cd ${project_root} && ~/.claude/scripts/generate_module_docs.sh "project-architecture" "." "${project_name}" "${tool}"`,
command: `cd ${project_root} && ccw tool exec generate_module_docs '{"strategy":"project-architecture","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -350,7 +350,7 @@ if (bash_result.stdout.includes("API_FOUND")) {
report("Generating HTTP API documentation...");
for (let tool of tool_order) {
Bash({
command: `cd ${project_root} && ~/.claude/scripts/generate_module_docs.sh "http-api" "." "${project_name}" "${tool}"`,
command: `cd ${project_root} && ccw tool exec generate_module_docs '{"strategy":"http-api","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {

View File

@@ -51,7 +51,7 @@ Orchestrates context-aware documentation generation/update for changed modules u
Bash({command: "pwd && basename \"$(pwd)\" && git rev-parse --show-toplevel 2>/dev/null || pwd", run_in_background: false});
// Detect changed modules
Bash({command: "~/.claude/scripts/detect_changed_modules.sh list", run_in_background: false});
Bash({command: "ccw tool exec detect_changed_modules '{\"format\":\"list\"}'", run_in_background: false});
// Cache git changes
Bash({command: "git add -A 2>/dev/null || true", run_in_background: false});
@@ -123,7 +123,7 @@ for (let depth of sorted_depths.reverse()) { // N → 0
return async () => {
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/generate_module_docs.sh "single" "." "${project_name}" "${tool}"`,
command: `cd ${module.path} && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -207,21 +207,21 @@ EXECUTION:
For each module above:
1. Try tool 1:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "single" "." "{{project_name}}" "{{tool_1}}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"{{project_name}}","tool":"{{tool_1}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} docs generated with {{tool_1}}", proceed to next module
→ Failure: Try tool 2
2. Try tool 2:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "single" "." "{{project_name}}" "{{tool_2}}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"{{project_name}}","tool":"{{tool_2}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} docs generated with {{tool_2}}", proceed to next module
→ Failure: Try tool 3
3. Try tool 3:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/generate_module_docs.sh "single" "." "{{project_name}}" "{{tool_3}}"`,
command: `cd "{{module_path}}" && ccw tool exec generate_module_docs '{"strategy":"single","sourcePath":".","projectName":"{{project_name}}","tool":"{{tool_3}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} docs generated with {{tool_3}}", proceed to next module

View File

@@ -64,12 +64,17 @@ Lightweight planner that analyzes project structure, decomposes documentation wo
```bash
# Get target path, project name, and root
bash(pwd && basename "$(pwd)" && git rev-parse --show-toplevel 2>/dev/null || pwd && date +%Y%m%d-%H%M%S)
```
# Create session directories (replace timestamp)
bash(mkdir -p .workflow/active/WFS-docs-{timestamp}/.{task,process,summaries})
```javascript
// Create docs session (type: docs)
SlashCommand(command="/workflow:session:start --type docs --new \"{project_name}-docs-{timestamp}\"")
// Parse output to get sessionId
```
# Create workflow-session.json (replace values)
bash(echo '{"session_id":"WFS-docs-{timestamp}","project":"{project} documentation","status":"planning","timestamp":"2024-01-20T14:30:22+08:00","path":".","target_path":"{target_path}","project_root":"{project_root}","project_name":"{project_name}","mode":"full","tool":"gemini","cli_execute":false}' | jq '.' > .workflow/active/WFS-docs-{timestamp}/workflow-session.json)
```bash
# Update workflow-session.json with docs-specific fields
bash(jq '. + {"target_path":"{target_path}","project_root":"{project_root}","project_name":"{project_name}","mode":"full","tool":"gemini","cli_execute":false}' .workflow/active/{sessionId}/workflow-session.json > tmp.json && mv tmp.json .workflow/active/{sessionId}/workflow-session.json)
```
### Phase 2: Analyze Structure
@@ -80,10 +85,10 @@ bash(echo '{"session_id":"WFS-docs-{timestamp}","project":"{project} documentati
```bash
# 1. Run folder analysis
bash(~/.claude/scripts/get_modules_by_depth.sh | ~/.claude/scripts/classify-folders.sh)
bash(ccw tool exec get_modules_by_depth '{}' | ccw tool exec classify_folders '{}')
# 2. Get top-level directories (first 2 path levels)
bash(~/.claude/scripts/get_modules_by_depth.sh | ~/.claude/scripts/classify-folders.sh | awk -F'|' '{print $1}' | sed 's|^\./||' | awk -F'/' '{if(NF>=2) print $1"/"$2; else if(NF==1) print $1}' | sort -u)
bash(ccw tool exec get_modules_by_depth '{}' | ccw tool exec classify_folders '{}' | awk -F'|' '{print $1}' | sed 's|^\./||' | awk -F'/' '{if(NF>=2) print $1"/"$2; else if(NF==1) print $1}' | sort -u)
# 3. Find existing docs (if directory exists)
bash(if [ -d .workflow/docs/\${project_name} ]; then find .workflow/docs/\${project_name} -type f -name "*.md" ! -path "*/README.md" ! -path "*/ARCHITECTURE.md" ! -path "*/EXAMPLES.md" ! -path "*/api/*" 2>/dev/null; fi)

View File

@@ -109,7 +109,7 @@ Task(
1. **Project Structure**
\`\`\`bash
bash(~/.claude/scripts/get_modules_by_depth.sh)
bash(ccw tool exec get_modules_by_depth '{}')
\`\`\`
2. **Core Documentation**

View File

@@ -99,10 +99,10 @@ src/ (depth 1) → SINGLE-LAYER STRATEGY
Bash({command: "git add -A 2>/dev/null || true", run_in_background: false});
// Get module structure
Bash({command: "~/.claude/scripts/get_modules_by_depth.sh list", run_in_background: false});
Bash({command: "ccw tool exec get_modules_by_depth '{\"format\":\"list\"}'", run_in_background: false});
// OR with --path
Bash({command: "cd <target-path> && ~/.claude/scripts/get_modules_by_depth.sh list", run_in_background: false});
Bash({command: "cd <target-path> && ccw tool exec get_modules_by_depth '{\"format\":\"list\"}'", run_in_background: false});
```
**Parse output** `depth:N|path:<PATH>|...` to extract module paths and count.
@@ -185,7 +185,7 @@ for (let layer of [3, 2, 1]) {
let strategy = module.depth >= 3 ? "multi-layer" : "single-layer";
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/update_module_claude.sh "${strategy}" "." "${tool}"`,
command: `cd ${module.path} && ccw tool exec update_module_claude '{"strategy":"${strategy}","path":".","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -244,7 +244,7 @@ MODULES:
TOOLS (try in order): {{tool_1}}, {{tool_2}}, {{tool_3}}
EXECUTION SCRIPT: ~/.claude/scripts/update_module_claude.sh
EXECUTION SCRIPT: ccw tool exec update_module_claude
- Accepts strategy parameter: multi-layer | single-layer
- Tool execution via direct CLI commands (gemini/qwen/codex)
@@ -252,7 +252,7 @@ EXECUTION FLOW (for each module):
1. Tool fallback loop (exit on first success):
for tool in {{tool_1}} {{tool_2}} {{tool_3}}; do
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "{{strategy}}" "." "${tool}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"{{strategy}}","path":".","tool":"${tool}"}'`,
run_in_background: false
})
exit_code=$?

View File

@@ -41,7 +41,7 @@ Orchestrates context-aware CLAUDE.md updates for changed modules using batched a
```javascript
// Detect changed modules
Bash({command: "~/.claude/scripts/detect_changed_modules.sh list", run_in_background: false});
Bash({command: "ccw tool exec detect_changed_modules '{\"format\":\"list\"}'", run_in_background: false});
// Cache git changes
Bash({command: "git add -A 2>/dev/null || true", run_in_background: false});
@@ -102,7 +102,7 @@ for (let depth of sorted_depths.reverse()) { // N → 0
return async () => {
for (let tool of tool_order) {
Bash({
command: `cd ${module.path} && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "${tool}"`,
command: `cd ${module.path} && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"${tool}"}'`,
run_in_background: false
});
if (bash_result.exit_code === 0) {
@@ -184,21 +184,21 @@ EXECUTION:
For each module above:
1. Try tool 1:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "{{tool_1}}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"{{tool_1}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} updated with {{tool_1}}", proceed to next module
→ Failure: Try tool 2
2. Try tool 2:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "{{tool_2}}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"{{tool_2}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} updated with {{tool_2}}", proceed to next module
→ Failure: Try tool 3
3. Try tool 3:
Bash({
command: `cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "single-layer" "." "{{tool_3}}"`,
command: `cd "{{module_path}}" && ccw tool exec update_module_claude '{"strategy":"single-layer","path":".","tool":"{{tool_3}}"}'`,
run_in_background: false
})
→ Success: Report "✅ {{module_path}} updated with {{tool_3}}", proceed to next module

View File

@@ -2,452 +2,359 @@
name: artifacts
description: Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis
argument-hint: "topic or challenge description [--count N]"
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*)
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), AskUserQuestion(*)
---
## Overview
Six-phase workflow: **Automatic project context collection**Extract topic challenges → Select roles → Generate task-specific questions → Detect conflicts → Generate confirmed guidance (declarative statements only).
Seven-phase workflow: **Context collection****Topic analysis****Role selection****Role questions****Conflict resolution****Final check****Generate specification**
All user interactions use AskUserQuestion tool (max 4 questions per call, multi-round).
**Input**: `"GOAL: [objective] SCOPE: [boundaries] CONTEXT: [background]" [--count N]`
**Output**: `.workflow/active/WFS-{topic}/.brainstorming/guidance-specification.md` (CONFIRMED/SELECTED format)
**Core Principle**: Questions dynamically generated from project context + topic keywords/challenges, NOT from generic templates
**Output**: `.workflow/active/WFS-{topic}/.brainstorming/guidance-specification.md`
**Core Principle**: Questions dynamically generated from project context + topic keywords, NOT generic templates
**Parameters**:
- `topic` (required): Topic or challenge description (structured format recommended)
- `--count N` (optional): Number of roles user WANTS to select (system will recommend N+2 options for user to choose from, default: 3)
- `--count N` (optional): Number of roles to select (system recommends N+2 options, default: 3)
---
## Quick Reference
### Phase Summary
| Phase | Goal | AskUserQuestion | Storage |
|-------|------|-----------------|---------|
| 0 | Context collection | - | context-package.json |
| 1 | Topic analysis | 2-4 questions | intent_context |
| 2 | Role selection | 1 multi-select | selected_roles |
| 3 | Role questions | 3-4 per role | role_decisions[role] |
| 4 | Conflict resolution | max 4 per round | cross_role_decisions |
| 4.5 | Final check | progressive rounds | additional_decisions |
| 5 | Generate spec | - | guidance-specification.md |
### AskUserQuestion Pattern
```javascript
// Single-select (Phase 1, 3, 4)
AskUserQuestion({
questions: [
{
question: "{问题文本}",
header: "{短标签}", // max 12 chars
multiSelect: false,
options: [
{ label: "{选项}", description: "{说明和影响}" },
{ label: "{选项}", description: "{说明和影响}" },
{ label: "{选项}", description: "{说明和影响}" }
]
}
// ... max 4 questions per call
]
})
// Multi-select (Phase 2)
AskUserQuestion({
questions: [{
question: "请选择 {count} 个角色",
header: "角色选择",
multiSelect: true,
options: [/* max 4 options per call */]
}]
})
```
### Multi-Round Execution
```javascript
const BATCH_SIZE = 4;
for (let i = 0; i < allQuestions.length; i += BATCH_SIZE) {
const batch = allQuestions.slice(i, i + BATCH_SIZE);
AskUserQuestion({ questions: batch });
// Store responses before next round
}
```
---
## Task Tracking
**⚠️ TodoWrite Rule**: EXTEND auto-parallel's task list (NOT replace/overwrite)
**TodoWrite Rule**: EXTEND auto-parallel's task list (NOT replace/overwrite)
**When called from auto-parallel**:
- Find the artifacts parent task: "Execute artifacts command for interactive framework generation"
- Mark parent task as "in_progress"
- APPEND artifacts sub-tasks AFTER the parent task (Phase 0-5)
- Mark each sub-task as it completes
- When Phase 5 completes, mark parent task as "completed"
- **PRESERVE all other auto-parallel tasks** (role agents, synthesis)
- Find artifacts parent task → Mark "in_progress"
- APPEND sub-tasks (Phase 0-5) → Mark each as completes
- When Phase 5 completes → Mark parent "completed"
- PRESERVE all other auto-parallel tasks
**Standalone Mode**:
```json
[
{"content": "Initialize session (.workflow/active/ session check, parse --count parameter)", "status": "pending", "activeForm": "Initializing"},
{"content": "Phase 0: Automatic project context collection (call context-gather)", "status": "pending", "activeForm": "Phase 0 context collection"},
{"content": "Phase 1: Extract challenges, output 2-4 task-specific questions, wait for user input", "status": "pending", "activeForm": "Phase 1 topic analysis"},
{"content": "Phase 2: Recommend count+2 roles, output role selection, wait for user input", "status": "pending", "activeForm": "Phase 2 role selection"},
{"content": "Phase 3: Generate 3-4 questions per role, output and wait for answers (max 10 per round)", "status": "pending", "activeForm": "Phase 3 role questions"},
{"content": "Phase 4: Detect conflicts, output clarifications, wait for answers (max 10 per round)", "status": "pending", "activeForm": "Phase 4 conflict resolution"},
{"content": "Phase 5: Transform Q&A to declarative statements, write guidance-specification.md", "status": "pending", "activeForm": "Phase 5 document generation"}
{"content": "Initialize session", "status": "pending", "activeForm": "Initializing"},
{"content": "Phase 0: Context collection", "status": "pending", "activeForm": "Phase 0"},
{"content": "Phase 1: Topic analysis (2-4 questions)", "status": "pending", "activeForm": "Phase 1"},
{"content": "Phase 2: Role selection", "status": "pending", "activeForm": "Phase 2"},
{"content": "Phase 3: Role questions (per role)", "status": "pending", "activeForm": "Phase 3"},
{"content": "Phase 4: Conflict resolution", "status": "pending", "activeForm": "Phase 4"},
{"content": "Phase 4.5: Final clarification", "status": "pending", "activeForm": "Phase 4.5"},
{"content": "Phase 5: Generate specification", "status": "pending", "activeForm": "Phase 5"}
]
```
## User Interaction Protocol
### Question Output Format
All questions output as structured text (detailed format with descriptions):
```markdown
【问题{N} - {短标签}】{问题文本}
a) {选项标签}
说明:{选项说明和影响}
b) {选项标签}
说明:{选项说明和影响}
c) {选项标签}
说明:{选项说明和影响}
请回答:{N}a 或 {N}b 或 {N}c
```
**Multi-select format** (Phase 2 role selection):
```markdown
【角色选择】请选择 {count} 个角色参与头脑风暴分析
a) {role-name} ({中文名})
推荐理由:{基于topic的相关性说明}
b) {role-name} ({中文名})
推荐理由:{基于topic的相关性说明}
...
支持格式:
- 分别选择2a 2c 2d (选择第2题的a、c、d选项)
- 合并语法2acd (选择a、c、d)
- 逗号分隔2a,c,d
请输入选择:
```
### Input Parsing Rules
**Supported formats** (intelligent parsing):
1. **Space-separated**: `1a 2b 3c` → Q1:a, Q2:b, Q3:c
2. **Comma-separated**: `1a,2b,3c` → Q1:a, Q2:b, Q3:c
3. **Multi-select combined**: `2abc` → Q2: options a,b,c
4. **Multi-select spaces**: `2 a b c` → Q2: options a,b,c
5. **Multi-select comma**: `2a,b,c` → Q2: options a,b,c
6. **Natural language**: `问题1选a` → 1a (fallback parsing)
**Parsing algorithm**:
- Extract question numbers and option letters
- Validate question numbers match output
- Validate option letters exist for each question
- If ambiguous/invalid, output example format and request re-input
**Error handling** (lenient):
- Recognize common variations automatically
- If parsing fails, show example and wait for clarification
- Support re-input without penalty
### Batching Strategy
**Batch limits**:
- **Default**: Maximum 10 questions per round
- **Phase 2 (role selection)**: Display all recommended roles at once (count+2 roles)
- **Auto-split**: If questions > 10, split into multiple rounds with clear round indicators
**Round indicators**:
```markdown
===== 第 1 轮问题 (共2轮) =====
【问题1 - ...】...
【问题2 - ...】...
...
【问题10 - ...】...
请回答 (格式: 1a 2b ... 10c)
```
### Interaction Flow
**Standard flow**:
1. Output questions in formatted text
2. Output expected input format example
3. Wait for user input
4. Parse input with intelligent matching
5. If parsing succeeds → Store answers and continue
6. If parsing fails → Show error, example, and wait for re-input
**No question/option limits**: Text-based interaction removes previous 4-question and 4-option restrictions
---
## Execution Phases
### Session Management
- Check `.workflow/active/` for existing sessions
- Multiple sessions → Prompt selection | Single → Use it | None → Create `WFS-[topic-slug]`
- Parse `--count N` parameter from user input (default: 3 if not specified)
- Store decisions in `workflow-session.json` including count parameter
- Multiple → Prompt selection | Single → Use it | None → Create `WFS-[topic-slug]`
- Parse `--count N` parameter (default: 3)
- Store decisions in `workflow-session.json`
### Phase 0: Automatic Project Context Collection
### Phase 0: Context Collection
**Goal**: Gather project architecture, documentation, and relevant code context BEFORE user interaction
**Goal**: Gather project context BEFORE user interaction
**Detection Mechanism** (execute first):
```javascript
// Check if context-package already exists
const contextPackagePath = `.workflow/active/WFS-{session-id}/.process/context-package.json`;
**Steps**:
1. Check if `context-package.json` exists → Skip if valid
2. Invoke `context-search-agent` (BRAINSTORM MODE - lightweight)
3. Output: `.workflow/active/WFS-{session-id}/.process/context-package.json`
if (file_exists(contextPackagePath)) {
// Validate package
const package = Read(contextPackagePath);
if (package.metadata.session_id === session_id) {
console.log("✅ Valid context-package found, skipping Phase 0");
return; // Skip to Phase 1
}
}
```
**Implementation**: Invoke `context-search-agent` only if package doesn't exist
**Graceful Degradation**: If agent fails, continue to Phase 1 without context
```javascript
Task(
subagent_type="context-search-agent",
description="Gather project context for brainstorm",
prompt=`
You are executing as context-search-agent (.claude/agents/context-search-agent.md).
Execute context-search-agent in BRAINSTORM MODE (Phase 1-2 only).
## Execution Mode
**BRAINSTORM MODE** (Lightweight) - Phase 1-2 only (skip deep analysis)
Session: ${session_id}
Task: ${task_description}
Output: .workflow/${session_id}/.process/context-package.json
## Session Information
- **Session ID**: ${session_id}
- **Task Description**: ${task_description}
- **Output Path**: .workflow/${session_id}/.process/context-package.json
## Mission
Execute complete context-search-agent workflow for implementation planning:
### Phase 1: Initialization & Pre-Analysis
1. **Detection**: Check for existing context-package (early exit if valid)
2. **Foundation**: Initialize code-index, get project structure, load docs
3. **Analysis**: Extract keywords, determine scope, classify complexity
### Phase 2: Multi-Source Context Discovery
Execute all 3 discovery tracks:
- **Track 1**: Reference documentation (CLAUDE.md, architecture docs)
- **Track 2**: Web examples (use Exa MCP for unfamiliar tech/APIs)
- **Track 3**: Codebase analysis (5-layer discovery: files, content, patterns, deps, config/tests)
### Phase 3: Synthesis, Assessment & Packaging
1. Apply relevance scoring and build dependency graph
2. Synthesize 3-source data (docs > code > web)
3. Integrate brainstorm artifacts (if .brainstorming/ exists, read content)
4. Perform conflict detection with risk assessment
5. Generate and validate context-package.json
## Output Requirements
Complete context-package.json with:
- **metadata**: task_description, keywords, complexity, tech_stack, session_id
- **project_context**: architecture_patterns, coding_conventions, tech_stack
- **assets**: {documentation[], source_code[], config[], tests[]} with relevance scores
- **dependencies**: {internal[], external[]} with dependency graph
- **brainstorm_artifacts**: {guidance_specification, role_analyses[], synthesis_output} with content
- **conflict_detection**: {risk_level, risk_factors, affected_modules[], mitigation_strategy}
## Quality Validation
Before completion verify:
- [ ] Valid JSON format with all required fields
- [ ] File relevance accuracy >80%
- [ ] Dependency graph complete (max 2 transitive levels)
- [ ] Conflict risk level calculated correctly
- [ ] No sensitive data exposed
- [ ] Total files ≤50 (prioritize high-relevance)
Execute autonomously following agent documentation.
Report completion with statistics.
Required fields: metadata, project_context, assets, dependencies, conflict_detection
`
)
```
**Graceful Degradation**:
- If agent fails: Log warning, continue to Phase 1 without project context
- If package invalid: Re-run context-search-agent
### Phase 1: Topic Analysis
### Phase 1: Topic Analysis & Intent Classification
**Goal**: Extract keywords/challenges to drive all subsequent question generation, **enriched by Phase 0 project context**
**Goal**: Extract keywords/challenges enriched by Phase 0 context
**Steps**:
1. **Load Phase 0 context** (if available):
- Read `.workflow/active/WFS-{session-id}/.process/context-package.json`
- Extract: tech_stack, existing modules, conflict_risk, relevant files
1. Load Phase 0 context (tech_stack, modules, conflict_risk)
2. Deep topic analysis (entities, challenges, constraints, metrics)
3. Generate 2-4 context-aware probing questions
4. AskUserQuestion → Store to `session.intent_context`
2. **Deep topic analysis** (context-aware):
- Extract technical entities from topic + existing codebase
- Identify core challenges considering existing architecture
- Consider constraints (timeline/budget/compliance)
- Define success metrics based on current project state
3. **Generate 2-4 context-aware probing questions**:
- Reference existing tech stack in questions
- Consider integration with existing modules
- Address identified conflict risks from Phase 0
- Target root challenges and trade-off priorities
4. **User interaction**: Output questions using text format (see User Interaction Protocol), wait for user input
5. **Parse user answers**: Use intelligent parsing to extract answers from user input (support multiple formats)
6. **Storage**: Store answers to `session.intent_context` with `{extracted_keywords, identified_challenges, user_answers, project_context_used}`
**Example Output**:
```markdown
===== Phase 1: 项目意图分析 =====
【问题1 - 核心挑战】实时协作平台的主要技术挑战?
a) 实时数据同步
说明100+用户同时在线,状态同步复杂度高
b) 可扩展性架构
说明:用户规模增长时的系统扩展能力
c) 冲突解决机制
说明:多用户同时编辑的冲突处理策略
【问题2 - 优先级】MVP阶段最关注的指标
a) 功能完整性
说明:实现所有核心功能
b) 用户体验
说明:流畅的交互体验和响应速度
c) 系统稳定性
说明:高可用性和数据一致性
请回答 (格式: 1a 2b)
**Example**:
```javascript
AskUserQuestion({
questions: [
{
question: "实时协作平台的主要技术挑战?",
header: "核心挑战",
multiSelect: false,
options: [
{ label: "实时数据同步", description: "100+用户同时在线,状态同步复杂度高" },
{ label: "可扩展性架构", description: "用户规模增长时的系统扩展能力" },
{ label: "冲突解决机制", description: "多用户同时编辑的冲突处理策略" }
]
},
{
question: "MVP阶段最关注的指标",
header: "优先级",
multiSelect: false,
options: [
{ label: "功能完整性", description: "实现所有核心功能" },
{ label: "用户体验", description: "流畅的交互体验和响应速度" },
{ label: "系统稳定性", description: "高可用性和数据一致性" }
]
}
]
})
```
**User input examples**:
- `1a 2c` → Q1:a, Q2:c
- `1a,2c` → Q1:a, Q2:c
**⚠️ CRITICAL**: Questions MUST reference topic keywords. Generic "Project type?" violates dynamic generation.
### Phase 2: Role Selection
**⚠️ CRITICAL**: User MUST interact to select roles. NEVER auto-select without user confirmation.
**Goal**: User selects roles from intelligent recommendations
**Available Roles**:
- data-architect (数据架构师)
- product-manager (产品经理)
- product-owner (产品负责人)
- scrum-master (敏捷教练)
- subject-matter-expert (领域专家)
- system-architect (系统架构师)
- test-strategist (测试策略师)
- ui-designer (UI 设计师)
- ux-expert (UX 专家)
**Available Roles**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
**Steps**:
1. **Intelligent role recommendation** (AI analysis):
- Analyze Phase 1 extracted keywords and challenges
- Use AI reasoning to determine most relevant roles for the specific topic
- Recommend count+2 roles (e.g., if user wants 3 roles, recommend 5 options)
- Provide clear rationale for each recommended role based on topic context
1. Analyze Phase 1 keywords → Recommend count+2 roles with rationale
2. AskUserQuestion (multiSelect=true) → Store to `session.selected_roles`
3. If count+2 > 4, split into multiple rounds
2. **User selection** (text interaction):
- Output all recommended roles at once (no batching needed for count+2 roles)
- Display roles with labels and relevance rationale
- Wait for user input in multi-select format
- Parse user input (support multiple formats)
- **Storage**: Store selections to `session.selected_roles`
**Example Output**:
```markdown
===== Phase 2: 角色选择 =====
【角色选择】请选择 3 个角色参与头脑风暴分析
a) system-architect (系统架构师)
推荐理由:实时同步架构设计和技术选型的核心角色
b) ui-designer (UI设计师)
推荐理由:协作界面用户体验和实时状态展示
c) product-manager (产品经理)
推荐理由功能优先级和MVP范围决策
d) data-architect (数据架构师)
推荐理由:数据同步模型和存储方案设计
e) ux-expert (UX专家)
推荐理由:多用户协作交互流程优化
支持格式:
- 分别选择2a 2c 2d (选择a、c、d)
- 合并语法2acd (选择a、c、d)
- 逗号分隔2a,c,d (选择a、c、d)
请输入选择:
**Example**:
```javascript
AskUserQuestion({
questions: [{
question: "请选择 3 个角色参与头脑风暴分析",
header: "角色选择",
multiSelect: true,
options: [
{ label: "system-architect", description: "实时同步架构设计和技术选型" },
{ label: "ui-designer", description: "协作界面用户体验和状态展示" },
{ label: "product-manager", description: "功能优先级和MVP范围决策" },
{ label: "data-architect", description: "数据同步模型和存储方案设计" }
]
}]
})
```
**User input examples**:
- `2acd` → Roles: a, c, d (system-architect, product-manager, data-architect)
- `2a 2c 2d` → Same result
- `2a,c,d` → Same result
**⚠️ CRITICAL**: User MUST interact. NEVER auto-select without confirmation.
**Role Recommendation Rules**:
- NO hardcoded keyword-to-role mappings
- Use intelligent analysis of topic, challenges, and requirements
- Consider role synergies and coverage gaps
- Explain WHY each role is relevant to THIS specific topic
- Default recommendation: count+2 roles for user to choose from
### Phase 3: Role-Specific Questions (Dynamic Generation)
### Phase 3: Role-Specific Questions
**Goal**: Generate deep questions mapping role expertise to Phase 1 challenges
**Algorithm**:
```
FOR each selected role:
1. Map Phase 1 challenges to role domain:
- "real-time sync" + system-architect → State management pattern
- "100 users" + system-architect → Communication protocol
- "low latency" + system-architect → Conflict resolution
1. FOR each selected role:
- Map Phase 1 challenges to role domain
- Generate 3-4 questions (implementation depth, trade-offs, edge cases)
- AskUserQuestion per role → Store to `session.role_decisions[role]`
2. Process roles sequentially (one at a time for clarity)
3. If role needs > 4 questions, split into multiple rounds
2. Generate 3-4 questions per role probing implementation depth, trade-offs, edge cases:
Q: "How handle real-time state sync for 100+ users?" (explores approach)
Q: "How resolve conflicts when 2 users edit simultaneously?" (explores edge case)
Options: [Event Sourcing/Centralized/CRDT] (concrete, explain trade-offs for THIS use case)
3. Output questions in text format per role:
- Display all questions for current role (3-4 questions, no 10-question limit)
- Questions in Chinese (用中文提问)
- Wait for user input
- Parse answers using intelligent parsing
- Store answers to session.role_decisions[role]
**Example** (system-architect):
```javascript
AskUserQuestion({
questions: [
{
question: "100+ 用户实时状态同步方案?",
header: "状态同步",
multiSelect: false,
options: [
{ label: "Event Sourcing", description: "完整事件历史,支持回溯,存储成本高" },
{ label: "集中式状态管理", description: "实现简单,单点瓶颈风险" },
{ label: "CRDT", description: "去中心化,自动合并,学习曲线陡" }
]
},
{
question: "两个用户同时编辑冲突如何解决?",
header: "冲突解决",
multiSelect: false,
options: [
{ label: "自动合并", description: "用户无感知,可能产生意外结果" },
{ label: "手动解决", description: "用户控制,增加交互复杂度" },
{ label: "版本控制", description: "保留历史,需要分支管理" }
]
}
]
})
```
**Batching Strategy**:
- Each role outputs all its questions at once (typically 3-4 questions)
- No need to split per role (within 10-question batch limit)
- Multiple roles processed sequentially (one role at a time for clarity)
### Phase 4: Conflict Resolution
**Output Format**: Follow standard format from "User Interaction Protocol" section (single-choice question format)
**Example Topic-Specific Questions** (system-architect role for "real-time collaboration platform"):
- "100+ 用户实时状态同步方案?" → Options: Event Sourcing / 集中式状态管理 / CRDT
- "两个用户同时编辑冲突如何解决?" → Options: 自动合并 / 手动解决 / 版本控制
- "低延迟通信协议选择?" → Options: WebSocket / SSE / 轮询
- "系统扩展性架构方案?" → Options: 微服务 / 单体+缓存 / Serverless
**Quality Requirements**: See "Question Generation Guidelines" section for detailed rules
### Phase 4: Cross-Role Clarification (Conflict Detection)
**Goal**: Resolve ACTUAL conflicts from Phase 3 answers, not pre-defined relationships
**Goal**: Resolve ACTUAL conflicts from Phase 3 answers
**Algorithm**:
```
1. Analyze Phase 3 answers for conflicts:
- Contradictory choices: product-manager "fast iteration" vs system-architect "complex Event Sourcing"
- Missing integration: ui-designer "Optimistic updates" but system-architect didn't address conflict handling
- Implicit dependencies: ui-designer "Live cursors" but no auth approach defined
2. FOR each detected conflict:
Generate clarification questions referencing SPECIFIC Phase 3 choices
3. Output clarification questions in text format:
- Batch conflicts into rounds (max 10 questions per round)
- Display questions with context from Phase 3 answers
- Questions in Chinese (用中文提问)
- Wait for user input
- Parse answers using intelligent parsing
- Store answers to session.cross_role_decisions
- Contradictory choices (e.g., "fast iteration" vs "complex Event Sourcing")
- Missing integration (e.g., "Optimistic updates" but no conflict handling)
- Implicit dependencies (e.g., "Live cursors" but no auth defined)
2. Generate clarification questions referencing SPECIFIC Phase 3 choices
3. AskUserQuestion (max 4 per call, multi-round) → Store to `session.cross_role_decisions`
4. If NO conflicts: Skip Phase 4 (inform user: "未检测到跨角色冲突跳过Phase 4")
**Example**:
```javascript
AskUserQuestion({
questions: [{
question: "CRDT 与 UI 回滚期望冲突,如何解决?\n背景system-architect选择CRDTui-designer期望回滚UI",
header: "架构冲突",
multiSelect: false,
options: [
{ label: "采用 CRDT", description: "保持去中心化调整UI期望" },
{ label: "显示合并界面", description: "增加用户交互,展示冲突详情" },
{ label: "切换到 OT", description: "支持回滚,增加服务器复杂度" }
]
}]
})
```
**Batching Strategy**:
- Maximum 10 clarification questions per round
- If conflicts > 10, split into multiple rounds
- Prioritize most critical conflicts first
### Phase 4.5: Final Clarification
**Output Format**: Follow standard format from "User Interaction Protocol" section (single-choice question format with background context)
**Example Conflict Detection** (from Phase 3 answers):
- **Architecture Conflict**: "CRDT 与 UI 回滚期望冲突,如何解决?"
- Background: system-architect chose CRDT, ui-designer expects rollback UI
- Options: 采用 CRDT / 显示合并界面 / 切换到 OT
- **Integration Gap**: "实时光标功能缺少身份认证方案"
- Background: ui-designer chose live cursors, no auth defined
- Options: OAuth 2.0 / JWT Token / Session-based
**Quality Requirements**: See "Question Generation Guidelines" section for conflict-specific rules
### Phase 5: Generate Guidance Specification
**Purpose**: Ensure no important points missed before generating specification
**Steps**:
1. Load all decisions: `intent_context` + `selected_roles` + `role_decisions` + `cross_role_decisions`
2. Transform Q&A pairs to declarative: Questions → Headers, Answers → CONFIRMED/SELECTED statements
3. Generate guidance-specification.md (template below) - **PRIMARY OUTPUT FILE**
4. Update workflow-session.json with **METADATA ONLY**:
- session_id (e.g., "WFS-topic-slug")
- selected_roles[] (array of role names, e.g., ["system-architect", "ui-designer", "product-manager"])
- topic (original user input string)
- timestamp (ISO-8601 format)
- phase_completed: "artifacts"
- count_parameter (number from --count flag)
5. Validate: No interrogative sentences in .md file, all decisions traceable, no content duplication in .json
1. Ask initial check:
```javascript
AskUserQuestion({
questions: [{
question: "在生成最终规范之前,是否有前面未澄清的重点需要补充?",
header: "补充确认",
multiSelect: false,
options: [
{ label: "无需补充", description: "前面的讨论已经足够完整" },
{ label: "需要补充", description: "还有重要内容需要澄清" }
]
}]
})
```
2. If "需要补充":
- Analyze user's additional points
- Generate progressive questions (not role-bound, interconnected)
- AskUserQuestion (max 4 per round) → Store to `session.additional_decisions`
- Repeat until user confirms completion
3. If "无需补充": Proceed to Phase 5
**⚠️ CRITICAL OUTPUT SEPARATION**:
- **guidance-specification.md**: Full guidance content (decisions, rationale, integration points)
- **workflow-session.json**: Session metadata ONLY (no guidance content, no decisions, no Q&A pairs)
- **NO content duplication**: Guidance stays in .md, metadata stays in .json
**Progressive Pattern**: Questions interconnected, each round informs next, continue until resolved.
## Output Document Template
### Phase 5: Generate Specification
**Steps**:
1. Load all decisions: `intent_context` + `selected_roles` + `role_decisions` + `cross_role_decisions` + `additional_decisions`
2. Transform Q&A to declarative: Questions → Headers, Answers → CONFIRMED/SELECTED statements
3. Generate `guidance-specification.md`
4. Update `workflow-session.json` (metadata only)
5. Validate: No interrogative sentences, all decisions traceable
---
## Question Guidelines
### Core Principle
**Target**: 开发者(理解技术但需要从用户需求出发)
**Question Structure**: `[业务场景/需求前提] + [技术关注点]`
**Option Structure**: `标签:[技术方案] + 说明:[业务影响] + [技术权衡]`
### Quality Rules
**MUST Include**:
- ✅ All questions in Chinese (用中文提问)
- ✅ 业务场景作为问题前提
- ✅ 技术选项的业务影响说明
- ✅ 量化指标和约束条件
**MUST Avoid**:
- ❌ 纯技术选型无业务上下文
- ❌ 过度抽象的用户体验问题
- ❌ 脱离话题的通用架构问题
### Phase-Specific Requirements
| Phase | Focus | Key Requirements |
|-------|-------|------------------|
| 1 | 意图理解 | Reference topic keywords, 用户场景、业务约束、优先级 |
| 2 | 角色推荐 | Intelligent analysis (NOT keyword mapping), explain relevance |
| 3 | 角色问题 | Reference Phase 1 keywords, concrete options with trade-offs |
| 4 | 冲突解决 | Reference SPECIFIC Phase 3 choices, explain impact on both roles |
---
## Output & Governance
### Output Template
**File**: `.workflow/active/WFS-{topic}/.brainstorming/guidance-specification.md`
@@ -478,9 +385,9 @@ FOR each selected role:
## Next Steps
**⚠️ Automatic Continuation** (when called from auto-parallel):
- auto-parallel will assign agents to generate role-specific analysis documents
- Each selected role gets dedicated conceptual-planning-agent
- Agents read this guidance-specification.md for framework context
- auto-parallel assigns agents for role-specific analysis
- Each selected role gets conceptual-planning-agent
- Agents read this guidance-specification.md for context
## Appendix: Decision Tracking
| Decision ID | Category | Question | Selected | Phase | Rationale |
@@ -490,95 +397,19 @@ FOR each selected role:
| D-003+ | [Role] | [Q] | [A] | 3 | [Why] |
```
## Question Generation Guidelines
### Core Principle: Developer-Facing Questions with User Context
**Target Audience**: 开发者(理解技术但需要从用户需求出发)
**Generation Philosophy**:
1. **Phase 1**: 用户场景、业务约束、优先级(建立上下文)
2. **Phase 2**: 基于话题分析的智能角色推荐(非关键词映射)
3. **Phase 3**: 业务需求 + 技术选型(需求驱动的技术决策)
4. **Phase 4**: 技术冲突的业务权衡(帮助开发者理解影响)
### Universal Quality Rules
**Question Structure** (all phases):
```
[业务场景/需求前提] + [技术关注点]
```
**Option Structure** (all phases):
```
标签:[技术方案简称] + (业务特征)
说明:[业务影响] + [技术权衡]
```
**MUST Include** (all phases):
- ✅ All questions in Chinese (用中文提问)
- ✅ 业务场景作为问题前提
- ✅ 技术选项的业务影响说明
- ✅ 量化指标和约束条件
**MUST Avoid** (all phases):
- ❌ 纯技术选型无业务上下文
- ❌ 过度抽象的用户体验问题
- ❌ 脱离话题的通用架构问题
### Phase-Specific Requirements
**Phase 1 Requirements**:
- Questions MUST reference topic keywords (NOT generic "Project type?")
- Focus: 用户使用场景(谁用?怎么用?多频繁?)、业务约束(预算、时间、团队、合规)
- Success metrics: 性能指标、用户体验目标
- Priority ranking: MVP vs 长期规划
**Phase 3 Requirements**:
- Questions MUST reference Phase 1 keywords (e.g., "real-time", "100 users")
- Options MUST be concrete approaches with relevance to topic
- Each option includes trade-offs specific to this use case
- Include 业务需求驱动的技术问题、量化指标(并发数、延迟、可用性)
**Phase 4 Requirements**:
- Questions MUST reference SPECIFIC Phase 3 choices in background context
- Options address the detected conflict directly
- Each option explains impact on both conflicting roles
- NEVER use static "Cross-Role Matrix" - ALWAYS analyze actual Phase 3 answers
- Focus: 技术冲突的业务权衡、帮助开发者理解不同选择的影响
## Validation Checklist
Generated guidance-specification.md MUST:
- ✅ No interrogative sentences (use CONFIRMED/SELECTED)
- ✅ Every decision traceable to user answer
- ✅ Cross-role conflicts resolved or documented
- ✅ Next steps concrete and specific
- ✅ All Phase 1-4 decisions in session metadata
## Update Mechanism
### File Structure
```
IF guidance-specification.md EXISTS:
Prompt: "Regenerate completely / Update sections / Cancel"
ELSE:
Run full Phase 1-5 flow
.workflow/active/WFS-[topic]/
├── workflow-session.json # Metadata ONLY
├── .process/
│ └── context-package.json # Phase 0 output
└── .brainstorming/
└── guidance-specification.md # Full guidance content
```
## Governance Rules
### Session Metadata
**Output Requirements**:
- All decisions MUST use CONFIRMED/SELECTED (NO "?" in decision sections)
- Every decision MUST trace to user answer
- Conflicts MUST be resolved (not marked "TBD")
- Next steps MUST be actionable
- Topic preserved as authoritative reference in session
**CRITICAL**: Guidance is single source of truth for downstream phases. Ambiguity violates governance.
## Storage Validation
**workflow-session.json** (metadata only):
```json
{
"session_id": "WFS-{topic-slug}",
@@ -591,14 +422,31 @@ ELSE:
}
```
**⚠️ Rule**: Session JSON stores ONLY metadata (session_id, selected_roles[], topic, timestamps). All guidance content goes to guidance-specification.md.
**⚠️ Rule**: Session JSON stores ONLY metadata. All guidance content goes to guidance-specification.md.
## File Structure
### Validation Checklist
- ✅ No interrogative sentences (use CONFIRMED/SELECTED)
- ✅ Every decision traceable to user answer
- ✅ Cross-role conflicts resolved or documented
- ✅ Next steps concrete and specific
- ✅ No content duplication between .json and .md
### Update Mechanism
```
.workflow/active/WFS-[topic]/
├── workflow-session.json # Session metadata ONLY
└── .brainstorming/
└── guidance-specification.md # Full guidance content
IF guidance-specification.md EXISTS:
Prompt: "Regenerate completely / Update sections / Cancel"
ELSE:
Run full Phase 0-5 flow
```
### Governance Rules
- All decisions MUST use CONFIRMED/SELECTED (NO "?" in decision sections)
- Every decision MUST trace to user answer
- Conflicts MUST be resolved (not marked "TBD")
- Next steps MUST be actionable
- Topic preserved as authoritative reference
**CRITICAL**: Guidance is single source of truth for downstream phases. Ambiguity violates governance.

View File

@@ -141,26 +141,10 @@ OUTPUT_LOCATION: .workflow/active/WFS-{session}/.brainstorming/{role}/
TOPIC: {user-provided-topic}
## Flow Control Steps
1. **load_topic_framework**
- Action: Load structured topic discussion framework
- Command: Read(.workflow/active/WFS-{session}/.brainstorming/guidance-specification.md)
- Output: topic_framework_content
2. **load_role_template**
- Action: Load {role-name} planning template
- Command: Read(~/.claude/workflows/cli-templates/planning-roles/{role}.md)
- Output: role_template_guidelines
3. **load_session_metadata**
- Action: Load session metadata and original user intent
- Command: Read(.workflow/active/WFS-{session}/workflow-session.json)
- Output: session_context (contains original user prompt as PRIMARY reference)
4. **load_style_skill** (ONLY for ui-designer role when style_skill_package exists)
- Action: Load style SKILL package for design system reference
- Command: Read(.claude/skills/style-{style_skill_package}/SKILL.md) AND Read(.workflow/reference_style/{style_skill_package}/design-tokens.json)
- Output: style_skill_content, design_tokens
- Usage: Apply design tokens in ui-designer analysis and artifacts
1. load_topic_framework → .workflow/active/WFS-{session}/.brainstorming/guidance-specification.md
2. load_role_template → ~/.claude/workflows/cli-templates/planning-roles/{role}.md
3. load_session_metadata → .workflow/active/WFS-{session}/workflow-session.json
4. load_style_skill (ui-designer only, if style_skill_package) → .claude/skills/style-{style_skill_package}/
## Analysis Requirements
**Primary Reference**: Original user prompt from workflow-session.json is authoritative
@@ -170,13 +154,9 @@ TOPIC: {user-provided-topic}
**Template Integration**: Apply role template guidelines within framework structure
## Expected Deliverables
1. **analysis.md**: Comprehensive {role-name} analysis addressing all framework discussion points
- **File Naming**: MUST start with `analysis` prefix (e.g., `analysis.md`, `analysis-1.md`, `analysis-2.md`)
- **FORBIDDEN**: Never use `recommendations.md` or any filename not starting with `analysis`
- **Auto-split if large**: If content >800 lines, split to `analysis-1.md`, `analysis-2.md` (max 3 files: analysis.md, analysis-1.md, analysis-2.md)
- **Content**: Includes both analysis AND recommendations sections within analysis files
2. **Framework Reference**: Include @../guidance-specification.md reference in analysis
3. **User Intent Alignment**: Validate analysis aligns with original user objectives from session_context
1. **analysis.md** (optionally with analysis-{slug}.md sub-documents)
2. **Framework Reference**: @../guidance-specification.md
3. **User Intent Alignment**: Validate against session_context
## Completion Criteria
- Address each discussion point from guidance-specification.md with {role-name} expertise
@@ -199,10 +179,10 @@ TOPIC: {user-provided-topic}
- guidance-specification.md path
**Validation**:
- Each role creates `.workflow/active/WFS-{topic}/.brainstorming/{role}/analysis.md` (primary file)
- If content is large (>800 lines), may split to `analysis-1.md`, `analysis-2.md` (max 3 files total)
- **File naming pattern**: ALL files MUST start with `analysis` prefix (use `analysis*.md` for globbing)
- **FORBIDDEN naming**: No `recommendations.md`, `recommendations-*.md`, or any non-`analysis` prefixed files
- Each role creates `.workflow/active/WFS-{topic}/.brainstorming/{role}/analysis.md`
- Optionally with `analysis-{slug}.md` sub-documents (max 5)
- **File pattern**: `analysis*.md` for globbing
- **FORBIDDEN**: `recommendations.md` or any non-`analysis` prefixed files
- All N role analyses completed
**TodoWrite Update (Phase 2 agents dispatched - tasks attached in parallel)**:
@@ -453,12 +433,9 @@ CONTEXT_VARS:
├── workflow-session.json # Session metadata ONLY
└── .brainstorming/
├── guidance-specification.md # Framework (Phase 1)
├── {role-1}/
── analysis.md # Role analysis (Phase 2)
├── {role-2}/
│ └── analysis.md
├── {role-N}/
│ └── analysis.md
├── {role}/
── analysis.md # Main document (with optional @references)
│ └── analysis-{slug}.md # Section documents (max 5)
└── synthesis-specification.md # Integration (Phase 3)
```

View File

@@ -2,325 +2,318 @@
name: synthesis
description: Clarify and refine role analyses through intelligent Q&A and targeted updates with synthesis agent
argument-hint: "[optional: --session session-id]"
allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*)
allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*), AskUserQuestion(*)
---
## Overview
Three-phase workflow to eliminate ambiguities and enhance conceptual depth in role analyses:
Six-phase workflow to eliminate ambiguities and enhance conceptual depth in role analyses:
**Phase 1-2 (Main Flow)**: Session detection → File discovery → Path preparation
**Phase 1-2**: Session detection → File discovery → Path preparation
**Phase 3A**: Cross-role analysis agent → Generate recommendations
**Phase 4**: User selects enhancements → User answers clarifications (via AskUserQuestion)
**Phase 5**: Parallel update agents (one per role)
**Phase 6**: Context package update → Metadata update → Completion report
**Phase 3A (Analysis Agent)**: Cross-role analysis → Generate recommendations
**Phase 4 (Main Flow)**: User selects enhancements → User answers clarifications → Build update plan
**Phase 5 (Parallel Update Agents)**: Each agent updates ONE role document → Parallel execution
**Phase 6 (Main Flow)**: Metadata update → Completion report
**Key Features**:
- Multi-agent architecture (analysis agent + parallel update agents)
- Clear separation: Agent analysis vs Main flow interaction
- Parallel document updates (one agent per role)
- User intent alignment validation
All user interactions use AskUserQuestion tool (max 4 questions per call, multi-round).
**Document Flow**:
- Input: `[role]/analysis*.md`, `guidance-specification.md`, session metadata
- Output: Updated `[role]/analysis*.md` with Enhancements + Clarifications sections
---
## Quick Reference
### Phase Summary
| Phase | Goal | Executor | Output |
|-------|------|----------|--------|
| 1 | Session detection | Main flow | session_id, brainstorm_dir |
| 2 | File discovery | Main flow | role_analysis_paths |
| 3A | Cross-role analysis | Agent | enhancement_recommendations |
| 4 | User interaction | Main flow + AskUserQuestion | update_plan |
| 5 | Document updates | Parallel agents | Updated analysis*.md |
| 6 | Finalization | Main flow | context-package.json, report |
### AskUserQuestion Pattern
```javascript
// Enhancement selection (multi-select)
AskUserQuestion({
questions: [{
question: "请选择要应用的改进建议",
header: "改进选择",
multiSelect: true,
options: [
{ label: "EP-001: API Contract", description: "添加详细的请求/响应 schema 定义" },
{ label: "EP-002: User Intent", description: "明确用户需求优先级和验收标准" }
]
}]
})
// Clarification questions (single-select, multi-round)
AskUserQuestion({
questions: [
{
question: "MVP 阶段的核心目标是什么?",
header: "用户意图",
multiSelect: false,
options: [
{ label: "快速验证", description: "最小功能集,快速上线获取反馈" },
{ label: "技术壁垒", description: "完善架构,为长期发展打基础" },
{ label: "功能完整", description: "覆盖所有规划功能,延迟上线" }
]
}
]
})
```
---
## Task Tracking
```json
[
{"content": "Detect session and validate analyses", "status": "in_progress", "activeForm": "Detecting session"},
{"content": "Detect session and validate analyses", "status": "pending", "activeForm": "Detecting session"},
{"content": "Discover role analysis file paths", "status": "pending", "activeForm": "Discovering paths"},
{"content": "Execute analysis agent (cross-role analysis)", "status": "pending", "activeForm": "Executing analysis agent"},
{"content": "Present enhancements for user selection", "status": "pending", "activeForm": "Presenting enhancements"},
{"content": "Generate and present clarification questions", "status": "pending", "activeForm": "Clarifying with user"},
{"content": "Build update plan from user input", "status": "pending", "activeForm": "Building update plan"},
{"content": "Execute parallel update agents (one per role)", "status": "pending", "activeForm": "Updating documents in parallel"},
{"content": "Update session metadata and generate report", "status": "pending", "activeForm": "Finalizing session"}
{"content": "Execute analysis agent (cross-role analysis)", "status": "pending", "activeForm": "Executing analysis"},
{"content": "Present enhancements via AskUserQuestion", "status": "pending", "activeForm": "Selecting enhancements"},
{"content": "Clarification questions via AskUserQuestion", "status": "pending", "activeForm": "Clarifying"},
{"content": "Execute parallel update agents", "status": "pending", "activeForm": "Updating documents"},
{"content": "Update context package and metadata", "status": "pending", "activeForm": "Finalizing"}
]
```
---
## Execution Phases
### Phase 1: Discovery & Validation
1. **Detect Session**: Use `--session` parameter or find `.workflow/active/WFS-*` directories
1. **Detect Session**: Use `--session` parameter or find `.workflow/active/WFS-*`
2. **Validate Files**:
- `guidance-specification.md` (optional, warn if missing)
- `*/analysis*.md` (required, error if empty)
3. **Load User Intent**: Extract from `workflow-session.json` (project/description field)
3. **Load User Intent**: Extract from `workflow-session.json`
### Phase 2: Role Discovery & Path Preparation
**Main flow prepares file paths for Agent**:
1. **Discover Analysis Files**:
- Glob(.workflow/active/WFS-{session}/.brainstorming/*/analysis*.md)
- Supports: analysis.md, analysis-1.md, analysis-2.md, analysis-3.md
- Validate: At least one file exists (error if empty)
- Glob: `.workflow/active/WFS-{session}/.brainstorming/*/analysis*.md`
- Supports: analysis.md + analysis-{slug}.md (max 5)
2. **Extract Role Information**:
- `role_analysis_paths`: Relative paths from brainstorm_dir
- `participating_roles`: Role names extracted from directory paths
- `role_analysis_paths`: Relative paths
- `participating_roles`: Role names from directories
3. **Pass to Agent** (Phase 3):
- `session_id`
- `brainstorm_dir`: .workflow/active/WFS-{session}/.brainstorming/
- `role_analysis_paths`: ["product-manager/analysis.md", "system-architect/analysis-1.md", ...]
- `participating_roles`: ["product-manager", "system-architect", ...]
**Main Flow Responsibility**: File discovery and path preparation only (NO file content reading)
3. **Pass to Agent**: session_id, brainstorm_dir, role_analysis_paths, participating_roles
### Phase 3A: Analysis & Enhancement Agent
**First agent call**: Cross-role analysis and generate enhancement recommendations
**Agent executes cross-role analysis**:
```bash
Task(conceptual-planning-agent): "
```javascript
Task(conceptual-planning-agent, `
## Agent Mission
Analyze role documents, identify conflicts/gaps, and generate enhancement recommendations
Analyze role documents, identify conflicts/gaps, generate enhancement recommendations
## Input from Main Flow
- brainstorm_dir: {brainstorm_dir}
- role_analysis_paths: {role_analysis_paths}
- participating_roles: {participating_roles}
## Input
- brainstorm_dir: ${brainstorm_dir}
- role_analysis_paths: ${role_analysis_paths}
- participating_roles: ${participating_roles}
## Execution Instructions
[FLOW_CONTROL]
## Flow Control Steps
1. load_session_metadata → Read workflow-session.json
2. load_role_analyses → Read all analysis files
3. cross_role_analysis → Identify consensus, conflicts, gaps, ambiguities
4. generate_recommendations → Format as EP-001, EP-002, ...
### Flow Control Steps
**AGENT RESPONSIBILITY**: Execute these analysis steps sequentially with context accumulation:
1. **load_session_metadata**
- Action: Load original user intent as primary reference
- Command: Read({brainstorm_dir}/../workflow-session.json)
- Output: original_user_intent (from project/description field)
2. **load_role_analyses**
- Action: Load all role analysis documents
- Command: For each path in role_analysis_paths: Read({brainstorm_dir}/{path})
- Output: role_analyses_content_map = {role_name: content}
3. **cross_role_analysis**
- Action: Identify consensus themes, conflicts, gaps, underspecified areas
- Output: consensus_themes, conflicting_views, gaps_list, ambiguities
4. **generate_recommendations**
- Action: Convert cross-role analysis findings into structured enhancement recommendations
- Format: EP-001, EP-002, ... (sequential numbering)
- Fields: id, title, affected_roles, category, current_state, enhancement, rationale, priority
- Taxonomy: Map to 9 categories (User Intent, Requirements, Architecture, UX, Feasibility, Risk, Process, Decisions, Terminology)
- Output: enhancement_recommendations (JSON array)
### Output to Main Flow
Return JSON array:
## Output Format
[
{
\"id\": \"EP-001\",
\"title\": \"API Contract Specification\",
\"affected_roles\": [\"system-architect\", \"api-designer\"],
\"category\": \"Architecture\",
\"current_state\": \"High-level API descriptions\",
\"enhancement\": \"Add detailed contract definitions with request/response schemas\",
\"rationale\": \"Enables precise implementation and testing\",
\"priority\": \"High\"
},
...
"id": "EP-001",
"title": "API Contract Specification",
"affected_roles": ["system-architect", "api-designer"],
"category": "Architecture",
"current_state": "High-level API descriptions",
"enhancement": "Add detailed contract definitions",
"rationale": "Enables precise implementation",
"priority": "High"
}
]
"
`)
```
### Phase 4: Main Flow User Interaction
### Phase 4: User Interaction
**Main flow handles all user interaction via text output**:
**All interactions via AskUserQuestion (Chinese questions)**
**⚠️ CRITICAL**: ALL questions MUST use Chinese (所有问题必须用中文) for better user understanding
#### Step 1: Enhancement Selection
1. **Present Enhancement Options** (multi-select):
```markdown
===== Enhancement 选择 =====
```javascript
// If enhancements > 4, split into multiple rounds
const enhancements = [...]; // from Phase 3A
const BATCH_SIZE = 4;
请选择要应用的改进建议(可多选):
for (let i = 0; i < enhancements.length; i += BATCH_SIZE) {
const batch = enhancements.slice(i, i + BATCH_SIZE);
a) EP-001: API Contract Specification
影响角色system-architect, api-designer
说明:添加详细的请求/响应 schema 定义
AskUserQuestion({
questions: [{
question: `请选择要应用的改进建议 (第${Math.floor(i/BATCH_SIZE)+1}轮)`,
header: "改进选择",
multiSelect: true,
options: batch.map(ep => ({
label: `${ep.id}: ${ep.title}`,
description: `影响: ${ep.affected_roles.join(', ')} | ${ep.enhancement}`
}))
}]
})
b) EP-002: User Intent Validation
影响角色product-manager, ux-expert
说明:明确用户需求优先级和验收标准
// Store selections before next round
}
c) EP-003: Error Handling Strategy
影响角色system-architect
说明:统一异常处理和降级方案
支持格式1abc 或 1a 1b 1c 或 1a,b,c
请输入选择(可跳过输入 skip
// User can also skip: provide "跳过" option
```
2. **Generate Clarification Questions** (based on analysis agent output):
-**ALL questions in Chinese (所有问题必须用中文)**
- Use 9-category taxonomy scan results
- Prioritize most critical questions (no hard limit)
- Each with 2-4 options + descriptions
#### Step 2: Clarification Questions
3. **Interactive Clarification Loop** (max 10 questions per round):
```markdown
===== Clarification 问题 (第 1/2 轮) =====
```javascript
// Generate questions based on 9-category taxonomy scan
// Categories: User Intent, Requirements, Architecture, UX, Feasibility, Risk, Process, Decisions, Terminology
【问题1 - 用户意图】MVP 阶段的核心目标是什么?
a) 快速验证市场需求
说明:最小功能集,快速上线获取反馈
b) 建立技术壁垒
说明:完善架构,为长期发展打基础
c) 实现功能完整性
说明:覆盖所有规划功能,延迟上线
const clarifications = [...]; // from analysis
const BATCH_SIZE = 4;
【问题2 - 架构决策】技术栈选择的优先考虑因素?
a) 团队熟悉度
说明:使用现有技术栈,降低学习成本
b) 技术先进性
说明:采用新技术,提升竞争力
c) 生态成熟度
说明:选择成熟方案,保证稳定性
for (let i = 0; i < clarifications.length; i += BATCH_SIZE) {
const batch = clarifications.slice(i, i + BATCH_SIZE);
const currentRound = Math.floor(i / BATCH_SIZE) + 1;
const totalRounds = Math.ceil(clarifications.length / BATCH_SIZE);
...最多10个问题
AskUserQuestion({
questions: batch.map(q => ({
question: q.question,
header: q.category.substring(0, 12),
multiSelect: false,
options: q.options.map(opt => ({
label: opt.label,
description: opt.description
}))
}))
})
请回答 (格式: 1a 2b 3c...)
// Store answers before next round
}
```
Wait for user input → Parse all answers in batch → Continue to next round if needed
### Question Guidelines
4. **Build Update Plan**:
```
**Target**: 开发者(理解技术但需要从用户需求出发)
**Question Structure**: `[跨角色分析发现] + [需要澄清的决策点]`
**Option Structure**: `标签:[具体方案] + 说明:[业务影响] + [技术权衡]`
**9-Category Taxonomy**:
| Category | Focus | Example Question Pattern |
|----------|-------|--------------------------|
| User Intent | 用户目标 | "MVP阶段核心目标" + 验证/壁垒/完整性 |
| Requirements | 需求细化 | "功能优先级如何排序?" + 核心/增强/可选 |
| Architecture | 架构决策 | "技术栈选择考量?" + 熟悉度/先进性/成熟度 |
| UX | 用户体验 | "交互复杂度取舍?" + 简洁/丰富/渐进 |
| Feasibility | 可行性 | "资源约束下的范围?" + 最小/标准/完整 |
| Risk | 风险管理 | "风险容忍度?" + 保守/平衡/激进 |
| Process | 流程规范 | "迭代节奏?" + 快速/稳定/灵活 |
| Decisions | 决策确认 | "冲突解决方案?" + 方案A/方案B/折中 |
| Terminology | 术语统一 | "统一使用哪个术语?" + 术语A/术语B |
**Quality Rules**:
**MUST Include**:
- ✅ All questions in Chinese (用中文提问)
- ✅ 基于跨角色分析的具体发现
- ✅ 选项包含业务影响说明
- ✅ 解决实际的模糊点或冲突
**MUST Avoid**:
- ❌ 与角色分析无关的通用问题
- ❌ 重复已在 artifacts 阶段确认的内容
- ❌ 过于细节的实现级问题
#### Step 3: Build Update Plan
```javascript
update_plan = {
"role1": {
"enhancements": [EP-001, EP-003],
"enhancements": ["EP-001", "EP-003"],
"clarifications": [
{"question": "...", "answer": "...", "category": "..."},
...
{"question": "...", "answer": "...", "category": "..."}
]
},
"role2": {
"enhancements": [EP-002],
"enhancements": ["EP-002"],
"clarifications": [...]
},
...
}
}
```
### Phase 5: Parallel Document Update Agents
**Parallel agent calls** (one per role needing updates):
**Execute in parallel** (one agent per role):
```bash
# Execute in parallel using single message with multiple Task calls
Task(conceptual-planning-agent): "
```javascript
// Single message with multiple Task calls for parallelism
Task(conceptual-planning-agent, `
## Agent Mission
Apply user-confirmed enhancements and clarifications to {role1} analysis document
Apply enhancements and clarifications to ${role} analysis
## Agent Intent
- **Goal**: Integrate synthesis results into role-specific analysis
- **Scope**: Update ONLY {role1}/analysis.md (isolated, no cross-role dependencies)
- **Constraints**: Preserve original insights, add refinements without deletion
## Input
- role: ${role}
- analysis_path: ${brainstorm_dir}/${role}/analysis.md
- enhancements: ${role_enhancements}
- clarifications: ${role_clarifications}
- original_user_intent: ${intent}
## Input from Main Flow
- role: {role1}
- analysis_path: {brainstorm_dir}/{role1}/analysis.md
- enhancements: [EP-001, EP-003] (user-selected improvements)
- clarifications: [{question, answer, category}, ...] (user-confirmed answers)
- original_user_intent: {from session metadata}
## Flow Control Steps
1. load_current_analysis → Read analysis file
2. add_clarifications_section → Insert Q&A section
3. apply_enhancements → Integrate into relevant sections
4. resolve_contradictions → Remove conflicts
5. enforce_terminology → Align terminology
6. validate_intent → Verify alignment with user intent
7. write_updated_file → Save changes
## Execution Instructions
[FLOW_CONTROL]
### Flow Control Steps
**AGENT RESPONSIBILITY**: Execute these update steps sequentially:
1. **load_current_analysis**
- Action: Load existing role analysis document
- Command: Read({brainstorm_dir}/{role1}/analysis.md)
- Output: current_analysis_content
2. **add_clarifications_section**
- Action: Insert Clarifications section with Q&A
- Format: \"## Clarifications\\n### Session {date}\\n- **Q**: {question} (Category: {category})\\n **A**: {answer}\"
- Output: analysis_with_clarifications
3. **apply_enhancements**
- Action: Integrate EP-001, EP-003 into relevant sections
- Strategy: Locate section by category (Architecture → Architecture section, UX → User Experience section)
- Output: analysis_with_enhancements
4. **resolve_contradictions**
- Action: Remove conflicts between original content and clarifications/enhancements
- Output: contradiction_free_analysis
5. **enforce_terminology_consistency**
- Action: Align all terminology with user-confirmed choices from clarifications
- Output: terminology_consistent_analysis
6. **validate_user_intent_alignment**
- Action: Verify all updates support original_user_intent
- Output: validated_analysis
7. **write_updated_file**
- Action: Save final analysis document
- Command: Write({brainstorm_dir}/{role1}/analysis.md, validated_analysis)
- Output: File update confirmation
### Output
Updated {role1}/analysis.md with Clarifications section + enhanced content
")
Task(conceptual-planning-agent): "
## Agent Mission
Apply user-confirmed enhancements and clarifications to {role2} analysis document
## Agent Intent
- **Goal**: Integrate synthesis results into role-specific analysis
- **Scope**: Update ONLY {role2}/analysis.md (isolated, no cross-role dependencies)
- **Constraints**: Preserve original insights, add refinements without deletion
## Input from Main Flow
- role: {role2}
- analysis_path: {brainstorm_dir}/{role2}/analysis.md
- enhancements: [EP-002] (user-selected improvements)
- clarifications: [{question, answer, category}, ...] (user-confirmed answers)
- original_user_intent: {from session metadata}
## Execution Instructions
[FLOW_CONTROL]
### Flow Control Steps
**AGENT RESPONSIBILITY**: Execute same 7 update steps as {role1} agent (load → clarifications → enhancements → contradictions → terminology → validation → write)
### Output
Updated {role2}/analysis.md with Clarifications section + enhanced content
")
# ... repeat for each role in update_plan
## Output
Updated ${role}/analysis.md
`)
```
**Agent Characteristics**:
- **Intent**: Integrate user-confirmed synthesis results (NOT generate new analysis)
- **Isolation**: Each agent updates exactly ONE role (parallel execution safe)
- **Context**: Minimal - receives only role-specific enhancements + clarifications
- **Dependencies**: Zero cross-agent dependencies (full parallelism)
- **Isolation**: Each agent updates exactly ONE role (parallel safe)
- **Dependencies**: Zero cross-agent dependencies
- **Validation**: All updates must align with original_user_intent
### Phase 6: Completion & Metadata Update
### Phase 6: Finalization
**Main flow finalizes**:
#### Step 1: Update Context Package
```javascript
// Sync updated analyses to context-package.json
const context_pkg = Read(".workflow/active/WFS-{session}/.process/context-package.json")
// Update guidance-specification if exists
// Update synthesis-specification if exists
// Re-read all role analysis files
// Update metadata timestamps
Write(context_pkg_path, JSON.stringify(context_pkg))
```
#### Step 2: Update Session Metadata
1. Wait for all parallel agents to complete
2. Update workflow-session.json:
```json
{
"phases": {
@@ -330,15 +323,13 @@ Updated {role2}/analysis.md with Clarifications section + enhanced content
"completed_at": "timestamp",
"participating_roles": [...],
"clarification_results": {
"enhancements_applied": ["EP-001", "EP-002", ...],
"enhancements_applied": ["EP-001", "EP-002"],
"questions_asked": 3,
"categories_clarified": ["Architecture", "UX", ...],
"roles_updated": ["role1", "role2", ...],
"outstanding_items": []
"categories_clarified": ["Architecture", "UX"],
"roles_updated": ["role1", "role2"]
},
"quality_metrics": {
"user_intent_alignment": "validated",
"requirement_coverage": "comprehensive",
"ambiguity_resolution": "complete",
"terminology_consistency": "enforced"
}
@@ -347,7 +338,8 @@ Updated {role2}/analysis.md with Clarifications section + enhanced content
}
```
3. Generate completion report (show to user):
#### Step 3: Completion Report
```markdown
## ✅ Clarification Complete
@@ -359,9 +351,11 @@ Updated {role2}/analysis.md with Clarifications section + enhanced content
✅ PROCEED: `/workflow:plan --session WFS-{session-id}`
```
---
## Output
**Location**: `.workflow/active/WFS-{session}/.brainstorming/[role]/analysis*.md` (in-place updates)
**Location**: `.workflow/active/WFS-{session}/.brainstorming/[role]/analysis*.md`
**Updated Structure**:
```markdown
@@ -381,116 +375,24 @@ Updated {role2}/analysis.md with Clarifications section + enhanced content
- Ambiguities resolved, placeholders removed
- Consistent terminology
### Phase 6: Update Context Package
**Purpose**: Sync updated role analyses to context-package.json to avoid stale cache
**Operations**:
```bash
context_pkg_path = ".workflow/active/WFS-{session}/.process/context-package.json"
# 1. Read existing package
context_pkg = Read(context_pkg_path)
# 2. Re-read brainstorm artifacts (now with synthesis enhancements)
brainstorm_dir = ".workflow/active/WFS-{session}/.brainstorming"
# 2.1 Update guidance-specification if exists
IF exists({brainstorm_dir}/guidance-specification.md):
context_pkg.brainstorm_artifacts.guidance_specification.content = Read({brainstorm_dir}/guidance-specification.md)
context_pkg.brainstorm_artifacts.guidance_specification.updated_at = NOW()
# 2.2 Update synthesis-specification if exists
IF exists({brainstorm_dir}/synthesis-specification.md):
IF context_pkg.brainstorm_artifacts.synthesis_output:
context_pkg.brainstorm_artifacts.synthesis_output.content = Read({brainstorm_dir}/synthesis-specification.md)
context_pkg.brainstorm_artifacts.synthesis_output.updated_at = NOW()
# 2.3 Re-read all role analysis files
role_analysis_files = Glob({brainstorm_dir}/*/analysis*.md)
context_pkg.brainstorm_artifacts.role_analyses = []
FOR file IN role_analysis_files:
role_name = extract_role_from_path(file) # e.g., "ui-designer"
relative_path = file.replace({brainstorm_dir}/, "")
context_pkg.brainstorm_artifacts.role_analyses.push({
"role": role_name,
"files": [{
"path": relative_path,
"type": "primary",
"content": Read(file),
"updated_at": NOW()
}]
})
# 3. Update metadata
context_pkg.metadata.updated_at = NOW()
context_pkg.metadata.synthesis_timestamp = NOW()
# 4. Write back
Write(context_pkg_path, JSON.stringify(context_pkg, indent=2))
REPORT: "✅ Updated context-package.json with synthesis results"
```
**TodoWrite Update**:
```json
{"content": "Update context package with synthesis results", "status": "completed", "activeForm": "Updating context package"}
```
## Session Metadata
Update `workflow-session.json`:
```json
{
"phases": {
"BRAINSTORM": {
"status": "clarification_completed",
"clarification_completed": true,
"completed_at": "timestamp",
"participating_roles": ["product-manager", "system-architect", ...],
"clarification_results": {
"questions_asked": 3,
"categories_clarified": ["Architecture & Design", ...],
"roles_updated": ["system-architect", "ui-designer", ...],
"outstanding_items": []
},
"quality_metrics": {
"user_intent_alignment": "validated",
"requirement_coverage": "comprehensive",
"ambiguity_resolution": "complete",
"terminology_consistency": "enforced",
"decision_transparency": "documented"
}
}
}
}
```
---
## Quality Checklist
**Content**:
- All role analyses loaded/analyzed
- Cross-role analysis (consensus, conflicts, gaps)
- 9-category ambiguity scan
- Questions prioritized
- Clarifications documented
- All role analyses loaded/analyzed
- Cross-role analysis (consensus, conflicts, gaps)
- 9-category ambiguity scan
- Questions prioritized
**Analysis**:
- User intent validated
- Cross-role synthesis complete
- Ambiguities resolved
- Correct roles updated
- Terminology consistent
- Contradictions removed
- User intent validated
- Cross-role synthesis complete
- Ambiguities resolved
- ✅ Terminology consistent
**Documents**:
- Clarifications section formatted
- Sections reflect answers
- No placeholders (TODO/TBD)
- Valid Markdown
- Cross-references maintained
- Clarifications section formatted
- Sections reflect answers
- No placeholders (TODO/TBD)
- Valid Markdown

View File

@@ -92,7 +92,7 @@ Analyze project for workflow initialization and generate .workflow/project.json.
## MANDATORY FIRST STEPS
1. Execute: cat ~/.claude/workflows/cli-templates/schemas/project-json-schema.json (get schema reference)
2. Execute: ~/.claude/scripts/get_modules_by_depth.sh (get project structure)
2. Execute: ccw tool exec get_modules_by_depth '{}' (get project structure)
## Task
Generate complete project.json with:
@@ -122,7 +122,7 @@ Generate complete project.json with:
1. Structural scan: get_modules_by_depth.sh, find, wc -l
2. Semantic analysis: Gemini for patterns/architecture
3. Synthesis: Merge findings
4. ${regenerate ? 'Merge with preserved features/statistics from .workflow/project.json.backup' : ''}
4. ${regenerate ? 'Merge with preserved features/development_index/statistics from .workflow/project.json.backup' : ''}
5. Write JSON: Write('.workflow/project.json', jsonContent)
6. Report: Return brief completion summary

View File

@@ -556,6 +556,58 @@ codex --full-auto exec "[Verify plan acceptance criteria at ${plan.json}]" --ski
- `@{plan.json}``@${executionContext.session.artifacts.plan}`
- `[@{exploration.json}]` → exploration files from artifacts (if exists)
### Step 6: Update Development Index
**Trigger**: After all executions complete (regardless of code review)
**Skip Condition**: Skip if `.workflow/project.json` does not exist
**Operations**:
```javascript
const projectJsonPath = '.workflow/project.json'
if (!fileExists(projectJsonPath)) return // Silent skip
const projectJson = JSON.parse(Read(projectJsonPath))
// Initialize if needed
if (!projectJson.development_index) {
projectJson.development_index = { feature: [], enhancement: [], bugfix: [], refactor: [], docs: [] }
}
// Detect category from keywords
function detectCategory(text) {
text = text.toLowerCase()
if (/\b(fix|bug|error|issue|crash)\b/.test(text)) return 'bugfix'
if (/\b(refactor|cleanup|reorganize)\b/.test(text)) return 'refactor'
if (/\b(doc|readme|comment)\b/.test(text)) return 'docs'
if (/\b(add|new|create|implement)\b/.test(text)) return 'feature'
return 'enhancement'
}
// Detect sub_feature from task file paths
function detectSubFeature(tasks) {
const dirs = tasks.map(t => t.file?.split('/').slice(-2, -1)[0]).filter(Boolean)
const counts = dirs.reduce((a, d) => { a[d] = (a[d] || 0) + 1; return a }, {})
return Object.entries(counts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'general'
}
const category = detectCategory(`${planObject.summary} ${planObject.approach}`)
const entry = {
title: planObject.summary.slice(0, 60),
sub_feature: detectSubFeature(planObject.tasks),
date: new Date().toISOString().split('T')[0],
description: planObject.approach.slice(0, 100),
status: previousExecutionResults.every(r => r.status === 'completed') ? 'completed' : 'partial',
session_id: executionContext?.session?.id || null
}
projectJson.development_index[category].push(entry)
projectJson.statistics.last_updated = new Date().toISOString()
Write(projectJsonPath, JSON.stringify(projectJson, null, 2))
console.log(`✓ Development index: [${category}] ${entry.title}`)
```
## Best Practices
**Input Modes**: In-memory (lite-plan), prompt (standalone), file (JSON/text)

View File

@@ -43,11 +43,11 @@ Phase 1: Bug Analysis & Diagnosis
|- needsDiagnosis=true -> Launch parallel cli-explore-agents (1-4 based on severity)
+- needsDiagnosis=false (hotfix) -> Skip directly to Phase 3 (Fix Planning)
Phase 2: Clarification (optional)
Phase 2: Clarification (optional, multi-round)
|- Aggregate clarification_needs from all diagnosis angles
|- Deduplicate similar questions
+- Decision:
|- Has clarifications -> AskUserQuestion (max 4 questions)
|- Has clarifications -> AskUserQuestion (max 4 questions per round, multiple rounds allowed)
+- No clarifications -> Skip to Phase 3
Phase 3: Fix Planning (NO CODE EXECUTION - planning only)
@@ -71,18 +71,18 @@ Phase 5: Dispatch
### Phase 1: Intelligent Multi-Angle Diagnosis
**Session Setup**:
**Session Setup** (MANDATORY - follow exactly):
```javascript
// Helper: Get UTC+8 (China Standard Time) ISO string
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
const bugSlug = bug_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
const timestamp = getUtc8ISOString().replace(/[:.]/g, '-')
const shortTimestamp = timestamp.substring(0, 19).replace('T', '-')
const sessionId = `${bugSlug}-${shortTimestamp}`
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-11-29
const sessionId = `${bugSlug}-${dateStr}` // e.g., "user-avatar-upload-fails-2025-11-29"
const sessionFolder = `.workflow/.lite-fix/${sessionId}`
bash(`mkdir -p ${sessionFolder}`)
bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${sessionFolder}" || echo "FAILED: ${sessionFolder}"`)
```
**Diagnosis Decision Logic**:
@@ -177,7 +177,7 @@ Execute **${angle}** diagnosis for bug root cause analysis. Analyze codebase fro
## MANDATORY FIRST STEPS (Execute by Agent)
**You (cli-explore-agent) MUST execute these steps in order:**
1. Run: ~/.claude/scripts/get_modules_by_depth.sh (project structure)
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
2. Run: rg -l "{error_keyword_from_bug}" --type ts (locate relevant files)
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/diagnosis-json-schema.json (get output schema reference)
@@ -216,7 +216,7 @@ Execute **${angle}** diagnosis for bug root cause analysis. Analyze codebase fro
- fix_hints: Suggested fix approaches from ${angle} viewpoint
- dependencies: Dependencies relevant to ${angle} diagnosis
- constraints: ${angle}-specific limitations affecting fix
- clarification_needs: ${angle}-related ambiguities (with options array)
- clarification_needs: ${angle}-related ambiguities (options array + recommended index)
- _metadata.diagnosis_angle: "${angle}"
- _metadata.diagnosis_index: ${index + 1}
@@ -228,7 +228,7 @@ Execute **${angle}** diagnosis for bug root cause analysis. Analyze codebase fro
- [ ] Fix hints are actionable (specific code changes, not generic advice)
- [ ] Reproduction steps are verifiable
- [ ] JSON output follows schema exactly
- [ ] clarification_needs includes options array
- [ ] clarification_needs includes options + recommended
## Output
Write: ${sessionFolder}/diagnosis-${angle}.json
@@ -287,10 +287,12 @@ Angles diagnosed: ${diagnosisManifest.diagnoses.map(d => d.angle).join(', ')}
---
### Phase 2: Clarification (Optional)
### Phase 2: Clarification (Optional, Multi-Round)
**Skip if**: No diagnosis or `clarification_needs` is empty across all diagnoses
**⚠️ CRITICAL**: AskUserQuestion tool limits max 4 questions per call. **MUST execute multiple rounds** to exhaust all clarification needs - do NOT stop at round 1.
**Aggregate clarification needs from all diagnosis angles**:
```javascript
// Load manifest and all diagnosis files
@@ -327,18 +329,35 @@ function deduplicateClarifications(clarifications) {
const uniqueClarifications = deduplicateClarifications(allClarifications)
// Multi-round clarification: batch questions (max 4 per round)
// ⚠️ MUST execute ALL rounds until uniqueClarifications exhausted
if (uniqueClarifications.length > 0) {
AskUserQuestion({
questions: uniqueClarifications.map(need => ({
question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
header: need.source_angle,
multiSelect: false,
options: need.options.map(opt => ({
label: opt,
description: `Use ${opt} approach`
const BATCH_SIZE = 4
const totalRounds = Math.ceil(uniqueClarifications.length / BATCH_SIZE)
for (let i = 0; i < uniqueClarifications.length; i += BATCH_SIZE) {
const batch = uniqueClarifications.slice(i, i + BATCH_SIZE)
const currentRound = Math.floor(i / BATCH_SIZE) + 1
console.log(`### Clarification Round ${currentRound}/${totalRounds}`)
AskUserQuestion({
questions: batch.map(need => ({
question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
header: need.source_angle,
multiSelect: false,
options: need.options.map((opt, index) => {
const isRecommended = need.recommended === index
return {
label: isRecommended ? `${opt}` : opt,
description: isRecommended ? `Use ${opt} approach (Recommended)` : `Use ${opt} approach`
}
})
}))
}))
})
})
// Store batch responses in clarificationContext before next round
}
}
```
@@ -568,7 +587,7 @@ SlashCommand(command="/workflow:lite-execute --in-memory --mode bugfix")
## Session Folder Structure
```
.workflow/.lite-fix/{bug-slug}-{timestamp}/
.workflow/.lite-fix/{bug-slug}-{YYYY-MM-DD}/
|- diagnosis-{angle1}.json # Diagnosis angle 1
|- diagnosis-{angle2}.json # Diagnosis angle 2
|- diagnosis-{angle3}.json # Diagnosis angle 3 (if applicable)

View File

@@ -43,11 +43,11 @@ Phase 1: Task Analysis & Exploration
├─ needsExploration=true → Launch parallel cli-explore-agents (1-4 based on complexity)
└─ needsExploration=false → Skip to Phase 2/3
Phase 2: Clarification (optional)
Phase 2: Clarification (optional, multi-round)
├─ Aggregate clarification_needs from all exploration angles
├─ Deduplicate similar questions
└─ Decision:
├─ Has clarifications → AskUserQuestion (max 4 questions)
├─ Has clarifications → AskUserQuestion (max 4 questions per round, multiple rounds allowed)
└─ No clarifications → Skip to Phase 3
Phase 3: Planning (NO CODE EXECUTION - planning only)
@@ -71,18 +71,18 @@ Phase 5: Dispatch
### Phase 1: Intelligent Multi-Angle Exploration
**Session Setup**:
**Session Setup** (MANDATORY - follow exactly):
```javascript
// Helper: Get UTC+8 (China Standard Time) ISO string
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
const timestamp = getUtc8ISOString().replace(/[:.]/g, '-')
const shortTimestamp = timestamp.substring(0, 19).replace('T', '-')
const sessionId = `${taskSlug}-${shortTimestamp}`
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-11-29
const sessionId = `${taskSlug}-${dateStr}` // e.g., "implement-jwt-refresh-2025-11-29"
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
bash(`mkdir -p ${sessionFolder}`)
bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${sessionFolder}" || echo "FAILED: ${sessionFolder}"`)
```
**Exploration Decision Logic**:
@@ -170,7 +170,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
## MANDATORY FIRST STEPS (Execute by Agent)
**You (cli-explore-agent) MUST execute these steps in order:**
1. Run: ~/.claude/scripts/get_modules_by_depth.sh (project structure)
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
2. Run: rg -l "{keyword_from_task}" --type ts (locate relevant files)
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/explore-json-schema.json (get output schema reference)
@@ -206,7 +206,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
- dependencies: Dependencies relevant to ${angle}
- integration_points: Where to integrate from ${angle} viewpoint (include file:line locations)
- constraints: ${angle}-specific limitations/conventions
- clarification_needs: ${angle}-related ambiguities (with options array)
- clarification_needs: ${angle}-related ambiguities (options array + recommended index)
- _metadata.exploration_angle: "${angle}"
## Success Criteria
@@ -217,7 +217,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
- [ ] Integration points include file:line locations
- [ ] Constraints are project-specific to ${angle}
- [ ] JSON output follows schema exactly
- [ ] clarification_needs includes options array
- [ ] clarification_needs includes options + recommended
## Output
Write: ${sessionFolder}/exploration-${angle}.json
@@ -276,10 +276,12 @@ Angles explored: ${explorationManifest.explorations.map(e => e.angle).join(', ')
---
### Phase 2: Clarification (Optional)
### Phase 2: Clarification (Optional, Multi-Round)
**Skip if**: No exploration or `clarification_needs` is empty across all explorations
**⚠️ CRITICAL**: AskUserQuestion tool limits max 4 questions per call. **MUST execute multiple rounds** to exhaust all clarification needs - do NOT stop at round 1.
**Aggregate clarification needs from all exploration angles**:
```javascript
// Load manifest and all exploration files
@@ -302,32 +304,40 @@ explorations.forEach(exp => {
}
})
// Deduplicate by question similarity
function deduplicateClarifications(clarifications) {
const unique = []
clarifications.forEach(c => {
const isDuplicate = unique.some(u =>
u.question.toLowerCase() === c.question.toLowerCase()
)
if (!isDuplicate) unique.push(c)
})
return unique
}
// Deduplicate exact same questions only
const seen = new Set()
const dedupedClarifications = allClarifications.filter(c => {
const key = c.question.toLowerCase()
if (seen.has(key)) return false
seen.add(key)
return true
})
const uniqueClarifications = deduplicateClarifications(allClarifications)
// Multi-round clarification: batch questions (max 4 per round)
if (dedupedClarifications.length > 0) {
const BATCH_SIZE = 4
const totalRounds = Math.ceil(dedupedClarifications.length / BATCH_SIZE)
if (uniqueClarifications.length > 0) {
AskUserQuestion({
questions: uniqueClarifications.map(need => ({
question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
header: need.source_angle,
multiSelect: false,
options: need.options.map(opt => ({
label: opt,
description: `Use ${opt} approach`
for (let i = 0; i < dedupedClarifications.length; i += BATCH_SIZE) {
const batch = dedupedClarifications.slice(i, i + BATCH_SIZE)
const currentRound = Math.floor(i / BATCH_SIZE) + 1
console.log(`### Clarification Round ${currentRound}/${totalRounds}`)
AskUserQuestion({
questions: batch.map(need => ({
question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
header: need.source_angle.substring(0, 12),
multiSelect: false,
options: need.options.map((opt, index) => ({
label: need.recommended === index ? `${opt}` : opt,
description: need.recommended === index ? `Recommended` : `Use ${opt}`
}))
}))
}))
})
})
// Store batch responses in clarificationContext before next round
}
}
```
@@ -552,7 +562,7 @@ SlashCommand(command="/workflow:lite-execute --in-memory")
## Session Folder Structure
```
.workflow/.lite-plan/{task-slug}-{timestamp}/
.workflow/.lite-plan/{task-slug}-{YYYY-MM-DD}/
├── exploration-{angle1}.json # Exploration angle 1
├── exploration-{angle2}.json # Exploration angle 2
├── exploration-{angle3}.json # Exploration angle 3 (if applicable)

View File

@@ -46,8 +46,7 @@ Automated fix orchestrator with **two-phase architecture**: AI-powered planning
1. **Intelligent Planning**: AI-powered analysis identifies optimal grouping and execution strategy
2. **Multi-stage Coordination**: Supports complex parallel + serial execution with dependency management
3. **Conservative Safety**: Mandatory test verification with automatic rollback on failure
4. **Real-time Visibility**: Dashboard shows planning progress, stage timeline, and active agents
5. **Resume Support**: Checkpoint-based recovery for interrupted sessions
4. **Resume Support**: Checkpoint-based recovery for interrupted sessions
### Orchestrator Boundary (CRITICAL)
- **ONLY command** for automated review finding fixes
@@ -59,14 +58,14 @@ Automated fix orchestrator with **two-phase architecture**: AI-powered planning
```
Phase 1: Discovery & Initialization
└─ Validate export file, create fix session structure, initialize state files → Generate fix-dashboard.html
└─ Validate export file, create fix session structure, initialize state files
Phase 2: Planning Coordination (@cli-planning-agent)
├─ Analyze findings for patterns and dependencies
├─ Group by file + dimension + root cause similarity
├─ Determine execution strategy (parallel/serial/hybrid)
├─ Generate fix timeline with stages
└─ Output: fix-plan.json (dashboard auto-polls for status)
└─ Output: fix-plan.json
Phase 3: Execution Orchestration (Stage-based)
For each timeline stage:
@@ -198,12 +197,10 @@ if (result.passRate < 100%) {
- Session creation: Generate fix-session-id (`fix-{timestamp}`)
- Directory structure: Create `{review-dir}/fixes/{fix-session-id}/` with subdirectories
- State files: Initialize active-fix-session.json (session marker)
- Dashboard generation: Create fix-dashboard.html from template (see Dashboard Generation below)
- TodoWrite initialization: Set up 4-phase tracking
**Phase 2: Planning Coordination**
- Launch @cli-planning-agent with findings data and project context
- Monitor planning progress (dashboard shows "Planning fixes..." indicator)
- Validate fix-plan.json output (schema conformance, includes metadata with session status)
- Load plan into memory for execution phase
- TodoWrite update: Mark planning complete, start execution
@@ -216,7 +213,6 @@ if (result.passRate < 100%) {
- Assign agent IDs (agents update their fix-progress-{N}.json)
- Handle agent failures gracefully (mark group as failed, continue)
- Advance to next stage only when current stage complete
- Dashboard polls and aggregates fix-progress-{N}.json files for display
**Phase 4: Completion & Aggregation**
- Collect final status from all fix-progress-{N}.json files
@@ -224,7 +220,7 @@ if (result.passRate < 100%) {
- Update fix-history.json with new session entry
- Remove active-fix-session.json
- TodoWrite completion: Mark all phases done
- Output summary to user with dashboard link
- Output summary to user
**Phase 5: Session Completion (Optional)**
- If all findings fixed successfully (no failures):
@@ -234,53 +230,12 @@ if (result.passRate < 100%) {
- Output: "Some findings failed. Review fix-summary.md before completing session."
- Do NOT auto-complete session
### Dashboard Generation
**MANDATORY**: Dashboard MUST be generated from template during Phase 1 initialization
**Template Location**: `~/.claude/templates/fix-dashboard.html`
**⚠️ POST-GENERATION**: Orchestrator and agents MUST NOT read/write/modify fix-dashboard.html after creation
**Generation Steps**:
```bash
# 1. Copy template to fix session directory
cp ~/.claude/templates/fix-dashboard.html ${sessionDir}/fixes/${fixSessionId}/fix-dashboard.html
# 2. Replace SESSION_ID placeholder
sed -i "s|{{SESSION_ID}}|${sessionId}|g" ${sessionDir}/fixes/${fixSessionId}/fix-dashboard.html
# 3. Replace REVIEW_DIR placeholder
sed -i "s|{{REVIEW_DIR}}|${reviewDir}|g" ${sessionDir}/fixes/${fixSessionId}/fix-dashboard.html
# 4. Start local server and output dashboard URL
cd ${sessionDir}/fixes/${fixSessionId} && python -m http.server 8766 --bind 127.0.0.1 &
echo "🔧 Fix Dashboard: http://127.0.0.1:8766/fix-dashboard.html"
echo " (Press Ctrl+C to stop server when done)"
```
**Dashboard Features**:
- Real-time progress tracking via JSON polling (3-second interval)
- Stage timeline visualization with parallel/serial execution modes
- Active groups and agents monitoring
- Flow control steps tracking for each agent
- Fix history drawer with session summaries
- Consumes new JSON structure (fix-plan.json with metadata + fix-progress-{N}.json)
**JSON Consumption**:
- `fix-plan.json`: Reads metadata field for session info, timeline stages, groups configuration
- `fix-progress-{N}.json`: Polls all progress files to aggregate real-time status
- `active-fix-session.json`: Detects active session on load
- `fix-history.json`: Loads historical fix sessions
### Output File Structure
```
.workflow/active/WFS-{session-id}/.review/
├── fix-export-{timestamp}.json # Exported findings (input)
└── fixes/{fix-session-id}/
├── fix-dashboard.html # Interactive dashboard (generated once, auto-polls JSON)
├── fix-plan.json # Planning agent output (execution plan with metadata)
├── fix-progress-1.json # Group 1 progress (planning agent init → agent updates)
├── fix-progress-2.json # Group 2 progress (planning agent init → agent updates)
@@ -291,10 +246,8 @@ echo " (Press Ctrl+C to stop server when done)"
```
**File Producers**:
- **Orchestrator**: `fix-dashboard.html` (generated once from template during Phase 1)
- **Planning Agent**: `fix-plan.json` (with metadata), all `fix-progress-*.json` (initial state)
- **Execution Agents**: Update assigned `fix-progress-{N}.json` in real-time
- **Dashboard (Browser)**: Reads `fix-plan.json` + all `fix-progress-*.json`, aggregates in-memory every 3 seconds via JavaScript polling
### Agent Invocation Template
@@ -347,7 +300,7 @@ For each group (G1, G2, G3, ...), generate fix-progress-{N}.json following templ
- Flow control: Empty implementation_approach array
- Errors: Empty array
**CRITICAL**: Ensure complete template structure for Dashboard consumption - all fields must be present.
**CRITICAL**: Ensure complete template structure - all fields must be present.
## Analysis Requirements
@@ -419,7 +372,7 @@ Task({
description: `Fix ${group.findings.length} issues: ${group.group_name}`,
prompt: `
## Task Objective
Execute fixes for code review findings in group ${group.group_id}. Update progress file in real-time with flow control tracking for dashboard visibility.
Execute fixes for code review findings in group ${group.group_id}. Update progress file in real-time with flow control tracking.
## Assignment
- Group ID: ${group.group_id}
@@ -549,7 +502,6 @@ When all findings processed:
### Progress File Updates
- **MUST update after every significant action** (before/after each step)
- **Dashboard polls every 3 seconds** - ensure writes are atomic
- **Always maintain complete structure** - never write partial updates
- **Use ISO 8601 timestamps** - e.g., "2025-01-25T14:36:00Z"
@@ -638,9 +590,17 @@ TodoWrite({
1. **Trust AI Planning**: Planning agent's grouping and execution strategy are based on dependency analysis
2. **Conservative Approach**: Test verification is mandatory - no fixes kept without passing tests
3. **Parallel Efficiency**: Default 3 concurrent agents balances speed and resource usage
4. **Monitor Dashboard**: Real-time stage timeline and agent status provide execution visibility
5. **Resume Support**: Fix sessions can resume from checkpoints after interruption
6. **Manual Review**: Always review failed fixes manually - may require architectural changes
7. **Incremental Fixing**: Start with small batches (5-10 findings) before large-scale fixes
4. **Resume Support**: Fix sessions can resume from checkpoints after interruption
5. **Manual Review**: Always review failed fixes manually - may require architectural changes
6. **Incremental Fixing**: Start with small batches (5-10 findings) before large-scale fixes
## Related Commands
### View Fix Progress
Use `ccw view` to open the workflow dashboard in browser:
```bash
ccw view
```

View File

@@ -51,14 +51,12 @@ Independent multi-dimensional code review orchestrator with **hybrid parallel-it
2. **Session-Integrated**: Review results tracked within workflow session for unified management
3. **Comprehensive Coverage**: Same 7 specialized dimensions as session review
4. **Intelligent Prioritization**: Automatic identification of critical issues and cross-cutting concerns
5. **Real-time Visibility**: JSON-based progress tracking with interactive HTML dashboard
6. **Unified Archive**: Review results archived with session for historical reference
5. **Unified Archive**: Review results archived with session for historical reference
### Orchestrator Boundary (CRITICAL)
- **ONLY command** for independent multi-dimensional module review
- Manages: dimension coordination, aggregation, iteration control, progress tracking
- Delegates: Code exploration and analysis to @cli-explore-agent, dimension-specific reviews via Deep Scan mode
- **⚠️ DASHBOARD CONSTRAINT**: Dashboard is generated ONCE during Phase 1 initialization. After initialization, orchestrator and agents MUST NOT read, write, or modify dashboard.html - it remains static for user interaction only.
## How It Works
@@ -66,7 +64,7 @@ Independent multi-dimensional code review orchestrator with **hybrid parallel-it
```
Phase 1: Discovery & Initialization
└─ Resolve file patterns, validate paths, initialize state, create output structure → Generate dashboard.html
└─ Resolve file patterns, validate paths, initialize state, create output structure
Phase 2: Parallel Reviews (for each dimension)
├─ Launch 7 review agents simultaneously
@@ -90,7 +88,7 @@ Phase 4: Iterative Deep-Dive (optional)
└─ Loop until no critical findings OR max iterations
Phase 5: Completion
└─ Finalize review-progress.json → Output dashboard path
└─ Finalize review-progress.json
```
### Agent Roles
@@ -188,8 +186,8 @@ const CATEGORIES = {
**Step 1: Session Creation**
```javascript
// Create workflow session for this review
SlashCommand(command="/workflow:session:start \"Code review for [target_pattern]\"")
// Create workflow session for this review (type: review)
SlashCommand(command="/workflow:session:start --type review \"Code review for [target_pattern]\"")
// Parse output
const sessionId = output.match(/SESSION_ID: (WFS-[^\s]+)/)[1];
@@ -219,37 +217,9 @@ done
**Step 4: Initialize Review State**
- State initialization: Create `review-state.json` with metadata, dimensions, max_iterations, resolved_files (merged metadata + state)
- Progress tracking: Create `review-progress.json` for dashboard polling
- Progress tracking: Create `review-progress.json` for progress tracking
**Step 5: Dashboard Generation**
**Constraints**:
- **MANDATORY**: Dashboard MUST be generated from template: `~/.claude/templates/review-cycle-dashboard.html`
- **PROHIBITED**: Direct creation or custom generation without template
- **POST-GENERATION**: Orchestrator and agents MUST NOT read/write/modify dashboard.html after creation
**Generation Commands** (3 independent steps):
```bash
# Step 1: Copy template to output location
cp ~/.claude/templates/review-cycle-dashboard.html ${sessionDir}/.review/dashboard.html
# Step 2: Replace SESSION_ID placeholder
sed -i "s|{{SESSION_ID}}|${sessionId}|g" ${sessionDir}/.review/dashboard.html
# Step 3: Replace REVIEW_TYPE placeholder
sed -i "s|{{REVIEW_TYPE}}|module|g" ${sessionDir}/.review/dashboard.html
# Step 4: Replace REVIEW_DIR placeholder
sed -i "s|{{REVIEW_DIR}}|${reviewDir}|g" ${sessionDir}/.review/dashboard.html
# Output: Start local server and output dashboard URL
# Use Python HTTP server (available on most systems)
cd ${sessionDir}/.review && python -m http.server 8765 --bind 127.0.0.1 &
echo "📊 Dashboard: http://127.0.0.1:8765/dashboard.html"
echo " (Press Ctrl+C to stop server when done)"
```
**Step 6: TodoWrite Initialization**
**Step 5: TodoWrite Initialization**
- Set up progress tracking with hierarchical structure
- Mark Phase 1 completed, Phase 2 in_progress
@@ -280,7 +250,6 @@ echo " (Press Ctrl+C to stop server when done)"
- Finalize review-progress.json with completion statistics
- Update review-state.json with completion_time and phase=complete
- TodoWrite completion: Mark all tasks done
- Output: Dashboard path to user
@@ -301,12 +270,11 @@ echo " (Press Ctrl+C to stop server when done)"
├── iterations/ # Deep-dive results
│ ├── iteration-1-finding-{uuid}.json
│ └── iteration-2-finding-{uuid}.json
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
└── dashboard.html # Interactive dashboard (primary output)
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
```
**Session Context**:
@@ -772,23 +740,25 @@ TodoWrite({
3. **Use Glob Wisely**: `src/auth/**` is more efficient than `src/**` with lots of irrelevant files
4. **Trust Aggregation Logic**: Auto-selection based on proven heuristics
5. **Monitor Logs**: Check reports/ directory for CLI analysis insights
6. **Dashboard Polling**: Refresh every 5 seconds for real-time updates
7. **Export Results**: Use dashboard export for external tracking tools
## Related Commands
### View Review Progress
Use `ccw view` to open the review dashboard in browser:
```bash
ccw view
```
### Automated Fix Workflow
After completing a module review, use the dashboard to select findings and export them for automated fixing:
After completing a module review, use the generated findings JSON for automated fixing:
```bash
# Step 1: Complete review (this command)
/workflow:review-module-cycle src/auth/**
# Step 2: Open dashboard, select findings, and export
# Dashboard generates: fix-export-{timestamp}.json
# Step 3: Run automated fixes
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/fix-export-{timestamp}.json
# Step 2: Run automated fixes using dimension findings
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/
```
See `/workflow:review-fix` for automated fixing with smart grouping, parallel execution, and test verification.

View File

@@ -45,13 +45,11 @@ Session-based multi-dimensional code review orchestrator with **hybrid parallel-
1. **Comprehensive Coverage**: 7 specialized dimensions analyze all quality aspects simultaneously
2. **Intelligent Prioritization**: Automatic identification of critical issues and cross-cutting concerns
3. **Actionable Insights**: Deep-dive iterations provide step-by-step remediation plans
4. **Real-time Visibility**: JSON-based progress tracking with interactive HTML dashboard
### Orchestrator Boundary (CRITICAL)
- **ONLY command** for comprehensive multi-dimensional review
- Manages: dimension coordination, aggregation, iteration control, progress tracking
- Delegates: Code exploration and analysis to @cli-explore-agent, dimension-specific reviews via Deep Scan mode
- **⚠️ DASHBOARD CONSTRAINT**: Dashboard is generated ONCE during Phase 1 initialization. After initialization, orchestrator and agents MUST NOT read, write, or modify dashboard.html - it remains static for user interaction only.
## How It Works
@@ -59,7 +57,7 @@ Session-based multi-dimensional code review orchestrator with **hybrid parallel-
```
Phase 1: Discovery & Initialization
└─ Validate session, initialize state, create output structure → Generate dashboard.html
└─ Validate session, initialize state, create output structure
Phase 2: Parallel Reviews (for each dimension)
├─ Launch 7 review agents simultaneously
@@ -83,7 +81,7 @@ Phase 4: Iterative Deep-Dive (optional)
└─ Loop until no critical findings OR max iterations
Phase 5: Completion
└─ Finalize review-progress.json → Output dashboard path
└─ Finalize review-progress.json
```
### Agent Roles
@@ -199,36 +197,9 @@ git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u
**Step 5: Initialize Review State**
- State initialization: Create `review-state.json` with metadata, dimensions, max_iterations (merged metadata + state)
- Progress tracking: Create `review-progress.json` for dashboard polling
- Progress tracking: Create `review-progress.json` for progress tracking
**Step 6: Dashboard Generation**
**Constraints**:
- **MANDATORY**: Dashboard MUST be generated from template: `~/.claude/templates/review-cycle-dashboard.html`
- **PROHIBITED**: Direct creation or custom generation without template
- **POST-GENERATION**: Orchestrator and agents MUST NOT read/write/modify dashboard.html after creation
**Generation Commands** (3 independent steps):
```bash
# Step 1: Copy template to output location
cp ~/.claude/templates/review-cycle-dashboard.html ${sessionDir}/.review/dashboard.html
# Step 2: Replace SESSION_ID placeholder
sed -i "s|{{SESSION_ID}}|${sessionId}|g" ${sessionDir}/.review/dashboard.html
# Step 3: Replace REVIEW_TYPE placeholder
sed -i "s|{{REVIEW_TYPE}}|session|g" ${sessionDir}/.review/dashboard.html
# Step 4: Replace REVIEW_DIR placeholder
sed -i "s|{{REVIEW_DIR}}|${reviewDir}|g" ${sessionDir}/.review/dashboard.html
# Output: Start local server and output dashboard URL
cd ${sessionDir}/.review && python -m http.server 8765 --bind 127.0.0.1 &
echo "📊 Dashboard: http://127.0.0.1:8765/dashboard.html"
echo " (Press Ctrl+C to stop server when done)"
```
**Step 7: TodoWrite Initialization**
**Step 6: TodoWrite Initialization**
- Set up progress tracking with hierarchical structure
- Mark Phase 1 completed, Phase 2 in_progress
@@ -259,7 +230,6 @@ echo " (Press Ctrl+C to stop server when done)"
- Finalize review-progress.json with completion statistics
- Update review-state.json with completion_time and phase=complete
- TodoWrite completion: Mark all tasks done
- Output: Dashboard path to user
@@ -280,12 +250,11 @@ echo " (Press Ctrl+C to stop server when done)"
├── iterations/ # Deep-dive results
│ ├── iteration-1-finding-{uuid}.json
│ └── iteration-2-finding-{uuid}.json
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
└── dashboard.html # Interactive dashboard (primary output)
── reports/ # Human-readable reports
├── security-analysis.md
├── security-cli-output.txt
├── deep-dive-1-{uuid}.md
└── ...
```
**Session Context**:
@@ -782,23 +751,25 @@ TodoWrite({
2. **Parallel Execution**: ~60 minutes for full initial review (7 dimensions)
3. **Trust Aggregation Logic**: Auto-selection based on proven heuristics
4. **Monitor Logs**: Check reports/ directory for CLI analysis insights
5. **Dashboard Polling**: Refresh every 5 seconds for real-time updates
6. **Export Results**: Use dashboard export for external tracking tools
## Related Commands
### View Review Progress
Use `ccw view` to open the review dashboard in browser:
```bash
ccw view
```
### Automated Fix Workflow
After completing a review, use the dashboard to select findings and export them for automated fixing:
After completing a review, use the generated findings JSON for automated fixing:
```bash
# Step 1: Complete review (this command)
/workflow:review-session-cycle
# Step 2: Open dashboard, select findings, and export
# Dashboard generates: fix-export-{timestamp}.json
# Step 3: Run automated fixes
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/fix-export-{timestamp}.json
# Step 2: Run automated fixes using dimension findings
/workflow:review-fix .workflow/active/WFS-{session-id}/.review/
```
See `/workflow:review-fix` for automated fixing with smart grouping, parallel execution, and test verification.

View File

@@ -1,11 +1,13 @@
---
name: start
description: Discover existing sessions or start new workflow session with intelligent session management and conflict detection
argument-hint: [--auto|--new] [optional: task description for new session]
argument-hint: [--type <workflow|review|tdd|test|docs>] [--auto|--new] [optional: task description for new session]
examples:
- /workflow:session:start
- /workflow:session:start --auto "implement OAuth2 authentication"
- /workflow:session:start --new "fix login bug"
- /workflow:session:start --type review "Code review for auth module"
- /workflow:session:start --type tdd --auto "implement user authentication"
- /workflow:session:start --type test --new "test payment flow"
---
# Start Workflow Session (/workflow:session:start)
@@ -17,6 +19,23 @@ Manages workflow sessions with three operation modes: discovery (manual), auto (
1. **Project-level initialization** (first-time only): Creates `.workflow/project.json` for feature registry
2. **Session-level initialization** (always): Creates session directory structure
## Session Types
The `--type` parameter classifies sessions for CCW dashboard organization:
| Type | Description | Default For |
|------|-------------|-------------|
| `workflow` | Standard implementation (default) | `/workflow:plan` |
| `review` | Code review sessions | `/workflow:review-module-cycle` |
| `tdd` | TDD-based development | `/workflow:tdd-plan` |
| `test` | Test generation/fix sessions | `/workflow:test-fix-gen` |
| `docs` | Documentation sessions | `/memory:docs` |
**Validation**: If `--type` is provided with invalid value, return error:
```
ERROR: Invalid session type. Valid types: workflow, review, tdd, test, docs
```
## Step 0: Initialize Project State (First-time Only)
**Executed before all modes** - Ensures project-level state file exists by calling `/workflow:init`.
@@ -86,8 +105,8 @@ bash(mkdir -p .workflow/active/WFS-implement-oauth2-auth/.process)
bash(mkdir -p .workflow/active/WFS-implement-oauth2-auth/.task)
bash(mkdir -p .workflow/active/WFS-implement-oauth2-auth/.summaries)
# Create metadata
bash(echo '{"session_id":"WFS-implement-oauth2-auth","project":"implement OAuth2 auth","status":"planning"}' > .workflow/active/WFS-implement-oauth2-auth/workflow-session.json)
# Create metadata (include type field, default to "workflow" if not specified)
bash(echo '{"session_id":"WFS-implement-oauth2-auth","project":"implement OAuth2 auth","status":"planning","type":"workflow","created_at":"2024-12-04T08:00:00Z"}' > .workflow/active/WFS-implement-oauth2-auth/workflow-session.json)
```
**Output**: `SESSION_ID: WFS-implement-oauth2-auth`
@@ -143,7 +162,8 @@ bash(mkdir -p .workflow/active/WFS-fix-login-bug/.summaries)
### Step 3: Create Metadata
```bash
bash(echo '{"session_id":"WFS-fix-login-bug","project":"fix login bug","status":"planning"}' > .workflow/active/WFS-fix-login-bug/workflow-session.json)
# Include type field from --type parameter (default: "workflow")
bash(echo '{"session_id":"WFS-fix-login-bug","project":"fix login bug","status":"planning","type":"workflow","created_at":"2024-12-04T08:00:00Z"}' > .workflow/active/WFS-fix-login-bug/workflow-session.json)
```
**Output**: `SESSION_ID: WFS-fix-login-bug`

View File

@@ -1,352 +0,0 @@
---
name: workflow:status
description: Generate on-demand views for project overview and workflow tasks with optional task-id filtering for detailed view
argument-hint: "[optional: --project|task-id|--validate|--dashboard]"
---
# Workflow Status Command (/workflow:status)
## Overview
Generates on-demand views from project and session data. Supports multiple modes:
1. **Project Overview** (`--project`): Shows completed features and project statistics
2. **Workflow Tasks** (default): Shows current session task progress
3. **HTML Dashboard** (`--dashboard`): Generates interactive HTML task board with active and archived sessions
No synchronization needed - all views are calculated from current JSON state.
## Usage
```bash
/workflow:status # Show current workflow session overview
/workflow:status --project # Show project-level feature registry
/workflow:status impl-1 # Show specific task details
/workflow:status --validate # Validate workflow integrity
/workflow:status --dashboard # Generate HTML dashboard board
```
## Execution Process
```
Input Parsing:
└─ Decision (mode detection):
├─ --project flag → Project Overview Mode
├─ --dashboard flag → Dashboard Mode
├─ task-id argument → Task Details Mode
└─ No flags → Workflow Session Mode (default)
Project Overview Mode:
├─ Check project.json exists
├─ Read project data
├─ Parse and display overview + features
└─ Show recent archived sessions
Workflow Session Mode (default):
├─ Find active session
├─ Load session data
├─ Scan task files
└─ Display task progress
Dashboard Mode:
├─ Collect active sessions
├─ Collect archived sessions
├─ Generate HTML from template
└─ Write dashboard.html
```
## Implementation Flow
### Mode Selection
**Check for --project flag**:
- If `--project` flag present → Execute **Project Overview Mode**
- Otherwise → Execute **Workflow Session Mode** (default)
## Project Overview Mode
### Step 1: Check Project State
```bash
bash(test -f .workflow/project.json && echo "EXISTS" || echo "NOT_FOUND")
```
**If NOT_FOUND**:
```
No project state found.
Run /workflow:session:start to initialize project.
```
### Step 2: Read Project Data
```bash
bash(cat .workflow/project.json)
```
### Step 3: Parse and Display
**Data Processing**:
```javascript
const projectData = JSON.parse(Read('.workflow/project.json'));
const features = projectData.features || [];
const stats = projectData.statistics || {};
const overview = projectData.overview || null;
// Sort features by implementation date (newest first)
const sortedFeatures = features.sort((a, b) =>
new Date(b.implemented_at) - new Date(a.implemented_at)
);
```
**Output Format** (with extended overview):
```
## Project: ${projectData.project_name}
Initialized: ${projectData.initialized_at}
${overview ? `
### Overview
${overview.description}
**Technology Stack**:
${overview.technology_stack.languages.map(l => `- ${l.name}${l.primary ? ' (primary)' : ''}: ${l.file_count} files`).join('\n')}
Frameworks: ${overview.technology_stack.frameworks.join(', ')}
**Architecture**:
Style: ${overview.architecture.style}
Patterns: ${overview.architecture.patterns.join(', ')}
**Key Components** (${overview.key_components.length}):
${overview.key_components.map(c => `- ${c.name} (${c.path})\n ${c.description}`).join('\n')}
---
` : ''}
### Completed Features (${stats.total_features})
${sortedFeatures.map(f => `
- ${f.title} (${f.timeline?.implemented_at || f.implemented_at})
${f.description}
Tags: ${f.tags?.join(', ') || 'none'}
Session: ${f.traceability?.session_id || f.session_id}
Archive: ${f.traceability?.archive_path || 'unknown'}
${f.traceability?.commit_hash ? `Commit: ${f.traceability.commit_hash}` : ''}
`).join('\n')}
### Project Statistics
- Total Features: ${stats.total_features}
- Total Sessions: ${stats.total_sessions}
- Last Updated: ${stats.last_updated}
### Quick Access
- View session details: /workflow:status
- Archive query: jq '.archives[] | select(.session_id == "SESSION_ID")' .workflow/archives/manifest.json
- Documentation: .workflow/docs/${projectData.project_name}/
### Query Commands
# Find by tag
cat .workflow/project.json | jq '.features[] | select(.tags[] == "auth")'
# View archive
cat ${feature.traceability.archive_path}/IMPL_PLAN.md
# List all tags
cat .workflow/project.json | jq -r '.features[].tags[]' | sort -u
```
**Empty State**:
```
## Project: ${projectData.project_name}
Initialized: ${projectData.initialized_at}
No features completed yet.
Complete your first workflow session to add features:
1. /workflow:plan "feature description"
2. /workflow:execute
3. /workflow:session:complete
```
### Step 4: Show Recent Sessions (Optional)
```bash
# List 5 most recent archived sessions
bash(ls -1t .workflow/archives/WFS-* 2>/dev/null | head -5 | xargs -I {} basename {})
```
**Output**:
```
### Recent Sessions
- WFS-auth-system (archived)
- WFS-payment-flow (archived)
- WFS-user-dashboard (archived)
Use /workflow:session:complete to archive current session.
```
## Workflow Session Mode (Default)
### Step 1: Find Active Session
```bash
find .workflow/active/ -name "WFS-*" -type d 2>/dev/null | head -1
```
### Step 2: Load Session Data
```bash
cat .workflow/active/WFS-session/workflow-session.json
```
### Step 3: Scan Task Files
```bash
find .workflow/active/WFS-session/.task/ -name "*.json" -type f 2>/dev/null
```
### Step 4: Generate Task Status
```bash
cat .workflow/active/WFS-session/.task/impl-1.json | jq -r '.status'
```
### Step 5: Count Task Progress
```bash
find .workflow/active/WFS-session/.task/ -name "*.json" -type f | wc -l
find .workflow/active/WFS-session/.summaries/ -name "*.md" -type f 2>/dev/null | wc -l
```
### Step 6: Display Overview
```markdown
# Workflow Overview
**Session**: WFS-session-name
**Progress**: 3/8 tasks completed
## Active Tasks
- [IN PROGRESS] impl-1: Current task in progress
- [ ] impl-2: Next pending task
## Completed Tasks
- [COMPLETED] impl-0: Setup completed
```
## Dashboard Mode (HTML Board)
### Step 1: Check for --dashboard flag
```bash
# If --dashboard flag present → Execute Dashboard Mode
```
### Step 2: Collect Workflow Data
**Collect Active Sessions**:
```bash
# Find all active sessions
find .workflow/active/ -name "WFS-*" -type d 2>/dev/null
# For each active session, read metadata and tasks
for session in $(find .workflow/active/ -name "WFS-*" -type d 2>/dev/null); do
cat "$session/workflow-session.json"
find "$session/.task/" -name "*.json" -type f 2>/dev/null
done
```
**Collect Archived Sessions**:
```bash
# Find all archived sessions
find .workflow/archives/ -name "WFS-*" -type d 2>/dev/null
# Read manifest if exists
cat .workflow/archives/manifest.json 2>/dev/null
# For each archived session, read metadata
for archive in $(find .workflow/archives/ -name "WFS-*" -type d 2>/dev/null); do
cat "$archive/workflow-session.json" 2>/dev/null
# Count completed tasks
find "$archive/.task/" -name "*.json" -type f 2>/dev/null | wc -l
done
```
### Step 3: Process and Structure Data
**Build data structure for dashboard**:
```javascript
const dashboardData = {
activeSessions: [],
archivedSessions: [],
generatedAt: new Date().toISOString()
};
// Process active sessions
for each active_session in active_sessions:
const sessionData = JSON.parse(Read(active_session/workflow-session.json));
const tasks = [];
// Load all tasks for this session
for each task_file in find(active_session/.task/*.json):
const taskData = JSON.parse(Read(task_file));
tasks.push({
task_id: taskData.task_id,
title: taskData.title,
status: taskData.status,
type: taskData.type
});
dashboardData.activeSessions.push({
session_id: sessionData.session_id,
project: sessionData.project,
status: sessionData.status,
created_at: sessionData.created_at || sessionData.initialized_at,
tasks: tasks
});
// Process archived sessions
for each archived_session in archived_sessions:
const sessionData = JSON.parse(Read(archived_session/workflow-session.json));
const taskCount = bash(find archived_session/.task/*.json | wc -l);
dashboardData.archivedSessions.push({
session_id: sessionData.session_id,
project: sessionData.project,
archived_at: sessionData.completed_at || sessionData.archived_at,
taskCount: parseInt(taskCount),
archive_path: archived_session
});
```
### Step 4: Generate HTML from Template
**Load template and inject data**:
```javascript
// Read the HTML template
const template = Read("~/.claude/templates/workflow-dashboard.html");
// Prepare data for injection
const dataJson = JSON.stringify(dashboardData, null, 2);
// Replace placeholder with actual data
const htmlContent = template.replace('{{WORKFLOW_DATA}}', dataJson);
// Ensure .workflow directory exists
bash(mkdir -p .workflow);
```
### Step 5: Write HTML File
```bash
# Write the generated HTML to .workflow/dashboard.html
Write({
file_path: ".workflow/dashboard.html",
content: htmlContent
})
```
### Step 6: Display Success Message
```markdown
Dashboard generated successfully!
Location: .workflow/dashboard.html
Open in browser:
file://$(pwd)/.workflow/dashboard.html
Features:
- 📊 Active sessions overview
- 📦 Archived sessions history
- 🔍 Search and filter
- 📈 Progress tracking
- 🎨 Dark/light theme
Refresh data: Re-run /workflow:status --dashboard
```

View File

@@ -44,7 +44,7 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
**Step 1.1: Dispatch** - Session discovery and initialization
```javascript
SlashCommand(command="/workflow:session:start --auto \"TDD: [structured-description]\"")
SlashCommand(command="/workflow:session:start --type tdd --auto \"TDD: [structured-description]\"")
```
**TDD Structured Format**:

View File

@@ -159,19 +159,19 @@ Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
```javascript
// Session Mode - Include original task description to enable semantic CLI selection
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
SlashCommand(command="/workflow:session:start --type test --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
// Prompt Mode - User's description already contains their intent
SlashCommand(command="/workflow:session:start --new \"Test generation for: [description]\"")
SlashCommand(command="/workflow:session:start --type test --new \"Test generation for: [description]\"")
```
**Input**: User argument (session ID, description, or file path)
**Expected Behavior**:
- Creates new session: `WFS-test-[slug]`
- Writes `workflow-session.json` metadata:
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`, description with original user intent
- **Prompt Mode**: Includes `workflow_type: "test_session"` only (user's description already contains intent)
- Writes `workflow-session.json` metadata with `type: "test"`
- **Session Mode**: Additionally includes `source_session_id: "[sourceId]"`, description with original user intent
- **Prompt Mode**: Uses user's description (already contains intent)
- Returns new session ID
**Parse Output**:
@@ -579,11 +579,11 @@ WFS-test-[session]/
**File**: `workflow-session.json`
**Session Mode** includes:
- `workflow_type: "test_session"`
- `type: "test"` (set by session:start --type test)
- `source_session_id: "[sourceSessionId]"` (enables automatic cross-session context)
**Prompt Mode** includes:
- `workflow_type: "test_session"`
- `type: "test"` (set by session:start --type test)
- No `source_session_id` field
### Execution Flow Diagram

View File

@@ -135,7 +135,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
## MANDATORY FIRST STEPS (Execute by Agent)
**You (cli-explore-agent) MUST execute these steps in order:**
1. Run: ~/.claude/scripts/get_modules_by_depth.sh (project structure)
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
2. Run: rg -l "{keyword_from_task}" --type ts (locate relevant files)
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/explore-json-schema.json (get output schema reference)
@@ -171,7 +171,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
- dependencies: Dependencies relevant to ${angle}
- integration_points: Where to integrate from ${angle} viewpoint (include file:line locations)
- constraints: ${angle}-specific limitations/conventions
- clarification_needs: ${angle}-related ambiguities (with options array)
- clarification_needs: ${angle}-related ambiguities (options array + recommended index)
- _metadata.exploration_angle: "${angle}"
## Success Criteria
@@ -182,7 +182,7 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
- [ ] Integration points include file:line locations
- [ ] Constraints are project-specific to ${angle}
- [ ] JSON output follows schema exactly
- [ ] clarification_needs includes options array
- [ ] clarification_needs includes options + recommended
## Output
Write: ${sessionFolder}/exploration-${angle}.json
@@ -251,7 +251,7 @@ Execute all discovery tracks:
### Phase 3: Synthesis, Assessment & Packaging
1. Apply relevance scoring and build dependency graph
2. **Synthesize 4-source data**: Merge findings from all sources (archive > docs > code > web). **Prioritize the context from `project.json`** for architecture and tech stack unless code analysis reveals it's outdated.
3. **Populate `project_context`**: Directly use the `overview` from `project.json` to fill the `project_context` section of the output `context-package.json`. Include technology_stack, architecture, key_components, and entry_points.
3. **Populate `project_context`**: Directly use the `overview` from `project.json` to fill the `project_context` section of the output `context-package.json`. Include description, technology_stack, architecture, and key_components.
4. Integrate brainstorm artifacts (if .brainstorming/ exists, read content)
5. Perform conflict detection with risk assessment
6. **Inject historical conflicts** from archive analysis into conflict_detection
@@ -260,7 +260,7 @@ Execute all discovery tracks:
## Output Requirements
Complete context-package.json with:
- **metadata**: task_description, keywords, complexity, tech_stack, session_id
- **project_context**: architecture_patterns, coding_conventions, tech_stack (sourced from `project.json` overview)
- **project_context**: description, technology_stack, architecture, key_components (sourced from `project.json` overview)
- **assets**: {documentation[], source_code[], config[], tests[]} with relevance scores
- **dependencies**: {internal[], external[]} with dependency graph
- **brainstorm_artifacts**: {guidance_specification, role_analyses[], synthesis_output} with content

View File

@@ -14,8 +14,8 @@ Generate implementation planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.
## Core Philosophy
- **Planning Only**: Generate planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) - does NOT implement code
- **Agent-Driven Document Generation**: Delegate plan generation to action-planning-agent
- **N+1 Parallel Planning**: Auto-detect multi-module projects, enable parallel planning (2+1 or 3+1 mode)
- **Progressive Loading**: Load context incrementally (Core → Selective → On-Demand) due to analysis.md file size
- **Two-Phase Flow**: Discovery (context gathering) → Output (planning document generation)
- **Memory-First**: Reuse loaded documents from conversation memory
- **Smart Selection**: Load synthesis_output OR guidance + relevant role analyses, NOT all role analyses
- **MCP-Enhanced**: Use MCP tools for advanced code analysis and research
@@ -28,22 +28,38 @@ Input Parsing:
├─ Parse flags: --session
└─ Validation: session_id REQUIRED
Phase 1: Context Preparation (Command)
Phase 1: Context Preparation & Module Detection (Command)
├─ Assemble session paths (metadata, context package, output dirs)
─ Provide metadata (session_id, execution_mode, mcp_capabilities)
─ Provide metadata (session_id, execution_mode, mcp_capabilities)
├─ Auto-detect modules from context-package + directory structure
└─ Decision:
├─ modules.length == 1 → Single Agent Mode (Phase 2A)
└─ modules.length >= 2 → Parallel Mode (Phase 2B + Phase 3)
Phase 2: Planning Document Generation (Agent)
Phase 2A: Single Agent Planning (Original Flow)
├─ Load context package (progressive loading strategy)
├─ Generate Task JSON Files (.task/IMPL-*.json)
├─ Create IMPL_PLAN.md
└─ Generate TODO_LIST.md
Phase 2B: N Parallel Planning (Multi-Module)
├─ Launch N action-planning-agents simultaneously (one per module)
├─ Each agent generates module-scoped tasks (IMPL-{prefix}{seq}.json)
├─ Task ID format: IMPL-A1, IMPL-A2... / IMPL-B1, IMPL-B2...
└─ Each module limited to ≤9 tasks
Phase 3: Integration (+1 Coordinator, Multi-Module Only)
├─ Collect all module task JSONs
├─ Resolve cross-module dependencies (CROSS::{module}::{pattern} → actual ID)
├─ Generate unified IMPL_PLAN.md (grouped by module)
└─ Generate TODO_LIST.md (hierarchical: module → tasks)
```
## Document Generation Lifecycle
### Phase 1: Context Preparation (Command Responsibility)
### Phase 1: Context Preparation & Module Detection (Command Responsibility)
**Command prepares session paths and metadata for planning document generation.**
**Command prepares session paths, metadata, and detects module structure.**
**Session Path Structure**:
```
@@ -52,8 +68,12 @@ Phase 2: Planning Document Generation (Agent)
├── .process/
│ └── context-package.json # Context package with artifact catalog
├── .task/ # Output: Task JSON files
├── IMPL_PLAN.md # Output: Implementation plan
└── TODO_LIST.md # Output: TODO list
├── IMPL-A1.json # Multi-module: prefixed by module
│ ├── IMPL-A2.json
│ ├── IMPL-B1.json
│ └── ...
├── IMPL_PLAN.md # Output: Implementation plan (grouped by module)
└── TODO_LIST.md # Output: TODO list (hierarchical)
```
**Command Preparation**:
@@ -66,9 +86,40 @@ Phase 2: Planning Document Generation (Agent)
- `session_id`
- `mcp_capabilities` (available MCP tools)
3. **Auto Module Detection** (determines single vs parallel mode):
```javascript
function autoDetectModules(contextPackage, projectRoot) {
// Priority 1: Explicit frontend/backend separation
if (exists('src/frontend') && exists('src/backend')) {
return [
{ name: 'frontend', prefix: 'A', paths: ['src/frontend'] },
{ name: 'backend', prefix: 'B', paths: ['src/backend'] }
];
}
// Priority 2: Monorepo structure
if (exists('packages/*') || exists('apps/*')) {
return detectMonorepoModules(); // Returns 2-3 main packages
}
// Priority 3: Context-package dependency clustering
const modules = clusterByDependencies(contextPackage.dependencies?.internal);
if (modules.length >= 2) return modules.slice(0, 3);
// Default: Single module (original flow)
return [{ name: 'main', prefix: '', paths: ['.'] }];
}
```
**Decision Logic**:
- `modules.length == 1` → Phase 2A (Single Agent, original flow)
- `modules.length >= 2` → Phase 2B + Phase 3 (N+1 Parallel)
**Note**: CLI tool usage is now determined semantically by action-planning-agent based on user's task description, not by flags.
### Phase 2: Planning Document Generation (Agent Responsibility)
### Phase 2A: Single Agent Planning (Original Flow)
**Condition**: `modules.length == 1` (no multi-module detected)
**Purpose**: Generate IMPL_PLAN.md, task JSONs, and TODO_LIST.md - planning documents only, NOT code implementation.
@@ -132,7 +183,7 @@ Determine CLI tool usage per-step based on user's task description:
## QUALITY STANDARDS
Hard Constraints:
- Task count <= 12 (hard limit - request re-scope if exceeded)
- Task count <= 18 (hard limit - request re-scope if exceeded)
- All requirements quantified (explicit counts and enumerated lists)
- Acceptance criteria measurable (include verification commands)
- Artifact references mapped from context package
@@ -148,4 +199,93 @@ Hard Constraints:
)
```
### Phase 2B: N Parallel Planning (Multi-Module)
**Condition**: `modules.length >= 2` (multi-module detected)
**Purpose**: Launch N action-planning-agents simultaneously, one per module, for parallel task generation.
**Parallel Agent Invocation**:
```javascript
// Launch N agents in parallel (one per module)
const planningTasks = modules.map(module =>
Task(
subagent_type="action-planning-agent",
description=`Plan ${module.name} module`,
prompt=`
## SCOPE
- Module: ${module.name} (${module.type})
- Focus Paths: ${module.paths.join(', ')}
- Task ID Prefix: IMPL-${module.prefix}
- Task Limit: ≤9 tasks
- Other Modules: ${otherModules.join(', ')}
- Cross-module deps format: "CROSS::{module}::{pattern}"
## SESSION PATHS
Input:
- Context Package: .workflow/active/{session-id}/.process/context-package.json
Output:
- Task Dir: .workflow/active/{session-id}/.task/
## INSTRUCTIONS
- Generate tasks ONLY for ${module.name} module
- Use task ID format: IMPL-${module.prefix}1, IMPL-${module.prefix}2, ...
- For cross-module dependencies, use: depends_on: ["CROSS::B::api-endpoint"]
- Maximum 9 tasks per module
`
)
);
// Execute all in parallel
await Promise.all(planningTasks);
```
**Output Structure** (direct to .task/):
```
.task/
├── IMPL-A1.json # Module A (e.g., frontend)
├── IMPL-A2.json
├── IMPL-B1.json # Module B (e.g., backend)
├── IMPL-B2.json
└── IMPL-C1.json # Module C (e.g., shared)
```
**Task ID Naming**:
- Format: `IMPL-{prefix}{seq}.json`
- Prefix: A, B, C... (assigned by detection order)
- Sequence: 1, 2, 3... (per-module increment)
### Phase 3: Integration (+1 Coordinator, Multi-Module Only)
**Condition**: Only executed when `modules.length >= 2`
**Purpose**: Collect all module tasks, resolve cross-module dependencies, generate unified documents.
**Integration Logic**:
```javascript
// 1. Collect all module task JSONs
const allTasks = glob('.task/IMPL-*.json').map(loadJson);
// 2. Resolve cross-module dependencies
for (const task of allTasks) {
if (task.depends_on) {
task.depends_on = task.depends_on.map(dep => {
if (dep.startsWith('CROSS::')) {
// CROSS::B::api-endpoint → find matching IMPL-B* task
const [, targetModule, pattern] = dep.match(/CROSS::(\w+)::(.+)/);
return findTaskByModuleAndPattern(allTasks, targetModule, pattern);
}
return dep;
});
}
}
// 3. Generate unified IMPL_PLAN.md (grouped by module)
generateIMPL_PLAN(allTasks, modules);
// 4. Generate TODO_LIST.md (hierarchical structure)
generateTODO_LIST(allTasks, modules);
```
**Note**: IMPL_PLAN.md and TODO_LIST.md structure definitions are in `action-planning-agent.md`.

View File

@@ -42,10 +42,10 @@ Autonomous TDD task JSON and IMPL_PLAN.md generation using action-planning-agent
- Different tech stacks or domains within feature
### Task Limits
- **Maximum 10 tasks** (hard limit for TDD workflows)
- **Maximum 18 tasks** (hard limit for TDD workflows)
- **Feature-based**: Complete functional units with internal TDD cycles
- **Hierarchy**: Flat (≤5 simple features) | Two-level (6-10 for complex features with sub-features)
- **Re-scope**: If >10 tasks needed, break project into multiple TDD workflow sessions
- **Re-scope**: If >18 tasks needed, break project into multiple TDD workflow sessions
### TDD Cycle Mapping
- **Old approach**: 1 feature = 3 tasks (TEST-N.M, IMPL-N.M, REFACTOR-N.M)
@@ -249,7 +249,7 @@ Refer to: @.claude/agents/action-planning-agent.md for:
- Each task executes Red-Green-Refactor phases sequentially
- Task count = Feature count (typically 5 features = 5 tasks)
- Subtasks only when complexity >2500 lines or >6 files per cycle
- **Maximum 10 tasks** (hard limit for TDD workflows)
- **Maximum 18 tasks** (hard limit for TDD workflows)
#### TDD Cycle Mapping
- **Simple features**: IMPL-N with internal Red-Green-Refactor phases
@@ -318,7 +318,7 @@ Refer to: @.claude/agents/action-planning-agent.md for:
**Quality Gates** (Full checklist in action-planning-agent.md):
- ✓ Quantification requirements enforced (explicit counts, measurable acceptance, exact targets)
- ✓ Task count ≤10 (hard limit)
- ✓ Task count ≤18 (hard limit)
- ✓ Each task has meta.tdd_workflow: true
- ✓ Each task has exactly 3 implementation steps with tdd_phase field
- ✓ Green phase includes test-fix cycle logic

View File

@@ -212,7 +212,7 @@ PRIMARY requirements source - extract and map to task JSONs:
## QUALITY STANDARDS
Hard Constraints:
- Task count: minimum 2, maximum 12
- Task count: minimum 2, maximum 18
- All requirements quantified from TEST_ANALYSIS_RESULTS.md
- Test framework matches existing project framework
- flow_control includes reusable_test_tools and test_commands from project

View File

@@ -320,7 +320,7 @@ Read({base_path}/prototypes/{target}-style-{style_id}-layout-{layout_id}.html)
### Step 1: Run Preview Generation Script
```bash
bash(~/.claude/scripts/ui-generate-preview.sh "{base_path}/prototypes")
bash(ccw tool exec ui_generate_preview '{"prototypesDir":"{base_path}/prototypes"}')
```
**Script generates**:
@@ -432,7 +432,7 @@ bash(test -f {base_path}/prototypes/compare.html && echo "exists")
bash(mkdir -p {base_path}/prototypes)
# Run preview script
bash(~/.claude/scripts/ui-generate-preview.sh "{base_path}/prototypes")
bash(ccw tool exec ui_generate_preview '{"prototypesDir":"{base_path}/prototypes"}')
```
## Output Structure
@@ -467,7 +467,7 @@ ERROR: Agent assembly failed
→ Check inputs exist, validate JSON structure
ERROR: Script permission denied
chmod +x ~/.claude/scripts/ui-generate-preview.sh
Verify ccw tool is available: ccw tool list
```
### Recovery Strategies

View File

@@ -106,7 +106,7 @@ echo " Output: $base_path"
# 3. Discover files using script
discovery_file="${intermediates_dir}/discovered-files.json"
~/.claude/scripts/discover-design-files.sh "$source" "$discovery_file"
ccw tool exec discover_design_files '{"sourceDir":"'"$source"'","outputPath":"'"$discovery_file"'"}'
echo " Output: $discovery_file"
```

View File

@@ -1,664 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Workflow Dashboard - Task Board</title>
<style>
:root {
--bg-primary: #f5f7fa;
--bg-secondary: #ffffff;
--bg-card: #ffffff;
--text-primary: #1a202c;
--text-secondary: #718096;
--border-color: #e2e8f0;
--accent-color: #4299e1;
--success-color: #48bb78;
--warning-color: #ed8936;
--danger-color: #f56565;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] {
--bg-primary: #1a202c;
--bg-secondary: #2d3748;
--bg-card: #2d3748;
--text-primary: #f7fafc;
--text-secondary: #a0aec0;
--border-color: #4a5568;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
transition: background-color 0.3s, color 0.3s;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
header {
background-color: var(--bg-secondary);
box-shadow: var(--shadow);
padding: 20px;
margin-bottom: 30px;
border-radius: 8px;
}
h1 {
font-size: 2rem;
margin-bottom: 10px;
color: var(--accent-color);
}
.header-controls {
display: flex;
gap: 15px;
flex-wrap: wrap;
align-items: center;
margin-top: 15px;
}
.search-box {
flex: 1;
min-width: 250px;
position: relative;
}
.search-box input {
width: 100%;
padding: 10px 15px;
border: 1px solid var(--border-color);
border-radius: 6px;
background-color: var(--bg-primary);
color: var(--text-primary);
font-size: 0.95rem;
}
.filter-group {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 0.9rem;
font-weight: 500;
transition: all 0.2s;
background-color: var(--bg-card);
color: var(--text-primary);
border: 1px solid var(--border-color);
}
.btn:hover {
transform: translateY(-1px);
box-shadow: var(--shadow);
}
.btn.active {
background-color: var(--accent-color);
color: white;
border-color: var(--accent-color);
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.stat-card {
background-color: var(--bg-card);
padding: 20px;
border-radius: 8px;
box-shadow: var(--shadow);
transition: transform 0.2s;
}
.stat-card:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-lg);
}
.stat-value {
font-size: 2rem;
font-weight: bold;
color: var(--accent-color);
}
.stat-label {
color: var(--text-secondary);
font-size: 0.9rem;
margin-top: 5px;
}
.section {
margin-bottom: 40px;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.section-title {
font-size: 1.5rem;
font-weight: 600;
}
.sessions-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 20px;
}
.session-card {
background-color: var(--bg-card);
border-radius: 8px;
box-shadow: var(--shadow);
padding: 20px;
transition: all 0.3s;
}
.session-card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg);
}
.session-header {
display: flex;
justify-content: space-between;
align-items: start;
margin-bottom: 15px;
}
.session-title {
font-size: 1.2rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 5px;
}
.session-status {
padding: 4px 12px;
border-radius: 12px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
}
.status-active {
background-color: #c6f6d5;
color: #22543d;
}
.status-archived {
background-color: #e2e8f0;
color: #4a5568;
}
[data-theme="dark"] .status-active {
background-color: #22543d;
color: #c6f6d5;
}
[data-theme="dark"] .status-archived {
background-color: #4a5568;
color: #e2e8f0;
}
.session-meta {
display: flex;
gap: 15px;
font-size: 0.85rem;
color: var(--text-secondary);
margin-bottom: 15px;
}
.progress-bar {
width: 100%;
height: 8px;
background-color: var(--bg-primary);
border-radius: 4px;
overflow: hidden;
margin: 15px 0;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent-color), var(--success-color));
transition: width 0.3s;
}
.tasks-list {
margin-top: 15px;
}
.task-item {
display: flex;
align-items: center;
padding: 10px;
margin-bottom: 8px;
background-color: var(--bg-primary);
border-radius: 6px;
border-left: 3px solid var(--border-color);
transition: all 0.2s;
}
.task-item:hover {
transform: translateX(4px);
}
.task-item.completed {
border-left-color: var(--success-color);
opacity: 0.8;
}
.task-item.in_progress {
border-left-color: var(--warning-color);
}
.task-item.pending {
border-left-color: var(--text-secondary);
}
.task-checkbox {
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid var(--border-color);
margin-right: 12px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.task-item.completed .task-checkbox {
background-color: var(--success-color);
border-color: var(--success-color);
}
.task-item.completed .task-checkbox::after {
content: '✓';
color: white;
font-size: 0.8rem;
font-weight: bold;
}
.task-item.in_progress .task-checkbox {
border-color: var(--warning-color);
background-color: var(--warning-color);
}
.task-item.in_progress .task-checkbox::after {
content: '⟳';
color: white;
font-size: 0.9rem;
}
.task-title {
flex: 1;
font-size: 0.9rem;
}
.task-id {
font-size: 0.75rem;
color: var(--text-secondary);
font-family: monospace;
margin-left: 10px;
}
.empty-state {
text-align: center;
padding: 60px 20px;
color: var(--text-secondary);
}
.empty-state-icon {
font-size: 4rem;
margin-bottom: 20px;
opacity: 0.5;
}
.theme-toggle {
position: fixed;
bottom: 30px;
right: 30px;
width: 60px;
height: 60px;
border-radius: 50%;
background-color: var(--accent-color);
color: white;
border: none;
cursor: pointer;
font-size: 1.5rem;
box-shadow: var(--shadow-lg);
transition: all 0.3s;
z-index: 1000;
}
.theme-toggle:hover {
transform: scale(1.1);
}
@media (max-width: 768px) {
.sessions-grid {
grid-template-columns: 1fr;
}
.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
h1 {
font-size: 1.5rem;
}
.header-controls {
flex-direction: column;
align-items: stretch;
}
.search-box {
width: 100%;
}
}
.badge {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
margin-left: 8px;
}
.badge-count {
background-color: var(--accent-color);
color: white;
}
.session-footer {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid var(--border-color);
font-size: 0.85rem;
color: var(--text-secondary);
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>🚀 Workflow Dashboard</h1>
<p style="color: var(--text-secondary);">Task Board - Active and Archived Sessions</p>
<div class="header-controls">
<div class="search-box">
<input type="text" id="searchInput" placeholder="🔍 Search tasks or sessions..." />
</div>
<div class="filter-group">
<button class="btn active" data-filter="all">All</button>
<button class="btn" data-filter="active">Active</button>
<button class="btn" data-filter="archived">Archived</button>
</div>
</div>
</header>
<div class="stats-grid">
<div class="stat-card">
<div class="stat-value" id="totalSessions">0</div>
<div class="stat-label">Total Sessions</div>
</div>
<div class="stat-card">
<div class="stat-value" id="activeSessions">0</div>
<div class="stat-label">Active Sessions</div>
</div>
<div class="stat-card">
<div class="stat-value" id="totalTasks">0</div>
<div class="stat-label">Total Tasks</div>
</div>
<div class="stat-card">
<div class="stat-value" id="completedTasks">0</div>
<div class="stat-label">Completed Tasks</div>
</div>
</div>
<div class="section" id="activeSectionContainer">
<div class="section-header">
<h2 class="section-title">📋 Active Sessions</h2>
</div>
<div class="sessions-grid" id="activeSessions"></div>
</div>
<div class="section" id="archivedSectionContainer">
<div class="section-header">
<h2 class="section-title">📦 Archived Sessions</h2>
</div>
<div class="sessions-grid" id="archivedSessions"></div>
</div>
</div>
<button class="theme-toggle" id="themeToggle">🌙</button>
<script>
// Workflow data will be injected here
const workflowData = {{WORKFLOW_DATA}};
// Theme management
function initTheme() {
const savedTheme = localStorage.getItem('theme') || 'light';
document.documentElement.setAttribute('data-theme', savedTheme);
updateThemeIcon(savedTheme);
}
function toggleTheme() {
const currentTheme = document.documentElement.getAttribute('data-theme');
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
document.documentElement.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
updateThemeIcon(newTheme);
}
function updateThemeIcon(theme) {
document.getElementById('themeToggle').textContent = theme === 'dark' ? '☀️' : '🌙';
}
// Statistics calculation
function updateStatistics() {
const stats = {
totalSessions: workflowData.activeSessions.length + workflowData.archivedSessions.length,
activeSessions: workflowData.activeSessions.length,
totalTasks: 0,
completedTasks: 0
};
workflowData.activeSessions.forEach(session => {
stats.totalTasks += session.tasks.length;
stats.completedTasks += session.tasks.filter(t => t.status === 'completed').length;
});
workflowData.archivedSessions.forEach(session => {
stats.totalTasks += session.taskCount || 0;
stats.completedTasks += session.taskCount || 0;
});
document.getElementById('totalSessions').textContent = stats.totalSessions;
document.getElementById('activeSessions').textContent = stats.activeSessions;
document.getElementById('totalTasks').textContent = stats.totalTasks;
document.getElementById('completedTasks').textContent = stats.completedTasks;
}
// Render session card
function createSessionCard(session, isActive) {
const card = document.createElement('div');
card.className = 'session-card';
card.dataset.sessionType = isActive ? 'active' : 'archived';
const completedTasks = isActive
? session.tasks.filter(t => t.status === 'completed').length
: (session.taskCount || 0);
const totalTasks = isActive ? session.tasks.length : (session.taskCount || 0);
const progress = totalTasks > 0 ? (completedTasks / totalTasks * 100) : 0;
let tasksHtml = '';
if (isActive && session.tasks.length > 0) {
tasksHtml = `
<div class="tasks-list">
${session.tasks.map(task => `
<div class="task-item ${task.status}">
<div class="task-checkbox"></div>
<div class="task-title">${task.title || 'Untitled Task'}</div>
<span class="task-id">${task.task_id || ''}</span>
</div>
`).join('')}
</div>
`;
}
card.innerHTML = `
<div class="session-header">
<div>
<h3 class="session-title">${session.session_id || 'Unknown Session'}</h3>
<div style="color: var(--text-secondary); font-size: 0.9rem; margin-top: 5px;">
${session.project || ''}
</div>
</div>
<span class="session-status ${isActive ? 'status-active' : 'status-archived'}">
${isActive ? 'Active' : 'Archived'}
</span>
</div>
<div class="session-meta">
<span>📅 ${session.created_at || session.archived_at || 'N/A'}</span>
<span>📊 ${completedTasks}/${totalTasks} tasks</span>
</div>
${totalTasks > 0 ? `
<div class="progress-bar">
<div class="progress-fill" style="width: ${progress}%"></div>
</div>
<div style="text-align: center; font-size: 0.85rem; color: var(--text-secondary);">
${Math.round(progress)}% Complete
</div>
` : ''}
${tasksHtml}
${!isActive && session.archive_path ? `
<div class="session-footer">
📁 Archive: ${session.archive_path}
</div>
` : ''}
`;
return card;
}
// Render all sessions
function renderSessions(filter = 'all') {
const activeContainer = document.getElementById('activeSessions');
const archivedContainer = document.getElementById('archivedSessions');
activeContainer.innerHTML = '';
archivedContainer.innerHTML = '';
if (filter === 'all' || filter === 'active') {
if (workflowData.activeSessions.length === 0) {
activeContainer.innerHTML = `
<div class="empty-state">
<div class="empty-state-icon">📭</div>
<p>No active sessions</p>
</div>
`;
} else {
workflowData.activeSessions.forEach(session => {
activeContainer.appendChild(createSessionCard(session, true));
});
}
}
if (filter === 'all' || filter === 'archived') {
if (workflowData.archivedSessions.length === 0) {
archivedContainer.innerHTML = `
<div class="empty-state">
<div class="empty-state-icon">📦</div>
<p>No archived sessions</p>
</div>
`;
} else {
workflowData.archivedSessions.forEach(session => {
archivedContainer.appendChild(createSessionCard(session, false));
});
}
}
// Show/hide sections
document.getElementById('activeSectionContainer').style.display =
(filter === 'all' || filter === 'active') ? 'block' : 'none';
document.getElementById('archivedSectionContainer').style.display =
(filter === 'all' || filter === 'archived') ? 'block' : 'none';
}
// Search functionality
function setupSearch() {
const searchInput = document.getElementById('searchInput');
searchInput.addEventListener('input', (e) => {
const query = e.target.value.toLowerCase();
const cards = document.querySelectorAll('.session-card');
cards.forEach(card => {
const text = card.textContent.toLowerCase();
card.style.display = text.includes(query) ? 'block' : 'none';
});
});
}
// Filter functionality
function setupFilters() {
const filterButtons = document.querySelectorAll('[data-filter]');
filterButtons.forEach(btn => {
btn.addEventListener('click', () => {
filterButtons.forEach(b => b.classList.remove('active'));
btn.classList.add('active');
renderSessions(btn.dataset.filter);
});
});
}
// Initialize
document.addEventListener('DOMContentLoaded', () => {
initTheme();
updateStatistics();
renderSessions();
setupSearch();
setupFilters();
document.getElementById('themeToggle').addEventListener('click', toggleTheme);
});
</script>
</body>
</html>

View File

@@ -52,7 +52,7 @@ RULES: Focus on direct relevance to task requirements
"
# Program Architecture (MANDATORY before planning)
~/.claude/scripts/get_modules_by_depth.sh
ccw tool exec get_modules_by_depth '{}'
# Content Search (rg preferred)
rg "pattern" --type js -n # Search JS files with line numbers

View File

@@ -582,7 +582,7 @@ prompts/
- **Complex** (implementation, migration): 20-60min (1200000-3600000ms)
- **Heavy** (large codebase, multi-file): 60-120min (3600000-7200000ms)
**Codex Multiplier**: 1.5x of allocated time
**Codex Multiplier**: 3x of allocated time (minimum 15min / 900000ms)
**Application**: All bash() wrapped commands including Gemini, Qwen and Codex executions

View File

@@ -1,11 +0,0 @@
# MCP Tool Strategy: Exa Usage
## ⚡ Exa Triggering Mechanisms
**Auto-Trigger**:
- User mentions "exa-code" or code-related queries → `mcp__exa__get_code_context_exa`
- Need current web information → `mcp__exa__web_search_exa`
**Manual Trigger**:
- Complex API research → Exa Code Context
- Real-time information needs → Exa Web Search

View File

@@ -0,0 +1,79 @@
# Tool Strategy
## ⚡ Exa Triggering Mechanisms
**Auto-Trigger**:
- User mentions "exa-code" or code-related queries → `mcp__exa__get_code_context_exa`
- Need current web information → `mcp__exa__web_search_exa`
**Manual Trigger**:
- Complex API research → Exa Code Context
- Real-time information needs → Exa Web Search
## ⚡ CCW edit_file Tool (AI-Powered Editing)
**When to Use**: Edit tool fails 1+ times on same file
### Usage
**Best for**: Code block replacements, function rewrites, multi-line changes
```bash
ccw tool exec edit_file --path "file.py" --old "def old():
pass" --new "def new():
return True"
```
**Parameters**:
- `--path`: File path to edit
- `--old`: Text to find and replace
- `--new`: New text to insert
**Features**:
- ✅ Exact text matching (precise and predictable)
- ✅ Auto line ending adaptation (CRLF/LF)
- ✅ No JSON escaping issues
- ✅ Multi-line text supported with quotes
### Fallback Strategy
1. **Edit fails 1+ times** → Use `ccw tool exec edit_file`
2. **Still fails** → Use Write to recreate file
## ⚡ sed Line Operations (Line Mode Alternative)
**When to Use**: Precise line number control (insert, delete, replace specific lines)
### Common Operations
```bash
# Insert after line 10
sed -i '10a\new line content' file.txt
# Insert before line 5
sed -i '5i\new line content' file.txt
# Delete line 3
sed -i '3d' file.txt
# Delete lines 5-8
sed -i '5,8d' file.txt
# Replace line 3 content
sed -i '3c\replacement line' file.txt
# Replace lines 3-5 content
sed -i '3,5c\single replacement line' file.txt
```
### Operation Reference
| Operation | Command | Example |
|-----------|---------|---------|
| Insert after | `Na\text` | `sed -i '10a\new' file` |
| Insert before | `Ni\text` | `sed -i '5i\new' file` |
| Delete line | `Nd` | `sed -i '3d' file` |
| Delete range | `N,Md` | `sed -i '5,8d' file` |
| Replace line | `Nc\text` | `sed -i '3c\new' file` |
**Note**: Use `sed -i` for in-place file modification (works in Git Bash on Windows)

View File

@@ -433,7 +433,7 @@ The `[FLOW_CONTROL]` marker indicates that a task or prompt contains flow contro
"step": "load_context",
"action": "Load project context and patterns",
"commands": [
"bash(~/.claude/scripts/get_modules_by_depth.sh)",
"bash(ccw tool exec get_modules_by_depth '{}')",
"Read(CLAUDE.md)"
],
"output_to": "project_structure",
@@ -782,15 +782,11 @@ All workflows use the same file structure definition regardless of complexity. *
**Examples**:
*Analysis Commands (read-only):*
- `/cli:analyze "security"` (no session) → `.scratchpad/analyze-security-20250105-143022.md`
- `/cli:chat "build process"` (unrelated to active session) → `.scratchpad/chat-build-process-20250105-143045.md`
- `/cli:mode:plan "feature idea"` (exploratory) → `.scratchpad/plan-feature-idea-20250105-143110.md`
- `/cli:mode:code-analysis "trace auth flow"` (no session) → `.scratchpad/code-analysis-auth-flow-20250105-143130.md`
*Workflow Commands (lightweight):*
- `/workflow:lite-plan "feature idea"` (exploratory) → `.scratchpad/lite-plan-feature-idea-20250105-143110.md`
- `/workflow:lite-fix "bug description"` (bug fixing) → `.scratchpad/lite-fix-bug-20250105-143130.md`
*Implementation Commands (⚠️ modifies code):*
- `/cli:execute "implement JWT auth"` (no session) → `.scratchpad/execute-jwt-auth-20250105-143200.md`
- `/cli:codex-execute "refactor API layer"` (no session) → `.scratchpad/codex-execute-api-refactor-20250105-143230.md`
> **Note**: Direct CLI commands (`/cli:analyze`, `/cli:execute`, etc.) have been replaced by semantic invocation and workflow commands.
**Maintenance**:
- Periodically review and clean up old scratchpad files

51
.npmignore Normal file
View File

@@ -0,0 +1,51 @@
# Git
.git/
.gitignore
.gitattributes
# History and temp files
.history/
*.log
*.tmp
# Development files
.vscode/
.idea/
*.md
!README.md
!CLAUDE.md
# Workflow runtime data
.workflow/
# Test files
test/
tests/
*.test.js
*.spec.js
# Build artifacts
node_modules/
*.tgz
# OS files
.DS_Store
Thumbs.db
# Documentation (keep only essential)
CHANGELOG.md
CONTRIBUTING.md
COMMAND_REFERENCE.md
COMMAND_SPEC.md
FAQ.md
GETTING_STARTED.md
GETTING_STARTED_CN.md
# PowerShell installer (not needed for npm)
Install-Claude.ps1
install-remote.ps1
# ccw internal files
ccw/package.json
ccw/node_modules/
ccw/*.md

View File

@@ -5,6 +5,33 @@ All notable changes to Claude Code Workflow (CCW) will be documented in this fil
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [6.1.3] - 2025-12-09
### 🔧 CLI Tool Simplification
This release simplifies the `ccw tool exec edit_file` command for better usability.
#### 🔄 Changed
- **Simplified edit_file**: Removed JSON input support, now uses parameter-based input only (`--path`, `--old`, `--new`)
- **Removed line mode**: Line operations now recommended via `sed` command
- **Updated tool-strategy.md**: Added sed as line operation alternative with usage examples
#### Usage
```bash
ccw tool exec edit_file --path "file.txt" --old "old text" --new "new text"
```
## [6.1.2] - 2025-12-09
### 🔔 Dashboard Update Notification & Bug Fixes
#### ✨ Added
- **Version Update Notification**: Dashboard now checks npm registry for updates and displays upgrade banner
- **Version Check API**: New `/api/version-check` endpoint with 1-hour cache
#### 🐛 Fixed
- **Hook Manager**: Fixed button click event handling for edit/delete operations (changed `e.target` to `e.currentTarget`)
## [5.9.6] - 2025-11-28
### 🚀 Review Cycle & Dashboard Enhancement

View File

@@ -5,7 +5,7 @@
This document defines project-specific coding standards and development principles.
### CLI Tool Context Protocols
For all CLI tool usage, command syntax, and integration guidelines:
- **MCP Tool Strategy**: @~/.claude/workflows/mcp-tool-strategy.md
- **Tool Strategy**: @~/.claude/workflows/tool-strategy.md
- **Intelligent Context Strategy**: @~/.claude/workflows/intelligent-tools-strategy.md
- **Context Search Commands**: @~/.claude/workflows/context-search-strategy.md
@@ -73,6 +73,7 @@ For all CLI tool usage, command syntax, and integration guidelines:
- Update plan documentation and progress tracking as you go
- Learn from existing implementations
- Stop after 3 failed attempts and reassess
- **Edit fallback**: When Edit tool fails 2+ times on same file, try Bash sed/awk first, then Write to recreate if still failing
## Platform-Specific Guidelines

View File

@@ -4,21 +4,13 @@ This document provides a comprehensive reference for all commands available in t
> **Version 5.9.6 Update**: Enhanced review cycle with dashboards, optimized lite-plan with parallel execution, and added lite-fix workflow for intelligent bug diagnosis.
## Unified CLI Commands (`/cli:*`)
These commands provide direct access to AI tools for quick analysis and interaction without initiating a full workflow.
## CLI Commands (`/cli:*`)
| Command | Description |
|---|---|
| `/cli:analyze` | Quick codebase analysis using CLI tools (codex/gemini/qwen). |
| `/cli:chat` | Simple CLI interaction command for direct codebase analysis. |
| `/cli:cli-init`| Initialize CLI tool configurations (Gemini and Qwen) based on workspace analysis. |
| `/cli:codex-execute` | Automated task decomposition and execution with Codex using resume mechanism. |
| `/cli:discuss-plan` | Orchestrates an iterative, multi-model discussion for planning and analysis without implementation. |
| `/cli:execute` | Auto-execution of implementation tasks with YOLO permissions and intelligent context inference. |
| `/cli:mode:bug-diagnosis` | Bug analysis and fix suggestions using CLI tools. |
| `/cli:mode:code-analysis` | Deep code analysis and debugging using CLI tools with specialized template. |
| `/cli:mode:plan` | Project planning and architecture analysis using CLI tools. |
> **Note**: For analysis, planning, and bug fixing, use workflow commands (`/workflow:lite-plan`, `/workflow:lite-fix`) or semantic invocation through natural language.
## Workflow Commands (`/workflow:*`)

View File

@@ -191,25 +191,7 @@ Commands for creating, listing, and managing workflow sessions.
## 5. CLI Commands
Direct access to AI tools for analysis and code interaction without a full workflow structure.
### **/cli:analyze**
- **Syntax**: `/cli:analyze [--agent] [--tool codex|gemini|qwen] [--enhance] <analysis target>`
- **Responsibilities**: Performs read-only codebase analysis. Can operate in standard mode (direct tool call) or agent mode (`@cli-execution-agent`) for automated context discovery.
- **Agent Calls**: `@cli-execution-agent` (if `--agent` is used).
- **Example**:
```bash
/cli:analyze "authentication patterns"
```
### **/cli:chat**
- **Syntax**: `/cli:chat [--agent] [--tool codex|gemini|qwen] [--enhance] <inquiry>`
- **Responsibilities**: Provides a direct Q&A interface with AI tools for codebase questions. Read-only.
- **Agent Calls**: `@cli-execution-agent` (if `--agent` is used).
- **Example**:
```bash
/cli:chat "how does the caching layer work?"
```
CLI tool configuration commands.
### **/cli:cli-init**
- **Syntax**: `/cli:cli-init [--tool gemini|qwen|all] [--output path] [--preview]`
@@ -220,59 +202,7 @@ Direct access to AI tools for analysis and code interaction without a full workf
/cli:cli-init
```
### **/cli:codex-execute**
- **Syntax**: `/cli:codex-execute [--verify-git] <description|task-id>`
- **Responsibilities**: Orchestrates automated task decomposition and sequential execution using Codex. It uses the `resume --last` mechanism for context continuity between subtasks.
- **Agent Calls**: None directly, but orchestrates `codex` CLI tool.
- **Example**:
```bash
/cli:codex-execute "implement user authentication system"
```
### **/cli:discuss-plan**
- **Syntax**: `/cli:discuss-plan [--topic '...'] [--task-id '...'] [--rounds N] <input>`
- **Responsibilities**: Orchestrates an iterative, multi-model (Gemini, Codex, Claude) discussion to perform deep analysis and planning without modifying code.
- **Agent Calls**: None directly, but orchestrates `gemini` and `codex` CLI tools.
- **Example**:
```bash
/cli:discuss-plan --topic "Design a new caching layer"
```
### **/cli:execute**
- **Syntax**: `/cli:execute [--agent] [--tool codex|gemini|qwen] [--enhance] <description|task-id>`
- **Responsibilities**: Executes implementation tasks with auto-approval (`YOLO` mode). **MODIFIES CODE**.
- **Agent Calls**: `@cli-execution-agent` (if `--agent` is used).
- **Example**:
```bash
/cli:execute "implement JWT authentication with middleware"
```
### **/cli:mode:bug-diagnosis**
- **Syntax**: `/cli:mode:bug-diagnosis [--tool ...] [--enhance] [--cd path] <bug description>`
- **Responsibilities**: Performs systematic bug analysis using the `bug-fix.md` template. Read-only.
- **Agent Calls**: `@cli-execution-agent` (default).
- **Example**:
```bash
/cli:mode:bug-diagnosis "null pointer error in login flow"
```
### **/cli:mode:code-analysis**
- **Syntax**: `/cli:mode:code-analysis [--agent] [--tool ...] [--enhance] [--cd path] <analysis target>`
- **Responsibilities**: Performs deep code analysis and execution path tracing using the `code-analysis.md` template. Read-only.
- **Agent Calls**: `@cli-execution-agent` (if `--agent` is used).
- **Example**:
```bash
/cli:mode:code-analysis "trace authentication execution flow"
```
### **/cli:mode:plan**
- **Syntax**: `/cli:mode:plan [--agent] [--tool ...] [--enhance] [--cd path] <topic>`
- **Responsibilities**: Performs comprehensive planning and architecture analysis using the `plan.md` template. Read-only.
- **Agent Calls**: `@cli-execution-agent` (if `--agent` is used).
- **Example**:
```bash
/cli:mode:plan "design user dashboard architecture"
```
> **Note**: For analysis, planning, and bug fixing, use workflow commands (`/workflow:lite-plan`, `/workflow:lite-fix`) or semantic invocation through natural language. Claude will automatically use appropriate CLI tools (Gemini/Qwen/Codex) with templates as needed.
---
@@ -380,13 +310,14 @@ Commands for managing individual tasks within a workflow session.
```
### **/enhance-prompt**
- **Syntax**: `/enhance-prompt <user input>`
- **Responsibilities**: A system-level skill that enhances a user's prompt by adding context from session memory and codebase analysis. It is typically triggered automatically by other commands that include the `--enhance` flag.
- **Skill Invocation**: This is a core skill, invoked when `--enhance` is used.
- **Syntax**: `/enhance-prompt <user input>` or use `-e` flag in conversation
- **Responsibilities**: A system-level skill that enhances a user's prompt by adding context from session memory and codebase analysis. It is typically triggered by the `-e` flag in natural conversation.
- **Skill Invocation**: This is a core skill, invoked when `-e` is used in conversation.
- **Agent Calls**: None.
- **Example (as part of another command)**:
```bash
/cli:execute --enhance "fix the login button"
- **Example (in natural conversation)**:
```
User: "fix the login button -e"
→ Prompt-enhancer expands and enhances the request
```
---

24
FAQ.md
View File

@@ -248,16 +248,16 @@ CCW-help
### What's the difference between `/cli:*` and `/workflow:*` commands?
**`/cli:*` commands**:
- Direct access to external AI tools
- No workflow session required
- Quick one-off tasks
- Examples: `/cli:analyze`, `/cli:chat`
- CLI tool configuration
- Example: `/cli:cli-init` (initialize Gemini/Qwen configurations)
**`/workflow:*` commands**:
- Multi-phase orchestration
- Session-based
- Complex development workflows
- Examples: `/workflow:plan`, `/workflow:execute`
- Examples: `/workflow:plan`, `/workflow:lite-plan`, `/workflow:lite-fix`
> **Note**: Most CLI commands have been replaced by **semantic invocation**. Simply describe your needs in natural language, and Claude will automatically use the appropriate tools.
### How do I use command flags?
@@ -270,9 +270,6 @@ Most commands support flags for customization:
# With CLI execution flag
/workflow:plan --cli-execute "Feature description"
# With tool selection
/cli:analyze --tool gemini "Code analysis"
# With multiple flags
/workflow:ui-design:explore-auto --prompt "Login page" --style-variants 3 --layout-variants 2
```
@@ -281,17 +278,12 @@ Most commands support flags for customization:
**Yes!** Claude understands semantic invocation:
Instead of:
```bash
/cli:analyze --tool gemini "Authentication module"
```
You can say:
Instead of using specific commands, you can say:
```
"Use Gemini to analyze the authentication module architecture"
```
Claude will automatically execute the appropriate command.
Claude will automatically select and execute the appropriate CLI tools (Gemini/Qwen/Codex) with optimized templates.
### What does the `-e` or `--enhance` flag do?
@@ -303,8 +295,6 @@ User: "Analyze authentication module -e"
Claude will expand and enhance your request for better results.
**Note**: `--enhance` in CLI commands (e.g., `/cli:analyze --enhance`) is a different feature built into CLI tools.
---
## 📦 Sessions & Tasks

View File

@@ -178,62 +178,36 @@ After planning, validate your implementation plan for consistency and completene
Quick bug analysis and fix workflow:
```bash
# Analyze the bug
/cli:mode:bug-diagnosis "Incorrect success message with wrong password"
# Lightweight bug fix workflow with intelligent diagnosis
/workflow:lite-fix "Incorrect success message with wrong password"
# Claude will analyze and then directly implement the fix based on the analysis
# Claude will analyze severity, diagnose root cause, and implement the fix
```
---
## 🔧 Workflow-Free Usage: Standalone Tools
## 🔧 Lightweight Commands
Beyond the full workflow mode, CCW provides standalone CLI tools and commands suitable for quick analysis, ad-hoc queries, and routine maintenance tasks.
Beyond the full workflow mode, CCW provides lightweight commands suitable for quick analysis and routine tasks.
### Direct CLI Tool Invocation
### Workflow Commands for Quick Tasks
CCW supports direct invocation of external AI tools (Gemini, Qwen, Codex) through a unified CLI interface without creating workflow sessions.
#### Code Analysis
Quickly analyze project code structure and architectural patterns:
Use workflow commands for integrated planning and bug fixing:
```bash
# Code analysis with Gemini
/cli:analyze --tool gemini "Analyze authentication module architecture"
# Lightweight planning workflow
/workflow:lite-plan "Design a scalable microservices architecture"
# Code quality analysis with Qwen
/cli:analyze --tool qwen "Review database model design for best practices"
# Bug fix workflow with intelligent diagnosis
/workflow:lite-fix "Analyze potential causes of memory leak"
# Initialize CLI tool configurations
/cli:cli-init
```
#### Interactive Chat
### Semantic Tool Invocation (Replaces Direct CLI Commands)
Direct interactive dialogue with AI tools:
```bash
# Chat with Gemini
/cli:chat --tool gemini "Explain React Hook use cases"
# Discuss implementation with Codex
/cli:chat --tool codex "How to optimize this query performance"
```
#### Specialized Analysis Modes
Use specific analysis modes for in-depth exploration:
```bash
# Architecture planning mode
/cli:mode:plan --tool gemini "Design a scalable microservices architecture"
# Deep code analysis
/cli:mode:code-analysis --tool qwen "Analyze utility functions in src/utils/"
# Bug analysis mode
/cli:mode:bug-index --tool gemini "Analyze potential causes of memory leak"
```
### Semantic Tool Invocation
> **Important**: Direct CLI commands (`/cli:analyze`, `/cli:chat`, `/cli:execute`, etc.) have been replaced by **semantic invocation**. Simply describe your needs in natural language, and Claude will automatically select and execute the appropriate CLI tools (Gemini/Qwen/Codex) with optimized templates.
Users can tell Claude to use specific tools through natural language, and Claude will understand the intent and automatically execute the appropriate commands.
@@ -381,13 +355,7 @@ User: "Analyze authentication module -e"
→ AI uses prompt-enhancer skill to expand the request
```
**CLI Command Enhancement** (built-in CLI feature):
```bash
# The --enhance flag here is a CLI parameter, not a skill trigger
/cli:analyze --enhance "check for security issues"
```
**Important Note**: The `-e` flag works in natural conversation, but `--enhance` in CLI commands is a separate enhancement mechanism, not the skill system.
**Important Note**: The `-e` flag works in natural conversation to trigger the prompt-enhancer skill.
---

View File

@@ -188,62 +188,36 @@
快速 Bug 分析和修复工作流:
```bash
# 分析 Bug
/cli:mode:bug-diagnosis "密码错误时仍显示成功消息"
# 轻量级 Bug 修复工作流,带智能诊断
/workflow:lite-fix "密码错误时仍显示成功消息"
# Claude 会分析后直接根据分析结果实现修复
# Claude 会分析严重程度,诊断根因,并实现修复
```
---
## 🔧 无工作流协作:独立工具使用
## 🔧 轻量级命令
除了完整的工作流模式CCW 还提供独立的 CLI 工具和命令,适合快速分析、临时查询和日常维护任务。
除了完整的工作流模式CCW 还提供轻量级命令,适合快速分析和日常任务。
### CLI 工具直接调用
### 快速任务工作流命令
CCW 支持通过统一的 CLI 接口直接调用外部 AI 工具Gemini、Qwen、Codex无需创建工作流会话。
#### 代码分析
快速分析项目代码结构和架构模式:
使用工作流命令进行集成规划和 Bug 修复:
```bash
# 使用 Gemini 进行代码分析
/cli:analyze --tool gemini "分析认证模块的架构设计"
# 轻量级规划工作流
/workflow:lite-plan "设计一个可扩展的微服务架构"
# 使用 Qwen 分析代码质量
/cli:analyze --tool qwen "检查数据库模型的设计是否合理"
# 带智能诊断的 Bug 修复工作流
/workflow:lite-fix "分析内存泄漏问题的可能原因"
# 初始化 CLI 工具配置
/cli:cli-init
```
#### 交互式对话
### 语义调用(替代直接 CLI 命令)
与 AI 工具进行直接交互式对话:
```bash
# 与 Gemini 交互
/cli:chat --tool gemini "解释一下 React Hook 的使用场景"
# 与 Codex 交互讨论实现方案
/cli:chat --tool codex "如何优化这个查询性能"
```
#### 专业模式分析
使用特定的分析模式进行深度探索:
```bash
# 架构分析模式
/cli:mode:plan --tool gemini "设计一个可扩展的微服务架构"
# 深度代码分析
/cli:mode:code-analysis --tool qwen "分析 src/utils/ 目录下的工具函数"
# Bug 分析模式
/cli:mode:bug-diagnosis --tool gemini "分析内存泄漏问题的可能原因"
```
### 工具语义调用
> **重要**: 直接 CLI 命令(`/cli:analyze`、`/cli:chat`、`/cli:execute` 等)已被**语义调用**替代。只需使用自然语言描述您的需求Claude 会自动选择并执行合适的 CLI 工具Gemini/Qwen/Codex和优化的模板。
用户可以通过自然语言告诉 Claude 使用特定工具完成任务Claude 会理解意图并自动执行相应的命令。
@@ -391,13 +365,7 @@ CCW 使用分层的 CLAUDE.md 文档系统维护项目上下文。定期更新
→ AI 使用 prompt-enhancer 技能扩展请求
```
**CLI 命令增强** (CLI 内置功能):
```bash
# 这里的 --enhance 标识符是 CLI 参数,不是技能触发器
/cli:analyze --enhance "检查安全问题"
```
**重要说明**`-e` 标识符仅在自然对话中有效,而 CLI 命令中的 `--enhance` 是独立的增强机制,与技能系统无关。
**重要说明**`-e` 标识符用于在自然对话中触发 prompt-enhancer 技能。
---

View File

@@ -1,8 +1,12 @@
# 🚀 Claude Code Workflow (CCW)
[![Run in Smithery](https://smithery.ai/badge/skills/catlog22)](https://smithery.ai/skills?ns=catlog22&utm_source=github&utm_medium=badge)
<div align="center">
[![Version](https://img.shields.io/badge/version-v5.9.6-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases)
[![Version](https://img.shields.io/badge/version-v6.1.3-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases)
[![npm](https://img.shields.io/npm/v/claude-code-workflow.svg)](https://www.npmjs.com/package/claude-code-workflow)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)]()
@@ -12,16 +16,13 @@
---
**Claude Code Workflow (CCW)** transforms AI development from simple prompt chaining into a powerful, context-first orchestration system. It solves execution uncertainty and error accumulation through structured planning, deterministic execution, and intelligent multi-model orchestration.
**Claude Code Workflow (CCW)** is a JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution. It transforms AI development from simple prompt chaining into a powerful orchestration system.
> **🎉 Version 5.9.6: Review Cycle Enhancement & Dashboard Automation**
> **🎉 Version 6.1.3: CLI Tool Simplification**
>
> **Core Improvements**:
> - **Enhanced Review Dashboard**: The `review-cycle` dashboard now supports real-time progress tracking and advanced filtering for better visibility into code reviews.
> - 🎯 **New Fix-Tracking Dashboard**: Introduced a new, independent `fix-dashboard.html` to monitor the progress of bug fixes with rich data integration.
> - 🚀 **`lite-fix` Workflow**: Added a new `lite-fix` command for intelligent, streamlined bug diagnosis and resolution.
> - 🛠️ **`lite-plan` Optimization**: Significantly optimized the `lite-plan` workflow with cost-aware parallel execution, better complexity analysis, and robust context protection.
> - 🧠 **Intelligent Test Cycles**: Improved the `test-cycle-execute` command with smart iteration strategies and a universal `@test-fix-agent` for more effective testing.
> - 🔧 **Simplified edit_file**: Parameter-based input only (`--path`, `--old`, `--new`)
> - 📝 **Updated tool-strategy.md**: Added sed as line operation alternative
>
> See [CHANGELOG.md](CHANGELOG.md) for complete details.
@@ -44,18 +45,23 @@ CCW is built on a set of core principles that distinguish it from traditional AI
## ⚙️ Installation
For detailed installation instructions, refer to the [**INSTALL.md**](INSTALL.md) guide.
### **📦 npm Install (Recommended)**
### **🚀 One-Click Quick Install**
**Windows (PowerShell):**
```powershell
Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.ps1" -UseBasicParsing).Content
Install globally via npm:
```bash
npm install -g claude-code-workflow
```
**Linux/macOS (Bash/Zsh):**
Then install workflow files to your system:
```bash
bash <(curl -fsSL https://raw.githubusercontent.com/catlog22/Claude-Code-Workflow/main/install-remote.sh)
# Interactive installation
ccw install
# Global installation (to ~/.claude)
ccw install -m Global
# Project-specific installation
ccw install -m Path -p /path/to/project
```
### **✅ Verify Installation**
@@ -67,6 +73,55 @@ If slash commands (e.g., `/workflow:*`) are recognized, the installation was suc
---
## 🖥️ CCW CLI Tool
The `ccw` command provides a powerful CLI for managing your Claude Code Workflow installation:
### **Commands**
| Command | Description |
|---------|-------------|
| `ccw install` | Install workflow files to Global (~/.claude) or specific Path |
| `ccw upgrade` | Upgrade existing installations to current package version |
| `ccw uninstall` | Remove workflow files from an installation |
| `ccw view` | Open the workflow dashboard in browser |
| `ccw serve` | Start dashboard server without opening browser |
| `ccw list` | List all managed installations |
### **Usage Examples**
```bash
# Install globally
ccw install -m Global
# Install to specific project
ccw install -m Path -p ./my-project
# Open dashboard
ccw view
# Start dashboard server on custom port
ccw serve -p 8080
# Upgrade all installations
ccw upgrade -a
# List installations
ccw list
```
### **Dashboard Features**
The CCW Dashboard (`ccw view`) provides:
- 📊 **Session Overview**: View all workflow sessions with status and progress
- 📋 **Task Management**: Track task execution and completion
- 🔍 **Review Sessions**: Manage code review cycles
- ⚙️ **MCP Manager**: Configure and monitor MCP servers
- 🪝 **Hook Manager**: Manage Claude Code hooks
- 📁 **Project Explorer**: Navigate project structure and artifacts
---
## 🛠️ Command Reference
CCW provides a rich set of commands for managing workflows, tasks, and interactions with AI tools. For a complete list and detailed descriptions of all available commands, please refer to the [**COMMAND_REFERENCE.md**](COMMAND_REFERENCE.md) file.

View File

@@ -2,7 +2,8 @@
<div align="center">
[![Version](https://img.shields.io/badge/version-v5.9.6-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases)
[![Version](https://img.shields.io/badge/version-v6.1.0-blue.svg)](https://github.com/catlog22/Claude-Code-Workflow/releases)
[![npm](https://img.shields.io/npm/v/claude-code-workflow.svg)](https://www.npmjs.com/package/claude-code-workflow)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)]()
@@ -14,14 +15,13 @@
**Claude Code Workflow (CCW)** 将 AI 开发从简单的提示词链接转变为一个强大的、上下文优先的编排系统。它通过结构化规划、确定性执行和智能多模型编排,解决了执行不确定性和误差累积的问题。
> **🎉 版本 5.9.6: 审查周期增强与仪表盘自动化**
> **🎉 版本 6.1.0: 仪表盘图标统一 & CCW 工具系统**
>
> **核心改进**:
> - **增强的审查仪表盘** - `review-cycle` 仪表盘支持实时进度跟踪和高级过滤
> - 🎯 **新修复追踪仪表盘** - 新增独立的 `fix-dashboard.html` 监控 Bug 修复进度
> - 🚀 **`lite-fix` 工作流** - 新增智能化、流程化的 Bug 诊断和修复命令
> - 🛠️ **`lite-plan` 优化** - 成本感知并行执行、智能复杂度分析、健壮的上下文保护
> - 🧠 **智能测试周期** - 改进 `test-cycle-execute` 智能迭代策略和通用 `@test-fix-agent`
> - 🎨 **仪表盘图标统一** - 全面迁移至 Lucide Icons 图标库
> - 🛠️ **CCW Tool Exec 系统** - 新增 `ccw tool exec` 命令,支持 JSON 参数执行工具
> - 🚀 **Explorer 增强** - 异步任务执行、CLI 选择器改进、WebSocket 帧处理
> - **智能服务器识别** - 智能工作空间切换和 MCP 多源配置
>
> 详见 [CHANGELOG.md](CHANGELOG.md)。

View File

@@ -16,7 +16,7 @@ flowchart TD
BugFix --> BugSeverity{了解问题根因?}
BugSeverity -->|清楚| LiteFix[/ /workflow:lite-fix<br>标准Bug修复 /]
BugSeverity -->|生产事故| HotFix[/ /workflow:lite-fix --hotfix<br>热修复模式 /]
BugSeverity -->|不清楚| BugDiag[/ /cli:mode:bug-diagnosis<br>诊断根因 /]
BugSeverity -->|不清楚| BugDiag[/ /workflow:lite-fix<br>自动诊断根因 /]
BugDiag --> LiteFix
LiteFix --> BugComplete[Bug修复完成]
@@ -142,7 +142,7 @@ flowchart TD
|------|------|------|
| 🐛 **标准Bug修复** | `/workflow:lite-fix "bug描述"` | 自适应严重性评估,完整诊断→影响评估→修复→验证 |
| 🔥 **生产热修复** | `/workflow:lite-fix --hotfix "bug描述"` | 最小化诊断,快速修复,自动生成跟进任务 |
| ❓ **根因不清楚** | `/cli:mode:bug-diagnosis``/workflow:lite-fix` | 深度诊断,再执行修复 |
| ❓ **根因不清楚** | `/workflow:lite-fix` | 自动进行深度诊断执行修复 |
| ✅ **功能开发** | 继续后续流程 | 不是Bug修复按正常开发流程 |
**Lite-Fix 工作流特性**:
@@ -171,16 +171,16 @@ flowchart TD
→ 最小化诊断 → 假设 Critical → 手术式修复 → 烟雾测试
→ 自动生成: 全面修复任务3天内+ 事后分析1周内
# 根因不清楚(诊断)
/cli:mode:bug-diagnosis --tool gemini "购物车随机丢失商品"
→ 深度诊断报告/workflow:lite-fix "修复购物车状态同步问题"
# 根因不清楚(lite-fix 自动诊断)
/workflow:lite-fix "购物车随机丢失商品"
自动深度诊断 → 识别根因 → 实现修复
```
**何时使用 lite-fix**:
- ✅ 任何有明确症状的Bug自动适应严重性
- ✅ 本地化修复1-5个文件
- ✅ 生产事故(使用 `--hotfix` 模式)
- 根因完全不明 → 先用 `/cli:mode:bug-diagnosis`
- 根因不清楚(自动进行深度诊断)
- ❌ 需要架构变更 → 用 `/workflow:plan --mode bugfix`
---
@@ -416,33 +416,24 @@ Phase 1: Gemini 分析 ──┐
→ Claude Code 自动生成codex -C src/auth --full-auto exec "实现注册"
```
**方式二:直接命令调用**
```bash
# 通过 Slash 命令精准调用
/cli:chat --tool gemini "解释这个算法"
/cli:analyze --tool qwen "分析性能瓶颈"
/cli:execute --tool codex "优化查询性能"
```
---
#### 🔗 CLI 结果作为上下文Memory
#### 🔗 语义调用与结果上下文Memory
CLI 工具的分析结果可以被保存并作为后续操作的上下文memory实现智能化的工作流程
通过自然语言描述Claude 会自动选择并执行适当的 CLI 工具Gemini/Qwen/Codex分析结果作为后续操作的上下文。
**1. 结果持久化**
**1. 语义调用示例**
```bash
# CLI 执行结果自动保存到会话目录
/cli:chat --tool gemini "分析认证模块架构"
保存到:.workflow/active/WFS-xxx/.chat/chat-[timestamp].md
# 用自然语言描述需求Claude 自动选择工具
"使用 gemini 分析认证模块架构"
Claude 自动执行 Gemini CLI 并保存结果
/cli:analyze --tool qwen "评估性能瓶颈"
保存到:.workflow/active/WFS-xxx/.chat/analyze-[timestamp].md
"让 qwen 评估性能瓶颈"
Claude 自动执行 Qwen CLI 并保存结果
/cli:execute --tool codex "实现功能"
保存到:.workflow/active/WFS-xxx/.chat/execute-[timestamp].md
"用 codex 实现这个功能"
Claude 自动执行 Codex CLI
```
**2. 结果作为规划依据**
@@ -476,8 +467,8 @@ CLI 工具的分析结果可以被保存并作为后续操作的上下文memo
```bash
# 引用历史会话的分析结果
/cli:execute --tool codex "参考 WFS-2024-001 中的架构分析,实现新的支付模块"
系统自动加载指定会话的上下文
"参考 WFS-2024-001 中的架构分析,用 codex 实现新的支付模块"
Claude 自动加载指定会话的上下文
→ 基于历史分析进行实现
```

View File

@@ -348,33 +348,24 @@ Phase 1: Gemini analysis ──┐
→ Claude Code auto-generates: codex -C src/auth --full-auto exec "Implement registration"
```
**Method 2: Direct Command Invocation**
```bash
# Precise invocation via Slash commands
/cli:chat --tool gemini "Explain this algorithm"
/cli:analyze --tool qwen "Analyze performance bottlenecks"
/cli:execute --tool codex "Optimize query performance"
```
---
#### 🔗 CLI Results as Context (Memory)
#### 🔗 Semantic Invocation & Results Context (Memory)
CLI tool analysis results can be saved and used as context (memory) for subsequent operations, enabling intelligent workflows:
Through natural language, Claude automatically selects and executes appropriate CLI tools (Gemini/Qwen/Codex), with results serving as context for subsequent operations.
**1. Result Persistence**
**1. Semantic Invocation Examples**
```bash
# CLI execution results automatically saved to session directory
/cli:chat --tool gemini "Analyze authentication module architecture"
Saved to: .workflow/active/WFS-xxx/.chat/chat-[timestamp].md
# Describe needs in natural language, Claude auto-selects tools
"Use gemini to analyze authentication module architecture"
Claude auto-executes Gemini CLI and saves results
/cli:analyze --tool qwen "Evaluate performance bottlenecks"
Saved to: .workflow/active/WFS-xxx/.chat/analyze-[timestamp].md
"Have qwen evaluate performance bottlenecks"
Claude auto-executes Qwen CLI and saves results
/cli:execute --tool codex "Implement feature"
Saved to: .workflow/active/WFS-xxx/.chat/execute-[timestamp].md
"Use codex to implement this feature"
Claude auto-executes Codex CLI
```
**2. Results as Planning Basis**
@@ -408,8 +399,8 @@ Have codex synthesize above Gemini and Qwen analyses to implement optimal soluti
```bash
# Reference historical session analysis results
/cli:execute --tool codex "Refer to architecture analysis in WFS-2024-001, implement new payment module"
System automatically loads specified session context
"Refer to architecture analysis in WFS-2024-001, use codex to implement new payment module"
Claude automatically loads specified session context
→ Implement based on historical analysis
```
@@ -630,16 +621,13 @@ Use gemini to review code quality
### Scenario D: Bug Fixing
```bash
# 1. Diagnosis
/cli:mode:bug-diagnosis --tool gemini "User login fails with token expired error"
# 1. Intelligent bug fix workflow (includes diagnosis)
/workflow:lite-fix "User login fails with token expired error"
# 2. Quick fix
/workflow:lite-plan "Fix JWT token expiration validation logic"
# 3. Test fix
# 2. Test fix (if needed)
/workflow:test-cycle-execute
# 4. Complete
# 3. Complete
```
---
@@ -654,7 +642,7 @@ Use gemini to review code quality
| ❓ Know what, don't know how | `/workflow:brainstorm:auto-parallel "Design technical solution"` |
| ✅ Know what and how | `/workflow:plan "Specific implementation description"` |
| ⚡ Simple, clear small task | `/workflow:lite-plan "Task description"` |
| 🐛 Bug fixing | `/cli:mode:bug-diagnosis` + `/workflow:lite-plan` |
| 🐛 Bug fixing | `/workflow:lite-fix "bug description"` |
### Choose by Project Phase

121
ccw/README.md Normal file
View File

@@ -0,0 +1,121 @@
# CCW - Claude Code Workflow CLI
A command-line tool for viewing workflow sessions and code review results from the Claude Code Workflow system.
## Installation
```bash
# Install globally
npm install -g ccw
# Or install from local source
cd path/to/ccw
npm install
npm link
```
## Usage
### View Dashboard
```bash
# Open workflow dashboard in browser
ccw view
# Specify project path
ccw view -p /path/to/project
# Generate dashboard without opening browser
ccw view --no-browser
# Custom output path
ccw view -o report.html
```
## Features
### Workflow Dashboard
- **Active Sessions**: View all active workflow sessions with task progress
- **Archived Sessions**: Browse completed/archived sessions
- **Task Tracking**: See individual task status (pending/in_progress/completed)
- **Progress Bars**: Visual progress indicators for each session
### Review Integration
- **Code Review Findings**: View results from `review-module-cycle`
- **Severity Distribution**: Critical/High/Medium/Low finding counts
- **Dimension Analysis**: Findings by review dimension (Security, Architecture, Quality, etc.)
- **Tabbed Interface**: Switch between Workflow and Reviews tabs
## Dashboard Data Sources
The CLI reads data from the `.workflow/` directory structure:
```
.workflow/
├── active/
│ └── WFS-{session-id}/
│ ├── workflow-session.json # Session metadata
│ ├── .task/
│ │ └── IMPL-*.json # Task definitions
│ └── .review/
│ ├── review-progress.json # Review progress
│ └── dimensions/
│ └── *.json # Dimension findings
└── archives/
└── WFS-{session-id}/ # Archived sessions
```
## Bundled Templates
The CLI includes bundled dashboard templates:
- `workflow-dashboard.html` - Workflow session and task visualization
- `review-cycle-dashboard.html` - Code review findings display
No external template installation required - templates are included in the npm package.
## Requirements
- Node.js >= 16.0.0
- npm or yarn
## Integration with Claude Code Workflow
This CLI is a standalone tool that works with the Claude Code Workflow system:
1. **Install CCW CLI** (via npm)
- `npm install -g ccw`
- Provides `ccw view` command for dashboard viewing
- Templates are bundled - no additional installation required
2. **Optional: Install Claude Code Workflow** (via `Install-Claude.ps1`)
- Provides workflow commands, agents, and automation
- CCW will automatically detect and display workflow sessions
## Options
| Option | Description |
|--------|-------------|
| `-p, --path <path>` | Path to project directory (default: current directory) |
| `--no-browser` | Generate dashboard without opening browser |
| `-o, --output <file>` | Custom output path for HTML file |
| `-V, --version` | Display version number |
| `-h, --help` | Display help information |
## Development
```bash
# Clone and install dependencies
git clone <repo-url>
cd ccw
npm install
# Link for local testing
npm link
# Test the CLI
ccw view -p /path/to/test/project
```
## License
MIT

10
ccw/bin/ccw.js Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env node
/**
* CCW CLI - Claude Code Workflow Dashboard
* Entry point for global CLI installation
*/
import { run } from '../src/cli.js';
run(process.argv);

1914
ccw/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

47
ccw/package.json Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "ccw",
"version": "1.0.0",
"description": "Claude Code Workflow CLI - Dashboard viewer for workflow sessions and reviews",
"type": "module",
"main": "src/index.js",
"bin": {
"ccw": "./bin/ccw.js"
},
"scripts": {
"test": "node --test",
"lint": "eslint src/"
},
"keywords": [
"claude",
"workflow",
"cli",
"dashboard",
"code-review"
],
"author": "Claude Code Workflow",
"license": "MIT",
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"boxen": "^7.1.0",
"chalk": "^5.3.0",
"commander": "^11.0.0",
"figlet": "^1.7.0",
"glob": "^10.3.0",
"gradient-string": "^2.0.2",
"inquirer": "^9.2.0",
"open": "^9.1.0",
"ora": "^7.0.0"
},
"files": [
"bin/",
"src/",
"README.md",
"LICENSE"
],
"repository": {
"type": "git",
"url": "https://github.com/claude-code-workflow/ccw"
}
}

119
ccw/src/cli.js Normal file
View File

@@ -0,0 +1,119 @@
import { Command } from 'commander';
import { viewCommand } from './commands/view.js';
import { serveCommand } from './commands/serve.js';
import { stopCommand } from './commands/stop.js';
import { installCommand } from './commands/install.js';
import { uninstallCommand } from './commands/uninstall.js';
import { upgradeCommand } from './commands/upgrade.js';
import { listCommand } from './commands/list.js';
import { toolCommand } from './commands/tool.js';
import { readFileSync, existsSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/**
* Load package.json with error handling
* @returns {Object} - Package info with version
*/
function loadPackageInfo() {
const pkgPath = join(__dirname, '../package.json');
try {
if (!existsSync(pkgPath)) {
console.error('Fatal Error: package.json not found.');
console.error(`Expected location: ${pkgPath}`);
process.exit(1);
}
const content = readFileSync(pkgPath, 'utf8');
return JSON.parse(content);
} catch (error) {
if (error instanceof SyntaxError) {
console.error('Fatal Error: package.json contains invalid JSON.');
console.error(`Parse error: ${error.message}`);
} else {
console.error('Fatal Error: Could not read package.json.');
console.error(`Error: ${error.message}`);
}
process.exit(1);
}
}
const pkg = loadPackageInfo();
export function run(argv) {
const program = new Command();
program
.name('ccw')
.description('Claude Code Workflow CLI - Dashboard and workflow tools')
.version(pkg.version);
// View command (server mode with live path switching)
program
.command('view')
.description('Open workflow dashboard server with live path switching')
.option('-p, --path <path>', 'Path to project directory', '.')
.option('--port <port>', 'Server port', '3456')
.option('--no-browser', 'Start server without opening browser')
.action(viewCommand);
// Serve command (alias for view)
program
.command('serve')
.description('Alias for view command')
.option('-p, --path <path>', 'Initial project directory')
.option('--port <port>', 'Server port', '3456')
.option('--no-browser', 'Start server without opening browser')
.action(serveCommand);
// Stop command
program
.command('stop')
.description('Stop the running CCW dashboard server')
.option('--port <port>', 'Server port', '3456')
.option('-f, --force', 'Force kill process on the port')
.action(stopCommand);
// Install command
program
.command('install')
.description('Install Claude Code Workflow to your system')
.option('-m, --mode <mode>', 'Installation mode: Global or Path')
.option('-p, --path <path>', 'Installation path (for Path mode)')
.option('-f, --force', 'Force installation without prompts')
.action(installCommand);
// Uninstall command
program
.command('uninstall')
.description('Uninstall Claude Code Workflow')
.action(uninstallCommand);
// Upgrade command
program
.command('upgrade')
.description('Upgrade Claude Code Workflow installations')
.option('-a, --all', 'Upgrade all installations without prompting')
.action(upgradeCommand);
// List command
program
.command('list')
.description('List all installed Claude Code Workflow instances')
.action(listCommand);
// Tool command
program
.command('tool [subcommand] [args]')
.description('Execute CCW tools')
.option('--path <path>', 'File path (for edit_file)')
.option('--old <text>', 'Old text to replace (for edit_file)')
.option('--new <text>', 'New text (for edit_file)')
.action((subcommand, args, options) => toolCommand(subcommand, args, options));
program.parse(argv);
}

324
ccw/src/commands/install.js Normal file
View File

@@ -0,0 +1,324 @@
import { existsSync, mkdirSync, readdirSync, statSync, copyFileSync, readFileSync, writeFileSync } from 'fs';
import { join, dirname, basename } from 'path';
import { homedir } from 'os';
import { fileURLToPath } from 'url';
import inquirer from 'inquirer';
import chalk from 'chalk';
import { showHeader, createSpinner, info, warning, error, summaryBox, divider } from '../utils/ui.js';
import { createManifest, addFileEntry, addDirectoryEntry, saveManifest, findManifest, getAllManifests } from '../core/manifest.js';
import { validatePath } from '../utils/path-resolver.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Source directories to install
const SOURCE_DIRS = ['.claude', '.codex', '.gemini', '.qwen'];
// Get package root directory (ccw/src/commands -> ccw)
function getPackageRoot() {
return join(__dirname, '..', '..');
}
// Get source installation directory (parent of ccw)
function getSourceDir() {
return join(getPackageRoot(), '..');
}
/**
* Install command handler
* @param {Object} options - Command options
*/
export async function installCommand(options) {
const version = getVersion();
// Show beautiful header
showHeader(version);
// Check for existing installations
const existingManifests = getAllManifests();
if (existingManifests.length > 0 && !options.force) {
info('Existing installations detected:');
console.log('');
existingManifests.forEach((m, i) => {
console.log(chalk.gray(` ${i + 1}. ${m.installation_mode} - ${m.installation_path}`));
console.log(chalk.gray(` Installed: ${new Date(m.installation_date).toLocaleDateString()}`));
});
console.log('');
const { proceed } = await inquirer.prompt([{
type: 'confirm',
name: 'proceed',
message: 'Continue with new installation?',
default: true
}]);
if (!proceed) {
info('Installation cancelled');
return;
}
}
// Local installation from package source
const sourceDir = getSourceDir();
// Interactive mode selection
const mode = options.mode || await selectMode();
let installPath;
if (mode === 'Global') {
installPath = homedir();
info(`Global installation to: ${installPath}`);
} else {
const inputPath = options.path || await selectPath();
// Validate the installation path
const pathValidation = validatePath(inputPath, { mustExist: true });
if (!pathValidation.valid) {
error(`Invalid installation path: ${pathValidation.error}`);
process.exit(1);
}
installPath = pathValidation.path;
info(`Path installation to: ${installPath}`);
}
// Validate source directories exist
const availableDirs = SOURCE_DIRS.filter(dir => existsSync(join(sourceDir, dir)));
if (availableDirs.length === 0) {
error('No source directories found to install.');
error(`Expected directories in: ${sourceDir}`);
process.exit(1);
}
console.log('');
info(`Found ${availableDirs.length} directories to install: ${availableDirs.join(', ')}`);
divider();
// Check for existing installation at target path
const existingManifest = findManifest(installPath, mode);
if (existingManifest) {
warning('Existing installation found at this location');
const { backup } = await inquirer.prompt([{
type: 'confirm',
name: 'backup',
message: 'Create backup before reinstalling?',
default: true
}]);
if (backup) {
await createBackup(installPath, existingManifest);
}
}
// Create manifest
const manifest = createManifest(mode, installPath);
// Perform installation
console.log('');
const spinner = createSpinner('Installing files...').start();
let totalFiles = 0;
let totalDirs = 0;
try {
for (const dir of availableDirs) {
const srcPath = join(sourceDir, dir);
const destPath = join(installPath, dir);
spinner.text = `Installing ${dir}...`;
const { files, directories } = await copyDirectory(srcPath, destPath, manifest);
totalFiles += files;
totalDirs += directories;
}
// Copy CLAUDE.md to .claude directory
const claudeMdSrc = join(sourceDir, 'CLAUDE.md');
const claudeMdDest = join(installPath, '.claude', 'CLAUDE.md');
if (existsSync(claudeMdSrc) && existsSync(dirname(claudeMdDest))) {
spinner.text = 'Installing CLAUDE.md...';
copyFileSync(claudeMdSrc, claudeMdDest);
addFileEntry(manifest, claudeMdDest);
totalFiles++;
}
// Create version.json
const versionPath = join(installPath, '.claude', 'version.json');
if (existsSync(dirname(versionPath))) {
const versionData = {
version: version,
installedAt: new Date().toISOString(),
mode: mode,
installer: 'ccw'
};
writeFileSync(versionPath, JSON.stringify(versionData, null, 2), 'utf8');
addFileEntry(manifest, versionPath);
totalFiles++;
}
spinner.succeed('Installation complete!');
} catch (err) {
spinner.fail('Installation failed');
error(err.message);
process.exit(1);
}
// Save manifest
const manifestPath = saveManifest(manifest);
// Show summary
console.log('');
const summaryLines = [
chalk.green.bold('✓ Installation Successful'),
'',
chalk.white(`Mode: ${chalk.cyan(mode)}`),
chalk.white(`Path: ${chalk.cyan(installPath)}`),
chalk.white(`Version: ${chalk.cyan(version)}`),
'',
chalk.gray(`Files installed: ${totalFiles}`),
chalk.gray(`Directories created: ${totalDirs}`),
'',
chalk.gray(`Manifest: ${basename(manifestPath)}`)
];
summaryBox({
title: ' Installation Summary ',
lines: summaryLines,
borderColor: 'green'
});
// Show next steps
console.log('');
info('Next steps:');
console.log(chalk.gray(' 1. Restart Claude Code or your IDE'));
console.log(chalk.gray(' 2. Run: ccw view - to open the workflow dashboard'));
console.log(chalk.gray(' 3. Run: ccw uninstall - to remove this installation'));
console.log('');
}
/**
* Interactive mode selection
* @returns {Promise<string>} - Selected mode
*/
async function selectMode() {
const { mode } = await inquirer.prompt([{
type: 'list',
name: 'mode',
message: 'Select installation mode:',
choices: [
{
name: `${chalk.cyan('Global')} - Install to home directory (recommended)`,
value: 'Global'
},
{
name: `${chalk.yellow('Path')} - Install to specific project path`,
value: 'Path'
}
]
}]);
return mode;
}
/**
* Interactive path selection
* @returns {Promise<string>} - Selected path
*/
async function selectPath() {
const { path } = await inquirer.prompt([{
type: 'input',
name: 'path',
message: 'Enter installation path:',
default: process.cwd(),
validate: (input) => {
if (!input) return 'Path is required';
if (!existsSync(input)) {
return `Path does not exist: ${input}`;
}
return true;
}
}]);
return path;
}
/**
* Create backup of existing installation
* @param {string} installPath - Installation path
* @param {Object} manifest - Existing manifest
*/
async function createBackup(installPath, manifest) {
const spinner = createSpinner('Creating backup...').start();
try {
const timestamp = new Date().toISOString().replace(/[-:]/g, '').replace('T', '-').split('.')[0];
const backupDir = join(installPath, `.claude-backup-${timestamp}`);
mkdirSync(backupDir, { recursive: true });
// Copy existing .claude directory
const claudeDir = join(installPath, '.claude');
if (existsSync(claudeDir)) {
await copyDirectory(claudeDir, join(backupDir, '.claude'));
}
spinner.succeed(`Backup created: ${backupDir}`);
} catch (err) {
spinner.warn(`Backup failed: ${err.message}`);
}
}
/**
* Copy directory recursively
* @param {string} src - Source directory
* @param {string} dest - Destination directory
* @param {Object} manifest - Manifest to track files (optional)
* @returns {Object} - Count of files and directories
*/
async function copyDirectory(src, dest, manifest = null) {
let files = 0;
let directories = 0;
// Create destination directory
if (!existsSync(dest)) {
mkdirSync(dest, { recursive: true });
directories++;
if (manifest) addDirectoryEntry(manifest, dest);
}
const entries = readdirSync(src);
for (const entry of entries) {
const srcPath = join(src, entry);
const destPath = join(dest, entry);
const stat = statSync(srcPath);
if (stat.isDirectory()) {
const result = await copyDirectory(srcPath, destPath, manifest);
files += result.files;
directories += result.directories;
} else {
copyFileSync(srcPath, destPath);
files++;
if (manifest) addFileEntry(manifest, destPath);
}
}
return { files, directories };
}
/**
* Get package version
* @returns {string} - Version string
*/
function getVersion() {
try {
const pkgPath = join(getPackageRoot(), 'package.json');
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
return pkg.version || '1.0.0';
} catch {
return '1.0.0';
}
}

37
ccw/src/commands/list.js Normal file
View File

@@ -0,0 +1,37 @@
import chalk from 'chalk';
import { showBanner, divider, info } from '../utils/ui.js';
import { getAllManifests } from '../core/manifest.js';
/**
* List command handler - shows all installations
*/
export async function listCommand() {
showBanner();
console.log(chalk.cyan.bold(' Installed Claude Code Workflow Instances\n'));
const manifests = getAllManifests();
if (manifests.length === 0) {
info('No installations found.');
console.log('');
console.log(chalk.gray(' Run: ccw install - to install Claude Code Workflow'));
console.log('');
return;
}
manifests.forEach((m, i) => {
const modeColor = m.installation_mode === 'Global' ? chalk.cyan : chalk.yellow;
console.log(chalk.white.bold(` ${i + 1}. `) + modeColor.bold(m.installation_mode));
console.log(chalk.gray(` Path: ${m.installation_path}`));
console.log(chalk.gray(` Date: ${new Date(m.installation_date).toLocaleDateString()}`));
console.log(chalk.gray(` Version: ${m.application_version}`));
console.log(chalk.gray(` Files: ${m.files_count}`));
console.log(chalk.gray(` Dirs: ${m.directories_count}`));
console.log('');
});
divider();
console.log(chalk.gray(' Run: ccw uninstall - to remove an installation'));
console.log('');
}

67
ccw/src/commands/serve.js Normal file
View File

@@ -0,0 +1,67 @@
import { startServer } from '../core/server.js';
import { launchBrowser } from '../utils/browser-launcher.js';
import { resolvePath, validatePath } from '../utils/path-resolver.js';
import chalk from 'chalk';
/**
* Serve command handler - starts dashboard server with live path switching
* @param {Object} options - Command options
*/
export async function serveCommand(options) {
const port = options.port || 3456;
// Validate project path
let initialPath = process.cwd();
if (options.path) {
const pathValidation = validatePath(options.path, { mustExist: true });
if (!pathValidation.valid) {
console.error(chalk.red(`\n Error: ${pathValidation.error}\n`));
process.exit(1);
}
initialPath = pathValidation.path;
}
console.log(chalk.blue.bold('\n CCW Dashboard Server\n'));
console.log(chalk.gray(` Initial project: ${initialPath}`));
console.log(chalk.gray(` Port: ${port}\n`));
try {
// Start server
console.log(chalk.cyan(' Starting server...'));
const server = await startServer({ port, initialPath });
const url = `http://localhost:${port}`;
console.log(chalk.green(` Server running at ${url}`));
// Open browser
if (options.browser !== false) {
console.log(chalk.cyan(' Opening in browser...'));
try {
await launchBrowser(url);
console.log(chalk.green.bold('\n Dashboard opened in browser!'));
} catch (err) {
console.log(chalk.yellow(`\n Could not open browser: ${err.message}`));
console.log(chalk.gray(` Open manually: ${url}`));
}
}
console.log(chalk.gray('\n Press Ctrl+C to stop the server\n'));
// Handle graceful shutdown
process.on('SIGINT', () => {
console.log(chalk.yellow('\n Shutting down server...'));
server.close(() => {
console.log(chalk.green(' Server stopped.\n'));
process.exit(0);
});
});
} catch (error) {
console.error(chalk.red(`\n Error: ${error.message}\n`));
if (error.code === 'EADDRINUSE') {
console.error(chalk.yellow(` Port ${port} is already in use.`));
console.error(chalk.gray(` Try a different port: ccw serve --port ${port + 1}\n`));
}
process.exit(1);
}
}

Some files were not shown because too many files have changed in this diff Show More