Shared AgentWorkforce primitives for persona-driven orchestration.
A persona is the runtime source of truth:
- prompt (
systemPrompt) - model
- harness
- harness settings
- optional
skillsarray of{ id, source, description }entries for reusable capability guidance (e.g. prpm.dev packages)
Each persona supports service tiers:
bestbest-valueminimum
Tiering controls depth, latency budget, and model cost envelope — not the quality bar. All tiers should enforce the same correctness/safety standards; lower tiers should be more concise, not lower-quality.
A routing profile is policy-only. It does not carry runtime fields; it only selects which persona tier to use per intent and explains why.
packages/workload-router— TypeScript SDK for typed persona + routing profile resolution.
personas/frontend-implementer.jsonpersonas/code-reviewer.jsonpersonas/architecture-planner.jsonpersonas/requirements-analyst.jsonpersonas/debugger.jsonpersonas/security-reviewer.jsonpersonas/technical-writer.jsonpersonas/verifier.jsonpersonas/test-strategist.jsonpersonas/tdd-guard.jsonpersonas/flake-hunter.jsonpersonas/opencode-workflow-specialist.jsonpersonas/npm-provenance-publisher.json
packages/workload-router/routing-profiles/default.jsonpackages/workload-router/routing-profiles/schema.json
import { resolvePersona, materializeSkillsFor } from '@agentworkforce/workload-router';
const selection = resolvePersona('npm-provenance');
// selection -> { personaId, tier, runtime, skills, rationale }
// selection.runtime.harness -> opencode | codex | claude
// selection.runtime.model -> concrete model
// selection.skills -> [{ id, source, description }, ...]
// Turn the persona's declared skills into a harness-correct install plan.
const plan = materializeSkillsFor(selection);
for (const install of plan.installs) {
// e.g. ['npx', '-y', 'prpm', 'install', 'prpm/npm-trusted-publishing', '--as', 'codex']
spawnSync(install.installCommand[0], install.installCommand.slice(1), { stdio: 'inherit' });
}- Map user request to
intent:implement-frontendreviewarchitecture-planrequirements-analysisdebuggingsecurity-reviewdocumentationverificationtest-strategytdd-enforcementflake-investigationopencode-workflow-correctnessnpm-provenance
- Resolve profile policy + persona runtime via
resolvePersona(intent). - Spawn subagent with returned harness/model/settings/prompt.
See runnable mapping example:
examples/openclaw-routing.ts
This keeps runtime configuration in personas, while routing policy stays explicit, typed, and auditable.
A persona can declare a skills array of reusable capability packages (e.g. from prpm.dev):
"skills": [
{
"id": "prpm/npm-trusted-publishing",
"source": "https://prpm.dev/packages/prpm/npm-trusted-publishing",
"description": "OIDC-based npm publish without long-lived tokens"
}
]Persona JSON is harness-agnostic — it declares what skill is needed, not how to install it. The SDK's materializeSkills(skills, harness) / materializeSkillsFor(selection) helper turns the declaration into a concrete install plan, routing each skill to the right on-disk convention per harness:
| Harness | Install flag | Skill directory |
|---|---|---|
claude |
prpm install --as claude |
.claude/skills/ |
codex |
prpm install --as codex |
.agents/skills/ |
opencode |
prpm install --as opencode |
.agents/skills/ |
Each returned SkillInstall carries an argv-style installCommand, installedDir, and installedManifest path. The helper is pure — it never shells out or touches disk — so callers (relay workflows, OpenClaw spawners, ad-hoc scripts) decide how to execute it. Once installed, Claude Code auto-discovers skills from .claude/skills/; for other harnesses, read the manifest off disk and inject it into the agent's task body.
Next step is a benchmark harness to score persona/tier combinations on:
- quality (task pass rate)
- cost
- latency
Then publish a versioned “recommended tier map” so default routing is data-backed.
corepack enable
pnpm install
pnpm run checkThis runs minimal guardrails across the workspace:
lint(currently TypeScript-only)typecheck(package + examples)test(Node test runner)