From b532028f4ddfe1ff1b0d2118ac23d27da6f82b49 Mon Sep 17 00:00:00 2001 From: Wyller Gomes Date: Wed, 25 Mar 2026 19:57:44 +0000 Subject: [PATCH 1/3] fix: update workflow to use the-agency feature name --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5ee1d6c..8a9c403 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: features: - - agency-agents + - the-agency baseImage: - debian:latest - ubuntu:latest @@ -33,7 +33,7 @@ jobs: strategy: matrix: features: - - agency-agents + - the-agency steps: - uses: actions/checkout@v4 From 9ff54054e284983b81c5e535a365d690cf536e99 Mon Sep 17 00:00:00 2001 From: Wyller Gomes Date: Wed, 25 Mar 2026 20:13:23 +0000 Subject: [PATCH 2/3] fix: use shared location for AGENT_ROUTING.md to support multi-user access - Move AGENT_ROUTING.md installation from user HOME to /usr/local/share/devcontainer-features - Update on-create.sh to copy the template to user's HOME directory - Fixes issue where file created as root was not accessible to vscode user - Ensures test-scenarios test passes for all users --- src/the-agency/install.sh | 6 ++---- src/the-agency/on-create.sh | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/the-agency/install.sh b/src/the-agency/install.sh index 2cd9c84..40db780 100644 --- a/src/the-agency/install.sh +++ b/src/the-agency/install.sh @@ -118,8 +118,7 @@ marker_file="$marker_dir/the-agency-v3-${tool}-${use_agent_zero}-${target_user}. on_create_helper_src="$(dirname "$0")/on-create.sh" on_create_helper_dst="$marker_dir/the-agency-on-create.sh" routing_template_src="$(dirname "$0")/AGENT_ROUTING.md" -global_agents_dir="${HOME}/.agents" -routing_global_dst="$global_agents_dir/AGENT_ROUTING.md" +routing_global_dst="$marker_dir/the-agency-AGENT_ROUTING.md" use_agent_zero_marker="$marker_dir/the-agency-use-agent-zero.enabled" if [ -f "$marker_file" ]; then @@ -128,7 +127,6 @@ if [ -f "$marker_file" ]; then fi mkdir -p "$marker_dir" -mkdir -p "$global_agents_dir" [ -f "$on_create_helper_src" ] || fail "Missing script: on-create.sh" [ -f "$routing_template_src" ] || fail "Missing file: AGENT_ROUTING.md" @@ -136,7 +134,7 @@ cp "$on_create_helper_src" "$on_create_helper_dst" cp "$routing_template_src" "$routing_global_dst" chmod 0755 "$on_create_helper_dst" chmod 0644 "$routing_global_dst" -log "AGENT_ROUTING.md installed to global: $routing_global_dst" +log "AGENT_ROUTING.md template installed to: $routing_global_dst" if [ "$use_agent_zero" = "true" ]; then touch "$use_agent_zero_marker" diff --git a/src/the-agency/on-create.sh b/src/the-agency/on-create.sh index 982eefd..f7e371d 100755 --- a/src/the-agency/on-create.sh +++ b/src/the-agency/on-create.sh @@ -80,6 +80,13 @@ cleanup() { } trap cleanup EXIT +# Copy AGENT_ROUTING.md from shared location to user's home if it exists +marker_dir="/usr/local/share/devcontainer-features" +routing_template_file="$marker_dir/the-agency-AGENT_ROUTING.md" +if [ -f "$routing_template_file" ]; then + cp "$routing_template_file" "$global_routing_file" +fi + # Check if use-agent-zero is enabled use_agent_zero_enabled=false if [ -f "$enabled_marker" ]; then From f847434a0d6f20897bf84d229bec4f3fab7229c8 Mon Sep 17 00:00:00 2001 From: Wyller Gomes Date: Wed, 25 Mar 2026 20:24:27 +0000 Subject: [PATCH 3/3] refactor: move global agency files to ~/.the-agency --- README.md | 8 ++++---- src/the-agency/NOTES.md | 6 +++--- src/the-agency/README.md | 2 +- src/the-agency/devcontainer-feature.json | 2 +- src/the-agency/on-create.sh | 10 +++++----- test/the-agency/use_agent_zero_disabled.sh | 6 +++--- test/the-agency/use_agent_zero_enabled.sh | 8 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 67db25e..5a08f8d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Adds the [msitarzewski/agency-agents](https://github.com/msitarzewski/agency-age 2. Runs `scripts/convert.sh` to prepare the agents. 3. Runs `scripts/install.sh --no-interactive --parallel` when `tool=auto` (default), or `scripts/install.sh --tool --no-interactive` for explicit tool mode. -If `use-agent-zero=true`, the feature syncs `AGENT-ZERO` to `~/.agents/AGENT-ZERO.md` and `AGENT_ROUTING.md` to `~/.agents/AGENT_ROUTING.md` during `onCreateCommand`. Workspace `AGENTS.md` is created if missing, or updated in-place by replacing only the-agency managed reference blocks. +If `use-agent-zero=true`, the feature syncs `AGENT-ZERO` to `~/.the-agency/AGENT-ZERO.md` and `AGENT_ROUTING.md` to `~/.the-agency/AGENT_ROUTING.md` during `onCreateCommand`. Workspace `AGENTS.md` is created if missing, or updated in-place by replacing only the-agency managed reference blocks. ### Usage @@ -55,13 +55,13 @@ To also create `AGENTS.md` in the workspace root: | Option | Type | Default | Description | |--------|--------|------------|---------------------------------------------------------------------| | `tool` | string | `auto` | `auto` runs `install.sh --no-interactive --parallel`; otherwise uses `--tool ` (e.g. `copilot`, `cursor`). | -| `use-agent-zero` | boolean | `false` | If `true`, syncs `AGENT-ZERO` to `~/.agents/AGENT-ZERO.md` and `AGENT_ROUTING.md` to `~/.agents/AGENT_ROUTING.md` during `onCreateCommand`. Workspace `AGENTS.md` is created if missing, or updated in-place by replacing only the-agency managed reference blocks. | +| `use-agent-zero` | boolean | `false` | If `true`, syncs `AGENT-ZERO` to `~/.the-agency/AGENT-ZERO.md` and `AGENT_ROUTING.md` to `~/.the-agency/AGENT_ROUTING.md` during `onCreateCommand`. Workspace `AGENTS.md` is created if missing, or updated in-place by replacing only the-agency managed reference blocks. | ### Credits The agents installed by this feature come from the [msitarzewski/agency-agents](https://github.com/msitarzewski/agency-agents) repository. All credit for the agent definitions, `convert.sh`, and `install.sh` scripts belongs to the upstream project and its contributors. -When `use-agent-zero=true`, `~/.agents/AGENT-ZERO.md` is sourced from [msitarzewski/AGENT-ZERO](https://github.com/msitarzewski/AGENT-ZERO), and `~/.agents/AGENT_ROUTING.md` is installed by this feature. Credit for AGENT-ZERO specification belongs to the AGENT-ZERO project and its contributors. +When `use-agent-zero=true`, `~/.the-agency/AGENT-ZERO.md` is sourced from [msitarzewski/AGENT-ZERO](https://github.com/msitarzewski/AGENT-ZERO), and `~/.the-agency/AGENT_ROUTING.md` is installed by this feature. Credit for AGENT-ZERO specification belongs to the AGENT-ZERO project and its contributors. This repository only wraps that upstream work as a dev container Feature for easier, reproducible installation inside dev containers. @@ -97,7 +97,7 @@ For example, the `the-agency` feature exposes a `tool` string option. If no opt "use-agent-zero": { "type": "boolean", "default": false, - "description": "If true, syncs AGENT-ZERO to ~/.agents/AGENT-ZERO.md and AGENT_ROUTING.md to ~/.agents/AGENT_ROUTING.md during onCreateCommand. Workspace AGENTS.md is created if missing, or updated in-place by replacing only the-agency managed reference blocks." + "description": "If true, syncs AGENT-ZERO to ~/.the-agency/AGENT-ZERO.md and AGENT_ROUTING.md to ~/.the-agency/AGENT_ROUTING.md during onCreateCommand. Workspace AGENTS.md is created if missing, or updated in-place by replacing only the-agency managed reference blocks." } } } diff --git a/src/the-agency/NOTES.md b/src/the-agency/NOTES.md index 52ee265..6794d28 100644 --- a/src/the-agency/NOTES.md +++ b/src/the-agency/NOTES.md @@ -5,13 +5,13 @@ ### Agent Routing Rules (Always Added) Regardless of the `use-agent-zero` setting, the feature always ensures that agent routing rules are present in your workspace `AGENTS.md` file. This helps LLM agents make informed decisions about which specialist agents to use. -- **When enabled**: Routing rules are added to the workspace and reference `~/.agents/AGENT_ROUTING.md` +- **When enabled**: Routing rules are added to the workspace and reference `~/.the-agency/AGENT_ROUTING.md` - **When disabled**: Same routing rules are added, without the Canonical Agent Guide ### Canonical Agent Guide (Optional) -When `use-agent-zero=true`, the feature additionally includes a reference to the Canonical Agent Guide, which syncs the global `AGENT-ZERO.md` file to `~/.agents/`. +When `use-agent-zero=true`, the feature additionally includes a reference to the Canonical Agent Guide, which syncs the global `AGENT-ZERO.md` file to `~/.the-agency/`. -- **When enabled**: Includes Canonical Agent Guide section pointing to `~/.agents/AGENT-ZERO.md` +- **When enabled**: Includes Canonical Agent Guide section pointing to `~/.the-agency/AGENT-ZERO.md` - **When disabled**: Canonical section is omitted, but routing rules still present ### Content Order (When Enabled) diff --git a/src/the-agency/README.md b/src/the-agency/README.md index 25dbdb3..83ab41b 100644 --- a/src/the-agency/README.md +++ b/src/the-agency/README.md @@ -16,7 +16,7 @@ Downloads agency-agents from msitarzewski repos and runs convert/install with au | Options Id | Description | Type | Default Value | |-----|-----|-----|-----| | tool | Tool name passed to ./scripts/install.sh --tool . Use 'auto' for --parallel auto-detection. | string | auto | -| use-agent-zero | If true, includes Canonical Agent Guide section in AGENTS.md and syncs AGENT-ZERO.md globally. Agent routing rules are always included in AGENTS.md (created if missing, or updated in-place). AGENT_ROUTING.md is always installed to ~/.agents/. | boolean | false | +| use-agent-zero | If true, includes Canonical Agent Guide section in AGENTS.md and syncs AGENT-ZERO.md globally. Agent routing rules are always included in AGENTS.md (created if missing, or updated in-place). AGENT_ROUTING.md is always installed to ~/.the-agency/. | boolean | false | diff --git a/src/the-agency/devcontainer-feature.json b/src/the-agency/devcontainer-feature.json index b688ab2..605639c 100644 --- a/src/the-agency/devcontainer-feature.json +++ b/src/the-agency/devcontainer-feature.json @@ -13,7 +13,7 @@ "use-agent-zero": { "type": "boolean", "default": false, - "description": "If true, includes Canonical Agent Guide section in AGENTS.md and syncs AGENT-ZERO.md globally." + "description": "If true, includes Canonical Agent Guide section in AGENTS.md and syncs AGENT-ZERO.md to ~/.the-agency/AGENT-ZERO.md. AGENT_ROUTING.md is synced to ~/.the-agency/AGENT_ROUTING.md." } }, "onCreateCommand": "/usr/local/share/devcontainer-features/the-agency-on-create.sh", diff --git a/src/the-agency/on-create.sh b/src/the-agency/on-create.sh index f7e371d..2aff502 100755 --- a/src/the-agency/on-create.sh +++ b/src/the-agency/on-create.sh @@ -9,9 +9,9 @@ log() { marker_dir="/usr/local/share/devcontainer-features" enabled_marker="$marker_dir/the-agency-use-agent-zero.enabled" output_file="$PWD/AGENTS.md" -global_agents_dir="${HOME}/.agents" -global_routing_file="${HOME}/.agents/AGENT_ROUTING.md" -global_agent_zero_file="${HOME}/.agents/AGENT-ZERO.md" +global_agents_dir="${HOME}/.the-agency" +global_routing_file="${HOME}/.the-agency/AGENT_ROUTING.md" +global_agent_zero_file="${HOME}/.the-agency/AGENT-ZERO.md" source_url="https://raw.githubusercontent.com/msitarzewski/AGENT-ZERO/main/AGENTS.md" write_workspace_agents_reference() { @@ -100,14 +100,14 @@ fi if [ "$use_agent_zero_enabled" = true ]; then echo "# Canonical Agent Guide (Mandatory)" echo "" - echo "Use ~/.agents/AGENT-ZERO.md as the global AGENTS baseline before execution." + echo "Use ~/.the-agency/AGENT-ZERO.md as the global AGENTS baseline before execution." echo "" fi echo "# Agent Routing Rules (Mandatory)" echo "" echo "Before selecting a specialist agent, first classify the request by division." - echo "Then use ~/.agents/AGENT_ROUTING.md as the routing reference to choose the primary and fallback agent." + echo "Then use ~/.the-agency/AGENT_ROUTING.md as the routing reference to choose the primary and fallback agent." echo "" echo "" } > "$references_block_file" diff --git a/test/the-agency/use_agent_zero_disabled.sh b/test/the-agency/use_agent_zero_disabled.sh index 26dfcfb..735e5b1 100644 --- a/test/the-agency/use_agent_zero_disabled.sh +++ b/test/the-agency/use_agent_zero_disabled.sh @@ -4,7 +4,7 @@ set -e source dev-container-features-test-lib check "global AGENT_ROUTING.md exists" bash -c \ - "test -s \"$HOME/.agents/AGENT_ROUTING.md\"" + "test -s \"$HOME/.the-agency/AGENT_ROUTING.md\"" check "on-create creates AGENTS.md with routing rules only (when disabled)" bash -c ' # Simulate use-agent-zero=false by ensuring the marker does NOT exist @@ -18,9 +18,9 @@ check "on-create creates AGENTS.md with routing rules only (when disabled)" bash test -s "$tmp_ws/AGENTS.md" grep -q "Agent Routing Rules (Mandatory)" "$tmp_ws/AGENTS.md" - grep -q "~/.agents/AGENT_ROUTING.md" "$tmp_ws/AGENTS.md" + grep -q "~/.the-agency/AGENT_ROUTING.md" "$tmp_ws/AGENTS.md" ! grep -q "Canonical Agent Guide (Mandatory)" "$tmp_ws/AGENTS.md" - ! grep -q "~/.agents/AGENT-ZERO.md" "$tmp_ws/AGENTS.md" + ! grep -q "~/.the-agency/AGENT-ZERO.md" "$tmp_ws/AGENTS.md" ' check "on-create updates existing AGENTS.md with routing rules only (when disabled)" bash -c ' diff --git a/test/the-agency/use_agent_zero_enabled.sh b/test/the-agency/use_agent_zero_enabled.sh index 14aaf30..2e53488 100755 --- a/test/the-agency/use_agent_zero_enabled.sh +++ b/test/the-agency/use_agent_zero_enabled.sh @@ -10,7 +10,7 @@ check "on-create helper exists and is executable" bash -c \ "test -x /usr/local/share/devcontainer-features/the-agency-on-create.sh" check "global AGENT_ROUTING.md exists" bash -c \ - "test -s \"$HOME/.agents/AGENT_ROUTING.md\"" + "test -s \"$HOME/.the-agency/AGENT_ROUTING.md\"" check "on-create creates AGENTS.md in workspace when missing" bash -c ' tmp_ws="$(mktemp -d)" @@ -47,21 +47,21 @@ check "on-create references global AGENT_ROUTING.md in AGENTS.md" bash -c ' tmp_ws="$(mktemp -d)" cd "$tmp_ws" /usr/local/share/devcontainer-features/the-agency-on-create.sh - grep -q "~/.agents/AGENT_ROUTING.md" "$tmp_ws/AGENTS.md" + grep -q "~/.the-agency/AGENT_ROUTING.md" "$tmp_ws/AGENTS.md" ' check "on-create writes global AGENT-ZERO.md" bash -c ' tmp_ws="$(mktemp -d)" cd "$tmp_ws" /usr/local/share/devcontainer-features/the-agency-on-create.sh - test -s "$HOME/.agents/AGENT-ZERO.md" + test -s "$HOME/.the-agency/AGENT-ZERO.md" ' check "on-create references global AGENT-ZERO.md in AGENTS.md" bash -c ' tmp_ws="$(mktemp -d)" cd "$tmp_ws" /usr/local/share/devcontainer-features/the-agency-on-create.sh - grep -q "~/.agents/AGENT-ZERO.md" "$tmp_ws/AGENTS.md" + grep -q "~/.the-agency/AGENT-ZERO.md" "$tmp_ws/AGENTS.md" ' check "on-create injects agent routing rules header into AGENTS.md" bash -c '