Skip to content
Open
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
5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ dotfiles/
│ ├── git-helpers.zsh # git-workdev, git-personaldev, git-whoami, clone-*
│ ├── pcsoft-helpers.zsh # is-pcsoft-forbidden, is-pcsoft-editable
│ ├── screenshots.zsh # ss, last, ssd, imgclip
│ └── tmux-helpers.zsh # ta, tn, tk, tl, tdev
│ ├── ssh-helpers.zsh # ssh/mosh con contexto visible
│ └── herdr-helpers.zsh # hhere, hremote, hname, whereami
├── starship/starship.toml # Prompt Gruvbox Dark → symlink a ~/.config/starship.toml
├── ghostty/config # Terminal → symlink a ~/.config/ghostty/config
├── tmux/tmux.conf # Multiplexor → symlink a ~/.tmux.conf
├── herdr/config.toml # Multiplexor → symlink a ~/.config/herdr/config.toml
├── local/
│ └── env.zsh.example # Template para local/env.zsh (gitignored)
└── install.sh # Instalador
Expand Down
68 changes: 55 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Configuración local extraida de `cortex`: terminal, shell, prompt, helpers de A

## Stack

- **Terminal**: [Ghostty](https://ghostty.org/) y Alacritty
- **Terminal**: [Ghostty](https://ghostty.org/)
- **Shell**: Zsh nativo de macOS
- **Prompt**: [Starship](https://starship.rs/) — tema Gruvbox Dark
- **Multiplexor**: tmux + helpers de sesión
- **Multiplexor**: [Herdr](https://herdr.dev/) para sesiones locales/remotas persistentes
- **Barra macOS**: [SketchyBar](https://github.com/FelixKratz/SketchyBar) con tema Gruvbox
- **Window manager macOS**: [yabai](https://github.com/koekeishiya/yabai) + [skhd](https://github.com/koekeishiya/skhd) opcional y gradual
- **Keyboard remaps macOS**: [Karabiner-Elements](https://karabiner-elements.pqrs.org/) con profile `cortex`
- **Editor terminal**: [micro](https://micro-editor.github.io/)
- **Editor principal**: Neovim basado en LazyVim/Gentleman.Dots con overlay RefactorIA
- **Ls**: [eza](https://github.com/eza-community/eza)
- **AI CLI UX**: Claude Code statusline, OpenCode helpers y cmux hooks opcionales
- **AI CLI UX**: Claude Code statusline, OpenCode helpers y sesiones Herdr por repo
- **Supply-chain guardrails**: defaults globales para `uv`, `npm`, `pnpm` y `bun`
- **Fuente**: FiraCode Nerd Font + variante custom RefactorIA

Expand All @@ -29,7 +29,7 @@ bash install.sh
```

El instalador macOS:
1. Instala dependencias via Homebrew (starship, tmux, lazygit, micro, eza, sketchybar, yabai, skhd, Karabiner-Elements, FiraCode Nerd Font)
1. Instala dependencias via Homebrew (starship, herdr, mosh, lazygit, micro, eza, sketchybar, yabai, skhd, Karabiner-Elements, FiraCode Nerd Font)
2. Hace backup de configs existentes con timestamp
3. Crea symlinks de los dotfiles y guardrails globales (`.npmrc`, `pnpm/rc`, `.bunfig.toml`, `uv.toml`)
4. Intenta seleccionar el profile `cortex` de Karabiner si `karabiner_cli` está disponible
Expand All @@ -41,8 +41,9 @@ El instalador macOS:
```
dotfiles/
├── claude/ # Claude Code statusline
├── ghostty/ # Config Ghostty, cmux Ghostty config, muxy legado y shaders
├── ghostty/ # Config Ghostty y shaders
├── fonts/ # Fuente RefactorIA y script de regeneración
├── herdr/ # Config Herdr
├── npm/ # Global npm defaults (~/.npmrc)
├── pnpm/ # Global pnpm defaults (~/Library/Preferences/pnpm/rc)
├── bun/ # Global bun defaults (~/.bunfig.toml)
Expand All @@ -52,11 +53,11 @@ dotfiles/
│ └── scripts/
│ ├── claude-helpers.zsh # Integración Claude Code
│ ├── git-helpers.zsh # Identidades Git y clone helpers
│ ├── tmux-helpers.zsh # Helpers tmux
│ ├── ssh-helpers.zsh # SSH/Mosh con contexto visible
│ ├── herdr-helpers.zsh # Helpers Herdr para sesiones y orientación
│ ├── worktree-helpers.zsh # Helpers git worktree
│ ├── screenshots.zsh # Manejo de screenshots macOS
│ └── pcsoft-helpers.zsh # Protección archivos PCSoft
├── tmux/ # Config tmux
├── lazygit/ # Config lazygit
├── karabiner/ # Config Karabiner-Elements (~/.config/karabiner/karabiner.json)
├── micro/ # Settings y themes de micro
Expand All @@ -81,8 +82,18 @@ dotfiles/
| `cortex`, `dotfiles` | Navegación rápida al repo `cortex` y sus dotfiles |
| `cc [path]` | Abrir Claude Code |
| `oc [path]` | Abrir OpenCode |
| `hhere`, `hmain` | Volver a la sesión Herdr principal del repo/branch |
| `hnew [path]` | Crear sesión Herdr independiente con timestamp |
| `hrole <rol> [path]` | Entrar/crear sesión Herdr por rol operativo |
| `hfocus`, `hside`, `hscratch` | Sesiones Herdr por rol para foco, lateral o scratch |
| `hremote <host> [session]` | Attach remoto con `herdr --remote` |
| `hname [label]` | Nombrar el pane Herdr actual |
| `moshx <host> [remote-path]` | Mosh al host; con path entra a ese directorio remoto |
| `moshx-doctor <host>` | Verifica `mosh-server`, `herdr`, `git` y `sh` en el host remoto |
| `sshx <host>` | SSH directo con contexto visible |
| `sshc <host>` | SSH directo con host visible en prompt |
| `whereami` | Mostrar host, cwd, repo, sesión y SSH |
| `ccclip <files>` | Copiar código al clipboard |
| `tcc`, `tdev`, `ta`, `tn`, `tl`, `tk` | Helpers tmux (`tcc` abre Claude Code en tmux) |
| `wtadd`, `wtlist`, `wtremove` | Helpers de git worktrees |
| `ss [n]` | Listar últimos screenshots |
| `last [-c\|-o]` | Último screenshot |
Expand All @@ -98,9 +109,40 @@ Editá `local/env.zsh` (gitignored) para configurar:
- `SCREENSHOTS_DIR` — directorio de screenshots
- `WORKSPACE_DIR` — directorio raíz de tus proyectos
- `OPENCODE_DEFAULT_FLAGS` — flags por defecto para `oc`
- `CORTEX_MULTIPLEXER=herdr` — marca Herdr como multiplexor operativo para prompt/helpers
- `INNIT_DIR` y overrides `INNIT_*_DIR` — navegación rápida de subdirectorios
- Aliases y paths personales

## Herdr remoto

Para SSH/remoto, el modelo recomendado es Herdr. Usá sesiones nombradas para separar tableros persistentes, workspaces por repo, tabs por objetivo y panes por agente/proceso:

```bash
hremote agent-dev-01 main
hhere ~/dev/personal/cortex
hfocus ~/dev/personal/cortex
hside ~/dev/personal/cortex
```

Si necesitás diagnosticar dependencias:

```bash
moshx-doctor agent-dev-01
```

Comportamiento:

- `hhere [path]` y `hmain [path]` nombran la sesión principal por host + repo + branch, para reattach exacto.
- `hnew [path]` crea otra sesión independiente del mismo repo/branch con timestamp corto.
- `hrole <rol> [path]`, `hfocus [path]`, `hside [path]` y `hscratch [path]` crean/entran a sesiones independientes por intención operativa, no por monitor físico.
- Si ya estás dentro de Herdr, esos helpers no intentan abrir Herdr anidado: crean o enfocan un workspace con el mismo nombre dentro de la sesión actual.
- `hremote <host> [session]` usa el bridge remoto de Herdr.
- `hname [label]` evita panes anónimos en el sidepanel.
- `cc [path]`, `ccb [path]`, `oc [path]` y `ocb [path]` ejecutan el agente en el pane actual; Herdr provee persistencia.
- Herdr también expone CLI scriptable para `workspace`, `tab`, `pane`, `agent`, `worktree`, `wait` e `integration`; los helpers solo cubren el flujo muscular diario.
- Prompt Starship marca `herdr` cuando `CORTEX_MULTIPLEXER=herdr`.
- `whereami` muestra ubicación completa sin depender de la UI.

## SketchyBar

La config macOS enlaza `sketchybar/` en `~/.config/sketchybar`. El diseño es sobrio, notch-safe y usa la paleta dark/green de InnIT.
Expand All @@ -110,9 +152,9 @@ Layout activo:
| Pantalla | Uso | Layout |
|------|-----|--------|
| Mac Retina (`display=1`) | apps generales: Discord, WhatsApp, Mail, Postman, Zen Browser | app activa + network, volumen, calendario, hora, batería |
| ViewSonic vertical (`display=2`) | auxiliar/random, cmux y Claude de formato vertical | brand + panel/spaces + app activa + git + issue/PR + SDD + brains + timer; derecha: RAM + CPU + hora |
| LG Ultrawide (`display=3`) | mixto: cmux, Claude, ChatGPT, Obsidian | brand + panel/spaces + app activa + git + issue/PR + SDD + brains + timer; derecha: RAM + CPU + hora |
| 4K derecho (`display=4`) | cmux exclusivo | brand + panel/spaces + app activa + git + issue/PR + SDD + brains + timer; derecha: RAM + CPU + hora |
| ViewSonic vertical (`display=2`) | auxiliar/random, Ghostty/Herdr y Claude de formato vertical | brand + panel/spaces + app activa + git + issue/PR + SDD + brains + timer; derecha: RAM + CPU + hora |
| LG Ultrawide (`display=3`) | mixto: Ghostty/Herdr, Claude, ChatGPT, Obsidian | brand + panel/spaces + app activa + git + issue/PR + SDD + brains + timer; derecha: RAM + CPU + hora |
| 4K derecho (`display=4`) | Ghostty/Herdr exclusivo | brand + panel/spaces + app activa + git + issue/PR + SDD + brains + timer; derecha: RAM + CPU + hora |

El centro queda libre para evitar el notch y reducir ruido visual.

Expand All @@ -126,7 +168,7 @@ Interacciones:
| Batería | abre Battery Settings |
| Fecha/hora | abre Calendar |

La barra asume Mac con notch y varios monitores: el centro queda libre y los items operativos se mantienen en los laterales. Los items de contexto (`git`, issue/PR, SDD y timer) se actualizan con un agregador liviano que lee `${XDG_CACHE_HOME:-~/.cache}/cortex/active-workspace`. Un watcher de eventos `workspace.selected` de cmux actualiza ese archivo y refresca los items al cambiar de workspace. `SKETCHYBAR_WORKSPACE` permite forzar un repo específico.
La barra asume Mac con notch y varios monitores: el centro queda libre y los items operativos se mantienen en los laterales. Los items de contexto (`git`, issue/PR, SDD y timer) se actualizan con un agregador liviano que lee `${XDG_CACHE_HOME:-~/.cache}/cortex/active-workspace`. `SKETCHYBAR_WORKSPACE` permite forzar un repo específico.

El layout cambia automáticamente al recargar SketchyBar: con un solo display, el Retina mantiene los indicadores de estado útiles; con varios displays, el Retina queda liviano y el layout completo se mueve al externo disponible.

Expand Down Expand Up @@ -251,7 +293,7 @@ El prompt usa una variante local de FiraCode Nerd Font Mono con el glyph de la b
| Codepoint | `U+F0F00` |
| Glyph test | `python3 -c 'print("\U000F0F00")'` |

La config de Starship usa este glyph PUA directamente. Si la terminal no tiene seleccionada `FiraCode Nerd Font Mono Beard`, el prompt puede mostrar un cuadrado/tofu en lugar de la barba. En macOS, `install.sh` instala la fuente y deja configurados Ghostty y cmux con esa family.
La config de Starship usa este glyph PUA directamente. Si la terminal no tiene seleccionada `FiraCode Nerd Font Mono Beard`, el prompt puede mostrar un cuadrado/tofu en lugar de la barba. En macOS, `install.sh` instala la fuente y deja configurado Ghostty con esa family.

Para regenerar la fuente:

Expand Down
7 changes: 2 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Mejoras identificadas en dotfiles externos de referencia.

- [x] **Glyph custom RefactorIA para Nerd Font** — `FiraCode Nerd Font Mono Beard` versionado en `fonts/FiraCodeNerdFontMonoBeard-Reg.ttf`, instalado en `~/Library/Fonts/FiraCodeNerdFontMonoBeard-Reg.ttf`, codepoint `U+F0F00`, script regenerable en `fonts/patch_beard.py`, Ghostty y Starship configurados.
- [x] **Statusline custom para Claude Code** — script que muestra barra visual de uso del contexto (verde/amarillo/rojo), modelo activo, rama git y porcentaje exacto.
- [x] **Sesión flotante Alt+G en tmux** — popup flotante sobre cualquier layout.
- [x] **tmux-resurrect** — guarda y restaura sesiones tmux al reiniciar. `Prefix+Ctrl+S` / `Prefix+Ctrl+R`.

## Media prioridad

Expand All @@ -23,7 +21,6 @@ Mejoras identificadas en dotfiles externos de referencia.
## Baja prioridad

- [x] **Shaders de cursor en Ghostty** — 4 shaders disponibles en `ghostty/shaders/`. Activo: cursor_smear_gentleman. Para cambiar: editar `custom-shader` en ghostty/config.
- [x] **`tmux-which-key`** — muestra keybindings al presionar el prefix.
- [x] **`window-padding-balance = true` en Ghostty** — padding balanceado en splits.

---
Expand All @@ -44,6 +41,6 @@ Mejoras identificadas en dotfiles externos de referencia.

## Worktrees — integración natural con Claude

- [x] **Worktree helpers zsh + cmux** — `wtadd`/`wtlist`/`wtremove` en `worktree-helpers.zsh`. Mecánica pura: crear directorio hermano, detectar repos PCSoft via `is-pcsoft-forbidden`, abrir workspace cmux automáticamente. Los comandos son la infraestructura, no el punto de entrada al usuario.
- [x] **Worktree helpers zsh + Herdr** — `wtadd`/`wtlist`/`wtremove` en `worktree-helpers.zsh`. Mecánica pura: crear directorio hermano, detectar repos PCSoft via `is-pcsoft-forbidden`, abrir agente en el flujo Herdr. Los comandos son la infraestructura, no el punto de entrada al usuario.

- [x] **Regla de evaluación proactiva en claude-config** — Claude evalúa si worktrees convienen y los sugiere/implementa sin que el usuario lo pida. Triggers: "hay un bug urgente y estoy en medio de algo", feature branch larga + hotfix simultáneo, "no quiero perder contexto pero necesito cambiar de rama". Si el repo es PCSoft → nunca sugerir. Si es no-PCSoft y hay conflicto de contexto → proponer `wtadd` + nuevo workspace cmux directamente.
- [x] **Regla de evaluación proactiva en claude-config** — Claude evalúa si worktrees convienen y los sugiere/implementa sin que el usuario lo pida. Triggers: "hay un bug urgente y estoy en medio de algo", feature branch larga + hotfix simultáneo, "no quiero perder contexto pero necesito cambiar de rama". Si el repo es PCSoft → nunca sugerir. Si es no-PCSoft y hay conflicto de contexto → proponer `wtadd` + nuevo workspace Herdr directamente.
18 changes: 9 additions & 9 deletions ghostty/cmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ palette = 15=#ffffff

# Transparencia
background-opacity = 1.0
unfocused-split-opacity = 0.2
unfocused-split-opacity = 0.85

# Ventana
window-decoration = false
window-decoration = true
window-padding-balance = true
window-step-resize = false
macos-titlebar-style = hidden
window-padding-x = 8
window-padding-y = 8
macos-titlebar-style = tabs
window-padding-x = 4
window-padding-y = 2

# Cursor
cursor-style = block_hollow

# Cursor con efecto suave
# Opciones disponibles: cursor_smear_soft, cursor_blaze, cursor_frozen, cursor_smear_rainbow
custom-shader = shaders/cursor_smear_soft.glsl
# Shaders desactivados en modo trabajo remoto: reducen legibilidad en multiplexers.
# custom-shader = shaders/cursor_smear_soft.glsl

# Integración con shell
shell-integration = zsh

# Sin macos-option-as-alt: Option sigue siendo Option en ambos lados (tildes/ñ funcionan normal)
# Option izquierdo como Alt para TUIs; Option derecho conserva tildes/ñ.
macos-option-as-alt = left

# Comportamiento
scrollback-limit = 10000
Expand Down
21 changes: 11 additions & 10 deletions ghostty/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Fuente
# Fuente primaria: FiraCode Beard custom. Fallback: Nerd Font oficial para glyphs.
font-family = FiraCode Nerd Font Mono Beard
font-family = FiraCode Nerd Font
font-size = 14

# Paleta Dark Vibrant (portada desde Windows Terminal)
Expand Down Expand Up @@ -32,27 +33,27 @@ palette = 15=#ffffff

# Transparencia
background-opacity = 1.0
unfocused-split-opacity = 0.2
unfocused-split-opacity = 0.85

# Ventana
window-decoration = false
window-decoration = true
window-padding-balance = true
window-step-resize = false
macos-titlebar-style = hidden
window-padding-x = 8
window-padding-y = 8
macos-titlebar-style = tabs
window-padding-x = 4
window-padding-y = 2

# Cursor
cursor-style = block_hollow

# Cursor con efecto suave
# Opciones disponibles: cursor_smear_soft, cursor_blaze, cursor_frozen, cursor_smear_rainbow
custom-shader = shaders/cursor_smear_soft.glsl
# Shaders desactivados en modo trabajo remoto: reducen legibilidad en multiplexers.
# custom-shader = shaders/cursor_smear_soft.glsl

# Integración con shell
shell-integration = zsh

# Sin macos-option-as-alt: Option sigue siendo Option en ambos lados (tildes/ñ funcionan normal)
# Option izquierdo como Alt para TUIs; Option derecho conserva tildes/ñ.
macos-option-as-alt = left

# Comportamiento
scrollback-limit = 10000
Expand Down
18 changes: 9 additions & 9 deletions ghostty/muxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ font-size = 14

# Transparencia
background-opacity = 1.0
unfocused-split-opacity = 0.2
unfocused-split-opacity = 0.85

# Ventana
window-decoration = false
window-decoration = true
window-padding-balance = true
window-step-resize = false
macos-titlebar-style = hidden
window-padding-x = 8
window-padding-y = 8
macos-titlebar-style = tabs
window-padding-x = 4
window-padding-y = 2

# Cursor
cursor-style = block_hollow

# Cursor con efecto suave
# Opciones disponibles: cursor_smear_soft, cursor_blaze, cursor_frozen, cursor_smear_rainbow
custom-shader = shaders/cursor_smear_soft.glsl
# Shaders desactivados en modo trabajo remoto: reducen legibilidad en multiplexers.
# custom-shader = shaders/cursor_smear_soft.glsl

# Integración con shell
shell-integration = zsh

# Sin macos-option-as-alt: Option sigue siendo Option en ambos lados (tildes/ñ funcionan normal)
# Option izquierdo como Alt para TUIs; Option derecho conserva tildes/ñ.
macos-option-as-alt = left

# Comportamiento
scrollback-limit = 10000
Expand Down
25 changes: 25 additions & 0 deletions herdr/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[ui.toast]
delivery = "terminal"

[ui]
sidebar_width = 32
sidebar_min_width = 24
sidebar_max_width = 42
agent_panel_sort = "priority"
show_agent_labels_on_pane_borders = true
prompt_new_tab_name = true
pane_borders = true
pane_gaps = true

[terminal]
new_cwd = "follow"

[session]
resume_agents_on_restore = true

[remote]
manage_ssh_config = true

[theme]
name = "gruvbox"
auto_switch = false
Loading