- Add /sc:git command with smart commit functionality - Add /sc:ultra-think command for deep thinking - Update .claude/rules/ with improved documentation: - commands.md: command usage guidelines - doc-management.md: documentation policy - no-extra-docs.md: documentation creation policy - gpu-testing.md: GPU type detection and testing rules - Update .claude/settings.json with claude-flow MCP configuration 这些改进提供了更好的开发体验和工具支持。
2.6 KiB
2.6 KiB
Documentation Management
CLAUDE.md Content Policy
CLAUDE.md should only contain operational requirements:
- Environment setup (PYTHONPATH, GPU mutex)
- Execution requirements (how to run tests/benchmarks)
- Quick configuration reference
- Documentation index (links to detailed docs)
Technical details should go to docs/:
- Architecture and design explanations
- Implementation details and code flows
- Debugging techniques
- Memory analysis and profiling
- Algorithm explanations
When Adding New Technical Content
Follow this workflow:
Step 1: Analyze and Document
If doing technical analysis (e.g., memory profiling):
- Calculate theoretical values using formulas
- Run actual tests to measure real values
- Compare theoretical vs actual (expect < 10% error for valid models)
- Document findings with both theory and empirical validation
Step 2: Create/Update docs/
Create a new doc or update existing one in docs/:
docs/
├── architecture_guide.md # Core components, design, flows
├── sparse_attention_guide.md # Sparse attention methods
├── layerwise_offload_memory_analysis.md # Memory analysis
├── debugging_guide.md # Debugging techniques
└── <new_topic>_guide.md # New technical topic
Step 3: Update CLAUDE.md Documentation Index
Add entry to the Documentation Index table:
| Document | Purpose |
|----------|---------|
| [`docs/new_doc.md`](docs/new_doc.md) | Brief description |
Step 4: Refactor if Needed
If CLAUDE.md grows too large (> 150 lines), refactor:
- Identify technical details that can be moved
- Create appropriate doc in docs/
- Replace detailed content with reference link
- Keep only operational essentials in CLAUDE.md
Documentation Structure Template
For new technical docs:
# Topic Guide
Brief overview of what this document covers.
## Section 1: Concepts
- Key concepts and terminology
## Section 2: Implementation
- Code locations
- Key methods/functions
## Section 3: Details
- Detailed explanations
- Code examples
## Section 4: Validation (if applicable)
- Theoretical analysis
- Empirical measurements
- Comparison table
Memory Analysis Template
When documenting memory behavior:
## Theoretical Calculation
| Component | Formula | Size |
|-----------|---------|------|
| Buffer X | `param1 × param2 × dtype_size` | X MB |
## Empirical Validation
| Metric | Theoretical | Actual | Error |
|--------|-------------|--------|-------|
| Peak memory | X GB | Y GB | Z% |
## Key Findings
1. Finding 1
2. Finding 2