feat: inject user-invocable: false in ClaudeAdapter#4
feat: inject user-invocable: false in ClaudeAdapter#4hugo-bluecorn wants to merge 4 commits intoserverpod:mainfrom
Conversation
…llSkill Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add four edge case tests for ClaudeAdapter.installSkill(): - Preserves explicit user-invocable: true - No duplication when user-invocable: false already present - Preserves nested frontmatter fields byte-for-byte - Handles SKILL.md with no body All tests pass against existing implementation, confirming the guard logic correctly handles these edge cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Manual VerificationVerified end-to-end against a real Flutter project. The fix correctly injects Environment: skills v0.2.1 (from feature branch), Dart 3.11.1, Flutter 3.41.4 (via fvm), Linux Steps to reproduce
Before vs After
|
Summary
Fixes #3
When
ClaudeAdapter.installSkill()copies a SKILL.md into.claude/skills/, Claude Code defaultsuser-invocabletotruewhen the field is absent from frontmatter. This causes every installed skill to appear as a slash command (22+ per Flutter project, 41+ for Serverpod).This PR overrides
installSkill()inClaudeAdapterto injectuser-invocable: falseinto the SKILL.md frontmatter when the field is absent. Existing values (trueorfalse) are preserved.Approach: Targeted text insertion before the closing
---— noSkillMetadataround-tripping, so nested YAML fields (e.g.,metadata:) are preserved byte-for-byte.Changes
lib/src/ide/adapters/claude_adapter.dart— overrideinstallSkill()with frontmatter injectiontest/ide/claude_adapter_test.dart— 5 new tests, 1 updated existing testTest plan
dart test— 130/130 passingdart analyze— no issuesdart format— clean