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,101 @@
# API Settings
## One-Liner
**API Settings manages AI model endpoint configuration** — Centralizes API keys, base URLs, and model selection for all supported AI backends.
---
## Configuration Locations
| Location | Scope | Priority |
|----------|-------|----------|
| `~/.claude/cli-tools.json` | Global | Base |
| `.claude/settings.json` | Project | Override |
| `.claude/settings.local.json` | Local | Highest |
---
## Supported Backends
| Backend | Type | Models |
|---------|------|--------|
| **Gemini** | Builtin | gemini-2.5-flash, gemini-2.5-pro |
| **Qwen** | Builtin | coder-model |
| **Codex** | Builtin | gpt-4o, gpt-4o-mini |
| **Claude** | Builtin | claude-sonnet, claude-haiku |
| **OpenCode** | Builtin | opencode/glm-4.7-free |
---
## Configuration Example
```json
// ~/.claude/cli-tools.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-4o",
"tags": [],
"type": "builtin"
}
}
}
```
---
## Environment Variables
```bash
# API Keys
LITELLM_API_KEY=your-api-key
LITELLM_API_BASE=https://api.example.com/v1
LITELLM_MODEL=gpt-4o-mini
# Reranker (optional)
RERANKER_API_KEY=your-reranker-key
RERANKER_API_BASE=https://api.siliconflow.cn
RERANKER_PROVIDER=siliconflow
RERANKER_MODEL=BAAI/bge-reranker-v2-m3
```
---
## Model Selection
### Via CLI Flag
```bash
ccw cli -p "Analyze code" --tool gemini --model gemini-2.5-pro
```
### Via Config
```json
{
"tools": {
"gemini": {
"primaryModel": "gemini-2.5-flash",
"secondaryModel": "gemini-2.5-pro"
}
}
}
```
---
## Related Links
- [CLI Call](/features/cli) - Command invocation
- [System Settings](/features/system-settings) - System configuration
- [CodexLens](/features/codexlens) - Code indexing

104
docs/features/cli.md Normal file
View File

@@ -0,0 +1,104 @@
# CLI Call System
## One-Liner
**The CLI Call System is a unified AI model invocation framework** — Provides a consistent interface for calling multiple AI models (Gemini, Qwen, Codex, Claude) with standardized prompts, modes, and templates.
---
## Pain Points Solved
| Pain Point | Current State | CLI Call Solution |
|------------|---------------|-------------------|
| **Single model limitation** | Can only use one AI model | Multi-model collaboration |
| **Inconsistent prompts** | Different prompt formats per model | Unified prompt template |
| **No mode control** | AI can modify files unexpectedly | analysis/write/review modes |
| **No templates** | Reinvent prompts each time | 30+ pre-built templates |
---
## vs Traditional Methods
| Dimension | Direct API | Individual CLIs | **CCW CLI** |
|-----------|------------|-----------------|-------------|
| Multi-model | Manual switch | Multiple tools | **Unified interface** |
| Prompt format | Per-model | Per-tool | **Standardized template** |
| Permission | Unclear | Unclear | **Explicit modes** |
| Templates | None | None | **30+ templates** |
---
## Core Concepts
| Concept | Description | Usage |
|---------|-------------|-------|
| **Tool** | AI model backend | `--tool gemini/qwen/codex/claude` |
| **Mode** | Permission level | `analysis/write/review` |
| **Template** | Pre-built prompt | `--rule analysis-review-code` |
| **Session** | Conversation continuity | `--resume <id>` |
---
## Usage
### Basic Command
```bash
ccw cli -p "Analyze authentication flow" --tool gemini --mode analysis
```
### With Template
```bash
ccw cli -p "PURPOSE: Security audit
TASK: • Check SQL injection • Verify CSRF tokens
MODE: analysis
CONTEXT: @src/auth/**/*
EXPECTED: Report with severity levels
CONSTRAINTS: Focus on authentication" --tool gemini --mode analysis --rule analysis-assess-security-risks
```
### Session Resume
```bash
ccw cli -p "Continue analysis" --resume
```
---
## Configuration
```json
// ~/.claude/cli-tools.json
{
"tools": {
"gemini": {
"enabled": true,
"primaryModel": "gemini-2.5-flash",
"tags": ["analysis", "debug"]
},
"qwen": {
"enabled": true,
"primaryModel": "coder-model"
}
}
}
```
---
## Available Templates
| Category | Templates |
|----------|-----------|
| Analysis | `analysis-review-code`, `analysis-diagnose-bug`, `analysis-assess-security` |
| Planning | `planning-plan-architecture`, `planning-breakdown-task` |
| Development | `development-implement-feature`, `development-refactor-codebase` |
---
## Related Links
- [Spec System](/features/spec) - Constraint injection
- [Memory System](/features/memory) - Persistent context
- [CodexLens](/features/codexlens) - Code indexing

115
docs/features/codexlens.md Normal file
View File

@@ -0,0 +1,115 @@
# CodexLens Code Indexing
## One-Liner
**CodexLens is a semantic code search engine** — Based on vector databases and LSP integration, it enables AI to understand code semantics rather than just keyword matching.
---
## Pain Points Solved
| Pain Point | Current State | CodexLens Solution |
|------------|---------------|-------------------|
| **Imprecise search** | Keywords can't find semantically related code | Semantic vector search |
| **No context** | Search results lack call chain context | LSP integration provides reference chains |
| **No understanding** | AI doesn't understand code relationships | Static analysis + semantic indexing |
| **Slow navigation** | Manual file traversal | Instant semantic navigation |
---
## vs Traditional Methods
| Dimension | Text Search | IDE Search | **CodexLens** |
|-----------|-------------|------------|---------------|
| Search type | Keyword | Keyword + symbol | **Semantic vector** |
| Context | None | File-level | **Call chain + imports** |
| AI-ready | No | No | **Direct AI consumption** |
| Multi-file | Poor | Good | **Excellent** |
---
## Core Concepts
| Concept | Description | Location |
|---------|-------------|----------|
| **Index** | Vector representation of code | `.codex-lens/index/` |
| **Chunk** | Code segment for embedding | Configurable size |
| **Retrieval** | Hybrid search (vector + keyword) | HybridSearch engine |
| **LSP** | Language Server Protocol integration | Built-in LSP client |
---
## Usage
### Indexing Project
```bash
ccw index
ccw index --watch # Continuous indexing
```
### Searching
```bash
ccw search "authentication logic"
ccw search "where is user validation" --top 10
```
### Via MCP Tool
```typescript
// ACE semantic search
mcp__ace-tool__search_context({
project_root_path: "/path/to/project",
query: "authentication logic"
})
```
---
## Configuration
```json
// ~/.codexlens/settings.json
{
"embedding": {
"backend": "litellm",
"model": "Qwen/Qwen3-Embedding-8B",
"use_gpu": false
},
"indexing": {
"static_graph_enabled": true,
"chunk_size": 512
}
}
```
---
## Architecture
```
┌─────────────────────────────────────────┐
│ CodexLens │
├─────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌────────┐ │
│ │ Parsers │ │ Chunker │ │ LSP │ │
│ │(TS/Py/..)│ │ │ │ Client │ │
│ └────┬─────┘ └────┬─────┘ └───┬────┘ │
│ │ │ │ │
│ └─────────────┼────────────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ Hybrid │ │
│ │ Search │ │
│ └─────────────┘ │
└─────────────────────────────────────────┘
```
---
## Related Links
- [CLI Call](/features/cli) - AI model invocation
- [Memory System](/features/memory) - Persistent context
- [MCP Tools](/mcp/tools) - MCP integration

View File

@@ -0,0 +1,79 @@
# Dashboard Panel
## One-Liner
**The Dashboard is a VS Code webview-based management interface** — Provides visual access to project configuration, specs, memory, and settings through an intuitive GUI.
---
## Pain Points Solved
| Pain Point | Current State | Dashboard Solution |
|------------|---------------|-------------------|
| **Config complexity** | JSON files hard to edit | Visual form-based editing |
| **No overview** | Can't see project state at a glance | Unified dashboard view |
| **Scattered settings** | Settings in multiple files | Centralized management |
| **No visual feedback** | CLI only, no UI | Interactive webview |
---
## Core Features
| Feature | Description |
|---------|-------------|
| **Project Overview** | Tech stack, dependencies, status |
| **Spec Manager** | View and edit specification files |
| **Memory Viewer** | Browse persistent memories |
| **API Settings** | Configure AI model endpoints |
| **System Settings** | Global and project settings |
---
## Access
Open via VS Code command palette:
```
CCW: Open Dashboard
```
Or via CLI:
```bash
ccw view
```
---
## Dashboard Sections
### 1. Project Overview
- Technology stack detection
- Dependency status
- Workflow session status
### 2. Spec Manager
- List all specs
- Edit spec content
- Enable/disable specs
### 3. Memory Viewer
- Browse memory entries
- Search memories
- Export/import
### 4. API Settings
- Configure API keys
- Set model endpoints
- Manage rate limits
### 5. System Settings
- Global configuration
- Project overrides
- Hook management
---
## Related Links
- [API Settings](/features/api-settings) - API configuration
- [System Settings](/features/system-settings) - System configuration
- [Spec System](/features/spec) - Specification management

80
docs/features/memory.md Normal file
View File

@@ -0,0 +1,80 @@
# Memory System
## One-Liner
**The Memory System is a cross-session knowledge persistence mechanism** — Stores project context, decisions, and learnings so AI remembers across sessions without re-explanation.
---
## Pain Points Solved
| Pain Point | Current State | Memory System Solution |
|------------|---------------|------------------------|
| **Cross-session amnesia** | New session requires re-explaining project | Persistent memory across sessions |
| **Lost decisions** | Architecture decisions forgotten | Decision log persists |
| **Repeated explanations** | Same context explained multiple times | Memory auto-injection |
| **Knowledge silos** | Each developer maintains own context | Shared team memory |
---
## vs Traditional Methods
| Dimension | CLAUDE.md | Notes | **Memory System** |
|-----------|-----------|-------|-------------------|
| Persistence | Static file | Manual | **Auto-extracted from sessions** |
| Search | Text search | Folder search | **Semantic vector search** |
| Updates | Manual edit | Manual note | **Auto-capture from conversations** |
| Sharing | Git | Manual | **Auto-sync via workflow** |
---
## Core Concepts
| Concept | Description | Location |
|---------|-------------|----------|
| **Core Memory** | Persistent project knowledge | `~/.claude/memory/` |
| **Session Memory** | Current session context | `.workflow/.memory/` |
| **Memory Entry** | Individual knowledge item | JSONL format |
| **Memory Index** | Searchable index | Embedding-based |
---
## Usage
### Viewing Memory
```bash
ccw memory list
ccw memory search "authentication"
```
### Memory Categories
- **Project Context**: Architecture, tech stack, patterns
- **Decisions**: ADRs, design choices
- **Learnings**: What worked, what didn't
- **Conventions**: Coding standards, naming
---
## Configuration
```json
// ~/.claude/cli-settings.json
{
"memory": {
"enabled": true,
"maxEntries": 1000,
"autoCapture": true,
"embeddingModel": "text-embedding-3-small"
}
}
```
---
## Related Links
- [Spec System](/features/spec) - Constraint injection
- [CLI Call](/features/cli) - Command line invocation
- [CodexLens](/features/codexlens) - Code indexing

96
docs/features/spec.md Normal file
View File

@@ -0,0 +1,96 @@
# Spec System
## One-Liner
**The Spec System is an automatic constraint injection mechanism** — Through specification documents defined in YAML frontmatter, relevant constraints are automatically loaded at the start of AI sessions, ensuring AI follows project coding standards and architectural requirements.
---
## Pain Points Solved
| Pain Point | Current State | Spec System Solution |
|------------|---------------|---------------------|
| **AI ignores standards** | CLAUDE.md written but AI ignores it after 5 turns | Hook auto-injection, every session carries specs |
| **Standards scattered** | Coding conventions in different places, hard to maintain | Unified in `.workflow/specs/*.md` |
| **Context loss** | New session requires re-explaining constraints | Spec auto-loads based on task context |
| **Inconsistent code** | Different developers write different styles | Shared Spec ensures consistency |
---
## vs Traditional Methods
| Dimension | CLAUDE.md | `.cursorrules` | **Spec System** |
|-----------|-----------|----------------|-----------------|
| Injection | Auto-load but easily truncated | Manual load | **Hook auto-injection, task-precise loading** |
| Granularity | One large file | One large file | **Per-module files, combined by task** |
| Cross-session memory | None | None | **Workflow journal persistence** |
| Team sharing | Single person | Single person | **Git versioned Spec library** |
---
## Core Concepts
| Concept | Description | Location |
|---------|-------------|----------|
| **Spec File** | Markdown document with YAML frontmatter | `.workflow/specs/*.md` |
| **Hook** | Script that auto-injects specs into AI context | `.claude/hooks/` |
| **Spec Index** | Registry of all available specs | `.workflow/specs/index.yaml` |
| **Spec Selector** | Logic that chooses relevant specs for a task | Built into CCW |
---
## Usage
### Creating a Spec
```markdown
---
name: coding-standards
description: Project coding standards
triggers:
- pattern: "**/*.ts"
- command: "/implement"
- skill: "code-developer"
applyTo:
- "src/**"
priority: high
---
# Coding Standards
## TypeScript Guidelines
- Use strict mode
- Prefer interfaces over types
- ...
```
### Spec Loading
Specs are automatically loaded based on:
1. File patterns being edited
2. Commands being executed
3. Skills being invoked
---
## Configuration
```yaml
# .workflow/specs/index.yaml
specs:
- name: coding-standards
path: ./coding-standards.md
enabled: true
- name: api-conventions
path: ./api-conventions.md
enabled: true
```
---
## Related Links
- [Memory System](/features/memory) - Persistent context
- [CLI Call](/features/cli) - Command line invocation
- [Dashboard](/features/dashboard) - Visual management

View File

@@ -0,0 +1,131 @@
# System Settings
## One-Liner
**System Settings manages global and project-level configuration** — Controls hooks, agents, skills, and core system behavior.
---
## Configuration Files
| File | Scope | Purpose |
|------|-------|---------|
| `~/.claude/CLAUDE.md` | Global | Global instructions |
| `.claude/CLAUDE.md` | Project | Project instructions |
| `~/.claude/cli-tools.json` | Global | CLI tool config |
| `.claude/settings.json` | Project | Project settings |
| `.claude/settings.local.json` | Local | Local overrides |
---
## Settings Schema
```json
{
"permissions": {
"allow": ["Bash(npm install)", "Bash(git status)"],
"deny": ["Bash(rm -rf)"]
},
"env": {
"ANTHROPIC_API_KEY": "your-key"
},
"enableAll": false,
"autoCheck": true
}
```
---
## Key Settings
### Permissions
```json
{
"permissions": {
"allow": [
"Bash(npm run*)",
"Read(**)",
"Edit(**/*.ts)"
],
"deny": [
"Bash(rm -rf /*)"
]
}
}
```
### Hooks
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [".claude/hooks/pre-bash.sh"]
}
]
}
}
```
### MCP Servers
```json
{
"mcpServers": {
"ccw-tools": {
"command": "node",
"args": ["./mcp-server/dist/index.js"]
}
}
}
```
---
## Hook Configuration
Hooks are scripts that run at specific events:
| Event | When | Use Case |
|-------|------|----------|
| `PreToolUse` | Before tool execution | Validation, logging |
| `PostToolUse` | After tool execution | Cleanup, notifications |
| `Notification` | On notifications | Custom handlers |
| `Stop` | On session end | Cleanup |
### Hook Example
```bash
#!/bin/bash
# .claude/hooks/pre-bash.sh
echo "Executing: $1" >> ~/.claude/bash.log
```
---
## Agent Configuration
```json
// .claude/agents/my-agent.md
---
description: Custom analysis agent
model: claude-sonnet
tools:
- Read
- Grep
---
# Agent Instructions
...
```
---
## Related Links
- [API Settings](/features/api-settings) - API configuration
- [CLI Call](/features/cli) - Command invocation
- [Dashboard](/features/dashboard) - Visual management