anthropics / anthropics/skills

Packaging validator should warn (not error) on platform-specific extension fields

Đang mở
#394 1 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
176k
Fork
20.9k
Merge trung bình
7 giờ 21 phút
Pull request đã merge (30 ngày)
5

Mô tả

## Context

The [Agent Skills open standard](https://agentskills.io/specification) defines 6 frontmatter fields:

```
name, description, license, compatibility, metadata, allowed-tools
```

The validator in `skills/skill-creator/scripts/quick_validate.py` (line 42) correctly enforces this set. However, platform-specific implementations like [Claude Code](https://code.claude.com/docs/en/skills#frontmatter-reference) extend the standard with additional fields:

```
model, context, agent, argument-hint, hooks, disable-model-invocation, user-invocable
```

These fields are documented and functional in Claude Code but are not part of the base spec. Other platforms (Cursor, Gemini CLI, Copilot, Goose, etc.) would simply ignore them.

## Problem

The validator currently **hard-errors** on any field not in the base spec:

```python
ALLOWED_PROPERTIES = {'name', 'description', 'license', 'allowed-tools', 'metadata', 'compatibility'}
unexpected_keys = set(frontmatter.keys()) - ALLOWED_PROPERTIES
if unexpected_keys:
return False, f"Unexpected key(s)..."
```

This means a skill authored for Claude Code with `context: fork` or `model: sonnet` fails validation and can't be packaged, even though:
- The base spec fields are all valid
- The extension fields are inert on non-Claude platforms
- The skill is otherwise portable

## Suggestion

**Warn on unknown fields instead of erroring.** Something like:

```python
if unexpected_keys:
print(f"Warning: non-standard frontmatter key(s): {', '.join(sorted(unexpected_keys))}. "
f"These may be platform-specific extensions and will be ignored by agents "
f"that don't support them.")
# Continue validation instead of returning False
```

This preserves the signal ("hey, these aren't portable") without blocking packaging of otherwise-valid skills that use platform extensions.

## References

- [Agent Skills spec - frontmatter](https://agentskills.io/specification#frontmatter-required)
- [Claude Code skills - frontmatter reference](https://code.claude.com/docs/en/skills#frontmatter-reference)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.