Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .agents/skills/managing-nono-profiles/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: managing-nono-profiles
description: Manage nono sandbox profiles and their shell launch wrappers in this dotfiles repo. Use when editing private_dot_config/nono/profiles, nono profile schemas, dot_agents/shell wrappers, SSH signing access for sandboxed agents, or adding/renaming agent-specific nono profiles.
description: Manage nono sandbox profiles and their shell launch wrappers in this dotfiles repo. Use when editing private_dot_config/nono/profiles, nono profile schemas, dot_agents/shell wrappers, employer-specific work-* profiles and launchers under private_dot_work, SSH signing access for sandboxed agents, or adding/renaming agent-specific nono profiles.
---

# Managing Nono Profiles
Expand All @@ -19,8 +19,12 @@ Edit chezmoi source files, not applied targets:
| Profile schema | `private_dot_config/nono/schemas/nono-profile.schema.json` | `~/.config/nono/schemas/nono-profile.schema.json` |
| Agent shell wrappers | `dot_agents/shell/` | `~/.agents/shell/` |
| Wrapper sourcing | `dot_zshrc.tmpl` | `~/.zshrc` |
| Employer profiles | `private_dot_config/nono/profiles/work-{work_name}-*.jsonc` | `~/.config/nono/profiles/work-{work_name}-*.jsonc` |
| Employer profile filtering | `.chezmoiignore` | β€” |
| Employer launchers | `private_dot_work/private_{work_name}/agents/shell/` | `~/.work/{work_name}/agents/shell/` |
| Employer launcher sourcing | `private_dot_work/private_{work_name}/zsh/dot_zshrc.tmpl` | `~/.work/{work_name}/zsh/.zshrc` |

`.zshrc` sources `~/.agents/shell/nono.zsh` first, then per-agent shell files, only when `nono` is installed.
`.zshrc` sources `~/.agents/shell/nono.zsh` first, then per-agent shell files, only when `nono` is installed. The employer zshrc extension sources the employer launchers, also only when `nono` is installed.

## Core Rule

Expand All @@ -35,6 +39,19 @@ When adding or renaming a profile:

Example: profile `claude-code-go` should have a profile file named `claude-code-go.jsonc`, `meta.name: "claude-code-go"`, and a wrapper that calls `nono run --profile claude-code-go`.

## Employer-Specific Profiles

Profiles that serve a single employer or employer project are named `work-{work_name}-<profile>` and are installed only on that employer's machines. Their launchers belong to the employer's work tree, not to `dot_agents/shell/`.

1. Add the profile to `private_dot_config/nono/profiles/` as `work-{work_name}-<profile>.jsonc`, with the same `meta.name`. List `work-{work_name}-common` first in `extends`, followed by the personal profiles the project needs.
2. Make sure `.chezmoiignore` has a block that ignores `.config/nono/profiles/work-{work_name}-*` unless `personal.work_env` is true and `personal.work_name` matches. Each employer needs one block, not one entry per profile.
3. Add the launcher function to the matching agent file in `private_dot_work/private_{work_name}/agents/shell/`, calling the shared helper with the profile name (for example `_claude_nono work-sedg-claude-code-energy-runtime`).
4. For a new employer launcher file, source it from `private_dot_work/private_{work_name}/zsh/dot_zshrc.tmpl` inside the existing `command -v nono` block.

Each employer project gets its own profile and launcher; there are no employer variants of the general launchers such as `claude-go`. `work-{work_name}-common` is agent-neutral: it holds the access every project of that employer needs regardless of agent (employer domains, credentials, tool config), extends nothing, and is shared by employer profiles of any agent. Put agent-specific employer access in a separate `work-{work_name}-<agent>-common` profile. Keep employer access out of personal profiles such as `my-claude-code`.

Employer profiles may extend personal profiles by name (for example `claude-code-go`). Renaming a personal profile requires updating those `extends` entries.

## Path Conventions

Prefer portable nono variables over `~` and absolute machine paths:
Expand Down
4 changes: 4 additions & 0 deletions .chezmoiignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ Taskfile.yml
.agents/shell/claude.zsh
.config/nono/profiles/my-claude-code.jsonc
{{- end }}

{{- if not (and .personal.work_env (eq .personal.work_name "sedg")) }}
.config/nono/profiles/work-sedg-* # only install sedg profiles on sedg work machines
{{- end }}
5 changes: 5 additions & 0 deletions docs/dotfiles/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ The project implements a two-tier model for separating personal and work configu
| Generic work profile | `~/.work/profile` | Cross-employer shared config β€” sets `WORK_DIR`, `WORK_EXECUTABLES_DIR`, and shell extension paths (`WORK_ZSH_ENV_EXTENSION`, `WORK_ZSH_RC_EXTENSION`) |
| Specific work profile | `~/.work/{work_name}/profile` | Employer-specific config β€” sourced by the generic profile |

Both profiles export their path variables, so shells started from an already-initialized shell (subshells, tmux panes) still find the shell extensions even though the profiles are not sourced again.

The generic profile delegates to the specific profile. Both layers produce shell extension files (`.zshenv` and `.zshrc` fragments) that are sourced during shell startup. See the [work environment loading process][work-env-loading] for the full loading flow.

**File structure in chezmoi source:**
Expand All @@ -32,11 +34,14 @@ private_dot_work/
β”‚ └── dot_zshrc.tmpl # Generic work zshrc extension
└── private_{work_name}/
β”œβ”€β”€ profile # Employer-specific profile
β”œβ”€β”€ agents/shell/ # Employer-specific agent launchers, sourced by the zshrc extension
└── zsh/
β”œβ”€β”€ dot_zshenv.tmpl # Employer-specific zshenv extension
└── dot_zshrc.tmpl # Employer-specific zshrc extension
```

**Employer-specific nono profiles:** Employer profiles live with the personal profiles in `~/.config/nono/profiles/`, named `work-{work_name}-*`. A `.chezmoiignore` block per employer skips them unless `personal.work_env` is true and `personal.work_name` matches. Each employer project has its own profile and launcher. Project profiles extend `work-{work_name}-common`, an agent-neutral profile that holds the employer's shared access (domains, credentials, tool config), plus the personal profiles they need. The launchers live in `~/.work/{work_name}/agents/shell/` and call the shared wrapper helpers from `~/.agents/shell/` with these profile names.

### Deferred Homebrew Loading

A shell startup optimization pattern where Homebrew's expensive `shellenv` evaluation is postponed from `.zshenv` to `.zshrc` on macOS. This avoids the cost in non-interactive shells while keeping the environment available for interactive use.
Expand Down
4 changes: 2 additions & 2 deletions docs/dotfiles/processes/work-environment-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ Result: Work-specific environment variables, paths, aliases, and functions are a

## State Changes

- **Environment variables**: `WORK_DIR`, `WORK_EXECUTABLES_DIR`, `WORK_ZSH_DIR`, `WORK_ZSH_RC_EXTENSION`, `WORK_ZSH_ENV_EXTENSION`, `WORK_ENV_LOADED`, plus any employer-specific variables
- **Environment variables** (exported): `WORK_DIR`, `WORK_EXECUTABLES_DIR`, `WORK_ZSH_DIR`, `WORK_ZSH_RC_EXTENSION`, `WORK_ZSH_ENV_EXTENSION`, `WORK_ENV_LOADED`, plus employer-specific path variables (e.g., `SEDG_ZSH_RC_EXTENSION`, `SEDG_AGENTS_SHELL_DIR`). Child shells inherit them, so steps 1–5 are skipped there but step 6 still finds the zshrc extensions. Non-exported state created by the zshenv extensions (shell functions, unexported variables) does not reach child shells.
- **PATH**: May be extended with `WORK_EXECUTABLES_DIR` and employer-specific paths
- **Shell functions/aliases**: Employer-specific additions from zshrc extension
- **Shell functions/aliases**: Employer-specific additions from zshrc extension, including the employer's nono agent launchers when `nono` is installed

## Dependencies

Expand Down
4 changes: 1 addition & 3 deletions dot_agents/shell/claude.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ function claude-chezmoi() { _claude_nono claude-code-chezmoi "$@" }

function claude-go() { _claude_nono claude-code-go "$@" }

function claude-lcp-docs() { _claude_nono claude-code-lcp-docs "$@" }
function claude-node() { _claude_nono claude-code-node "$@" }

function claude-python() { _claude_nono claude-code-python "$@" }

function claude-rust() { _claude_nono claude-code-rust "$@" }

function claude-typescript() { _claude_nono claude-code-typescript "$@" }
4 changes: 1 addition & 3 deletions private_dot_config/nono/profiles/claude-code-go.jsonc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
"network": {
"block": false,
"allow_domain": [],
"open_port": [
1502 // Required for Modbus
],
"open_port": [],
"listen_port": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"my-claude-code"
],
"meta": {
"name": "claude-code-typescript",
"description": "Profile for developing TypeScript applications with Claude Code"
"name": "claude-code-node",
"description": "Profile for developing Node.js applications with Claude Code"
}
}
25 changes: 4 additions & 21 deletions private_dot_config/nono/profiles/my-claude-code.jsonc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
"$XDG_CACHE_HOME/uv",
"$XDG_DATA_HOME/uv/tools", // Mostly for semble search
"$XDG_CACHE_HOME/huggingface/hub/models--minishlab--potion-code-16M-v2", // Semble model cache
"$HOME/.azure",
"$HOME/.azure-devops",
"$XDG_DATA_HOME/deck/status", // Deck writes agent status JSON here
"$XDG_DATA_HOME/deck/hooks", // Deck writes session sidecar JSON here
"$TMPDIR"
],
"read": [
"$HOME/.agents/skills",
"$HOME/lcp-docs",
"$HOME/.context7",
"$HOME/Library/Application Support/glab-cli",
"$HOME/Library/Caches/semble/" // Semble's internal stats
],
"write": [
Expand All @@ -40,25 +36,21 @@
"$XDG_CONFIG_HOME/git/allowed_signers",
"$XDG_CONFIG_HOME/worktrunk/config.toml",
"$XDG_CONFIG_HOME/gh/config.yml",
"$XDG_CONFIG_HOME/gh/hosts.yml",
"$XDG_DATA_HOME/.atlassian-token" // Atlassian's API token - For agents
"$XDG_CONFIG_HOME/gh/hosts.yml"
],
"write_file": [],
"deny": [],
"bypass_protection": [
"$HOME/.ssh/id_rsa.pub",
"$HOME/.ssh/id_ed25519.pub",
"$HOME/.ssh/known_hosts",
"$HOME/.ssh/config",
"$HOME/.azure"
"$HOME/.ssh/config"
],
"suppress_save_prompt": [
"/Users",
"$HOME",
"$HOME/Library/Application Support/Microsoft Edge",
"$HOME/Projects",
"$HOME/Projects/sedg",
"$HOME/Projects/sedg/hark"
"$HOME/Projects"
]
},
"network": {
Expand All @@ -68,16 +60,7 @@
"code.claude.com",
"docs.claude.com",
"mcp.context7.com",
"mcp.atlassian.com",
"mcp-proxy.anthropic.com",
"gitlab.solaredge.com",
"solaredge-prod.atlassian.net",
"dev.azure.com",
"ssh.dev.azure.com",
"balena.io",
"docs.balena.io",
"balena-cloud.com",
"edge-controller-2.internal.hark.network"
"mcp-proxy.anthropic.com"
]
},
"env_credentials": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "../schemas/nono-profile.schema.json",
"extends": [
"work-sedg-common",
"claude-code-go",
"claude-code-node"
],
"meta": {
"name": "work-sedg-claude-code-energy-runtime",
"description": "Profile for developing the Energy Runtime project with Claude Code"
},
"network": {
"open_port": [
0 // Any localhost port; tests bind to random ports with :0
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "../schemas/nono-profile.schema.json",
"extends": [
"work-sedg-common",
"claude-code-go"
],
"meta": {
"name": "work-sedg-claude-code-inverter-driver",
"description": "Profile for developing the Inverter Driver project with Claude Code"
},
"network": {
"open_port": [
1502 // Required for Modbus
]
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"$schema": "../schemas/nono-profile.schema.json",
"extends": [
"work-sedg-common",
"node-dev",
"my-claude-code"
],
"meta": {
"name": "claude-code-lcp-docs",
"name": "work-sedg-claude-code-lcp-docs",
"description": "Profile for developing the LCP documentation project with Claude Code"
},
"filesystem": {
Expand Down
40 changes: 40 additions & 0 deletions private_dot_config/nono/profiles/work-sedg-common.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "../schemas/nono-profile.schema.json",
"meta": {
"name": "work-sedg-common",
"description": "Shared sedg access, mixed into every sedg project profile"
},
"filesystem": {
"allow": [
"$HOME/.azure",
"$HOME/.azure-devops"
],
"read": [
"$HOME/lcp-docs",
"$HOME/Library/Application Support/glab-cli"
],
"read_file": [
"$XDG_DATA_HOME/.atlassian-token" // Atlassian's API token - For agents
],
"bypass_protection": [
"$HOME/.azure"
],
"suppress_save_prompt": [
"$HOME/Projects/sedg",
"$HOME/Projects/sedg/hark"
]
},
"network": {
"allow_domain": [
"mcp.atlassian.com",
"gitlab.solaredge.com",
"solaredge-prod.atlassian.net",
"dev.azure.com",
"ssh.dev.azure.com",
"balena.io",
"docs.balena.io",
"balena-cloud.com",
"edge-controller-2.internal.hark.network"
]
}
}
5 changes: 5 additions & 0 deletions private_dot_work/private_sedg/agents/shell/claude.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function claude-energy-runtime() { _claude_nono work-sedg-claude-code-energy-runtime "$@" }

function claude-inverter-driver() { _claude_nono work-sedg-claude-code-inverter-driver "$@" }

function claude-lcp-docs() { _claude_nono work-sedg-claude-code-lcp-docs "$@" }
20 changes: 11 additions & 9 deletions private_dot_work/private_sedg/profile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/bin/sh
#shellcheck disable=SC1000-SC9999

SEDG_DIR="$WORK_DIR/sedg"
export SEDG_DIR="$WORK_DIR/sedg"

SEDG_ZSH_DIR="$SEDG_DIR/zsh"
SEDG_ZSH_RC_EXTENSION="$SEDG_ZSH_DIR/.zshrc"
SEDG_ZSH_ENV_EXTENSION="$SEDG_ZSH_DIR/.zshenv"
export SEDG_ZSH_DIR="$SEDG_DIR/zsh"
export SEDG_ZSH_RC_EXTENSION="$SEDG_ZSH_DIR/.zshrc"
export SEDG_ZSH_ENV_EXTENSION="$SEDG_ZSH_DIR/.zshenv"

SEDG_EXECUTABLES_DIR="$SEDG_DIR/bin"
SEDG_FIX_VPN_EXECUTABLE_NAME="fix-vpn"
SEDG_FIX_VPN_EXECUTABLE_PATH="${SEDG_EXECUTABLES_DIR}/${SEDG_FIX_VPN_EXECUTABLE_NAME}"
export SEDG_AGENTS_SHELL_DIR="$SEDG_DIR/agents/shell"

SEDG_IOE_DEV_ENV_FRAMEWORK_DIR="$HOME/dev-env"
SEDG_IOE_DEV_ENV_FRAMEWORK_ENTRY_POINT="$HOME/dev-env.sh"
export SEDG_EXECUTABLES_DIR="$SEDG_DIR/bin"
export SEDG_FIX_VPN_EXECUTABLE_NAME="fix-vpn"
export SEDG_FIX_VPN_EXECUTABLE_PATH="${SEDG_EXECUTABLES_DIR}/${SEDG_FIX_VPN_EXECUTABLE_NAME}"

export SEDG_IOE_DEV_ENV_FRAMEWORK_DIR="$HOME/dev-env"
export SEDG_IOE_DEV_ENV_FRAMEWORK_ENTRY_POINT="$HOME/dev-env.sh"
5 changes: 5 additions & 0 deletions private_dot_work/private_sedg/zsh/dot_zshrc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
sudo fix-vpn up
{{- end }}
{{- end }}

# Use sandboxed sedg agent launchers if nono is installed
if command -v nono >/dev/null 2>&1; then
[[ -r "$SEDG_AGENTS_SHELL_DIR/claude.zsh" ]] && source "$SEDG_AGENTS_SHELL_DIR/claude.zsh"
fi
10 changes: 5 additions & 5 deletions private_dot_work/profile.tmpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh
#shellcheck disable=SC1000-SC9999

WORK_DIR="$HOME/.work"
WORK_EXECUTABLES_DIR="$WORK_DIR/bin"
export WORK_DIR="$HOME/.work"
export WORK_EXECUTABLES_DIR="$WORK_DIR/bin"

WORK_ZSH_DIR="$WORK_DIR/zsh"
WORK_ZSH_RC_EXTENSION="$WORK_ZSH_DIR/.zshrc"
WORK_ZSH_ENV_EXTENSION="$WORK_ZSH_DIR/.zshenv"
export WORK_ZSH_DIR="$WORK_DIR/zsh"
export WORK_ZSH_RC_EXTENSION="$WORK_ZSH_DIR/.zshrc"
export WORK_ZSH_ENV_EXTENSION="$WORK_ZSH_DIR/.zshenv"

# Load work-specific profile
source {{ .system.work_specific_dotfiles_profile }}
Loading