Repository navigation
feat(install): config-driven multi-target sync - #4
Conversation
…-safe sync
The installer previously only wrote to ~/.config/opencode/{skills,agents}.
Users running multiple harnesses (OpenCode + Codex + Claude Code) had to
sync the other targets manually, and every `git pull` silently drifted the
unmanaged copies away from the repo.
Changes:
- Auto-detect Codex: if ~/.codex exists, copy skills to ~/.codex/skills
- Auto-detect Claude Code: if ~/.claude exists, copy skills to
~/.claude/skills and agents to ~/.claude/agents
- Antigravity detection hint: logs that OpenCode paths are reused
- Symlink safety: destination paths that are already symlinks are
skipped (not overwritten), so users who linked the repo directly into
~/.claude/skills keep the "git pull = live update" layout
- New env vars: SYNC_CODEX_SKILLS, SYNC_CLAUDE (auto|1|0), CLAUDE_HOME,
CODEX_HOME, OPENCODE_HOME for full override control
Tested:
- bash -n + shellcheck clean
- default run against live ~/.claude/ and ~/.codex/: symlinked skills
skipped, agents copied
- SYNC_CLAUDE=0 correctly disables Claude target
- SYNC_CLAUDE=1 with temp CLAUDE_HOME installs into fresh directory
- Symlinks at both skill and agent destinations preserved across runs
Antigravity is a VS Code fork that ships the `anthropic.claude-code` extension. The extension reads skills/agents from CLAUDE_HOME, so Antigravity has no config path of its own — the old hint claiming it "uses OpenCode paths" was wrong. - Log "served by Claude Code target" when both are present - Log a warning when Antigravity is present but SYNC_CLAUDE is disabled (so the user knows Antigravity will silently go stale) - Make ANTIGRAVITY_APP_SUPPORT overridable, matching the other home vars, so the absence branch is testable Tested: - shellcheck clean - Antigravity + Claude enabled -> served-by log - Antigravity + SYNC_CLAUDE=0 -> warning - ANTIGRAVITY_APP_SUPPORT=/nonexistent -> no Antigravity line - Symlink preservation unchanged
tisDDM
left a comment
There was a problem hiding this comment.
Nicht schlecht.
Aber Idee: Statt environment vars alles in die Config.yaml packen. Das wird sonst ein Massaker
Weitere Idee: Wir brauchen einen Skill oder einen Agenten für PRs und Issues. Diese AI Slop Style / Wall of Text Dinger machen mich fertig. Auch wenn sie manuell geprüft oder über arbeitet wurden
…verrides Moves target configuration from a grab-bag of ad-hoc env vars into a proper config.yaml schema with a clean three-layer precedence model. Precedence (highest wins): OPS_* env vars > config.yaml > built-in defaults config.yaml is optional — a fresh clone still works via auto-detect. The env vars are now scoped to testing/CI overrides, with an OPS_ prefix to avoid colliding with tool-native vars like CLAUDE_HOME (which Claude Code itself may set in the user's environment). Changes: - config.yaml gains a `targets:` section with tri-state `enabled` (true|false|auto) and per-target `home` paths for opencode, codex, claude - install.sh parses config.yaml via yq (hard dependency, v4+); the grep/awk YAML parser is gone, removing a class of brittleness around quoted values, nested structures, and comments-in-values - Env var rename: SYNC_CLAUDE -> OPS_SYNC_CLAUDE, CLAUDE_HOME -> OPS_CLAUDE_HOME, etc. Full list documented in install.sh header and docs/installation.md - New `is_enabled` helper: single source of truth for true/false/auto resolution with an invalid-value warning path - yq dependency check fires early with a clear brew install hint on failure - Model parsing (get_model_for_agent, get_additional_delegates) also migrated to yq for a consistent parser stack - docs/installation.md: new "Configuration Layers" section explains the precedence model, plus a full env-var reference table - config.yaml.example: rewritten as the canonical schema doc with inline comments for every field Tested (10/10 green): - shellcheck clean - T1 no config.yaml: auto-detect works as before - T2 yaml disables claude: claude target skipped - T3 yaml=false + OPS_SYNC_CLAUDE=true: env wins, precedence correct - T4 yaml home override with ~ expansion: files land in custom dir - T5 yq missing: clean error message, exit 1 - T6 symlink preservation: pre-existing symlinks in skills+agents skipped - T7 model injection via yq: correct model: line written to delegate.md - T8 additional_delegates via yq: delegate-fast, delegate-opus generated - T9 invalid `enabled` value: warning printed, falls back to auto - T10 Antigravity detected while claude disabled via yaml: warning printed
|
Danke für das Feedback.
Zum Skill/Agent-Vorschlag für PRs und Issues: eigenes Thema, aber lohnenswert. Sag Bescheid, ob ich einen Scope-Issue aufmachen soll. |
…w findings - Remove yq v4+ hard dependency — use only coreutils + grep + awk + sed - yaml_get_root(): grep-based root-level key lookup (handles hyphenated keys) - yaml_get_target(): awk-based nested targets parser with indentation detection - is_enabled(): normalize to lowercase for case-insensitive env var handling - create_delegate_variant(): add symlink safety check (-L guard) - get_additional_delegates(): awk parser with inline comment stripping - agents: add ast-grep preference to delegate, doc-explorer, implementer, legacy-curator, maintainer
Review-Driven Refactor PushedHey @flitzrrr — ich habe die Review-Findings direkt gefixt und dazu den yq-Ansatz durch native grep/awk-Parser ersetzt. Die Kernideen deines PRs (Multi-Target, OPS_* Overrides, Symlink-Safety, Antigravity) bleiben vollständig erhalten. Was sich geändert hat:yq → grep/awk (Hauptänderung)
Review-Findings gefixt:
Bonus — Agent-Dateien (unrelated): Getestet:
Bitte nochmal drüberschauen und ggf. approven 🙏 |
…idate OPS_CONFIG_FILE Follow-up to the native grep/awk parser from 6e980eb. Addresses review findings on robustness and consistency. - yaml_get_root/yaml_get_target now strip " #..." inline comments and surrounding single/double quotes via a shared _yaml_clean helper. Fixes values like "home: ~/.codex # laptop path" leaking garbage into directory paths and model IDs. - OPS_CONFIG_FILE pointing to a non-existent file now fails fast with a clear error — silent fallback to defaults was a CI/test footgun. - yaml_get_target comment documents the 2-space indentation requirement; config.yaml.example mirrors the note. - Antigravity path comment clarifies its macOS-only default. - Drop redundant trailing echo after Step 1 and Step 2 loops (each loop already prints a per-target separator).
|
Danke Tim — Refactor sieht gut aus, habe drübergeschaut und die Agent-Änderungen sind ebenfalls ok. Ein paar Follow-up-Fixes aus dem eigenen Review sind in
PR-Body ist außerdem aktualisiert — die Getestet mit Sandbox-Run über alle 3 Targets + Config-Szenarien (quoted values, inline comments, hyphenated keys, missing |
…active orchestration Agent routing changes: - Remove standard 'delegate' from routing table (fast + strong only) - Promote delegate-strong from 'escalation' to primary judgment/synthesis agent - delegate-fast: add explicit anti-patterns (not for analysis/synthesis/impl) - Lifecycle: all 3 review steps delegate → delegate-strong Rule changes: - Rule #3: add proactive orchestration paragraph — decompose complex goals into subagent tasks without waiting for explicit instructions - Rule #4: 'Context is a budget' → 'Context hygiene' — softer framing (maintainer model not expensive/context-restricted; lean = sharper judgment) Review escalation: update framing — strong is already the default reviewer
Was
Installer liest Targets aus
config.yaml(targets:-Block) plusOPS_*env vars als Override-Layer. Parsing direkt in Bash übergrep/awk/sed— keine externen Dependencies (nur coreutils).Nebenher gefixt:
~/.claude/anthropic.claude-codeExtension, also überCLAUDE_HOMEConfig
Precedence:
OPS_*env >config.yaml> auto-detect.Vollständiges Schema in
config.yaml.example, Env-Var-Liste iminstall.shHeader.Bonus: Agents
5 Agent-Dateien (
delegate,doc-explorer,implementer,legacy-curator,maintainer) bekommen eineast-grep-Präferenz für Symbol-Lookups. Strukturell unabhängig vom Installer-Refactor; ist im gleichen PR eingeflossen, weil klein und themennah (Tooling-Hygiene).Tests
Sandbox-Runs mit 3 Targets (OpenCode/Codex/Claude), hyphenated Keys, Inline-Kommentaren, quoted values, Symlink-Safety, Case-Insensitivity bei
OPS_*-Werten — alle grün.bash -n+shellcheckclean.