Skip to content

gh skill: lock file ignores XDG_STATE_HOME, so it splits from the Vercel skills CLI lock it is meant to share #14895

Open

Agent suggestions

Public preview

Description

@Izzur

Describe the bug

internal/skills/lockfile/lockfile.go says the skill lock file is shared with the Vercel skills CLI on purpose:

// lockVersion must match Vercel's CURRENT_LOCK_VERSION for interop.

But the two tools do not resolve the same path when XDG_STATE_HOME is set:

Tool Lock path when XDG_STATE_HOME is set
Vercel skills (getSkillLockPath in src/skill-lock.ts) $XDG_STATE_HOME/skills/.skill-lock.json
gh skill (lockfilePath()) $HOME/.agents/.skill-lock.json (always)

So with XDG_STATE_HOME set, each tool writes its own lock file and neither sees the other's installs. The shared format does not help because the files are different.

There is also no way to move the gh lock file out of $HOME/.agents (no env var or flag), which matters for users who keep $HOME clean with XDG directories.

Affected version

gh version 2.102.1 (2026-10-21)

Also checked against trunk: lockfilePath() still joins os.UserHomeDir() with .agents/.skill-lock.json.

Steps to reproduce the behavior

  1. export XDG_STATE_HOME=$HOME/.local/state
  2. Install a skill with the Vercel CLI: npx skills add obra/superpowers -g. It is recorded in ~/.local/state/skills/.skill-lock.json.
  3. Install a skill with gh: gh skill install cloudflare/skills wrangler --scope user --agent opencode. It is recorded in ~/.agents/.skill-lock.json.
  4. Each lock file lists only its own tool's skills.

Expected vs actual behavior

Expected: gh skill resolves the lock path the same way as the Vercel CLI, so both tools share one lock file:

func lockfilePath() (string, error) {
	if state := os.Getenv("XDG_STATE_HOME"); state != "" {
		return filepath.Join(state, "skills", lockFile), nil
	}
	home, err := os.UserHomeDir()
	if err != nil {
		return "", err
	}
	return filepath.Join(home, agentsDir, lockFile), nil
}

This keeps the current default for users without XDG_STATE_HOME.

Actual: gh always writes $HOME/.agents/.skill-lock.json, and the two tools keep separate lock files.

Related: #14118 / #14260 added PI_CODING_AGENT_DIR support for the same kind of hardcoded path. vercel-labs/skills#2144 (open) proposes AGENTS_HOME for the same shared store; if it merges, gh would need to follow it too to keep the interop.

Logs

$ echo $XDG_STATE_HOME
/home/<user>/.local/state

$ ls -l ~/.local/state/skills/.skill-lock.json ~/.agents/.skill-lock.json
-rw-r--r-- 1 <user> <user> 456 Oct 30 18:29 /home/<user>/.agents/.skill-lock.json
-rw-r--r-- 1 <user> <user> 677 Aug 21 10:06 /home/<user>/.local/state/skills/.skill-lock.json

The first file has only the skill installed with gh skill install. The second has only the skill installed with npx skills add.

Activity

  1. added
    needs-triage
    on Nov 1, 2026
  2. cli-triage commented on Nov 1, 2026

    @cli-triage

    Thanks for the detailed report! I verified this against current trunk (commit 9490d20): lockfilePath() unconditionally returns $HOME/.agents/.skill-lock.json and never consults XDG_STATE_HOME, so it diverges from the Vercel skills CLI's lock path despite the comment stating the format is meant to interoperate. No duplicate issues found. I'm suggesting bug given the clear, verified code evidence and reproduction steps, and priority-3 since it only affects the subset of users who set XDG_STATE_HOME and use both tools together (workaround: manually point both tools at the same path, or symlink). A maintainer should confirm whether honoring XDG_STATE_HOME (as proposed) is the desired fix, consistent with the PI_CODING_AGENT_DIR precedent mentioned in the issue.

    Generated by Issue Triage (skills-driven) for #14895 · copilot · auto · 26.3 AIC · ⊞ 4.5K · ◷

  3. added
    enhancement
    on Nov 2, 2026
  4. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Contributions welcome label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

  5. removed
    needs-triage
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions