From 1d0082cf2832209fba29222319691ee7cda154a4 Mon Sep 17 00:00:00 2001 From: realM1lF Date: Fri, 18 Sep 2026 12:22:13 +0200 Subject: [PATCH] fix(adapters): stop overwriting the tracked generic instructions template install-adapters.py wrote the generated agents block, which contains the absolute paths of the current machine, into adapters/generic/instructions.md. That file is tracked, so every 'sa install' (and every 'sa sync pull', which calls the installer) left the core repo dirty. A careless commit would publish a teammate's home path to the public repo. The generated block now goes to adapters/generic/instructions.local.md, matching the existing *.local.* convention, and is git-ignored. The tracked instructions.md keeps its $SHARED_AGENTS_HOME placeholders for reading on GitHub before a local install. Docs and the generic tool hint point at the generated file. --- .gitignore | 1 + adapters/aider/README.md | 2 +- adapters/generic/README.md | 7 +++++-- docs/adapters.md | 2 +- scripts/install-adapters.py | 6 ++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index e91de94..2d4dd6f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ mcps.local.yaml # Local install config + private team data (nested git — never commit to core) config.local.yaml **/config.local.yaml +adapters/generic/instructions.local.md team/ .gitmodules diff --git a/adapters/aider/README.md b/adapters/aider/README.md index 82e281a..3edb276 100644 --- a/adapters/aider/README.md +++ b/adapters/aider/README.md @@ -36,7 +36,7 @@ read: Or run: ```bash -aider --read "$SHARED_AGENTS_HOME/adapters/generic/instructions.md" +aider --read "$SHARED_AGENTS_HOME/adapters/generic/instructions.local.md" ``` ## Sync diff --git a/adapters/generic/README.md b/adapters/generic/README.md index 15d17cf..23e880c 100644 --- a/adapters/generic/README.md +++ b/adapters/generic/README.md @@ -7,10 +7,13 @@ For tools not yet in [`manifest.json`](../manifest.json). Every **`sa install`** run refreshes: ``` -adapters/generic/instructions.md +adapters/generic/instructions.local.md ``` -Copy that block into your tool's global config file. +Copy that block into your tool's global config file. It carries the absolute paths of +your machine and is git-ignored. [`instructions.md`](instructions.md) next to it is the +tracked template with `$SHARED_AGENTS_HOME` placeholders, for reading on GitHub before +a local install. ## Common global paths (ecosystem convention) diff --git a/docs/adapters.md b/docs/adapters.md index 4b6bafa..3a80c5b 100644 --- a/docs/adapters.md +++ b/docs/adapters.md @@ -75,7 +75,7 @@ See [Contributing](/docs/contributing). ## Generic fallback -If your CLI is not in the manifest, copy [adapters/generic/instructions.md](https://github.com/netgrade-digital/shared-agents/blob/main/adapters/generic/instructions.md) into your global agent config and set `$SHARED_AGENTS_HOME`. +If your CLI is not in the manifest, copy [adapters/generic/instructions.md](https://github.com/netgrade-digital/shared-agents/blob/main/adapters/generic/instructions.md) into your global agent config and set `$SHARED_AGENTS_HOME`. After `sa install`, `adapters/generic/instructions.local.md` holds the same block with the absolute paths of your machine already filled in. --- diff --git a/scripts/install-adapters.py b/scripts/install-adapters.py index 70f32cb..0718850 100755 --- a/scripts/install-adapters.py +++ b/scripts/install-adapters.py @@ -274,7 +274,7 @@ def check_tool(tool: dict, home: str, repo_home: Path | None = None) -> ToolRepo bins_found=bins_found, config_paths=config_paths, docs=docs, - message="Use adapters/generic/instructions.md for unsupported CLIs", + message="Use adapters/generic/instructions.local.md for unsupported CLIs", ) if tid == "openclaw": @@ -672,7 +672,9 @@ def run_install( messages.extend(install_tool(repo_home, home, tool, dry_run)) configured.append(tool["name"]) - generic = repo_home / "adapters" / "generic" / "instructions.md" + # Machine-specific output: absolute paths of THIS machine. Never the tracked + # template (adapters/generic/instructions.md), or every install dirties the repo. + generic = repo_home / "adapters" / "generic" / "instructions.local.md" if not dry_run: generic.parent.mkdir(parents=True, exist_ok=True) generic.write_text(