anthropics / anthropics/skills

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

Ouverte
#394 1 commentaire 3 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
176k
Forks
20.9k
Merge moyen
7 h 21 min
PR mergées (30 j)
5

Description

## 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)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.