Fixes #214 - Local enhancement now handles large skills automatically **Problem:** - Claude CLI has undocumented ~30-40K character limit - Large skills (>30K chars) fail silently during local enhancement - Users experience "Claude finished but SKILL.md was not updated" error **Solution:** - Auto-detect large skills (>30K chars) - Apply intelligent summarization to reduce content size - Preserve critical content: * First 20% (introduction/overview) * Up to 5 best code blocks * Up to 10 section headings with context - Target ~30% of original size - Show clear warnings when summarization is applied **Implementation:** - Added `summarize_reference()` method to LocalSkillEnhancer - Modified `create_enhancement_prompt()` to accept summarization parameters - Updated `run()` method to auto-enable summarization for large skills - Added comprehensive test suite (6 tests) **Test Results:** - ✅ All 612 tests passing (100% pass rate) - ✅ 6 new smart summarization tests - ✅ E2E test: 60K skill → 17K prompt (within limits) - ✅ Code block preservation verified **User Experience:** When enhancement is triggered on a large skill: ``` ⚠️ LARGE SKILL DETECTED 📊 Reference content: 60,072 characters 💡 Claude CLI limit: ~30,000-40,000 characters 🔧 Applying smart summarization to ensure success... • Keeping introductions and overviews • Extracting best code examples • Preserving key concepts and headings • Target: ~30% of original size ✓ Reduced from 60,072 to 15,685 chars (26%) ✓ Prompt created and optimized (17,804 characters) ✓ Ready for Claude CLI (within safe limits) ``` **Backward Compatibility:** - No breaking changes - Works with existing skills - Falls back gracefully for normal-sized skills
7.5 KiB
7.5 KiB