Skip to content

Support PI_CODING_AGENT_DIR for skills - #14260

Open
tommaso-moro wants to merge 1 commit into
trunkfrom
tommaso-moro-support-pi-agent-directory
Open

Support PI_CODING_AGENT_DIR for skills#14260
tommaso-moro wants to merge 1 commit into
trunkfrom
tommaso-moro-support-pi-agent-directory

Conversation

@tommaso-moro

Copy link
Copy Markdown
Contributor

Fixes #14118

Description

Pi supports relocating its global agent configuration with PI_CODING_AGENT_DIR and discovers global skills under that directory's skills/ subdirectory. gh skill ignored the override and always used ~/.pi/agent/skills for Pi user-scope operations.

This updates the shared agent registry resolver to use $PI_CODING_AGENT_DIR/skills when the variable is set. Because install, list, and update all use this resolver, they now agree on the custom Pi location. When the variable is unset, the existing ~/.pi/agent/skills fallback remains unchanged.

How did you test this change?

Given PI_CODING_AGENT_DIR pointed to this checkout's .github directory, whose skills/ directory contains the code-review skill, when I ran go run ./cmd/gh skill list --agent pi --scope user --json skillName,path, the command reported code-review at .github/skills/code-review instead of looking under ~/.pi/agent/skills.

Key points

The change stays in AgentHost.InstallDir, matching the existing CLAUDE_CONFIG_DIR handling. Project-scope resolution and every other agent remain unchanged.

Notes for reviewers

Start with internal/skills/registry/registry.go, then review the registry and install regression tests. Pi's current environment variable documentation defines PI_CODING_AGENT_DIR as the config-directory override, and its skills documentation places global skills beneath the agent directory. This follows the same approach merged for Claude Code in #13523.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @tommaso-moro will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 25, 2026 15:33

Copilot AI 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.

Pull request overview

Resolves #14118 by honoring Pi’s custom global agent directory for user-scoped skills.

Changes:

  • Resolves Pi skills under $PI_CODING_AGENT_DIR/skills.
  • Preserves the existing default path when unset.
  • Adds registry and installation regression tests.
Show a summary per file
File Description
internal/skills/registry/registry.go Adds Pi environment-based directory resolution.
internal/skills/registry/registry_test.go Tests default and overridden Pi paths.
pkg/cmd/skills/install/install_test.go Verifies installation into the overridden directory.

Review details

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@tommaso-moro
tommaso-moro marked this pull request as ready for review August 25, 2026 15:40
@tommaso-moro
tommaso-moro requested review from a team as code owners August 25, 2026 15:40
@tommaso-moro
tommaso-moro requested a review from sergiou87 August 25, 2026 15:40
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.

gh skill ignores PI_CODING_AGENT_DIR for Pi user-scope skills

2 participants