/ 目录 / 演练场 / agent-skills-nix
● 社区 Kyure-A ⚡ 即开即用

agent-skills-nix

作者 Kyure-A · Kyure-A/agent-skills-nix

Manage your Claude Agent Skills declaratively with Nix — reproducible skill sets across machines.

A Nix flake that lets you declare your Agent Skills in Nix config and have them materialized into ~/.claude/skills/ (or any target). Useful if you already live in NixOS or Home Manager and want your skill setup to be as reproducible as the rest of your dotfiles.

为什么要用

核心特性

实时演示

实际使用效果

agent-skills-nix-skill.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "agent-skills-nix-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Kyure-A/agent-skills-nix",
        "~/.claude/skills/agent-skills-nix"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "agent-skills-nix-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Kyure-A/agent-skills-nix",
        "~/.claude/skills/agent-skills-nix"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "agent-skills-nix-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Kyure-A/agent-skills-nix",
        "~/.claude/skills/agent-skills-nix"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "agent-skills-nix-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Kyure-A/agent-skills-nix",
        "~/.claude/skills/agent-skills-nix"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "agent-skills-nix-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Kyure-A/agent-skills-nix",
        "~/.claude/skills/agent-skills-nix"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "agent-skills-nix-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/Kyure-A/agent-skills-nix",
          "~/.claude/skills/agent-skills-nix"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add agent-skills-nix-skill -- git clone https://github.com/Kyure-A/agent-skills-nix ~/.claude/skills/agent-skills-nix

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: agent-skills-nix

How to declare your Claude skills in a Nix flake

👤 NixOS / Home Manager users ⏱ ~25 min intermediate

何时使用: You want your Claude skill set tracked the same way as your shells, editors, and services.

前置条件
  • Nix with flakes enabled — echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
  • The flake added as an input — flake input agent-skills-nix.url = "github:Kyure-A/agent-skills-nix";
步骤
  1. Add the input
    Add agent-skills-nix to my flake inputs and wire it into Home Manager.✓ 已复制
    → flake.nix updated with the input + module import
  2. List the skills I want
    Declare the skills I use: linear-claude-skill, symfony-ux-skills, mck-ppt-design-skill. Pin to current main.✓ 已复制
    → A skills = { ... }; block with pinned revs
  3. Build and switch
    Run home-manager switch and verify ~/.claude/skills/ is populated.✓ 已复制
    → All skills present as symlinked directories

结果: Reproducible skill set managed by Nix — wipe your dotfiles and get the same setup back in one command.

注意事项
  • Upstream skill changes break your workflow — Pin to a specific rev, only bump on purpose
搭配使用: filesystem

Sync the same skill set across laptop and workstation

👤 Multi-machine developers ⏱ ~15 min intermediate

何时使用: You switch between a laptop and a desktop and keep forgetting to clone the same skills on both.

步骤
  1. Add to your shared HM module
    Move the skills declaration into my shared home-manager module so both hosts import it.✓ 已复制
    → Single source of truth, two hosts consuming it
  2. Switch both hosts
    Build and switch on both machines.✓ 已复制
    → Matching ~/.claude/skills/ on both

结果: Both machines carry the same skill bundle automatically.

注意事项
  • Forgetting to commit and push before switching on the second machine — Use a self-flake with autoCommit or a shared git repo

组合

与其他 MCP 搭配,撬动十倍杠杆

agent-skills-nix-skill + filesystem

Claude reads your flake and suggests skills to add/remove

Read my flake.nix, check which of my installed skills haven't been used in 30 days, and suggest removals.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
skill-declaration set of { name, url, rev } During home-manager switch / nixos-rebuild nix build runtime
lock-management flake.lock When you want deterministic upgrades 0

成本与限制

运行它的成本

API 配额
none
每次调用 Token 数
minimal — Nix declarations are short
费用
free
提示
Keep your skill set small — every skill costs context tokens at load time

安全

权限、密钥、影响范围

凭据存储: none
数据出站: fetches only the skill repos you declare

故障排查

常见错误与修复

Flake doesn't evaluate

Check input url format and run nix flake check for specific errors.

验证: nix flake check
Skills dir empty after switch

Make sure the module is actually imported in your HM config, and home.activation is running.

验证: ls ~/.claude/skills/
Pinned rev 404

The upstream repo may have rewritten history — update the rev.

替代方案

agent-skills-nix 对比其他方案

替代方案何时用它替代权衡
manual git cloneYou're not on Nix and don't want to beNo reproducibility; easy drift
agent-skills-cli-skillYou want a CLI installer without NixImperative rather than declarative

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills