Skip to content

fix --as codex for skill#261

Merged
khaliqgant merged 3 commits into
mainfrom
fix-codex-skills
Mar 18, 2026
Merged

fix --as codex for skill#261
khaliqgant merged 3 commits into
mainfrom
fix-codex-skills

Conversation

@khaliqgant
Copy link
Copy Markdown
Collaborator

@khaliqgant khaliqgant commented Mar 17, 2026

CodeAnt-AI Description

Preserve skill frontmatter and allow --tools overrides when converting or installing Claude skills

What Changed

  • Converting Claude-format skills to Codex SKILL.md preserves the original YAML frontmatter (name, description, metadata) instead of copying body text into frontmatter.
  • The CLI gained a --tools option that normalizes space- or comma-separated input and overrides the skill's allowed-tools during:
    • Claude→Codex conversion (applies to single-file and multi-file Codex packages)
    • Installing native Claude skills
  • When installing from the lockfile (no package specified), --tools is ignored and a warning is shown.
  • Tests added to verify frontmatter preservation, --tools override during Claude→Codex conversion, and --tools override when installing native Claude skills.

Impact

✅ Clearer skill frontmatter after conversion
✅ Consistent allowed-tools in installed and converted skills
✅ Fewer mismatched tool lists for multi-file Codex packages

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 17, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Mar 17, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 17, 2026

Sequence Diagram

This PR adds a tools override option to install and ensures Claude skill metadata is preserved when converting to Codex skill format. The main flow shows how install propagates the override into conversion and writes the final skill file.

sequenceDiagram
    participant User
    participant CLI
    participant Install
    participant Converter
    participant FileSystem

    User->>CLI: Run install with target format and tools override
    CLI->>Install: Call handle install with tools option
    Install->>Install: Download package and parse source skill
    alt Target is Codex skill
        Install->>Converter: Convert to Codex with allowed tools override
        Converter-->>Install: Return SKILL content with preserved frontmatter
    else Target is Claude
        Install->>Install: Apply Claude tools override in frontmatter
    end
    Install->>FileSystem: Save updated skill file
    Install-->>User: Report install success
Loading

Generated by CodeAnt AI

@my-senior-dev-pr-review
Copy link
Copy Markdown

my-senior-dev-pr-review Bot commented Mar 17, 2026

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in packages/ (210 edits) • ⚡ 7th PR this month

View your contributor analytics →


📊 6 files reviewed • 3 high risk • 5 need attention

🚨 High Risk:

  • packages/cli/src/commands/install.ts — Critical security implications related to command injections and path traversals.

⚠️ Needs Attention:

  • package.json — Minor changes to maintain build configuration; still relevant for overall code quality.
  • packages/cli/src/commands/install.ts — Significant changes made in command handling that might introduce logic errors or performance issues.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 17, 2026

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Frontmatter edge cases
    applyAgentSkillsTools parses YAML frontmatter with a regex and manual line edits. This can break for valid frontmatter variants (different line endings, indentation, quoted values, multiple allowed-tools entries, or nested YAML). Consider using a YAML parser to avoid subtle bugs and to correctly preserve formatting/escaping.

  • Config merge
    effectiveClaudeConfig is created by spreading config.claude and possibly adding options.tools. hasConfigValues checks only tools/model properties. If config.claude contains other meaningful flags used by toClaude, verify they are preserved and that hasConfigValues's criteria are sufficient to decide whether to pass claudeConfig into toClaude.

  • API change
    fromCursor and fromClaude invocations were changed to pass additional parameters (subtype / explicit 'claude' param). Verify the converters' APIs accept these extra args and that types/overloads match; otherwise runtime errors will occur when parsing source formats.

  • Potential Bug
    The call to toCodex passes options.tools directly as codexConfig.allowedTools (a string). The converter may expect an array or normalized list. This risks producing an incorrect Codex manifest. Ensure allowedTools is normalized and in the shape the converter expects (e.g., array of tool ids or a space/comma-separated normalized string).

  • CLI option handling
    A new global CLI option --tools was added and wired through createInstallCommand -> handleInstall. Confirm parsing semantics (comma vs space-separated), documentation/examples, and that options.tools is consistently normalized before being used by converters or frontmatter modifiers.

Comment thread packages/cli/src/commands/install.ts
Comment thread packages/cli/src/commands/install.ts
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 17, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

2 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/cli/src/commands/install.ts">

<violation number="1" location="packages/cli/src/commands/install.ts:1276">
P2: The Codex `--tools` override only runs for single-file installs, so multi-file skills keep the old `allowed-tools` value.</violation>

<violation number="2" location="packages/cli/src/commands/install.ts:2010">
P2: `--tools` is not forwarded when `install` runs from `prpm.lock`, so the new flag is silently ignored for no-package installs.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread packages/cli/src/commands/install.ts
Comment thread packages/cli/src/commands/install.ts
- Normalize space-separated tools to comma-separated for Claude format
  (e.g. 'Read Write' → 'Read, Write') in both conversion and native
  install paths
- Apply Codex --tools override to SKILL.md in multi-file packages
  (previously only worked for single-file installs)
- Warn when --tools is passed with bare 'prpm install' (lockfile mode)
  since per-install overrides don't apply to lockfile reinstalls
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 18, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Mar 18, 2026
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/cli/src/commands/install.ts">

<violation number="1" location="packages/cli/src/commands/install.ts:150">
P1: Splitting Claude tools on whitespace corrupts valid Bash restrictions like `Bash(git add:*)`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread packages/cli/src/commands/install.ts Outdated
Comment thread packages/cli/src/commands/install.ts Outdated
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 18, 2026

CodeAnt AI Incremental review completed.

Tools like Bash(git add:*) contain spaces inside parens — naive
whitespace splitting corrupted them. Now uses regex to match tool
tokens with optional parenthesized args.
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/cli/src/commands/install.ts">

<violation number="1" location="packages/cli/src/commands/install.ts:152">
P2: `--tools` values that mix commas and spaces are normalized incorrectly for Claude, merging adjacent tools into one entry.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread packages/cli/src/commands/install.ts
@khaliqgant khaliqgant merged commit 530bdab into main Mar 18, 2026
12 checks passed
@khaliqgant khaliqgant deleted the fix-codex-skills branch March 18, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant