Skip to content

Scope skill completion to the active agent and include marketplace-installed skills #662

@NightWatcher314

Description

@NightWatcher314

Problem

HAPI's $skill completion currently appears to aggregate skills from multiple agent ecosystems (for example ~/.agents/skills, ~/.claude/skills, and ~/.codex/skills) regardless of which agent/flavor is active.

This can surface skills that the current agent cannot actually use. Example: in a Codex session, HAPI suggests $davinci-resolve-scripting because it exists under ~/.claude/skills/davinci-resolve-scripting, but the active Codex environment does not list that skill in its available skills.

This makes completion misleading: selecting a suggested skill can produce a prompt reference that the target agent will not recognize.

Expected behavior

Skill completion should be scoped to the active agent/flavor:

  • Claude Code sessions should only suggest skills that Claude Code can actually load/use.
  • Codex sessions should only suggest skills that Codex can actually load/use.
  • Shared/project skills should still be included when they are valid for that agent.

In other words, the completion list should reflect the effective skill set of the current agent, not every skill directory HAPI knows about.

Additional request: marketplace-installed skills

Skills installed through a marketplace should also be discoverable by the corresponding agent integration:

  • If a skill is installed for Codex through the marketplace, Codex sessions should include it in $ completion.
  • If a skill is installed for Claude Code through the marketplace, Claude sessions should include it in $ completion.

The important point is that marketplace-installed skills should be included in the same agent-scoped resolution path, rather than being either invisible or globally mixed into every agent's suggestions.

Possible implementation direction

Add agent/flavor-aware skill root resolution, e.g.:

  • Common/project roots, where applicable:
    • <cwd>/.agents/skills
    • repo ancestor .agents/skills
  • Claude-specific roots:
    • ~/.claude/skills
    • marketplace roots used by Claude Code
  • Codex-specific roots:
    • ~/.codex/skills
    • /etc/codex/skills
    • Codex system skills under ~/.codex/skills/.system
    • marketplace roots used by Codex
  • Generic user roots:
    • ~/.agents/skills, if intended to be shared across agents

Then have /sessions/:id/skills pass the current session flavor/agent into the skill listing RPC, so the CLI lists only roots applicable to that session.

Why this matters

This avoids false-positive completions and makes $skill suggestions trustworthy: every suggested skill should be usable by the current active agent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions