Commit 9aa8033
fix(discovery): agentskills.io spec compliance + parity hardening
Mirrors node-commerce — addresses spec violations + parity issues from
end-to-end review against https://agentskills.io/specification:
P0 — spec violations:
- description / license / compatibility / allowed-tools / metadata-values now
emitted as YAML double-quoted scalars. Fixes the colon / quote / newline
parse failure the spec explicitly warns about.
- metadata.version emitted as quoted string ("1") not int (1). Spec requires
metadata values to be strings.
P1 — validation + exports:
- Validate name against the spec regex (1-64 chars, lowercase alphanumeric +
hyphens, no leading / trailing / consecutive hyphens).
- Validate description length ≤1024 + non-empty.
- Validate compatibility length ≤500.
- Title-block parity fix: tagline + intro now join with blank lines instead
of being glued together (previously diverged from node output).
- Re-export RailKey + compatible_clients_by_rails from agentscore_commerce
.discovery (added to __all__).
P2 — additional spec fields:
- Surface optional license, compatibility, allowed_tools frontmatter fields.
- Move homepage from top-level to metadata.homepage (spec-compliant).
P3 — edge cases:
- Drop compatible_clients overrides for rails not in accepted_rails.
- Escape pipe characters in markdown table cells.
- Add /SKILL.md (uppercase) to DEFAULT_DISCOVERY_PATHS for canonical-cased
alias.
Tests: 49 cases covering spec violations + edge cases + validation throws.
Coverage 95.45% (over 95%).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ce9a8ec commit 9aa8033
4 files changed
Lines changed: 340 additions & 131 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments