Skip to content

feat(capabilities): Initial capability manifest support (legacy + map)#545

Open
vincentkoc wants to merge 14 commits intomainfrom
vincentkoc-code/phase1-capabilities-registry-schema
Open

feat(capabilities): Initial capability manifest support (legacy + map)#545
vincentkoc wants to merge 14 commits intomainfrom
vincentkoc-code/phase1-capabilities-registry-schema

Conversation

@vincentkoc
Copy link
Member

Summary

  • Problem:
    • Registry-side schema/API needs to accept and surface capability metadata during migration.
  • Why it matters:
    • Visibility and validation must precede strict enforcement.
  • What changed:
    • Added capability schema support and validation helpers.
    • Parsed capability metadata in skill-processing pipeline.
    • Exposed capabilities through v1 API response.
    • Included declared capabilities in security evaluator context.
    • Updated skill format docs for capability declarations.
  • What did NOT change (scope boundary):
    • No publish-time hard blocking.
    • No broad UI refactor in this PR.

Testing

  • bun run lint
  • bun run test
  • bun run build

Related

@vercel
Copy link
Contributor

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clawhub Ready Ready Preview, Comment Feb 27, 2026 7:07pm

@vincentkoc vincentkoc force-pushed the vincentkoc-code/phase1-capabilities-registry-schema branch from 2a524e9 to 446be4b Compare February 27, 2026 17:09
@vincentkoc
Copy link
Member Author

Refinement pass completed on schema/API branch.

Updates added:

  • Expanded canonical capability enum to include messaging and scheduling.
  • Added alias normalization for common external naming (terminal/bash/exec, web_fetch/web_search, subagent, cron/message, etc.).
  • Capability parser now accepts:
    • flat string list
    • object-map shape (constraints payload supported)
    • array-of-objects shape (name/type/id/capability)
  • Added tests covering alias normalization and object-shape parsing.

Local validation:

  • bun run lint
  • bun run test
  • bun run build
    (all passed)

Note: current failing "Scan for Verified Secrets" check appears infrastructure-related (missing trufflesecurity/trufflehog action tarball), not diff-related.

@vincentkoc vincentkoc changed the title feat(schema): phase 1 capability manifest support (legacy + map) feat(capability): Initial capability manifest support (legacy + map) Feb 27, 2026
@vincentkoc vincentkoc marked this pull request as ready for review February 27, 2026 17:40
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Adds capability manifest support to the skill registry, enabling skills to declare their required capabilities (shell, filesystem, network, browser, sessions, messaging, scheduling) for visibility and future enforcement.

Key changes:

  • Created new capability normalization system with comprehensive alias mapping
  • Integrated capability parsing into skill metadata pipeline
  • Exposed capabilities through v1 API endpoints
  • Added capability validation via schema
  • Included robust test coverage for various declaration formats

Implementation highlights:

  • Handles multiple input formats: strings, arrays, and object-style declarations
  • Normalizes capability aliases (e.g., terminalshell, web_fetchnetwork)
  • Filters unknown capabilities silently
  • Deduplicates capabilities automatically

Confidence Score: 4/5

  • This PR is safe to merge with one minor style fix
  • The implementation is solid with good test coverage and proper validation. Only one minor indentation style issue was found that doesn't affect functionality.
  • Fix indentation in packages/schema/src/schemas.ts line 170

Last reviewed commit: e0d4948

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +170 to +175
latestVersion: type({
version: 'string',
createdAt: 'number',
changelog: 'string',
capabilities: '("shell"|"filesystem"|"network"|"browser"|"sessions"|"messaging"|"scheduling")[]?',
}).optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

inconsistent indentation (should be 4 spaces like other fields, not 6)

Suggested change
latestVersion: type({
version: 'string',
createdAt: 'number',
changelog: 'string',
capabilities: '("shell"|"filesystem"|"network"|"browser"|"sessions"|"messaging"|"scheduling")[]?',
}).optional(),
latestVersion: type({
version: 'string',
createdAt: 'number',
changelog: 'string',
capabilities: '("shell"|"filesystem"|"network"|"browser"|"sessions"|"messaging"|"scheduling")[]?',
}).optional(),

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/schema/src/schemas.ts
Line: 170-175

Comment:
inconsistent indentation (should be 4 spaces like other fields, not 6)

```suggestion
    latestVersion: type({
      version: 'string',
      createdAt: 'number',
      changelog: 'string',
      capabilities: '("shell"|"filesystem"|"network"|"browser"|"sessions"|"messaging"|"scheduling")[]?',
    }).optional(),
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 6248053. Indentation has been normalized to match surrounding schema fields.

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: da1dab3ec8

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (typeof clawdisObj.author === 'string') metadata.author = clawdisObj.author
const links = parseSkillLinks(clawdisObj.links)
if (links) metadata.links = links
const capabilities = normalizeCapabilities(clawdisObj.capabilities)

Choose a reason for hiding this comment

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

P2 Badge Read openclaw capabilities even when clawdis metadata exists

This normalization only reads clawdisObj.capabilities, and clawdisObj comes from the first metadata alias selected earlier (clawdbot/clawdis before openclaw). In mixed manifests that keep legacy metadata.clawdis fields but add new metadata.openclaw.capabilities (the format documented in this PR), the declared capabilities are silently dropped, so downstream API consumers see [] instead of the author-declared capabilities.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in b7482e7 (+ coverage in be990c8). Capability parsing now prefers metadata.openclaw.capabilities when present, even when other legacy metadata namespaces exist in the same frontmatter.

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

The ListSkillsResult type is missing the capabilities property in its clawdis type definition, causing TypeScript error TS2339 when accessing capabilities at line 208.

Fix on Vercel

@vincentkoc vincentkoc changed the title feat(capability): Initial capability manifest support (legacy + map) feat(capabilities): Initial capability manifest support (legacy + map) Feb 27, 2026
@vincentkoc
Copy link
Member Author

Addressed remaining review items from bots/reviewers in latest push:

  • ListSkillsResult typing now includes parsed.clawdis.capabilities (f65d5e8)
  • Mixed-manifest capability precedence fixed to prefer metadata.openclaw.capabilities (b7482e7)
  • Added regression test for mixed legacy + openclaw manifests (be990c8)
  • Fixed schema indentation nit in packages/schema/src/schemas.ts (6248053)

Re-ran local validation after these updates:

  • bun run lint
  • bun run test
  • bun run build

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