name: setup-pstack description: Configure how pstack chooses cloud agent modes, local subagent profiles, and permission posture across Devin Cloud and Devin Desktop. Use for /setup-pstack, "configure pstack models", "pstack budget", or changing pstack execution choices.
Setup pstack
Write ~/.devin/rules/pstack-models.md, an always-on rule that sets pstack execution choices per role. Cloud values are Devin agent modes. Local values are subagent profiles, not raw model slugs. These are different domains.
Read ../poteto-mode/references/execution-router.md before changing execution behavior. Every lane decision uses cloud-native, local-full, or blocked language.
Steps
1. Probe the runtime
Classify the current session before asking questions.
cloud-native: direct cloud orchestration tools are available.local-full: any local Desktop/CLI session. All execution is local; there is no cloud control plane.blocked: only physical impossibilities (lid-closed execution, Windows platform coverage).
Also probe, without printing secrets:
- Whether local subagents are enabled.
- Whether
scripts/local_schedule.py probeshows CLI auth, since unattended durability depends on it. - Whether
devinis onPATHor at the Desktop app bundled path. - Whether
devin auth statusis authenticated in the shell. Treat this as shell CLI state, not proof of Desktop auth state. - Whether
devin models list --format jsonreturns local models. If it fails, use the default subagent model policy rather than inventing model names.
When the plugin checkout is available, python3 scripts/probe_devin_local.py --json is the preferred probe. Otherwise inspect the live tool surface directly.
2. Load and migrate current state
The current rule is ~/.devin/rules/pstack-models.md. If it exists, read it before writing anything.
Accepted current shape:
cloud_modes:
feature, refactoring: ultra
local_profiles:
swarm workers: devin-pstack:poteto-agent
Migration rules:
- A file with top-level role lines such as
feature, refactoring: ultrais format version 3 or older. Move those values undercloud_modesand preserve them. - Retired roles such as
hardest tasks,architect runners,reflect tooling, andwhy investigatorsare dropped. - Raw Cursor-era effort slugs in cloud values map by effort:
xhigh→ultra,high→normal,medium→fast,lowor unmapped →lite. - Raw model slugs are not valid local profile names. Do not copy them into
local_profiles. inherit-parentandautoremain valid cloud aliases. In local configuration they meansubagent_general, because that profile follows the parent model.
Tell the user which lines you migrated or dropped.
3. Choose cloud role modes
Use the existing budget flow for cloud lanes.
Offer these exact budget labels, preferring the structured question tool:
large — ultra defaultmedium — normal defaultsmall — fast default
Apply the budget on the cloud ladder ultra > fusion > normal > fast > fast-ultra > lite. large keeps the default, medium lowers one step, and small lowers two steps.
Defaults:
cloud_modes:
feature, refactoring: ultra
bug-fix: ultra
perf-issue: ultra
hillclimb: ultra
judgment and prose: ultra
arena runners: ultra, fusion, fast-ultra
arena cross-judge pool: fusion, normal
swarm workers: normal
interrogate reviewers: ultra, fusion, fast-ultra
Validate every real cloud mode before writing it. In a cloud-native session use the available direct evidence you have, including a devin_session_create 400 that lists allowed modes. In a local session without cloud evidence, offer the documented set and let the user remove unavailable modes. Never write a mode the user rejects. inherit-parent and auto are always valid aliases and mean omit devin_mode for cloud children.
4. Choose local role profiles
Local execution uses profiles because run_subagent takes a profile, not a model or devin_mode.
Defaults:
local_profiles:
research: subagent_explore
workers: devin-pstack:poteto-agent
verification: devin-pstack:poteto-agent
swarm workers: devin-pstack:poteto-agent
judgment and prose: devin-pstack:poteto-agent
Meanings:
subagent_exploreis read-only research on the default subagent model.devin-pstack:poteto-agentis the plugin's write-capable pstack delegate.subagent_generalfollows the parent's model and can cost as much as another parent session. Use it only when the user chooses parent-model parity.
If the user wants pinned local models and detection proves the model ids or aliases, generate user-level profiles under ~/.config/devin/agents/ with distinct names such as pstack-worker-opus.md or pstack-worker-swe.md. Each profile needs only name, description, model, and the system prompt. Do not pin a model that detection did not find or the user did not confirm. Do not overwrite a user file without showing the diff.
If local models cannot be detected, write the default profile mapping above and record local_model_policy: default-subagent-model. This is a safe configuration, not a failure.
5. Choose permission posture
Background local subagents cannot prompt for new permission. Unapproved tools are denied. Offer three choices:
foreground-first— safest default. Write-capable workers start in the foreground.preflight-then-background— the parent first runs or requests the small command set workers need, then backgrounds them.explicit-rules— the user writes exact permission rules in Devin settings. Do not write broad bypass rules for them.
Never enable Bypass as part of setup. A background worker that fails on permissions may be resumed once in the foreground. A second failure is blocked.
6. Write the rule
Write ~/.devin/rules/pstack-models.md atomically enough for a config file: build the full contents, show or summarize them, then overwrite the file. Use Devin-native rule frontmatter. Shape:
---
description: pstack per-role execution choices for cloud modes and local subagent profiles
trigger: always_on
---
# pstack execution configuration
Cloud values are Devin agent modes. Local values are subagent profiles. `inherit-parent` or `auto` in `cloud_modes` means omit `devin_mode`. In `local_profiles` it means `subagent_general`.
# defaults: 4
# budget: large (ultra)
# local_model_policy: default-subagent-model
# permission_posture: foreground-first
cloud_modes:
feature, refactoring: ultra
bug-fix: ultra
perf-issue: ultra
hillclimb: ultra
judgment and prose: ultra
arena runners: ultra, fusion, fast-ultra
arena cross-judge pool: fusion, normal
swarm workers: normal
interrogate reviewers: ultra, fusion, fast-ultra
local_profiles:
research: subagent_explore
workers: devin-pstack:poteto-agent
verification: devin-pstack:poteto-agent
swarm workers: devin-pstack:poteto-agent
judgment and prose: devin-pstack:poteto-agent
Preserve user overrides on reruns unless the user asks for a reset.
7. Confirm the lanes
Report four lines:
- Cloud lane: configured modes, or
unavailable in this session. - Local lane: profile mapping and permission posture.
- Durability posture: whether CLI auth is present for launchd unattended runs, or modes degrade to session-scoped. Physical limits: lid-closed execution and Windows coverage.
Local sessions have no cloud dependency. Report what the local lane provides and the two physical limits (lid-closed, Windows).
8. Offer verification skills
Keep the existing optional offers:
- If the project has no way to drive the real app for proof, offer
/create-verification-skillonce. - If the project has no formal verification skill, offer
/create-formal-verification-skillonce.
Do not push either offer after a no.