mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
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:
@@ -132,14 +132,33 @@ Single source of truth: **[command.json](command.json)**
|
|||||||
|
|
||||||
## Maintenance
|
## 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
|
```bash
|
||||||
cd D:/Claude_dms3/.claude/skills/ccw-help
|
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
|
## Statistics
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_metadata": {
|
"_metadata": {
|
||||||
"version": "2.1.0",
|
"version": "2.3.0",
|
||||||
"total_commands": 51,
|
"total_commands": 51,
|
||||||
"total_agents": 16,
|
"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": [
|
"essential_commands": [
|
||||||
|
|||||||
34
.claude/skills/ccw-help/scripts/auto-update.py
Normal file
34
.claude/skills/ccw-help/scripts/auto-update.py
Normal 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)
|
||||||
Reference in New Issue
Block a user