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
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
features:
- agency-agents
- the-agency
baseImage:
- debian:latest
- ubuntu:latest
Expand All @@ -33,7 +33,7 @@ jobs:
strategy:
matrix:
features:
- agency-agents
- the-agency
steps:
- uses: actions/checkout@v4

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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

Expand Down Expand Up @@ -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 <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.

Expand Down Expand Up @@ -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."
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/the-agency/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/the-agency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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 |



Expand Down
2 changes: 1 addition & 1 deletion src/the-agency/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions src/the-agency/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -128,15 +127,14 @@ 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"
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"
Expand Down
17 changes: 12 additions & 5 deletions src/the-agency/on-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand All @@ -93,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 "<!-- the-agency-feature:workspace-references:end -->"
} > "$references_block_file"
Expand Down
6 changes: 3 additions & 3 deletions test/the-agency/use_agent_zero_disabled.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 '
Expand Down
8 changes: 4 additions & 4 deletions test/the-agency/use_agent_zero_enabled.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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 '
Expand Down
Loading