Skip to content

codex -> agent skills#257

Merged
khaliqgant merged 2 commits into
mainfrom
agent-codex-skills
Feb 24, 2026
Merged

codex -> agent skills#257
khaliqgant merged 2 commits into
mainfrom
agent-codex-skills

Conversation

@khaliqgant
Copy link
Copy Markdown
Collaborator

@khaliqgant khaliqgant commented Feb 24, 2026

CodeAnt-AI Description

Move Codex skill and agent locations to .agents and add native agent output

What Changed

  • Codex skills now live at .agents/skills/{name}/SKILL.md instead of .codex/skills/{name}/SKILL.md
  • Codex agents are supported with .agents/agents/{name}/AGENT.md (new native agent output)
  • File detection, converters, documentation, UI examples, and the format registry updated to recognize and produce .agents/skills and .agents/agents paths
  • A new example SKILL.md for creating Agent Skills was added under .agents/skills and included in the package index

Impact

✅ Fewer missed Codex skills during format detection
✅ Clearer Codex agent output location (AGENT.md) for agent packages
✅ Consistent cross-tool skill directory (.agents) for conversions and docs

💡 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 Feb 24, 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 Feb 24, 2026
@my-senior-dev-pr-review
Copy link
Copy Markdown

my-senior-dev-pr-review Bot commented Feb 24, 2026

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

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

View your contributor analytics →


📊 9 files reviewed • 4 need attention

⚠️ Needs Attention:

  • .agents/skills/creating-agent-skills/SKILL.md — This critical documentation file outlines the new standards for creating agent skills.

🚀 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 Feb 24, 2026

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Subtype detection
    detectFormat now treats any path under .agents (both skills and agents) as generic 'codex' but does not distinguish 'skill' vs 'agent'. That means downstream logic (default output path selection, conversion subtype handling) may not have the correct subtype set and could choose the wrong destination (e.g., AGENT.md vs SKILL.md) or incorrect conversion behavior. Verify whether detectFormat should return more specific subtype tokens (e.g. 'codex-skill' / 'codex-agent') or whether later code will reliably infer subtype from content or options.

  • Filename Mismatch
    The file header/docs mention an agent-native file should be "AGENT.md" (directory .agents/agents/{name}/AGENT.md) but the implementation of generateFilename() returns only 'SKILL.md' for subtype 'skill' and 'AGENTS.md' for everything else. This is inconsistent with the new docs and may cause agents to be written to the wrong filename (AGENTS.md vs AGENT.md). Verify callers and consumers that create on-disk paths expect AGENTS.md vs AGENT.md and update implementation or docs accordingly.

  • New format mapping
    'codex' was added to Format, FORMATS, FORMAT_SUBTYPES and FORMAT_NATIVE_SUBTYPES. This is a cross-cutting format addition — ensure all conversion, tooling, validation, CLI help, and registry code paths are updated to recognize 'codex' (directory mapping .agents/..., generators, validators). Pay attention to any code that expects different directory roots (previously ".codex") and update test coverage.

  • Tool parsing limits
    The new parseAllowedTools implementation extracts a base tool name using a regex that only allows ASCII letters. Real tool names in frontmatter may include digits, dashes, underscores or dots. That parsing can drop valid characters and produce incorrect tool names or duplicate entries. Validate that allowed-tools parsing preserves realistic tool identifiers and doesn't unintentionally normalize or lose tokens.

  • Default output naming inconsistency
    The new codex mapping writes SKILL.md / AGENT.md into .agents/skills/.. and .agents/agents/.., while the generic fallback for other codex subtypes is 'AGENTS.md' (uppercase) whereas elsewhere the project uses 'agents.md' (lowercase) for other formats. This inconsistent naming/casing may confuse users and automation on case-sensitive filesystems. Confirm desired filename casing and align across detection, defaults and documentation.

if (subtype === 'agent') {
return join(process.cwd(), '.agents', 'agents', baseName, 'AGENT.md');
}
// Other subtypes use AGENTS.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Codex slash commands currently fall through to the generic AGENTS.md path, but the Agent Skills/Codex docs specify that progressive-disclosure slash commands should live at .opencommands/{name}.md. This mislocation means converted Codex slash commands won't be written where the editor expects them, so they may not be discovered or invoked correctly as slash commands. Add a dedicated slash-command branch in the Codex getDefaultPath case to target .opencommands/{name}.md. [logic error]

Severity Level: Major ⚠️
- ⚠️ `prpm convert --to codex --subtype slash-command` writes AGENTS.md.
- ⚠️ Converted Codex slash-commands diverge from `.opencommands/` install layout.
Suggested change
// Other subtypes use AGENTS.md
// Codex slash commands use .opencommands/{name}.md for progressive disclosure
if (subtype === 'slash-command') {
return join(process.cwd(), '.opencommands', `${baseName}.md`);
}
Steps of Reproduction ✅
1. Run the CLI convert command created by `createConvertCommand()` at
`packages/cli/src/commands/convert.ts:534-585`, e.g.:

   `prpm convert my-command.md --to codex --subtype slash-command` in a project directory
   with no `--output` flag.

2. The `.action` handler in `createConvertCommand()` calls `handleConvert()` at
`convert.ts:569-576`, passing `options.to === 'codex'` and `options.subtype ===
'slash-command'`.

3. Inside `handleConvert()` at `convert.ts:485-487`, the code computes the output path as:

   `const outputPath = options.output || getDefaultPath(options.to, sourcePath,
   options.subtype, options.name);`

   so it calls `getDefaultPath('codex', sourcePath, 'slash-command', options.name)`.

4. In `getDefaultPath()` at `convert.ts:90-178`, the `case 'codex'` branch at `165-175`
executes. Because `subtype` is `'slash-command'`, neither the `skill` check at `167-168`
nor the `agent` check at `171-172` matches, so execution falls through to the default
branch at `174-175` and returns `<cwd>/AGENTS.md`. This is inconsistent with:

   - The Codex progressive disclosure spec in
   `packages/converters/docs/agent-skills.md:218-223`, which specifies
   `.opencommands/{name}.md` for Codex slash commands; and

   - The install flow in `packages/cli/src/commands/install.ts:1097-1111` and the
   progressive-disclosure logic at `install.ts:1475-1481`, where manifest formats
   including `'codex'` install slash commands to `.opencommands/{packageName}.md`.

   As a result, Codex slash commands produced via `prpm convert --to codex --subtype
   slash-command` are written to `AGENTS.md` instead of the `.opencommands/{name}.md`
   location used by `prpm install` and described in the docs.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** packages/cli/src/commands/convert.ts
**Line:** 174:174
**Comment:**
	*Logic Error: Codex slash commands currently fall through to the generic AGENTS.md path, but the Agent Skills/Codex docs specify that progressive-disclosure slash commands should live at `.opencommands/{name}.md`. This mislocation means converted Codex slash commands won't be written where the editor expects them, so they may not be discovered or invoked correctly as slash commands. Add a dedicated `slash-command` branch in the Codex `getDefaultPath` case to target `.opencommands/{name}.md`.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Feb 24, 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 9 files

Prompt for AI agents (all 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/converters/src/to-codex.ts">

<violation number="1" location="packages/converters/src/to-codex.ts:578">
P2: The new comment says agents use AGENT.md, but the converter still routes all non-skill subtypes (including agents) to AGENTS.md and generateFilename never returns AGENT.md. Either implement agent-specific AGENT.md output or remove the AGENT.md claim to avoid misleading behavior.</violation>
</file>

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

<violation number="1" location="packages/cli/src/commands/convert.ts:224">
P2: `detectFormat` now treats `.agents/agents` as Codex, but the Codex parser only supports SKILL.md (skills) and hard-codes `subtype: 'skill'`. This will mis-detect `.agents/agents/{name}/AGENT.md` files and parse them as skills. Either add an agent parser or avoid classifying `.agents/agents` as `codex` until agent parsing exists.</violation>
</file>

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

Comment thread packages/converters/src/to-codex.ts
Comment thread packages/cli/src/commands/convert.ts Outdated
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 3 files (changes from recent commits).

Prompt for AI agents (all 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/convert.ts">

<violation number="1" location="packages/cli/src/commands/convert.ts:225">
P2: detectFormat now returns "codex-skill"/"codex-agent", but handleConvert only supports "codex". This makes .agents/skills or .agents/agents files fail conversion with "Unsupported source format". Add cases for the new formats or map them back to "codex" before the switch.</violation>
</file>

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

if (filepath.includes('.codex/skills')) {
return 'codex';
if (filepath.includes('.agents/skills')) {
return 'codex-skill';
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Feb 24, 2026

Choose a reason for hiding this comment

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

P2: detectFormat now returns "codex-skill"/"codex-agent", but handleConvert only supports "codex". This makes .agents/skills or .agents/agents files fail conversion with "Unsupported source format". Add cases for the new formats or map them back to "codex" before the switch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/cli/src/commands/convert.ts, line 225:

<comment>detectFormat now returns "codex-skill"/"codex-agent", but handleConvert only supports "codex". This makes .agents/skills or .agents/agents files fail conversion with "Unsupported source format". Add cases for the new formats or map them back to "codex" before the switch.</comment>

<file context>
@@ -221,8 +221,11 @@ function detectFormat(content: string, filepath: string): string | null {
-  if (filepath.includes('.agents/skills') || filepath.includes('.agents/agents')) {
-    return 'codex';
+  if (filepath.includes('.agents/skills')) {
+    return 'codex-skill';
+  }
+  if (filepath.includes('.agents/agents')) {
</file context>
Fix with Cubic

@khaliqgant khaliqgant merged commit 331a889 into main Feb 24, 2026
12 checks passed
@khaliqgant khaliqgant deleted the agent-codex-skills branch February 24, 2026 11:37
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