MCPcopy
hub / github.com/codeaashu/claude-code / skillHasOnlySafeProperties

Function skillHasOnlySafeProperties

src/tools/SkillTool/SkillTool.ts:910–933  ·  view source on GitHub ↗
(command: Command)

Source from the content-addressed store, hash-verified

908])
909
910function skillHasOnlySafeProperties(command: Command): boolean {
911 for (const key of Object.keys(command)) {
912 if (SAFE_SKILL_PROPERTIES.has(key)) {
913 continue
914 }
915 // Property not in safe allowlist - check if it has a meaningful value
916 const value = (command as Record<string, unknown>)[key]
917 if (value === undefined || value === null) {
918 continue
919 }
920 if (Array.isArray(value) && value.length === 0) {
921 continue
922 }
923 if (
924 typeof value === 'object' &&
925 !Array.isArray(value) &&
926 Object.keys(value).length === 0
927 ) {
928 continue
929 }
930 return false
931 }
932 return true
933}
934
935function isOfficialMarketplaceSkill(command: PromptCommand): boolean {
936 if (command.source !== 'plugin' || !command.pluginInfo?.repository) {

Callers 1

checkPermissionsFunction · 0.85

Calls 2

keysMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected