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
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ workers run in isolated containers, never push to git directly, and upload `patc

set it up with [`/setup-agystack`](./skills/setup-agystack/SKILL.md) with your Google Cloud auth and run [`/swarm`](./skills/swarm/SKILL.md) to dispatch.

### summoning cloud agents (Gemini & DeepSeek)

Cloud swarms run on Google Cloud Run with zero-friction serverless models:

```bash
# list supported cloud models and tiers
python3 skills/swarm/scripts/cloud_dispatch.py --list-models

# fan out 5 Gemini Argon agents
python3 skills/swarm/scripts/cloud_dispatch.py --tasks 5 --model gemini-4-argon

# fan out 5 DeepSeek Flash 4.1 agents
python3 skills/swarm/scripts/cloud_dispatch.py --tasks 5 --model deepseek-v4.1-flash
```

Or trigger `/swarm` right in chat:
- `/swarm 5 workers using Gemini Argon to test src/`
- `/swarm 5 workers using DeepSeek Flash to explore hypotheses`

## skills

[`/poteto-mode`](./skills/poteto-mode/SKILL.md) runs most of these for you when a step needs them (`how`, `why`, `architect`, `arena`, `swarm`, `interrogate`, `unslop`, `no-comments`, `technical-writing`, `tdd`, and the principles). the table below is for when you want one directly:
Expand Down
4 changes: 4 additions & 0 deletions rules/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Mirroring pstack in Cursor, enforce strict separation between coordination and c
- **Interactive State-Changing Playbooks (`Feature`, `Refactoring`, `Multi-phase`):** Mandatory `implementation_plan.md` with `RequestFeedback: true` before coding; mandatory `walkthrough.md` with pass receipts upon completion.
- **Autonomous & Hillclimb Playbooks (`Autonomous run`, `Hillclimb`, `Swarm`, `/goal`, `/loop`):** Unattended throughput invariant. Use `RequestFeedback: false`. Domain deliverables (`decision_trail.md`, `score.json`, `receipts/`) take precedence without interactive blocking.
- **Read-Only Investigation Playbooks (`Investigation`, `How`, `Why`, `Runtime Forensics`):** Produces `investigation_report.md` with `RequestFeedback: false`.
6. **Cloud Swarm Model Selection & Zero-Friction Fallback:**
- **Prefer Tier 1 Serverless Models:** Default to frictionless serverless models that require zero console forms: `gemini-3.8-flash`, `gemini-4-argon`, or `deepseek-v4.1-flash` (MaaS).
- **Gated Partner Gating Detection:** If a user requests an Anthropic partner model (`claude-3-opus`, `claude-3-5-sonnet`) that is not yet enabled in Vertex AI Model Garden, explain that Google enforces a one-time console form click-through that agents cannot accept programmatically, and immediately offer the Tier 1 zero-friction alternative.
- **Open-Weights vs. MaaS Distinction:** Models like `GLM 5.3` or `Llama 3.3` on Model Garden are deployable open-weights requiring dedicated GPU endpoints (8x H100/B200 instances), not on-demand serverless APIs. Never attempt to dispatch Cloud Run tasks against deploy-only models without an active dedicated endpoint.

## Surface Precedence Hierarchy

Expand Down
9 changes: 8 additions & 1 deletion skills/setup-agystack/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ Do not leave the user to do the work. Complete the deployment end-to-end for the

### 2. Detect available models

Enumerate the model tiers you can pass to `invoke_subagent`:
Enumerate the model tiers you can pass to `invoke_subagent` (local) and `cloud_dispatch.py` (Cloud Run):

**Local subagent tiers (`invoke_subagent`):**
- `pro`: High-capability tier (maximum reasoning budget for complex code, architecture, and hard tasks)
- `flash`: Balanced fast tier (fast execution for exploration and standard generation)
- `flash_lite`: Lightweight tier (minimal latency for quick lookups)
- `inherit` (or `auto`): Inherit parent chat model

**Cloud Run swarm model tiers (`cloud_dispatch.py`):**
- **Tier 1 (Zero-Friction MaaS):** `gemini-4-argon`, `gemini-3.8-flash`, `deepseek-v4.1-flash` (Instant on global Vertex endpoint, zero forms).
- **Tier 2 (Gated Partner MaaS):** `claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-opus` (Requires one-time Console agreement).
- **Tier 3 (Dedicated GPU Endpoint):** Open-weights models like `glm-5-3-flash` requiring dedicated 8x H100/B200 GPU instances.

### 3. Load current state

If `~/.gemini/config/plugins/agystack/rules/agystack-models.md` exists, read its current role assignments. Otherwise start from skill defaults.
Expand Down
27 changes: 22 additions & 5 deletions skills/setup-agystack/scripts/setup_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ def check_model_garden(project_id=None, region="us-central1", run_cmd_fn=None, i
"project_id": project,
"region": region,
"anthropic_installed": False,
"serverless_models": [
"gemini-4-argon",
"gemini-3.8-flash",
"gemini-3.1-pro",
"deepseek-v4.1-flash-maas",
],
"partner_models": [
"claude-3-7-sonnet@20250219",
"claude-3-5-sonnet-v2@20241022",
Expand All @@ -140,9 +146,8 @@ def check_model_garden(project_id=None, region="us-central1", run_cmd_fn=None, i
result["error"] = f"Failed to initialize AnthropicVertex client: {init_exc}"
return result
except ImportError:
result["ok"] = False
result["error"] = "Package 'anthropic[vertex]' is not installed (run: pip install anthropic[vertex])"
return result
result["anthropic_installed"] = False
result["partner_models_note"] = "Optional package 'anthropic[vertex]' not installed for Claude partner models."
except Exception as exc:
result["ok"] = False
result["error"] = f"Error importing 'anthropic': {exc}"
Expand Down Expand Up @@ -576,6 +581,17 @@ def create_project(project_id):
run_cmd(["gcloud", "projects", "create", project_id])
print("Setting active project...")
run_cmd(["gcloud", "config", "set", "project", project_id])
try:
res = run_cmd(["gcloud", "billing", "accounts", "list", "--format=json"], check=False)
if getattr(res, "returncode", 1) == 0:
accounts = json.loads(getattr(res, "stdout", "[]"))
open_accounts = [a for a in accounts if a.get("open", False)]
if open_accounts:
billing_id = open_accounts[0].get("name", "").split("/")[-1]
print(f"Linking billing account {billing_id} to project {project_id}...")
run_cmd(["gcloud", "billing", "projects", "link", project_id, f"--billing-account={billing_id}"], check=False)
except Exception:
pass

def enable_apis(project_id):
print(f"Enabling APIs for {project_id}...")
Expand Down Expand Up @@ -711,7 +727,7 @@ def _ignore_copy(directory, contents):
ignored.add(item)
continue
resolved_item = (dir_p / item).resolve()
if resolved_item == dst_resolved or resolved_item == scripts_path:
if resolved_item == dst_resolved or resolved_item == scripts_path or scripts_path in resolved_item.parents or resolved_item in scripts_path.parents:
ignored.add(item)
return ignored

Expand All @@ -723,7 +739,8 @@ def _ignore_copy(directory, contents):
"gcloud", "builds", "submit",
f"--tag={image_tag}",
scripts_dir,
f"--project={project_id}"
f"--project={project_id}",
f"--region={region}"
], capture_output=False)
finally:
for staged in staged_dirs:
Expand Down
10 changes: 10 additions & 0 deletions skills/swarm/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ Spawn all N workers in one `invoke_subagent` call with `TypeName: "poteto-agent"

Cloud Run swarms enable parallel execution across dozens or hundreds of container tasks.

**Model Selection & Friction Tiers:**

Before launching cloud swarms, match the model to the project's Model Garden enablement status:

| Tier | Models | Endpoint Type | Friction | Setup Required |
|---|---|---|---|---|
| **Tier 1: Native MaaS** | `gemini-4-argon`, `gemini-3.8-flash`, `deepseek-v4.1-flash` | Global Serverless | **Zero** | Instant via existing ADC / project IAM |
| **Tier 2: Gated Partner MaaS** | `claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-opus` | Regional Serverless | **Low / One-Time** | Console agreement click-through required |
| **Tier 3: Dedicated GPU** | `glm-5-3-flash`, `llama-3.3-70b` | Dedicated Endpoint | **High** | Dedicated 8x H100/B200 GPU instance provisioning |

**Quota & Auth Prerequisites:**
- **Paid Tier API Key or Vertex AI:** Cloud Run swarms require either a paid Google AI Studio tier (Pay-as-you-go / Tier 1+) or verified Vertex AI permissions (`roles/aiplatform.user` on the target project). Free-tier API keys (5 RPM) are prohibited as parallel container workers will immediately exhaust quota and fail.
- **Git Authentication:** A valid GitHub token (`gh auth token` or `GH_TOKEN` / `GITHUB_TOKEN`) with repository clone access. Under the zero-push architecture, cloud containers do not require git push access.
Expand Down
Loading
Loading