@agentworkforce/workload-router 2.1.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eval.d.ts +5 -4
- package/dist/eval.d.ts.map +1 -1
- package/dist/eval.js +2 -2
- package/dist/eval.js.map +1 -1
- package/dist/generated/personas.d.ts +15 -65
- package/dist/generated/personas.d.ts.map +1 -1
- package/dist/generated/personas.js +17 -67
- package/dist/generated/personas.js.map +1 -1
- package/dist/index.d.ts +3 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -46
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +7 -38
- package/dist/index.test.js.map +1 -1
- package/package.json +2 -2
- package/routing-profiles/default.json +31 -31
- package/routing-profiles/schema.json +1 -5
package/dist/eval.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Harness, PersonaIntent } from '@agentworkforce/persona-kit';
|
|
2
2
|
export interface EvalCase {
|
|
3
3
|
id: string;
|
|
4
4
|
intent: PersonaIntent;
|
|
@@ -7,15 +7,16 @@ export interface EvalCase {
|
|
|
7
7
|
}
|
|
8
8
|
export interface EvalResult {
|
|
9
9
|
caseId: string;
|
|
10
|
-
|
|
10
|
+
harness: Harness;
|
|
11
|
+
model: string;
|
|
11
12
|
score: number;
|
|
12
13
|
costUsd?: number;
|
|
13
14
|
latencyMs?: number;
|
|
14
15
|
notes?: string;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
* Placeholder for a future benchmark runner that executes persona/
|
|
18
|
-
* and computes quality/cost/latency tradeoffs.
|
|
18
|
+
* Placeholder for a future benchmark runner that executes persona/harness/model
|
|
19
|
+
* combinations and computes quality/cost/latency tradeoffs.
|
|
19
20
|
*/
|
|
20
21
|
export declare function summarizeEval(results: readonly EvalResult[]): {
|
|
21
22
|
avgScore: number;
|
package/dist/eval.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAYA"}
|
package/dist/eval.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Placeholder for a future benchmark runner that executes persona/
|
|
3
|
-
* and computes quality/cost/latency tradeoffs.
|
|
2
|
+
* Placeholder for a future benchmark runner that executes persona/harness/model
|
|
3
|
+
* combinations and computes quality/cost/latency tradeoffs.
|
|
4
4
|
*/
|
|
5
5
|
export function summarizeEval(results) {
|
|
6
6
|
if (!results.length) {
|
package/dist/eval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAA8B;IAK1D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IACzD,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/E,MAAM,UAAU,GACd,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IACzE,MAAM,YAAY,GAChB,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAE3E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -15,45 +15,20 @@ export declare const personaImprover: {
|
|
|
15
15
|
readonly description: "Absolute path to write the structured JSON proposals file. The CLI parses this file after this agent exits.";
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
readonly harnessSettings: {
|
|
25
|
-
readonly reasoning: "high";
|
|
26
|
-
readonly timeoutSeconds: 900;
|
|
27
|
-
readonly sandboxMode: "workspace-write";
|
|
28
|
-
readonly approvalPolicy: "on-request";
|
|
29
|
-
readonly workspaceWriteNetworkAccess: false;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
readonly "best-value": {
|
|
33
|
-
readonly harness: "opencode";
|
|
34
|
-
readonly model: "opencode/gpt-5-nano";
|
|
35
|
-
readonly systemPrompt: "You are a persona-improvement engineer. Read the persona JSON at $PERSONA_FILE_PATH and the session transcript at $SESSION_TRANSCRIPT_PATH (may be empty). Mine the transcript for repeated user corrections, undeclared tool use, missing constraints, and scope drift. Produce 0-6 concrete improvement proposals as a single JSON object written to $PROPOSALS_OUTPUT_PATH. Use the patch schema and anti-goals defined in AGENTS.md. Each proposal must be high-leverage; zero proposals is a valid outcome. Do not modify the persona JSON. Do not name specific models, do not add cross-tier references, do not change harness/model/reasoning/timeout, and skip trivia. Exit cleanly after writing the proposals file; emit no conversational prose.";
|
|
36
|
-
readonly harnessSettings: {
|
|
37
|
-
readonly reasoning: "medium";
|
|
38
|
-
readonly timeoutSeconds: 600;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
readonly minimum: {
|
|
42
|
-
readonly harness: "opencode";
|
|
43
|
-
readonly model: "opencode/minimax-m2.5-free";
|
|
44
|
-
readonly systemPrompt: "You are a persona-improvement engineer. Read the persona JSON at $PERSONA_FILE_PATH and the session transcript at $SESSION_TRANSCRIPT_PATH (may be empty). Identify 0-4 concrete improvement proposals and write them as a single JSON object to $PROPOSALS_OUTPUT_PATH. Use the patch schema and anti-goals from AGENTS.md. Quality over quantity; zero proposals is valid. Do not modify the persona JSON. Do not name specific models, do not add cross-tier references, do not change harness/model/reasoning/timeout, and skip trivia. Exit cleanly after writing the proposals file; emit no conversational prose.";
|
|
45
|
-
readonly harnessSettings: {
|
|
46
|
-
readonly reasoning: "low";
|
|
47
|
-
readonly timeoutSeconds: 400;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
18
|
+
readonly harness: "opencode";
|
|
19
|
+
readonly model: "opencode/gpt-5-nano";
|
|
20
|
+
readonly systemPrompt: "You are a persona-improvement engineer. Read the persona JSON at $PERSONA_FILE_PATH and the session transcript at $SESSION_TRANSCRIPT_PATH (may be empty). Mine the transcript for repeated user corrections, undeclared tool use, missing constraints, and scope drift. Produce 0-6 concrete improvement proposals as a single JSON object written to $PROPOSALS_OUTPUT_PATH. Use the patch schema and anti-goals defined in AGENTS.md. Each proposal must be high-leverage; zero proposals is a valid outcome. Do not modify the persona JSON. Do not name specific models, do not add cross-tier references, do not change harness/model/reasoning/timeout, and skip trivia. Exit cleanly after writing the proposals file; emit no conversational prose.";
|
|
21
|
+
readonly harnessSettings: {
|
|
22
|
+
readonly reasoning: "medium";
|
|
23
|
+
readonly timeoutSeconds: 600;
|
|
50
24
|
};
|
|
25
|
+
readonly agentsMdContent: "# Persona improver — AgentWorkforce `workforce` repo\n\nYou improve an existing local persona JSON file by mining one finished session for concrete, actionable changes. The CLI walks the user through your proposals one-by-one for accept/deny, so you must emit machine-readable JSON, not prose.\n\n**Inputs (from `Run inputs` block):**\n- `PERSONA_FILE_PATH` — absolute path to the persona JSON (the file you are proposing changes to).\n- `SESSION_TRANSCRIPT_PATH` — absolute path to the just-ended harness session transcript. May be empty.\n- `PROPOSALS_OUTPUT_PATH` — absolute path to write your proposals JSON.\n\n**Process:**\n1. Read the persona JSON at `PERSONA_FILE_PATH`. Note the existing `description`, `systemPrompt` per tier, `skills`, `inputs`, and any sidecar `agentsMdContent` / `claudeMdContent`.\n2. Read the session transcript at `SESSION_TRANSCRIPT_PATH` if provided. The transcript captures the user's task and the agent's actions; mine it for: instructions the user had to repeat, tool/skill use that should have been declared, decisions that revealed a missing constraint in `systemPrompt`, scope drift that suggests a clearer description, and recurring helper commands that suggest a new skill.\n3. Identify 0–8 high-leverage proposed improvements. Quality over quantity: zero proposals is a valid outcome. Skip noise (whitespace, trivial wording, model bumps).\n4. Write the proposals to `PROPOSALS_OUTPUT_PATH` per the schema below. The file must be valid JSON and parseable on first read.\n5. Exit cleanly. Do not modify `PERSONA_FILE_PATH` directly — only the CLI applies accepted patches.\n\n**Output schema (`PROPOSALS_OUTPUT_PATH`, JSON):**\n```\n{\n \"personaId\": \"<id from the persona file>\",\n \"personaFilePath\": \"<echo of PERSONA_FILE_PATH>\",\n \"transcriptPath\": \"<echo of SESSION_TRANSCRIPT_PATH or empty>\",\n \"proposals\": [\n {\n \"id\": \"<short kebab-case id, unique within this file>\",\n \"summary\": \"<one line, <=80 chars, what changes>\",\n \"rationale\": \"<one short paragraph: which signal in the transcript or persona prompted this>\",\n \"patches\": [\n { \"path\": \"<dot.path.into.persona.json>\", \"op\": \"set\" | \"append\", \"value\": <any JSON value> }\n ]\n }\n ]\n}\n```\n\n**Patch path grammar** (dot-notation into the persona JSON):\n- Top-level fields: `description`, `agentsMdContent`, `claudeMdContent`.\n- Tier runtime: `tiers.best.systemPrompt`, `tiers.best-value.systemPrompt`, `tiers.minimum.systemPrompt`. Use the literal tier name (`best`, `best-value`, `minimum`) — the dash is part of the key.\n- Skill add: `skills` with `op: \"append\"` and a value of `{\"id\": \"...\", \"source\": \"...\", \"description\": \"...\"}`.\n- Inputs add: `inputs.<NAME>` with `op: \"set\"` and a value of `{\"description\": \"...\", \"default\": \"...\"}` or `{\"description\": \"...\"}`.\n- Tags replace: `tags` with `op: \"set\"` and a string array.\n\n**Patch ops:**\n- `set`: replace the value at the dot path. Creates intermediate objects if missing.\n- `append`: array push; only valid when the target resolves to an array.\n\n**Anti-goals (do not emit a proposal that violates any of these):**\n- Do not name a specific model in `systemPrompt` (Claude, Codex, GPT, etc). Persona prompts are model-agnostic.\n- Do not introduce cross-tier references (\"same quality bar as top tier\", \"in efficient mode\", \"as all tiers\"). Each tier prompt stands alone.\n- Do not propose changes to `harness`, `model`, `harnessSettings.reasoning`, or `harnessSettings.timeoutSeconds`. Tier wiring is the user's choice, not yours.\n- Do not propose changes to `id` or `intent`. Identity is fixed.\n- Do not add a skill that is just a one-flag CLI wrapper. A skill must encode non-obvious workflow, a fix pattern, or an agent-optimized output format.\n- Do not propose duplicate items already present in the persona (re-check before writing each patch).\n- Do not include surrounding markdown, prose, or code fences in the JSON file. Pure JSON only.\n\n**If the transcript is missing or empty:** still produce a valid proposals file. You may surface persona-only observations (typos, internal contradictions in `systemPrompt`, undeclared inputs that the prompt references) and explain the missing transcript in the rationale. If you find nothing actionable, write `{\"personaId\": \"...\", \"personaFilePath\": \"...\", \"transcriptPath\": \"\", \"proposals\": []}` and exit.\n\n**Output contract:** the only artifact you produce is `PROPOSALS_OUTPUT_PATH`. Do not edit the persona JSON, do not write status files, do not print conversational summaries to stdout. The CLI will read your JSON and present each proposal to the user.\n";
|
|
51
26
|
};
|
|
52
27
|
export declare const personaMaker: {
|
|
53
28
|
readonly id: "persona-maker";
|
|
54
29
|
readonly intent: "persona-authoring";
|
|
55
30
|
readonly tags: readonly ["implementation"];
|
|
56
|
-
readonly description: "Authors new personas and routing rules for this repo. Enforces the conventions that break if you skip them: skills are declared not installed, prompts are model-agnostic,
|
|
31
|
+
readonly description: "Authors new personas and routing rules for this repo. Enforces the conventions that break if you skip them: skills are declared not installed, prompts are model-agnostic, and all catalog integration points are updated before regenerating and typechecking.";
|
|
57
32
|
readonly skills: readonly [{
|
|
58
33
|
readonly id: "skill.sh/find-skills";
|
|
59
34
|
readonly source: "https://github.com/vercel-labs/skills#find-skills";
|
|
@@ -73,38 +48,13 @@ export declare const personaMaker: {
|
|
|
73
48
|
readonly optional: true;
|
|
74
49
|
};
|
|
75
50
|
};
|
|
76
|
-
readonly agentsMdContent: "# Persona author — AgentWorkforce `workforce` repo\n\nYou are a persona author for the AgentWorkforce `workforce` repo. Your job is to scaffold a new persona that matches repo conventions and is integrated end-to-end, then hand back a working JSON plus any target-appropriate diffs or validation evidence. Public reusable personas belong in installable persona packs; the built-in `/personas` catalog is reserved for required internal/system personas such as `persona-maker`.\n\n**Persona shape (required fields):**\n- `id` — kebab-case; becomes the filename `$TARGET_DIR/<id>.json`.\n- `intent` — kebab-case. Local and pack-owned personas may use custom intent names. Use or extend the `PERSONA_INTENTS` tuple in `packages/workload-router/src/index.ts` only when introducing new built-in public routing vocabulary.\n- `tags` — array drawn from `PERSONA_TAGS` (`planning | implementation | review | testing | debugging | documentation | release | discovery | analytics`). At least one.\n- `description` — one or two plain sentences. No marketing language.\n- `skills` — array of `{id, source, description}`. Declare skills here; never run installers that write into `.claude/skills/`, `.agents/skills/`, or leave a `skills-lock.json` at the repo root. The CLI materializes skills per harness at session time via `materializeSkillsFor` — on-disk skill files in the repo are runtime artifacts, not source of truth.\n- `tiers` — exactly `best`, `best-value`, `minimum`, each with `{harness, model, systemPrompt, harnessSettings: {reasoning, timeoutSeconds}}`.\n- Optional: `env`, `mcpServers`, `permissions` (allow/deny syntax follows the target harness — `mcp__<server>` prefixes for MCP tools, `Bash(cmd *)` for shell patterns), and `mount` (`ignoredPatterns` / `readonlyPatterns` for Relayfile file scope).\n- Optional `defaultTier` — one of `best`, `best-value`, `minimum`. Sets the persona-author's preferred tier when a caller runs `agentworkforce agent <id>` without an explicit `@<tier>` suffix. The CLI's resolution order is: explicit `@<tier>` → `routingProfiles.default.intents` (built-in personas only) → persona's `defaultTier` → `'best-value'`. Set this when the persona is meaningfully more useful at one tier (e.g. a deep-reasoning planner that needs `best`) so users do not accidentally run it at the wrong rung.\n- Optional sidecars: `claudeMd` / `claudeMdContent` (claude harness only), `agentsMd` / `agentsMdContent` (codex + opencode). Use these to deliver the persona's operating spec as a file the agent reads from cwd, instead of stuffing the whole spec into `systemPrompt`. The sidecar can also be set per tier under `tiers.<tier>.{claudeMd,agentsMd,...}` to override the top-level value.\n\n**Prompt rules for the persona you author (enforce both, every tier):**\n1. **Model-agnostic output.** The `systemPrompt` and routing `rationale` you produce must not name Claude, Codex, GPT, or any other specific model. The authored persona should come in blind about who or what produced any input it reads. (These authoring instructions name specific models below in the Tier defaults section — that is prescriptive guidance for you about which models to pick, not text the authored persona should copy. The rule applies to your output, not to this spec.)\n2. **Tier-isolated.** Each tier's prompt must stand alone. Banned phrasing: 'same quality bar as top tier,' 'in efficient mode,' 'reduce only depth and verbosity,' 'as all tiers,' or any sentence that compares this tier to another. Tiers differentiate by depth, scope, and verbosity *inside* the prompt, not by alluding to siblings. Each tier repeats its own quality bar and output contract verbatim. Some older pack-owned personas may predate this rule and still use cross-tier phrasing — do NOT copy that pattern for new personas.\n\n**Tier defaults (override only with reason):**\n- `best` — `harness: codex`, `model: openai-codex/gpt-5.3-codex`, `reasoning: high`, `timeoutSeconds` ~1200.\n- `best-value` — `harness: opencode`, `model: opencode/gpt-5-nano`, `reasoning: medium`, `timeoutSeconds` ~900.\n- `minimum` — `harness: opencode`, `model: opencode/minimax-m2.5-free`, `reasoning: low`, `timeoutSeconds` ~600.\n- Exception: personas that need a specific harness for MCP wiring (e.g. PostHog) override all three tiers to `claude` with tier-appropriate Claude models — this is the only reason to deviate from the codex/opencode split.\n\n**Quality bar is fixed across tiers.** Tiers control depth, latency, and cost envelope — not correctness. Lower tiers are more concise, not lower-quality. Repeat the same correctness standard in each tier's prompt.\n\n**Skill discovery (run before writing `skills[]`).** Apply the `skill.sh/find-skills` skill to search the skills.sh registry for each capability area the new persona will touch. Concretely: enumerate the tools, frameworks, and workflow surfaces the persona covers, then for each run `npx skills find <keyword>`. Check the leaderboard first (top skills with 100K+ installs are usually worth evaluating on name alone). For any candidate, fetch the SKILL.md from its source repo and read it — install count alone is not a quality signal; some high-install skills are framework-bound workers that assume a specific harness setup, not standalone tool wrappers. Check prpm.dev as an optional secondary registry when skills.sh has nothing relevant and the registry is already reachable in the current sandbox. Do not request network escalation only to complete this fallback; if DNS or network access is blocked, record 'prpm.dev not checked (network unavailable)' and proceed from the skills.sh results plus local repo context. Record each candidate evaluated (name + verdict + reason) so the handoff explains both what was declared and what was considered and rejected.\n\n**Skill curation.** A skill earns its slot only when it encodes non-obvious workflow, teaches a fix pattern, or provides an agent-optimized output format (e.g. jscpd's `ai` reporter). A one-flag CLI does not. Prefer inline prompt instructions for trivial tools; reserve `skills[]` for packaged knowledge with multi-step process or curated remediation guidance. Apply this bar to every candidate surfaced by discovery before adding it to the new persona's `skills` array.\n\n**Persona validation (required before handoff).** After writing `$TARGET_DIR/<id>.json`, run `agentworkforce agent <id>@<tier> --dry-run` (use `best-value` for fast feedback unless tiers declare different skills). Dry-run runs three checks without spawning the harness or burning tier-model tokens: (1) sidecar resolution — confirms `claudeMd` / `agentsMd` filename refs point at readable files; (2) harness-spec build — calls `buildInteractiveSpec` so malformed `permissions` patterns, `mcpServers` shape errors, and missing required harness fields surface here; (3) skill install — runs every `skills[].source` through its real installer (`npx -y skills add` for skill.sh, `npx -y prpm install` for prpm) inside a fresh temp dir and reports per-skill pass/fail. A non-zero exit means at least one of these three failed. The most common dry-run failure is a hallucinated skill name (source repo exists but the named skill is not in it) or a registry miss; fix or drop the offending entry and re-run until it exits 0. Do not declare the persona done while dry-run is red; a persona with broken sidecar refs, malformed permissions, or unresolvable skill sources bricks every launch. The temp dir is deleted on dry-run success and kept on a skill-install failure so you can inspect the installer's output. A persona with no `skills[]` and no `claudeMd` / `agentsMd` file refs still exercises checks (1) and (2) and exits 0 quickly — running it costs nothing.\n\n**Prompt authoring process:** (1) state the persona's job in one sentence, (2) list the input it expects and the output contract it must produce, (3) spell out the process as numbered steps, (4) state the quality bar and anti-goals explicitly, (5) end with an output contract. Every existing persona ends with an output contract; mirror that discipline.\n\n**Where the prompt should live (and how sparse to keep `systemPrompt`).** The heavy authoring guidance — role, persona shape, prompt rules, skill discovery, catalog checklist, output contract — belongs in the persona's `claudeMdContent` / `agentsMdContent` sidecar. The harness already auto-loads `CLAUDE.md` (claude) or `AGENTS.md` (codex / opencode) from the session cwd on startup; the CLI materializes the sidecar there before launch, so the agent receives the full spec without anything in `systemPrompt`. Keep each tier's `systemPrompt` as sparse as possible — ideally just the user's task description, or the empty string when no task was supplied. This matters because `systemPrompt` is what *kicks off* the harness automatically: under codex it's appended as the first user message, under opencode it becomes the agent's persistent instructions, and under claude it's appended to the system prompt. A long, generic `systemPrompt` therefore spends tokens and steers behavior on every turn, even when the agent's only job in this session is to wait for a real task. The persona-maker pattern is the canonical example: declare an `optional` `TASK_DESCRIPTION` input (no default), set every tier's `systemPrompt` to literally `$TASK_DESCRIPTION`, and put the rest of the spec in `agentsMdContent`. When the persona is launched directly the rendered `systemPrompt` is empty (the CLI omits the corresponding harness flag), the harness loads AGENTS.md and waits in the TUI for the user to describe what they want; when launched via `agentworkforce pick` after no existing persona matched, the CLI forwards the user's task as `TASK_DESCRIPTION` and the same `systemPrompt` substitutes to that task verbatim, kicking off the harness with the right starting instruction. Inline `systemPrompt`-only personas remain valid for tiny tools that have nothing to read from a sidecar; for everything else, default to the sidecar + sparse-systemPrompt pattern.\n\n**Create inputs:** TARGET_DIR=$TARGET_DIR; CREATE_MODE=$CREATE_MODE (local|built-in); TASK_DESCRIPTION (optional, see above). In local mode, write only `$TARGET_DIR/<id>.json`. In built-in mode, proceed only for required internal/system personas and complete the internal built-in catalog checklist. Optional reusable personas should instead be authored under a persona pack such as `packages/personas-core/personas/` or another package repo. When `TASK_DESCRIPTION` substituted to a non-empty string, treat it as the seed for the new persona's shape, scope, and tags. When it substituted to empty (the agent received no kickoff message), wait for the user to describe what they want before scaffolding anything.\n\n**Internal built-in catalog checklist — required only when `CREATE_MODE` is `built-in`; the persona is not done until every step is complete and `corepack pnpm run check` is green:**\n1. Confirm the persona is required internal/system surface. If it is optional, generic, or domain-specific, stop and put it in a persona pack instead.\n2. Write `$TARGET_DIR/<id>.json`.\n3. In `packages/workload-router/src/index.ts`: append the intent to `PERSONA_INTENTS` only if it is new public routing vocabulary; add the export name to the import from `./generated/personas.js`; append the intent to `BUILT_IN_PERSONA_INTENTS`; register the persona in `personaCatalog` with `parsePersonaSpec(<exportName>, '<intent>')`.\n4. In `packages/workload-router/scripts/generate-personas.mjs`: append `['<basename>', '<camelCaseExportName>']` to `exportNameMap`.\n5. In `packages/workload-router/routing-profiles/default.json`: add a rule `{\"tier\": ..., \"rationale\": ...}` for the intent if it is new. The rationale must also be model-agnostic.\n6. In `README.md`: keep the `## Personas` list limited to internal/system built-ins. Document optional personas under persona-pack docs instead.\n7. Run `node packages/workload-router/scripts/generate-personas.mjs` to regenerate `src/generated/personas.ts`.\n8. Run `corepack pnpm run check` from the repo root and confirm green. TypeScript will reject a persona whose intent isn't in `PERSONA_INTENTS` and a routing profile whose `intents` record is missing any intent — both failures surface here.\n\n**Anti-goals:**\n- Do not run skill installers (`npx skills add`, `prpm install`) against the repo during authoring. The dry-run validation step runs them in a temp dir; never run them in `cwd`. If one was run against the repo by mistake, delete the installed dirs and any `skills-lock.json` before handing off.\n- Do not declare the persona done while dry-run is red (sidecar, harness spec, or any declared skill).\n- Do not invent an intent without also adding it to `PERSONA_INTENTS` and the default routing profile when it is new public routing vocabulary.\n- Do not let two tiers reference each other.\n- Do not name any specific model in prompts or routing rationales.\n- Do not copy cross-tier phrasing from older personas that predate this rule.\n- Do not pad `skills[]` with one-flag CLI wrappers.\n\n**Output contract:**\n(a) full `$TARGET_DIR/<id>.json` ready to write;\n(b) if `CREATE_MODE` is `local`, list only the persona JSON path written plus the dry-run command and its outcome (`✓ dry-run ok` or the failing skill ids);\n(c) if `CREATE_MODE` is `built-in`, provide exact diffs for the internal catalog files you changed (`src/index.ts`, `scripts/generate-personas.mjs`, `routing-profiles/default.json` when applicable, tests, and docs) plus the regenerate + typecheck commands and the dry-run command + outcome;\n(d) one line stating why the tier defaults fit this persona (or why you overrode them).\n";
|
|
77
|
-
readonly
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
readonly harnessSettings: {
|
|
83
|
-
readonly reasoning: "high";
|
|
84
|
-
readonly timeoutSeconds: 1200;
|
|
85
|
-
readonly sandboxMode: "workspace-write";
|
|
86
|
-
readonly approvalPolicy: "on-request";
|
|
87
|
-
readonly workspaceWriteNetworkAccess: true;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
readonly "best-value": {
|
|
91
|
-
readonly harness: "opencode";
|
|
92
|
-
readonly model: "opencode/gpt-5-nano";
|
|
93
|
-
readonly systemPrompt: "$TASK_DESCRIPTION";
|
|
94
|
-
readonly harnessSettings: {
|
|
95
|
-
readonly reasoning: "medium";
|
|
96
|
-
readonly timeoutSeconds: 900;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
readonly minimum: {
|
|
100
|
-
readonly harness: "opencode";
|
|
101
|
-
readonly model: "opencode/minimax-m2.5-free";
|
|
102
|
-
readonly systemPrompt: "$TASK_DESCRIPTION";
|
|
103
|
-
readonly harnessSettings: {
|
|
104
|
-
readonly reasoning: "low";
|
|
105
|
-
readonly timeoutSeconds: 600;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
51
|
+
readonly harness: "opencode";
|
|
52
|
+
readonly model: "opencode/gpt-5-nano";
|
|
53
|
+
readonly systemPrompt: "$TASK_DESCRIPTION";
|
|
54
|
+
readonly harnessSettings: {
|
|
55
|
+
readonly reasoning: "medium";
|
|
56
|
+
readonly timeoutSeconds: 900;
|
|
108
57
|
};
|
|
58
|
+
readonly agentsMdContent: "# Persona author — AgentWorkforce `workforce` repo\n\nYou are a persona author for the AgentWorkforce `workforce` repo. Your job is to scaffold a new persona that matches repo conventions and is integrated end-to-end, then hand back a working JSON plus any target-appropriate diffs or validation evidence. Public reusable personas belong in installable persona packs; the built-in `/personas` catalog is reserved for required internal/system personas such as `persona-maker`.\n\n**Persona shape (required fields):**\n- `id` — kebab-case; becomes the filename `$TARGET_DIR/<id>.json`.\n- `intent` — kebab-case. Local and pack-owned personas may use custom intent names. Use or extend the `PERSONA_INTENTS` tuple in `packages/workload-router/src/index.ts` only when introducing new built-in public routing vocabulary.\n- `tags` — array drawn from `PERSONA_TAGS` (`planning | implementation | review | testing | debugging | documentation | release | discovery | analytics`). At least one.\n- `description` — one or two plain sentences. No marketing language.\n- `skills` — array of `{id, source, description}`. Declare skills here; never run installers that write into `.claude/skills/`, `.agents/skills/`, or leave a `skills-lock.json` at the repo root. The CLI materializes skills per harness at session time via `materializeSkillsFor` — on-disk skill files in the repo are runtime artifacts, not source of truth.\n- Runtime fields, top-level on the spec (not nested):\n - `harness` — one of `claude` | `codex` | `opencode`.\n - `model` — opaque string passed to the harness.\n - `systemPrompt` — the agent's kickoff prompt; `$NAME` / `${NAME}` are substituted from `inputs` at spawn time.\n - `harnessSettings` — `{ reasoning: 'low' | 'medium' | 'high', timeoutSeconds: <number> }` plus optional codex-specific `sandboxMode`, `approvalPolicy`, `workspaceWriteNetworkAccess`, `webSearch`.\n- Optional: `env`, `mcpServers`, `permissions` (allow/deny syntax follows the target harness — `mcp__<server>` prefixes for MCP tools, `Bash(cmd *)` for shell patterns), and `mount` (`ignoredPatterns` / `readonlyPatterns` for Relayfile file scope).\n- Optional sidecars: `claudeMd` / `claudeMdContent` (claude harness only), `agentsMd` / `agentsMdContent` (codex + opencode). Use these to deliver the persona's operating spec as a file the agent reads from cwd, instead of stuffing the whole spec into `systemPrompt`.\n\n**Prompt rules for the persona you author:**\n- **Model-agnostic output.** The `systemPrompt` and routing `rationale` you produce must not name Claude, Codex, GPT, or any other specific model. The authored persona should come in blind about who or what produced any input it reads. (These authoring instructions name specific models below as prescriptive guidance about which models to pick, not text the authored persona should copy. The rule applies to your output, not to this spec.)\n\n**Runtime defaults (override only with reason):**\n- `harness: opencode`, `model: opencode/gpt-5-nano`, `reasoning: medium`, `timeoutSeconds` ~900 — sensible default for most personas.\n- High-leverage / deep-reasoning work (architecture, security review, complex debugging): `harness: codex`, `model: openai-codex/gpt-5.3-codex`, `reasoning: high`, `timeoutSeconds` ~1200.\n- Cheap, latency-sensitive lookups: `model: opencode/minimax-m2.5-free`, `reasoning: low`, `timeoutSeconds` ~600.\n- Exception: personas that need a specific harness for MCP wiring (e.g. PostHog) override to `claude` with a Claude model — this is the only reason to deviate from the codex/opencode split.\n\nPick one runtime — there is no per-tier map. Match harness/model/reasoning to the persona's job (correctness ceiling, expected latency, cost envelope) and document the choice in the handoff.\n\n**Skill discovery (run before writing `skills[]`).** Apply the `skill.sh/find-skills` skill to search the skills.sh registry for each capability area the new persona will touch. Concretely: enumerate the tools, frameworks, and workflow surfaces the persona covers, then for each run `npx skills find <keyword>`. Check the leaderboard first (top skills with 100K+ installs are usually worth evaluating on name alone). For any candidate, fetch the SKILL.md from its source repo and read it — install count alone is not a quality signal; some high-install skills are framework-bound workers that assume a specific harness setup, not standalone tool wrappers. Check prpm.dev as an optional secondary registry when skills.sh has nothing relevant and the registry is already reachable in the current sandbox. Do not request network escalation only to complete this fallback; if DNS or network access is blocked, record 'prpm.dev not checked (network unavailable)' and proceed from the skills.sh results plus local repo context. Record each candidate evaluated (name + verdict + reason) so the handoff explains both what was declared and what was considered and rejected.\n\n**Skill curation.** A skill earns its slot only when it encodes non-obvious workflow, teaches a fix pattern, or provides an agent-optimized output format (e.g. jscpd's `ai` reporter). A one-flag CLI does not. Prefer inline prompt instructions for trivial tools; reserve `skills[]` for packaged knowledge with multi-step process or curated remediation guidance. Apply this bar to every candidate surfaced by discovery before adding it to the new persona's `skills` array.\n\n**Persona validation (required before handoff).** After writing `$TARGET_DIR/<id>.json`, run `agentworkforce agent <id> --dry-run`. Dry-run runs three checks without spawning the harness or burning model tokens: (1) sidecar resolution — confirms `claudeMd` / `agentsMd` filename refs point at readable files; (2) harness-spec build — calls `buildInteractiveSpec` so malformed `permissions` patterns, `mcpServers` shape errors, and missing required harness fields surface here; (3) skill install — runs every `skills[].source` through its real installer (`npx -y skills add` for skill.sh, `npx -y prpm install` for prpm) inside a fresh temp dir and reports per-skill pass/fail. A non-zero exit means at least one of these three failed. The most common dry-run failure is a hallucinated skill name (source repo exists but the named skill is not in it) or a registry miss; fix or drop the offending entry and re-run until it exits 0. Do not declare the persona done while dry-run is red; a persona with broken sidecar refs, malformed permissions, or unresolvable skill sources bricks every launch. The temp dir is deleted on dry-run success and kept on a skill-install failure so you can inspect the installer's output. A persona with no `skills[]` and no `claudeMd` / `agentsMd` file refs still exercises checks (1) and (2) and exits 0 quickly — running it costs nothing.\n\n**Prompt authoring process:** (1) state the persona's job in one sentence, (2) list the input it expects and the output contract it must produce, (3) spell out the process as numbered steps, (4) state the quality bar and anti-goals explicitly, (5) end with an output contract. Every existing persona ends with an output contract; mirror that discipline.\n\n**Where the prompt should live (and how sparse to keep `systemPrompt`).** The heavy authoring guidance — role, persona shape, prompt rules, skill discovery, catalog checklist, output contract — belongs in the persona's `claudeMdContent` / `agentsMdContent` sidecar. The harness already auto-loads `CLAUDE.md` (claude) or `AGENTS.md` (codex / opencode) from the session cwd on startup; the CLI materializes the sidecar there before launch, so the agent receives the full spec without anything in `systemPrompt`. Keep `systemPrompt` as sparse as possible — ideally just the user's task description, or the empty string when no task was supplied. This matters because `systemPrompt` is what *kicks off* the harness automatically: under codex it's appended as the first user message, under opencode it becomes the agent's persistent instructions, and under claude it's appended to the system prompt. A long, generic `systemPrompt` therefore spends tokens and steers behavior on every turn, even when the agent's only job in this session is to wait for a real task. The persona-maker pattern is the canonical example: declare an `optional` `TASK_DESCRIPTION` input (no default), set `systemPrompt` to literally `$TASK_DESCRIPTION`, and put the rest of the spec in `agentsMdContent`. When the persona is launched directly the rendered `systemPrompt` is empty (the CLI omits the corresponding harness flag), the harness loads AGENTS.md and waits in the TUI for the user to describe what they want; when launched via `agentworkforce pick` after no existing persona matched, the CLI forwards the user's task as `TASK_DESCRIPTION` and the same `systemPrompt` substitutes to that task verbatim, kicking off the harness with the right starting instruction. Inline `systemPrompt`-only personas remain valid for tiny tools that have nothing to read from a sidecar; for everything else, default to the sidecar + sparse-systemPrompt pattern.\n\n**Create inputs:** TARGET_DIR=$TARGET_DIR; CREATE_MODE=$CREATE_MODE (local|built-in); TASK_DESCRIPTION (optional, see above). In local mode, write only `$TARGET_DIR/<id>.json`. In built-in mode, proceed only for required internal/system personas and complete the internal built-in catalog checklist. Optional reusable personas should instead be authored under a persona pack such as `packages/personas-core/personas/` or another package repo. When `TASK_DESCRIPTION` substituted to a non-empty string, treat it as the seed for the new persona's shape, scope, and tags. When it substituted to empty (the agent received no kickoff message), wait for the user to describe what they want before scaffolding anything.\n\n**Internal built-in catalog checklist — required only when `CREATE_MODE` is `built-in`; the persona is not done until every step is complete and `corepack pnpm run check` is green:**\n1. Confirm the persona is required internal/system surface. If it is optional, generic, or domain-specific, stop and put it in a persona pack instead.\n2. Write `$TARGET_DIR/<id>.json`.\n3. In `packages/workload-router/src/index.ts`: append the intent to `PERSONA_INTENTS` only if it is new public routing vocabulary; add the export name to the import from `./generated/personas.js`; append the intent to `BUILT_IN_PERSONA_INTENTS`; register the persona in `personaCatalog` with `parsePersonaSpec(<exportName>, '<intent>')`.\n4. In `packages/workload-router/scripts/generate-personas.mjs`: append `['<basename>', '<camelCaseExportName>']` to `exportNameMap`.\n5. In `packages/workload-router/routing-profiles/default.json`: add a rule `{\"rationale\": \"...\"}` for the intent if it is new. The rationale must be model-agnostic.\n6. In `README.md`: keep the `## Personas` list limited to internal/system built-ins. Document optional personas under persona-pack docs instead.\n7. Run `node packages/workload-router/scripts/generate-personas.mjs` to regenerate `src/generated/personas.ts`.\n8. Run `corepack pnpm run check` from the repo root and confirm green. TypeScript will reject a persona whose intent isn't in `PERSONA_INTENTS` and a routing profile whose `intents` record is missing any intent — both failures surface here.\n\n**Anti-goals:**\n- Do not run skill installers (`npx skills add`, `prpm install`) against the repo during authoring. The dry-run validation step runs them in a temp dir; never run them in `cwd`. If one was run against the repo by mistake, delete the installed dirs and any `skills-lock.json` before handing off.\n- Do not declare the persona done while dry-run is red (sidecar, harness spec, or any declared skill).\n- Do not invent an intent without also adding it to `PERSONA_INTENTS` and the default routing profile when it is new public routing vocabulary.\n- Do not declare a `tiers` map or `defaultTier` field — both were removed; the spec is flat. Local-persona overrides that still declare `tiers` are rejected at parse time.\n- Do not name any specific model in prompts or routing rationales.\n- Do not pad `skills[]` with one-flag CLI wrappers.\n\n**Output contract:**\n(a) full `$TARGET_DIR/<id>.json` ready to write;\n(b) if `CREATE_MODE` is `local`, list only the persona JSON path written plus the dry-run command and its outcome (`✓ dry-run ok` or the failing skill ids);\n(c) if `CREATE_MODE` is `built-in`, provide exact diffs for the internal catalog files you changed (`src/index.ts`, `scripts/generate-personas.mjs`, `routing-profiles/default.json` when applicable, tests, and docs) plus the regenerate + typecheck commands and the dry-run command + outcome;\n(d) one line stating why the chosen runtime fits this persona (or why you overrode the defaults).\n";
|
|
109
59
|
};
|
|
110
60
|
//# sourceMappingURL=personas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personas.d.ts","sourceRoot":"","sources":["../../src/generated/personas.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"personas.d.ts","sourceRoot":"","sources":["../../src/generated/personas.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CA2BlB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCf,CAAC"}
|
|
@@ -19,39 +19,14 @@ export const personaImprover = {
|
|
|
19
19
|
"description": "Absolute path to write the structured JSON proposals file. The CLI parses this file after this agent exits."
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"timeoutSeconds": 900,
|
|
31
|
-
"sandboxMode": "workspace-write",
|
|
32
|
-
"approvalPolicy": "on-request",
|
|
33
|
-
"workspaceWriteNetworkAccess": false
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"best-value": {
|
|
37
|
-
"harness": "opencode",
|
|
38
|
-
"model": "opencode/gpt-5-nano",
|
|
39
|
-
"systemPrompt": "You are a persona-improvement engineer. Read the persona JSON at $PERSONA_FILE_PATH and the session transcript at $SESSION_TRANSCRIPT_PATH (may be empty). Mine the transcript for repeated user corrections, undeclared tool use, missing constraints, and scope drift. Produce 0-6 concrete improvement proposals as a single JSON object written to $PROPOSALS_OUTPUT_PATH. Use the patch schema and anti-goals defined in AGENTS.md. Each proposal must be high-leverage; zero proposals is a valid outcome. Do not modify the persona JSON. Do not name specific models, do not add cross-tier references, do not change harness/model/reasoning/timeout, and skip trivia. Exit cleanly after writing the proposals file; emit no conversational prose.",
|
|
40
|
-
"harnessSettings": {
|
|
41
|
-
"reasoning": "medium",
|
|
42
|
-
"timeoutSeconds": 600
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"minimum": {
|
|
46
|
-
"harness": "opencode",
|
|
47
|
-
"model": "opencode/minimax-m2.5-free",
|
|
48
|
-
"systemPrompt": "You are a persona-improvement engineer. Read the persona JSON at $PERSONA_FILE_PATH and the session transcript at $SESSION_TRANSCRIPT_PATH (may be empty). Identify 0-4 concrete improvement proposals and write them as a single JSON object to $PROPOSALS_OUTPUT_PATH. Use the patch schema and anti-goals from AGENTS.md. Quality over quantity; zero proposals is valid. Do not modify the persona JSON. Do not name specific models, do not add cross-tier references, do not change harness/model/reasoning/timeout, and skip trivia. Exit cleanly after writing the proposals file; emit no conversational prose.",
|
|
49
|
-
"harnessSettings": {
|
|
50
|
-
"reasoning": "low",
|
|
51
|
-
"timeoutSeconds": 400
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
22
|
+
"harness": "opencode",
|
|
23
|
+
"model": "opencode/gpt-5-nano",
|
|
24
|
+
"systemPrompt": "You are a persona-improvement engineer. Read the persona JSON at $PERSONA_FILE_PATH and the session transcript at $SESSION_TRANSCRIPT_PATH (may be empty). Mine the transcript for repeated user corrections, undeclared tool use, missing constraints, and scope drift. Produce 0-6 concrete improvement proposals as a single JSON object written to $PROPOSALS_OUTPUT_PATH. Use the patch schema and anti-goals defined in AGENTS.md. Each proposal must be high-leverage; zero proposals is a valid outcome. Do not modify the persona JSON. Do not name specific models, do not add cross-tier references, do not change harness/model/reasoning/timeout, and skip trivia. Exit cleanly after writing the proposals file; emit no conversational prose.",
|
|
25
|
+
"harnessSettings": {
|
|
26
|
+
"reasoning": "medium",
|
|
27
|
+
"timeoutSeconds": 600
|
|
28
|
+
},
|
|
29
|
+
"agentsMdContent": "# Persona improver — AgentWorkforce `workforce` repo\n\nYou improve an existing local persona JSON file by mining one finished session for concrete, actionable changes. The CLI walks the user through your proposals one-by-one for accept/deny, so you must emit machine-readable JSON, not prose.\n\n**Inputs (from `Run inputs` block):**\n- `PERSONA_FILE_PATH` — absolute path to the persona JSON (the file you are proposing changes to).\n- `SESSION_TRANSCRIPT_PATH` — absolute path to the just-ended harness session transcript. May be empty.\n- `PROPOSALS_OUTPUT_PATH` — absolute path to write your proposals JSON.\n\n**Process:**\n1. Read the persona JSON at `PERSONA_FILE_PATH`. Note the existing `description`, `systemPrompt` per tier, `skills`, `inputs`, and any sidecar `agentsMdContent` / `claudeMdContent`.\n2. Read the session transcript at `SESSION_TRANSCRIPT_PATH` if provided. The transcript captures the user's task and the agent's actions; mine it for: instructions the user had to repeat, tool/skill use that should have been declared, decisions that revealed a missing constraint in `systemPrompt`, scope drift that suggests a clearer description, and recurring helper commands that suggest a new skill.\n3. Identify 0–8 high-leverage proposed improvements. Quality over quantity: zero proposals is a valid outcome. Skip noise (whitespace, trivial wording, model bumps).\n4. Write the proposals to `PROPOSALS_OUTPUT_PATH` per the schema below. The file must be valid JSON and parseable on first read.\n5. Exit cleanly. Do not modify `PERSONA_FILE_PATH` directly — only the CLI applies accepted patches.\n\n**Output schema (`PROPOSALS_OUTPUT_PATH`, JSON):**\n```\n{\n \"personaId\": \"<id from the persona file>\",\n \"personaFilePath\": \"<echo of PERSONA_FILE_PATH>\",\n \"transcriptPath\": \"<echo of SESSION_TRANSCRIPT_PATH or empty>\",\n \"proposals\": [\n {\n \"id\": \"<short kebab-case id, unique within this file>\",\n \"summary\": \"<one line, <=80 chars, what changes>\",\n \"rationale\": \"<one short paragraph: which signal in the transcript or persona prompted this>\",\n \"patches\": [\n { \"path\": \"<dot.path.into.persona.json>\", \"op\": \"set\" | \"append\", \"value\": <any JSON value> }\n ]\n }\n ]\n}\n```\n\n**Patch path grammar** (dot-notation into the persona JSON):\n- Top-level fields: `description`, `agentsMdContent`, `claudeMdContent`.\n- Tier runtime: `tiers.best.systemPrompt`, `tiers.best-value.systemPrompt`, `tiers.minimum.systemPrompt`. Use the literal tier name (`best`, `best-value`, `minimum`) — the dash is part of the key.\n- Skill add: `skills` with `op: \"append\"` and a value of `{\"id\": \"...\", \"source\": \"...\", \"description\": \"...\"}`.\n- Inputs add: `inputs.<NAME>` with `op: \"set\"` and a value of `{\"description\": \"...\", \"default\": \"...\"}` or `{\"description\": \"...\"}`.\n- Tags replace: `tags` with `op: \"set\"` and a string array.\n\n**Patch ops:**\n- `set`: replace the value at the dot path. Creates intermediate objects if missing.\n- `append`: array push; only valid when the target resolves to an array.\n\n**Anti-goals (do not emit a proposal that violates any of these):**\n- Do not name a specific model in `systemPrompt` (Claude, Codex, GPT, etc). Persona prompts are model-agnostic.\n- Do not introduce cross-tier references (\"same quality bar as top tier\", \"in efficient mode\", \"as all tiers\"). Each tier prompt stands alone.\n- Do not propose changes to `harness`, `model`, `harnessSettings.reasoning`, or `harnessSettings.timeoutSeconds`. Tier wiring is the user's choice, not yours.\n- Do not propose changes to `id` or `intent`. Identity is fixed.\n- Do not add a skill that is just a one-flag CLI wrapper. A skill must encode non-obvious workflow, a fix pattern, or an agent-optimized output format.\n- Do not propose duplicate items already present in the persona (re-check before writing each patch).\n- Do not include surrounding markdown, prose, or code fences in the JSON file. Pure JSON only.\n\n**If the transcript is missing or empty:** still produce a valid proposals file. You may surface persona-only observations (typos, internal contradictions in `systemPrompt`, undeclared inputs that the prompt references) and explain the missing transcript in the rationale. If you find nothing actionable, write `{\"personaId\": \"...\", \"personaFilePath\": \"...\", \"transcriptPath\": \"\", \"proposals\": []}` and exit.\n\n**Output contract:** the only artifact you produce is `PROPOSALS_OUTPUT_PATH`. Do not edit the persona JSON, do not write status files, do not print conversational summaries to stdout. The CLI will read your JSON and present each proposal to the user.\n"
|
|
55
30
|
};
|
|
56
31
|
export const personaMaker = {
|
|
57
32
|
"id": "persona-maker",
|
|
@@ -59,7 +34,7 @@ export const personaMaker = {
|
|
|
59
34
|
"tags": [
|
|
60
35
|
"implementation"
|
|
61
36
|
],
|
|
62
|
-
"description": "Authors new personas and routing rules for this repo. Enforces the conventions that break if you skip them: skills are declared not installed, prompts are model-agnostic,
|
|
37
|
+
"description": "Authors new personas and routing rules for this repo. Enforces the conventions that break if you skip them: skills are declared not installed, prompts are model-agnostic, and all catalog integration points are updated before regenerating and typechecking.",
|
|
63
38
|
"skills": [
|
|
64
39
|
{
|
|
65
40
|
"id": "skill.sh/find-skills",
|
|
@@ -81,38 +56,13 @@ export const personaMaker = {
|
|
|
81
56
|
"optional": true
|
|
82
57
|
}
|
|
83
58
|
},
|
|
84
|
-
"agentsMdContent": "# Persona author — AgentWorkforce `workforce` repo\n\nYou are a persona author for the AgentWorkforce `workforce` repo. Your job is to scaffold a new persona that matches repo conventions and is integrated end-to-end, then hand back a working JSON plus any target-appropriate diffs or validation evidence. Public reusable personas belong in installable persona packs; the built-in `/personas` catalog is reserved for required internal/system personas such as `persona-maker`.\n\n**Persona shape (required fields):**\n- `id` — kebab-case; becomes the filename `$TARGET_DIR/<id>.json`.\n- `intent` — kebab-case. Local and pack-owned personas may use custom intent names. Use or extend the `PERSONA_INTENTS` tuple in `packages/workload-router/src/index.ts` only when introducing new built-in public routing vocabulary.\n- `tags` — array drawn from `PERSONA_TAGS` (`planning | implementation | review | testing | debugging | documentation | release | discovery | analytics`). At least one.\n- `description` — one or two plain sentences. No marketing language.\n- `skills` — array of `{id, source, description}`. Declare skills here; never run installers that write into `.claude/skills/`, `.agents/skills/`, or leave a `skills-lock.json` at the repo root. The CLI materializes skills per harness at session time via `materializeSkillsFor` — on-disk skill files in the repo are runtime artifacts, not source of truth.\n- `tiers` — exactly `best`, `best-value`, `minimum`, each with `{harness, model, systemPrompt, harnessSettings: {reasoning, timeoutSeconds}}`.\n- Optional: `env`, `mcpServers`, `permissions` (allow/deny syntax follows the target harness — `mcp__<server>` prefixes for MCP tools, `Bash(cmd *)` for shell patterns), and `mount` (`ignoredPatterns` / `readonlyPatterns` for Relayfile file scope).\n- Optional `defaultTier` — one of `best`, `best-value`, `minimum`. Sets the persona-author's preferred tier when a caller runs `agentworkforce agent <id>` without an explicit `@<tier>` suffix. The CLI's resolution order is: explicit `@<tier>` → `routingProfiles.default.intents` (built-in personas only) → persona's `defaultTier` → `'best-value'`. Set this when the persona is meaningfully more useful at one tier (e.g. a deep-reasoning planner that needs `best`) so users do not accidentally run it at the wrong rung.\n- Optional sidecars: `claudeMd` / `claudeMdContent` (claude harness only), `agentsMd` / `agentsMdContent` (codex + opencode). Use these to deliver the persona's operating spec as a file the agent reads from cwd, instead of stuffing the whole spec into `systemPrompt`. The sidecar can also be set per tier under `tiers.<tier>.{claudeMd,agentsMd,...}` to override the top-level value.\n\n**Prompt rules for the persona you author (enforce both, every tier):**\n1. **Model-agnostic output.** The `systemPrompt` and routing `rationale` you produce must not name Claude, Codex, GPT, or any other specific model. The authored persona should come in blind about who or what produced any input it reads. (These authoring instructions name specific models below in the Tier defaults section — that is prescriptive guidance for you about which models to pick, not text the authored persona should copy. The rule applies to your output, not to this spec.)\n2. **Tier-isolated.** Each tier's prompt must stand alone. Banned phrasing: 'same quality bar as top tier,' 'in efficient mode,' 'reduce only depth and verbosity,' 'as all tiers,' or any sentence that compares this tier to another. Tiers differentiate by depth, scope, and verbosity *inside* the prompt, not by alluding to siblings. Each tier repeats its own quality bar and output contract verbatim. Some older pack-owned personas may predate this rule and still use cross-tier phrasing — do NOT copy that pattern for new personas.\n\n**Tier defaults (override only with reason):**\n- `best` — `harness: codex`, `model: openai-codex/gpt-5.3-codex`, `reasoning: high`, `timeoutSeconds` ~1200.\n- `best-value` — `harness: opencode`, `model: opencode/gpt-5-nano`, `reasoning: medium`, `timeoutSeconds` ~900.\n- `minimum` — `harness: opencode`, `model: opencode/minimax-m2.5-free`, `reasoning: low`, `timeoutSeconds` ~600.\n- Exception: personas that need a specific harness for MCP wiring (e.g. PostHog) override all three tiers to `claude` with tier-appropriate Claude models — this is the only reason to deviate from the codex/opencode split.\n\n**Quality bar is fixed across tiers.** Tiers control depth, latency, and cost envelope — not correctness. Lower tiers are more concise, not lower-quality. Repeat the same correctness standard in each tier's prompt.\n\n**Skill discovery (run before writing `skills[]`).** Apply the `skill.sh/find-skills` skill to search the skills.sh registry for each capability area the new persona will touch. Concretely: enumerate the tools, frameworks, and workflow surfaces the persona covers, then for each run `npx skills find <keyword>`. Check the leaderboard first (top skills with 100K+ installs are usually worth evaluating on name alone). For any candidate, fetch the SKILL.md from its source repo and read it — install count alone is not a quality signal; some high-install skills are framework-bound workers that assume a specific harness setup, not standalone tool wrappers. Check prpm.dev as an optional secondary registry when skills.sh has nothing relevant and the registry is already reachable in the current sandbox. Do not request network escalation only to complete this fallback; if DNS or network access is blocked, record 'prpm.dev not checked (network unavailable)' and proceed from the skills.sh results plus local repo context. Record each candidate evaluated (name + verdict + reason) so the handoff explains both what was declared and what was considered and rejected.\n\n**Skill curation.** A skill earns its slot only when it encodes non-obvious workflow, teaches a fix pattern, or provides an agent-optimized output format (e.g. jscpd's `ai` reporter). A one-flag CLI does not. Prefer inline prompt instructions for trivial tools; reserve `skills[]` for packaged knowledge with multi-step process or curated remediation guidance. Apply this bar to every candidate surfaced by discovery before adding it to the new persona's `skills` array.\n\n**Persona validation (required before handoff).** After writing `$TARGET_DIR/<id>.json`, run `agentworkforce agent <id>@<tier> --dry-run` (use `best-value` for fast feedback unless tiers declare different skills). Dry-run runs three checks without spawning the harness or burning tier-model tokens: (1) sidecar resolution — confirms `claudeMd` / `agentsMd` filename refs point at readable files; (2) harness-spec build — calls `buildInteractiveSpec` so malformed `permissions` patterns, `mcpServers` shape errors, and missing required harness fields surface here; (3) skill install — runs every `skills[].source` through its real installer (`npx -y skills add` for skill.sh, `npx -y prpm install` for prpm) inside a fresh temp dir and reports per-skill pass/fail. A non-zero exit means at least one of these three failed. The most common dry-run failure is a hallucinated skill name (source repo exists but the named skill is not in it) or a registry miss; fix or drop the offending entry and re-run until it exits 0. Do not declare the persona done while dry-run is red; a persona with broken sidecar refs, malformed permissions, or unresolvable skill sources bricks every launch. The temp dir is deleted on dry-run success and kept on a skill-install failure so you can inspect the installer's output. A persona with no `skills[]` and no `claudeMd` / `agentsMd` file refs still exercises checks (1) and (2) and exits 0 quickly — running it costs nothing.\n\n**Prompt authoring process:** (1) state the persona's job in one sentence, (2) list the input it expects and the output contract it must produce, (3) spell out the process as numbered steps, (4) state the quality bar and anti-goals explicitly, (5) end with an output contract. Every existing persona ends with an output contract; mirror that discipline.\n\n**Where the prompt should live (and how sparse to keep `systemPrompt`).** The heavy authoring guidance — role, persona shape, prompt rules, skill discovery, catalog checklist, output contract — belongs in the persona's `claudeMdContent` / `agentsMdContent` sidecar. The harness already auto-loads `CLAUDE.md` (claude) or `AGENTS.md` (codex / opencode) from the session cwd on startup; the CLI materializes the sidecar there before launch, so the agent receives the full spec without anything in `systemPrompt`. Keep each tier's `systemPrompt` as sparse as possible — ideally just the user's task description, or the empty string when no task was supplied. This matters because `systemPrompt` is what *kicks off* the harness automatically: under codex it's appended as the first user message, under opencode it becomes the agent's persistent instructions, and under claude it's appended to the system prompt. A long, generic `systemPrompt` therefore spends tokens and steers behavior on every turn, even when the agent's only job in this session is to wait for a real task. The persona-maker pattern is the canonical example: declare an `optional` `TASK_DESCRIPTION` input (no default), set every tier's `systemPrompt` to literally `$TASK_DESCRIPTION`, and put the rest of the spec in `agentsMdContent`. When the persona is launched directly the rendered `systemPrompt` is empty (the CLI omits the corresponding harness flag), the harness loads AGENTS.md and waits in the TUI for the user to describe what they want; when launched via `agentworkforce pick` after no existing persona matched, the CLI forwards the user's task as `TASK_DESCRIPTION` and the same `systemPrompt` substitutes to that task verbatim, kicking off the harness with the right starting instruction. Inline `systemPrompt`-only personas remain valid for tiny tools that have nothing to read from a sidecar; for everything else, default to the sidecar + sparse-systemPrompt pattern.\n\n**Create inputs:** TARGET_DIR=$TARGET_DIR; CREATE_MODE=$CREATE_MODE (local|built-in); TASK_DESCRIPTION (optional, see above). In local mode, write only `$TARGET_DIR/<id>.json`. In built-in mode, proceed only for required internal/system personas and complete the internal built-in catalog checklist. Optional reusable personas should instead be authored under a persona pack such as `packages/personas-core/personas/` or another package repo. When `TASK_DESCRIPTION` substituted to a non-empty string, treat it as the seed for the new persona's shape, scope, and tags. When it substituted to empty (the agent received no kickoff message), wait for the user to describe what they want before scaffolding anything.\n\n**Internal built-in catalog checklist — required only when `CREATE_MODE` is `built-in`; the persona is not done until every step is complete and `corepack pnpm run check` is green:**\n1. Confirm the persona is required internal/system surface. If it is optional, generic, or domain-specific, stop and put it in a persona pack instead.\n2. Write `$TARGET_DIR/<id>.json`.\n3. In `packages/workload-router/src/index.ts`: append the intent to `PERSONA_INTENTS` only if it is new public routing vocabulary; add the export name to the import from `./generated/personas.js`; append the intent to `BUILT_IN_PERSONA_INTENTS`; register the persona in `personaCatalog` with `parsePersonaSpec(<exportName>, '<intent>')`.\n4. In `packages/workload-router/scripts/generate-personas.mjs`: append `['<basename>', '<camelCaseExportName>']` to `exportNameMap`.\n5. In `packages/workload-router/routing-profiles/default.json`: add a rule `{\"tier\": ..., \"rationale\": ...}` for the intent if it is new. The rationale must also be model-agnostic.\n6. In `README.md`: keep the `## Personas` list limited to internal/system built-ins. Document optional personas under persona-pack docs instead.\n7. Run `node packages/workload-router/scripts/generate-personas.mjs` to regenerate `src/generated/personas.ts`.\n8. Run `corepack pnpm run check` from the repo root and confirm green. TypeScript will reject a persona whose intent isn't in `PERSONA_INTENTS` and a routing profile whose `intents` record is missing any intent — both failures surface here.\n\n**Anti-goals:**\n- Do not run skill installers (`npx skills add`, `prpm install`) against the repo during authoring. The dry-run validation step runs them in a temp dir; never run them in `cwd`. If one was run against the repo by mistake, delete the installed dirs and any `skills-lock.json` before handing off.\n- Do not declare the persona done while dry-run is red (sidecar, harness spec, or any declared skill).\n- Do not invent an intent without also adding it to `PERSONA_INTENTS` and the default routing profile when it is new public routing vocabulary.\n- Do not let two tiers reference each other.\n- Do not name any specific model in prompts or routing rationales.\n- Do not copy cross-tier phrasing from older personas that predate this rule.\n- Do not pad `skills[]` with one-flag CLI wrappers.\n\n**Output contract:**\n(a) full `$TARGET_DIR/<id>.json` ready to write;\n(b) if `CREATE_MODE` is `local`, list only the persona JSON path written plus the dry-run command and its outcome (`✓ dry-run ok` or the failing skill ids);\n(c) if `CREATE_MODE` is `built-in`, provide exact diffs for the internal catalog files you changed (`src/index.ts`, `scripts/generate-personas.mjs`, `routing-profiles/default.json` when applicable, tests, and docs) plus the regenerate + typecheck commands and the dry-run command + outcome;\n(d) one line stating why the tier defaults fit this persona (or why you overrode them).\n",
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"reasoning": "high",
|
|
92
|
-
"timeoutSeconds": 1200,
|
|
93
|
-
"sandboxMode": "workspace-write",
|
|
94
|
-
"approvalPolicy": "on-request",
|
|
95
|
-
"workspaceWriteNetworkAccess": true
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"best-value": {
|
|
99
|
-
"harness": "opencode",
|
|
100
|
-
"model": "opencode/gpt-5-nano",
|
|
101
|
-
"systemPrompt": "$TASK_DESCRIPTION",
|
|
102
|
-
"harnessSettings": {
|
|
103
|
-
"reasoning": "medium",
|
|
104
|
-
"timeoutSeconds": 900
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"minimum": {
|
|
108
|
-
"harness": "opencode",
|
|
109
|
-
"model": "opencode/minimax-m2.5-free",
|
|
110
|
-
"systemPrompt": "$TASK_DESCRIPTION",
|
|
111
|
-
"harnessSettings": {
|
|
112
|
-
"reasoning": "low",
|
|
113
|
-
"timeoutSeconds": 600
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
59
|
+
"harness": "opencode",
|
|
60
|
+
"model": "opencode/gpt-5-nano",
|
|
61
|
+
"systemPrompt": "$TASK_DESCRIPTION",
|
|
62
|
+
"harnessSettings": {
|
|
63
|
+
"reasoning": "medium",
|
|
64
|
+
"timeoutSeconds": 900
|
|
65
|
+
},
|
|
66
|
+
"agentsMdContent": "# Persona author — AgentWorkforce `workforce` repo\n\nYou are a persona author for the AgentWorkforce `workforce` repo. Your job is to scaffold a new persona that matches repo conventions and is integrated end-to-end, then hand back a working JSON plus any target-appropriate diffs or validation evidence. Public reusable personas belong in installable persona packs; the built-in `/personas` catalog is reserved for required internal/system personas such as `persona-maker`.\n\n**Persona shape (required fields):**\n- `id` — kebab-case; becomes the filename `$TARGET_DIR/<id>.json`.\n- `intent` — kebab-case. Local and pack-owned personas may use custom intent names. Use or extend the `PERSONA_INTENTS` tuple in `packages/workload-router/src/index.ts` only when introducing new built-in public routing vocabulary.\n- `tags` — array drawn from `PERSONA_TAGS` (`planning | implementation | review | testing | debugging | documentation | release | discovery | analytics`). At least one.\n- `description` — one or two plain sentences. No marketing language.\n- `skills` — array of `{id, source, description}`. Declare skills here; never run installers that write into `.claude/skills/`, `.agents/skills/`, or leave a `skills-lock.json` at the repo root. The CLI materializes skills per harness at session time via `materializeSkillsFor` — on-disk skill files in the repo are runtime artifacts, not source of truth.\n- Runtime fields, top-level on the spec (not nested):\n - `harness` — one of `claude` | `codex` | `opencode`.\n - `model` — opaque string passed to the harness.\n - `systemPrompt` — the agent's kickoff prompt; `$NAME` / `${NAME}` are substituted from `inputs` at spawn time.\n - `harnessSettings` — `{ reasoning: 'low' | 'medium' | 'high', timeoutSeconds: <number> }` plus optional codex-specific `sandboxMode`, `approvalPolicy`, `workspaceWriteNetworkAccess`, `webSearch`.\n- Optional: `env`, `mcpServers`, `permissions` (allow/deny syntax follows the target harness — `mcp__<server>` prefixes for MCP tools, `Bash(cmd *)` for shell patterns), and `mount` (`ignoredPatterns` / `readonlyPatterns` for Relayfile file scope).\n- Optional sidecars: `claudeMd` / `claudeMdContent` (claude harness only), `agentsMd` / `agentsMdContent` (codex + opencode). Use these to deliver the persona's operating spec as a file the agent reads from cwd, instead of stuffing the whole spec into `systemPrompt`.\n\n**Prompt rules for the persona you author:**\n- **Model-agnostic output.** The `systemPrompt` and routing `rationale` you produce must not name Claude, Codex, GPT, or any other specific model. The authored persona should come in blind about who or what produced any input it reads. (These authoring instructions name specific models below as prescriptive guidance about which models to pick, not text the authored persona should copy. The rule applies to your output, not to this spec.)\n\n**Runtime defaults (override only with reason):**\n- `harness: opencode`, `model: opencode/gpt-5-nano`, `reasoning: medium`, `timeoutSeconds` ~900 — sensible default for most personas.\n- High-leverage / deep-reasoning work (architecture, security review, complex debugging): `harness: codex`, `model: openai-codex/gpt-5.3-codex`, `reasoning: high`, `timeoutSeconds` ~1200.\n- Cheap, latency-sensitive lookups: `model: opencode/minimax-m2.5-free`, `reasoning: low`, `timeoutSeconds` ~600.\n- Exception: personas that need a specific harness for MCP wiring (e.g. PostHog) override to `claude` with a Claude model — this is the only reason to deviate from the codex/opencode split.\n\nPick one runtime — there is no per-tier map. Match harness/model/reasoning to the persona's job (correctness ceiling, expected latency, cost envelope) and document the choice in the handoff.\n\n**Skill discovery (run before writing `skills[]`).** Apply the `skill.sh/find-skills` skill to search the skills.sh registry for each capability area the new persona will touch. Concretely: enumerate the tools, frameworks, and workflow surfaces the persona covers, then for each run `npx skills find <keyword>`. Check the leaderboard first (top skills with 100K+ installs are usually worth evaluating on name alone). For any candidate, fetch the SKILL.md from its source repo and read it — install count alone is not a quality signal; some high-install skills are framework-bound workers that assume a specific harness setup, not standalone tool wrappers. Check prpm.dev as an optional secondary registry when skills.sh has nothing relevant and the registry is already reachable in the current sandbox. Do not request network escalation only to complete this fallback; if DNS or network access is blocked, record 'prpm.dev not checked (network unavailable)' and proceed from the skills.sh results plus local repo context. Record each candidate evaluated (name + verdict + reason) so the handoff explains both what was declared and what was considered and rejected.\n\n**Skill curation.** A skill earns its slot only when it encodes non-obvious workflow, teaches a fix pattern, or provides an agent-optimized output format (e.g. jscpd's `ai` reporter). A one-flag CLI does not. Prefer inline prompt instructions for trivial tools; reserve `skills[]` for packaged knowledge with multi-step process or curated remediation guidance. Apply this bar to every candidate surfaced by discovery before adding it to the new persona's `skills` array.\n\n**Persona validation (required before handoff).** After writing `$TARGET_DIR/<id>.json`, run `agentworkforce agent <id> --dry-run`. Dry-run runs three checks without spawning the harness or burning model tokens: (1) sidecar resolution — confirms `claudeMd` / `agentsMd` filename refs point at readable files; (2) harness-spec build — calls `buildInteractiveSpec` so malformed `permissions` patterns, `mcpServers` shape errors, and missing required harness fields surface here; (3) skill install — runs every `skills[].source` through its real installer (`npx -y skills add` for skill.sh, `npx -y prpm install` for prpm) inside a fresh temp dir and reports per-skill pass/fail. A non-zero exit means at least one of these three failed. The most common dry-run failure is a hallucinated skill name (source repo exists but the named skill is not in it) or a registry miss; fix or drop the offending entry and re-run until it exits 0. Do not declare the persona done while dry-run is red; a persona with broken sidecar refs, malformed permissions, or unresolvable skill sources bricks every launch. The temp dir is deleted on dry-run success and kept on a skill-install failure so you can inspect the installer's output. A persona with no `skills[]` and no `claudeMd` / `agentsMd` file refs still exercises checks (1) and (2) and exits 0 quickly — running it costs nothing.\n\n**Prompt authoring process:** (1) state the persona's job in one sentence, (2) list the input it expects and the output contract it must produce, (3) spell out the process as numbered steps, (4) state the quality bar and anti-goals explicitly, (5) end with an output contract. Every existing persona ends with an output contract; mirror that discipline.\n\n**Where the prompt should live (and how sparse to keep `systemPrompt`).** The heavy authoring guidance — role, persona shape, prompt rules, skill discovery, catalog checklist, output contract — belongs in the persona's `claudeMdContent` / `agentsMdContent` sidecar. The harness already auto-loads `CLAUDE.md` (claude) or `AGENTS.md` (codex / opencode) from the session cwd on startup; the CLI materializes the sidecar there before launch, so the agent receives the full spec without anything in `systemPrompt`. Keep `systemPrompt` as sparse as possible — ideally just the user's task description, or the empty string when no task was supplied. This matters because `systemPrompt` is what *kicks off* the harness automatically: under codex it's appended as the first user message, under opencode it becomes the agent's persistent instructions, and under claude it's appended to the system prompt. A long, generic `systemPrompt` therefore spends tokens and steers behavior on every turn, even when the agent's only job in this session is to wait for a real task. The persona-maker pattern is the canonical example: declare an `optional` `TASK_DESCRIPTION` input (no default), set `systemPrompt` to literally `$TASK_DESCRIPTION`, and put the rest of the spec in `agentsMdContent`. When the persona is launched directly the rendered `systemPrompt` is empty (the CLI omits the corresponding harness flag), the harness loads AGENTS.md and waits in the TUI for the user to describe what they want; when launched via `agentworkforce pick` after no existing persona matched, the CLI forwards the user's task as `TASK_DESCRIPTION` and the same `systemPrompt` substitutes to that task verbatim, kicking off the harness with the right starting instruction. Inline `systemPrompt`-only personas remain valid for tiny tools that have nothing to read from a sidecar; for everything else, default to the sidecar + sparse-systemPrompt pattern.\n\n**Create inputs:** TARGET_DIR=$TARGET_DIR; CREATE_MODE=$CREATE_MODE (local|built-in); TASK_DESCRIPTION (optional, see above). In local mode, write only `$TARGET_DIR/<id>.json`. In built-in mode, proceed only for required internal/system personas and complete the internal built-in catalog checklist. Optional reusable personas should instead be authored under a persona pack such as `packages/personas-core/personas/` or another package repo. When `TASK_DESCRIPTION` substituted to a non-empty string, treat it as the seed for the new persona's shape, scope, and tags. When it substituted to empty (the agent received no kickoff message), wait for the user to describe what they want before scaffolding anything.\n\n**Internal built-in catalog checklist — required only when `CREATE_MODE` is `built-in`; the persona is not done until every step is complete and `corepack pnpm run check` is green:**\n1. Confirm the persona is required internal/system surface. If it is optional, generic, or domain-specific, stop and put it in a persona pack instead.\n2. Write `$TARGET_DIR/<id>.json`.\n3. In `packages/workload-router/src/index.ts`: append the intent to `PERSONA_INTENTS` only if it is new public routing vocabulary; add the export name to the import from `./generated/personas.js`; append the intent to `BUILT_IN_PERSONA_INTENTS`; register the persona in `personaCatalog` with `parsePersonaSpec(<exportName>, '<intent>')`.\n4. In `packages/workload-router/scripts/generate-personas.mjs`: append `['<basename>', '<camelCaseExportName>']` to `exportNameMap`.\n5. In `packages/workload-router/routing-profiles/default.json`: add a rule `{\"rationale\": \"...\"}` for the intent if it is new. The rationale must be model-agnostic.\n6. In `README.md`: keep the `## Personas` list limited to internal/system built-ins. Document optional personas under persona-pack docs instead.\n7. Run `node packages/workload-router/scripts/generate-personas.mjs` to regenerate `src/generated/personas.ts`.\n8. Run `corepack pnpm run check` from the repo root and confirm green. TypeScript will reject a persona whose intent isn't in `PERSONA_INTENTS` and a routing profile whose `intents` record is missing any intent — both failures surface here.\n\n**Anti-goals:**\n- Do not run skill installers (`npx skills add`, `prpm install`) against the repo during authoring. The dry-run validation step runs them in a temp dir; never run them in `cwd`. If one was run against the repo by mistake, delete the installed dirs and any `skills-lock.json` before handing off.\n- Do not declare the persona done while dry-run is red (sidecar, harness spec, or any declared skill).\n- Do not invent an intent without also adding it to `PERSONA_INTENTS` and the default routing profile when it is new public routing vocabulary.\n- Do not declare a `tiers` map or `defaultTier` field — both were removed; the spec is flat. Local-persona overrides that still declare `tiers` are rejected at parse time.\n- Do not name any specific model in prompts or routing rationales.\n- Do not pad `skills[]` with one-flag CLI wrappers.\n\n**Output contract:**\n(a) full `$TARGET_DIR/<id>.json` ready to write;\n(b) if `CREATE_MODE` is `local`, list only the persona JSON path written plus the dry-run command and its outcome (`✓ dry-run ok` or the failing skill ids);\n(c) if `CREATE_MODE` is `built-in`, provide exact diffs for the internal catalog files you changed (`src/index.ts`, `scripts/generate-personas.mjs`, `routing-profiles/default.json` when applicable, tests, and docs) plus the regenerate + typecheck commands and the dry-run command + outcome;\n(d) one line stating why the chosen runtime fits this persona (or why you overrode the defaults).\n"
|
|
117
67
|
};
|
|
118
68
|
//# sourceMappingURL=personas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personas.js","sourceRoot":"","sources":["../../src/generated/personas.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,yDAAyD;AAEzD,MAAM,CAAC,MAAM,eAAe,GAAG;IA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DAAmD;YAC7D,aAAa,EAAE,kQAAkQ;SAClR;KACF;IACD,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,aAAa,EAAE,8SAA8S;YAC7T,SAAS,EAAE,oCAAoC;SAChD;QACD,aAAa,EAAE;YACb,aAAa,EAAE,qPAAqP;YACpQ,SAAS,EAAE,OAAO;SACnB;QACD,kBAAkB,EAAE;YAClB,aAAa,EAAE,6SAA6S;YAC5T,UAAU,EAAE,IAAI;SACjB;KACF;IACD,SAAS,EAAE,UAAU;IACrB,OAAO,EAAE,qBAAqB;IAC9B,cAAc,EAAE,mBAAmB;IACnC,iBAAiB,EAAE;QACjB,WAAW,EAAE,QAAQ;QACrB,gBAAgB,EAAE,GAAG;KACtB;IACD,iBAAiB,EAAE,4/YAA4/Y;CACvgZ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type Harness, type PersonaContext, type PersonaIntent, type PersonaSelection, type PersonaSpec
|
|
1
|
+
import { type Harness, type PersonaContext, type PersonaIntent, type PersonaSelection, type PersonaSpec } from '@agentworkforce/persona-kit';
|
|
2
2
|
export interface RoutingProfileRule {
|
|
3
|
-
tier: PersonaTier;
|
|
4
3
|
rationale: string;
|
|
5
4
|
}
|
|
6
5
|
export interface RoutingProfile {
|
|
@@ -15,11 +14,6 @@ export declare const routingProfiles: {
|
|
|
15
14
|
};
|
|
16
15
|
export type RoutingProfileId = keyof typeof routingProfiles;
|
|
17
16
|
export declare function resolvePersona(intent: PersonaIntent, profile?: RoutingProfile | RoutingProfileId): PersonaSelection;
|
|
18
|
-
/**
|
|
19
|
-
* Backward-compatible helper for callers that already selected a tier directly.
|
|
20
|
-
* Prefer resolvePersona(intent, profile) for policy-driven selection.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolvePersonaByTier(intent: PersonaIntent, tier?: PersonaTier): PersonaSelection;
|
|
23
17
|
/**
|
|
24
18
|
* Resolve a persona for `intent` and return a {@link PersonaContext}
|
|
25
19
|
* bundling the resolved persona and grouped install metadata.
|
|
@@ -42,14 +36,11 @@ export declare function resolvePersonaByTier(intent: PersonaIntent, tier?: Perso
|
|
|
42
36
|
*
|
|
43
37
|
* @param intent The internal persona intent to resolve (e.g. `'persona-authoring'`).
|
|
44
38
|
* @param options Optional overrides. `harness` forces a specific harness
|
|
45
|
-
* (otherwise inferred from the
|
|
46
|
-
* `
|
|
47
|
-
* directly (legacy path — prefer `profile`). `profile`
|
|
48
|
-
* selects the routing profile (defaults to `'default'`).
|
|
39
|
+
* (otherwise inferred from the persona's declared harness).
|
|
40
|
+
* `profile` selects the routing profile (defaults to `'default'`).
|
|
49
41
|
*/
|
|
50
42
|
export declare function usePersona(intent: PersonaIntent, options?: {
|
|
51
43
|
harness?: Harness;
|
|
52
|
-
tier?: PersonaTier;
|
|
53
44
|
profile?: RoutingProfile | RoutingProfileId;
|
|
54
45
|
/**
|
|
55
46
|
* Stage claude skills under this absolute directory instead of the
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,OAAO,EACZ,KAAK,cAAc,EAEnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEjB,MAAM,6BAA6B,CAAC;AASrC,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;CACpD;AAsCD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAGtE,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,WAAW,EAAE,CAInD;AAcD,eAAO,MAAM,eAAe;;CAElB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,eAAe,CAAC;AAE5D,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,GAAE,cAAc,GAAG,gBAA4B,GAAG,gBAAgB,CAoB9H;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACd,GACL,cAAc,CAQhB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,gBAAgB,EAC/B,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3E,cAAc,CAgChB;AAED,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepFreeze, isObject,
|
|
1
|
+
import { deepFreeze, isObject, materializeSkills, materializeSkillsFor, parsePersonaSpec, PERSONA_INTENTS, resolveSidecar, sidecarSelectionFields, buildInstallArtifacts, buildCleanupArtifacts } from '@agentworkforce/persona-kit';
|
|
2
2
|
import { personaImprover, personaMaker } from './generated/personas.js';
|
|
3
3
|
import defaultRoutingProfileJson from '../routing-profiles/default.json' with { type: 'json' };
|
|
4
4
|
function parseRoutingProfile(value, context) {
|
|
@@ -21,14 +21,11 @@ function parseRoutingProfile(value, context) {
|
|
|
21
21
|
if (!isObject(rule)) {
|
|
22
22
|
throw new Error(`${context}.intents.${intent} must be an object`);
|
|
23
23
|
}
|
|
24
|
-
const {
|
|
25
|
-
if (!isTier(tier)) {
|
|
26
|
-
throw new Error(`${context}.intents.${intent}.tier must be one of: ${PERSONA_TIERS.join(', ')}`);
|
|
27
|
-
}
|
|
24
|
+
const { rationale } = rule;
|
|
28
25
|
if (typeof rationale !== 'string' || !rationale.trim()) {
|
|
29
26
|
throw new Error(`${context}.intents.${intent}.rationale must be a non-empty string`);
|
|
30
27
|
}
|
|
31
|
-
parsedIntents[intent] = {
|
|
28
|
+
parsedIntents[intent] = { rationale };
|
|
32
29
|
}
|
|
33
30
|
return {
|
|
34
31
|
id,
|
|
@@ -61,8 +58,10 @@ export function resolvePersona(intent, profile = 'default') {
|
|
|
61
58
|
const spec = requireBuiltInPersona(intent);
|
|
62
59
|
return {
|
|
63
60
|
personaId: spec.id,
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
harness: spec.harness,
|
|
62
|
+
model: spec.model,
|
|
63
|
+
systemPrompt: spec.systemPrompt,
|
|
64
|
+
harnessSettings: spec.harnessSettings,
|
|
66
65
|
skills: spec.skills,
|
|
67
66
|
rationale: `${profileSpec.id}: ${rule.rationale}`,
|
|
68
67
|
...(spec.inputs ? { inputs: spec.inputs } : {}),
|
|
@@ -70,27 +69,7 @@ export function resolvePersona(intent, profile = 'default') {
|
|
|
70
69
|
...(spec.mcpServers ? { mcpServers: spec.mcpServers } : {}),
|
|
71
70
|
...(spec.permissions ? { permissions: spec.permissions } : {}),
|
|
72
71
|
...(spec.mount ? { mount: spec.mount } : {}),
|
|
73
|
-
...sidecarSelectionFields(resolveSidecar(spec
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Backward-compatible helper for callers that already selected a tier directly.
|
|
78
|
-
* Prefer resolvePersona(intent, profile) for policy-driven selection.
|
|
79
|
-
*/
|
|
80
|
-
export function resolvePersonaByTier(intent, tier = 'best-value') {
|
|
81
|
-
const spec = requireBuiltInPersona(intent);
|
|
82
|
-
return {
|
|
83
|
-
personaId: spec.id,
|
|
84
|
-
tier,
|
|
85
|
-
runtime: spec.tiers[tier],
|
|
86
|
-
skills: spec.skills,
|
|
87
|
-
rationale: `legacy-tier-override: ${tier}`,
|
|
88
|
-
...(spec.inputs ? { inputs: spec.inputs } : {}),
|
|
89
|
-
...(spec.env ? { env: spec.env } : {}),
|
|
90
|
-
...(spec.mcpServers ? { mcpServers: spec.mcpServers } : {}),
|
|
91
|
-
...(spec.permissions ? { permissions: spec.permissions } : {}),
|
|
92
|
-
...(spec.mount ? { mount: spec.mount } : {}),
|
|
93
|
-
...sidecarSelectionFields(resolveSidecar(spec, tier))
|
|
72
|
+
...sidecarSelectionFields(resolveSidecar(spec))
|
|
94
73
|
};
|
|
95
74
|
}
|
|
96
75
|
/**
|
|
@@ -115,15 +94,11 @@ export function resolvePersonaByTier(intent, tier = 'best-value') {
|
|
|
115
94
|
*
|
|
116
95
|
* @param intent The internal persona intent to resolve (e.g. `'persona-authoring'`).
|
|
117
96
|
* @param options Optional overrides. `harness` forces a specific harness
|
|
118
|
-
* (otherwise inferred from the
|
|
119
|
-
* `
|
|
120
|
-
* directly (legacy path — prefer `profile`). `profile`
|
|
121
|
-
* selects the routing profile (defaults to `'default'`).
|
|
97
|
+
* (otherwise inferred from the persona's declared harness).
|
|
98
|
+
* `profile` selects the routing profile (defaults to `'default'`).
|
|
122
99
|
*/
|
|
123
100
|
export function usePersona(intent, options = {}) {
|
|
124
|
-
const baseSelection = options.
|
|
125
|
-
? resolvePersonaByTier(intent, options.tier)
|
|
126
|
-
: resolvePersona(intent, options.profile ?? 'default');
|
|
101
|
+
const baseSelection = resolvePersona(intent, options.profile ?? 'default');
|
|
127
102
|
return useSelection(baseSelection, {
|
|
128
103
|
harness: options.harness,
|
|
129
104
|
installRoot: options.installRoot,
|
|
@@ -137,21 +112,15 @@ export function usePersona(intent, options = {}) {
|
|
|
137
112
|
* loaded from disk.
|
|
138
113
|
*/
|
|
139
114
|
export function useSelection(baseSelection, options = {}) {
|
|
140
|
-
const effectiveHarness = options.harness ?? baseSelection.
|
|
141
|
-
const selection = effectiveHarness === baseSelection.
|
|
115
|
+
const effectiveHarness = options.harness ?? baseSelection.harness;
|
|
116
|
+
const selection = effectiveHarness === baseSelection.harness
|
|
142
117
|
? baseSelection
|
|
143
|
-
: {
|
|
144
|
-
...baseSelection,
|
|
145
|
-
runtime: {
|
|
146
|
-
...baseSelection.runtime,
|
|
147
|
-
harness: effectiveHarness
|
|
148
|
-
}
|
|
149
|
-
};
|
|
118
|
+
: { ...baseSelection, harness: effectiveHarness };
|
|
150
119
|
const materializationOptions = {
|
|
151
120
|
...(options.installRoot !== undefined ? { installRoot: options.installRoot } : {}),
|
|
152
121
|
...(options.repoRoot !== undefined ? { repoRoot: options.repoRoot } : {})
|
|
153
122
|
};
|
|
154
|
-
const installPlan = effectiveHarness === baseSelection.
|
|
123
|
+
const installPlan = effectiveHarness === baseSelection.harness
|
|
155
124
|
? materializeSkillsFor(selection, materializationOptions)
|
|
156
125
|
: materializeSkills(selection.skills, effectiveHarness, materializationOptions);
|
|
157
126
|
const { installCommand, installCommandString } = buildInstallArtifacts(installPlan);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EAQtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,yBAAyB,MA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0B,MAAM,CAAC,MAAM,CAAC;QACzD,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,oBAAoB;QACnC,cAAc;QACd,oBAAoB;KACrB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,eAAe;QAC1B,OAAO,EAAE,aAAa;KACvB,CAAC,CAAC;AACL,CAAC;AAED,cAAc,WAAW,CAAC"}
|
package/dist/index.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
3
|
import { PERSONA_INTENTS, materializeSkillsFor } from '@agentworkforce/persona-kit';
|
|
4
|
-
import { listBuiltInPersonas, personaCatalog, resolvePersona,
|
|
4
|
+
import { listBuiltInPersonas, personaCatalog, resolvePersona, routingProfiles, usePersona, useSelection } from './index.js';
|
|
5
5
|
const prpmSkill = {
|
|
6
6
|
id: 'prpm/npm-trusted-publishing',
|
|
7
7
|
source: '@prpm/npm-trusted-publishing',
|
|
@@ -13,16 +13,12 @@ const skillShSkill = {
|
|
|
13
13
|
description: 'skill.sh discovery skill'
|
|
14
14
|
};
|
|
15
15
|
function syntheticSelection(over = {}) {
|
|
16
|
-
|
|
16
|
+
return {
|
|
17
|
+
personaId: 'synthetic',
|
|
17
18
|
harness: 'codex',
|
|
18
19
|
model: 'test-model',
|
|
19
20
|
systemPrompt: 'test prompt',
|
|
20
|
-
harnessSettings: { reasoning: 'medium', timeoutSeconds: 300 }
|
|
21
|
-
};
|
|
22
|
-
return {
|
|
23
|
-
personaId: 'synthetic',
|
|
24
|
-
tier: 'best-value',
|
|
25
|
-
runtime,
|
|
21
|
+
harnessSettings: { reasoning: 'medium', timeoutSeconds: 300 },
|
|
26
22
|
skills: [],
|
|
27
23
|
rationale: 'test',
|
|
28
24
|
...over
|
|
@@ -35,48 +31,24 @@ test('built-in catalog is limited to internal system personas', () => {
|
|
|
35
31
|
assert.equal(personaCatalog['persona-improvement']?.id, 'persona-improver');
|
|
36
32
|
assert.equal(personaCatalog.review, undefined);
|
|
37
33
|
assert.ok(PERSONA_INTENTS.includes('review'));
|
|
38
|
-
assert.
|
|
34
|
+
assert.ok(routingProfiles.default.intents.review.rationale.length > 0);
|
|
39
35
|
});
|
|
40
36
|
test('resolves persona-maker from the default routing profile', () => {
|
|
41
37
|
const selection = resolvePersona('persona-authoring');
|
|
42
38
|
assert.equal(selection.personaId, 'persona-maker');
|
|
43
|
-
assert.equal(selection.
|
|
44
|
-
assert.equal(selection.runtime.harness, 'codex');
|
|
39
|
+
assert.equal(selection.harness, 'opencode');
|
|
45
40
|
assert.match(selection.rationale, /balanced-default/);
|
|
46
41
|
assert.equal(selection.inputs?.TARGET_DIR?.default, '.agentworkforce/workforce/personas');
|
|
47
42
|
assert.equal(selection.inputs?.CREATE_MODE?.default, 'local');
|
|
48
43
|
assert.match(selection.agentsMdContent ?? '', /\$TARGET_DIR\/<id>\.json/);
|
|
49
|
-
assert.equal(selection.runtime.harnessSettings.sandboxMode, 'workspace-write');
|
|
50
|
-
assert.equal(selection.runtime.harnessSettings.approvalPolicy, 'on-request');
|
|
51
|
-
assert.equal(selection.runtime.harnessSettings.workspaceWriteNetworkAccess, true);
|
|
52
|
-
assert.match(selection.agentsMdContent ?? '', /Do not request network escalation only to complete this fallback/);
|
|
53
44
|
});
|
|
54
45
|
test('optional pack-owned intents do not resolve from the built-in catalog', () => {
|
|
55
46
|
assert.throws(() => resolvePersona('review'), /No built-in persona is registered for intent "review".*personas-core/);
|
|
56
|
-
assert.throws(() => resolvePersonaByTier('review', 'best'), /No built-in persona is registered for intent "review"/);
|
|
57
|
-
});
|
|
58
|
-
test('legacy tier override remains available for internal personas', () => {
|
|
59
|
-
const selection = resolvePersonaByTier('persona-authoring', 'minimum');
|
|
60
|
-
assert.equal(selection.personaId, 'persona-maker');
|
|
61
|
-
assert.equal(selection.tier, 'minimum');
|
|
62
|
-
assert.equal(selection.runtime.harness, 'opencode');
|
|
63
|
-
assert.match(selection.rationale, /legacy-tier-override/);
|
|
64
47
|
});
|
|
65
48
|
test('materializeSkillsFor derives an install plan from a resolved internal persona', () => {
|
|
66
49
|
const selection = resolvePersona('persona-authoring');
|
|
67
50
|
const plan = materializeSkillsFor(selection);
|
|
68
|
-
assert.equal(plan.harness,
|
|
69
|
-
assert.equal(plan.installs.length, 1);
|
|
70
|
-
assert.deepEqual([...plan.installs[0].installCommand], [
|
|
71
|
-
'npx',
|
|
72
|
-
'-y',
|
|
73
|
-
'skills',
|
|
74
|
-
'add',
|
|
75
|
-
'https://github.com/vercel-labs/skills',
|
|
76
|
-
'--skill',
|
|
77
|
-
'find-skills',
|
|
78
|
-
'-y'
|
|
79
|
-
]);
|
|
51
|
+
assert.equal(plan.harness, selection.harness);
|
|
80
52
|
});
|
|
81
53
|
test('useSelection install command never embeds cleanup', () => {
|
|
82
54
|
const context = useSelection(syntheticSelection({ skills: [prpmSkill] }));
|
|
@@ -147,9 +119,6 @@ test('usePersona combines selection and grouped install metadata into a frozen c
|
|
|
147
119
|
assert.ok(Object.isFrozen(context.install.plan));
|
|
148
120
|
assert.ok(Object.isFrozen(context.install.command));
|
|
149
121
|
});
|
|
150
|
-
test('PersonaSpec catalog leaves defaultTier unset for built-ins', () => {
|
|
151
|
-
assert.equal(personaCatalog['persona-authoring']?.defaultTier, undefined);
|
|
152
|
-
});
|
|
153
122
|
test('resolvePersona populates sidecar selection fields from the internal catalog', () => {
|
|
154
123
|
const sel = resolvePersona('persona-authoring');
|
|
155
124
|
assert.equal(sel.claudeMd, undefined);
|
package/dist/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,eAAe,EACf,oBAAoB,EAErB,MA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AAC;IAC5C,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6EAA6E,EAAE,GAAG,EAAE;IACvF,MAAM,GAAG,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACtC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACtC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAC1D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentworkforce/workload-router",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"url": "https://github.com/AgentWorkforce/workforce"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agentworkforce/persona-kit": "
|
|
26
|
+
"@agentworkforce/persona-kit": "3.0.1"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./schema.json",
|
|
3
3
|
"id": "balanced-default",
|
|
4
|
-
"description": "Default routing policy
|
|
4
|
+
"description": "Default routing policy attaching a rationale string to every persona intent.",
|
|
5
5
|
"intents": {
|
|
6
|
-
"implement-frontend": {"
|
|
7
|
-
"review": {"
|
|
8
|
-
"architecture-plan": {"
|
|
9
|
-
"requirements-analysis": {"
|
|
10
|
-
"debugging": {"
|
|
11
|
-
"security-review": {"
|
|
12
|
-
"documentation": {"
|
|
13
|
-
"verification": {"
|
|
14
|
-
"test-strategy": {"
|
|
15
|
-
"tdd-enforcement": {"
|
|
16
|
-
"flake-investigation": {"
|
|
17
|
-
"opencode-workflow-correctness": {"
|
|
18
|
-
"npm-provenance": {"
|
|
19
|
-
"cloud-sandbox-infra": {"
|
|
20
|
-
"sage-slack-egress-migration": {"
|
|
21
|
-
"sage-proactive-rewire": {"
|
|
22
|
-
"cloud-slack-proxy-guard": {"
|
|
23
|
-
"sage-cloud-e2e-conduction": {"
|
|
24
|
-
"capability-discovery": {"
|
|
25
|
-
"npm-package-compat": {"
|
|
26
|
-
"posthog": {"
|
|
27
|
-
"persona-authoring": {"
|
|
28
|
-
"persona-improvement": {"
|
|
29
|
-
"slop-audit": {"
|
|
30
|
-
"api-contract-review": {"
|
|
31
|
-
"local-stack-orchestration": {"
|
|
32
|
-
"e2e-validation": {"
|
|
33
|
-
"write-integration-tests": {"
|
|
34
|
-
"agent-relay-workflow": {"
|
|
35
|
-
"relay-orchestrator": {"
|
|
6
|
+
"implement-frontend": {"rationale": "Most frontend tasks are iterative and benefit from strong quality-per-dollar defaults."},
|
|
7
|
+
"review": {"rationale": "Code review usually needs careful reasoning without always requiring max-cost models."},
|
|
8
|
+
"architecture-plan": {"rationale": "Architecture decisions are high leverage; prioritize depth and stronger reasoning."},
|
|
9
|
+
"requirements-analysis": {"rationale": "Most scope clarification work benefits from careful synthesis without needing the slowest tier by default."},
|
|
10
|
+
"debugging": {"rationale": "Root-cause debugging is expensive when wrong; default to deeper reasoning and stronger verification."},
|
|
11
|
+
"security-review": {"rationale": "Security review has asymmetric downside; favor deeper analysis on default policy."},
|
|
12
|
+
"documentation": {"rationale": "Most docs work benefits from solid code-grounded synthesis without always needing the top tier."},
|
|
13
|
+
"verification": {"rationale": "Completion checks need disciplined evidence review, but usually not the most expensive model."},
|
|
14
|
+
"test-strategy": {"rationale": "Test planning benefits from strong reasoning, but usually does not require the slowest or most expensive tier."},
|
|
15
|
+
"tdd-enforcement": {"rationale": "TDD coaching needs reliable process enforcement and concise feedback more than maximum-depth output."},
|
|
16
|
+
"flake-investigation": {"rationale": "Intermittent failures are expensive and subtle; prioritize deeper reasoning for reproduction and root-cause analysis."},
|
|
17
|
+
"opencode-workflow-correctness": {"rationale": "Cross-layer opencode workflow failures are expensive to misdiagnose; default to the deepest tier for end-to-end reproduction and root-cause analysis."},
|
|
18
|
+
"npm-provenance": {"rationale": "Publishing setup is mostly mechanical workflow configuration; best-value is sufficient when guided by the prpm/npm-trusted-publishing skill."},
|
|
19
|
+
"cloud-sandbox-infra": {"rationale": "Cloud infrastructure changes (sandbox provisioning, credential handling, session durability) have high blast radius; prioritize deeper reasoning and thorough verification."},
|
|
20
|
+
"sage-slack-egress-migration": {"rationale": "Slack egress migration work is mostly mechanical integration plumbing, so best-value is the default tradeoff."},
|
|
21
|
+
"sage-proactive-rewire": {"rationale": "Proactive rewiring is configuration-heavy coordination work that usually does not need the highest-cost tier by default."},
|
|
22
|
+
"cloud-slack-proxy-guard": {"rationale": "Proxy guard updates are typically policy and wiring checks, so best-value is a sensible default tier."},
|
|
23
|
+
"sage-cloud-e2e-conduction": {"rationale": "End-to-end conduction is orchestration-heavy work where strong reasoning is useful without requiring the top tier by default."},
|
|
24
|
+
"capability-discovery": {"rationale": "Searching skill.sh and prpm.dev for existing skills, agents, and hooks is lightweight research; the balanced default is sufficient when guided by the skill.sh/find-skills and @prpm/self-improving skills."},
|
|
25
|
+
"npm-package-compat": {"rationale": "Package.json audits are mostly mechanical checks against known rules; best-value provides sufficient reasoning for catching misconfigurations."},
|
|
26
|
+
"posthog": {"rationale": "PostHog queries are interactive analytics lookups; best-value is sufficient and keeps latency low when chatting with the MCP server."},
|
|
27
|
+
"persona-authoring": {"rationale": "New personas must satisfy a fixed conventions checklist before they typecheck; missing any step ships a broken routing entry, so depth over speed is the right default."},
|
|
28
|
+
"persona-improvement": {"rationale": "Mining a finished session for high-leverage persona edits is constrained pattern matching against a fixed schema; best-value reasoning is sufficient and keeps the post-session prompt latency low."},
|
|
29
|
+
"slop-audit": {"rationale": "Slop auditing reads across a diff or subtree and classifies findings into a multi-category taxonomy; missed slop ships unchanged, so depth over speed is the right default."},
|
|
30
|
+
"api-contract-review": {"rationale": "Contract review catches silent breaking changes between deployed services; missing a discriminant collision or enum widening ships incidents, so depth over speed is the right default."},
|
|
31
|
+
"local-stack-orchestration": {"rationale": "Compose authoring is mostly mechanical wiring once the topology is known; best-value is sufficient when guided by explicit healthcheck and pinning rules."},
|
|
32
|
+
"e2e-validation": {"rationale": "End-to-end validation is the last line of defense before merge; missing a hop-level divergence ships broken behavior, so depth over speed is the right default."},
|
|
33
|
+
"write-integration-tests": {"rationale": "Integration test authoring follows a fixed template (real substitute, wire-shape assertions, failure modes); best-value reasoning is sufficient when guided by the template."},
|
|
34
|
+
"agent-relay-workflow": {"rationale": "new agent-relay-workflow capability requiring balanced reasoning and tooling"},
|
|
35
|
+
"relay-orchestrator": {"rationale": "Relay orchestrator coordinates agent spawning with balanced reasoning and fast path for first-turn orchestration."}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -46,13 +46,9 @@
|
|
|
46
46
|
"definitions": {
|
|
47
47
|
"rule": {
|
|
48
48
|
"type": "object",
|
|
49
|
-
"required": ["
|
|
49
|
+
"required": ["rationale"],
|
|
50
50
|
"additionalProperties": false,
|
|
51
51
|
"properties": {
|
|
52
|
-
"tier": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"enum": ["best", "best-value", "minimum"]
|
|
55
|
-
},
|
|
56
52
|
"rationale": { "type": "string", "minLength": 1 }
|
|
57
53
|
}
|
|
58
54
|
}
|