Skip to content

Commit fc98e07

Browse files
authored
refactor(skills): migrate skills to agent-skills-nix (#137)
* 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`. * chore(skills): add .agents/skills directory for Codex compatibility Add .agents/skills as a target for agent-skills-nix alongside .claude/skills. This directory is used by Codex and other coding agents.
1 parent c53a85d commit fc98e07

File tree

6 files changed

+134
-78
lines changed

6 files changed

+134
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ 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
23+
.agents/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: 57 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,23 @@
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+
agents = {
123+
dest = ".agents/skills";
124+
structure = "symlink-tree";
125+
enable = true;
126+
systems = [ ];
127+
};
128+
};
79129
in
80130
{
81131
formatter = treefmtEval.config.build.wrapper;
@@ -101,19 +151,23 @@
101151
102152
# Initialize git submodules if not already done
103153
if [ -f .gitmodules ] && [ ! -f vendor/stackone-ai-node/package.json ]; then
104-
echo "📦 Initializing git submodules..."
154+
echo "Initializing git submodules..."
105155
git submodule update --init --recursive
106156
fi
107157
108158
# Install Python dependencies only if .venv is missing or uv.lock is newer
109159
if [ ! -d .venv ] || [ uv.lock -nt .venv ]; then
110-
echo "📦 Installing Python dependencies..."
160+
echo "Installing Python dependencies..."
111161
uv sync --all-extras --locked
112162
fi
113163
114164
# Install git hooks
115165
${pre-commit-check.shellHook}
116-
'';
166+
''
167+
+ agentLib.mkShellHook {
168+
inherit pkgs bundle;
169+
targets = localTargets;
170+
};
117171
};
118172
};
119173
};

0 commit comments

Comments
 (0)