Skip to content
alto-dev-guide logo

ALTO Development Guide

alto-dev-guide

Use when developing ALTO itself - editing devenv.nix, hooks/*.py, agents/*.md, or checking Claude Code hook/agent syntax. Reference guide with documentation URLs and patterns.

SKILL.md

Full skill instructions

ALTO Development Guide

Reference for developing ALTO. Use URLs for authoritative docs, summaries for quick reference.


Devenv MCP (always available)

ALTO configures the devenv MCP server automatically. Use it for:

  • Package search - Find packages and their configuration options
  • Config understanding - Understand devenv syntax and patterns
  • Config generation - Generate valid devenv configurations

The MCP is available as devenv server. Use MCP tools to query it when you need:

  • What packages are available for a language/​tool
  • How to configure a specific service
  • Valid options for a devenv setting

Documentation Sources

Devenv (authoritative)

Claude Code (authoritative)

Community resources


Devenv Quick Reference

Scripts

scripts.<name> = {
  exec = ''
    echo "script body"
  '';
  description = "Shown in devenv info";
};
  • Available as commands in shell
  • Use ${variable} for nix interpolation
  • Use ''$ to escape $ in bash

Tasks

tasks."namespace:name" = {
  exec = ''
    echo "task body"
  '';
  before = [ "devenv:enterShell" ];  # Run before shell entry
  # after = [ "other:task" ];        # Run after another task
};
  • Run automatically on shell entry (if before includes enterShell)
  • Good for setup/​deployment that should happen every time

Native Imports (not flakes)

# devenv.yaml
inputs:
  alto:
    url: github:gonzaloetjo/​alto
    flake: false  # Critical: native import mode

imports:
  - alto  # References the input name
  • flake: false = use devenv's native import system
  • ALTO activates on import, configure with alto.orchestrator

Claude Code Quick Reference

Hook Types

TypeWhenCan BlockReceives
SessionStartSession beginsNo{session_id, resume}
PreToolUseBefore tool runsYes{tool, input, ...}
PostToolUseAfter tool runsNo{tool, result, ...}
StopSession endsNo{session_id, ...}
SubagentStopAgent completesNo{agent, ...}
NotificationClaude notifiesNo{message, ...}
PermissionRequestPermission askedYes{tool, ...}

Hook Configuration (devenv)

claude.code.hooks.<name> = {
  hookType = "PostToolUse";  # Required
  matcher = "Bash";          # Tool name, or "*" for all
  command = "python3 \"$CLAUDE_PROJECT_DIR\"/​.claude/​hooks/​script.py";
};

Hook Script Pattern

#!/​usr/​bin/​env python3
import json, sys, os
from pathlib import Path

def main():
    hook_data = json.load(sys.stdin)
    project_dir = Path(os.environ.get("CLAUDE_PROJECT_DIR", "."))

    # Do work...

    # For SessionStart: print context for Claude to see
    print("Context message")

if __name__ == "__main__":
    main()

Agents (devenv)

claude.code.agents.<name> = {
  description = "Shown when listing agents";
  tools = [ "Read" "Edit" "Bash" "Grep" "Glob" "WebFetch" ];
  model = "opus";  # or "sonnet", "haiku"
  prompt = ''
    Agent system prompt here.
    This defines behavior, not user request.
  '';
};

Available Tools

Read, Write, Edit, Bash, Grep, Glob, LS, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion

Skills

Place SKILL.md in .claude/​skills/<name>/

  • Invoked with /<skill-name> or automatically by context
  • Content is instructions for Claude

MCP Servers

claude.code.mcpServers.<name> = {
  type = "stdio";  # or "http"
  command = "devenv";
  args = [ "mcp" ];
  env = { DEVENV_ROOT = "."; };
};

Permissions

claude.code.permissions = {
  Bash = {
    allow = [ "git:*" "npm:*" ];
    deny = [ "rm -rf:*" "sudo:*" ];
  };
  Read = {
    deny = [ ".env" "secrets/​**" ];
  };
};

ALTO File Reference

WhatWherePurpose
Module optionsdevenv.nix -> options.altoAll configurable settings
Scriptsdevenv.nix -> scripts.*Shell commands
Deploy taskdevenv.nix -> tasks."alto:deploy"File deployment
Agent configsdevenv.nix -> claude.code.agentsAgent wiring
Hook configsdevenv.nix -> claude.code.hooksHook wiring
Agent promptsagents/​*.mdAgent behavior
Hook logichooks/​*.pyHook implementation
Skillsskills/​*/​SKILL.mdSkill content
Setup orchestratortemplates/​CLAUDE.md.setupHuman-interactive mode
Build orchestratortemplates/​CLAUDE.md.buildAutonomous mode
Dev orchestratortemplates/​CLAUDE.md.devALTO development mode
User templatetemplates/​default/nix flake init output
ArchitectureARCHITECTURE.mdDesign docs

Testing Workflows

Fresh install

mkdir /​tmp/​test && cd /​tmp/​test
nix --extra-experimental-features 'nix-command flakes' flake init -t github:gonzaloetjo/​alto --refresh
devenv shell
# Check: ls .claude/ runs/ CLAUDE.md

Local development

# test project's devenv.yaml - use local path
imports:
  - /​absolute/​path/​to/​alto

Then devenv shell to rebuild with local changes.

Verify deployment

ls -la .claude/​agents/     # Symlinks to nix store
ls -la .claude/​hooks/      # Python files
cat runs/​state.json        # ALTO state
cat .claude/​settings.json  # Permissions + hooks

Common Issues

ProblemSolution
jq escaping in nixUse echo "$(jq ...)" not complex jq strings
Changes not appliedRun devenv shell again
Remote changes not appliedUse --refresh flag
Hook not runningCheck settings.json, verify hookType matches
Files read-onlyExpected - nix store symlinks

Nix String Escaping ('' strings)

  • ''$ -> $ (escape dollar)
  • ''' -> '' (escape quotes)
  • \n -> literal \n (not newline)
  • Use actual newlines for line breaks

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View