skills/flake.nix
dan 5fea49b7c0 feat(tufte-press): evolve skill to complete workflow with JSON generation and build automation
- Transform tufte-press from reference guide to conversation-aware generator
- Add JSON generation from conversation context following strict schema
- Create build automation scripts with Nix environment handling
- Integrate CUPS printing with duplex support
- Add comprehensive workflow documentation

Scripts added:
- skills/tufte-press/scripts/generate-and-build.sh (242 lines)
- skills/tufte-press/scripts/build-card.sh (23 lines)

Documentation:
- Updated SKILL.md with complete workflow instructions (370 lines)
- Updated README.md with usage examples (340 lines)
- Created SKILL-DEVELOPMENT-STRATEGY-tufte-press.md (450 lines)
- Added worklog: 2025-11-10-tufte-press-skill-evolution.org

Features:
- Agent generates valid JSON from conversation
- Schema validation before build (catches errors early)
- Automatic Nix shell entry for dependencies
- PDF build via tufte-press toolchain
- Optional print with duplex support
- Self-contained margin notes enforced
- Complete end-to-end testing

Workflow: Conversation → JSON → Validate → Build → Print

Related: niri-window-capture, screenshot-latest, worklog skills
2025-11-10 15:03:44 -08:00

103 lines
3.2 KiB
Nix

{
description = "AI agent skills for Claude Code and OpenCode";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
# Home Manager module for deploying skills
skillsModule = import ./modules/ai-skills.nix;
# List of available skills
availableSkills = [
"niri-window-capture"
"screenshot-latest"
"tufte-press"
"worklog"
"update-spec-kit"
];
in
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
in
{
# Development shell for working on skills
devShells.default = pkgs.mkShell {
name = "ai-skills";
packages = with pkgs; [
bash
shellcheck
jq
];
shellHook = ''
echo "🤖 AI Skills development environment"
echo "Available skills: ${builtins.concatStringsSep ", " availableSkills}"
echo ""
echo "Commands:"
echo " ./bin/deploy-skill.sh <name> - Copy skill to dotfiles"
echo " bash -n skills/*/scripts/*.sh - Validate all scripts"
'';
};
# Package individual skills for deployment
packages =
let
# Filter to only skills that exist
existingSkills = builtins.filter
(name: builtins.pathExists (./skills + "/${name}"))
availableSkills;
individualSkills = builtins.listToAttrs (
map (skillName: {
name = skillName;
value = pkgs.stdenv.mkDerivation {
name = "ai-skill-${skillName}";
src = ./skills + "/${skillName}";
installPhase = ''
mkdir -p $out
cp -r . $out/
# Make scripts executable
if [ -d $out/scripts ]; then
chmod +x $out/scripts/*.sh 2>/dev/null || true
fi
'';
};
}) existingSkills
);
in
individualSkills // {
# All skills as a combined package
all-skills = pkgs.symlinkJoin {
name = "all-ai-skills";
paths = builtins.attrValues individualSkills;
};
};
})
// {
# Export the Home Manager module
homeManagerModules.ai-skills = skillsModule;
# Also export as nixosModules for compatibility
nixosModules.ai-skills = skillsModule;
# Export skills paths for direct use
lib = {
inherit availableSkills;
# Helper to get skill path
getSkillPath = skillName: ./skills/${skillName};
# Helper to get all skill paths
getAllSkillPaths = map (name: ./skills/${name}) availableSkills;
};
};
}