feat: Optimize ccw-help skill with user-prompted update mechanism

- Add auto-update.py script for simple index regeneration
- Update SKILL.md with clear update instructions
- Simplify update mechanism: prompt user on skill execution
- Support both automatic and manual update workflows
- Clean version 2.3.0 metadata in command.json
This commit is contained in:
catlog22
2026-01-29 15:58:51 +08:00
parent 86d5be8288
commit f5e435f791
3 changed files with 59 additions and 5 deletions

View File

@@ -132,14 +132,33 @@ Single source of truth: **[command.json](command.json)**
## Maintenance
### Update Index
### Update Mechanism
CCW-Help skill supports manual updates through user confirmation dialog.
#### How to Update
**Option 1: When executing the skill, user will be prompted:**
```
Would you like to update CCW-Help command index?
- Yes: Run auto-update and regenerate command.json
- No: Use current index
```
**Option 2: Manual update**
```bash
cd D:/Claude_dms3/.claude/skills/ccw-help
python scripts/analyze_commands.py
python scripts/auto-update.py
```
脚本功能:扫描 commands/ agents/ 目录,生成统一的 command.json
This runs `analyze_commands.py` to scan commands/ and agents/ directories and regenerate `command.json`.
#### Update Scripts
- **`auto-update.py`**: Simple wrapper that runs analyze_commands.py
- **`analyze_commands.py`**: Scans directories and generates command index
## Statistics

View File

@@ -1,9 +1,10 @@
{
"_metadata": {
"version": "2.1.0",
"version": "2.3.0",
"total_commands": 51,
"total_agents": 16,
"description": "Unified CCW-Help command index"
"description": "Unified CCW-Help command index",
"update": "User prompted to update on skill execution. Run 'python scripts/auto-update.py' for manual update."
},
"essential_commands": [

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env python3
"""
Simple update script for ccw-help skill.
Runs analyze_commands.py to regenerate command index.
"""
import sys
import subprocess
from pathlib import Path
BASE_DIR = Path("D:/Claude_dms3/.claude")
SKILL_DIR = BASE_DIR / "skills" / "ccw-help"
ANALYZE_SCRIPT = SKILL_DIR / "scripts" / "analyze_commands.py"
def run_update():
"""Run command analysis update."""
try:
result = subprocess.run(
[sys.executable, str(ANALYZE_SCRIPT)],
capture_output=True,
text=True,
timeout=30
)
print(result.stdout)
return result.returncode == 0
except Exception as e:
print(f"Error running update: {e}")
return False
if __name__ == '__main__':
success = run_update()
sys.exit(0 if success else 1)