Skip to content

feat(skills): add per-profile skills management#711

Draft
cooco119 wants to merge 1 commit intokaitranntt:devfrom
cooco119:feat/per-profile-skills
Draft

feat(skills): add per-profile skills management#711
cooco119 wants to merge 1 commit intokaitranntt:devfrom
cooco119:feat/per-profile-skills

Conversation

@cooco119
Copy link
Copy Markdown

@cooco119 cooco119 commented Mar 8, 2026

Summary

  • Add skills_mode (shared | isolated) to account config, enabling per-profile skill isolation
  • Implement syncSkills() in SharedManager that converts the instance skills/ symlink to a real directory with individually symlinked shared skills
  • Add ccs skills <profile> <command> CLI that wraps npx skills with CLAUDE_CONFIG_DIR targeting the correct instance directory
  • Auto-isolate on ccs skills <profile> add, sync shared skills during ccs sync

How it works

When skills_mode: isolated is set for an account profile:

  1. The instance's skills/ symlink (→ shared → ~/.claude/skills) is replaced with a real directory
  2. Each shared skill from ~/.claude/skills/ is individually symlinked into the instance directory
  3. npx skills add -g runs with CLAUDE_CONFIG_DIR pointing to the instance, so new skills install directly into the isolated directory
  4. Profile-specific skills coexist with shared skill symlinks

Changed files

File Change
src/auth/account-context.ts AccountSkillsMode type, skillsMode in policy/metadata
src/config/unified-config-types.ts skills_mode on AccountConfig
src/types/config.ts skills_mode on ProfileMetadata
src/management/shared-manager.ts syncSkills() + syncSharedSkillsToIsolated()
src/management/instance-manager.ts Call syncSkills() in ensureInstance()
src/commands/sync-command.ts Sync isolated skills during ccs sync
src/commands/skills-command.ts New — CLI wrapping npx skills
src/ccs.ts Route skills subcommand
src/commands/help-command.ts Per-Profile Skills help section
tests/unit/skills-sync.test.ts New — 7 tests for syncSkills

Test plan

  • bun run format — clean
  • bun run typecheck — no errors
  • bun run lint:fix — clean
  • bun run validate — exit 0 (pre-existing failures unrelated)
  • bun run validate:ci-parity — passed (pre-push hook)
  • 7 new tests pass (skills-sync.test.ts)
  • 34 related tests pass (account-context, shared-context-policy, shared-manager, sync-command)
  • Manual: ccs skills personal isolateccs skills personal add <pkg>ccs skills personal list
  • Manual: ccs skills personal share restores shared mode
  • Manual: ccs sync preserves isolated skills

🤖 Generated with Claude Code

Enable per-profile skill isolation by leveraging CLAUDE_CONFIG_DIR.
When skills_mode is set to 'isolated', the instance's skills symlink is
replaced with a real directory where shared skills are individually
symlinked and profile-specific skills can coexist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cooco119 cooco119 marked this pull request as draft March 8, 2026 22:43
@kaitranntt kaitranntt added enhancement New feature or request area:cli-runtime CLI runtime commands, execution flow, and core target behavior labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli-runtime CLI runtime commands, execution flow, and core target behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants