pstack portable
Provider-native Claude Code and Codex ports of pstack. This repository vendors only the pstack subtree. It does not port the other plugins beside pstack in the upstream repository.
The source snapshot is immutable under upstream/pstack/. dist/claude/ and dist/codex/ are deterministic generated artifacts. Provider-neutral files are copied byte for byte. Every transformed, omitted, renamed, or added file is classified in portability/manifests/ with source and output hashes.
The current compatibility label is behavior-unverified. Static checks prove provenance, deterministic generation, exact-copy bytes, declared adaptations, native package validity, role mappings, managed-file guards, links, and absence of source-provider mechanics. They do not prove identical model behavior.
Install
Generate and verify first:
npm run generate
npm test
npm run verify
Then run the interactive installer:
node scripts/install.mjs
It detects installed providers, asks which providers to register, and asks for native scope per provider. Non-interactive examples:
node scripts/install.mjs --provider claude --scope personal
node scripts/install.mjs --provider codex --scope project --project /absolute/path/to/repo
node scripts/install.mjs --provider claude,codex --scope personal
The installer uses provider-native registration. Claude Code registers this repository as a marketplace and installs pstack with native user, project, or local scope. Codex registers a personal or project marketplace and activates pstack with codex plugin add. Codex's CLI registration is machine-level even for a project marketplace; the marketplace source, plugin pointer, and sticky instruction remain project-scoped. Both providers cache installed plugins, so rerun the installer after regeneration.
The unified repository remains the source of truth. The installer creates ~/.pstack/providers/<provider> as a stable runtime pointer for setup and bundled scripts. It never creates .pstack/skills.
After installation, start a new provider session and run the provider-native setup skill:
- Claude Code:
/pstack:setup-pstack
- Codex:
$pstack:setup-pstack
Setup validates the effective model roster, stores sparse personal overrides under ~/.pstack/config/, and compiles guarded native agent profiles. Plugin scope never commits personal model choices to a project. Until setup has run and a new session has loaded those profiles, every role-using workflow fails closed instead of falling back to a generic agent.
Isolated end-to-end simulation
To exercise the README install flow without changing real Claude Code or Codex state:
npm run simulate-install
The simulation creates temporary personal, project, and Claude-local roots, runs the real installer against deterministic provider CLI shims, resolves each native marketplace, copies each plugin into an emulated provider cache, verifies the cached bytes, and runs both installed setup compilers with the shipped model rosters. It rejects arbitrary shim directories and refuses the real home directory. Successful temporary state is removed automatically; use npm run simulate-install -- --keep to preserve it for inspection.
This proves the repository-owned install, path, discovery, cache, and profile-compilation contracts. It does not authenticate either provider, make model calls, or prove undocumented provider-internal cache behavior. The real provider validators remain a separate final check.
Model routing
Skills call stable semantic profile names such as pstack-role-feature, pstack-role-how-explorer, and pstack-role-arena-runner-1. Shipped defaults live in config/defaults/. A model release or retirement changes one sparse provider mapping and regenerated native profiles, not dozens of prompts.
Workflow-specific panel slots remain separate. Arena runners, Arena judges, How critics, Architect runners, and Interrogate reviewers do not share one accidental four-model setting. Exact fan-out is preserved; a provider limit surfaces as an error instead of silently shrinking the run.
See the porting design for the complete mapping boundary and capability decisions.
Update the upstream snapshot