skills/NIX-FLAKE-README.md
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

3.2 KiB

AI Skills Nix Flake

This repository now provides a Nix flake for declarative deployment of AI agent skills to Claude Code and OpenCode.

Quick Start

# In your flake.nix
{
  inputs.ai-skills.url = "path:/home/dan/proj/skills";
  # or when published: "github:yourusername/skills";
  
  outputs = { ai-skills, ... }: {
    homeConfigurations.youruser = {
      imports = [ ai-skills.homeManagerModules.ai-skills ];
      
      services.ai-skills = {
        enable = true;
        skillsPath = "${ai-skills}/skills";
        skills = [ "worklog" "screenshot-latest" "tufte-press" ];
      };
    };
  };
}

What This Provides

Home Manager Module

Declaratively deploy skills to ~/.claude/skills/ and ~/.config/opencode/skills/ with:

  • Automatic opencode-skills plugin installation
  • Per-skill configuration
  • Support for both agents (Claude Code + OpenCode)

Packages

Individual skill packages for custom deployment:

  • packages.x86_64-linux.worklog
  • packages.x86_64-linux.screenshot-latest
  • packages.x86_64-linux.tufte-press
  • packages.x86_64-linux.update-spec-kit
  • packages.x86_64-linux.all-skills (combined)

Development Shell

nix develop
# Provides: bash, shellcheck, jq
# Plus validation helpers

Available Skills

Current skills (only existing ones are packaged):

  • worklog - Create org-mode worklogs
  • update-spec-kit - Update spec-kit ecosystem
  • ⏸️ screenshot-latest - Find latest screenshots (not yet in git)
  • ⏸️ tufte-press - Generate study card JSON (not yet in git)
  • ⏸️ niri-window-capture - Window screenshots (not yet in git)

Skills marked ⏸️ are developed but not committed to git yet.

Files

  • flake.nix - Main flake definition
  • modules/ai-skills.nix - Home Manager module
  • NIX-FLAKE-USAGE.md - Complete usage documentation
  • skills/ - Individual skill directories

Usage

See NIX-FLAKE-USAGE.md for:

  • Detailed configuration options
  • Integration examples
  • Troubleshooting guide
  • Advanced usage patterns

Testing

# Check flake
nix flake check

# Show outputs
nix flake show

# Enter dev shell
nix develop

# Build a skill
nix build .#worklog

Example: Using in dotfiles

# ~/proj/dotfiles/flake.nix
{
  inputs.ai-skills.url = "path:/home/dan/proj/skills";
  
  outputs = { ai-skills, ... }: {
    homeConfigurations.dan = {
      imports = [ ai-skills.homeManagerModules.ai-skills ];
      
      services.ai-skills = {
        enable = true;
        skillsPath = "${ai-skills}/skills";
        skills = [ "worklog" ];
        enableClaudeCode = true;
        enableOpenCode = true;
        installOpencodePlugin = true;
      };
    };
  };
}

Then:

cd ~/proj/dotfiles
home-manager switch --flake .#dan

Status

  • Flake structure created
  • Home Manager module implemented
  • Package outputs working
  • Documentation complete
  • ⏸️ Not yet tested in consuming repository
  • ⏸️ opencode-skills plugin installation needs testing

Next Steps

  1. Test module in dotfiles repo
  2. Verify opencode-skills plugin installs correctly
  3. Add remaining skills to git
  4. Publish to GitHub for remote access