docs: add VitePress documentation site

- Add docs directory with VitePress configuration
- Add GitHub Actions workflow for docs build and deploy
- Support bilingual (English/Chinese) documentation
- Include search, custom theme, and responsive design
This commit is contained in:
catlog22
2026-02-28 16:14:09 +08:00
parent ab65caec45
commit c3ddf7e322
136 changed files with 34486 additions and 0 deletions

204
docs/workflows/4-level.md Normal file
View File

@@ -0,0 +1,204 @@
# 4-Level Workflow System
The CCW 4-level workflow system provides a structured approach to software development from specification to deployment.
## Overview
```
Level 1: SPECIFICATION → Level 2: PLANNING → Level 3: IMPLEMENTATION → Level 4: VALIDATION
```
## Level 1: Specification
**Goal**: Define what to build and why.
### Activities
| Activity | Description | Output |
|----------|-------------|--------|
| Research | Analyze requirements and context | Discovery context |
| Product Brief | Define product vision | Product brief |
| Requirements | Create PRD with acceptance criteria | Requirements document |
| Architecture | Design system architecture | Architecture document |
| Epics & Stories | Break down into trackable items | Epics and stories |
### Agents
- **analyst**: Conducts research and analysis
- **writer**: Creates specification documents
- **discuss-subagent**: Multi-perspective critique
### Quality Gate
**QUALITY-001** validates:
- All requirements documented
- Architecture approved
- Risks assessed
- Acceptance criteria defined
### Example Tasks
```
RESEARCH-001 → DRAFT-001 → DRAFT-002 → DRAFT-003 → DRAFT-004 → QUALITY-001
```
## Level 2: Planning
**Goal**: Define how to build it.
### Activities
| Activity | Description | Output |
|----------|-------------|--------|
| Exploration | Multi-angle codebase analysis | Exploration cache |
| Task Breakdown | Create implementation tasks | Task definitions |
| Dependency Mapping | Identify task dependencies | Dependency graph |
| Resource Estimation | Estimate effort and complexity | Plan metadata |
### Agents
- **planner**: Creates implementation plan
- **architect**: Provides technical consultation (on-demand)
- **explore-subagent**: Codebase exploration
### Output
```json
{
"epic_count": 5,
"total_tasks": 27,
"execution_order": [...],
"tech_stack": {...}
}
```
## Level 3: Implementation
**Goal**: Build the solution.
### Activities
| Activity | Description | Output |
|----------|-------------|--------|
| Code Generation | Write source code | Source files |
| Unit Testing | Create unit tests | Test files |
| Documentation | Document code and APIs | Documentation |
| Self-Validation | Verify implementation quality | Validation report |
### Agents
- **executor**: Coordinates implementation
- **code-developer**: Simple, direct edits
- **ccw cli**: Complex, multi-file changes
### Execution Strategy
Tasks executed in topological order based on dependencies:
```
TASK-001 (no deps) → TASK-002 (depends on 001) → TASK-003 (depends on 002)
```
### Backends
| Backend | Use Case |
|---------|----------|
| agent | Simple, direct edits |
| codex | Complex, architecture |
| gemini | Analysis-heavy |
## Level 4: Validation
**Goal**: Ensure quality.
### Activities
| Activity | Description | Output |
|----------|-------------|--------|
| Integration Testing | Verify component integration | Test results |
| QA Testing | User acceptance testing | QA report |
| Performance Testing | Measure performance | Performance metrics |
| Security Review | Security vulnerability scan | Security findings |
| Code Review | Final quality check | Review feedback |
### Agents
- **tester**: Executes test-fix cycles
- **reviewer**: 4-dimension code review
### Review Dimensions
| Dimension | Focus |
|-----------|-------|
| Product | Requirements alignment |
| Technical | Code quality, patterns |
| Quality | Testing, edge cases |
| Coverage | Completeness |
| Risk | Security, performance |
## Workflow Orchestration
### Beat Model
Event-driven execution with coordinator orchestration:
```
Event Coordinator Workers
────────────────────────────────────────────────
callback/resume → handleCallback ─────────────────┐
→ mark completed │
→ check pipeline │
→ handleSpawnNext ──────────────┼───→ [Worker A]
→ find ready tasks │
→ spawn workers ─────────────────┼───→ [Worker B]
→ STOP (idle) ──────────────────┘ │
callback <──────────────────────────────────────────────┘
```
### Checkpoints
**Spec Checkpoint** (after QUALITY-001):
- Pauses for user confirmation
- Validates specification completeness
- Requires manual resume to proceed
**Final Gate** (after REVIEW-001):
- Final quality validation
- All tests must pass
- Critical issues resolved
### Fast-Advance
For simple linear successions, workers can spawn successors directly:
```
[Worker A] complete
→ Check: 1 ready task? simple successor?
→ YES: Spawn Worker B directly
→ NO: SendMessage to coordinator
```
## Parallel Execution
Some epics can execute in parallel:
```
EPIC-003: Content Modules ──┐
├──→ EPIC-005: Interaction Features
EPIC-004: Search & Nav ────┘
```
## Error Handling
| Scenario | Resolution |
|----------|------------|
| Syntax errors | Retry with error context (max 3) |
| Missing dependencies | Request from coordinator |
| Backend unavailable | Fallback to alternative |
| Circular dependencies | Abort, report graph |
::: info See Also
- [Best Practices](./best-practices.md) - Workflow optimization
- [Agents](../agents/) - Agent specialization
:::

View File

@@ -0,0 +1,167 @@
# Workflow Best Practices
Optimize your CCW workflows for maximum efficiency and quality.
## Specification Phase
### DO
- **Start with clear objectives**: Define success criteria upfront
- **Involve stakeholders**: Gather requirements from all stakeholders
- **Document assumptions**: Make implicit knowledge explicit
- **Identify risks early**: Assess technical and project risks
### DON'T
- Skip research phase
- Assume requirements without validation
- Ignore technical constraints
- Over-engineer solutions
## Planning Phase
### DO
- **Break down tasks**: Granular tasks are easier to estimate
- **Map dependencies**: Identify task relationships early
- **Estimate realistically**: Use historical data for estimates
- **Plan for iteration**: Include buffer for unknowns
### DON'T
- Create monolithic tasks
- Ignore task dependencies
- Underestimate complexity
- Plan everything upfront
## Implementation Phase
### DO
- **Follow the plan**: Trust the planning process
- **Test as you go**: Write tests alongside code
- **Document changes**: Keep documentation in sync
- **Validate frequently**: Run tests after each change
### DON'T
- Deviate from the plan without discussion
- Skip testing for speed
- Defer documentation
- Ignore feedback
## Validation Phase
### DO
- **Test comprehensively**: Cover happy paths and edge cases
- **Review code**: Use code review guidelines
- **Measure quality**: Use automated metrics
- **Document findings**: Create test reports
### DON'T
- Skip edge case testing
- Ignore review feedback
- Rely on manual testing only
- Hide test failures
## Team Coordination
### Communication
- **Use SendMessage**: Always communicate through coordinator
- **Be specific**: Clear messages reduce back-and-forth
- **Report progress**: Update status regularly
- **Escalate blockers**: Don't wait on blockers
### Collaboration
- **Respect boundaries**: Each role has specific responsibilities
- **Trust the process**: The workflow ensures quality
- **Share knowledge**: Contribute to wisdom files
- **Learn from failures**: Post-mortems improve future workflows
## Common Pitfalls
### Specification
| Pitfall | Impact | Prevention |
|---------|--------|------------|
| Vague requirements | Rework | Use acceptance criteria |
| Missing constraints | Failed implementation | List NFRs explicitly |
| Unclear scope | Scope creep | Define in/out scope |
### Planning
| Pitfall | Impact | Prevention |
|---------|--------|------------|
| Optimistic estimates | Delays | Use cone of uncertainty |
| Unknown dependencies | Blocked tasks | Explore codebase first |
| Single-threaded planning | Bottlenecks | Identify parallel opportunities |
### Implementation
| Pitfall | Impact | Prevention |
|---------|--------|------------|
| Skipping tests | Bugs in production | Test-first approach |
| Ignoring feedback | Rejected PRs | Address review comments |
| Gold plating | Delayed delivery | Follow requirements |
## Workflow Optimization
### Reduce Cycle Time
1. **Batch similar tasks**: Reduce context switching
2. **Automate validation**: Continuous integration
3. **Parallel execution**: Identify independent tasks
4. **Fast-advance**: Skip coordinator for simple successions
### Improve Quality
1. **Early validation**: Test-first development
2. **Peer review**: Multiple reviewer perspectives
3. **Automated testing**: Comprehensive test coverage
4. **Metrics tracking**: Measure quality indicators
### Scale Effectively
1. **Epic decomposition**: Large projects → epics → tasks
2. **Team specialization**: Role-based agent assignment
3. **Knowledge sharing**: Wisdom accumulation
4. **Process refinement**: Continuous improvement
## Examples
### Good Workflow
```
[Specification]
↓ Clear requirements with acceptance criteria
[Planning]
↓ Realistic estimates with identified dependencies
[Implementation]
↓ Tests pass, documentation updated
[Validation]
↓ All acceptance criteria met
[Complete]
```
### Problematic Workflow
```
[Specification]
↓ Vague requirements, no acceptance criteria
[Planning]
↓ Optimistic estimates, missed dependencies
[Implementation]
↓ No tests, incomplete documentation
[Validation]
↓ Failed tests, missing requirements
[Rework]
```
::: info See Also
- [4-Level System](./4-level.md) - Detailed workflow explanation
- [Agents](../agents/) - Agent capabilities
:::

183
docs/workflows/index.md Normal file
View File

@@ -0,0 +1,183 @@
# Workflow System
CCW's 4-level workflow system orchestrates the entire development lifecycle from requirements to deployed code.
## Workflow Levels
```
Level 1: SPECIFICATION
Level 2: PLANNING
Level 3: IMPLEMENTATION
Level 4: VALIDATION
```
## Level 1: Specification
Define what to build and why.
**Activities:**
- Requirements gathering
- User story creation
- Acceptance criteria definition
- Risk assessment
**Output:**
- Product brief
- Requirements document (PRD)
- Architecture design
- Epics and stories
**Agents:** analyst, writer
## Level 2: Planning
Define how to build it.
**Activities:**
- Technical planning
- Task breakdown
- Dependency mapping
- Resource estimation
**Output:**
- Implementation plan
- Task definitions
- Dependency graph
- Risk mitigation
**Agents:** planner, architect
## Level 3: Implementation
Build the solution.
**Activities:**
- Code implementation
- Unit testing
- Documentation
- Code review
**Output:**
- Source code
- Tests
- Documentation
- Build artifacts
**Agents:** executor, code-developer
## Level 4: Validation
Ensure quality.
**Activities:**
- Integration testing
- QA testing
- Performance testing
- Security review
**Output:**
- Test reports
- QA findings
- Review feedback
- Deployment readiness
**Agents:** tester, reviewer
## Complete Workflow Example
```bash
# Level 1: Specification
Skill(skill="team-lifecycle-v4", args="Build user authentication system")
# => Creates RESEARCH-001, DRAFT-001/002/003/004, QUALITY-001
# Level 2: Planning (auto-triggered after QUALITY-001)
# => Creates PLAN-001 with task breakdown
# Level 3: Implementation (auto-triggered after PLAN-001)
# => Executes IMPL-001 with code generation
# Level 4: Validation (auto-triggered after IMPL-001)
# => Runs TEST-001 and REVIEW-001
```
## Workflow Visualization
```
┌─────────────────────────────────────────────────────────────┐
│ WORKFLOW ORCHESTRATION │
├─────────────────────────────────────────────────────────────┤
│ │
│ [RESEARCH-001] Product Discovery │
│ ↓ │
│ [DRAFT-001] Product Brief │
│ ↓ │
│ [DRAFT-002] Requirements (PRD) │
│ ↓ │
│ [DRAFT-003] Architecture Design │
│ ↓ │
│ [DRAFT-004] Epics & Stories │
│ ↓ │
│ [QUALITY-001] Spec Quality Check ◄── CHECKPOINT │
│ ↓ ↓ │
│ [PLAN-001] Implementation Plan │
│ ↓ │
│ [IMPL-001] Code Implementation │
│ ↓ │
│ [TEST-001] ───┐ │
│ ├──► [REVIEW-001] ◄── FINAL GATE │
│ [REVIEW-001] ─┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
## Checkpoints
### Spec Checkpoint (After QUALITY-001)
Pauses for user confirmation before implementation.
**Validation:**
- All requirements documented
- Architecture approved
- Risks assessed
- Acceptance criteria defined
### Final Gate (After REVIEW-001)
Final quality gate before deployment.
**Validation:**
- All tests passing
- Critical issues resolved
- Documentation complete
- Performance acceptable
## Custom Workflows
Define custom workflows for your team:
```yaml
# .ccw/workflows/my-workflow.yaml
name: "Feature Development"
levels:
- name: "discovery"
agent: "analyst"
tasks: ["research", "user-stories"]
- name: "design"
agent: "architect"
tasks: ["api-design", "database-schema"]
- name: "build"
agent: "executor"
tasks: ["implementation", "unit-tests"]
- name: "verify"
agent: "tester"
tasks: ["integration-tests", "e2e-tests"]
```
::: info See Also
- [4-Level System](./4-level.md) - Detailed workflow explanation
- [Best Practices](./best-practices.md) - Workflow optimization tips
:::

197
docs/workflows/teams.md Normal file
View File

@@ -0,0 +1,197 @@
# Team Workflows
CCW provides multiple team collaboration Skills that support multi-role coordination for complex tasks.
## Team Skill Overview
| Skill | Roles | Pipeline | Use Case |
|-------|-------|----------|----------|
| **team-planex** | 3 (planner + executor) | Wave pipeline (边规划边执行) | Planning and execution in parallel waves |
| **team-iterdev** | 5 (generator → critic → integrator → validator) | Generator-critic loop | Iterative development with feedback cycles |
| **team-lifecycle-v4** | 8 (spec → architect → impl → test) | 5-phase lifecycle | Full spec → impl → test workflow |
| **team-lifecycle-v5** | Variable (team-worker) | Built-in phases | Latest team-worker architecture |
| **team-issue** | 6 (explorer → planner → implementer → reviewer → integrator) | 5-phase issue resolution | Multi-role issue solving |
| **team-testing** | 5 (strategist → generator → executor → analyst) | 4-phase testing | Comprehensive test coverage |
| **team-quality-assurance** | 6 (scout → strategist → generator → executor → analyst) | 5-phase QA | Quality assurance closed loop |
| **team-brainstorm** | 5 (coordinator → ideator → challenger → synthesizer → evaluator) | 5-phase brainstorming | Multi-perspective ideation |
| **team-uidesign** | 4 (designer → developer → reviewer) | CP-9 dual-track | UI design and implementation in parallel |
| **team-frontend** | 6 (frontend-lead → ui-developer → ux-engineer → component-dev → qa) | Design integration | Frontend development with UI/UX integration |
| **team-review** | 4 (scanner → reviewer → fixer) | 4-phase code review | Code scanning and automated fix |
| **team-roadmap-dev** | 4 (planner → executor → verifier) | Phased execution | Roadmap-driven development |
| **team-tech-debt** | 6 (scanner → assessor → planner → executor → validator) | 5-phase cleanup | Technical debt identification and resolution |
| **team-ultra-analyze** | 5 (explorer → analyst → discussant → synthesizer) | 4-phase analysis | Deep collaborative codebase analysis |
| **team-coordinate** | Variable | Generic coordination | Generic team coordination (legacy) |
| **team-coordinate-v2** | Variable (team-worker) | team-worker architecture | Modern team-worker coordination |
| **team-executor** | Variable | Lightweight execution | Session-based execution |
| **team-executor-v2** | Variable (team-worker) | team-worker execution | Modern team-worker execution |
## Usage
### Via /ccw Orchestrator
```bash
# Automatic routing based on intent
/ccw "team planex: 用户认证系统"
/ccw "全生命周期: 通知服务开发"
/ccw "QA 团队: 质量保障支付流程"
# Team-based workflows
/ccw "team brainstorm: 新功能想法"
/ccw "team issue: 修复登录超时"
/ccw "team testing: 测试覆盖率提升"
```
### Direct Skill Invocation
```javascript
// Programmatic invocation
Skill(skill="team-lifecycle-v5", args="Build user authentication system")
Skill(skill="team-planex", args="Implement OAuth2 with concurrent planning")
Skill(skill="team-quality-assurance", args="Quality audit of payment system")
// With mode selection
Skill(skill="workflow-plan", args="--mode replan")
```
### Via Task Tool (for agent invocation)
```javascript
// Spawn team worker agent
Task({
subagent_type: "team-worker",
description: "Spawn executor worker",
team_name: "my-team",
name: "executor",
run_in_background: true,
prompt: `## Role Assignment
role: executor
session: D:/project/.workflow/.team/my-session
session_id: my-session
team_name: my-team
requirement: Implement user authentication
inner_loop: true`
})
```
## Detection Keywords
| Skill | Keywords (English) | Keywords (中文) |
|-------|-------------------|----------------|
| **team-planex** | team planex, plan execute, wave pipeline | 团队规划执行, 波浪流水线 |
| **team-iterdev** | team iterdev, iterative development | 迭代开发团队 |
| **team-lifecycle** | team lifecycle, full lifecycle, spec impl test | 全生命周期, 规范实现测试 |
| **team-issue** | team issue, resolve issue, issue team | 团队 issue, issue 解决团队 |
| **team-testing** | team test, comprehensive test, test coverage | 测试团队, 全面测试 |
| **team-quality-assurance** | team qa, qa team, quality assurance | QA 团队, 质量保障团队 |
| **team-brainstorm** | team brainstorm, collaborative brainstorming | 团队头脑风暴, 协作头脑风暴 |
| **team-uidesign** | team ui design, ui design team, dual track | UI 设计团队, 双轨设计 |
| **team-frontend** | team frontend, frontend team | 前端开发团队 |
| **team-review** | team review, code review team | 代码审查团队 |
| **team-roadmap-dev** | team roadmap, roadmap driven | 路线图驱动开发 |
| **team-tech-debt** | tech debt cleanup, technical debt | 技术债务清理, 清理技术债 |
| **team-ultra-analyze** | team analyze, deep analysis, collaborative analysis | 深度协作分析 |
## Team Skill Architecture
### Version Evolution
| Version | Architecture | Status |
|---------|-------------|--------|
| **v5** | team-worker (dynamic roles) | **Latest** |
| v4 | 5-phase lifecycle with inline discuss | Stable |
| v3 | 3-phase lifecycle | Legacy |
| v2 | Generic coordination | Obsolete |
### v5 Team Worker Architecture
The latest architecture uses the `team-worker` agent with dynamic role assignment based on phase prefixes:
| Phase | Prefix | Role |
|-------|--------|------|
| Analysis | ANALYSIS | doc-analyst |
| Draft | DRAFT | doc-writer |
| Planning | PLAN | planner |
| Implementation | IMPL | executor (code-developer, tdd-developer, etc.) |
| Testing | TEST | tester (test-fix-agent, etc.) |
| Review | REVIEW | reviewer |
### Role Types
| Type | Prefix | Description |
|------|--------|-------------|
| **Orchestrator** | COORD | Manages workflow, coordinates agents |
| **Lead** | SPEC, IMPL, TEST | Leads phase, delegates to workers |
| **Worker** | Various | Executes specific tasks |
## Workflow Patterns
### Wave Pipeline (team-planex)
```
Wave 1: Plan ──────────────────────────────────┐
↓ │
Wave 2: Exec ←────────────────────────────────┘
Wave 3: Plan → Exec → Plan → Exec → ...
```
Concurrent planning and execution - executor works on wave N while planner plans wave N+1.
### Generator-Critic Loop (team-iterdev)
```
Generator → Output → Critic → Feedback → Generator
Integrator → Validator
```
Iterative improvement through feedback cycles.
### CP-9 Dual-Track (team-uidesign)
```
Design Track: Designer → Tokens → Style
Implementation Track: Developer → Components
Reviewer → Verify
```
Design and implementation proceed in parallel tracks.
### 5-Phase Lifecycle (team-lifecycle-v4)
```
1. Spec Planning (coordinator + spec-lead)
2. Architecture Design (architect)
3. Implementation Planning (impl-lead + dev team)
4. Test Planning (test-lead + qa-analyst)
5. Execution & Verification (all roles)
```
Linear progression through all lifecycle phases.
## When to Use Each Team Skill
| Scenario | Recommended Skill |
|----------|-------------------|
| Need parallel planning and execution | **team-planex** |
| Complex feature with multiple iterations | **team-iterdev** |
| Full spec → impl → test workflow | **team-lifecycle-v5** |
| Issue resolution | **team-issue** |
| Comprehensive testing | **team-testing** |
| Quality audit | **team-quality-assurance** |
| New feature ideation | **team-brainstorm** |
| UI design + implementation | **team-uidesign** |
| Frontend-specific development | **team-frontend** |
| Code quality review | **team-review** |
| Large project with roadmap | **team-roadmap-dev** |
| Tech debt cleanup | **team-tech-debt** |
| Deep codebase analysis | **team-ultra-analyze** |
::: info See Also
- [Skills Reference](../skills/reference.md) - All skills documentation
- [CLI Commands](../cli/commands.md) - Command reference
- [Agents](../agents/index.md) - Agent documentation
- [4-Level Workflows](./4-level.md) - Workflow system overview
:::