feat(discovery): build_skill_md renderer for /skill.md agent surface#5
Merged
vvillait88 merged 4 commits intomainfrom May 2, 2026
Merged
feat(discovery): build_skill_md renderer for /skill.md agent surface#5vvillait88 merged 4 commits intomainfrom
vvillait88 merged 4 commits intomainfrom
Conversation
Adds a new discovery builder mirroring node-commerce 1.2.0 — emits a Claude-Skill-compatible manifest (YAML frontmatter + markdown body) describing the merchant's agent-facing contract: payment rails, compatible clients per rail, identity requirements as outcomes, shipping policy, endpoints, triggers, support links. Renders strictly agent-facing data — no fail_open, no mount-strategy names, no KYC vendor names, no defense parameters, no idempotency construction shape. Internal posture stays in merchant runtime config. The compatible-clients-per-rail table sources from the same SDK constant (compatible_clients_by_rails, extracted from challenge/agent_instructions.py) that drives the live 402 body's compatible_clients field — single source of truth across surfaces. Adds /skill.md to DEFAULT_DISCOVERY_PATHS so the existing noindex middleware / discovery-path predicate auto-recognizes the new surface. Bump to 1.2.0 to match node-commerce parity. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
Mirror node-commerce parity-lock test. End-to-end review flagged version: 0 as potential parity drift; verified both pass 0 through unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors node-commerce CodeQL fix. Prior implementation escaped \`|\` but not \`\\\`, so an input like \`a\\|b\` rendered as literal-backslash + cell-terminator — breaking the markdown table row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan