Skip to content

Add project-scope skill installation - #481

Open
michael-webster wants to merge 1 commit into
mainfrom
dm-claude/skill-project-scope
Open

Add project-scope skill installation#481
michael-webster wants to merge 1 commit into
mainfrom
dm-claude/skill-project-scope

Conversation

@michael-webster

Copy link
Copy Markdown
Contributor

Summary

  • Introduces a Scope enum (ScopeUser, ScopeProject) to the internal/skills package — all callers now pass a scope explicitly
  • User scope (default): existing behavior unchanged — installs into ~/.claude/skills and ~/.agents/skills, skipping agents whose config dirs don't exist
  • Project scope: installs into .claude/skills and .agents/skills relative to the current working directory, creating directories as needed (no pre-existing agent config required)
  • Adds --scope user|project flag to both skill install and skill list (default: user)

Reproduction commands

# User scope (existing behavior, unchanged)
chunk skill install
chunk skill install --scope user

# Project scope — installs into ./.claude/skills and ./.agents/skills
chunk skill install --scope project

# List with project scope (agents always shown as available)
chunk skill list --scope project

# Invalid scope returns a clear error
chunk skill install --scope global
# → error: invalid scope: must be 'user' or 'project'

Test plan

  • All existing acceptance tests pass (user scope unchanged)
  • TestSkillsInstallProjectScope — installs to project dir, leaves user home untouched
  • TestSkillsInstallProjectScopeUpToDate — idempotent on second run
  • TestSkillsInstallProjectScopeNotIsolatedFromUserScope — user and project installs coexist
  • TestSkillsListProjectScope — list shows missing before install, current after
  • TestSkillsInstallInvalidScope — unknown scope returns non-zero exit + clear error
  • Unit tests for ScopeProject in internal/skills/skills_test.go

🤖 Generated with Claude Code

Introduces a Scope enum (ScopeUser, ScopeProject) to the skills package.
User scope preserves existing behavior — installs into ~/.claude and ~/.agents,
skipping agents whose config dirs don't exist. Project scope installs into
.claude/skills and .agents/skills relative to the current working directory,
creating directories as needed without requiring pre-existing agent config dirs.

The --scope flag (default: user) is added to both `skill install` and `skill list`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant