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

View File

@@ -0,0 +1,87 @@
# What is Claude_dms3
## One-Line Positioning
**Claude_dms3 is an AI-powered development workbench for VS Code** — Through semantic code indexing, multi-model CLI invocation, and team collaboration systems, it enables AI to deeply understand your project and generate high-quality code according to specifications.
> AI capabilities bloom like vines — Claude_dms3 is the trellis that guides AI along your project's architecture, coding standards, and team workflows.
---
## 1.1 Pain Points Solved
| Pain Point | Current State | Claude_dms3 Solution |
|------------|---------------|---------------------|
| **AI doesn't understand the project** | Every new session requires re-explaining project background, tech stack, and coding standards | Memory system persists project context, AI remembers project knowledge across sessions |
| **Difficult code search** | Keyword search can't find semantically related code, don't know where functions are called | CodexLens semantic indexing, supports natural language search and call chain tracing |
| **Single model limitation** | Can only call one AI model, different models excel in different scenarios | CCW unified invocation framework, supports multi-model collaboration (Gemini, Qwen, Codex, Claude) |
| **Chaotic collaboration process** | Team members work independently, inconsistent code styles, standards hard to implement | Team workflow system (PlanEx, IterDev, Lifecycle) ensures standard execution |
| **Standards hard to implement** | CLAUDE.md written but AI doesn't follow, project constraints ignored | Spec + Hook auto-injection, AI forced to follow project standards |
---
## 1.2 vs Traditional Methods
| Dimension | Traditional AI Assistant | **Claude_dms3** |
|-----------|-------------------------|-----------------|
| **Code Search** | Text keyword search | **Semantic vector search + LSP call chain** |
| **AI Invocation** | Single model fixed call | **Multi-model collaboration, optimal model per task** |
| **Project Memory** | Re-explain each session | **Cross-session persistent Memory** |
| **Standard Execution** | Relies on Prompt reminders | **Spec + Hook auto-injection** |
| **Team Collaboration** | Each person for themselves | **Structured workflow system** |
| **Code Quality** | Depends on AI capability | **Multi-dimensional review + auto-fix cycle** |
---
## 1.3 Core Concepts Overview
| Concept | Description | Location/Command |
|---------|-------------|------------------|
| **CodexLens** | Semantic code indexing and search engine | `ccw search` |
| **CCW** | Unified CLI tool invocation framework | `ccw cli` |
| **Memory** | Cross-session knowledge persistence | `ccw memory` |
| **Spec** | Project specification and constraint system | `.workflow/specs/` |
| **Hook** | Auto-triggered context injection scripts | `.claude/hooks/` |
| **Agent** | Specialized AI subprocess for specific roles | `.claude/agents/` |
| **Skill** | Reusable AI capability modules | `.claude/skills/` |
| **Workflow** | Multi-phase development orchestration | `/workflow:*` |
---
## 1.4 Architecture Overview
```
┌─────────────────────────────────────────────────────────────┐
│ Claude_dms3 Architecture │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ CodexLens │ │ CCW │ │ Memory │ │
│ │ (Semantic │ │ (CLI Call │ │ (Persistent │ │
│ │ Index) │ │ Framework) │ │ Context) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ │ │
│ ┌─────┴─────┐ │
│ │ Spec │ │
│ │ System │ │
│ └─────┬─────┘ │
│ │ │
│ ┌────────────────┼────────────────┐ │
│ │ │ │ │
│ ┌────┴────┐ ┌─────┴─────┐ ┌────┴────┐ │
│ │ Hooks │ │ Skills │ │ Agents │ │
│ │(Inject) │ │(Reusable) │ │(Roles) │ │
│ └─────────┘ └───────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
---
## Next Steps
- [Getting Started](/guide/ch02-getting-started) - Install and configure
- [Core Concepts](/guide/ch03-core-concepts) - Understand the fundamentals
- [Workflow Basics](/guide/ch04-workflow-basics) - Start your first workflow

View File

@@ -0,0 +1,295 @@
# Getting Started
## One-Line Positioning
**Getting Started is a 5-minute quick-start guide** — Installation, first command, first workflow, quickly experience Claude_dms3's core features.
---
## 2.1 Installation
### 2.1.1 Prerequisites
| Requirement | Version | Description |
| --- | --- | --- |
| **Node.js** | 18+ | Required for CCW modules |
| **Python** | 3.10+ | Required for CodexLens modules |
| **VS Code** | Latest | Extension runtime environment |
| **Git** | Latest | Version control |
### 2.1.2 Clone Project
```bash
# Clone repository
git clone https://github.com/your-repo/claude-dms3.git
cd claude-dms3
# Install dependencies
npm install
```
### 2.1.3 Configure API Keys
Configure API Keys in `~/.claude/settings.json`:
```json
{
"openai": {
"apiKey": "sk-xxx"
},
"anthropic": {
"apiKey": "sk-ant-xxx"
},
"google": {
"apiKey": "AIza-xxx"
}
}
```
::: tip Tip
API Keys can also be configured at the project level in `.claude/settings.json`. Project-level configuration takes priority over global configuration.
:::
---
## 2.2 Initialize Project
### 2.2.1 Start Workflow Session
Open your project in VS Code, then run:
```
/workflow:session:start
```
This creates a new workflow session. All subsequent operations will be performed within this session context.
### 2.2.2 Initialize Project Specs
```
/workflow:init
```
This creates the `project-tech.json` file, recording your project's technology stack information.
### 2.2.3 Populate Project Specs
```
/workflow:init-guidelines
```
Interactively populate project specifications, including coding style, architectural decisions, and other information.
---
## 2.3 First Command
### 2.3.1 Code Analysis
Use CCW CLI tool to analyze code:
```bash
ccw cli -p "Analyze the code structure and design patterns of this file" --tool gemini --mode analysis
```
**Parameter Description**:
- `-p`: Prompt (task description)
- `--tool gemini`: Use Gemini model
- `--mode analysis`: Analysis mode (read-only, no file modifications)
### 2.3.2 Code Generation
Use CCW CLI tool to generate code:
```bash
ccw cli -p "Create a React component implementing user login form" --tool qwen --mode write
```
**Parameter Description**:
- `--mode write`: Write mode (can create/modify files)
::: danger Warning
`--mode write` will modify files. Ensure your code is committed or backed up.
:::
---
## 2.4 First Workflow
### 2.4.1 Start Planning Workflow
```
/workflow:plan
```
This launches the PlanEx workflow, including the following steps:
1. **Analyze Requirements** - Understand user intent
2. **Explore Code** - Search related code and patterns
3. **Generate Plan** - Create structured task list
4. **Execute Tasks** - Execute development according to plan
### 2.4.2 Brainstorming
```
/brainstorm
```
Multi-perspective brainstorming for diverse viewpoints:
| Perspective | Role | Focus |
| --- | --- | --- |
| Product | Product Manager | Market fit, user value |
| Technical | Tech Lead | Feasibility, technical debt |
| Quality | QA Lead | Completeness, testability |
| Risk | Risk Analyst | Risk identification, dependencies |
---
## 2.5 Using Memory
### 2.5.1 View Project Memory
```bash
ccw memory list
```
Display all project memories, including learnings, decisions, conventions, and issues.
### 2.5.2 Search Related Memory
```bash
ccw memory search "authentication"
```
Semantic search for memories related to "authentication".
### 2.5.3 Add Memory
```
/memory-capture
```
Interactively capture important knowledge points from the current session.
---
## 2.6 Code Search
### 2.6.1 Semantic Search
Use CodexLens search in VS Code:
```bash
# Search via CodexLens MCP endpoint
ccw search "user login logic"
```
### 2.6.2 Call Chain Tracing
Search function definitions and all call locations:
```bash
ccw search --trace "authenticateUser"
```
---
## 2.7 Dashboard Panel
### 2.7.1 Open Dashboard
Run in VS Code:
```
ccw-dashboard.open
```
Or use Command Palette (Ctrl+Shift+P) and search "CCW Dashboard".
### 2.7.2 Panel Features
| Feature | Description |
| --- | --- |
| **Tech Stack** | Display frameworks and libraries used |
| **Specs Docs** | Quick view of project specifications |
| **Memory** | Browse and search project memory |
| **Code Search** | Integrated CodexLens semantic search |
---
## 2.8 FAQ
### 2.8.1 API Key Configuration
**Q: Where to configure API Keys?**
A: Can be configured in two locations:
- Global configuration: `~/.claude/settings.json`
- Project configuration: `.claude/settings.json`
Project configuration takes priority over global configuration.
### 2.8.2 Model Selection
**Q: How to choose the right model?**
A: Select based on task type:
- Code analysis, architecture design → Gemini
- General development → Qwen
- Code review → Codex (GPT)
- Long text understanding → Claude
### 2.8.3 Workflow Selection
**Q: When to use which workflow?**
A: Select based on task objective:
- New feature development → `/workflow:plan`
- Problem diagnosis → `/debug-with-file`
- Code review → `/review-code`
- Refactoring planning → `/refactor-cycle`
- UI development → `/workflow:ui-design`
---
## 2.9 Quick Reference
### Installation Steps
```bash
# 1. Clone project
git clone https://github.com/your-repo/claude-dms3.git
cd claude-dms3
# 2. Install dependencies
npm install
# 3. Configure API Keys
# Edit ~/.claude/settings.json
# 4. Start workflow session
/workflow:session:start
# 5. Initialize project
/workflow:init
```
### Common Commands
| Command | Function |
| --- | --- |
| `/workflow:session:start` | Start session |
| `/workflow:plan` | Planning workflow |
| `/brainstorm` | Brainstorming |
| `/review-code` | Code review |
| `ccw memory list` | View Memory |
| `ccw cli -p "..."` | CLI invocation |
---
## Next Steps
- [Core Concepts](ch03-core-concepts.md) — Deep dive into Commands, Skills, Prompts
- [Workflow Basics](ch04-workflow-basics.md) — Learn various workflow commands
- [Advanced Tips](ch05-advanced-tips.md) — CLI toolchain, multi-model collaboration, memory management optimization

View File

@@ -0,0 +1,264 @@
# Core Concepts
## One-Line Positioning
**Core Concepts are the foundation for understanding Claude_dms3** — Three-layer abstraction of Commands, Skills, Prompts, Workflow session management, and team collaboration patterns.
---
## 3.1 Three-Layer Abstraction
Claude_dms3's command system is divided into three layers of abstraction:
### 3.1.1 Commands - Built-in Commands
**Commands are the atomic operations of Claude_dms3** — Predefined reusable commands that complete specific tasks.
| Category | Count | Description |
| --- | --- | --- |
| **Core Orchestration** | 2 | ccw, ccw-coordinator |
| **CLI Tools** | 2 | cli-init, codex-review |
| **Issue Workflow** | 8 | discover, plan, execute, queue, etc. |
| **Memory** | 2 | prepare, style-skill-memory |
| **Workflow Session** | 6 | start, resume, list, complete, etc. |
| **Workflow Analysis** | 10+ | analyze, brainstorm, debug, refactor, etc. |
| **Workflow UI Design** | 9 | generate, import-from-code, style-extract, etc. |
::: tip Tip
Commands are defined in the `.claude/commands/` directory. Each command is a Markdown file.
:::
### 3.1.2 Skills - Composite Skills
**Skills are combined encapsulations of Commands** — Reusable skills for specific scenarios, containing multiple steps and best practices.
| Skill | Function | Trigger |
| --- | --- | --- |
| **brainstorm** | Multi-perspective brainstorming | `/brainstorm` |
| **ccw-help** | CCW command help | `/ccw-help` |
| **command-generator** | Generate Claude commands | `/command-generator` |
| **issue-manage** | Issue management | `/issue-manage` |
| **memory-capture** | Memory compression and capture | `/memory-capture` |
| **memory-manage** | Memory updates | `/memory-manage` |
| **review-code** | Multi-dimensional code review | `/review-code` |
| **review-cycle** | Code review and fix cycle | `/review-cycle` |
| **skill-generator** | Generate Claude skills | `/skill-generator` |
| **skill-tuning** | Skill diagnosis and tuning | `/skill-tuning` |
::: tip Tip
Skills are defined in the `.claude/skills/` directory, containing SKILL.md specification files and reference documentation.
:::
### 3.1.3 Prompts - Codex Prompts
**Prompts are instruction templates for the Codex model** — Prompt templates optimized for the Codex (GPT) model.
| Prompt | Function |
| --- | --- |
| **prep-cycle** | Prep cycle prompt |
| **prep-plan** | Prep planning prompt |
::: tip Tip
Codex Prompts are defined in the `.codex/prompts/` directory, optimized specifically for the Codex model.
:::
---
## 3.2 Three-Layer Relationship
```
┌─────────────────────────────────────────────────────┐
│ User Request │
└────────────────────┬────────────────────────────────┘
┌─────────────────────────────────────────────────────┐
│ ccw (Orchestrator) │
│ Intent Analysis → Workflow Selection → Execution │
└────────────────────┬────────────────────────────────┘
┌───────────┼───────────┐
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│ Command│ │ Skill │ │ Prompt │
│ (Atom) │ │(Composite)│ │(Template)│
└────────┘ └────────┘ └────────┘
│ │ │
└───────────┼───────────┘
┌────────────────┐
│ AI Model Call │
└────────────────┘
```
### 3.2.1 Call Path
1. **User initiates request** → Enter command or describe requirements in VS Code
2. **ccw orchestration** → Intent analysis, select appropriate workflow
3. **Execute Command** → Execute atomic command operations
4. **Call Skill** → For complex logic, call composite skills
5. **Use Prompt** → For specific models, use optimized prompts
6. **AI model execution** → Call configured AI model
7. **Return result** → Format output to user
---
## 3.3 Workflow Session Management
### 3.3.1 Session Lifecycle
```
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Start │────▶│ Resume │────▶│ Execute │────▶│Complete │
│ Launch │ │ Resume │ │ Execute │ │ Complete│
└─────────┘ └─────────┘ └─────────┘ └─────────┘
│ │
▼ ▼
┌─────────┐ ┌─────────┐
│ List │ │ Solidify│
│ List │ │ Solidify│
└─────────┘ └─────────┘
```
### 3.3.2 Session Commands
| Command | Function | Example |
| --- | --- | --- |
| **start** | Start new session | `/workflow:session:start` |
| **resume** | Resume existing session | `/workflow:session:resume <session-id>` |
| **list** | List all sessions | `/workflow:session:list` |
| **sync** | Sync session state | `/workflow:session:sync` |
| **complete** | Complete current session | `/workflow:session:complete` |
| **solidify** | Solidify session results | `/workflow:session:solidify` |
### 3.3.3 Session Directory Structure
```
.workflow/
├── .team/
│ └── TC-<project>-<date>/ # Session directory
│ ├── spec/ # Session specifications
│ │ ├── discovery-context.json
│ │ └── requirements.md
│ ├── artifacts/ # Session artifacts
│ ├── wisdom/ # Session wisdom
│ │ ├── learnings.md
│ │ ├── decisions.md
│ │ ├── conventions.md
│ │ └── issues.md
│ └── .team-msg/ # Message bus
```
---
## 3.4 Team Collaboration Patterns
### 3.4.1 Role System
Claude_dms3 supports 8 team workflows, each defining different roles:
| Workflow | Roles | Description |
| --- | --- | --- |
| **PlanEx** | planner, executor | Planning-execution separation |
| **IterDev** | developer, reviewer | Iterative development |
| **Lifecycle** | analyzer, developer, tester, reviewer | Lifecycle coverage |
| **Issue** | discoverer, planner, executor | Issue-driven |
| **Testing** | tester, developer | Test-driven |
| **QA** | qa, developer | Quality assurance |
| **Brainstorm** | facilitator, perspectives | Multi-perspective analysis |
| **UIDesign** | designer, developer | UI design generation |
### 3.4.2 Message Bus
Team members communicate via the message bus:
```
┌────────────┐ ┌────────────┐
│ Planner │ │ Executor │
└─────┬──────┘ └──────┬─────┘
│ │
│ [plan_ready] │
├────────────────────────────────▶
│ │
│ [task_complete]
│◀────────────────────────────────┤
│ │
│ [plan_approved] │
├────────────────────────────────▶
│ │
```
### 3.4.3 Workflow Selection Guide
| Task Objective | Recommended Workflow | Command |
| --- | --- | --- |
| New feature development | PlanEx | `/workflow:plan` |
| Bug fix | Lifecycle | `/debug-with-file` |
| Code refactoring | IterDev | `/refactor-cycle` |
| Technical decision | Brainstorm | `/brainstorm-with-file` |
| UI development | UIDesign | `/workflow:ui-design` |
| Integration testing | Testing | `/integration-test-cycle` |
| Code review | QA | `/review-cycle` |
| Issue management | Issue | `/issue` series |
---
## 3.5 Core Concepts Overview
| Concept | Description | Location/Command |
| --- | --- | --- |
| **Command** | Atomic operation commands | `.claude/commands/` |
| **Skill** | Composite skill encapsulation | `.claude/skills/` |
| **Prompt** | Codex prompt templates | `.codex/prompts/` |
| **Workflow** | Team collaboration process | `/workflow:*` |
| **Session** | Session context management | `/workflow:session:*` |
| **Memory** | Cross-session knowledge persistence | `ccw memory` |
| **Spec** | Project specification constraints | `.workflow/specs/` |
| **CodexLens** | Semantic code indexing | `.codex-lens/` |
| **CCW** | CLI invocation framework | `ccw` directory |
---
## 3.6 Data Flow
```
User Request
┌──────────────┐
│ CCW Orchestrator│ ──▶ Intent Analysis
└──────────────┘
├─▶ Workflow Selection
│ │
│ ├─▶ PlanEx
│ ├─▶ IterDev
│ ├─▶ Lifecycle
│ └─▶ ...
├─▶ Command Execution
│ │
│ ├─▶ Built-in commands
│ └─▶ Skill calls
├─▶ AI Model Invocation
│ │
│ ├─▶ Gemini
│ ├─▶ Qwen
│ ├─▶ Codex
│ └─▶ Claude
└─▶ Result Return
├─▶ File modification
├─▶ Memory update
└─▶ Dashboard update
```
---
## Next Steps
- [Workflow Basics](ch04-workflow-basics.md) — Learn various workflow commands
- [Advanced Tips](ch05-advanced-tips.md) — CLI toolchain, multi-model collaboration
- [Best Practices](ch06-best-practices.md) — Team collaboration standards, code review process

View File

@@ -0,0 +1,328 @@
# Workflow Basics
## One-Line Positioning
**Workflows are the core of team collaboration** — 8 workflows covering the full development lifecycle, from planning to execution, from analysis to testing.
---
## 4.1 Workflow Overview
| Workflow | Core Command | Use Case | Roles |
| --- | --- | --- | --- |
| **PlanEx** | `/workflow:plan` | New feature development, requirement implementation | planner, executor |
| **IterDev** | `/refactor-cycle` | Code refactoring, technical debt handling | developer, reviewer |
| **Lifecycle** | `/unified-execute-with-file` | Complete development cycle | analyzer, developer, tester, reviewer |
| **Issue** | `/issue:*` | Issue-driven development | discoverer, planner, executor |
| **Testing** | `/integration-test-cycle` | Integration testing, test generation | tester, developer |
| **QA** | `/review-cycle` | Code review and quality assurance | qa, developer |
| **Brainstorm** | `/brainstorm-with-file` | Multi-perspective analysis, technical decisions | facilitator, perspectives |
| **UIDesign** | `/workflow:ui-design` | UI design and code generation | designer, developer |
---
## 4.2 PlanEx - Planning-Execution Workflow
### 4.2.1 One-Line Positioning
**PlanEx is a planning-execution separation workflow** — Plan first, then execute, ensuring tasks are clear before starting work.
### 4.2.2 Launch Method
```
/workflow:plan
```
Or describe requirements directly:
```
Implement user login functionality, supporting email and phone number login
```
### 4.2.3 Workflow Process
```
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Planner │────▶│ Executor │────▶│ Reviewer │
│ Planning │ │ Execution │ │ Review │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Requirements│ │ Task │ │ Code │
│ Analysis │ │ Execution │ │ Review │
│ Task Breakdown│ Code Gen │ │ Quality │
│ Plan Gen │ │ Test Write │ │ Feedback │
└─────────────┘ └─────────────┘ └─────────────┘
```
### 4.2.4 Output Artifacts
| Artifact | Location | Description |
| --- | --- | --- |
| **Requirements Analysis** | `artifacts/requirements.md` | Detailed requirement analysis |
| **Task Plan** | `artifacts/plan.md` | Structured task list |
| **Execution Artifacts** | `artifacts/implementation/` | Code and tests |
| **Wisdom Accumulation** | `wisdom/learnings.md` | Lessons learned |
---
## 4.3 IterDev - Iterative Development Workflow
### 4.3.1 One-Line Positioning
**IterDev is an iterative refactoring workflow** — Discover technical debt, plan refactoring, improve iteratively.
### 4.3.2 Launch Method
```
/refactor-cycle
```
### 4.3.3 Workflow Process
```
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Discover │────▶│ Plan │────▶│ Refactor │
│ Discovery │ │ Planning │ │ Refactoring │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Code │ │ Refactor │ │ Code │
│ Analysis │ │ Strategy │ │ Modification│
│ Problem │ │ Priority │ │ Test │
│ ID │ │ Task Breakdown│ │ Verification│
│ Tech Debt │ │ │ │ Doc Update │
└─────────────┘ └─────────────┘ └─────────────┘
```
### 4.3.4 Use Cases
| Scenario | Example |
| --- | --- |
| **Code Smells** | Long functions, duplicate code |
| **Architecture Improvement** | Decoupling, modularization |
| **Performance Optimization** | Algorithm optimization, caching strategy |
| **Security Hardening** | Fix security vulnerabilities |
| **Standard Unification** | Code style consistency |
---
## 4.4 Lifecycle - Lifecycle Workflow
### 4.4.1 One-Line Positioning
**Lifecycle is a full-lifecycle coverage workflow** — From analysis to testing to review, complete closed loop.
### 4.4.2 Launch Method
```
/unified-execute-with-file <file>
```
### 4.4.3 Role Responsibilities
| Role | Responsibility | Output |
| --- | --- | --- |
| **Analyzer** | Analyze requirements, explore code | Analysis report |
| **Developer** | Implement features, write tests | Code + tests |
| **Tester** | Run tests, verify functionality | Test report |
| **Reviewer** | Code review, quality check | Review report |
### 4.4.4 Workflow Process
```
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│Analyzer │──▶│Developer│──▶│ Tester │──▶│Reviewer │
│ Analysis │ │ Develop │ │ Test │ │ Review │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
│ │ │ │
▼ ▼ ▼ ▼
Requirement Code Test Quality
Analysis Implementation Verification Gate
Code Unit Regression Final
Exploration Test Test Confirmation
```
---
## 4.5 Issue - Issue Management Workflow
### 4.5.1 One-Line Positioning
**Issue is an issue-driven development workflow** — From issue discovery to planning to execution, complete tracking.
### 4.5.2 Issue Commands
| Command | Function | Example |
| --- | --- | --- |
| **discover** | Discover Issue | `/issue discover https://github.com/xxx/issue/1` |
| **discover-by-prompt** | Create from Prompt | `/issue discover-by-prompt "Login failed"` |
| **from-brainstorm** | Create from brainstorm | `/issue from-brainstorm` |
| **plan** | Batch plan Issues | `/issue plan` |
| **queue** | Form execution queue | `/issue queue` |
| **execute** | Execute Issue queue | `/issue execute` |
### 4.5.3 Workflow Process
```
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│Discover │──▶│ Plan │──▶│ Queue │──▶│ Execute │
│Discovery│ │ Plan │ │ Queue │ │ Execute │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
│ │ │ │
▼ ▼ ▼ ▼
Identify Analyze Priority Implement
Problems Requirements Sort Solution
Define Plan Dependencies Verify
Scope Results
```
---
## 4.6 Testing - Testing Workflow
### 4.6.1 One-Line Positioning
**Testing is a self-iterating test workflow** — Auto-generate tests, iteratively improve test coverage.
### 4.6.2 Launch Method
```
/integration-test-cycle
```
### 4.6.3 Workflow Process
```
┌─────────┐ ┌─────────┐ ┌─────────┐
│Generate │──▶│ Execute │──▶│ Verify │
│ Generate │ │ Execute │ │ Verify │
└─────────┘ └─────────┘ └─────────┘
│ │ │
▼ ▼ ▼
Test Cases Run Tests Coverage
Mock Data Failure Analysis
Analysis Gap Fill
```
---
## 4.7 QA - Quality Assurance Workflow
### 4.7.1 One-Line Positioning
**QA is a code review workflow** — 6-dimensional code review, auto-discover issues.
### 4.7.2 Launch Method
```
/review-cycle
```
### 4.7.3 Review Dimensions
| Dimension | Check Items |
| --- | --- |
| **Correctness** | Logic correct, boundary handling |
| **Performance** | Algorithm efficiency, resource usage |
| **Security** | Injection vulnerabilities, permission checks |
| **Maintainability** | Code clarity, modularity |
| **Test Coverage** | Unit tests, boundary tests |
| **Standard Compliance** | Coding standards, project conventions |
---
## 4.8 Brainstorm - Brainstorming Workflow
### 4.8.1 One-Line Positioning
**Brainstorm is a multi-perspective analysis workflow** — Analyze problems from multiple viewpoints for comprehensive insights.
### 4.8.2 Launch Method
```
/brainstorm-with-file <file>
```
### 4.8.3 Analysis Perspectives
| Perspective | Role | Focus |
| --- | --- | --- |
| **Product** | Product Manager | Market fit, user value |
| **Technical** | Tech Lead | Feasibility, technical debt |
| **Quality** | QA Lead | Completeness, testability |
| **Risk** | Risk Analyst | Risk identification, dependencies |
### 4.8.4 Output Format
```markdown
## Consensus Points
- [Consensus point 1]
- [Consensus point 2]
## Divergences
- [Divergence 1]
- Perspective A: ...
- Perspective B: ...
- Recommendation: ...
## Action Items
- [ ] [Action item 1]
- [ ] [Action item 2]
```
---
## 4.9 UIDesign - UI Design Workflow
### 4.9.1 One-Line Positioning
**UIDesign is a UI design generation workflow** — From design to code, auto-extract styles and layouts.
### 4.9.2 UI Design Commands
| Command | Function |
| --- | --- |
| **generate** | Generate UI components |
| **import-from-code** | Import styles from code |
| **style-extract** | Extract style specifications |
| **layout-extract** | Extract layout structure |
| **imitate-auto** | Imitate reference page |
| **codify-style** | Convert styles to code |
| **design-sync** | Sync design changes |
---
## 4.10 Quick Reference
### Workflow Selection Guide
| Requirement | Recommended Workflow | Command |
| --- | --- | --- |
| New feature development | PlanEx | `/workflow:plan` |
| Code refactoring | IterDev | `/refactor-cycle` |
| Complete development | Lifecycle | `/unified-execute-with-file` |
| Issue management | Issue | `/issue:*` |
| Test generation | Testing | `/integration-test-cycle` |
| Code review | QA | `/review-cycle` |
| Multi-perspective analysis | Brainstorm | `/brainstorm-with-file` |
| UI development | UIDesign | `/workflow:ui-design` |
### Session Management Commands
| Command | Function |
| --- | --- |
| `/workflow:session:start` | Start new session |
| `/workflow:session:resume` | Resume session |
| `/workflow:session:list` | List sessions |
| `/workflow:session:complete` | Complete session |
| `/workflow:session:solidify` | Solidify results |
---
## Next Steps
- [Advanced Tips](ch05-advanced-tips.md) — CLI toolchain, multi-model collaboration
- [Best Practices](ch06-best-practices.md) — Team collaboration standards, code review process

View File

@@ -0,0 +1,331 @@
# Advanced Tips
## One-Line Positioning
**Advanced Tips are the key to efficiency improvement** — Deep CLI toolchain usage, multi-model collaboration optimization, memory management best practices.
---
## 5.1 CLI Toolchain Usage
### 5.1.1 CLI Configuration
CLI tool configuration file: `~/.claude/cli-tools.json`
```json
{
"version": "3.3.0",
"tools": {
"gemini": {
"enabled": true,
"primaryModel": "gemini-2.5-flash",
"secondaryModel": "gemini-2.5-flash",
"tags": ["analysis", "Debug"],
"type": "builtin"
},
"qwen": {
"enabled": true,
"primaryModel": "coder-model",
"secondaryModel": "coder-model",
"tags": [],
"type": "builtin"
},
"codex": {
"enabled": true,
"primaryModel": "gpt-5.2",
"secondaryModel": "gpt-5.2",
"tags": [],
"type": "builtin"
}
}
}
```
### 5.1.2 Tag Routing
Automatically select models based on task type:
| Tag | Applicable Model | Task Type |
| --- | --- | --- |
| **analysis** | Gemini | Code analysis, architecture design |
| **Debug** | Gemini | Root cause analysis, problem diagnosis |
| **implementation** | Qwen | Feature development, code generation |
| **review** | Codex | Code review, Git operations |
### 5.1.3 CLI Command Templates
#### Analysis Task
```bash
ccw cli -p "PURPOSE: Identify security vulnerabilities
TASK: • Scan for SQL injection • Check XSS • Verify CSRF
MODE: analysis
CONTEXT: @src/auth/**/*
EXPECTED: Security report with severity grading and fix recommendations
CONSTRAINTS: Focus on auth module" --tool gemini --mode analysis --rule analysis-assess-security-risks
```
#### Implementation Task
```bash
ccw cli -p "PURPOSE: Implement rate limiting
TASK: • Create middleware • Configure routes • Redis backend
MODE: write
CONTEXT: @src/middleware/**/* @src/config/**/*
EXPECTED: Production code + unit tests + integration tests
CONSTRAINTS: Follow existing middleware patterns" --tool qwen --mode write --rule development-implement-feature
```
### 5.1.4 Rule Templates
| Rule | Purpose |
| --- | --- |
| **analysis-diagnose-bug-root-cause** | Bug root cause analysis |
| **analysis-analyze-code-patterns** | Code pattern analysis |
| **analysis-review-architecture** | Architecture review |
| **analysis-assess-security-risks** | Security assessment |
| **development-implement-feature** | Feature implementation |
| **development-refactor-codebase** | Code refactoring |
| **development-generate-tests** | Test generation |
---
## 5.2 Multi-Model Collaboration
### 5.2.1 Model Selection Guide
| Task | Recommended Model | Reason |
| --- | --- | --- |
| **Code Analysis** | Gemini | Strong at deep code understanding and pattern recognition |
| **Bug Diagnosis** | Gemini | Powerful root cause analysis capability |
| **Feature Development** | Qwen | High code generation efficiency |
| **Code Review** | Codex (GPT) | Good Git integration, standard review format |
| **Long Text** | Claude | Large context window |
### 5.2.2 Collaboration Patterns
#### Serial Collaboration
```bash
# Step 1: Gemini analysis
ccw cli -p "Analyze code architecture" --tool gemini --mode analysis
# Step 2: Qwen implementation
ccw cli -p "Implement feature based on analysis" --tool qwen --mode write
# Step 3: Codex review
ccw cli -p "Review implementation code" --tool codex --mode review
```
#### Parallel Collaboration
Use `--tool gemini` and `--tool qwen` to analyze the same problem simultaneously:
```bash
# Terminal 1
ccw cli -p "Analyze from performance perspective" --tool gemini --mode analysis &
# Terminal 2
ccw cli -p "Analyze from security perspective" --tool codex --mode analysis &
```
### 5.2.3 Session Resume
Cross-model session resume:
```bash
# First call
ccw cli -p "Analyze authentication module" --tool gemini --mode analysis
# Resume session to continue
ccw cli -p "Based on previous analysis, design improvement plan" --tool qwen --mode write --resume
```
---
## 5.3 Memory Management
### 5.3.1 Memory Categories
| Category | Purpose | Example Content |
| --- | --- | --- |
| **learnings** | Learning insights | New technology usage experience |
| **decisions** | Architecture decisions | Technology selection rationale |
| **conventions** | Coding standards | Naming conventions, patterns |
| **issues** | Known issues | Bugs, limitations, TODOs |
### 5.3.2 Memory Commands
| Command | Function | Example |
| --- | --- | --- |
| **list** | List all memories | `ccw memory list` |
| **search** | Search memories | `ccw memory search "authentication"` |
| **export** | Export memory | `ccw memory export <id>` |
| **import** | Import memory | `ccw memory import "..."` |
| **embed** | Generate embeddings | `ccw memory embed <id>` |
### 5.3.3 Memory Best Practices
::: tip Tip
- **Regular cleanup**: Organize Memory weekly, delete outdated content
- **Structure**: Use standard format for easy search and reuse
- **Context**: Record decision background, not just conclusions
- **Linking**: Cross-reference related content
:::
### 5.3.4 Memory Template
```markdown
## Title
### Background
- **Problem**: ...
- **Impact**: ...
### Decision
- **Solution**: ...
- **Rationale**: ...
### Result
- **Effect**: ...
- **Lessons Learned**: ...
### Related
- [Related Memory 1](memory-id-1)
- [Related Documentation](link)
```
---
## 5.4 CodexLens Advanced Usage
### 5.4.1 Hybrid Search
Combine vector search and keyword search:
```bash
# Pure vector search
ccw search --mode vector "user authentication"
# Hybrid search (default)
ccw search --mode hybrid "user authentication"
# Pure keyword search
ccw search --mode keyword "authenticate"
```
### 5.4.2 Call Chain Tracing
Trace complete call chains of functions:
```bash
# Trace up (who called me)
ccw search --trace-up "authenticateUser"
# Trace down (who I called)
ccw search --trace-down "authenticateUser"
# Full call chain
ccw search --trace-full "authenticateUser"
```
### 5.4.3 Semantic Search Techniques
| Technique | Example | Effect |
| --- | --- | --- |
| **Functional description** | "handle user login" | Find login-related code |
| **Problem description** | "memory leak locations" | Find potential issues |
| **Pattern description** | "singleton implementation" | Find design patterns |
| **Technical description** | "using React Hooks" | Find related usage |
---
## 5.5 Hook Auto-Injection
### 5.5.1 Hook Types
| Hook Type | Trigger Time | Purpose |
| --- | --- | --- |
| **pre-command** | Before command execution | Inject specifications, load context |
| **post-command** | After command execution | Save Memory, update state |
| **pre-commit** | Before Git commit | Code review, standard checks |
| **file-change** | On file change | Auto-format, update index |
### 5.5.2 Hook Configuration
Configure in `.claude/hooks.json`:
```json
{
"pre-command": [
{
"name": "inject-specs",
"description": "Inject project specifications",
"command": "cat .workflow/specs/project-constraints.md"
},
{
"name": "load-memory",
"description": "Load related Memory",
"command": "ccw memory search \"{query}\""
}
],
"post-command": [
{
"name": "save-memory",
"description": "Save important decisions",
"command": "ccw memory import \"{content}\""
}
]
}
```
---
## 5.6 Performance Optimization
### 5.6.1 Indexing Optimization
| Optimization | Description |
| --- | --- |
| **Incremental indexing** | Only index changed files |
| **Parallel indexing** | Multi-process parallel processing |
| **Caching strategy** | Vector embedding cache |
### 5.6.2 Search Optimization
| Optimization | Description |
| --- | --- |
| **Result caching** | Same query returns cached results |
| **Paginated loading** | Large result sets paginated |
| **Smart deduplication** | Auto-duplicate similar results |
---
## 5.7 Quick Reference
### CLI Command Cheatsheet
| Command | Function |
| --- | --- |
| `ccw cli -p "..." --tool gemini --mode analysis` | Analysis task |
| `ccw cli -p "..." --tool qwen --mode write` | Implementation task |
| `ccw cli -p "..." --tool codex --mode review` | Review task |
| `ccw memory list` | List memories |
| `ccw memory search "..."` | Search memories |
| `ccw search "..."` | Semantic search |
| `ccw search --trace "..."` | Call chain tracing |
### Rule Template Cheatsheet
| Rule | Purpose |
| --- | --- |
| `analysis-diagnose-bug-root-cause` | Bug analysis |
| `analysis-assess-security-risks` | Security assessment |
| `development-implement-feature` | Feature implementation |
| `development-refactor-codebase` | Code refactoring |
| `development-generate-tests` | Test generation |
---
## Next Steps
- [Best Practices](ch06-best-practices.md) — Team collaboration standards, code review process, documentation maintenance strategy

View File

@@ -0,0 +1,330 @@
# Best Practices
## One-Line Positioning
**Best Practices ensure efficient team collaboration** — Practical experience summary on standard formulation, code review, documentation maintenance, and team collaboration.
---
## 6.1 Team Collaboration Standards
### 6.1.1 Role Responsibility Definitions
| Role | Responsibility | Skill Requirements |
| --- | --- | --- |
| **Planner** | Requirement analysis, task breakdown | Architectural thinking, communication skills |
| **Developer** | Code implementation, unit testing | Coding ability, testing awareness |
| **Reviewer** | Code review, quality gatekeeping | Code sensitivity, standard understanding |
| **QA** | Quality assurance, test verification | Test design, risk identification |
| **Facilitator** | Coordination, progress tracking | Project management, conflict resolution |
### 6.1.2 Workflow Selection
| Scenario | Recommended Workflow | Rationale |
| --- | --- | --- |
| **New Feature Development** | PlanEx | Planning-execution separation, reduces risk |
| **Bug Fix** | Lifecycle | Complete closed loop, ensures fix quality |
| **Code Refactoring** | IterDev | Iterative improvement, continuous optimization |
| **Technical Decision** | Brainstorm | Multi-perspective analysis, comprehensive consideration |
| **Issue Management** | Issue | Traceable, manageable |
| **UI Development** | UIDesign | Seamless design-to-code transition |
### 6.1.3 Communication Protocols
#### Message Format
```
[<Role>] <Action> <Object>: <Result>
Examples:
[Planner] Task breakdown complete: Generated 5 subtasks
[Developer] Code implementation complete: user-auth.ts, 324 lines
[Reviewer] Code review complete: Found 2 issues, suggested 1 optimization
```
#### Status Reporting
| Status | Meaning | Next Action |
| --- | --- | --- |
| **pending** | Pending | Wait for dependencies to complete |
| **in_progress** | In progress | Continue execution |
| **completed** | Completed | Can be depended upon |
| **blocked** | Blocked | Manual intervention required |
---
## 6.2 Code Review Process
### 6.2.1 Review Dimensions
| Dimension | Check Items | Severity |
| --- | --- | --- |
| **Correctness** | Logic correct, boundary handling | HIGH |
| **Performance** | Algorithm efficiency, resource usage | MEDIUM |
| **Security** | Injection vulnerabilities, permission checks | HIGH |
| **Maintainability** | Code clarity, modularity | MEDIUM |
| **Test Coverage** | Unit tests, boundary tests | MEDIUM |
| **Standard Compliance** | Coding standards, project conventions | LOW |
### 6.2.2 Review Process
```
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Submit │──▶│ Review │──▶│ Feedback│──▶│ Fix │
│ Code │ │ Code │ │ Comments│ │ Issues │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
│ │ │ │
▼ ▼ ▼ ▼
Push PR Auto Review Manual Review Fix Verify
CI Check 6 Dimensions Code Walkthrough Re-review
```
### 6.2.3 Review Checklist
#### Code Correctness
- [ ] Logic correct, no bugs
- [ ] Boundary condition handling
- [ ] Complete error handling
- [ ] Proper resource cleanup
#### Performance
- [ ] Reasonable algorithm complexity
- [ ] No memory leaks
- [ ] No redundant computation
- [ ] Reasonable caching strategy
#### Security
- [ ] No SQL injection
- [ ] No XSS vulnerabilities
- [ ] Complete permission checks
- [ ] Sensitive data protection
#### Maintainability
- [ ] Clear naming
- [ ] Good modularity
- [ ] Sufficient comments
- [ ] Easy to test
#### Test Coverage
- [ ] Complete unit tests
- [ ] Boundary test coverage
- [ ] Exception case testing
- [ ] Integration test verification
#### Standard Compliance
- [ ] Unified coding style
- [ ] Naming standard compliance
- [ ] Project convention adherence
- [ ] Complete documentation
### 6.2.4 Feedback Format
```markdown
## Review Results
### Issues
1. **[HIGH]** SQL injection risk
- Location: `src/auth/login.ts:45`
- Recommendation: Use parameterized queries
2. **[MEDIUM]** Performance issue
- Location: `src/utils/cache.ts:78`
- Recommendation: Use LRU cache
### Suggestions
1. Naming optimization: `data``userData`
2. Module separation: Consider extracting Auth logic independently
### Approval Conditions
- [ ] Fix HIGH issues
- [ ] Consider MEDIUM suggestions
```
---
## 6.3 Documentation Maintenance Strategy
### 6.3.1 Documentation Classification
| Type | Location | Update Frequency | Owner |
| --- | --- | --- | --- |
| **Spec Documents** | `.workflow/specs/` | As needed | Architect |
| **Reference Docs** | `docs/ref/` | Every change | Developer |
| **Guide Docs** | `docs/guide/` | Monthly | Technical Writer |
| **API Docs** | `docs/api/` | Auto-generated | Tools |
| **FAQ** | `docs/faq.md` | Weekly | Support Team |
### 6.3.2 Documentation Update Triggers
| Event | Update Content |
| --- | --- |
| **New Feature** | Add feature documentation and API reference |
| **Spec Change** | Update spec documents and migration guide |
| **Bug Fix** | Update FAQ and known issues |
| **Architecture Change** | Update architecture docs and decision records |
| **Code Review** | Supplement missing comments and docs |
### 6.3.3 Documentation Quality Standards
| Standard | Requirement |
| --- | --- |
| **Accuracy** | Consistent with actual code |
| **Completeness** | Cover all public APIs |
| **Clarity** | Easy to understand, sufficient examples |
| **Timeliness** | Updated promptly, not lagging |
| **Navigability** | Clear structure, easy to find |
---
## 6.4 Memory Management Best Practices
### 6.4.1 Memory Recording Triggers
| Trigger | Record Content |
| --- | --- |
| **Architecture Decisions** | Technology selection, design decisions |
| **Problem Resolution** | Bug root cause, solutions |
| **Experience Summary** | Best practices, gotchas |
| **Standard Conventions** | Coding standards, naming conventions |
| **Known Issues** | Bugs, limitations, TODOs |
### 6.4.2 Memory Format Standards
```markdown
## [Type] Title
### Background
- **Problem**: ...
- **Impact**: ...
- **Context**: ...
### Analysis/Decision
- **Solution**: ...
- **Rationale**: ...
- **Alternatives**: ...
### Result
- **Effect**: ...
- **Data**: ...
### Related
- [Related Memory](memory-id)
- [Related Code](file-link)
- [Related Documentation](doc-link)
```
### 6.4.3 Memory Maintenance
| Maintenance Item | Frequency | Content |
| --- | --- | --- |
| **Deduplication** | Weekly | Merge duplicate memories |
| **Update** | As needed | Update outdated content |
| **Archive** | Monthly | Archive historical memories |
| **Cleanup** | Quarterly | Delete useless memories |
---
## 6.5 Hook Usage Standards
### 6.5.1 Hook Types
| Hook Type | Purpose | Example |
| --- | --- | --- |
| **pre-command** | Inject specifications, load context | Auto-load CLAUDE.md |
| **post-command** | Save Memory, update index | Auto-save decisions |
| **pre-commit** | Code review, standard checks | Auto-run Lint |
| **file-change** | Auto-format, update index | Auto-format code |
### 6.5.2 Hook Configuration Principles
| Principle | Description |
| --- | --- |
| **Minimize** | Only configure necessary Hooks |
| **Idempotent** | Hook execution results are repeatable |
| **Recoverable** | Hook failure doesn't affect main flow |
| **Observable** | Hook execution has logging |
---
## 6.6 Team Collaboration Techniques
### 6.6.1 Conflict Resolution
| Conflict Type | Resolution Strategy |
| --- | --- |
| **Standard Conflict** | Team discussion, unify standards |
| **Technical Disagreement** | Brainstorm, data-driven |
| **Schedule Conflict** | Priority sorting, resource adjustment |
| **Quality Conflict** | Set standards, automated checks |
### 6.6.2 Knowledge Sharing
| Method | Frequency | Content |
| --- | --- | --- |
| **Tech Sharing** | Weekly | New technologies, best practices |
| **Code Walkthrough** | Every PR | Code logic, design approach |
| **Documentation Sync** | Monthly | Documentation updates, standard changes |
| **Incident Retrospective** | Every incident | Root cause analysis, improvements |
### 6.6.3 Efficiency Improvement
| Technique | Effect |
| --- | --- |
| **Templating** | Reuse successful patterns |
| **Automation** | Reduce repetitive work |
| **Tooling** | Improve development efficiency |
| **Standardization** | Lower communication cost |
---
## 6.7 Quick Reference
### Workflow Selection Guide
| Scenario | Workflow | Command |
| --- | --- | --- |
| New Feature | PlanEx | `/workflow:plan` |
| Bug Fix | Lifecycle | `/unified-execute-with-file` |
| Refactoring | IterDev | `/refactor-cycle` |
| Decision | Brainstorm | `/brainstorm-with-file` |
| UI Development | UIDesign | `/workflow:ui-design` |
### Code Review Checklist
- [ ] Correctness check
- [ ] Performance check
- [ ] Security check
- [ ] Maintainability check
- [ ] Test coverage check
- [ ] Standard compliance check
### Memory Maintenance
| Operation | Command |
| --- | --- |
| List memories | `ccw memory list` |
| Search memories | `ccw memory search "..."` |
| Import memory | `ccw memory import "..."` |
| Export memory | `ccw memory export <id>` |
---
## Summary
Claude_dms3 best practices can be summarized as:
1. **Standards First** - Establish clear team standards
2. **Process Assurance** - Use appropriate workflows
3. **Quality Gatekeeping** - Strict code review
4. **Knowledge Accumulation** - Continuously maintain Memory and documentation
5. **Continuous Improvement** - Regular retrospectives and optimization
---
## Related Links
- [What is Claude_dms3](ch01-what-is-claude-dms3.md)
- [Getting Started](ch02-getting-started.md)
- [Core Concepts](ch03-core-concepts.md)
- [Workflow Basics](ch04-workflow-basics.md)
- [Advanced Tips](ch05-advanced-tips.md)

225
docs/guide/claude-md.md Normal file
View File

@@ -0,0 +1,225 @@
# CLAUDE.md Guide
Configure project-specific instructions for CCW using CLAUDE.md.
## What is CLAUDE.md?
`CLAUDE.md` is a special file that contains project-specific instructions, conventions, and preferences for CCW. It's automatically loaded when CCW operates on your project.
## File Location
Place `CLAUDE.md` in your project root:
```
my-project/
├── CLAUDE.md # Project instructions
├── package.json
└── src/
```
## File Structure
```markdown
# Project Name
## Overview
Brief description of the project.
## Tech Stack
- Frontend: Framework + libraries
- Backend: Runtime + framework
- Database: Storage solution
## Coding Standards
- Style guide
- Linting rules
- Formatting preferences
## Architecture
- Project structure
- Key patterns
- Important conventions
## Development Guidelines
- How to add features
- Testing requirements
- Documentation standards
```
## Example CLAUDE.md
```markdown
# E-Commerce Platform
## Overview
Multi-tenant e-commerce platform with headless architecture.
## Tech Stack
- Frontend: Vue 3 + TypeScript + Vite
- Backend: Node.js + NestJS
- Database: PostgreSQL + Redis
- Queue: BullMQ
## Coding Standards
### TypeScript
- Use strict mode
- No implicit any
- Explicit return types
### Naming Conventions
- Components: PascalCase (UserProfile.ts)
- Utilities: camelCase (formatDate.ts)
- Constants: UPPER_SNAKE_CASE (API_URL)
### File Structure
```
src/
├── components/ # Vue components
├── composables/ # Vue composables
├── services/ # Business logic
├── types/ # TypeScript types
└── utils/ # Utilities
```
## Architecture
### Layered Architecture
1. **Presentation Layer**: Vue components
2. **Application Layer**: Composables and services
3. **Domain Layer**: Business logic
4. **Infrastructure Layer**: External services
### Key Patterns
- Repository pattern for data access
- Factory pattern for complex objects
- Strategy pattern for payments
## Development Guidelines
### Adding Features
1. Create feature branch from develop
2. Implement feature with tests
3. Update documentation
4. Create PR with template
### Testing
- Unit tests: Vitest
- E2E tests: Playwright
- Coverage: >80%
### Commits
Follow conventional commits:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- refactor: Refactoring
- test: Tests
## Important Notes
- Always use TypeScript strict mode
- Never commit .env files
- Run linter before commit
- Update API docs for backend changes
```
## Sections
### Required Sections
| Section | Purpose |
|---------|---------|
| Overview | Project description |
| Tech Stack | Technologies used |
| Coding Standards | Style conventions |
| Architecture | System design |
### Optional Sections
| Section | Purpose |
|---------|---------|
| Testing | Test requirements |
| Deployment | Deploy process |
| Troubleshooting | Common issues |
| References | External docs |
## Best Practices
### 1. Keep It Current
Update CLAUDE.md when:
- Tech stack changes
- New patterns adopted
- Standards updated
### 2. Be Specific
Instead of:
```markdown
## Style
Follow good practices
```
Use:
```markdown
## Style
- Use ESLint with project config
- Max line length: 100
- Use single quotes for strings
```
### 3. Provide Examples
```markdown
## Naming
Components use PascalCase:
- UserProfile.vue ✓
- userProfile.vue ✗
```
## Multiple Projects
For monorepos, use multiple CLAUDE.md files:
```
monorepo/
├── CLAUDE.md # Root instructions
├── packages/
│ ├── frontend/
│ │ └── CLAUDE.md # Frontend specific
│ └── backend/
│ └── CLAUDE.md # Backend specific
```
## Template
```markdown
# [Project Name]
## Overview
[1-2 sentence description]
## Tech Stack
- [Framework/Language]
- [Key libraries]
## Coding Standards
- [Style guide]
- [Linting]
## Architecture
- [Structure]
- [Patterns]
## Development
- [How to add features]
- [Testing approach]
## Notes
- [Important conventions]
```
::: info See Also
- [Configuration](./cli-tools.md) - CLI tools config
- [Workflows](../workflows/) - Development workflows
:::

272
docs/guide/cli-tools.md Normal file
View File

@@ -0,0 +1,272 @@
# CLI Tools Configuration
Configure and customize CCW CLI tools for your development workflow.
## Configuration File
CCW CLI tools are configured in `~/.claude/cli-tools.json`:
```json
{
"version": "3.3.0",
"tools": {
"tool-id": {
"enabled": true,
"primaryModel": "model-name",
"secondaryModel": "fallback-model",
"tags": ["tag1", "tag2"],
"type": "builtin | api-endpoint | cli-wrapper"
}
}
}
```
## Tool Types
### Builtin Tools
Full-featured tools with all capabilities:
```json
{
"gemini": {
"enabled": true,
"primaryModel": "gemini-2.5-flash",
"secondaryModel": "gemini-2.5-pro",
"tags": ["analysis", "debug"],
"type": "builtin"
}
}
```
**Capabilities**: Analysis + Write tools
### API Endpoint Tools
Analysis-only tools for specialized tasks:
```json
{
"custom-api": {
"enabled": true,
"primaryModel": "custom-model",
"tags": ["specialized-analysis"],
"type": "api-endpoint"
}
}
```
**Capabilities**: Analysis only
## CLI Command Format
### Universal Template
```bash
ccw cli -p "PURPOSE: [goal] + [why] + [success criteria]
TASK: • [step 1] • [step 2] • [step 3]
MODE: [analysis|write|review]
CONTEXT: @[file patterns] | Memory: [context]
EXPECTED: [output format]
CONSTRAINTS: [constraints]" --tool <tool-id> --mode <mode> --rule <template>
```
### Required Parameters
| Parameter | Description | Options |
|-----------|-------------|---------|
| `--mode <mode>` | **REQUIRED** - Execution permission level | `analysis` (read-only) \| `write` (create/modify) \| `review` (git-aware review) |
| `-p <prompt>` | **REQUIRED** - Task prompt with structured template | - |
### Optional Parameters
| Parameter | Description | Example |
|-----------|-------------|---------|
| `--tool <tool>` | Explicit tool selection | `--tool gemini` |
| `--rule <template>` | Load rule template for structured prompts | `--rule analysis-review-architecture` |
| `--resume [id]` | Resume previous session | `--resume` or `--resume session-id` |
| `--cd <path>` | Set working directory | `--cd src/auth` |
| `--includeDirs <dirs>` | Include additional directories (comma-separated) | `--includeDirs ../shared,../types` |
| `--model <model>` | Override tool's primary model | `--model gemini-2.5-pro` |
## Tool Selection
### Tag-Based Routing
Tools are selected based on task requirements:
```bash
# Task with "analysis" tag routes to gemini
ccw cli -p "PURPOSE: Debug authentication issue
TASK: • Trace auth flow • Identify failure point
MODE: analysis" --tool gemini --mode analysis
# No tags - uses first enabled tool
ccw cli -p "PURPOSE: Implement feature X
TASK: • Create component • Add tests
MODE: write" --mode write
```
### Explicit Selection
Override automatic selection:
```bash
ccw cli -p "Task description" --tool codex --mode write
```
### Rule Templates
Auto-load structured prompt templates:
```bash
# Architecture review template
ccw cli -p "Analyze system architecture" --mode analysis --rule analysis-review-architecture
# Feature implementation template
ccw cli -p "Add OAuth2 authentication" --mode write --rule development-implement-feature
```
## Model Configuration
### Primary vs Secondary
```json
{
"codex": {
"primaryModel": "gpt-5.2",
"secondaryModel": "gpt-5.2"
}
}
```
- **primaryModel**: Default model for the tool
- **secondaryModel**: Fallback if primary fails
### Available Models
| Tool | Available Models |
|------|------------------|
| gemini | gemini-3-pro-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash |
| codex | gpt-5.2 |
| claude | sonnet, haiku |
| qwen | coder-model |
## Tool Tags
Tags enable automatic tool selection:
| Tag | Use Case |
|-----|----------|
| analysis | Code review, architecture analysis |
| debug | Bug diagnosis, troubleshooting |
| implementation | Feature development, code generation |
| documentation | Doc generation, technical writing |
| testing | Test generation, coverage analysis |
## Example Configurations
### Development Setup
```json
{
"version": "3.3.0",
"tools": {
"gemini": {
"enabled": true,
"primaryModel": "gemini-2.5-flash",
"tags": ["development", "debug"],
"type": "builtin"
},
"codex": {
"enabled": true,
"primaryModel": "gpt-5.2",
"tags": ["implementation", "review"],
"type": "builtin"
}
}
}
```
### Cost Optimization
```json
{
"tools": {
"gemini": {
"enabled": true,
"primaryModel": "gemini-2.0-flash",
"tags": ["analysis"],
"type": "builtin"
}
}
}
```
### Quality Focus
```json
{
"tools": {
"codex": {
"enabled": true,
"primaryModel": "gpt-5.2",
"tags": ["review", "implementation"],
"type": "builtin"
},
"claude": {
"enabled": true,
"primaryModel": "sonnet",
"tags": ["documentation"],
"type": "builtin"
}
}
}
```
## Validation
To verify your configuration, check the config file directly:
```bash
cat ~/.claude/cli-tools.json
```
Or test tool availability:
```bash
ccw cli -p "PURPOSE: Test tool availability
TASK: Verify tool is working
MODE: analysis" --mode analysis
```
## Troubleshooting
### Tool Not Available
```bash
Error: Tool 'custom-tool' not found
```
**Solution**: Check tool is enabled in config:
```json
{
"custom-tool": {
"enabled": true
}
}
```
### Model Not Found
```bash
Error: Model 'invalid-model' not available
```
**Solution**: Use valid model name from available models list.
::: info See Also
- [CLI Reference](../cli/commands.md) - CLI usage
- [Modes](#modes) - Execution modes
:::

View File

@@ -0,0 +1,93 @@
# First Workflow: Build a Simple API
Complete your first CCW workflow in 30 minutes. We'll build a simple REST API from specification to implementation.
## What We'll Build
A simple users API with:
- GET /users - List all users
- GET /users/:id - Get user by ID
- POST /users - Create new user
- PUT /users/:id - Update user
- DELETE /users/:id - Delete user
## Prerequisites
- CCW installed ([Installation Guide](./installation.md))
- Node.js >= 18.0.0
- Code editor (VS Code recommended)
## Step 1: Create Project (5 minutes)
```bash
# Create project directory
mkdir user-api
cd user-api
# Initialize npm project
npm init -y
# Install dependencies
npm install express
npm install --save-dev typescript @types/node @types/express
```
## Step 2: Generate Specification (5 minutes)
```bash
# Use CCW to generate API specification
ccw cli -p "Generate a REST API specification for a users resource with CRUD operations" --mode analysis
```
CCW will analyze your request and generate a specification document.
## Step 3: Implement API (15 minutes)
```bash
# Implement the API
ccw cli -p "Implement the users API following the specification with Express and TypeScript" --mode write
```
CCW will:
1. Create the project structure
2. Implement the routes
3. Add type definitions
4. Include error handling
## Step 4: Review Code (5 minutes)
```bash
# Review the implementation
ccw cli -p "Review the users API code for quality, security, and best practices" --mode analysis
```
## Step 5: Test and Run
```bash
# Compile TypeScript
npx tsc
# Run the server
node dist/index.js
# Test the API
curl http://localhost:3000/users
```
## Expected Result
You should have:
- `src/index.ts` - Main server file
- `src/routes/users.ts` - User routes
- `src/types/user.ts` - User types
- `src/middleware/error.ts` - Error handling
## Next Steps
- [CLI Reference](../cli/commands.md) - Learn all CLI commands
- [Skills Library](../skills/core-skills.md) - Explore built-in skills
- [Workflow System](../workflows/4-level.md) - Understand workflow orchestration
::: tip Congratulations! 🎉
You've completed your first CCW workflow. You can now use CCW for more complex projects.
:::

View File

@@ -0,0 +1,55 @@
# Getting Started with CCW
Welcome to CCW (Claude Code Workspace) - an advanced AI-powered development environment that helps you write better code faster.
## What is CCW?
CCW is a comprehensive development environment that combines:
- **Main Orchestrator (`/ccw`)**: Intent-aware workflow selection and automatic command routing
- **AI-Powered CLI Tools**: Analyze, review, and implement code with multiple AI backends
- **Specialized Agents**: Code execution, TDD development, testing, debugging, and documentation
- **Workflow Orchestration**: 4-level workflow system from spec to implementation
- **Extensible Skills**: 50+ built-in skills with custom skill support
- **MCP Integration**: Model Context Protocol for enhanced tool integration
## Quick Start
### Installation
```bash
# Install CCW globally
npm install -g @ccw/cli
# Or use with npx
npx ccw --help
```
### Your First Workflow
Create a simple workflow in under 5 minutes:
```bash
# Main orchestrator - automatically selects workflow based on intent
/ccw "Create a new project" # Auto-selects appropriate workflow
/ccw "Analyze the codebase structure" # Auto-selects analysis workflow
/ccw "Add user authentication" # Auto-selects implementation workflow
# Auto-mode - skip confirmation
/ccw -y "Fix the login timeout issue" # Execute without confirmation prompts
# Or use specific workflow commands
/workflow:init # Initialize project state
/workflow:plan "Add OAuth2 authentication" # Create implementation plan
/workflow:execute # Execute planned tasks
```
## Next Steps
- [Installation Guide](./installation.md) - Detailed installation instructions
- [First Workflow](./first-workflow.md) - 30-minute quickstart tutorial
- [Configuration](./configuration.md) - Customize your CCW setup
::: tip Need Help?
Check out our [GitHub Discussions](https://github.com/your-repo/ccw/discussions) or join our [Discord community](https://discord.gg/ccw).
:::

146
docs/guide/installation.md Normal file
View File

@@ -0,0 +1,146 @@
# Installation
Learn how to install and configure CCW on your system.
## Prerequisites
Before installing CCW, make sure you have:
- **Node.js** >= 18.0.0
- **npm** >= 9.0.0 or **yarn** >= 1.22.0
- **Git** for version control features
## Install CCW
### Global Installation (Recommended)
```bash
npm install -g @ccw/cli
```
### Project-Specific Installation
```bash
# In your project directory
npm install --save-dev @ccw/cli
# Run with npx
npx ccw [command]
```
### Using Yarn
```bash
# Global
yarn global add @ccw/cli
# Project-specific
yarn add -D @ccw/cli
```
## Verify Installation
```bash
ccw --version
# Output: CCW v1.0.0
ccw --help
# Shows all available commands
```
## Configuration
### CLI Tools Configuration
Create or edit `~/.claude/cli-tools.json`:
```json
{
"version": "3.3.0",
"tools": {
"gemini": {
"enabled": true,
"primaryModel": "gemini-2.5-flash",
"secondaryModel": "gemini-2.5-flash",
"tags": ["analysis", "debug"],
"type": "builtin"
},
"codex": {
"enabled": true,
"primaryModel": "gpt-5.2",
"secondaryModel": "gpt-5.2",
"tags": [],
"type": "builtin"
}
}
}
```
### CLAUDE.md Instructions
Create `CLAUDE.md` in your project root:
```markdown
# Project Instructions
## Coding Standards
- Use TypeScript for type safety
- Follow ESLint configuration
- Write tests for all new features
## Architecture
- Frontend: Vue 3 + Vite
- Backend: Node.js + Express
- Database: PostgreSQL
```
## Updating CCW
```bash
# Update to the latest version
npm update -g @ccw/cli
# Or install a specific version
npm install -g @ccw/cli@latest
```
## Uninstallation
```bash
npm uninstall -g @ccw/cli
# Remove configuration (optional)
rm -rf ~/.claude
```
## Troubleshooting
### Permission Issues
If you encounter permission errors:
```bash
# Use sudo (not recommended)
sudo npm install -g @ccw/cli
# Or fix npm permissions (recommended)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
```
### PATH Issues
Add npm global bin to your PATH:
```bash
# For bash/zsh
echo 'export PATH=$(npm config get prefix)/bin:$PATH' >> ~/.bashrc
# For fish
echo 'set -gx PATH (npm config get prefix)/bin $PATH' >> ~/.config/fish/config.fish
```
::: info Next Steps
After installation, check out the [First Workflow](./first-workflow.md) guide.
:::

209
docs/guide/workflows.md Normal file
View File

@@ -0,0 +1,209 @@
# CCW Workflows
Understanding and using CCW's workflow system for efficient development.
## What are Workflows?
CCW workflows are orchestrated sequences of tasks that guide a project from initial concept to completed implementation. They ensure consistency, quality, and proper documentation throughout the development lifecycle.
## Workflow Levels
CCW uses a 4-level workflow system:
```
Level 1: SPECIFICATION
Level 2: PLANNING
Level 3: IMPLEMENTATION
Level 4: VALIDATION
```
## Using Workflows
### Starting a Workflow
Begin a new workflow with the team-lifecycle-v4 skill:
```javascript
Skill(skill="team-lifecycle-v4", args="Build user authentication system")
```
This creates a complete workflow:
1. Specification phase (RESEARCH-001 through QUALITY-001)
2. Planning phase (PLAN-001)
3. Implementation phase (IMPL-001)
4. Validation phase (TEST-001 and REVIEW-001)
### Workflow Execution
The workflow executes automatically:
1. **Specification**: Analyst and writer agents research and document requirements
2. **Checkpoint**: User reviews and approves specification
3. **Planning**: Planner creates implementation plan with task breakdown
4. **Implementation**: Executor writes code
5. **Validation**: Tester and reviewer validate quality
### Resume Workflow
After a checkpoint, resume the workflow:
```bash
ccw workflow resume
```
## Workflow Tasks
### Specification Tasks
| Task | Agent | Output |
|------|-------|--------|
| RESEARCH-001 | analyst | Discovery context |
| DRAFT-001 | writer | Product brief |
| DRAFT-002 | writer | Requirements (PRD) |
| DRAFT-003 | writer | Architecture design |
| DRAFT-004 | writer | Epics & stories |
| QUALITY-001 | reviewer | Readiness report |
### Implementation Tasks
| Task | Agent | Output |
|------|-------|--------|
| PLAN-001 | planner | Implementation plan |
| IMPL-001 | executor | Source code |
| TEST-001 | tester | Test results |
| REVIEW-001 | reviewer | Code review |
## Custom Workflows
Create custom workflows for your team:
```yaml
# .ccw/workflows/feature-development.yaml
name: Feature Development
description: Standard workflow for new features
levels:
- name: specification
tasks:
- type: research
agent: analyst
- type: document
agent: writer
documents: [prd, architecture]
- name: planning
tasks:
- type: plan
agent: planner
- name: implementation
tasks:
- type: implement
agent: executor
- type: test
agent: tester
- name: validation
tasks:
- type: review
agent: reviewer
checkpoints:
- after: specification
action: await_user_approval
- after: validation
action: verify_quality_gates
```
## Workflow Configuration
Configure workflow behavior in `~/.claude/workflows/config.json`:
```json
{
"defaults": {
"autoAdvance": true,
"checkpoints": ["specification", "implementation"],
"parallel": true
},
"agents": {
"analyst": {
"timeout": 300000,
"retries": 3
}
}
}
```
## Best Practices
### 1. Clear Requirements
Start with clear, specific requirements:
```javascript
// Good: Specific
Skill(skill="team-lifecycle-v4", args="Build JWT authentication with refresh tokens")
// Bad: Vague
Skill(skill="team-lifecycle-v4", args="Add auth")
```
### 2. Checkpoint Reviews
Always review checkpoints:
- Specification checkpoint: Validate requirements
- Implementation checkpoint: Verify progress
### 3. Feedback Loops
Provide feedback during workflow:
```bash
# Add feedback during review
ccw workflow feedback --task REVIEW-001 --message "Tests need more edge cases"
```
### 4. Monitor Progress
Track workflow status:
```bash
# Check workflow status
ccw workflow status
# View task details
ccw workflow task IMPL-001
```
## Troubleshooting
### Stalled Workflow
If a workflow stalls:
```bash
# Check for blocked tasks
ccw workflow status --blocked
# Reset stuck tasks
ccw workflow reset --task IMPL-001
```
### Failed Tasks
Retry failed tasks:
```bash
# Retry with new prompt
ccw workflow retry --task IMPL-001 --prompt "Fix the TypeScript errors"
```
::: info See Also
- [4-Level System](../workflows/4-level.md) - Detailed workflow explanation
- [Best Practices](../workflows/best-practices.md) - Workflow optimization
:::