refactor: update skill invocation methods and enhance CLI usage examples

This commit is contained in:
catlog22
2026-03-05 10:59:07 +08:00
parent bf057a927b
commit 99a45e3136
3 changed files with 85 additions and 51 deletions

View File

@@ -92,18 +92,24 @@ Skill(skill="workflow-tdd-plan", args="--mode tdd-verify")
## Using Skills ## Using Skills
### CLI Interface ### Recommended: CCW Orchestrator
Use `/ccw` command with natural language - CCW analyzes intent and auto-selects appropriate skill:
```bash ```bash
# Invoke via ccw command # CCW auto-routes to brainstorm skill
ccw --help /ccw "头脑风暴: 用户通知系统设计"
# Or use triggers directly # CCW auto-routes to team lifecycle workflow
ccw brainstorm /ccw "从零开始: 用户认证系统"
ccw team lifecycle
# CCW auto-routes to review cycle
/ccw "review: 代码质量检查"
``` ```
### Programmatic Interface ### Direct Skill Invocation
Use `Skill()` tool for direct skill calls:
```javascript ```javascript
// Basic usage // Basic usage
@@ -116,6 +122,17 @@ Skill(skill="team-lifecycle-v4", args="Build user authentication")
Skill(skill="workflow-plan", args="--mode verify") Skill(skill="workflow-plan", args="--mode verify")
``` ```
### CCW Team CLI (Message Bus Only)
`ccw team` is **only** for team message bus operations, not for invoking team skills:
```bash
# Message bus operations
ccw team log --session-id TLS-xxx --from executor --type state_update
ccw team list --session-id TLS-xxx --last 5
ccw team status --session-id TLS-xxx
```
## Custom Skills ## Custom Skills
Create your own skills for team-specific workflows: Create your own skills for team-specific workflows:
@@ -173,24 +190,23 @@ Skill(skill="my-custom-skill", args="input")
**Scenario**: Implement a new user dashboard feature **Scenario**: Implement a new user dashboard feature
```bash ```bash
# Step 1: Brainstorm the feature # Step 1: Brainstorm the feature (via CCW orchestrator)
ccw brainstorm /ccw "头脑风暴: 用户仪表板功能设计"
# Follow prompts to define: # Or use Skill directly:
# - Dashboard widgets (stats, charts, recent activity) # Skill(skill="brainstorm")
# - Layout preferences
# - Data refresh intervals
# Step 2: Plan implementation # Step 2: Plan implementation (via CCW orchestrator)
ccw workflow-plan "Build user dashboard with configurable widgets" /ccw "Plan: Build user dashboard with configurable widgets"
# Outputs: IMPL-001.json with task breakdown # Or use Skill directly:
# Skill(skill="workflow-plan", args="Build user dashboard")
# Step 3: Execute with team # Step 3: Execute with team lifecycle
ccw team lifecycle Skill(skill="team-lifecycle-v4", args="Build user dashboard")
# Or use quick iteration: # Or use quick iteration:
ccw workflow-lite-planex && ccw workflow-execute # Skill(skill="workflow-lite-planex")
# Step 4: Review and refine # Step 4: Review and refine
ccw review-code Skill(skill="review-code")
# Fix any issues found # Fix any issues found
``` ```
@@ -215,12 +231,13 @@ ccw workflow-execute --task "Fix N+1 query in user endpoint"
**Scenario**: Migrate from JavaScript to TypeScript **Scenario**: Migrate from JavaScript to TypeScript
```bash ```bash
# Step 1: Analyze codebase # Step 1: Analyze codebase (via CCW orchestrator)
ccw workflow:refactor-cycle /ccw "refactor: JavaScript to TypeScript migration"
# Identifies tech debt and creates migration plan # Or use Skill directly:
# Skill(skill="workflow:refactor-cycle")
# Step 2: Execute migration in phases # Step 2: Execute with team roadmap
ccw team roadmap-dev --epic "ts-migration" Skill(skill="team-roadmap-dev", args="--epic ts-migration")
# Progressively migrates modules with tests # Progressively migrates modules with tests
``` ```

View File

@@ -83,8 +83,8 @@ Short aliases for common commands:
| Full Command | Short Alias | | Full Command | Short Alias |
|--------------|-------------| |--------------|-------------|
| `workflow:multi-cli-plan` | `workflow:multi-cli-plan` | | `workflow:multi-cli-plan` | `workflow:multi-cli-plan` |
| `team:lifecycle-v4` | `team lifecycle` | | `team-lifecycle-v4` | (via `/ccw "从零开始: ..."` or `Skill()`) |
| `brainstorm:auto` | `brainstorm` | | `brainstorm` | (via `/ccw "头脑风暴: ..."` or `Skill()`) |
## File Naming ## File Naming

View File

@@ -92,18 +92,24 @@ Skill(skill="workflow-tdd-plan", args="--mode tdd-verify")
## 使用技能 ## 使用技能
### CLI 接口 ### 推荐方式CCW 编排器
使用 `/ccw` 命令配合自然语言描述 - CCW 自动分析意图并选择合适的 skill
```bash ```bash
# 通过 ccw 命令调用 # CCW 自动路由到 brainstorm skill
ccw --help /ccw "头脑风暴: 用户通知系统设计"
# 或直接使用触发器 # CCW 自动路由到 team lifecycle 工作流
ccw brainstorm /ccw "从零开始: 用户认证系统"
ccw team lifecycle
# CCW 自动路由到代码审查
/ccw "review: 代码质量检查"
``` ```
### 编程接口 ### 直接调用 Skill
使用 `Skill()` 工具直接调用:
```javascript ```javascript
// 基本使用 // 基本使用
@@ -116,6 +122,17 @@ Skill(skill="team-lifecycle-v4", args="Build user authentication")
Skill(skill="workflow-plan", args="--mode verify") Skill(skill="workflow-plan", args="--mode verify")
``` ```
### CCW Team CLI仅消息总线
`ccw team` **仅用于**团队消息总线操作,不能用于调用 team skill
```bash
# 消息总线操作
ccw team log --session-id TLS-xxx --from executor --type state_update
ccw team list --session-id TLS-xxx --last 5
ccw team status --session-id TLS-xxx
```
## 自定义技能 ## 自定义技能
为团队特定工作流创建自己的技能: 为团队特定工作流创建自己的技能:
@@ -173,24 +190,23 @@ Skill(skill="my-custom-skill", args="input")
**场景**:实现新的用户仪表板功能 **场景**:实现新的用户仪表板功能
```bash ```bash
# 步骤 1头脑风暴功能 # 步骤 1头脑风暴功能(通过 CCW 编排器)
ccw brainstorm /ccw "头脑风暴: 用户仪表板功能设计"
# 按提示定义: # 或直接调用 Skill:
# - 仪表板小部件(统计、图表、最近活动) # Skill(skill="brainstorm")
# - 布局偏好
# - 数据刷新间隔
# 步骤 2规划实现 # 步骤 2规划实现(通过 CCW 编排器)
ccw workflow-plan "Build user dashboard with configurable widgets" /ccw "Plan: Build user dashboard with configurable widgets"
# 输出IMPL-001.json 包含任务分解 # 或直接调用 Skill:
# Skill(skill="workflow-plan", args="Build user dashboard")
# 步骤 3团队执行 # 步骤 3团队执行
ccw team lifecycle Skill(skill="team-lifecycle-v4", args="Build user dashboard")
# 或使用快速迭代 # 或使用快速迭代:
ccw workflow-lite-planex && ccw workflow-execute # Skill(skill="workflow-lite-planex")
# 步骤 4审查和优化 # 步骤 4审查和优化
ccw review-code Skill(skill="review-code")
# 修复发现的问题 # 修复发现的问题
``` ```
@@ -215,12 +231,13 @@ ccw workflow-execute --task "Fix N+1 query in user endpoint"
**场景**:从 JavaScript 迁移到 TypeScript **场景**:从 JavaScript 迁移到 TypeScript
```bash ```bash
# 步骤 1分析代码库 # 步骤 1分析代码库(通过 CCW 编排器)
ccw workflow:refactor-cycle /ccw "refactor: JavaScript to TypeScript 迁移"
# 识别技术债务并创建迁移计划 # 或直接调用 Skill:
# Skill(skill="workflow:refactor-cycle")
# 步骤 2分阶段执行迁移 # 步骤 2分阶段执行迁移
ccw team roadmap-dev --epic "ts-migration" Skill(skill="team-roadmap-dev", args="--epic ts-migration")
# 渐进式迁移模块并测试 # 渐进式迁移模块并测试
``` ```