Skip to content

fix(plugin-dev): declare skills.sh skills in generated Codex manifests - #300

Merged
amondnet merged 2 commits into
mainfrom
amondnet/codex-skills-path
Nov 2, 2026
Merged

amondnet merged 2 commits into
mainfrom
amondnet/codex-skills-path

Conversation

@amondnet

@amondnet amondnet commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

multi-format.ts omitted skills from .codex-plugin/plugin.json whenever the Claude manifest used ./.agents/skills/, so the skills of 53 skills.sh plugins never loaded under Codex. deriveCapabilities also advertised Skill whenever Claude declared skills, and as a fallback when nothing else applied (for example gatekeeper, which has no skills). The Codex runtime accepts any ./-relative path inside the plugin root (codex-rs/core-plugins/src/manifest.rs resolve_manifest_path) and always loads root skills/ plus the manifest skills path (loader.rs plugin_skill_roots), so the generator now declares the real path.

What changed

  • New toCodexSkillsPath rejects absolute, .., empty, and ./-only paths. normalizeSkillsPath prefers the first non-root path from an array (better-auth and mastra resolve to ./.agents/skills/), since Codex auto-loads root skills/.
  • toCodexManifest(claude, entry, { hasRootSkillsDir }) declares ./skills/ explicitly for plugins that have a root skills/ dir but no manifest field. generateForPlugin passes the flag.
  • Skill capability appears if and only if the Codex manifest declares skills. The Skill fallback is removed (gatekeeper now gets []).
  • Regenerated 69 .codex-plugin/plugin.json files; only skills and interface.capabilities changed (67 gained or changed a skills line).

Scope

Out of scope, as follow-ups:

  • deriveCapabilities ignores hooks/hooks.json (auto-loaded, not in the manifest), so hook-only plugins like gatekeeper get no Interactive.
  • Repo-wide multi-format drift. A full run on main already changes about 153 unrelated files (Antigravity $schema, stale versions, codegraph hook path, untracked portone .mcp.json); these are deliberately excluded.

Tradeoffs

Only the sample plugin-creator validate_plugin.py requires exactly skills; nothing in this repo's CI runs it, so declaring non-default paths is safe. Existing skills keys keep their position; new ones sit where the generator emits them (after keywords, before mcpServers).

Blast radius

Only Codex manifests change, and only skills and capabilities. portone's Codex manifest is hand-curated (privacyPolicyURL, brandColor), so only Skill was added to its existing ["Interactive","Write"]. A full regen would still rewrite it to ["Skill","Tool"]; that drift predates this PR.

Verification

  • bun test plugins/plugin-dev/scripts/multi-format.test.ts: 83 pass, 0 fail. New tests cover .agents/skills passthrough, array preference, invalid paths omitted, the root-dir flag, and Skill only when skills are declared. The old capabilities toContain("Skill") assertion on a skills-less manifest asserted the bug and now expects [].
  • bun run lint passes.
  • After committing, a fresh bun scripts/cli.ts multi-format changes no skills or capabilities line in any Codex manifest except portone's pre-existing curated drift.
  • Husky pre-commit printed fnm: not found locally, so lint-staged may not have run; CI is the lint gate.

Related issue

Closes #296

Checklist

  • PR title follows Conventional Commits
  • Tests added or updated, and the suite passes (bun run test)
  • Lint/format pass (bun run lint)
  • Documentation updated if behavior changed
  • No breaking change, or a BREAKING CHANGE: note is included

Summary by cubic

Generated Codex manifests now declare skills for the 53 skills.sh plugins that point at ./.agents/skills/, so those skills actually load under Codex instead of being silently omitted.

  • normalizeSkillsPath now accepts any valid in-root path so ./.agents/skills/ passes through, omitting absolute, .., empty, ./-only, and backslash-separated paths; from an array it prefers the first non-root path, since Codex auto-loads root skills/.
  • Plugins with a root skills/ dir but no manifest field get an explicit ./skills/ declaration.
  • The Skill capability now appears only when the Codex manifest declares skills; the fallback that wrongly advertised Skill (e.g. gatekeeper) is removed.
  • Regenerated 69 .codex-plugin/plugin.json files; only skills and interface.capabilities changed.

Closes #296.

Written for commit afc7803. Summary will update on new commits.

Turn on auto-fix

The multi-format generator omitted `skills` from Codex manifests whenever the
Claude manifest pointed at `./.agents/skills/`, so the skills of every
skills.sh plugin never loaded under Codex. The Codex runtime accepts any
`./`-relative path inside the plugin root and always loads root `skills/` as
well; only the sample plugin-creator validator insists on `./skills/`.

- Pass any valid in-root skills path through; from an array prefer the first
  non-root path, since Codex already auto-loads root `skills/`.
- Declare `./skills/` explicitly for plugins that ship a root `skills/` dir
  without a manifest field.
- Emit the `Skill` capability only when the Codex manifest declares `skills`,
  and drop the `Skill` fallback.
- Update the generated Codex manifests (skills and capabilities only; the
  unrelated drift a full regeneration produces is left out).

Closes #296
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
claude-code-plugins Ready Ready Preview Oct 30, 2026 8:08am UTC

Request Review

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 17 complexity · 0 duplication

Metric Results
Complexity 17
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@amondnet
amondnet marked this pull request as ready for review October 30, 2026 08:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T08:07:03.377231Z d441d64 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Generated Codex manifests now declare the skills directories that plugins actually use.

  • Codex manifests point to valid skills folders and label skills accurately.

Reviews (2) · Last reviewed commit: "fix(plugin-dev): reject backslash separa..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cubic analysis

All reported issues were addressed across 71 files

You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Linked issue analysis

Linked issue: pleaseai/claude-code-plugins#296: Review follow-up: Codex manifests omit skills for .agents/skills plugins in multi-format.ts

Status Acceptance criteria Notes
✅ Declare .agents skill paths in generated Codex manifests multi-format.ts now preserves valid in-root paths, and regenerated manifests declare ./.agents/skills/ for affected plugins.
Architecture diagram
sequenceDiagram
    participant CLI as multi-format CLI
    participant Gen as generateForPlugin()
    participant FS as Filesystem
    participant Conv as toCodexManifest()
    participant Skills as normalizeSkillsPath()
    participant Caps as deriveCapabilities()
    participant Out as .codex-plugin/plugin.json
    participant Codex as Codex Runtime

    Note over CLI,Out: Plugin manifest generation flow

    CLI->>Gen: Process plugin directory
    Gen->>FS: Check root skills/ directory
    FS-->>Gen: hasRootSkillsDir flag

    Gen->>Conv: toCodexManifest(claude, entry, { hasRootSkillsDir })

    Conv->>Skills: Normalize Claude skills path
    alt Claude declares skills array
        Skills->>Skills: Validate each path (reject ../, /abs, ./ only)
        Skills->>Skills: Prefer first non-root path (e.g. ./.agents/skills/)
        Skills-->>Conv: Valid Codex skills path or null
    else Claude declares single skills path
        Skills->>Skills: Validate and normalize path
        Skills-->>Conv: Valid Codex skills path or null
    else No skills declared but root skills/ exists
        Skills-->>Conv: ./skills/
    else No skills and no root dir
        Skills-->>Conv: null
    end

    Conv->>Caps: deriveCapabilities(claude, hasSkills)
    alt hasSkills is true
        Caps->>Caps: Include "Skill" capability
    else no skills declared
        Caps->>Caps: Omit "Skill" capability
    end

    Note over Caps: Also checks MCP servers (Tool) and hooks (Interactive)
    Caps-->>Conv: capabilities array (may be empty)

    opt skillsPath is not null
        Conv->>Out: Write "skills": "./.agents/skills/" or "./skills/"
    end
    Conv->>Out: Write capabilities array

    Gen->>Out: Write .codex-plugin/plugin.json
    Out-->>Codex: Manifest with skills path

    Note over Codex: Runtime behavior
    Codex->>Codex: Load root skills/ automatically
    Codex->>Codex: Load manifest skills path (any ./-relative in-root)
    Codex-->>Out: Skills now load correctly

    alt Invalid skills path (../, absolute, or empty)
        Skills-->>Conv: null
        Conv->>Out: Omit skills field
        Out->>Codex: No skills declared
        Codex->>Codex: Only auto-loaded root skills/ (if any)
    end
Loading

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@sonarqubecloud

Copy link
Copy Markdown

@amondnet
amondnet merged commit dd00b8f into main Nov 2, 2026
13 checks passed
@amondnet
amondnet deleted the amondnet/codex-skills-path branch November 2, 2026 06:30

This branch was successfully deployed

1 active deployment
Preview — afc7803f Deployed Oct 30, 2026 by vercel[bot]
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.

Review follow-up: Codex manifests omit skills for .agents/skills plugins in multi-format.ts

1 participant