Skip to content

Commit ac5f4af

Browse files
committed
refactor(skills): migrate skills to agent-skills-nix
- Remove local skills directory from git tracking - Add agent-skills-nix and StackOneHQ/skills as flake inputs - Configure devShell to auto-install skills via symlink-tree - Update .gitignore to exclude Nix-managed skill directories - Update CLAUDE.md to document the new skills management approach Skills are now sourced from StackOneHQ/skills repository and automatically installed when entering `nix develop`.
1 parent c53a85d commit ac5f4af

File tree

6 files changed

+127
-78
lines changed

6 files changed

+127
-78
lines changed

.claude/skills/just-commands/SKILL.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.claude/skills/release-please/SKILL.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ build/
1717

1818
# Git hooks (managed by Nix)
1919
.pre-commit-config.yaml
20+
21+
# Agent skills (managed by Nix via agent-skills-nix)
22+
.claude/skills

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Rules and Skills Structure
66

77
- **Rules** (`.claude/rules/`): Automatically loaded based on file paths. Source of truth for project conventions.
8-
- **Skills** (`.claude/skills/`): Manually invoked for specific integrations.
8+
- **Skills** (`.claude/skills/`): Managed by Nix via [agent-skills-nix](https://github.com/Kyure-A/agent-skills-nix). Skills are sourced from [StackOneHQ/skills](https://github.com/StackOneHQ/skills) and installed automatically when entering `nix develop`.
99
- **Cursor rules** (`.cursor/rules/`): Symlinks to `.claude/rules/` for consistency.
1010

1111
## Available Skills

flake.lock

Lines changed: 72 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,47 @@
66
flake-parts.url = "github:hercules-ci/flake-parts";
77
git-hooks.url = "github:cachix/git-hooks.nix";
88
treefmt-nix.url = "github:numtide/treefmt-nix";
9+
10+
# Agent skills management
11+
agent-skills.url = "github:Kyure-A/agent-skills-nix";
12+
agent-skills.inputs.nixpkgs.follows = "nixpkgs";
13+
14+
# StackOne skills repository (non-flake)
15+
stackone-skills.url = "github:StackOneHQ/skills";
16+
stackone-skills.flake = false;
917
};
1018

1119
outputs =
1220
inputs@{
1321
flake-parts,
1422
git-hooks,
1523
treefmt-nix,
24+
agent-skills,
25+
stackone-skills,
1626
...
1727
}:
28+
let
29+
# Agent skills configuration (outside flake-parts for access to inputs)
30+
agentLib = agent-skills.lib.agent-skills;
31+
sources = {
32+
stackone = {
33+
path = stackone-skills;
34+
subdir = ".";
35+
};
36+
};
37+
catalog = agentLib.discoverCatalog sources;
38+
allowlist = agentLib.allowlistFor {
39+
inherit catalog sources;
40+
enable = [
41+
"just-commands"
42+
"release-please"
43+
];
44+
};
45+
selection = agentLib.selectSkills {
46+
inherit catalog allowlist sources;
47+
skills = { };
48+
};
49+
in
1850
flake-parts.lib.mkFlake { inherit inputs; } {
1951
systems = [
2052
"x86_64-linux"
@@ -34,6 +66,7 @@
3466
};
3567
settings.formatter.oxfmt = {
3668
command = "${pkgs.oxfmt}/bin/oxfmt";
69+
options = [ "--no-error-on-unmatched-pattern" ];
3770
includes = [
3871
"*.md"
3972
"*.yml"
@@ -76,6 +109,17 @@
76109
};
77110
};
78111
};
112+
113+
# Agent skills bundle and targets
114+
bundle = agentLib.mkBundle { inherit pkgs selection; };
115+
localTargets = {
116+
claude = {
117+
dest = ".claude/skills";
118+
structure = "symlink-tree";
119+
enable = true;
120+
systems = [ ];
121+
};
122+
};
79123
in
80124
{
81125
formatter = treefmtEval.config.build.wrapper;
@@ -101,19 +145,23 @@
101145
102146
# Initialize git submodules if not already done
103147
if [ -f .gitmodules ] && [ ! -f vendor/stackone-ai-node/package.json ]; then
104-
echo "📦 Initializing git submodules..."
148+
echo "Initializing git submodules..."
105149
git submodule update --init --recursive
106150
fi
107151
108152
# Install Python dependencies only if .venv is missing or uv.lock is newer
109153
if [ ! -d .venv ] || [ uv.lock -nt .venv ]; then
110-
echo "📦 Installing Python dependencies..."
154+
echo "Installing Python dependencies..."
111155
uv sync --all-extras --locked
112156
fi
113157
114158
# Install git hooks
115159
${pre-commit-check.shellHook}
116-
'';
160+
''
161+
+ agentLib.mkShellHook {
162+
inherit pkgs bundle;
163+
targets = localTargets;
164+
};
117165
};
118166
};
119167
};

0 commit comments

Comments
 (0)