feat: initialize monorepo with package.json for CCW workflow platform

This commit is contained in:
catlog22
2026-02-03 14:42:20 +08:00
parent 5483a72e9f
commit 39b80b3386
267 changed files with 99597 additions and 2658 deletions

View File

@@ -0,0 +1,146 @@
---
title: /cli:cli-init
sidebar_label: /cli:cli-init
sidebar_position: 1
description: Initialize CLI configuration for workspace with automatic technology detection
---
# /cli:cli-init
Initialize CLI tool configurations for the workspace by analyzing project structure and generating optimized configuration files.
## Overview
The `/cli:cli-init` command analyzes your workspace to detect technology stacks and automatically generates CLI tool configurations for Gemini and Qwen with optimized ignore patterns.
**Supported Tools**: gemini, qwen, all (default)
## Features
- **Automatic Technology Detection** - Analyzes project structure to identify tech stacks
- **Smart Ignore Rules** - Generates filtering patterns optimized for detected technologies
- **Configuration Generation** - Creates tool-specific settings files
- **Multi-Tool Support** - Configure Gemini, Qwen, or both simultaneously
## Usage
```bash
# Initialize all CLI tools (Gemini + Qwen)
/cli:cli-init
# Initialize only Gemini
/cli:cli-init --tool gemini
# Initialize only Qwen
/cli:cli-init --tool qwen
# Preview what would be generated
/cli:cli-init --preview
# Generate in subdirectory
/cli:cli-init --output=.config/
```
## Generated Files
### Configuration Directories
**For Gemini** (`.gemini/`):
- `.gemini/settings.json` - Context file configuration
**For Qwen** (`.qwen/`):
- `.qwen/settings.json` - Context file configuration
### Ignore Files
- `.geminiignore` - File filtering patterns for Gemini CLI
- `.qwenignore` - File filtering patterns for Qwen CLI
Both ignore files use gitignore syntax and include technology-specific rules.
## Supported Technology Stacks
### Frontend Technologies
- **React/Next.js** - Ignores build artifacts, .next/, node_modules
- **Vue/Nuxt** - Ignores .nuxt/, dist/, .cache/
- **Angular** - Ignores dist/, .angular/, node_modules
- **Webpack/Vite** - Ignores build outputs, cache directories
### Backend Technologies
- **Node.js** - Ignores node_modules/, npm-debug.log*, package-lock.json
- **Python** - Ignores __pycache__/, *.py[cod], .venv/, venv/
- **Java** - Ignores target/, .gradle/, *.class, *.jar
- **Go** - Ignores vendor/, *.exe, *.test
- **Rust** - Ignores target/, Cargo.lock
### Configuration Files
Both `.gemini/settings.json` and `.qwen/settings.json` are configured with:
```json
{
"contextfilename": ["CLAUDE.md"]
}
```
## Command Options
| Option | Description | Default |
|--------|-------------|---------|
| `--tool <name>` | Tool to configure (gemini, qwen, all) | all |
| `--output <path>` | Custom output directory | Current directory |
| `--preview` | Show what would be generated without creating files | false |
## Execution Flow
1. **Workspace Analysis** - Runs `get_modules_by_depth` to analyze project structure
2. **Technology Detection** - Identifies tech stacks based on files and directories
3. **Configuration Generation** - Creates tool-specific configuration directories
4. **Ignore Rules Generation** - Creates organized ignore files with detected patterns
5. **File Creation** - Writes all configuration files to disk
## Examples
### Basic Project Setup
```bash
# Initialize all CLI tools
/cli:cli-init
# Output:
# Creating .gemini/ directory
# Creating .qwen/ directory
# Generating .geminiignore with 45 rules
# Generating .qwenignore with 45 rules
# Technology detected: Node.js, TypeScript, React
```
### Technology Migration
```bash
# After adding Docker to project
/cli:cli-init
# Regenerates all config and ignore files with new Docker rules
```
### Tool-Specific Setup
```bash
# Gemini-only workflow
/cli:cli-init --tool gemini
# Creates only .gemini/ and .geminiignore
```
## Related Commands
- **/cli:codex-review** - Code review using Codex CLI
- **/memory:update-full** - Full project memory update
- **/workflow:lite-execute** - Quick execution workflow
## Notes
- Backs up existing configuration files before overwriting
- Auto-detects technology stacks from common indicators
- Generated ignore patterns optimize CLI tool performance
- Safe to run multiple times - preserves existing configurations

View File

@@ -0,0 +1,208 @@
---
title: /cli:codex-review
sidebar_label: /cli:codex-review
sidebar_position: 2
description: Interactive code review using Codex CLI with configurable review targets
---
# /cli:codex-review
Interactive code review command that invokes `codex review` via CCW CLI endpoint with guided parameter selection.
## Overview
The `/cli:codex-review` command provides an interface to Codex's powerful code review capabilities, supporting multiple review targets and customizable review parameters.
## Review Parameters
| Parameter | Description |
|-----------|-------------|
| `[PROMPT]` | Custom review instructions (positional) |
| `-c model=<model>` | Override model via config |
| `--uncommitted` | Review staged, unstaged, and untracked changes |
| `--base <BRANCH>` | Review changes against base branch |
| `--commit <SHA>` | Review changes introduced by a commit |
| `--title <TITLE>` | Optional commit title for review summary |
## Usage
### Direct Execution (No Interaction)
```bash
# Review uncommitted changes
/cli:codex-review --uncommitted
# Review against main branch
/cli:codex-review --base main
# Review specific commit
/cli:codex-review --commit abc123
# Review with custom model
/cli:codex-review --uncommitted --model o3
# Review with security focus
/cli:codex-review --uncommitted security
# Full options
/cli:codex-review --base main --model o3 --title "Auth Feature" security
```
### Interactive Mode
```bash
# Start interactive selection (guided flow)
/cli:codex-review
```
## Review Targets
| Target | Description | Use Case |
|--------|-------------|----------|
| **Uncommitted** | Reviews staged, unstaged, and untracked changes | Quick pre-commit review |
| **Base Branch** | Reviews changes against specified branch | PR review, branch comparison |
| **Commit** | Reviews changes introduced by specific commit | Historical commit review |
## Focus Areas
| Focus | Description | Key Checks |
|-------|-------------|------------|
| **General** | Comprehensive review | Correctness, style, bugs, documentation |
| **Security** | Security-first review | Injection vulnerabilities, auth issues, validation, data exposure |
| **Performance** | Optimization review | Complexity analysis, memory usage, query optimization, caching |
| **Code Quality** | Maintainability review | SOLID principles, code duplication, naming conventions, test coverage |
## Execution Flow
### Interactive Mode
1. **Select Review Target** - Choose uncommitted, base branch, or commit
2. **Select Focus Area** - Choose general, security, performance, or code quality
3. **Configure Options** - Set model, title, and custom instructions
4. **Execute Review** - Runs Codex review with selected parameters
5. **Display Results** - Shows structured review findings
### Command Construction
```bash
# Base structure
ccw cli -p "<PROMPT>" --tool codex --mode review [OPTIONS]
# Example with custom prompt
ccw cli -p "
PURPOSE: Comprehensive code review to identify issues and improve quality
TASK: • Review correctness and logic • Check standards compliance • Identify bugs
MODE: review
CONTEXT: Reviewing uncommitted changes
CONSTRAINTS: Actionable feedback
" --tool codex --mode review --rule analysis-review-code-quality
# Example with target flag only
ccw cli --tool codex --mode review --uncommitted
```
## Prompt Template
Follow the standard CCW CLI prompt template:
```bash
PURPOSE: [what] + [why] + [success criteria]
TASK: • [step 1] • [step 2] • [step 3]
MODE: review
CONTEXT: [target description] | Memory: [project context]
EXPECTED: [deliverable format] + [quality criteria]
CONSTRAINTS: [domain constraints]
```
## Validation Constraints
**IMPORTANT**: Target flags (`--uncommitted`, `--base`, `--commit`) and custom prompt are **mutually exclusive**.
### Valid Combinations
| Command | Result |
|---------|--------|
| `codex review "Focus on security"` | ✓ Custom prompt, reviews uncommitted (default) |
| `codex review --uncommitted` | ✓ No prompt, uses default review |
| `codex review --base main` | ✓ No prompt, uses default review |
| `codex review --commit abc123` | ✓ No prompt, uses default review |
### Invalid Combinations
| Command | Result |
|---------|--------|
| `codex review --uncommitted "prompt"` | ✗ Mutually exclusive |
| `codex review --base main "prompt"` | ✗ Mutually exclusive |
| `codex review --commit abc123 "prompt"` | ✗ Mutually exclusive |
## Error Handling
### No Changes to Review
```
No changes found for review target. Suggestions:
- For --uncommitted: Make some code changes first
- For --base: Ensure branch exists and has diverged
- For --commit: Verify commit SHA exists
```
### Invalid Branch
```bash
# Show available branches
git branch -a --list | head -20
```
### Invalid Commit
```bash
# Show recent commits
git log --oneline -10
```
## Examples
### Pre-Commit Review
```bash
# Quick review before committing
/cli:codex-review --uncommitted
# Output:
# Reviewing 3 files with 45 changes
# - src/auth/login.ts: 2 issues found
# - src/user/profile.ts: 1 issue found
# - tests/auth.test.ts: No issues
```
### Branch Comparison
```bash
# Review feature branch against main
/cli:codex-review --base feature-auth
# Shows all differences between branches
```
### Security-Focused Review
```bash
# Security review of uncommitted changes
/cli:codex-review --uncommitted "Focus on security vulnerabilities, injection risks, authentication issues"
# Prioritizes security-related findings
```
## Related Commands
- **/cli:cli-init** - Initialize CLI configuration
- **/workflow:review-session-cycle** - Session-based code review
- **/workflow:review-module-cycle** - Module-specific code review
## Integration Notes
- Uses `ccw cli --tool codex --mode review` endpoint
- Model passed via prompt (codex uses `-c model=` internally)
- Target flags passed through to codex
- Prompt follows standard CCW CLI template format
- Results include severity levels, file:line references, and remediation suggestions