feat!: turn the skills repo into agent-env (m4rti.agents module) #2

Merged
marti merged 4 commits from feature/agent-env into main 2026-10-13 19:42:03 +02:00
Owner

Summary

The skills repo becomes the agent-env repo: one Home Manager module, m4rti.agents, replaces m4rti-skills and the scattered agent config in the NixOS repo. apps decides which agents exist; every other part is installed into whichever enabled agents can take it.

m4rti.agents = {
  apps = {
    claude.code.enable = true;  claude.desktop.enable = true;
    codex.enable = true;        gpt.desktop.enable = true;
    opencode.cli.enable = true; opencode.desktop.enable = true;
    pi.enable = true;           t3code.enable = true;
  };
  skills.enable = true;     rules.enable = true;
  mcp.enable = true;        plugins.enable = true;
  subagents.enable = true;
  providers.cumsek = { url = "https://ai.cumsek.com"; keyFile = osConfig.sops.secrets."...".path; };
};
 nix/
-├── hm-module.nix        # m4rti-skills
+├── module/
+│   ├── apps.nix         # the agents and their default settings
+│   ├── skills.nix       # skills/ -> every agent
+│   ├── rules.nix        # rules/ -> rulesDir / AGENTS.md
+│   ├── mcp.nix          # one server list, secrets read from files at startup
+│   ├── plugins.nix      # ponytail, graft, open-code-review, zeit, agent-browser
+│   ├── subagents.nix    # subagents/ -> each agent's format
+│   └── providers.nix    # LiteLLM gateways for opencode and pi
+├── subagents.nix        # frontmatter parser + per-agent renderers
 └── ponytail.nix
+rules/                   # code-style, subagents (new)
+subagents/               # 10 agents: 5 rewritten, 5 new
+providers/               # gateway model discovery scripts

How each agent reads a secret (env or headers value { file = ...; }) at startup:

Agent stdio env HTTP headers
Claude Code wrapper script headersHelper
codex wrapper script env_http_headers + codex wrapper
opencode {file:...} {file:...}
pi !cat !cat

Evidence

  • Before: nix flake check covered skill frontmatter and lint only; the module was never evaluated.
    After: new subagents check (parses and renders all 10) and module check (full Home Manager evaluation, every part on, secret-backed stdio + HTTP MCP servers) -> all checks passed!
  • Built and inspected the generated pieces: the Claude headersHelper emits {"X-Api-Key": "<file contents>"}; the codex wrapper contains export MCP_HTTP_SECRET_X_API_KEY="$(cat /run/secrets/key)"; read-only subagents render with sandbox_mode = "read-only" (codex), disallowedTools (Claude), tools: {...: false} (opencode), a reduced allowlist (pi).
  • Not done: a real switch on a host, or launching each agent against the generated config.

Merge Danger

Door: two-way

Nothing consumes this until the NixOS config is migrated; reverting the merge restores m4rti-skills.

Blast Radius: consumers

m4rti-skills.* is removed, so the NixOS config fails to evaluate on the next nix flake update skills until it moves to m4rti.agents. When migrating: drop the CODEX_HOME session variable (it would hide the Home Manager codex config), drop the separate zeit module import (this module imports it), and note Claude Code now defaults to the llm-agents build on every host.

🤖 Generated with Claude Code

## Summary The skills repo becomes the agent-env repo: one Home Manager module, `m4rti.agents`, replaces `m4rti-skills` and the scattered agent config in the NixOS repo. `apps` decides which agents exist; every other part is installed into whichever enabled agents can take it. ```nix m4rti.agents = { apps = { claude.code.enable = true; claude.desktop.enable = true; codex.enable = true; gpt.desktop.enable = true; opencode.cli.enable = true; opencode.desktop.enable = true; pi.enable = true; t3code.enable = true; }; skills.enable = true; rules.enable = true; mcp.enable = true; plugins.enable = true; subagents.enable = true; providers.cumsek = { url = "https://ai.cumsek.com"; keyFile = osConfig.sops.secrets."...".path; }; }; ``` ```diff nix/ -├── hm-module.nix # m4rti-skills +├── module/ +│ ├── apps.nix # the agents and their default settings +│ ├── skills.nix # skills/ -> every agent +│ ├── rules.nix # rules/ -> rulesDir / AGENTS.md +│ ├── mcp.nix # one server list, secrets read from files at startup +│ ├── plugins.nix # ponytail, graft, open-code-review, zeit, agent-browser +│ ├── subagents.nix # subagents/ -> each agent's format +│ └── providers.nix # LiteLLM gateways for opencode and pi +├── subagents.nix # frontmatter parser + per-agent renderers └── ponytail.nix +rules/ # code-style, subagents (new) +subagents/ # 10 agents: 5 rewritten, 5 new +providers/ # gateway model discovery scripts ``` How each agent reads a secret (`env` or `headers` value `{ file = ...; }`) at startup: | Agent | stdio `env` | HTTP `headers` | | --- | --- | --- | | Claude Code | wrapper script | `headersHelper` | | codex | wrapper script | `env_http_headers` + codex wrapper | | opencode | `{file:...}` | `{file:...}` | | pi | `!cat` | `!cat` | ## Evidence - **Before:** `nix flake check` covered skill frontmatter and lint only; the module was never evaluated. **After:** new `subagents` check (parses and renders all 10) and `module` check (full Home Manager evaluation, every part on, secret-backed stdio + HTTP MCP servers) -> `all checks passed!` - Built and inspected the generated pieces: the Claude `headersHelper` emits `{"X-Api-Key": "<file contents>"}`; the codex wrapper contains `export MCP_HTTP_SECRET_X_API_KEY="$(cat /run/secrets/key)"`; read-only subagents render with `sandbox_mode = "read-only"` (codex), `disallowedTools` (Claude), `tools: {...: false}` (opencode), a reduced allowlist (pi). - Not done: a real switch on a host, or launching each agent against the generated config. ## Merge Danger **Door:** two-way Nothing consumes this until the NixOS config is migrated; reverting the merge restores `m4rti-skills`. **Blast Radius:** consumers `m4rti-skills.*` is removed, so the NixOS config fails to evaluate on the next `nix flake update skills` until it moves to `m4rti.agents`. When migrating: drop the `CODEX_HOME` session variable (it would hide the Home Manager codex config), drop the separate zeit module import (this module imports it), and note Claude Code now defaults to the llm-agents build on every host. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Rewrites the five opencode-only subagents from the NixOS config into a
single-line frontmatter format (name, description, deny, mode) that
nix/subagents.nix parses and renders for Claude Code, opencode, codex and
pi. Adds explorer, code-reviewer, test-writer, debugger and docs-writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moved from the NixOS config. The time-tracking rule is left behind since
the zeit plugin tracks turns itself; a new rule tells agents to delegate
long or wide tasks to subagents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One Home Manager module for the whole agent environment: apps (Claude
Code and Desktop, codex, ChatGPT desktop, opencode CLI and desktop, pi,
T3 Code), skills, rules, MCP servers with file-backed secrets, plugins
(ponytail, graft, open-code-review, zeit, agent-browser), subagents and
model gateways. Adds a check that evaluates a full configuration.

BREAKING CHANGE: `m4rti-skills.*` is gone; use `m4rti.agents.*`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marti merged commit 3ca27fd4d3 into main 2026-10-13 19:42:03 +02:00
marti deleted branch feature/agent-env 2026-10-13 19:42:05 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marti/agent-env!2
No description provided.