diff --git a/src/agency-agents/NOTES.md b/src/agency-agents/NOTES.md index 4787eef..1473fff 100644 --- a/src/agency-agents/NOTES.md +++ b/src/agency-agents/NOTES.md @@ -9,3 +9,4 @@ No workspace instructions files are created or modified. - Install agents for auto-detected tools (`tool=auto`) - Install agents for a specific tool (`tool=`) +- Install only specific divisions (`divisions=engineering,security`) diff --git a/src/agency-agents/README.md b/src/agency-agents/README.md index c1eff8c..068397e 100644 --- a/src/agency-agents/README.md +++ b/src/agency-agents/README.md @@ -17,6 +17,7 @@ A complete AI agency at your fingertips - From frontend wizards to Reddit commun |-----|-----|-----|-----| | tool | Tool name passed to ./scripts/install.sh --tool . Use 'auto' for --parallel auto-detection. | string | auto | | autoupdate | Check for updates on container start | boolean | true | +| divisions | Comma-separated list of divisions to install (e.g., engineering,security). Leave empty to install all agents. | string | | # Agency Agents Feature - Additional Notes @@ -29,6 +30,7 @@ No workspace instructions files are created or modified. - Install agents for auto-detected tools (`tool=auto`) - Install agents for a specific tool (`tool=`) +- Install only specific divisions (`divisions=engineering,security`) --- diff --git a/src/agency-agents/devcontainer-feature.json b/src/agency-agents/devcontainer-feature.json index 1553a25..6cb6240 100644 --- a/src/agency-agents/devcontainer-feature.json +++ b/src/agency-agents/devcontainer-feature.json @@ -14,6 +14,11 @@ "type": "boolean", "default": true, "description": "Check for updates on container start" + }, + "divisions": { + "type": "string", + "default": "", + "description": "Comma-separated list of divisions to install (e.g., engineering,security). Leave empty to install all agents." } }, "installsAfter": [ diff --git a/src/agency-agents/postStartCommand.sh b/src/agency-agents/postStartCommand.sh index 5cd6485..cf2aad4 100755 --- a/src/agency-agents/postStartCommand.sh +++ b/src/agency-agents/postStartCommand.sh @@ -12,6 +12,7 @@ export USERNAME="$TARGET_USER" export _REMOTE_USER="$TARGET_USER" export TOOL="${TOOL:-auto}" export AUTOUPDATE="${AUTOUPDATE:-true}" +export DIVISIONS="${DIVISIONS:-}" log() { echo "[agency-agents-poststart] $*" >&2 @@ -104,18 +105,20 @@ do_install() { chown -R "$TARGET_USER":"$TARGET_USER" "$tmp_dir" chmod -R u+rwX,go+rX "$tmp_dir" + local install_args="--no-interactive" + if [ "$tool" = "auto" ]; then + install_args="$install_args --parallel" + else + install_args="$install_args --tool $tool" + fi + if [ -n "$DIVISIONS" ]; then + install_args="$install_args --division $DIVISIONS" + fi + if [ "$(id -un)" = "$TARGET_USER" ]; then - if [ "$tool" = "auto" ]; then - cd "$repo_dir" && HOME="$TARGET_HOME" ./scripts/install.sh --no-interactive --parallel - else - cd "$repo_dir" && HOME="$TARGET_HOME" ./scripts/install.sh --tool "$tool" --no-interactive - fi + cd "$repo_dir" && HOME="$TARGET_HOME" ./scripts/install.sh $install_args else - if [ "$tool" = "auto" ]; then - su - "$TARGET_USER" -c "cd '$repo_dir' && HOME='$TARGET_HOME' ./scripts/install.sh --no-interactive --parallel" - else - su - "$TARGET_USER" -c "cd '$repo_dir' && HOME='$TARGET_HOME' ./scripts/install.sh --tool '$tool' --no-interactive" - fi + su - "$TARGET_USER" -c "cd '$repo_dir' && HOME='$TARGET_HOME' ./scripts/install.sh $install_args" fi if should_install_opencode && [ -d "$opencode_agents_src" ]; then diff --git a/src/agents-workspace/NOTES.md b/src/agents-workspace/NOTES.md index 9d397f6..fcc4fc2 100644 --- a/src/agents-workspace/NOTES.md +++ b/src/agents-workspace/NOTES.md @@ -11,6 +11,7 @@ It supports auto-update by tracking commit IDs from both agents-workspace and ag - Install skills for a specific tool (`tool=opencode|claude|copilot|antigravity`) - Skip agency-agents installation (`includeAgency=false`) - Disable auto-update (`autoupdate=false`) +- Install only specific agency divisions (`divisions=engineering,security`) ## Auto-Update Logic diff --git a/src/agents-workspace/README.md b/src/agents-workspace/README.md index 96594e6..cc4244d 100644 --- a/src/agents-workspace/README.md +++ b/src/agents-workspace/README.md @@ -17,6 +17,7 @@ AI agent workspace with specialist agents for orchestrated, minimal, and self-le |-----|-----|-----|-----| | tool | Tool to install: opencode, claude, copilot, antigravity, all (default: all) | string | all | | includeAgency | Install agency-agents (144+ specialized agents) | boolean | true | +| divisions | Comma-separated list of divisions to install (e.g., engineering,security). Leave empty to install all agents. | string | | | autoupdate | Check for updates on container start | boolean | true | # Agents Workspace Feature - Additional Notes @@ -32,6 +33,7 @@ It supports auto-update by tracking commit IDs from both agents-workspace and ag - Install skills for a specific tool (`tool=opencode|claude|copilot|antigravity`) - Skip agency-agents installation (`includeAgency=false`) - Disable auto-update (`autoupdate=false`) +- Install only specific agency divisions (`divisions=engineering,security`) ## Auto-Update Logic diff --git a/src/agents-workspace/devcontainer-feature.json b/src/agents-workspace/devcontainer-feature.json index da66d18..a66e7f3 100644 --- a/src/agents-workspace/devcontainer-feature.json +++ b/src/agents-workspace/devcontainer-feature.json @@ -15,6 +15,11 @@ "default": true, "description": "Install agency-agents (144+ specialized agents)" }, + "divisions": { + "type": "string", + "default": "", + "description": "Comma-separated list of divisions to install (e.g., engineering,security). Leave empty to install all agents." + }, "autoupdate": { "type": "boolean", "default": true, diff --git a/src/agents-workspace/postStartCommand.sh b/src/agents-workspace/postStartCommand.sh index d78871a..064cd57 100755 --- a/src/agents-workspace/postStartCommand.sh +++ b/src/agents-workspace/postStartCommand.sh @@ -14,6 +14,7 @@ export _REMOTE_USER="$TARGET_USER" export TOOL="${TOOL:-all}" export INCLUDEAGENCY="${INCLUDEAGENCY:-true}" export AUTOUPDATE="${AUTOUPDATE:-true}" +export DIVISIONS="${DIVISIONS:-}" log() { echo "[agents-workspace-poststart] $*" >&2 @@ -75,7 +76,11 @@ do_install() { install_script="$(download_install_script)" log "Running install script from $install_script..." export HOME="$TARGET_HOME" - bash "$install_script" --all || log "Install completed with warnings" + if [ -n "$DIVISIONS" ]; then + bash "$install_script" --all --division "$DIVISIONS" || log "Install completed with warnings" + else + bash "$install_script" --all || log "Install completed with warnings" + fi local remote_final_commit remote_final_commit="$(get_remote_commit "wcgomes/agents-workspace")" diff --git a/test/agency-agents/divisions.sh b/test/agency-agents/divisions.sh new file mode 100644 index 0000000..2550362 --- /dev/null +++ b/test/agency-agents/divisions.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +source dev-container-features-test-lib + +check "postStartCommand script exists" bash -c \ + "ls /usr/local/share/devcontainer-features/agency-agents-postStartCommand.sh 2>/dev/null | grep -q ." + +check "user marker exists" bash -c \ + "ls ~/.local/share/devcontainer-features/agency-agents.done 2>/dev/null | grep -q ." + +reportResults diff --git a/test/agency-agents/scenarios.json b/test/agency-agents/scenarios.json index 92f73dc..4976e0c 100644 --- a/test/agency-agents/scenarios.json +++ b/test/agency-agents/scenarios.json @@ -28,5 +28,13 @@ "tool": "opencode" } } + }, + "divisions": { + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "features": { + "agency-agents": { + "divisions": "engineering,security" + } + } } } diff --git a/test/agents-workspace/divisions.sh b/test/agents-workspace/divisions.sh new file mode 100644 index 0000000..6300b90 --- /dev/null +++ b/test/agents-workspace/divisions.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +source dev-container-features-test-lib + +check "postStartCommand script exists" bash -c \ + "ls /usr/local/share/devcontainer-features/agents-workspace-postStartCommand.sh 2>/dev/null | grep -q ." + +check "user marker exists" bash -c \ + "ls ~/.local/share/devcontainer-features/agents-workspace.done 2>/dev/null | grep -q ." + +reportResults diff --git a/test/agents-workspace/scenarios.json b/test/agents-workspace/scenarios.json index d189fe7..78584e4 100644 --- a/test/agents-workspace/scenarios.json +++ b/test/agents-workspace/scenarios.json @@ -54,5 +54,13 @@ "features": { "agents-workspace": {} } + }, + "divisions": { + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "features": { + "agents-workspace": { + "divisions": "engineering,security" + } + } } } \ No newline at end of file