Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Project-local skills should override user-global skills with the same frontmatter name #25324

Description

@rijavec

Summary

Codex currently allows project-local and user-global skills with the same frontmatter name to both appear active in the runtime skill catalog. This causes ambiguous model-visible skill resolution.

For My Work Hub, the project-local skills under:

/Volumes/Samsung_T7/my-work-hub/.agents/skills

must override same-name user-global skills under:

/Users/mlnjtmnsnkitjmg26/.agents/skills

Observed Behavior

A fresh runtime session exposed both copies of these four skills:

  • goal
  • goal-prompt-author
  • goal-mode-preflight
  • goal-closeout-evaluator

The duplicate active paths included both:

/Volumes/Samsung_T7/my-work-hub/.agents/skills/.../SKILL.md

and:

/Users/mlnjtmnsnkitjmg26/.agents/skills/.../SKILL.md

This produced a PRECEDENCE_FAILURE risk because the runtime catalog did not deterministically suppress the lower-priority user-global entries.

Expected Behavior

Codex should deduplicate skills by parsed frontmatter name, not by file path.

Suggested precedence:

  1. active workspace/project .agents/skills
  2. repo-local configured skill roots
  3. user-global ~/.agents/skills
  4. bundled/system/plugin skills

Only the highest-priority skill should be model-visible. Suppressed duplicates may be retained in debug/audit output.

Repro Command

Run from a machine with duplicate project-local and user-global skill names:

codex exec -C /Volumes/Samsung_T7/my-work-hub -s read-only --ephemeral 'Read-only runtime skill catalog precedence check. Do not start /goal. Do not edit files. Inspect only the loaded skills list available to this fresh Codex runtime session. For the exact skill names goal, goal-prompt-author, goal-mode-preflight, and goal-closeout-evaluator, report every active SKILL.md path visible in the runtime catalog. Then print PRECEDENCE_OK only if all four active paths are under /Volumes/Samsung_T7/my-work-hub/.agents/skills and no active path for those four names is under /Users/mlnjtmnsnkitjmg26/.agents/skills. Otherwise print PRECEDENCE_FAILURE.'

Local Workaround

The current local workaround is to disable the four user-global paths explicitly in:

/Users/mlnjtmnsnkitjmg26/.codex/config.toml

[[skills.config]]
path = "/Users/mlnjtmnsnkitjmg26/.agents/skills/goal/SKILL.md"
enabled = false

[[skills.config]]
path = "/Users/mlnjtmnsnkitjmg26/.agents/skills/goal-prompt-author/SKILL.md"
enabled = false

[[skills.config]]
path = "/Users/mlnjtmnsnkitjmg26/.agents/skills/goal-mode-preflight/SKILL.md"
enabled = false

[[skills.config]]
path = "/Users/mlnjtmnsnkitjmg26/.agents/skills/goal-closeout-evaluator/SKILL.md"
enabled = false

After that workaround, the fresh runtime check reports only project-local paths and prints PRECEDENCE_OK.

Supporting Evidence

The project-side diagnostic already implements the intended precedence and passes:

cd /Volumes/Samsung_T7/my-work-hub/app
npm run agent-skills:check-goal-precedence
node --test test/agent-skill-catalog.test.js
npm run syntax:check

Verified again on 2026-05-30:

  • npm run agent-skills:check-goal-precedence resolved all four goal* skills to /Volumes/Samsung_T7/my-work-hub/.agents/skills/... and reported the /Users/mlnjtmnsnkitjmg26/.agents/skills/... duplicates as suppressed.
  • node --test test/agent-skill-catalog.test.js passed.
  • npm run syntax:check passed.
  • Fresh codex exec -C /Volumes/Samsung_T7/my-work-hub -s read-only --ephemeral ... reported only the four project-local active paths and printed PRECEDENCE_OK after applying the local path-filter workaround.

The runtime should implement equivalent precedence in codex_core_skills::loader so projects do not need user-config path filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingskillsIssues related to skills

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions