Files
kwcode/kaiwu/tests/test_skill_loader.py
Val-sss 0aeb91b766 feat: upgrade expert system to SKILL.md progressive disclosure format
- Add SKILL.md directory format (YAML frontmatter + Markdown instructions + scripts/)
- 3 pilot experts converted: bugfix/, fastapi/, testgen/ (with scripts)
- expert_loader.py: load_skill_dir() + load_directory() supports both formats
- expert_registry.py: get_instructions() (Level 2) + get_scripts() (Level 3)
- gate.py: uses instructions field for SKILL.md experts
- prompt_optimizer.py: _update_skill_md() appends rules to markdown body
- SKILL.md takes priority over same-name YAML (backward compat preserved)
- 19 new tests (311 total, all passing)

Progressive disclosure architecture:
  Level 1 (Gate): name + keywords only (~100 tokens per expert)
  Level 2 (Generator): full instructions loaded only for matched expert
  Level 3 (on-demand): scripts executed deterministically, never enter LLM context

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-29 19:15:19 +08:00

13 KiB