Skip to content

feat: add license metadata to skill frontmatter#594

Open
jack-piplabs wants to merge 14 commits intoopenclaw:mainfrom
jack-piplabs:feat/skill-license-metadata
Open

feat: add license metadata to skill frontmatter#594
jack-piplabs wants to merge 14 commits intoopenclaw:mainfrom
jack-piplabs:feat/skill-license-metadata

Conversation

@jack-piplabs
Copy link

Summary

  • Adds an optional license field to SKILL.md frontmatter for declaring licensing terms on published skills
  • Introduces SkillLicenseSchema (ArkType) and SkillFrontmatterSchema as the canonical schema for the complete SKILL.md frontmatter shape
  • LicenseSelector component on the upload skills page with 18 SPDX presets and advanced per-field controls
  • License displayed on skill detail page, install card, and CLI inspect output
  • Backward-compatible parser: accepts simple string form (license: MIT) and structured object form with boolean fields (commercialUse, derivativesAllowed, transferable, etc.)
  • Old field names (commercial, attribution, derivatives, url) are still accepted and normalized automatically

What's included

Area Changes
Schema SkillLicense type, SkillLicenseSchema, SkillFrontmatterSchema, LICENSE_PRESETS for 18 SPDX identifiers
Backend parseLicenseField() with backward compat, Convex schema update
UI LicenseSelector on upload page, license badge on detail/install card
CLI clawhub inspect shows license terms
Docs docs/skill-format.md updated with field reference and deprecation table
Tests 60 parser tests, 10 UI component tests

Test plan

  • npx vitest run convex/lib/skills.test.ts — 60 tests pass
  • npx vitest run src/components/LicenseSelector.test.tsx — 10 tests pass
  • TypeScript compilation clean (no new errors)
  • Manual: upload a skill with license: MIT and verify badge appears
  • Manual: upload with structured license object and verify advanced fields display
  • Manual: run clawhub inspect <slug> and verify license output

Add an optional `license` field to SKILL.md frontmatter, parsed in the
Convex backend, displayed on skill pages, and validated with ArkType.

Schema:
- `SkillLicense` type with structured boolean fields for commercial use,
  attribution, derivatives, transferability
- `SkillLicenseSchema` ArkType validator
- `SkillFrontmatterSchema` defining the complete SKILL.md frontmatter shape
- `LICENSE_PRESETS` mapping 18 SPDX identifiers to structured terms
- Backward-compatible parser accepts both simple string (`license: MIT`)
  and structured object forms

UI:
- `LicenseSelector` component on the upload skills page with preset
  picker and advanced boolean controls
- License badge on skill detail page and install card
- CLI `inspect` command displays license info

Docs:
- Updated `docs/skill-format.md` with field reference and examples

Tests:
- 60 parser tests including backward-compat normalization
- 10 LicenseSelector UI tests
@vercel
Copy link
Contributor

vercel bot commented Mar 4, 2026

@jack-piplabs is attempting to deploy a commit to the Amantus Machina Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR successfully adds optional license metadata to SKILL.md frontmatter with strong backend implementation, schema design, and test coverage (60 parser tests, 10 component tests). The core feature is backward-compatible and correctly handles both simple SPDX strings and structured license objects on the server side.

Three UX/usability issues warrant attention before merge:

  1. Frontmatter conflict detection incompleteness (src/routes/upload.tsx, line 133): The single-line regex ^license:\s*(.+)$ misses the new structured multi-line object form. Users uploading SKILL.md files with structured license metadata will not see the override warning, silently losing the conflict hint. The backend parser correctly handles both forms; the frontend detection should too.

  2. Advanced license terms button disappears (src/components/LicenseSelector.tsx, line 201): Once the advanced panel opens, the toggle button is never shown again, leaving only the dropdown as an exit path. Users cannot easily collapse the panel via a visible control.

  3. Validation warnings lack visual distinction (src/routes/upload.tsx, line 523): Warnings like "No license declared ⚠" render in the same list with identical styling as hard errors, potentially confusing users into thinking missing licenses block submission.

All three are presentation/UX issues; the core data model, persistence, and security are sound.

Confidence Score: 3/5

  • Safe to merge; no data integrity or security risks — three UX issues are presentation-only.
  • The core implementation (license schema, backend parser, database persistence, CLI output) is solid and well-tested. The three flagged issues are all UX/presentation concerns: incomplete regex in frontmatter detection, button visibility in the advanced panel, and visual distinction between warnings and errors. None affect data correctness, security constraints, or feature completeness. Backend correctly enforces https-only URIs and 64-char SPDX limits regardless of frontend UI choices. Issues are straightforward to fix but not critical for merge.
  • src/routes/upload.tsx — frontmatter conflict detection (line 133) and warning/error styling (line 523); src/components/LicenseSelector.tsx — "Advanced terms" button visibility (line 201).

Last reviewed commit: 15668ee

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15668ee208

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@jack-piplabs
Copy link
Author

Uploading a skill
clawhub-license-publish-skill-1

License selected
clawhub-license-publish-skill-2

Option to use a custom license
clawhub-license-publish-skill-3

Skills page with license information
clawhub-license-publish-skill-5

Updating a license, overriding previous license
clawhub-license-publish-skill-4

Read license from skill object instead of undefined result.license in
CLI inspect. Account for frontmatter license when showing the "no
license declared" upload warning.
Detect multi-line license block (license:\n  spdx: ...) in upload
frontmatter parsing so the override warning fires for both forms.
Keep the "Advanced terms" button visible when the panel is open
with a toggle label so users can collapse it.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 716b29cf97

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…arnings

Add license field to ApiV1SkillResponseSchema in both schema packages
so CLI inspect reads it from the top-level API response instead of
casting through result.skill. Fix frontmatter regex to use horizontal
whitespace only so multi-line license blocks fall through to the spdx
extractor. Visually distinguish validation warnings from errors with
muted italic styling.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d274a032e5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…ense in inspect

Stop resetting license to bare SPDX when hiding the advanced panel so
customized terms persist until the user changes the dropdown. Prefer
version-specific license from the version detail API over the skill-level
latest when --version or --tag is provided in clawhub inspect.
@jack-piplabs
Copy link
Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5190f4129

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…sion

When a version is fetched, use only that version's license (even if
null) so clawhub inspect --version accurately reports "not declared"
instead of silently showing the latest version's license.
@jack-piplabs
Copy link
Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 376050dadf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Pass parsed.license through toPublicSkillListVersion so the /api/v1/skills
list endpoint returns license data. Handle \r\n line endings in the
frontmatter delimiter regex so Windows-authored SKILL.md files are parsed
correctly.
Replace fragile regex-based license extraction in upload UI with the
yaml package parser, handling both string and structured object forms
reliably. Remove inaccurate docs claim that custom SPDX identifiers
show a warning during clawhub publish.
Warnings (like "No license declared") are advisory and should not
prevent the "All checks passed" message from appearing. Render them
in a separate list below the validation status.
Default the upload form license selector to MIT instead of empty.
Remove the "No license declared" warning and associated warning
rendering infrastructure since it's no longer needed. Drop hint
labels from MIT and Apache-2.0 in the license dropdown.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b548d95a7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

If args.license is non-null but parseLicenseField returns undefined,
fall through to the frontmatter license instead of silently dropping it.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d86f1e49a3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Track whether the user touched the license selector; if not, omit
license from the publish payload so the backend uses the SKILL.md
frontmatter value. Also guard the legacy derivatives fallback on
derivativesReciprocal being unset to prevent it from overwriting
an explicitly provided value.
…from current value

Only include license in the publish payload for skill mode when the
user interacted with the selector, preventing Convex argument validation
errors in soul mode. Seed advanced license editor controls from the
current value prop instead of static presets so customizations persist
across open/close cycles.
@jack-piplabs
Copy link
Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53a574b077

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Send null (not undefined) when the user selects "No license declaration"
after touching the selector. Update resolveLicense to distinguish
undefined (not provided, use frontmatter) from null (explicitly cleared).
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 272cc74186

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
const spdx = (raw as Record<string, unknown>).spdx
if (typeof spdx === 'string' && spdx.trim()) {
setFrontmatterLicense({ spdx: spdx.trim() })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve frontmatter license terms when checking overrides

This parser collapses object-form frontmatter licenses down to { spdx }, which means later conflict checks only compare SPDX strings and treat license: { spdx: MIT, commercialUse: false } as equivalent to selecting plain MIT in the form. In that flow, submit sends an explicit { spdx: 'MIT' } override and drops the restrictive terms from SKILL.md without showing the “will override” warning, so publishers can unintentionally relax license terms.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant